vendor.js 716 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328
  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'];
  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. /***/ 114:
  76. /*!***************************************************!*\
  77. !*** E:/work/Project_newGit/CKQ/app/api/index.js ***!
  78. \***************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. "use strict";
  82. /* WEBPACK VAR INJECTION */(function(uni) {
  83. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  84. Object.defineProperty(exports, "__esModule", {
  85. value: true
  86. });
  87. exports.upload = void 0;
  88. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  89. var _auth = __webpack_require__(/*! @/libs/auth.js */ 45);
  90. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 44));
  91. var upload = function upload(_ref) {
  92. var formData = _ref.formData,
  93. filePath = _ref.filePath,
  94. callback = _ref.callback;
  95. return new Promise(function (resolve, reject) {
  96. var uploadTask = uni.uploadFile({
  97. url: _index.default.uploadFile + '/admin/uploadFile',
  98. filePath: filePath,
  99. header: (0, _defineProperty2.default)({}, _index.default.TokenKey, (0, _auth.getToken)()),
  100. name: 'file',
  101. formData: formData,
  102. success: function success(uploadFileRes) {
  103. resolve(uploadFileRes.data);
  104. },
  105. fail: function fail(_ref2) {
  106. var errMsg = _ref2.errMsg;
  107. reject(errMsg);
  108. }
  109. });
  110. if (callback) {
  111. callback(uploadTask);
  112. }
  113. });
  114. };
  115. exports.upload = upload;
  116. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  117. /***/ }),
  118. /***/ 115:
  119. /*!**********************************************************!*\
  120. !*** E:/work/Project_newGit/CKQ/app/api/system/wfApi.js ***!
  121. \**********************************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports, __webpack_require__) {
  124. "use strict";
  125. Object.defineProperty(exports, "__esModule", {
  126. value: true
  127. });
  128. exports.cancelWorkflow = cancelWorkflow;
  129. exports.completeWorkflow = completeWorkflow;
  130. exports.getWorkflowById = getWorkflowById;
  131. exports.handleWorkflow = handleWorkflow;
  132. exports.startWorkflow = startWorkflow;
  133. exports.transferWorkflow = transferWorkflow;
  134. var _request = __webpack_require__(/*! @/libs/request.js */ 40);
  135. /**
  136. * 启动Workflow
  137. * @param wfDefId
  138. * @returns
  139. */
  140. function startWorkflow(wfDefId) {
  141. return (0, _request.request)({
  142. url: "/wf/start/".concat(wfDefId),
  143. method: 'GET'
  144. });
  145. }
  146. function getWorkflowById(wfInsId) {
  147. return (0, _request.request)({
  148. url: "/wf/getIns/".concat(wfInsId),
  149. method: 'GET'
  150. });
  151. }
  152. /**
  153. * 处理
  154. * @param data
  155. * @returns
  156. */
  157. function handleWorkflow(data) {
  158. return (0, _request.request)({
  159. url: "/wf/handle",
  160. method: 'POST',
  161. data: data
  162. });
  163. }
  164. /**
  165. * 移交
  166. * @param data
  167. * @returns
  168. */
  169. function transferWorkflow(data) {
  170. return (0, _request.request)({
  171. url: "/wf/transfer",
  172. method: 'POST',
  173. data: data
  174. });
  175. }
  176. /**
  177. * 完成
  178. * @param wfInsId
  179. * @returns
  180. */
  181. function completeWorkflow(wfInsId) {
  182. return (0, _request.request)({
  183. url: "/wf/complete/".concat(wfInsId),
  184. method: 'GET'
  185. });
  186. }
  187. /**
  188. * 撤消
  189. * @param wfInsId
  190. * @returns
  191. */
  192. function cancelWorkflow(wfInsId) {
  193. return (0, _request.request)({
  194. url: "/wf/cancel/".concat(wfInsId),
  195. method: 'GET'
  196. });
  197. }
  198. /***/ }),
  199. /***/ 12:
  200. /*!**************************************************************!*\
  201. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  202. \**************************************************************/
  203. /*! no static exports found */
  204. /***/ (function(module, exports, __webpack_require__) {
  205. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  206. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  207. function _toPropertyKey(arg) {
  208. var key = toPrimitive(arg, "string");
  209. return _typeof(key) === "symbol" ? key : String(key);
  210. }
  211. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  212. /***/ }),
  213. /***/ 13:
  214. /*!*******************************************************!*\
  215. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  216. \*******************************************************/
  217. /*! no static exports found */
  218. /***/ (function(module, exports) {
  219. function _typeof(obj) {
  220. "@babel/helpers - typeof";
  221. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  222. return typeof obj;
  223. } : function (obj) {
  224. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  225. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  226. }
  227. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  228. /***/ }),
  229. /***/ 14:
  230. /*!************************************************************!*\
  231. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  232. \************************************************************/
  233. /*! no static exports found */
  234. /***/ (function(module, exports, __webpack_require__) {
  235. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  236. function _toPrimitive(input, hint) {
  237. if (_typeof(input) !== "object" || input === null) return input;
  238. var prim = input[Symbol.toPrimitive];
  239. if (prim !== undefined) {
  240. var res = prim.call(input, hint || "default");
  241. if (_typeof(res) !== "object") return res;
  242. throw new TypeError("@@toPrimitive must return a primitive value.");
  243. }
  244. return (hint === "string" ? String : Number)(input);
  245. }
  246. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  247. /***/ }),
  248. /***/ 15:
  249. /*!**********************************************************!*\
  250. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  251. \**********************************************************/
  252. /*! no static exports found */
  253. /***/ (function(module, exports, __webpack_require__) {
  254. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  255. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  256. function _construct(Parent, args, Class) {
  257. if (isNativeReflectConstruct()) {
  258. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  259. } else {
  260. module.exports = _construct = function _construct(Parent, args, Class) {
  261. var a = [null];
  262. a.push.apply(a, args);
  263. var Constructor = Function.bind.apply(Parent, a);
  264. var instance = new Constructor();
  265. if (Class) setPrototypeOf(instance, Class.prototype);
  266. return instance;
  267. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  268. }
  269. return _construct.apply(null, arguments);
  270. }
  271. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  272. /***/ }),
  273. /***/ 16:
  274. /*!***************************************************************!*\
  275. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  276. \***************************************************************/
  277. /*! no static exports found */
  278. /***/ (function(module, exports) {
  279. function _setPrototypeOf(o, p) {
  280. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  281. o.__proto__ = p;
  282. return o;
  283. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  284. return _setPrototypeOf(o, p);
  285. }
  286. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  287. /***/ }),
  288. /***/ 167:
  289. /*!***************************************************!*\
  290. !*** E:/work/Project_newGit/CKQ/app/api/check.js ***!
  291. \***************************************************/
  292. /*! no static exports found */
  293. /***/ (function(module, exports, __webpack_require__) {
  294. "use strict";
  295. Object.defineProperty(exports, "__esModule", {
  296. value: true
  297. });
  298. exports.createChecklist = createChecklist;
  299. exports.createChecklistItem = createChecklistItem;
  300. exports.deleteChecklistById = deleteChecklistById;
  301. exports.deleteChecklistItemById = deleteChecklistItemById;
  302. exports.getChecklist = getChecklist;
  303. exports.getChecklistById = getChecklistById;
  304. exports.getChecklistByPage = getChecklistByPage;
  305. exports.getChecklistItemById = getChecklistItemById;
  306. exports.updateChecklist = updateChecklist;
  307. exports.updateChecklistItem = updateChecklistItem;
  308. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  309. // 获取所有检查表及其内容
  310. function getChecklist(params) {
  311. return (0, _request.request)({
  312. url: '/goaf/goafChecklist/list',
  313. params: params
  314. });
  315. }
  316. // 分页获取所有检查表及其内容
  317. function getChecklistByPage(params) {
  318. return (0, _request.request)({
  319. url: '/goaf/goafChecklist/page',
  320. params: params
  321. });
  322. }
  323. // 获取指定的检查表及其内容
  324. function getChecklistById(goafchecklistId) {
  325. return (0, _request.request)({
  326. url: "/goaf/goafChecklist/".concat(goafchecklistId)
  327. });
  328. }
  329. // 获取指定的检查项
  330. function getChecklistItemById(goafchecklistId) {
  331. return (0, _request.request)({
  332. url: "/goaf/goafChecklist/checklistitem/".concat(goafchecklistId)
  333. });
  334. }
  335. // 增加检查表及其内容
  336. function createChecklist(data) {
  337. return (0, _request.request)({
  338. url: '/goaf/goafChecklist/add',
  339. method: 'POST',
  340. data: data
  341. });
  342. }
  343. // 更新
  344. function updateChecklist(data) {
  345. return (0, _request.request)({
  346. url: '/goaf/goafChecklist/update',
  347. method: 'PUT',
  348. data: data
  349. });
  350. }
  351. // 删除指定检查表
  352. function deleteChecklistById(goafchecklistId) {
  353. return (0, _request.request)({
  354. url: "/goaf/goafChecklist/deletechecklist/".concat(goafchecklistId),
  355. method: 'DELETE'
  356. });
  357. }
  358. // .删除指定检查表的某项内容
  359. function deleteChecklistItemById(goafchecklistitemid) {
  360. return (0, _request.request)({
  361. url: "/goaf/goafChecklist/deletecheckitemlist/".concat(goafchecklistitemid),
  362. method: 'DELETE'
  363. });
  364. }
  365. // 增加检查表及其内容
  366. function createChecklistItem(data) {
  367. return (0, _request.request)({
  368. url: '/goaf/goafChecklist/add',
  369. method: 'POST',
  370. data: data
  371. });
  372. }
  373. // 更新
  374. function updateChecklistItem(data) {
  375. return (0, _request.request)({
  376. url: '/goaf/goafChecklist/update',
  377. method: 'PUT',
  378. data: data
  379. });
  380. }
  381. /***/ }),
  382. /***/ 17:
  383. /*!*************************************************************************!*\
  384. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  385. \*************************************************************************/
  386. /*! no static exports found */
  387. /***/ (function(module, exports) {
  388. function _isNativeReflectConstruct() {
  389. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  390. if (Reflect.construct.sham) return false;
  391. if (typeof Proxy === "function") return true;
  392. try {
  393. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  394. return true;
  395. } catch (e) {
  396. return false;
  397. }
  398. }
  399. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  400. /***/ }),
  401. /***/ 18:
  402. /*!******************************************************************!*\
  403. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  404. \******************************************************************/
  405. /*! no static exports found */
  406. /***/ (function(module, exports, __webpack_require__) {
  407. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  408. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  409. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  410. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  411. function _toConsumableArray(arr) {
  412. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  413. }
  414. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  415. /***/ }),
  416. /***/ 183:
  417. /*!*********************************************************************************************!*\
  418. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  419. \*********************************************************************************************/
  420. /*! no static exports found */
  421. /***/ (function(module, exports, __webpack_require__) {
  422. "use strict";
  423. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  424. Object.defineProperty(exports, "__esModule", {
  425. value: true
  426. });
  427. exports.default = void 0;
  428. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  429. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 184));
  430. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 185));
  431. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 187));
  432. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  433. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  434. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  435. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  436. 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); }; }
  437. 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; } }
  438. var pattern = {
  439. email: /^\S+?@\S+?\.\S+?$/,
  440. 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]$/,
  441. 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')
  442. };
  443. var FORMAT_MAPPING = {
  444. "int": 'integer',
  445. "bool": 'boolean',
  446. "double": 'number',
  447. "long": 'number',
  448. "password": 'string'
  449. // "fileurls": 'array'
  450. };
  451. function formatMessage(args) {
  452. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  453. var defaultMessage = ['label'];
  454. defaultMessage.forEach(function (item) {
  455. if (args[item] === undefined) {
  456. args[item] = '';
  457. }
  458. });
  459. var str = resources;
  460. for (var key in args) {
  461. var reg = new RegExp('{' + key + '}');
  462. str = str.replace(reg, args[key]);
  463. }
  464. return str;
  465. }
  466. function isEmptyValue(value, type) {
  467. if (value === undefined || value === null) {
  468. return true;
  469. }
  470. if (typeof value === 'string' && !value) {
  471. return true;
  472. }
  473. if (Array.isArray(value) && !value.length) {
  474. return true;
  475. }
  476. if (type === 'object' && !Object.keys(value).length) {
  477. return true;
  478. }
  479. return false;
  480. }
  481. var types = {
  482. integer: function integer(value) {
  483. return types.number(value) && parseInt(value, 10) === value;
  484. },
  485. string: function string(value) {
  486. return typeof value === 'string';
  487. },
  488. number: function number(value) {
  489. if (isNaN(value)) {
  490. return false;
  491. }
  492. return typeof value === 'number';
  493. },
  494. "boolean": function boolean(value) {
  495. return typeof value === 'boolean';
  496. },
  497. "float": function float(value) {
  498. return types.number(value) && !types.integer(value);
  499. },
  500. array: function array(value) {
  501. return Array.isArray(value);
  502. },
  503. object: function object(value) {
  504. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  505. },
  506. date: function date(value) {
  507. return value instanceof Date;
  508. },
  509. timestamp: function timestamp(value) {
  510. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  511. return false;
  512. }
  513. return true;
  514. },
  515. file: function file(value) {
  516. return typeof value.url === 'string';
  517. },
  518. email: function email(value) {
  519. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  520. },
  521. url: function url(value) {
  522. return typeof value === 'string' && !!value.match(pattern.url);
  523. },
  524. pattern: function pattern(reg, value) {
  525. try {
  526. return new RegExp(reg).test(value);
  527. } catch (e) {
  528. return false;
  529. }
  530. },
  531. method: function method(value) {
  532. return typeof value === 'function';
  533. },
  534. idcard: function idcard(value) {
  535. return typeof value === 'string' && !!value.match(pattern.idcard);
  536. },
  537. 'url-https': function urlHttps(value) {
  538. return this.url(value) && value.startsWith('https://');
  539. },
  540. 'url-scheme': function urlScheme(value) {
  541. return value.startsWith('://');
  542. },
  543. 'url-web': function urlWeb(value) {
  544. return false;
  545. }
  546. };
  547. var RuleValidator = /*#__PURE__*/function () {
  548. function RuleValidator(message) {
  549. (0, _classCallCheck2.default)(this, RuleValidator);
  550. this._message = message;
  551. }
  552. (0, _createClass2.default)(RuleValidator, [{
  553. key: "validateRule",
  554. value: function () {
  555. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  556. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  557. return _regenerator.default.wrap(function _callee$(_context) {
  558. while (1) {
  559. switch (_context.prev = _context.next) {
  560. case 0:
  561. result = null;
  562. rules = fieldValue.rules;
  563. hasRequired = rules.findIndex(function (item) {
  564. return item.required;
  565. });
  566. if (!(hasRequired < 0)) {
  567. _context.next = 8;
  568. break;
  569. }
  570. if (!(value === null || value === undefined)) {
  571. _context.next = 6;
  572. break;
  573. }
  574. return _context.abrupt("return", result);
  575. case 6:
  576. if (!(typeof value === 'string' && !value.length)) {
  577. _context.next = 8;
  578. break;
  579. }
  580. return _context.abrupt("return", result);
  581. case 8:
  582. message = this._message;
  583. if (!(rules === undefined)) {
  584. _context.next = 11;
  585. break;
  586. }
  587. return _context.abrupt("return", message['default']);
  588. case 11:
  589. i = 0;
  590. case 12:
  591. if (!(i < rules.length)) {
  592. _context.next = 35;
  593. break;
  594. }
  595. rule = rules[i];
  596. vt = this._getValidateType(rule);
  597. Object.assign(rule, {
  598. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  599. });
  600. if (!RuleValidatorHelper[vt]) {
  601. _context.next = 20;
  602. break;
  603. }
  604. result = RuleValidatorHelper[vt](rule, value, message);
  605. if (!(result != null)) {
  606. _context.next = 20;
  607. break;
  608. }
  609. return _context.abrupt("break", 35);
  610. case 20:
  611. if (!rule.validateExpr) {
  612. _context.next = 26;
  613. break;
  614. }
  615. now = Date.now();
  616. resultExpr = rule.validateExpr(value, allData, now);
  617. if (!(resultExpr === false)) {
  618. _context.next = 26;
  619. break;
  620. }
  621. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  622. return _context.abrupt("break", 35);
  623. case 26:
  624. if (!rule.validateFunction) {
  625. _context.next = 32;
  626. break;
  627. }
  628. _context.next = 29;
  629. return this.validateFunction(rule, value, data, allData, vt);
  630. case 29:
  631. result = _context.sent;
  632. if (!(result !== null)) {
  633. _context.next = 32;
  634. break;
  635. }
  636. return _context.abrupt("break", 35);
  637. case 32:
  638. i++;
  639. _context.next = 12;
  640. break;
  641. case 35:
  642. if (result !== null) {
  643. result = message.TAG + result;
  644. }
  645. return _context.abrupt("return", result);
  646. case 37:
  647. case "end":
  648. return _context.stop();
  649. }
  650. }
  651. }, _callee, this);
  652. }));
  653. function validateRule(_x, _x2, _x3, _x4, _x5) {
  654. return _validateRule.apply(this, arguments);
  655. }
  656. return validateRule;
  657. }()
  658. }, {
  659. key: "validateFunction",
  660. value: function () {
  661. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  662. var result, callbackMessage, res;
  663. return _regenerator.default.wrap(function _callee2$(_context2) {
  664. while (1) {
  665. switch (_context2.prev = _context2.next) {
  666. case 0:
  667. result = null;
  668. _context2.prev = 1;
  669. callbackMessage = null;
  670. _context2.next = 5;
  671. return rule.validateFunction(rule, value, allData || data, function (message) {
  672. callbackMessage = message;
  673. });
  674. case 5:
  675. res = _context2.sent;
  676. if (callbackMessage || typeof res === 'string' && res || res === false) {
  677. result = this._getMessage(rule, callbackMessage || res, vt);
  678. }
  679. _context2.next = 12;
  680. break;
  681. case 9:
  682. _context2.prev = 9;
  683. _context2.t0 = _context2["catch"](1);
  684. result = this._getMessage(rule, _context2.t0.message, vt);
  685. case 12:
  686. return _context2.abrupt("return", result);
  687. case 13:
  688. case "end":
  689. return _context2.stop();
  690. }
  691. }
  692. }, _callee2, this, [[1, 9]]);
  693. }));
  694. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  695. return _validateFunction.apply(this, arguments);
  696. }
  697. return validateFunction;
  698. }()
  699. }, {
  700. key: "_getMessage",
  701. value: function _getMessage(rule, message, vt) {
  702. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  703. }
  704. }, {
  705. key: "_getValidateType",
  706. value: function _getValidateType(rule) {
  707. var result = '';
  708. if (rule.required) {
  709. result = 'required';
  710. } else if (rule.format) {
  711. result = 'format';
  712. } else if (rule.arrayType) {
  713. result = 'arrayTypeFormat';
  714. } else if (rule.range) {
  715. result = 'range';
  716. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  717. result = 'rangeNumber';
  718. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  719. result = 'rangeLength';
  720. } else if (rule.pattern) {
  721. result = 'pattern';
  722. } else if (rule.validateFunction) {
  723. result = 'validateFunction';
  724. }
  725. return result;
  726. }
  727. }]);
  728. return RuleValidator;
  729. }();
  730. var RuleValidatorHelper = {
  731. required: function required(rule, value, message) {
  732. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  733. return formatMessage(rule, rule.errorMessage || message.required);
  734. }
  735. return null;
  736. },
  737. range: function range(rule, value, message) {
  738. var range = rule.range,
  739. errorMessage = rule.errorMessage;
  740. var list = new Array(range.length);
  741. for (var i = 0; i < range.length; i++) {
  742. var item = range[i];
  743. if (types.object(item) && item.value !== undefined) {
  744. list[i] = item.value;
  745. } else {
  746. list[i] = item;
  747. }
  748. }
  749. var result = false;
  750. if (Array.isArray(value)) {
  751. result = new Set(value.concat(list)).size === list.length;
  752. } else {
  753. if (list.indexOf(value) > -1) {
  754. result = true;
  755. }
  756. }
  757. if (!result) {
  758. return formatMessage(rule, errorMessage || message['enum']);
  759. }
  760. return null;
  761. },
  762. rangeNumber: function rangeNumber(rule, value, message) {
  763. if (!types.number(value)) {
  764. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  765. }
  766. var minimum = rule.minimum,
  767. maximum = rule.maximum,
  768. exclusiveMinimum = rule.exclusiveMinimum,
  769. exclusiveMaximum = rule.exclusiveMaximum;
  770. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  771. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  772. if (minimum !== undefined && min) {
  773. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  774. } else if (maximum !== undefined && max) {
  775. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  776. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  777. return formatMessage(rule, rule.errorMessage || message['number'].range);
  778. }
  779. return null;
  780. },
  781. rangeLength: function rangeLength(rule, value, message) {
  782. if (!types.string(value) && !types.array(value)) {
  783. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  784. }
  785. var min = rule.minLength;
  786. var max = rule.maxLength;
  787. var val = value.length;
  788. if (min !== undefined && val < min) {
  789. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  790. } else if (max !== undefined && val > max) {
  791. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  792. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  793. return formatMessage(rule, rule.errorMessage || message['length'].range);
  794. }
  795. return null;
  796. },
  797. pattern: function pattern(rule, value, message) {
  798. if (!types['pattern'](rule.pattern, value)) {
  799. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  800. }
  801. return null;
  802. },
  803. format: function format(rule, value, message) {
  804. var customTypes = Object.keys(types);
  805. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  806. if (customTypes.indexOf(format) > -1) {
  807. if (!types[format](value)) {
  808. return formatMessage(rule, rule.errorMessage || message.typeError);
  809. }
  810. }
  811. return null;
  812. },
  813. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  814. if (!Array.isArray(value)) {
  815. return formatMessage(rule, rule.errorMessage || message.typeError);
  816. }
  817. for (var i = 0; i < value.length; i++) {
  818. var element = value[i];
  819. var formatResult = this.format(rule, element, message);
  820. if (formatResult !== null) {
  821. return formatResult;
  822. }
  823. }
  824. return null;
  825. }
  826. };
  827. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  828. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  829. var _super = _createSuper(SchemaValidator);
  830. function SchemaValidator(schema, options) {
  831. var _this;
  832. (0, _classCallCheck2.default)(this, SchemaValidator);
  833. _this = _super.call(this, SchemaValidator.message);
  834. _this._schema = schema;
  835. _this._options = options || null;
  836. return _this;
  837. }
  838. (0, _createClass2.default)(SchemaValidator, [{
  839. key: "updateSchema",
  840. value: function updateSchema(schema) {
  841. this._schema = schema;
  842. }
  843. }, {
  844. key: "validate",
  845. value: function () {
  846. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  847. var result;
  848. return _regenerator.default.wrap(function _callee3$(_context3) {
  849. while (1) {
  850. switch (_context3.prev = _context3.next) {
  851. case 0:
  852. result = this._checkFieldInSchema(data);
  853. if (result) {
  854. _context3.next = 5;
  855. break;
  856. }
  857. _context3.next = 4;
  858. return this.invokeValidate(data, false, allData);
  859. case 4:
  860. result = _context3.sent;
  861. case 5:
  862. return _context3.abrupt("return", result.length ? result[0] : null);
  863. case 6:
  864. case "end":
  865. return _context3.stop();
  866. }
  867. }
  868. }, _callee3, this);
  869. }));
  870. function validate(_x11, _x12) {
  871. return _validate.apply(this, arguments);
  872. }
  873. return validate;
  874. }()
  875. }, {
  876. key: "validateAll",
  877. value: function () {
  878. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  879. var result;
  880. return _regenerator.default.wrap(function _callee4$(_context4) {
  881. while (1) {
  882. switch (_context4.prev = _context4.next) {
  883. case 0:
  884. result = this._checkFieldInSchema(data);
  885. if (result) {
  886. _context4.next = 5;
  887. break;
  888. }
  889. _context4.next = 4;
  890. return this.invokeValidate(data, true, allData);
  891. case 4:
  892. result = _context4.sent;
  893. case 5:
  894. return _context4.abrupt("return", result);
  895. case 6:
  896. case "end":
  897. return _context4.stop();
  898. }
  899. }
  900. }, _callee4, this);
  901. }));
  902. function validateAll(_x13, _x14) {
  903. return _validateAll.apply(this, arguments);
  904. }
  905. return validateAll;
  906. }()
  907. }, {
  908. key: "validateUpdate",
  909. value: function () {
  910. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  911. var result;
  912. return _regenerator.default.wrap(function _callee5$(_context5) {
  913. while (1) {
  914. switch (_context5.prev = _context5.next) {
  915. case 0:
  916. result = this._checkFieldInSchema(data);
  917. if (result) {
  918. _context5.next = 5;
  919. break;
  920. }
  921. _context5.next = 4;
  922. return this.invokeValidateUpdate(data, false, allData);
  923. case 4:
  924. result = _context5.sent;
  925. case 5:
  926. return _context5.abrupt("return", result.length ? result[0] : null);
  927. case 6:
  928. case "end":
  929. return _context5.stop();
  930. }
  931. }
  932. }, _callee5, this);
  933. }));
  934. function validateUpdate(_x15, _x16) {
  935. return _validateUpdate.apply(this, arguments);
  936. }
  937. return validateUpdate;
  938. }()
  939. }, {
  940. key: "invokeValidate",
  941. value: function () {
  942. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  943. var result, schema, key, value, errorMessage;
  944. return _regenerator.default.wrap(function _callee6$(_context6) {
  945. while (1) {
  946. switch (_context6.prev = _context6.next) {
  947. case 0:
  948. result = [];
  949. schema = this._schema;
  950. _context6.t0 = _regenerator.default.keys(schema);
  951. case 3:
  952. if ((_context6.t1 = _context6.t0()).done) {
  953. _context6.next = 15;
  954. break;
  955. }
  956. key = _context6.t1.value;
  957. value = schema[key];
  958. _context6.next = 8;
  959. return this.validateRule(key, value, data[key], data, allData);
  960. case 8:
  961. errorMessage = _context6.sent;
  962. if (!(errorMessage != null)) {
  963. _context6.next = 13;
  964. break;
  965. }
  966. result.push({
  967. key: key,
  968. errorMessage: errorMessage
  969. });
  970. if (all) {
  971. _context6.next = 13;
  972. break;
  973. }
  974. return _context6.abrupt("break", 15);
  975. case 13:
  976. _context6.next = 3;
  977. break;
  978. case 15:
  979. return _context6.abrupt("return", result);
  980. case 16:
  981. case "end":
  982. return _context6.stop();
  983. }
  984. }
  985. }, _callee6, this);
  986. }));
  987. function invokeValidate(_x17, _x18, _x19) {
  988. return _invokeValidate.apply(this, arguments);
  989. }
  990. return invokeValidate;
  991. }()
  992. }, {
  993. key: "invokeValidateUpdate",
  994. value: function () {
  995. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  996. var result, key, errorMessage;
  997. return _regenerator.default.wrap(function _callee7$(_context7) {
  998. while (1) {
  999. switch (_context7.prev = _context7.next) {
  1000. case 0:
  1001. result = [];
  1002. _context7.t0 = _regenerator.default.keys(data);
  1003. case 2:
  1004. if ((_context7.t1 = _context7.t0()).done) {
  1005. _context7.next = 13;
  1006. break;
  1007. }
  1008. key = _context7.t1.value;
  1009. _context7.next = 6;
  1010. return this.validateRule(key, this._schema[key], data[key], data, allData);
  1011. case 6:
  1012. errorMessage = _context7.sent;
  1013. if (!(errorMessage != null)) {
  1014. _context7.next = 11;
  1015. break;
  1016. }
  1017. result.push({
  1018. key: key,
  1019. errorMessage: errorMessage
  1020. });
  1021. if (all) {
  1022. _context7.next = 11;
  1023. break;
  1024. }
  1025. return _context7.abrupt("break", 13);
  1026. case 11:
  1027. _context7.next = 2;
  1028. break;
  1029. case 13:
  1030. return _context7.abrupt("return", result);
  1031. case 14:
  1032. case "end":
  1033. return _context7.stop();
  1034. }
  1035. }
  1036. }, _callee7, this);
  1037. }));
  1038. function invokeValidateUpdate(_x20, _x21, _x22) {
  1039. return _invokeValidateUpdate.apply(this, arguments);
  1040. }
  1041. return invokeValidateUpdate;
  1042. }()
  1043. }, {
  1044. key: "_checkFieldInSchema",
  1045. value: function _checkFieldInSchema(data) {
  1046. var keys = Object.keys(data);
  1047. var keys2 = Object.keys(this._schema);
  1048. if (new Set(keys.concat(keys2)).size === keys2.length) {
  1049. return '';
  1050. }
  1051. var noExistFields = keys.filter(function (key) {
  1052. return keys2.indexOf(key) < 0;
  1053. });
  1054. var errorMessage = formatMessage({
  1055. field: JSON.stringify(noExistFields)
  1056. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  1057. return [{
  1058. key: 'invalid',
  1059. errorMessage: errorMessage
  1060. }];
  1061. }
  1062. }]);
  1063. return SchemaValidator;
  1064. }(RuleValidator);
  1065. function Message() {
  1066. return {
  1067. TAG: "",
  1068. default: '验证错误',
  1069. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  1070. validateFunction: '验证无效',
  1071. required: '{label}必填',
  1072. 'enum': '{label}超出范围',
  1073. timestamp: '{label}格式无效',
  1074. whitespace: '{label}不能为空',
  1075. typeError: '{label}类型无效',
  1076. date: {
  1077. format: '{label}日期{value}格式无效',
  1078. parse: '{label}日期无法解析,{value}无效',
  1079. invalid: '{label}日期{value}无效'
  1080. },
  1081. length: {
  1082. minLength: '{label}长度不能少于{minLength}',
  1083. maxLength: '{label}长度不能超过{maxLength}',
  1084. range: '{label}必须介于{minLength}和{maxLength}之间'
  1085. },
  1086. number: {
  1087. minimum: '{label}不能小于{minimum}',
  1088. maximum: '{label}不能大于{maximum}',
  1089. exclusiveMinimum: '{label}不能小于等于{minimum}',
  1090. exclusiveMaximum: '{label}不能大于等于{maximum}',
  1091. range: '{label}必须介于{minimum}and{maximum}之间'
  1092. },
  1093. pattern: {
  1094. mismatch: '{label}格式不匹配'
  1095. }
  1096. };
  1097. }
  1098. SchemaValidator.message = new Message();
  1099. var _default = SchemaValidator;
  1100. exports.default = _default;
  1101. /***/ }),
  1102. /***/ 184:
  1103. /*!*********************************************************!*\
  1104. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  1105. \*********************************************************/
  1106. /*! no static exports found */
  1107. /***/ (function(module, exports, __webpack_require__) {
  1108. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1109. function _inherits(subClass, superClass) {
  1110. if (typeof superClass !== "function" && superClass !== null) {
  1111. throw new TypeError("Super expression must either be null or a function");
  1112. }
  1113. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1114. constructor: {
  1115. value: subClass,
  1116. writable: true,
  1117. configurable: true
  1118. }
  1119. });
  1120. Object.defineProperty(subClass, "prototype", {
  1121. writable: false
  1122. });
  1123. if (superClass) setPrototypeOf(subClass, superClass);
  1124. }
  1125. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1126. /***/ }),
  1127. /***/ 185:
  1128. /*!**************************************************************************!*\
  1129. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  1130. \**************************************************************************/
  1131. /*! no static exports found */
  1132. /***/ (function(module, exports, __webpack_require__) {
  1133. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  1134. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 186);
  1135. function _possibleConstructorReturn(self, call) {
  1136. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  1137. return call;
  1138. } else if (call !== void 0) {
  1139. throw new TypeError("Derived constructors may only return object or undefined");
  1140. }
  1141. return assertThisInitialized(self);
  1142. }
  1143. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1144. /***/ }),
  1145. /***/ 186:
  1146. /*!**********************************************************************!*\
  1147. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  1148. \**********************************************************************/
  1149. /*! no static exports found */
  1150. /***/ (function(module, exports) {
  1151. function _assertThisInitialized(self) {
  1152. if (self === void 0) {
  1153. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1154. }
  1155. return self;
  1156. }
  1157. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1158. /***/ }),
  1159. /***/ 187:
  1160. /*!***************************************************************!*\
  1161. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  1162. \***************************************************************/
  1163. /*! no static exports found */
  1164. /***/ (function(module, exports) {
  1165. function _getPrototypeOf(o) {
  1166. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  1167. return o.__proto__ || Object.getPrototypeOf(o);
  1168. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1169. return _getPrototypeOf(o);
  1170. }
  1171. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1172. /***/ }),
  1173. /***/ 188:
  1174. /*!******************************************************************************************!*\
  1175. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  1176. \******************************************************************************************/
  1177. /*! no static exports found */
  1178. /***/ (function(module, exports, __webpack_require__) {
  1179. "use strict";
  1180. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1181. Object.defineProperty(exports, "__esModule", {
  1182. value: true
  1183. });
  1184. 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;
  1185. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1186. /**
  1187. * 简单处理对象拷贝
  1188. * @param {Obejct} 被拷贝对象
  1189. * @@return {Object} 拷贝对象
  1190. */
  1191. var deepCopy = function deepCopy(val) {
  1192. return JSON.parse(JSON.stringify(val));
  1193. };
  1194. /**
  1195. * 过滤数字类型
  1196. * @param {String} format 数字类型
  1197. * @@return {Boolean} 返回是否为数字类型
  1198. */
  1199. exports.deepCopy = deepCopy;
  1200. var typeFilter = function typeFilter(format) {
  1201. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  1202. };
  1203. /**
  1204. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  1205. * @param {String} key 字段名
  1206. * @param {any} value 字段值
  1207. * @param {Object} rules 表单校验规则
  1208. */
  1209. exports.typeFilter = typeFilter;
  1210. var getValue = function getValue(key, value, rules) {
  1211. var isRuleNumType = rules.find(function (val) {
  1212. return val.format && typeFilter(val.format);
  1213. });
  1214. var isRuleBoolType = rules.find(function (val) {
  1215. return val.format && val.format === 'boolean' || val.format === 'bool';
  1216. });
  1217. // 输入类型为 number
  1218. if (!!isRuleNumType) {
  1219. if (!value && value !== 0) {
  1220. value = null;
  1221. } else {
  1222. value = isNumber(Number(value)) ? Number(value) : value;
  1223. }
  1224. }
  1225. // 输入类型为 boolean
  1226. if (!!isRuleBoolType) {
  1227. value = isBoolean(value) ? value : false;
  1228. }
  1229. return value;
  1230. };
  1231. /**
  1232. * 获取表单数据
  1233. * @param {String|Array} name 真实名称,需要使用 realName 获取
  1234. * @param {Object} data 原始数据
  1235. * @param {any} value 需要设置的值
  1236. */
  1237. exports.getValue = getValue;
  1238. var setDataValue = function setDataValue(field, formdata, value) {
  1239. formdata[field] = value;
  1240. return value || '';
  1241. };
  1242. /**
  1243. * 获取表单数据
  1244. * @param {String|Array} field 真实名称,需要使用 realName 获取
  1245. * @param {Object} data 原始数据
  1246. */
  1247. exports.setDataValue = setDataValue;
  1248. var getDataValue = function getDataValue(field, data) {
  1249. return objGet(data, field);
  1250. };
  1251. /**
  1252. * 获取表单类型
  1253. * @param {String|Array} field 真实名称,需要使用 realName 获取
  1254. */
  1255. exports.getDataValue = getDataValue;
  1256. var getDataValueType = function getDataValueType(field, data) {
  1257. var value = getDataValue(field, data);
  1258. return {
  1259. type: type(value),
  1260. value: value
  1261. };
  1262. };
  1263. /**
  1264. * 获取表单可用的真实name
  1265. * @param {String|Array} name 表单name
  1266. * @@return {String} 表单可用的真实name
  1267. */
  1268. exports.getDataValueType = getDataValueType;
  1269. var realName = function realName(name) {
  1270. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1271. var base_name = _basePath(name);
  1272. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  1273. var realname = base_name.reduce(function (a, b) {
  1274. return a += "#".concat(b);
  1275. }, '_formdata_');
  1276. return realname;
  1277. }
  1278. return base_name[0] || name;
  1279. };
  1280. /**
  1281. * 判断是否表单可用的真实name
  1282. * @param {String|Array} name 表单name
  1283. * @@return {String} 表单可用的真实name
  1284. */
  1285. exports.realName = realName;
  1286. var isRealName = function isRealName(name) {
  1287. var reg = /^_formdata_#*/;
  1288. return reg.test(name);
  1289. };
  1290. /**
  1291. * 获取表单数据的原始格式
  1292. * @@return {Object|Array} object 需要解析的数据
  1293. */
  1294. exports.isRealName = isRealName;
  1295. var rawData = function rawData() {
  1296. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1297. var name = arguments.length > 1 ? arguments[1] : undefined;
  1298. var newData = JSON.parse(JSON.stringify(object));
  1299. var formData = {};
  1300. for (var i in newData) {
  1301. var path = name2arr(i);
  1302. objSet(formData, path, newData[i]);
  1303. }
  1304. return formData;
  1305. };
  1306. /**
  1307. * 真实name还原为 array
  1308. * @param {*} name
  1309. */
  1310. exports.rawData = rawData;
  1311. var name2arr = function name2arr(name) {
  1312. var field = name.replace('_formdata_#', '');
  1313. field = field.split('#').map(function (v) {
  1314. return isNumber(v) ? Number(v) : v;
  1315. });
  1316. return field;
  1317. };
  1318. /**
  1319. * 对象中设置值
  1320. * @param {Object|Array} object 源数据
  1321. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  1322. * @param {String} value 需要设置的值
  1323. */
  1324. exports.name2arr = name2arr;
  1325. var objSet = function objSet(object, path, value) {
  1326. if ((0, _typeof2.default)(object) !== 'object') return object;
  1327. _basePath(path).reduce(function (o, k, i, _) {
  1328. if (i === _.length - 1) {
  1329. // 若遍历结束直接赋值
  1330. o[k] = value;
  1331. return null;
  1332. } else if (k in o) {
  1333. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  1334. return o[k];
  1335. } else {
  1336. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  1337. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  1338. return o[k];
  1339. }
  1340. }, object);
  1341. // 返回object
  1342. return object;
  1343. };
  1344. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  1345. exports.objSet = objSet;
  1346. function _basePath(path) {
  1347. // 若是数组,则直接返回
  1348. if (Array.isArray(path)) return path;
  1349. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  1350. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  1351. }
  1352. /**
  1353. * 从对象中获取值
  1354. * @param {Object|Array} object 源数据
  1355. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  1356. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  1357. */
  1358. var objGet = function objGet(object, path) {
  1359. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  1360. // 先将path处理成统一格式
  1361. var newPath = _basePath(path);
  1362. // 递归处理,返回最后结果
  1363. var val = newPath.reduce(function (o, k) {
  1364. return (o || {})[k];
  1365. }, object);
  1366. return !val || val !== undefined ? val : defaultVal;
  1367. };
  1368. /**
  1369. * 是否为 number 类型
  1370. * @param {any} num 需要判断的值
  1371. * @return {Boolean} 是否为 number
  1372. */
  1373. exports.objGet = objGet;
  1374. var isNumber = function isNumber(num) {
  1375. return !isNaN(Number(num));
  1376. };
  1377. /**
  1378. * 是否为 boolean 类型
  1379. * @param {any} bool 需要判断的值
  1380. * @return {Boolean} 是否为 boolean
  1381. */
  1382. exports.isNumber = isNumber;
  1383. var isBoolean = function isBoolean(bool) {
  1384. return typeof bool === 'boolean';
  1385. };
  1386. /**
  1387. * 是否有必填字段
  1388. * @param {Object} rules 规则
  1389. * @return {Boolean} 是否有必填字段
  1390. */
  1391. exports.isBoolean = isBoolean;
  1392. var isRequiredField = function isRequiredField(rules) {
  1393. var isNoField = false;
  1394. for (var i = 0; i < rules.length; i++) {
  1395. var ruleData = rules[i];
  1396. if (ruleData.required) {
  1397. isNoField = true;
  1398. break;
  1399. }
  1400. }
  1401. return isNoField;
  1402. };
  1403. /**
  1404. * 获取数据类型
  1405. * @param {Any} obj 需要获取数据类型的值
  1406. */
  1407. exports.isRequiredField = isRequiredField;
  1408. var type = function type(obj) {
  1409. var class2type = {};
  1410. // 生成class2type映射
  1411. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  1412. class2type["[object " + item + "]"] = item.toLowerCase();
  1413. });
  1414. if (obj == null) {
  1415. return obj + "";
  1416. }
  1417. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  1418. };
  1419. /**
  1420. * 判断两个值是否相等
  1421. * @param {any} a 值
  1422. * @param {any} b 值
  1423. * @return {Boolean} 是否相等
  1424. */
  1425. exports.type = type;
  1426. var isEqual = function isEqual(a, b) {
  1427. //如果a和b本来就全等
  1428. if (a === b) {
  1429. //判断是否为0和-0
  1430. return a !== 0 || 1 / a === 1 / b;
  1431. }
  1432. //判断是否为null和undefined
  1433. if (a == null || b == null) {
  1434. return a === b;
  1435. }
  1436. //接下来判断a和b的数据类型
  1437. var classNameA = toString.call(a),
  1438. classNameB = toString.call(b);
  1439. //如果数据类型不相等,则返回false
  1440. if (classNameA !== classNameB) {
  1441. return false;
  1442. }
  1443. //如果数据类型相等,再根据不同数据类型分别判断
  1444. switch (classNameA) {
  1445. case '[object RegExp]':
  1446. case '[object String]':
  1447. //进行字符串转换比较
  1448. return '' + a === '' + b;
  1449. case '[object Number]':
  1450. //进行数字转换比较,判断是否为NaN
  1451. if (+a !== +a) {
  1452. return +b !== +b;
  1453. }
  1454. //判断是否为0或-0
  1455. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  1456. case '[object Date]':
  1457. case '[object Boolean]':
  1458. return +a === +b;
  1459. }
  1460. //如果是对象类型
  1461. if (classNameA == '[object Object]') {
  1462. //获取a和b的属性长度
  1463. var propsA = Object.getOwnPropertyNames(a),
  1464. propsB = Object.getOwnPropertyNames(b);
  1465. if (propsA.length != propsB.length) {
  1466. return false;
  1467. }
  1468. for (var i = 0; i < propsA.length; i++) {
  1469. var propName = propsA[i];
  1470. //如果对应属性对应值不相等,则返回false
  1471. if (a[propName] !== b[propName]) {
  1472. return false;
  1473. }
  1474. }
  1475. return true;
  1476. }
  1477. //如果是数组类型
  1478. if (classNameA == '[object Array]') {
  1479. if (a.toString() == b.toString()) {
  1480. return true;
  1481. }
  1482. return false;
  1483. }
  1484. };
  1485. exports.isEqual = isEqual;
  1486. /***/ }),
  1487. /***/ 19:
  1488. /*!******************************************************************!*\
  1489. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1490. \******************************************************************/
  1491. /*! no static exports found */
  1492. /***/ (function(module, exports, __webpack_require__) {
  1493. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1494. function _arrayWithoutHoles(arr) {
  1495. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1496. }
  1497. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1498. /***/ }),
  1499. /***/ 2:
  1500. /*!************************************************************!*\
  1501. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1502. \************************************************************/
  1503. /*! no static exports found */
  1504. /***/ (function(module, exports, __webpack_require__) {
  1505. "use strict";
  1506. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1507. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1508. Object.defineProperty(exports, "__esModule", {
  1509. value: true
  1510. });
  1511. exports.createApp = createApp;
  1512. exports.createComponent = createComponent;
  1513. exports.createPage = createPage;
  1514. exports.createPlugin = createPlugin;
  1515. exports.createSubpackageApp = createSubpackageApp;
  1516. exports.default = void 0;
  1517. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1518. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1519. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1520. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1521. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1522. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1523. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1524. 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; }
  1525. 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; }
  1526. var realAtob;
  1527. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1528. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1529. if (typeof atob !== 'function') {
  1530. realAtob = function realAtob(str) {
  1531. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1532. if (!b64re.test(str)) {
  1533. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1534. }
  1535. // Adding the padding if missing, for semplicity
  1536. str += '=='.slice(2 - (str.length & 3));
  1537. var bitmap;
  1538. var result = '';
  1539. var r1;
  1540. var r2;
  1541. var i = 0;
  1542. for (; i < str.length;) {
  1543. 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++)));
  1544. 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);
  1545. }
  1546. return result;
  1547. };
  1548. } else {
  1549. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1550. realAtob = atob;
  1551. }
  1552. function b64DecodeUnicode(str) {
  1553. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1554. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1555. }).join(''));
  1556. }
  1557. function getCurrentUserInfo() {
  1558. var token = wx.getStorageSync('uni_id_token') || '';
  1559. var tokenArr = token.split('.');
  1560. if (!token || tokenArr.length !== 3) {
  1561. return {
  1562. uid: null,
  1563. role: [],
  1564. permission: [],
  1565. tokenExpired: 0
  1566. };
  1567. }
  1568. var userInfo;
  1569. try {
  1570. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1571. } catch (error) {
  1572. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1573. }
  1574. userInfo.tokenExpired = userInfo.exp * 1000;
  1575. delete userInfo.exp;
  1576. delete userInfo.iat;
  1577. return userInfo;
  1578. }
  1579. function uniIdMixin(Vue) {
  1580. Vue.prototype.uniIDHasRole = function (roleId) {
  1581. var _getCurrentUserInfo = getCurrentUserInfo(),
  1582. role = _getCurrentUserInfo.role;
  1583. return role.indexOf(roleId) > -1;
  1584. };
  1585. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1586. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1587. permission = _getCurrentUserInfo2.permission;
  1588. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1589. };
  1590. Vue.prototype.uniIDTokenValid = function () {
  1591. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1592. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1593. return tokenExpired > Date.now();
  1594. };
  1595. }
  1596. var _toString = Object.prototype.toString;
  1597. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1598. function isFn(fn) {
  1599. return typeof fn === 'function';
  1600. }
  1601. function isStr(str) {
  1602. return typeof str === 'string';
  1603. }
  1604. function isObject(obj) {
  1605. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1606. }
  1607. function isPlainObject(obj) {
  1608. return _toString.call(obj) === '[object Object]';
  1609. }
  1610. function hasOwn(obj, key) {
  1611. return hasOwnProperty.call(obj, key);
  1612. }
  1613. function noop() {}
  1614. /**
  1615. * Create a cached version of a pure function.
  1616. */
  1617. function cached(fn) {
  1618. var cache = Object.create(null);
  1619. return function cachedFn(str) {
  1620. var hit = cache[str];
  1621. return hit || (cache[str] = fn(str));
  1622. };
  1623. }
  1624. /**
  1625. * Camelize a hyphen-delimited string.
  1626. */
  1627. var camelizeRE = /-(\w)/g;
  1628. var camelize = cached(function (str) {
  1629. return str.replace(camelizeRE, function (_, c) {
  1630. return c ? c.toUpperCase() : '';
  1631. });
  1632. });
  1633. function sortObject(obj) {
  1634. var sortObj = {};
  1635. if (isPlainObject(obj)) {
  1636. Object.keys(obj).sort().forEach(function (key) {
  1637. sortObj[key] = obj[key];
  1638. });
  1639. }
  1640. return !Object.keys(sortObj) ? obj : sortObj;
  1641. }
  1642. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1643. var globalInterceptors = {};
  1644. var scopedInterceptors = {};
  1645. function mergeHook(parentVal, childVal) {
  1646. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1647. return res ? dedupeHooks(res) : res;
  1648. }
  1649. function dedupeHooks(hooks) {
  1650. var res = [];
  1651. for (var i = 0; i < hooks.length; i++) {
  1652. if (res.indexOf(hooks[i]) === -1) {
  1653. res.push(hooks[i]);
  1654. }
  1655. }
  1656. return res;
  1657. }
  1658. function removeHook(hooks, hook) {
  1659. var index = hooks.indexOf(hook);
  1660. if (index !== -1) {
  1661. hooks.splice(index, 1);
  1662. }
  1663. }
  1664. function mergeInterceptorHook(interceptor, option) {
  1665. Object.keys(option).forEach(function (hook) {
  1666. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1667. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1668. }
  1669. });
  1670. }
  1671. function removeInterceptorHook(interceptor, option) {
  1672. if (!interceptor || !option) {
  1673. return;
  1674. }
  1675. Object.keys(option).forEach(function (hook) {
  1676. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1677. removeHook(interceptor[hook], option[hook]);
  1678. }
  1679. });
  1680. }
  1681. function addInterceptor(method, option) {
  1682. if (typeof method === 'string' && isPlainObject(option)) {
  1683. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1684. } else if (isPlainObject(method)) {
  1685. mergeInterceptorHook(globalInterceptors, method);
  1686. }
  1687. }
  1688. function removeInterceptor(method, option) {
  1689. if (typeof method === 'string') {
  1690. if (isPlainObject(option)) {
  1691. removeInterceptorHook(scopedInterceptors[method], option);
  1692. } else {
  1693. delete scopedInterceptors[method];
  1694. }
  1695. } else if (isPlainObject(method)) {
  1696. removeInterceptorHook(globalInterceptors, method);
  1697. }
  1698. }
  1699. function wrapperHook(hook) {
  1700. return function (data) {
  1701. return hook(data) || data;
  1702. };
  1703. }
  1704. function isPromise(obj) {
  1705. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1706. }
  1707. function queue(hooks, data) {
  1708. var promise = false;
  1709. for (var i = 0; i < hooks.length; i++) {
  1710. var hook = hooks[i];
  1711. if (promise) {
  1712. promise = Promise.resolve(wrapperHook(hook));
  1713. } else {
  1714. var res = hook(data);
  1715. if (isPromise(res)) {
  1716. promise = Promise.resolve(res);
  1717. }
  1718. if (res === false) {
  1719. return {
  1720. then: function then() {}
  1721. };
  1722. }
  1723. }
  1724. }
  1725. return promise || {
  1726. then: function then(callback) {
  1727. return callback(data);
  1728. }
  1729. };
  1730. }
  1731. function wrapperOptions(interceptor) {
  1732. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1733. ['success', 'fail', 'complete'].forEach(function (name) {
  1734. if (Array.isArray(interceptor[name])) {
  1735. var oldCallback = options[name];
  1736. options[name] = function callbackInterceptor(res) {
  1737. queue(interceptor[name], res).then(function (res) {
  1738. /* eslint-disable no-mixed-operators */
  1739. return isFn(oldCallback) && oldCallback(res) || res;
  1740. });
  1741. };
  1742. }
  1743. });
  1744. return options;
  1745. }
  1746. function wrapperReturnValue(method, returnValue) {
  1747. var returnValueHooks = [];
  1748. if (Array.isArray(globalInterceptors.returnValue)) {
  1749. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1750. }
  1751. var interceptor = scopedInterceptors[method];
  1752. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1753. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1754. }
  1755. returnValueHooks.forEach(function (hook) {
  1756. returnValue = hook(returnValue) || returnValue;
  1757. });
  1758. return returnValue;
  1759. }
  1760. function getApiInterceptorHooks(method) {
  1761. var interceptor = Object.create(null);
  1762. Object.keys(globalInterceptors).forEach(function (hook) {
  1763. if (hook !== 'returnValue') {
  1764. interceptor[hook] = globalInterceptors[hook].slice();
  1765. }
  1766. });
  1767. var scopedInterceptor = scopedInterceptors[method];
  1768. if (scopedInterceptor) {
  1769. Object.keys(scopedInterceptor).forEach(function (hook) {
  1770. if (hook !== 'returnValue') {
  1771. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1772. }
  1773. });
  1774. }
  1775. return interceptor;
  1776. }
  1777. function invokeApi(method, api, options) {
  1778. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1779. params[_key - 3] = arguments[_key];
  1780. }
  1781. var interceptor = getApiInterceptorHooks(method);
  1782. if (interceptor && Object.keys(interceptor).length) {
  1783. if (Array.isArray(interceptor.invoke)) {
  1784. var res = queue(interceptor.invoke, options);
  1785. return res.then(function (options) {
  1786. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1787. });
  1788. } else {
  1789. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1790. }
  1791. }
  1792. return api.apply(void 0, [options].concat(params));
  1793. }
  1794. var promiseInterceptor = {
  1795. returnValue: function returnValue(res) {
  1796. if (!isPromise(res)) {
  1797. return res;
  1798. }
  1799. return new Promise(function (resolve, reject) {
  1800. res.then(function (res) {
  1801. if (res[0]) {
  1802. reject(res[0]);
  1803. } else {
  1804. resolve(res[1]);
  1805. }
  1806. });
  1807. });
  1808. }
  1809. };
  1810. 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/;
  1811. var CONTEXT_API_RE = /^create|Manager$/;
  1812. // Context例外情况
  1813. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1814. // 同步例外情况
  1815. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1816. var CALLBACK_API_RE = /^on|^off/;
  1817. function isContextApi(name) {
  1818. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1819. }
  1820. function isSyncApi(name) {
  1821. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1822. }
  1823. function isCallbackApi(name) {
  1824. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1825. }
  1826. function handlePromise(promise) {
  1827. return promise.then(function (data) {
  1828. return [null, data];
  1829. }).catch(function (err) {
  1830. return [err];
  1831. });
  1832. }
  1833. function shouldPromise(name) {
  1834. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1835. return false;
  1836. }
  1837. return true;
  1838. }
  1839. /* eslint-disable no-extend-native */
  1840. if (!Promise.prototype.finally) {
  1841. Promise.prototype.finally = function (callback) {
  1842. var promise = this.constructor;
  1843. return this.then(function (value) {
  1844. return promise.resolve(callback()).then(function () {
  1845. return value;
  1846. });
  1847. }, function (reason) {
  1848. return promise.resolve(callback()).then(function () {
  1849. throw reason;
  1850. });
  1851. });
  1852. };
  1853. }
  1854. function promisify(name, api) {
  1855. if (!shouldPromise(name) || !isFn(api)) {
  1856. return api;
  1857. }
  1858. return function promiseApi() {
  1859. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1860. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1861. params[_key2 - 1] = arguments[_key2];
  1862. }
  1863. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1864. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1865. }
  1866. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1867. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1868. success: resolve,
  1869. fail: reject
  1870. })].concat(params));
  1871. })));
  1872. };
  1873. }
  1874. var EPS = 1e-4;
  1875. var BASE_DEVICE_WIDTH = 750;
  1876. var isIOS = false;
  1877. var deviceWidth = 0;
  1878. var deviceDPR = 0;
  1879. function checkDeviceWidth() {
  1880. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1881. platform = _wx$getSystemInfoSync.platform,
  1882. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1883. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1884. deviceWidth = windowWidth;
  1885. deviceDPR = pixelRatio;
  1886. isIOS = platform === 'ios';
  1887. }
  1888. function upx2px(number, newDeviceWidth) {
  1889. if (deviceWidth === 0) {
  1890. checkDeviceWidth();
  1891. }
  1892. number = Number(number);
  1893. if (number === 0) {
  1894. return 0;
  1895. }
  1896. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1897. if (result < 0) {
  1898. result = -result;
  1899. }
  1900. result = Math.floor(result + EPS);
  1901. if (result === 0) {
  1902. if (deviceDPR === 1 || !isIOS) {
  1903. result = 1;
  1904. } else {
  1905. result = 0.5;
  1906. }
  1907. }
  1908. return number < 0 ? -result : result;
  1909. }
  1910. var LOCALE_ZH_HANS = 'zh-Hans';
  1911. var LOCALE_ZH_HANT = 'zh-Hant';
  1912. var LOCALE_EN = 'en';
  1913. var LOCALE_FR = 'fr';
  1914. var LOCALE_ES = 'es';
  1915. var messages = {};
  1916. var locale;
  1917. {
  1918. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1919. }
  1920. function initI18nMessages() {
  1921. if (!isEnableLocale()) {
  1922. return;
  1923. }
  1924. var localeKeys = Object.keys(__uniConfig.locales);
  1925. if (localeKeys.length) {
  1926. localeKeys.forEach(function (locale) {
  1927. var curMessages = messages[locale];
  1928. var userMessages = __uniConfig.locales[locale];
  1929. if (curMessages) {
  1930. Object.assign(curMessages, userMessages);
  1931. } else {
  1932. messages[locale] = userMessages;
  1933. }
  1934. });
  1935. }
  1936. }
  1937. initI18nMessages();
  1938. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1939. var t = i18n.t;
  1940. var i18nMixin = i18n.mixin = {
  1941. beforeCreate: function beforeCreate() {
  1942. var _this = this;
  1943. var unwatch = i18n.i18n.watchLocale(function () {
  1944. _this.$forceUpdate();
  1945. });
  1946. this.$once('hook:beforeDestroy', function () {
  1947. unwatch();
  1948. });
  1949. },
  1950. methods: {
  1951. $$t: function $$t(key, values) {
  1952. return t(key, values);
  1953. }
  1954. }
  1955. };
  1956. var setLocale = i18n.setLocale;
  1957. var getLocale = i18n.getLocale;
  1958. function initAppLocale(Vue, appVm, locale) {
  1959. var state = Vue.observable({
  1960. locale: locale || i18n.getLocale()
  1961. });
  1962. var localeWatchers = [];
  1963. appVm.$watchLocale = function (fn) {
  1964. localeWatchers.push(fn);
  1965. };
  1966. Object.defineProperty(appVm, '$locale', {
  1967. get: function get() {
  1968. return state.locale;
  1969. },
  1970. set: function set(v) {
  1971. state.locale = v;
  1972. localeWatchers.forEach(function (watch) {
  1973. return watch(v);
  1974. });
  1975. }
  1976. });
  1977. }
  1978. function isEnableLocale() {
  1979. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1980. }
  1981. function include(str, parts) {
  1982. return !!parts.find(function (part) {
  1983. return str.indexOf(part) !== -1;
  1984. });
  1985. }
  1986. function startsWith(str, parts) {
  1987. return parts.find(function (part) {
  1988. return str.indexOf(part) === 0;
  1989. });
  1990. }
  1991. function normalizeLocale(locale, messages) {
  1992. if (!locale) {
  1993. return;
  1994. }
  1995. locale = locale.trim().replace(/_/g, '-');
  1996. if (messages && messages[locale]) {
  1997. return locale;
  1998. }
  1999. locale = locale.toLowerCase();
  2000. if (locale === 'chinese') {
  2001. // 支付宝
  2002. return LOCALE_ZH_HANS;
  2003. }
  2004. if (locale.indexOf('zh') === 0) {
  2005. if (locale.indexOf('-hans') > -1) {
  2006. return LOCALE_ZH_HANS;
  2007. }
  2008. if (locale.indexOf('-hant') > -1) {
  2009. return LOCALE_ZH_HANT;
  2010. }
  2011. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2012. return LOCALE_ZH_HANT;
  2013. }
  2014. return LOCALE_ZH_HANS;
  2015. }
  2016. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2017. if (lang) {
  2018. return lang;
  2019. }
  2020. }
  2021. // export function initI18n() {
  2022. // const localeKeys = Object.keys(__uniConfig.locales || {})
  2023. // if (localeKeys.length) {
  2024. // localeKeys.forEach((locale) =>
  2025. // i18n.add(locale, __uniConfig.locales[locale])
  2026. // )
  2027. // }
  2028. // }
  2029. function getLocale$1() {
  2030. // 优先使用 $locale
  2031. if (isFn(getApp)) {
  2032. var app = getApp({
  2033. allowDefault: true
  2034. });
  2035. if (app && app.$vm) {
  2036. return app.$vm.$locale;
  2037. }
  2038. }
  2039. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  2040. }
  2041. function setLocale$1(locale) {
  2042. var app = isFn(getApp) ? getApp() : false;
  2043. if (!app) {
  2044. return false;
  2045. }
  2046. var oldLocale = app.$vm.$locale;
  2047. if (oldLocale !== locale) {
  2048. app.$vm.$locale = locale;
  2049. onLocaleChangeCallbacks.forEach(function (fn) {
  2050. return fn({
  2051. locale: locale
  2052. });
  2053. });
  2054. return true;
  2055. }
  2056. return false;
  2057. }
  2058. var onLocaleChangeCallbacks = [];
  2059. function onLocaleChange(fn) {
  2060. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  2061. onLocaleChangeCallbacks.push(fn);
  2062. }
  2063. }
  2064. if (typeof global !== 'undefined') {
  2065. global.getLocale = getLocale$1;
  2066. }
  2067. var interceptors = {
  2068. promiseInterceptor: promiseInterceptor
  2069. };
  2070. var baseApi = /*#__PURE__*/Object.freeze({
  2071. __proto__: null,
  2072. upx2px: upx2px,
  2073. getLocale: getLocale$1,
  2074. setLocale: setLocale$1,
  2075. onLocaleChange: onLocaleChange,
  2076. addInterceptor: addInterceptor,
  2077. removeInterceptor: removeInterceptor,
  2078. interceptors: interceptors
  2079. });
  2080. function findExistsPageIndex(url) {
  2081. var pages = getCurrentPages();
  2082. var len = pages.length;
  2083. while (len--) {
  2084. var page = pages[len];
  2085. if (page.$page && page.$page.fullPath === url) {
  2086. return len;
  2087. }
  2088. }
  2089. return -1;
  2090. }
  2091. var redirectTo = {
  2092. name: function name(fromArgs) {
  2093. if (fromArgs.exists === 'back' && fromArgs.delta) {
  2094. return 'navigateBack';
  2095. }
  2096. return 'redirectTo';
  2097. },
  2098. args: function args(fromArgs) {
  2099. if (fromArgs.exists === 'back' && fromArgs.url) {
  2100. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  2101. if (existsPageIndex !== -1) {
  2102. var delta = getCurrentPages().length - 1 - existsPageIndex;
  2103. if (delta > 0) {
  2104. fromArgs.delta = delta;
  2105. }
  2106. }
  2107. }
  2108. }
  2109. };
  2110. var previewImage = {
  2111. args: function args(fromArgs) {
  2112. var currentIndex = parseInt(fromArgs.current);
  2113. if (isNaN(currentIndex)) {
  2114. return;
  2115. }
  2116. var urls = fromArgs.urls;
  2117. if (!Array.isArray(urls)) {
  2118. return;
  2119. }
  2120. var len = urls.length;
  2121. if (!len) {
  2122. return;
  2123. }
  2124. if (currentIndex < 0) {
  2125. currentIndex = 0;
  2126. } else if (currentIndex >= len) {
  2127. currentIndex = len - 1;
  2128. }
  2129. if (currentIndex > 0) {
  2130. fromArgs.current = urls[currentIndex];
  2131. fromArgs.urls = urls.filter(function (item, index) {
  2132. return index < currentIndex ? item !== urls[currentIndex] : true;
  2133. });
  2134. } else {
  2135. fromArgs.current = urls[0];
  2136. }
  2137. return {
  2138. indicator: false,
  2139. loop: false
  2140. };
  2141. }
  2142. };
  2143. var UUID_KEY = '__DC_STAT_UUID';
  2144. var deviceId;
  2145. function useDeviceId(result) {
  2146. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  2147. if (!deviceId) {
  2148. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  2149. wx.setStorage({
  2150. key: UUID_KEY,
  2151. data: deviceId
  2152. });
  2153. }
  2154. result.deviceId = deviceId;
  2155. }
  2156. function addSafeAreaInsets(result) {
  2157. if (result.safeArea) {
  2158. var safeArea = result.safeArea;
  2159. result.safeAreaInsets = {
  2160. top: safeArea.top,
  2161. left: safeArea.left,
  2162. right: result.windowWidth - safeArea.right,
  2163. bottom: result.screenHeight - safeArea.bottom
  2164. };
  2165. }
  2166. }
  2167. function populateParameters(result) {
  2168. var _result$brand = result.brand,
  2169. brand = _result$brand === void 0 ? '' : _result$brand,
  2170. _result$model = result.model,
  2171. model = _result$model === void 0 ? '' : _result$model,
  2172. _result$system = result.system,
  2173. system = _result$system === void 0 ? '' : _result$system,
  2174. _result$language = result.language,
  2175. language = _result$language === void 0 ? '' : _result$language,
  2176. theme = result.theme,
  2177. version = result.version,
  2178. platform = result.platform,
  2179. fontSizeSetting = result.fontSizeSetting,
  2180. SDKVersion = result.SDKVersion,
  2181. pixelRatio = result.pixelRatio,
  2182. deviceOrientation = result.deviceOrientation;
  2183. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  2184. var extraParam = {};
  2185. // osName osVersion
  2186. var osName = '';
  2187. var osVersion = '';
  2188. {
  2189. osName = system.split(' ')[0] || '';
  2190. osVersion = system.split(' ')[1] || '';
  2191. }
  2192. var hostVersion = version;
  2193. // deviceType
  2194. var deviceType = getGetDeviceType(result, model);
  2195. // deviceModel
  2196. var deviceBrand = getDeviceBrand(brand);
  2197. // hostName
  2198. var _hostName = getHostName(result);
  2199. // deviceOrientation
  2200. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  2201. // devicePixelRatio
  2202. var _devicePixelRatio = pixelRatio;
  2203. // SDKVersion
  2204. var _SDKVersion = SDKVersion;
  2205. // hostLanguage
  2206. var hostLanguage = language.replace(/_/g, '-');
  2207. // wx.getAccountInfoSync
  2208. var parameters = {
  2209. appId: "__UNI__ED9AEA5",
  2210. appName: "采空区巡检",
  2211. appVersion: "1.0.0",
  2212. appVersionCode: "100",
  2213. appLanguage: getAppLanguage(hostLanguage),
  2214. uniCompileVersion: "3.7.11",
  2215. uniRuntimeVersion: "3.7.11",
  2216. uniPlatform: undefined || "mp-weixin",
  2217. deviceBrand: deviceBrand,
  2218. deviceModel: model,
  2219. deviceType: deviceType,
  2220. devicePixelRatio: _devicePixelRatio,
  2221. deviceOrientation: _deviceOrientation,
  2222. osName: osName.toLocaleLowerCase(),
  2223. osVersion: osVersion,
  2224. hostTheme: theme,
  2225. hostVersion: hostVersion,
  2226. hostLanguage: hostLanguage,
  2227. hostName: _hostName,
  2228. hostSDKVersion: _SDKVersion,
  2229. hostFontSizeSetting: fontSizeSetting,
  2230. windowTop: 0,
  2231. windowBottom: 0,
  2232. // TODO
  2233. osLanguage: undefined,
  2234. osTheme: undefined,
  2235. ua: undefined,
  2236. hostPackageName: undefined,
  2237. browserName: undefined,
  2238. browserVersion: undefined
  2239. };
  2240. Object.assign(result, parameters, extraParam);
  2241. }
  2242. function getGetDeviceType(result, model) {
  2243. var deviceType = result.deviceType || 'phone';
  2244. {
  2245. var deviceTypeMaps = {
  2246. ipad: 'pad',
  2247. windows: 'pc',
  2248. mac: 'pc'
  2249. };
  2250. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  2251. var _model = model.toLocaleLowerCase();
  2252. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  2253. var _m = deviceTypeMapsKeys[index];
  2254. if (_model.indexOf(_m) !== -1) {
  2255. deviceType = deviceTypeMaps[_m];
  2256. break;
  2257. }
  2258. }
  2259. }
  2260. return deviceType;
  2261. }
  2262. function getDeviceBrand(brand) {
  2263. var deviceBrand = brand;
  2264. if (deviceBrand) {
  2265. deviceBrand = brand.toLocaleLowerCase();
  2266. }
  2267. return deviceBrand;
  2268. }
  2269. function getAppLanguage(defaultLanguage) {
  2270. return getLocale$1 ? getLocale$1() : defaultLanguage;
  2271. }
  2272. function getHostName(result) {
  2273. var _platform = 'WeChat';
  2274. var _hostName = result.hostName || _platform; // mp-jd
  2275. {
  2276. if (result.environment) {
  2277. _hostName = result.environment;
  2278. } else if (result.host && result.host.env) {
  2279. _hostName = result.host.env;
  2280. }
  2281. }
  2282. return _hostName;
  2283. }
  2284. var getSystemInfo = {
  2285. returnValue: function returnValue(result) {
  2286. useDeviceId(result);
  2287. addSafeAreaInsets(result);
  2288. populateParameters(result);
  2289. }
  2290. };
  2291. var showActionSheet = {
  2292. args: function args(fromArgs) {
  2293. if ((0, _typeof2.default)(fromArgs) === 'object') {
  2294. fromArgs.alertText = fromArgs.title;
  2295. }
  2296. }
  2297. };
  2298. var getAppBaseInfo = {
  2299. returnValue: function returnValue(result) {
  2300. var _result = result,
  2301. version = _result.version,
  2302. language = _result.language,
  2303. SDKVersion = _result.SDKVersion,
  2304. theme = _result.theme;
  2305. var _hostName = getHostName(result);
  2306. var hostLanguage = language.replace('_', '-');
  2307. result = sortObject(Object.assign(result, {
  2308. appId: "__UNI__ED9AEA5",
  2309. appName: "采空区巡检",
  2310. appVersion: "1.0.0",
  2311. appVersionCode: "100",
  2312. appLanguage: getAppLanguage(hostLanguage),
  2313. hostVersion: version,
  2314. hostLanguage: hostLanguage,
  2315. hostName: _hostName,
  2316. hostSDKVersion: SDKVersion,
  2317. hostTheme: theme
  2318. }));
  2319. }
  2320. };
  2321. var getDeviceInfo = {
  2322. returnValue: function returnValue(result) {
  2323. var _result2 = result,
  2324. brand = _result2.brand,
  2325. model = _result2.model;
  2326. var deviceType = getGetDeviceType(result, model);
  2327. var deviceBrand = getDeviceBrand(brand);
  2328. useDeviceId(result);
  2329. result = sortObject(Object.assign(result, {
  2330. deviceType: deviceType,
  2331. deviceBrand: deviceBrand,
  2332. deviceModel: model
  2333. }));
  2334. }
  2335. };
  2336. var getWindowInfo = {
  2337. returnValue: function returnValue(result) {
  2338. addSafeAreaInsets(result);
  2339. result = sortObject(Object.assign(result, {
  2340. windowTop: 0,
  2341. windowBottom: 0
  2342. }));
  2343. }
  2344. };
  2345. var getAppAuthorizeSetting = {
  2346. returnValue: function returnValue(result) {
  2347. var locationReducedAccuracy = result.locationReducedAccuracy;
  2348. result.locationAccuracy = 'unsupported';
  2349. if (locationReducedAccuracy === true) {
  2350. result.locationAccuracy = 'reduced';
  2351. } else if (locationReducedAccuracy === false) {
  2352. result.locationAccuracy = 'full';
  2353. }
  2354. }
  2355. };
  2356. // import navigateTo from 'uni-helpers/navigate-to'
  2357. var compressImage = {
  2358. args: function args(fromArgs) {
  2359. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2360. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2361. fromArgs.compressHeight = fromArgs.compressedHeight;
  2362. }
  2363. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2364. fromArgs.compressWidth = fromArgs.compressedWidth;
  2365. }
  2366. }
  2367. };
  2368. var protocols = {
  2369. redirectTo: redirectTo,
  2370. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2371. previewImage: previewImage,
  2372. getSystemInfo: getSystemInfo,
  2373. getSystemInfoSync: getSystemInfo,
  2374. showActionSheet: showActionSheet,
  2375. getAppBaseInfo: getAppBaseInfo,
  2376. getDeviceInfo: getDeviceInfo,
  2377. getWindowInfo: getWindowInfo,
  2378. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2379. compressImage: compressImage
  2380. };
  2381. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2382. var canIUses = [];
  2383. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2384. function processCallback(methodName, method, returnValue) {
  2385. return function (res) {
  2386. return method(processReturnValue(methodName, res, returnValue));
  2387. };
  2388. }
  2389. function processArgs(methodName, fromArgs) {
  2390. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2391. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2392. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2393. if (isPlainObject(fromArgs)) {
  2394. // 一般 api 的参数解析
  2395. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2396. if (isFn(argsOption)) {
  2397. argsOption = argsOption(fromArgs, toArgs) || {};
  2398. }
  2399. for (var key in fromArgs) {
  2400. if (hasOwn(argsOption, key)) {
  2401. var keyOption = argsOption[key];
  2402. if (isFn(keyOption)) {
  2403. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2404. }
  2405. if (!keyOption) {
  2406. // 不支持的参数
  2407. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2408. } else if (isStr(keyOption)) {
  2409. // 重写参数 key
  2410. toArgs[keyOption] = fromArgs[key];
  2411. } else if (isPlainObject(keyOption)) {
  2412. // {name:newName,value:value}可重新指定参数 key:value
  2413. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2414. }
  2415. } else if (CALLBACKS.indexOf(key) !== -1) {
  2416. if (isFn(fromArgs[key])) {
  2417. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2418. }
  2419. } else {
  2420. if (!keepFromArgs) {
  2421. toArgs[key] = fromArgs[key];
  2422. }
  2423. }
  2424. }
  2425. return toArgs;
  2426. } else if (isFn(fromArgs)) {
  2427. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2428. }
  2429. return fromArgs;
  2430. }
  2431. function processReturnValue(methodName, res, returnValue) {
  2432. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2433. if (isFn(protocols.returnValue)) {
  2434. // 处理通用 returnValue
  2435. res = protocols.returnValue(methodName, res);
  2436. }
  2437. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2438. }
  2439. function wrapper(methodName, method) {
  2440. if (hasOwn(protocols, methodName)) {
  2441. var protocol = protocols[methodName];
  2442. if (!protocol) {
  2443. // 暂不支持的 api
  2444. return function () {
  2445. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2446. };
  2447. }
  2448. return function (arg1, arg2) {
  2449. // 目前 api 最多两个参数
  2450. var options = protocol;
  2451. if (isFn(protocol)) {
  2452. options = protocol(arg1);
  2453. }
  2454. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2455. var args = [arg1];
  2456. if (typeof arg2 !== 'undefined') {
  2457. args.push(arg2);
  2458. }
  2459. if (isFn(options.name)) {
  2460. methodName = options.name(arg1);
  2461. } else if (isStr(options.name)) {
  2462. methodName = options.name;
  2463. }
  2464. var returnValue = wx[methodName].apply(wx, args);
  2465. if (isSyncApi(methodName)) {
  2466. // 同步 api
  2467. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2468. }
  2469. return returnValue;
  2470. };
  2471. }
  2472. return method;
  2473. }
  2474. var todoApis = Object.create(null);
  2475. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2476. function createTodoApi(name) {
  2477. return function todoApi(_ref) {
  2478. var fail = _ref.fail,
  2479. complete = _ref.complete;
  2480. var res = {
  2481. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2482. };
  2483. isFn(fail) && fail(res);
  2484. isFn(complete) && complete(res);
  2485. };
  2486. }
  2487. TODOS.forEach(function (name) {
  2488. todoApis[name] = createTodoApi(name);
  2489. });
  2490. var providers = {
  2491. oauth: ['weixin'],
  2492. share: ['weixin'],
  2493. payment: ['wxpay'],
  2494. push: ['weixin']
  2495. };
  2496. function getProvider(_ref2) {
  2497. var service = _ref2.service,
  2498. success = _ref2.success,
  2499. fail = _ref2.fail,
  2500. complete = _ref2.complete;
  2501. var res = false;
  2502. if (providers[service]) {
  2503. res = {
  2504. errMsg: 'getProvider:ok',
  2505. service: service,
  2506. provider: providers[service]
  2507. };
  2508. isFn(success) && success(res);
  2509. } else {
  2510. res = {
  2511. errMsg: 'getProvider:fail service not found'
  2512. };
  2513. isFn(fail) && fail(res);
  2514. }
  2515. isFn(complete) && complete(res);
  2516. }
  2517. var extraApi = /*#__PURE__*/Object.freeze({
  2518. __proto__: null,
  2519. getProvider: getProvider
  2520. });
  2521. var getEmitter = function () {
  2522. var Emitter;
  2523. return function getUniEmitter() {
  2524. if (!Emitter) {
  2525. Emitter = new _vue.default();
  2526. }
  2527. return Emitter;
  2528. };
  2529. }();
  2530. function apply(ctx, method, args) {
  2531. return ctx[method].apply(ctx, args);
  2532. }
  2533. function $on() {
  2534. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2535. }
  2536. function $off() {
  2537. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2538. }
  2539. function $once() {
  2540. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2541. }
  2542. function $emit() {
  2543. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2544. }
  2545. var eventApi = /*#__PURE__*/Object.freeze({
  2546. __proto__: null,
  2547. $on: $on,
  2548. $off: $off,
  2549. $once: $once,
  2550. $emit: $emit
  2551. });
  2552. /**
  2553. * 框架内 try-catch
  2554. */
  2555. /**
  2556. * 开发者 try-catch
  2557. */
  2558. function tryCatch(fn) {
  2559. return function () {
  2560. try {
  2561. return fn.apply(fn, arguments);
  2562. } catch (e) {
  2563. // TODO
  2564. console.error(e);
  2565. }
  2566. };
  2567. }
  2568. function getApiCallbacks(params) {
  2569. var apiCallbacks = {};
  2570. for (var name in params) {
  2571. var param = params[name];
  2572. if (isFn(param)) {
  2573. apiCallbacks[name] = tryCatch(param);
  2574. delete params[name];
  2575. }
  2576. }
  2577. return apiCallbacks;
  2578. }
  2579. var cid;
  2580. var cidErrMsg;
  2581. var enabled;
  2582. function normalizePushMessage(message) {
  2583. try {
  2584. return JSON.parse(message);
  2585. } catch (e) {}
  2586. return message;
  2587. }
  2588. function invokePushCallback(args) {
  2589. if (args.type === 'enabled') {
  2590. enabled = true;
  2591. } else if (args.type === 'clientId') {
  2592. cid = args.cid;
  2593. cidErrMsg = args.errMsg;
  2594. invokeGetPushCidCallbacks(cid, args.errMsg);
  2595. } else if (args.type === 'pushMsg') {
  2596. var message = {
  2597. type: 'receive',
  2598. data: normalizePushMessage(args.message)
  2599. };
  2600. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2601. var callback = onPushMessageCallbacks[i];
  2602. callback(message);
  2603. // 该消息已被阻止
  2604. if (message.stopped) {
  2605. break;
  2606. }
  2607. }
  2608. } else if (args.type === 'click') {
  2609. onPushMessageCallbacks.forEach(function (callback) {
  2610. callback({
  2611. type: 'click',
  2612. data: normalizePushMessage(args.message)
  2613. });
  2614. });
  2615. }
  2616. }
  2617. var getPushCidCallbacks = [];
  2618. function invokeGetPushCidCallbacks(cid, errMsg) {
  2619. getPushCidCallbacks.forEach(function (callback) {
  2620. callback(cid, errMsg);
  2621. });
  2622. getPushCidCallbacks.length = 0;
  2623. }
  2624. function getPushClientId(args) {
  2625. if (!isPlainObject(args)) {
  2626. args = {};
  2627. }
  2628. var _getApiCallbacks = getApiCallbacks(args),
  2629. success = _getApiCallbacks.success,
  2630. fail = _getApiCallbacks.fail,
  2631. complete = _getApiCallbacks.complete;
  2632. var hasSuccess = isFn(success);
  2633. var hasFail = isFn(fail);
  2634. var hasComplete = isFn(complete);
  2635. Promise.resolve().then(function () {
  2636. if (typeof enabled === 'undefined') {
  2637. enabled = false;
  2638. cid = '';
  2639. cidErrMsg = 'uniPush is not enabled';
  2640. }
  2641. getPushCidCallbacks.push(function (cid, errMsg) {
  2642. var res;
  2643. if (cid) {
  2644. res = {
  2645. errMsg: 'getPushClientId:ok',
  2646. cid: cid
  2647. };
  2648. hasSuccess && success(res);
  2649. } else {
  2650. res = {
  2651. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2652. };
  2653. hasFail && fail(res);
  2654. }
  2655. hasComplete && complete(res);
  2656. });
  2657. if (typeof cid !== 'undefined') {
  2658. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2659. }
  2660. });
  2661. }
  2662. var onPushMessageCallbacks = [];
  2663. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2664. var onPushMessage = function onPushMessage(fn) {
  2665. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2666. onPushMessageCallbacks.push(fn);
  2667. }
  2668. };
  2669. var offPushMessage = function offPushMessage(fn) {
  2670. if (!fn) {
  2671. onPushMessageCallbacks.length = 0;
  2672. } else {
  2673. var index = onPushMessageCallbacks.indexOf(fn);
  2674. if (index > -1) {
  2675. onPushMessageCallbacks.splice(index, 1);
  2676. }
  2677. }
  2678. };
  2679. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2680. if (!baseInfo) {
  2681. baseInfo = wx.getSystemInfoSync();
  2682. }
  2683. var host = baseInfo ? baseInfo.host : null;
  2684. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2685. var api = /*#__PURE__*/Object.freeze({
  2686. __proto__: null,
  2687. shareVideoMessage: shareVideoMessage,
  2688. getPushClientId: getPushClientId,
  2689. onPushMessage: onPushMessage,
  2690. offPushMessage: offPushMessage,
  2691. invokePushCallback: invokePushCallback
  2692. });
  2693. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2694. function findVmByVueId(vm, vuePid) {
  2695. var $children = vm.$children;
  2696. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2697. for (var i = $children.length - 1; i >= 0; i--) {
  2698. var childVm = $children[i];
  2699. if (childVm.$scope._$vueId === vuePid) {
  2700. return childVm;
  2701. }
  2702. }
  2703. // 反向递归查找
  2704. var parentVm;
  2705. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2706. parentVm = findVmByVueId($children[_i], vuePid);
  2707. if (parentVm) {
  2708. return parentVm;
  2709. }
  2710. }
  2711. }
  2712. function initBehavior(options) {
  2713. return Behavior(options);
  2714. }
  2715. function isPage() {
  2716. return !!this.route;
  2717. }
  2718. function initRelation(detail) {
  2719. this.triggerEvent('__l', detail);
  2720. }
  2721. function selectAllComponents(mpInstance, selector, $refs) {
  2722. var components = mpInstance.selectAllComponents(selector) || [];
  2723. components.forEach(function (component) {
  2724. var ref = component.dataset.ref;
  2725. $refs[ref] = component.$vm || toSkip(component);
  2726. {
  2727. if (component.dataset.vueGeneric === 'scoped') {
  2728. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2729. selectAllComponents(scopedComponent, selector, $refs);
  2730. });
  2731. }
  2732. }
  2733. });
  2734. }
  2735. function syncRefs(refs, newRefs) {
  2736. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2737. var newKeys = Object.keys(newRefs);
  2738. newKeys.forEach(function (key) {
  2739. var oldValue = refs[key];
  2740. var newValue = newRefs[key];
  2741. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2742. return oldValue.includes(value);
  2743. })) {
  2744. return;
  2745. }
  2746. refs[key] = newValue;
  2747. oldKeys.delete(key);
  2748. });
  2749. oldKeys.forEach(function (key) {
  2750. delete refs[key];
  2751. });
  2752. return refs;
  2753. }
  2754. function initRefs(vm) {
  2755. var mpInstance = vm.$scope;
  2756. var refs = {};
  2757. Object.defineProperty(vm, '$refs', {
  2758. get: function get() {
  2759. var $refs = {};
  2760. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2761. // TODO 暂不考虑 for 中的 scoped
  2762. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2763. forComponents.forEach(function (component) {
  2764. var ref = component.dataset.ref;
  2765. if (!$refs[ref]) {
  2766. $refs[ref] = [];
  2767. }
  2768. $refs[ref].push(component.$vm || toSkip(component));
  2769. });
  2770. return syncRefs(refs, $refs);
  2771. }
  2772. });
  2773. }
  2774. function handleLink(event) {
  2775. var _ref3 = event.detail || event.value,
  2776. vuePid = _ref3.vuePid,
  2777. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2778. var parentVm;
  2779. if (vuePid) {
  2780. parentVm = findVmByVueId(this.$vm, vuePid);
  2781. }
  2782. if (!parentVm) {
  2783. parentVm = this.$vm;
  2784. }
  2785. vueOptions.parent = parentVm;
  2786. }
  2787. function markMPComponent(component) {
  2788. // 在 Vue 中标记为小程序组件
  2789. var IS_MP = '__v_isMPComponent';
  2790. Object.defineProperty(component, IS_MP, {
  2791. configurable: true,
  2792. enumerable: false,
  2793. value: true
  2794. });
  2795. return component;
  2796. }
  2797. function toSkip(obj) {
  2798. var OB = '__ob__';
  2799. var SKIP = '__v_skip';
  2800. if (isObject(obj) && Object.isExtensible(obj)) {
  2801. // 避免被 @vue/composition-api 观测
  2802. Object.defineProperty(obj, OB, {
  2803. configurable: true,
  2804. enumerable: false,
  2805. value: (0, _defineProperty2.default)({}, SKIP, true)
  2806. });
  2807. }
  2808. return obj;
  2809. }
  2810. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2811. function initWorkletMethods(mpMethods, vueMethods) {
  2812. if (vueMethods) {
  2813. Object.keys(vueMethods).forEach(function (name) {
  2814. var matches = name.match(WORKLET_RE);
  2815. if (matches) {
  2816. var workletName = matches[1];
  2817. mpMethods[name] = vueMethods[name];
  2818. mpMethods[workletName] = vueMethods[workletName];
  2819. }
  2820. });
  2821. }
  2822. }
  2823. var MPPage = Page;
  2824. var MPComponent = Component;
  2825. var customizeRE = /:/g;
  2826. var customize = cached(function (str) {
  2827. return camelize(str.replace(customizeRE, '-'));
  2828. });
  2829. function initTriggerEvent(mpInstance) {
  2830. var oldTriggerEvent = mpInstance.triggerEvent;
  2831. var newTriggerEvent = function newTriggerEvent(event) {
  2832. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2833. args[_key3 - 1] = arguments[_key3];
  2834. }
  2835. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2836. if (this.$vm || this.dataset && this.dataset.comType) {
  2837. event = customize(event);
  2838. } else {
  2839. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2840. var newEvent = customize(event);
  2841. if (newEvent !== event) {
  2842. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2843. }
  2844. }
  2845. return oldTriggerEvent.apply(this, [event].concat(args));
  2846. };
  2847. try {
  2848. // 京东小程序 triggerEvent 为只读
  2849. mpInstance.triggerEvent = newTriggerEvent;
  2850. } catch (error) {
  2851. mpInstance._triggerEvent = newTriggerEvent;
  2852. }
  2853. }
  2854. function initHook(name, options, isComponent) {
  2855. var oldHook = options[name];
  2856. options[name] = function () {
  2857. markMPComponent(this);
  2858. initTriggerEvent(this);
  2859. if (oldHook) {
  2860. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2861. args[_key4] = arguments[_key4];
  2862. }
  2863. return oldHook.apply(this, args);
  2864. }
  2865. };
  2866. }
  2867. if (!MPPage.__$wrappered) {
  2868. MPPage.__$wrappered = true;
  2869. Page = function Page() {
  2870. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2871. initHook('onLoad', options);
  2872. return MPPage(options);
  2873. };
  2874. Page.after = MPPage.after;
  2875. Component = function Component() {
  2876. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2877. initHook('created', options);
  2878. return MPComponent(options);
  2879. };
  2880. }
  2881. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2882. function initMocks(vm, mocks) {
  2883. var mpInstance = vm.$mp[vm.mpType];
  2884. mocks.forEach(function (mock) {
  2885. if (hasOwn(mpInstance, mock)) {
  2886. vm[mock] = mpInstance[mock];
  2887. }
  2888. });
  2889. }
  2890. function hasHook(hook, vueOptions) {
  2891. if (!vueOptions) {
  2892. return true;
  2893. }
  2894. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2895. return true;
  2896. }
  2897. vueOptions = vueOptions.default || vueOptions;
  2898. if (isFn(vueOptions)) {
  2899. if (isFn(vueOptions.extendOptions[hook])) {
  2900. return true;
  2901. }
  2902. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2903. return true;
  2904. }
  2905. return false;
  2906. }
  2907. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2908. return true;
  2909. }
  2910. var mixins = vueOptions.mixins;
  2911. if (Array.isArray(mixins)) {
  2912. return !!mixins.find(function (mixin) {
  2913. return hasHook(hook, mixin);
  2914. });
  2915. }
  2916. }
  2917. function initHooks(mpOptions, hooks, vueOptions) {
  2918. hooks.forEach(function (hook) {
  2919. if (hasHook(hook, vueOptions)) {
  2920. mpOptions[hook] = function (args) {
  2921. return this.$vm && this.$vm.__call_hook(hook, args);
  2922. };
  2923. }
  2924. });
  2925. }
  2926. function initUnknownHooks(mpOptions, vueOptions) {
  2927. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2928. findHooks(vueOptions).forEach(function (hook) {
  2929. return initHook$1(mpOptions, hook, excludes);
  2930. });
  2931. }
  2932. function findHooks(vueOptions) {
  2933. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2934. if (vueOptions) {
  2935. Object.keys(vueOptions).forEach(function (name) {
  2936. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2937. hooks.push(name);
  2938. }
  2939. });
  2940. }
  2941. return hooks;
  2942. }
  2943. function initHook$1(mpOptions, hook, excludes) {
  2944. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2945. mpOptions[hook] = function (args) {
  2946. return this.$vm && this.$vm.__call_hook(hook, args);
  2947. };
  2948. }
  2949. }
  2950. function initVueComponent(Vue, vueOptions) {
  2951. vueOptions = vueOptions.default || vueOptions;
  2952. var VueComponent;
  2953. if (isFn(vueOptions)) {
  2954. VueComponent = vueOptions;
  2955. } else {
  2956. VueComponent = Vue.extend(vueOptions);
  2957. }
  2958. vueOptions = VueComponent.options;
  2959. return [VueComponent, vueOptions];
  2960. }
  2961. function initSlots(vm, vueSlots) {
  2962. if (Array.isArray(vueSlots) && vueSlots.length) {
  2963. var $slots = Object.create(null);
  2964. vueSlots.forEach(function (slotName) {
  2965. $slots[slotName] = true;
  2966. });
  2967. vm.$scopedSlots = vm.$slots = $slots;
  2968. }
  2969. }
  2970. function initVueIds(vueIds, mpInstance) {
  2971. vueIds = (vueIds || '').split(',');
  2972. var len = vueIds.length;
  2973. if (len === 1) {
  2974. mpInstance._$vueId = vueIds[0];
  2975. } else if (len === 2) {
  2976. mpInstance._$vueId = vueIds[0];
  2977. mpInstance._$vuePid = vueIds[1];
  2978. }
  2979. }
  2980. function initData(vueOptions, context) {
  2981. var data = vueOptions.data || {};
  2982. var methods = vueOptions.methods || {};
  2983. if (typeof data === 'function') {
  2984. try {
  2985. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2986. } catch (e) {
  2987. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"采空区巡检","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2988. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2989. }
  2990. }
  2991. } else {
  2992. try {
  2993. // 对 data 格式化
  2994. data = JSON.parse(JSON.stringify(data));
  2995. } catch (e) {}
  2996. }
  2997. if (!isPlainObject(data)) {
  2998. data = {};
  2999. }
  3000. Object.keys(methods).forEach(function (methodName) {
  3001. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  3002. data[methodName] = methods[methodName];
  3003. }
  3004. });
  3005. return data;
  3006. }
  3007. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  3008. function createObserver(name) {
  3009. return function observer(newVal, oldVal) {
  3010. if (this.$vm) {
  3011. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  3012. }
  3013. };
  3014. }
  3015. function initBehaviors(vueOptions, initBehavior) {
  3016. var vueBehaviors = vueOptions.behaviors;
  3017. var vueExtends = vueOptions.extends;
  3018. var vueMixins = vueOptions.mixins;
  3019. var vueProps = vueOptions.props;
  3020. if (!vueProps) {
  3021. vueOptions.props = vueProps = [];
  3022. }
  3023. var behaviors = [];
  3024. if (Array.isArray(vueBehaviors)) {
  3025. vueBehaviors.forEach(function (behavior) {
  3026. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  3027. if (behavior === 'uni://form-field') {
  3028. if (Array.isArray(vueProps)) {
  3029. vueProps.push('name');
  3030. vueProps.push('value');
  3031. } else {
  3032. vueProps.name = {
  3033. type: String,
  3034. default: ''
  3035. };
  3036. vueProps.value = {
  3037. type: [String, Number, Boolean, Array, Object, Date],
  3038. default: ''
  3039. };
  3040. }
  3041. }
  3042. });
  3043. }
  3044. if (isPlainObject(vueExtends) && vueExtends.props) {
  3045. behaviors.push(initBehavior({
  3046. properties: initProperties(vueExtends.props, true)
  3047. }));
  3048. }
  3049. if (Array.isArray(vueMixins)) {
  3050. vueMixins.forEach(function (vueMixin) {
  3051. if (isPlainObject(vueMixin) && vueMixin.props) {
  3052. behaviors.push(initBehavior({
  3053. properties: initProperties(vueMixin.props, true)
  3054. }));
  3055. }
  3056. });
  3057. }
  3058. return behaviors;
  3059. }
  3060. function parsePropType(key, type, defaultValue, file) {
  3061. // [String]=>String
  3062. if (Array.isArray(type) && type.length === 1) {
  3063. return type[0];
  3064. }
  3065. return type;
  3066. }
  3067. function initProperties(props) {
  3068. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  3069. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  3070. var options = arguments.length > 3 ? arguments[3] : undefined;
  3071. var properties = {};
  3072. if (!isBehavior) {
  3073. properties.vueId = {
  3074. type: String,
  3075. value: ''
  3076. };
  3077. {
  3078. if (options.virtualHost) {
  3079. properties.virtualHostStyle = {
  3080. type: null,
  3081. value: ''
  3082. };
  3083. properties.virtualHostClass = {
  3084. type: null,
  3085. value: ''
  3086. };
  3087. }
  3088. }
  3089. // scopedSlotsCompiler auto
  3090. properties.scopedSlotsCompiler = {
  3091. type: String,
  3092. value: ''
  3093. };
  3094. properties.vueSlots = {
  3095. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  3096. type: null,
  3097. value: [],
  3098. observer: function observer(newVal, oldVal) {
  3099. var $slots = Object.create(null);
  3100. newVal.forEach(function (slotName) {
  3101. $slots[slotName] = true;
  3102. });
  3103. this.setData({
  3104. $slots: $slots
  3105. });
  3106. }
  3107. };
  3108. }
  3109. if (Array.isArray(props)) {
  3110. // ['title']
  3111. props.forEach(function (key) {
  3112. properties[key] = {
  3113. type: null,
  3114. observer: createObserver(key)
  3115. };
  3116. });
  3117. } else if (isPlainObject(props)) {
  3118. // {title:{type:String,default:''},content:String}
  3119. Object.keys(props).forEach(function (key) {
  3120. var opts = props[key];
  3121. if (isPlainObject(opts)) {
  3122. // title:{type:String,default:''}
  3123. var value = opts.default;
  3124. if (isFn(value)) {
  3125. value = value();
  3126. }
  3127. opts.type = parsePropType(key, opts.type);
  3128. properties[key] = {
  3129. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  3130. value: value,
  3131. observer: createObserver(key)
  3132. };
  3133. } else {
  3134. // content:String
  3135. var type = parsePropType(key, opts);
  3136. properties[key] = {
  3137. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  3138. observer: createObserver(key)
  3139. };
  3140. }
  3141. });
  3142. }
  3143. return properties;
  3144. }
  3145. function wrapper$1(event) {
  3146. // TODO 又得兼容 mpvue 的 mp 对象
  3147. try {
  3148. event.mp = JSON.parse(JSON.stringify(event));
  3149. } catch (e) {}
  3150. event.stopPropagation = noop;
  3151. event.preventDefault = noop;
  3152. event.target = event.target || {};
  3153. if (!hasOwn(event, 'detail')) {
  3154. event.detail = {};
  3155. }
  3156. if (hasOwn(event, 'markerId')) {
  3157. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  3158. event.detail.markerId = event.markerId;
  3159. }
  3160. if (isPlainObject(event.detail)) {
  3161. event.target = Object.assign({}, event.target, event.detail);
  3162. }
  3163. return event;
  3164. }
  3165. function getExtraValue(vm, dataPathsArray) {
  3166. var context = vm;
  3167. dataPathsArray.forEach(function (dataPathArray) {
  3168. var dataPath = dataPathArray[0];
  3169. var value = dataPathArray[2];
  3170. if (dataPath || typeof value !== 'undefined') {
  3171. // ['','',index,'disable']
  3172. var propPath = dataPathArray[1];
  3173. var valuePath = dataPathArray[3];
  3174. var vFor;
  3175. if (Number.isInteger(dataPath)) {
  3176. vFor = dataPath;
  3177. } else if (!dataPath) {
  3178. vFor = context;
  3179. } else if (typeof dataPath === 'string' && dataPath) {
  3180. if (dataPath.indexOf('#s#') === 0) {
  3181. vFor = dataPath.substr(3);
  3182. } else {
  3183. vFor = vm.__get_value(dataPath, context);
  3184. }
  3185. }
  3186. if (Number.isInteger(vFor)) {
  3187. context = value;
  3188. } else if (!propPath) {
  3189. context = vFor[value];
  3190. } else {
  3191. if (Array.isArray(vFor)) {
  3192. context = vFor.find(function (vForItem) {
  3193. return vm.__get_value(propPath, vForItem) === value;
  3194. });
  3195. } else if (isPlainObject(vFor)) {
  3196. context = Object.keys(vFor).find(function (vForKey) {
  3197. return vm.__get_value(propPath, vFor[vForKey]) === value;
  3198. });
  3199. } else {
  3200. console.error('v-for 暂不支持循环数据:', vFor);
  3201. }
  3202. }
  3203. if (valuePath) {
  3204. context = vm.__get_value(valuePath, context);
  3205. }
  3206. }
  3207. });
  3208. return context;
  3209. }
  3210. function processEventExtra(vm, extra, event, __args__) {
  3211. var extraObj = {};
  3212. if (Array.isArray(extra) && extra.length) {
  3213. /**
  3214. *[
  3215. * ['data.items', 'data.id', item.data.id],
  3216. * ['metas', 'id', meta.id]
  3217. *],
  3218. *[
  3219. * ['data.items', 'data.id', item.data.id],
  3220. * ['metas', 'id', meta.id]
  3221. *],
  3222. *'test'
  3223. */
  3224. extra.forEach(function (dataPath, index) {
  3225. if (typeof dataPath === 'string') {
  3226. if (!dataPath) {
  3227. // model,prop.sync
  3228. extraObj['$' + index] = vm;
  3229. } else {
  3230. if (dataPath === '$event') {
  3231. // $event
  3232. extraObj['$' + index] = event;
  3233. } else if (dataPath === 'arguments') {
  3234. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  3235. } else if (dataPath.indexOf('$event.') === 0) {
  3236. // $event.target.value
  3237. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  3238. } else {
  3239. extraObj['$' + index] = vm.__get_value(dataPath);
  3240. }
  3241. }
  3242. } else {
  3243. extraObj['$' + index] = getExtraValue(vm, dataPath);
  3244. }
  3245. });
  3246. }
  3247. return extraObj;
  3248. }
  3249. function getObjByArray(arr) {
  3250. var obj = {};
  3251. for (var i = 1; i < arr.length; i++) {
  3252. var element = arr[i];
  3253. obj[element[0]] = element[1];
  3254. }
  3255. return obj;
  3256. }
  3257. function processEventArgs(vm, event) {
  3258. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  3259. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  3260. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  3261. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  3262. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  3263. // fixed 用户直接触发 mpInstance.triggerEvent
  3264. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  3265. if (isCustom) {
  3266. // 自定义事件
  3267. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  3268. if (!args.length) {
  3269. // 无参数,直接传入 event 或 detail 数组
  3270. if (isCustomMPEvent) {
  3271. return [event];
  3272. }
  3273. return __args__;
  3274. }
  3275. }
  3276. var extraObj = processEventExtra(vm, extra, event, __args__);
  3277. var ret = [];
  3278. args.forEach(function (arg) {
  3279. if (arg === '$event') {
  3280. if (methodName === '__set_model' && !isCustom) {
  3281. // input v-model value
  3282. ret.push(event.target.value);
  3283. } else {
  3284. if (isCustom && !isCustomMPEvent) {
  3285. ret.push(__args__[0]);
  3286. } else {
  3287. // wxcomponent 组件或内置组件
  3288. ret.push(event);
  3289. }
  3290. }
  3291. } else {
  3292. if (Array.isArray(arg) && arg[0] === 'o') {
  3293. ret.push(getObjByArray(arg));
  3294. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  3295. ret.push(extraObj[arg]);
  3296. } else {
  3297. ret.push(arg);
  3298. }
  3299. }
  3300. });
  3301. return ret;
  3302. }
  3303. var ONCE = '~';
  3304. var CUSTOM = '^';
  3305. function isMatchEventType(eventType, optType) {
  3306. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  3307. }
  3308. function getContextVm(vm) {
  3309. var $parent = vm.$parent;
  3310. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  3311. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  3312. $parent = $parent.$parent;
  3313. }
  3314. return $parent && $parent.$parent;
  3315. }
  3316. function handleEvent(event) {
  3317. var _this2 = this;
  3318. event = wrapper$1(event);
  3319. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  3320. var dataset = (event.currentTarget || event.target).dataset;
  3321. if (!dataset) {
  3322. return console.warn('事件信息不存在');
  3323. }
  3324. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3325. if (!eventOpts) {
  3326. return console.warn('事件信息不存在');
  3327. }
  3328. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3329. var eventType = event.type;
  3330. var ret = [];
  3331. eventOpts.forEach(function (eventOpt) {
  3332. var type = eventOpt[0];
  3333. var eventsArray = eventOpt[1];
  3334. var isCustom = type.charAt(0) === CUSTOM;
  3335. type = isCustom ? type.slice(1) : type;
  3336. var isOnce = type.charAt(0) === ONCE;
  3337. type = isOnce ? type.slice(1) : type;
  3338. if (eventsArray && isMatchEventType(eventType, type)) {
  3339. eventsArray.forEach(function (eventArray) {
  3340. var methodName = eventArray[0];
  3341. if (methodName) {
  3342. var handlerCtx = _this2.$vm;
  3343. if (handlerCtx.$options.generic) {
  3344. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3345. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3346. }
  3347. if (methodName === '$emit') {
  3348. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3349. return;
  3350. }
  3351. var handler = handlerCtx[methodName];
  3352. if (!isFn(handler)) {
  3353. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3354. var path = _this2.route || _this2.is;
  3355. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3356. }
  3357. if (isOnce) {
  3358. if (handler.once) {
  3359. return;
  3360. }
  3361. handler.once = true;
  3362. }
  3363. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3364. params = Array.isArray(params) ? params : [];
  3365. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3366. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3367. // eslint-disable-next-line no-sparse-arrays
  3368. params = params.concat([,,,,,,,,,, event]);
  3369. }
  3370. ret.push(handler.apply(handlerCtx, params));
  3371. }
  3372. });
  3373. }
  3374. });
  3375. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3376. return ret[0];
  3377. }
  3378. }
  3379. var eventChannels = {};
  3380. var eventChannelStack = [];
  3381. function getEventChannel(id) {
  3382. if (id) {
  3383. var eventChannel = eventChannels[id];
  3384. delete eventChannels[id];
  3385. return eventChannel;
  3386. }
  3387. return eventChannelStack.shift();
  3388. }
  3389. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3390. function initEventChannel() {
  3391. _vue.default.prototype.getOpenerEventChannel = function () {
  3392. // 微信小程序使用自身getOpenerEventChannel
  3393. {
  3394. return this.$scope.getOpenerEventChannel();
  3395. }
  3396. };
  3397. var callHook = _vue.default.prototype.__call_hook;
  3398. _vue.default.prototype.__call_hook = function (hook, args) {
  3399. if (hook === 'onLoad' && args && args.__id__) {
  3400. this.__eventChannel__ = getEventChannel(args.__id__);
  3401. delete args.__id__;
  3402. }
  3403. return callHook.call(this, hook, args);
  3404. };
  3405. }
  3406. function initScopedSlotsParams() {
  3407. var center = {};
  3408. var parents = {};
  3409. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  3410. var has = center[vueId];
  3411. if (!has) {
  3412. parents[vueId] = this;
  3413. this.$on('hook:destroyed', function () {
  3414. delete parents[vueId];
  3415. });
  3416. }
  3417. return has;
  3418. };
  3419. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  3420. var data = center[vueId];
  3421. if (data) {
  3422. var object = data[name] || {};
  3423. return key ? object[key] : object;
  3424. } else {
  3425. parents[vueId] = this;
  3426. this.$on('hook:destroyed', function () {
  3427. delete parents[vueId];
  3428. });
  3429. }
  3430. };
  3431. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  3432. var vueIds = this.$options.propsData.vueId;
  3433. if (vueIds) {
  3434. var vueId = vueIds.split(',')[0];
  3435. var object = center[vueId] = center[vueId] || {};
  3436. object[name] = value;
  3437. if (parents[vueId]) {
  3438. parents[vueId].$forceUpdate();
  3439. }
  3440. }
  3441. };
  3442. _vue.default.mixin({
  3443. destroyed: function destroyed() {
  3444. var propsData = this.$options.propsData;
  3445. var vueId = propsData && propsData.vueId;
  3446. if (vueId) {
  3447. delete center[vueId];
  3448. delete parents[vueId];
  3449. }
  3450. }
  3451. });
  3452. }
  3453. function parseBaseApp(vm, _ref4) {
  3454. var mocks = _ref4.mocks,
  3455. initRefs = _ref4.initRefs;
  3456. initEventChannel();
  3457. {
  3458. initScopedSlotsParams();
  3459. }
  3460. if (vm.$options.store) {
  3461. _vue.default.prototype.$store = vm.$options.store;
  3462. }
  3463. uniIdMixin(_vue.default);
  3464. _vue.default.prototype.mpHost = "mp-weixin";
  3465. _vue.default.mixin({
  3466. beforeCreate: function beforeCreate() {
  3467. if (!this.$options.mpType) {
  3468. return;
  3469. }
  3470. this.mpType = this.$options.mpType;
  3471. this.$mp = (0, _defineProperty2.default)({
  3472. data: {}
  3473. }, this.mpType, this.$options.mpInstance);
  3474. this.$scope = this.$options.mpInstance;
  3475. delete this.$options.mpType;
  3476. delete this.$options.mpInstance;
  3477. if (this.mpType === 'page' && typeof getApp === 'function') {
  3478. // hack vue-i18n
  3479. var app = getApp();
  3480. if (app.$vm && app.$vm.$i18n) {
  3481. this._i18n = app.$vm.$i18n;
  3482. }
  3483. }
  3484. if (this.mpType !== 'app') {
  3485. initRefs(this);
  3486. initMocks(this, mocks);
  3487. }
  3488. }
  3489. });
  3490. var appOptions = {
  3491. onLaunch: function onLaunch(args) {
  3492. if (this.$vm) {
  3493. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3494. return;
  3495. }
  3496. {
  3497. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3498. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3499. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3500. }
  3501. }
  3502. this.$vm = vm;
  3503. this.$vm.$mp = {
  3504. app: this
  3505. };
  3506. this.$vm.$scope = this;
  3507. // vm 上也挂载 globalData
  3508. this.$vm.globalData = this.globalData;
  3509. this.$vm._isMounted = true;
  3510. this.$vm.__call_hook('mounted', args);
  3511. this.$vm.__call_hook('onLaunch', args);
  3512. }
  3513. };
  3514. // 兼容旧版本 globalData
  3515. appOptions.globalData = vm.$options.globalData || {};
  3516. // 将 methods 中的方法挂在 getApp() 中
  3517. var methods = vm.$options.methods;
  3518. if (methods) {
  3519. Object.keys(methods).forEach(function (name) {
  3520. appOptions[name] = methods[name];
  3521. });
  3522. }
  3523. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3524. initHooks(appOptions, hooks);
  3525. initUnknownHooks(appOptions, vm.$options);
  3526. return appOptions;
  3527. }
  3528. function parseApp(vm) {
  3529. return parseBaseApp(vm, {
  3530. mocks: mocks,
  3531. initRefs: initRefs
  3532. });
  3533. }
  3534. function createApp(vm) {
  3535. App(parseApp(vm));
  3536. return vm;
  3537. }
  3538. var encodeReserveRE = /[!'()*]/g;
  3539. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3540. return '%' + c.charCodeAt(0).toString(16);
  3541. };
  3542. var commaRE = /%2C/g;
  3543. // fixed encodeURIComponent which is more conformant to RFC3986:
  3544. // - escapes [!'()*]
  3545. // - preserve commas
  3546. var encode = function encode(str) {
  3547. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3548. };
  3549. function stringifyQuery(obj) {
  3550. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3551. var res = obj ? Object.keys(obj).map(function (key) {
  3552. var val = obj[key];
  3553. if (val === undefined) {
  3554. return '';
  3555. }
  3556. if (val === null) {
  3557. return encodeStr(key);
  3558. }
  3559. if (Array.isArray(val)) {
  3560. var result = [];
  3561. val.forEach(function (val2) {
  3562. if (val2 === undefined) {
  3563. return;
  3564. }
  3565. if (val2 === null) {
  3566. result.push(encodeStr(key));
  3567. } else {
  3568. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3569. }
  3570. });
  3571. return result.join('&');
  3572. }
  3573. return encodeStr(key) + '=' + encodeStr(val);
  3574. }).filter(function (x) {
  3575. return x.length > 0;
  3576. }).join('&') : null;
  3577. return res ? "?".concat(res) : '';
  3578. }
  3579. function parseBaseComponent(vueComponentOptions) {
  3580. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3581. isPage = _ref5.isPage,
  3582. initRelation = _ref5.initRelation;
  3583. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3584. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3585. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3586. VueComponent = _initVueComponent2[0],
  3587. vueOptions = _initVueComponent2[1];
  3588. var options = _objectSpread({
  3589. multipleSlots: true,
  3590. addGlobalClass: true
  3591. }, vueOptions.options || {});
  3592. {
  3593. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3594. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3595. Object.assign(options, vueOptions['mp-weixin'].options);
  3596. }
  3597. }
  3598. var componentOptions = {
  3599. options: options,
  3600. data: initData(vueOptions, _vue.default.prototype),
  3601. behaviors: initBehaviors(vueOptions, initBehavior),
  3602. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3603. lifetimes: {
  3604. attached: function attached() {
  3605. var properties = this.properties;
  3606. var options = {
  3607. mpType: isPage.call(this) ? 'page' : 'component',
  3608. mpInstance: this,
  3609. propsData: properties
  3610. };
  3611. initVueIds(properties.vueId, this);
  3612. // 处理父子关系
  3613. initRelation.call(this, {
  3614. vuePid: this._$vuePid,
  3615. vueOptions: options
  3616. });
  3617. // 初始化 vue 实例
  3618. this.$vm = new VueComponent(options);
  3619. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3620. initSlots(this.$vm, properties.vueSlots);
  3621. // 触发首次 setData
  3622. this.$vm.$mount();
  3623. },
  3624. ready: function ready() {
  3625. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3626. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3627. if (this.$vm) {
  3628. this.$vm._isMounted = true;
  3629. this.$vm.__call_hook('mounted');
  3630. this.$vm.__call_hook('onReady');
  3631. }
  3632. },
  3633. detached: function detached() {
  3634. this.$vm && this.$vm.$destroy();
  3635. }
  3636. },
  3637. pageLifetimes: {
  3638. show: function show(args) {
  3639. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3640. },
  3641. hide: function hide() {
  3642. this.$vm && this.$vm.__call_hook('onPageHide');
  3643. },
  3644. resize: function resize(size) {
  3645. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3646. }
  3647. },
  3648. methods: {
  3649. __l: handleLink,
  3650. __e: handleEvent
  3651. }
  3652. };
  3653. // externalClasses
  3654. if (vueOptions.externalClasses) {
  3655. componentOptions.externalClasses = vueOptions.externalClasses;
  3656. }
  3657. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3658. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3659. componentOptions.methods[callMethod] = function (args) {
  3660. return this.$vm[callMethod](args);
  3661. };
  3662. });
  3663. }
  3664. if (needVueOptions) {
  3665. return [componentOptions, vueOptions, VueComponent];
  3666. }
  3667. if (isPage) {
  3668. return componentOptions;
  3669. }
  3670. return [componentOptions, VueComponent];
  3671. }
  3672. function parseComponent(vueComponentOptions, needVueOptions) {
  3673. return parseBaseComponent(vueComponentOptions, {
  3674. isPage: isPage,
  3675. initRelation: initRelation
  3676. }, needVueOptions);
  3677. }
  3678. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3679. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3680. function parseBasePage(vuePageOptions) {
  3681. var _parseComponent = parseComponent(vuePageOptions, true),
  3682. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3683. pageOptions = _parseComponent2[0],
  3684. vueOptions = _parseComponent2[1];
  3685. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3686. pageOptions.methods.onLoad = function (query) {
  3687. this.options = query;
  3688. var copyQuery = Object.assign({}, query);
  3689. delete copyQuery.__id__;
  3690. this.$page = {
  3691. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3692. };
  3693. this.$vm.$mp.query = query; // 兼容 mpvue
  3694. this.$vm.__call_hook('onLoad', query);
  3695. };
  3696. {
  3697. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3698. }
  3699. {
  3700. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  3701. }
  3702. return pageOptions;
  3703. }
  3704. function parsePage(vuePageOptions) {
  3705. return parseBasePage(vuePageOptions);
  3706. }
  3707. function createPage(vuePageOptions) {
  3708. {
  3709. return Component(parsePage(vuePageOptions));
  3710. }
  3711. }
  3712. function createComponent(vueOptions) {
  3713. {
  3714. return Component(parseComponent(vueOptions));
  3715. }
  3716. }
  3717. function createSubpackageApp(vm) {
  3718. var appOptions = parseApp(vm);
  3719. var app = getApp({
  3720. allowDefault: true
  3721. });
  3722. vm.$scope = app;
  3723. var globalData = app.globalData;
  3724. if (globalData) {
  3725. Object.keys(appOptions.globalData).forEach(function (name) {
  3726. if (!hasOwn(globalData, name)) {
  3727. globalData[name] = appOptions.globalData[name];
  3728. }
  3729. });
  3730. }
  3731. Object.keys(appOptions).forEach(function (name) {
  3732. if (!hasOwn(app, name)) {
  3733. app[name] = appOptions[name];
  3734. }
  3735. });
  3736. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3737. wx.onAppShow(function () {
  3738. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3739. args[_key5] = arguments[_key5];
  3740. }
  3741. vm.__call_hook('onShow', args);
  3742. });
  3743. }
  3744. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3745. wx.onAppHide(function () {
  3746. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3747. args[_key6] = arguments[_key6];
  3748. }
  3749. vm.__call_hook('onHide', args);
  3750. });
  3751. }
  3752. if (isFn(appOptions.onLaunch)) {
  3753. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3754. vm.__call_hook('onLaunch', args);
  3755. }
  3756. return vm;
  3757. }
  3758. function createPlugin(vm) {
  3759. var appOptions = parseApp(vm);
  3760. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3761. wx.onAppShow(function () {
  3762. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3763. args[_key7] = arguments[_key7];
  3764. }
  3765. vm.__call_hook('onShow', args);
  3766. });
  3767. }
  3768. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3769. wx.onAppHide(function () {
  3770. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3771. args[_key8] = arguments[_key8];
  3772. }
  3773. vm.__call_hook('onHide', args);
  3774. });
  3775. }
  3776. if (isFn(appOptions.onLaunch)) {
  3777. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3778. vm.__call_hook('onLaunch', args);
  3779. }
  3780. return vm;
  3781. }
  3782. todos.forEach(function (todoApi) {
  3783. protocols[todoApi] = false;
  3784. });
  3785. canIUses.forEach(function (canIUseApi) {
  3786. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3787. if (!wx.canIUse(apiName)) {
  3788. protocols[canIUseApi] = false;
  3789. }
  3790. });
  3791. var uni = {};
  3792. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3793. uni = new Proxy({}, {
  3794. get: function get(target, name) {
  3795. if (hasOwn(target, name)) {
  3796. return target[name];
  3797. }
  3798. if (baseApi[name]) {
  3799. return baseApi[name];
  3800. }
  3801. if (api[name]) {
  3802. return promisify(name, api[name]);
  3803. }
  3804. {
  3805. if (extraApi[name]) {
  3806. return promisify(name, extraApi[name]);
  3807. }
  3808. if (todoApis[name]) {
  3809. return promisify(name, todoApis[name]);
  3810. }
  3811. }
  3812. if (eventApi[name]) {
  3813. return eventApi[name];
  3814. }
  3815. return promisify(name, wrapper(name, wx[name]));
  3816. },
  3817. set: function set(target, name, value) {
  3818. target[name] = value;
  3819. return true;
  3820. }
  3821. });
  3822. } else {
  3823. Object.keys(baseApi).forEach(function (name) {
  3824. uni[name] = baseApi[name];
  3825. });
  3826. {
  3827. Object.keys(todoApis).forEach(function (name) {
  3828. uni[name] = promisify(name, todoApis[name]);
  3829. });
  3830. Object.keys(extraApi).forEach(function (name) {
  3831. uni[name] = promisify(name, todoApis[name]);
  3832. });
  3833. }
  3834. Object.keys(eventApi).forEach(function (name) {
  3835. uni[name] = eventApi[name];
  3836. });
  3837. Object.keys(api).forEach(function (name) {
  3838. uni[name] = promisify(name, api[name]);
  3839. });
  3840. Object.keys(wx).forEach(function (name) {
  3841. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3842. uni[name] = promisify(name, wrapper(name, wx[name]));
  3843. }
  3844. });
  3845. }
  3846. wx.createApp = createApp;
  3847. wx.createPage = createPage;
  3848. wx.createComponent = createComponent;
  3849. wx.createSubpackageApp = createSubpackageApp;
  3850. wx.createPlugin = createPlugin;
  3851. var uni$1 = uni;
  3852. var _default = uni$1;
  3853. exports.default = _default;
  3854. /* 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)))
  3855. /***/ }),
  3856. /***/ 20:
  3857. /*!****************************************************************!*\
  3858. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3859. \****************************************************************/
  3860. /*! no static exports found */
  3861. /***/ (function(module, exports) {
  3862. function _iterableToArray(iter) {
  3863. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3864. }
  3865. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3866. /***/ }),
  3867. /***/ 21:
  3868. /*!******************************************************************!*\
  3869. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3870. \******************************************************************/
  3871. /*! no static exports found */
  3872. /***/ (function(module, exports) {
  3873. function _nonIterableSpread() {
  3874. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3875. }
  3876. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3877. /***/ }),
  3878. /***/ 210:
  3879. /*!************************************************************************************!*\
  3880. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  3881. \************************************************************************************/
  3882. /*! no static exports found */
  3883. /***/ (function(module, exports, __webpack_require__) {
  3884. "use strict";
  3885. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  3886. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3887. Object.defineProperty(exports, "__esModule", {
  3888. value: true
  3889. });
  3890. exports.default = void 0;
  3891. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  3892. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 186));
  3893. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3894. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3895. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  3896. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  3897. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 184));
  3898. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 185));
  3899. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 187));
  3900. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 211));
  3901. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  3902. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3903. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3904. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  3905. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 213));
  3906. 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; } } }; }
  3907. 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); }
  3908. 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; }
  3909. 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); }; }
  3910. 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; } }
  3911. 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; }
  3912. 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; }
  3913. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  3914. function n(e) {
  3915. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  3916. }
  3917. function s(e, t, n) {
  3918. return e(n = {
  3919. path: t,
  3920. exports: {},
  3921. require: function require(e, t) {
  3922. return function () {
  3923. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  3924. }(null == t && n.path);
  3925. }
  3926. }, n.exports), n.exports;
  3927. }
  3928. var r = s(function (e, t) {
  3929. var n;
  3930. e.exports = (n = n || function (e, t) {
  3931. var n = Object.create || function () {
  3932. function e() {}
  3933. return function (t) {
  3934. var n;
  3935. return e.prototype = t, n = new e(), e.prototype = null, n;
  3936. };
  3937. }(),
  3938. s = {},
  3939. r = s.lib = {},
  3940. i = r.Base = {
  3941. extend: function extend(e) {
  3942. var t = n(this);
  3943. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  3944. t.$super.init.apply(this, arguments);
  3945. }), t.init.prototype = t, t.$super = this, t;
  3946. },
  3947. create: function create() {
  3948. var e = this.extend();
  3949. return e.init.apply(e, arguments), e;
  3950. },
  3951. init: function init() {},
  3952. mixIn: function mixIn(e) {
  3953. for (var t in e) {
  3954. e.hasOwnProperty(t) && (this[t] = e[t]);
  3955. }
  3956. e.hasOwnProperty("toString") && (this.toString = e.toString);
  3957. },
  3958. clone: function clone() {
  3959. return this.init.prototype.extend(this);
  3960. }
  3961. },
  3962. o = r.WordArray = i.extend({
  3963. init: function init(e, n) {
  3964. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  3965. },
  3966. toString: function toString(e) {
  3967. return (e || c).stringify(this);
  3968. },
  3969. concat: function concat(e) {
  3970. var t = this.words,
  3971. n = e.words,
  3972. s = this.sigBytes,
  3973. r = e.sigBytes;
  3974. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  3975. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  3976. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  3977. } else for (i = 0; i < r; i += 4) {
  3978. t[s + i >>> 2] = n[i >>> 2];
  3979. }
  3980. return this.sigBytes += r, this;
  3981. },
  3982. clamp: function clamp() {
  3983. var t = this.words,
  3984. n = this.sigBytes;
  3985. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  3986. },
  3987. clone: function clone() {
  3988. var e = i.clone.call(this);
  3989. return e.words = this.words.slice(0), e;
  3990. },
  3991. random: function random(t) {
  3992. for (var n, s = [], r = function r(t) {
  3993. t = t;
  3994. var n = 987654321,
  3995. s = 4294967295;
  3996. return function () {
  3997. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  3998. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  3999. };
  4000. }, i = 0; i < t; i += 4) {
  4001. var a = r(4294967296 * (n || e.random()));
  4002. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  4003. }
  4004. return new o.init(s, t);
  4005. }
  4006. }),
  4007. a = s.enc = {},
  4008. c = a.Hex = {
  4009. stringify: function stringify(e) {
  4010. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4011. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4012. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  4013. }
  4014. return s.join("");
  4015. },
  4016. parse: function parse(e) {
  4017. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  4018. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  4019. }
  4020. return new o.init(n, t / 2);
  4021. }
  4022. },
  4023. u = a.Latin1 = {
  4024. stringify: function stringify(e) {
  4025. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4026. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4027. s.push(String.fromCharCode(i));
  4028. }
  4029. return s.join("");
  4030. },
  4031. parse: function parse(e) {
  4032. for (var t = e.length, n = [], s = 0; s < t; s++) {
  4033. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  4034. }
  4035. return new o.init(n, t);
  4036. }
  4037. },
  4038. h = a.Utf8 = {
  4039. stringify: function stringify(e) {
  4040. try {
  4041. return decodeURIComponent(escape(u.stringify(e)));
  4042. } catch (e) {
  4043. throw new Error("Malformed UTF-8 data");
  4044. }
  4045. },
  4046. parse: function parse(e) {
  4047. return u.parse(unescape(encodeURIComponent(e)));
  4048. }
  4049. },
  4050. l = r.BufferedBlockAlgorithm = i.extend({
  4051. reset: function reset() {
  4052. this._data = new o.init(), this._nDataBytes = 0;
  4053. },
  4054. _append: function _append(e) {
  4055. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  4056. },
  4057. _process: function _process(t) {
  4058. var n = this._data,
  4059. s = n.words,
  4060. r = n.sigBytes,
  4061. i = this.blockSize,
  4062. a = r / (4 * i),
  4063. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  4064. u = e.min(4 * c, r);
  4065. if (c) {
  4066. for (var h = 0; h < c; h += i) {
  4067. this._doProcessBlock(s, h);
  4068. }
  4069. var l = s.splice(0, c);
  4070. n.sigBytes -= u;
  4071. }
  4072. return new o.init(l, u);
  4073. },
  4074. clone: function clone() {
  4075. var e = i.clone.call(this);
  4076. return e._data = this._data.clone(), e;
  4077. },
  4078. _minBufferSize: 0
  4079. });
  4080. r.Hasher = l.extend({
  4081. cfg: i.extend(),
  4082. init: function init(e) {
  4083. this.cfg = this.cfg.extend(e), this.reset();
  4084. },
  4085. reset: function reset() {
  4086. l.reset.call(this), this._doReset();
  4087. },
  4088. update: function update(e) {
  4089. return this._append(e), this._process(), this;
  4090. },
  4091. finalize: function finalize(e) {
  4092. return e && this._append(e), this._doFinalize();
  4093. },
  4094. blockSize: 16,
  4095. _createHelper: function _createHelper(e) {
  4096. return function (t, n) {
  4097. return new e.init(n).finalize(t);
  4098. };
  4099. },
  4100. _createHmacHelper: function _createHmacHelper(e) {
  4101. return function (t, n) {
  4102. return new d.HMAC.init(e, n).finalize(t);
  4103. };
  4104. }
  4105. });
  4106. var d = s.algo = {};
  4107. return s;
  4108. }(Math), n);
  4109. }),
  4110. i = r,
  4111. o = (s(function (e, t) {
  4112. var n;
  4113. e.exports = (n = i, function (e) {
  4114. var t = n,
  4115. s = t.lib,
  4116. r = s.WordArray,
  4117. i = s.Hasher,
  4118. o = t.algo,
  4119. a = [];
  4120. !function () {
  4121. for (var t = 0; t < 64; t++) {
  4122. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  4123. }
  4124. }();
  4125. var c = o.MD5 = i.extend({
  4126. _doReset: function _doReset() {
  4127. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  4128. },
  4129. _doProcessBlock: function _doProcessBlock(e, t) {
  4130. for (var n = 0; n < 16; n++) {
  4131. var s = t + n,
  4132. r = e[s];
  4133. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  4134. }
  4135. var i = this._hash.words,
  4136. o = e[t + 0],
  4137. c = e[t + 1],
  4138. p = e[t + 2],
  4139. f = e[t + 3],
  4140. g = e[t + 4],
  4141. m = e[t + 5],
  4142. y = e[t + 6],
  4143. _ = e[t + 7],
  4144. w = e[t + 8],
  4145. v = e[t + 9],
  4146. S = e[t + 10],
  4147. I = e[t + 11],
  4148. b = e[t + 12],
  4149. k = e[t + 13],
  4150. T = e[t + 14],
  4151. C = e[t + 15],
  4152. P = i[0],
  4153. A = i[1],
  4154. E = i[2],
  4155. O = i[3];
  4156. P = u(P, A, E, O, o, 7, a[0]), O = u(O, P, A, E, c, 12, a[1]), E = u(E, O, P, A, p, 17, a[2]), A = u(A, E, O, P, f, 22, a[3]), P = u(P, A, E, O, g, 7, a[4]), O = u(O, P, A, E, m, 12, a[5]), E = u(E, O, P, A, y, 17, a[6]), A = u(A, E, O, P, _, 22, a[7]), P = u(P, A, E, O, w, 7, a[8]), O = u(O, P, A, E, v, 12, a[9]), E = u(E, O, P, A, S, 17, a[10]), A = u(A, E, O, P, I, 22, a[11]), P = u(P, A, E, O, b, 7, a[12]), O = u(O, P, A, E, k, 12, a[13]), E = u(E, O, P, A, T, 17, a[14]), P = h(P, A = u(A, E, O, P, C, 22, a[15]), E, O, c, 5, a[16]), O = h(O, P, A, E, y, 9, a[17]), E = h(E, O, P, A, I, 14, a[18]), A = h(A, E, O, P, o, 20, a[19]), P = h(P, A, E, O, m, 5, a[20]), O = h(O, P, A, E, S, 9, a[21]), E = h(E, O, P, A, C, 14, a[22]), A = h(A, E, O, P, g, 20, a[23]), P = h(P, A, E, O, v, 5, a[24]), O = h(O, P, A, E, T, 9, a[25]), E = h(E, O, P, A, f, 14, a[26]), A = h(A, E, O, P, w, 20, a[27]), P = h(P, A, E, O, k, 5, a[28]), O = h(O, P, A, E, p, 9, a[29]), E = h(E, O, P, A, _, 14, a[30]), P = l(P, A = h(A, E, O, P, b, 20, a[31]), E, O, m, 4, a[32]), O = l(O, P, A, E, w, 11, a[33]), E = l(E, O, P, A, I, 16, a[34]), A = l(A, E, O, P, T, 23, a[35]), P = l(P, A, E, O, c, 4, a[36]), O = l(O, P, A, E, g, 11, a[37]), E = l(E, O, P, A, _, 16, a[38]), A = l(A, E, O, P, S, 23, a[39]), P = l(P, A, E, O, k, 4, a[40]), O = l(O, P, A, E, o, 11, a[41]), E = l(E, O, P, A, f, 16, a[42]), A = l(A, E, O, P, y, 23, a[43]), P = l(P, A, E, O, v, 4, a[44]), O = l(O, P, A, E, b, 11, a[45]), E = l(E, O, P, A, C, 16, a[46]), P = d(P, A = l(A, E, O, P, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, P, A, E, _, 10, a[49]), E = d(E, O, P, A, T, 15, a[50]), A = d(A, E, O, P, m, 21, a[51]), P = d(P, A, E, O, b, 6, a[52]), O = d(O, P, A, E, f, 10, a[53]), E = d(E, O, P, A, S, 15, a[54]), A = d(A, E, O, P, c, 21, a[55]), P = d(P, A, E, O, w, 6, a[56]), O = d(O, P, A, E, C, 10, a[57]), E = d(E, O, P, A, y, 15, a[58]), A = d(A, E, O, P, k, 21, a[59]), P = d(P, A, E, O, g, 6, a[60]), O = d(O, P, A, E, I, 10, a[61]), E = d(E, O, P, A, p, 15, a[62]), A = d(A, E, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + A | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  4157. },
  4158. _doFinalize: function _doFinalize() {
  4159. var t = this._data,
  4160. n = t.words,
  4161. s = 8 * this._nDataBytes,
  4162. r = 8 * t.sigBytes;
  4163. n[r >>> 5] |= 128 << 24 - r % 32;
  4164. var i = e.floor(s / 4294967296),
  4165. o = s;
  4166. 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();
  4167. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  4168. var h = c[u];
  4169. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  4170. }
  4171. return a;
  4172. },
  4173. clone: function clone() {
  4174. var e = i.clone.call(this);
  4175. return e._hash = this._hash.clone(), e;
  4176. }
  4177. });
  4178. function u(e, t, n, s, r, i, o) {
  4179. var a = e + (t & n | ~t & s) + r + o;
  4180. return (a << i | a >>> 32 - i) + t;
  4181. }
  4182. function h(e, t, n, s, r, i, o) {
  4183. var a = e + (t & s | n & ~s) + r + o;
  4184. return (a << i | a >>> 32 - i) + t;
  4185. }
  4186. function l(e, t, n, s, r, i, o) {
  4187. var a = e + (t ^ n ^ s) + r + o;
  4188. return (a << i | a >>> 32 - i) + t;
  4189. }
  4190. function d(e, t, n, s, r, i, o) {
  4191. var a = e + (n ^ (t | ~s)) + r + o;
  4192. return (a << i | a >>> 32 - i) + t;
  4193. }
  4194. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  4195. }(Math), n.MD5);
  4196. }), s(function (e, t) {
  4197. var n;
  4198. e.exports = (n = i, void function () {
  4199. var e = n,
  4200. t = e.lib.Base,
  4201. s = e.enc.Utf8;
  4202. e.algo.HMAC = t.extend({
  4203. init: function init(e, t) {
  4204. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  4205. var n = e.blockSize,
  4206. r = 4 * n;
  4207. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  4208. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  4209. a[u] ^= 1549556828, c[u] ^= 909522486;
  4210. }
  4211. i.sigBytes = o.sigBytes = r, this.reset();
  4212. },
  4213. reset: function reset() {
  4214. var e = this._hasher;
  4215. e.reset(), e.update(this._iKey);
  4216. },
  4217. update: function update(e) {
  4218. return this._hasher.update(e), this;
  4219. },
  4220. finalize: function finalize(e) {
  4221. var t = this._hasher,
  4222. n = t.finalize(e);
  4223. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  4224. }
  4225. });
  4226. }());
  4227. }), s(function (e, t) {
  4228. e.exports = i.HmacMD5;
  4229. })),
  4230. a = s(function (e, t) {
  4231. e.exports = i.enc.Utf8;
  4232. }),
  4233. c = s(function (e, t) {
  4234. var n;
  4235. e.exports = (n = i, function () {
  4236. var e = n,
  4237. t = e.lib.WordArray;
  4238. function s(e, n, s) {
  4239. for (var r = [], i = 0, o = 0; o < n; o++) {
  4240. if (o % 4) {
  4241. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  4242. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  4243. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  4244. }
  4245. }
  4246. return t.create(r, i);
  4247. }
  4248. e.enc.Base64 = {
  4249. stringify: function stringify(e) {
  4250. var t = e.words,
  4251. n = e.sigBytes,
  4252. s = this._map;
  4253. e.clamp();
  4254. for (var r = [], i = 0; i < n; i += 3) {
  4255. 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++) {
  4256. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  4257. }
  4258. }
  4259. var c = s.charAt(64);
  4260. if (c) for (; r.length % 4;) {
  4261. r.push(c);
  4262. }
  4263. return r.join("");
  4264. },
  4265. parse: function parse(e) {
  4266. var t = e.length,
  4267. n = this._map,
  4268. r = this._reverseMap;
  4269. if (!r) {
  4270. r = this._reverseMap = [];
  4271. for (var i = 0; i < n.length; i++) {
  4272. r[n.charCodeAt(i)] = i;
  4273. }
  4274. }
  4275. var o = n.charAt(64);
  4276. if (o) {
  4277. var a = e.indexOf(o);
  4278. -1 !== a && (t = a);
  4279. }
  4280. return s(e, t, r);
  4281. },
  4282. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  4283. };
  4284. }(), n.enc.Base64);
  4285. });
  4286. var u = "FUNCTION",
  4287. h = "OBJECT",
  4288. l = "CLIENT_DB",
  4289. d = "pending",
  4290. p = "fullfilled",
  4291. f = "rejected";
  4292. function g(e) {
  4293. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  4294. }
  4295. function m(e) {
  4296. return "object" === g(e);
  4297. }
  4298. function y(e) {
  4299. return "function" == typeof e;
  4300. }
  4301. function _(e) {
  4302. return function () {
  4303. try {
  4304. return e.apply(e, arguments);
  4305. } catch (e) {
  4306. console.error(e);
  4307. }
  4308. };
  4309. }
  4310. var w = "REJECTED",
  4311. v = "NOT_PENDING";
  4312. var S = /*#__PURE__*/function () {
  4313. function S() {
  4314. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  4315. e = _ref.createPromise,
  4316. _ref$retryRule = _ref.retryRule,
  4317. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  4318. (0, _classCallCheck2.default)(this, S);
  4319. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  4320. }
  4321. (0, _createClass2.default)(S, [{
  4322. key: "needRetry",
  4323. get: function get() {
  4324. if (!this.status) return !0;
  4325. switch (this.retryRule) {
  4326. case w:
  4327. return this.status === f;
  4328. case v:
  4329. return this.status !== d;
  4330. }
  4331. }
  4332. }, {
  4333. key: "exec",
  4334. value: function exec() {
  4335. var _this = this;
  4336. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  4337. return _this.status = p, Promise.resolve(e);
  4338. }, function (e) {
  4339. return _this.status = f, Promise.reject(e);
  4340. }), this.promise) : this.promise;
  4341. }
  4342. }]);
  4343. return S;
  4344. }();
  4345. function I(e) {
  4346. return function (t) {
  4347. return new Promise(function (n, s) {
  4348. uni[e](_objectSpread(_objectSpread({}, t), {}, {
  4349. success: function success(e) {
  4350. n(e);
  4351. },
  4352. fail: function fail(e) {
  4353. s(e);
  4354. }
  4355. }));
  4356. });
  4357. };
  4358. }
  4359. function b(e) {
  4360. return e && "string" == typeof e ? JSON.parse(e) : e;
  4361. }
  4362. var k = "development" === "development",
  4363. T = "mp-weixin",
  4364. C = "true" === undefined || !0 === undefined,
  4365. P = b([]),
  4366. A = "h5" === T ? "web" : "app-plus" === T ? "app" : T,
  4367. E = b(undefined),
  4368. O = b([]) || [],
  4369. x = true;
  4370. var R = "";
  4371. try {
  4372. R = (__webpack_require__(/*! uni-stat-config */ 214).default || __webpack_require__(/*! uni-stat-config */ 214)).appid;
  4373. } catch (e) {}
  4374. var U = {};
  4375. function L(e) {
  4376. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4377. var n, s;
  4378. return n = U, s = e, Object.prototype.hasOwnProperty.call(n, s) || (U[e] = t), U[e];
  4379. }
  4380. "app" === A && (U = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  4381. var N = ["invoke", "success", "fail", "complete"],
  4382. D = L("_globalUniCloudInterceptor");
  4383. function F(e, t) {
  4384. D[e] || (D[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  4385. N.indexOf(n) > -1 && function (e, t, n) {
  4386. var s = D[e][t];
  4387. s || (s = D[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  4388. }(e, n, t[n]);
  4389. });
  4390. }
  4391. function q(e, t) {
  4392. D[e] || (D[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  4393. N.indexOf(n) > -1 && function (e, t, n) {
  4394. var s = D[e][t];
  4395. if (!s) return;
  4396. var r = s.indexOf(n);
  4397. r > -1 && s.splice(r, 1);
  4398. }(e, n, t[n]);
  4399. }) : delete D[e];
  4400. }
  4401. function M(e, t) {
  4402. return e && 0 !== e.length ? e.reduce(function (e, n) {
  4403. return e.then(function () {
  4404. return n(t);
  4405. });
  4406. }, Promise.resolve()) : Promise.resolve();
  4407. }
  4408. function K(e, t) {
  4409. return D[e] && D[e][t] || [];
  4410. }
  4411. function j(e) {
  4412. F("callObject", e);
  4413. }
  4414. var B = L("_globalUniCloudListener"),
  4415. $ = "response",
  4416. W = "needLogin",
  4417. z = "refreshToken",
  4418. J = "clientdb",
  4419. H = "cloudfunction",
  4420. G = "cloudobject";
  4421. function V(e) {
  4422. return B[e] || (B[e] = []), B[e];
  4423. }
  4424. function Q(e, t) {
  4425. var n = V(e);
  4426. n.includes(t) || n.push(t);
  4427. }
  4428. function Y(e, t) {
  4429. var n = V(e),
  4430. s = n.indexOf(t);
  4431. -1 !== s && n.splice(s, 1);
  4432. }
  4433. function X(e, t) {
  4434. var n = V(e);
  4435. for (var _e2 = 0; _e2 < n.length; _e2++) {
  4436. (0, n[_e2])(t);
  4437. }
  4438. }
  4439. var Z,
  4440. ee = !1;
  4441. function te() {
  4442. return Z || (Z = new Promise(function (e) {
  4443. ee && e(), function t() {
  4444. if ("function" == typeof getCurrentPages) {
  4445. var _t2 = getCurrentPages();
  4446. _t2 && _t2[0] && (ee = !0, e());
  4447. }
  4448. ee || setTimeout(function () {
  4449. t();
  4450. }, 30);
  4451. }();
  4452. }), Z);
  4453. }
  4454. function ne(e) {
  4455. var t = {};
  4456. for (var _n2 in e) {
  4457. var _s2 = e[_n2];
  4458. y(_s2) && (t[_n2] = _(_s2));
  4459. }
  4460. return t;
  4461. }
  4462. var se = /*#__PURE__*/function (_Error) {
  4463. (0, _inherits2.default)(se, _Error);
  4464. var _super = _createSuper(se);
  4465. function se(e) {
  4466. var _this2;
  4467. (0, _classCallCheck2.default)(this, se);
  4468. _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;
  4469. return _this2;
  4470. }
  4471. (0, _createClass2.default)(se, [{
  4472. key: "toJson",
  4473. value: function toJson() {
  4474. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4475. if (!(e >= 10)) return e++, {
  4476. errCode: this.errCode,
  4477. errMsg: this.errMsg,
  4478. errSubject: this.errSubject,
  4479. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  4480. };
  4481. }
  4482. }]);
  4483. return se;
  4484. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  4485. var re = {
  4486. request: function request(e) {
  4487. return uni.request(e);
  4488. },
  4489. uploadFile: function uploadFile(e) {
  4490. return uni.uploadFile(e);
  4491. },
  4492. setStorageSync: function setStorageSync(e, t) {
  4493. return uni.setStorageSync(e, t);
  4494. },
  4495. getStorageSync: function getStorageSync(e) {
  4496. return uni.getStorageSync(e);
  4497. },
  4498. removeStorageSync: function removeStorageSync(e) {
  4499. return uni.removeStorageSync(e);
  4500. },
  4501. clearStorageSync: function clearStorageSync() {
  4502. return uni.clearStorageSync();
  4503. }
  4504. };
  4505. function ie() {
  4506. return {
  4507. token: re.getStorageSync("uni_id_token") || re.getStorageSync("uniIdToken"),
  4508. tokenExpired: re.getStorageSync("uni_id_token_expired")
  4509. };
  4510. }
  4511. function oe() {
  4512. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  4513. e = _ref2.token,
  4514. t = _ref2.tokenExpired;
  4515. e && re.setStorageSync("uni_id_token", e), t && re.setStorageSync("uni_id_token_expired", t);
  4516. }
  4517. var ae, ce;
  4518. function ue() {
  4519. return ae || (ae = uni.getSystemInfoSync()), ae;
  4520. }
  4521. function he() {
  4522. var e, t;
  4523. try {
  4524. if (uni.getLaunchOptionsSync) {
  4525. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  4526. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  4527. _n3 = _uni$getLaunchOptions.scene,
  4528. _s3 = _uni$getLaunchOptions.channel;
  4529. e = _s3, t = _n3;
  4530. }
  4531. } catch (e) {}
  4532. return {
  4533. channel: e,
  4534. scene: t
  4535. };
  4536. }
  4537. function le() {
  4538. var e = uni.getLocale && uni.getLocale() || "en";
  4539. if (ce) return _objectSpread(_objectSpread({}, ce), {}, {
  4540. locale: e,
  4541. LOCALE: e
  4542. });
  4543. var t = ue(),
  4544. n = t.deviceId,
  4545. s = t.osName,
  4546. r = t.uniPlatform,
  4547. i = t.appId,
  4548. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  4549. for (var _e3 = 0; _e3 < o.length; _e3++) {
  4550. delete t[o[_e3]];
  4551. }
  4552. return ce = _objectSpread(_objectSpread({
  4553. PLATFORM: r,
  4554. OS: s,
  4555. APPID: i,
  4556. DEVICEID: n
  4557. }, he()), t), _objectSpread(_objectSpread({}, ce), {}, {
  4558. locale: e,
  4559. LOCALE: e
  4560. });
  4561. }
  4562. var de = {
  4563. sign: function sign(e, t) {
  4564. var n = "";
  4565. return Object.keys(e).sort().forEach(function (t) {
  4566. e[t] && (n = n + "&" + t + "=" + e[t]);
  4567. }), n = n.slice(1), o(n, t).toString();
  4568. },
  4569. wrappedRequest: function wrappedRequest(e, t) {
  4570. return new Promise(function (n, s) {
  4571. t(Object.assign(e, {
  4572. complete: function complete(e) {
  4573. e || (e = {}), k && "web" === A && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  4574. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  4575. if (!e.statusCode || e.statusCode >= 400) return s(new se({
  4576. code: "SYS_ERR",
  4577. message: e.errMsg || "request:fail",
  4578. requestId: t
  4579. }));
  4580. var r = e.data;
  4581. if (r.error) return s(new se({
  4582. code: r.error.code,
  4583. message: r.error.message,
  4584. requestId: t
  4585. }));
  4586. r.result = r.data, r.requestId = t, delete r.data, n(r);
  4587. }
  4588. }));
  4589. });
  4590. },
  4591. toBase64: function toBase64(e) {
  4592. return c.stringify(a.parse(e));
  4593. }
  4594. },
  4595. pe = {
  4596. "uniCloud.init.paramRequired": "{param} required",
  4597. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4598. };
  4599. var _e4 = (0, _uniI18n.initVueI18n)({
  4600. "zh-Hans": {
  4601. "uniCloud.init.paramRequired": "缺少参数:{param}",
  4602. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  4603. },
  4604. "zh-Hant": {
  4605. "uniCloud.init.paramRequired": "缺少参数:{param}",
  4606. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  4607. },
  4608. en: pe,
  4609. fr: {
  4610. "uniCloud.init.paramRequired": "{param} required",
  4611. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4612. },
  4613. es: {
  4614. "uniCloud.init.paramRequired": "{param} required",
  4615. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4616. },
  4617. ja: pe
  4618. }, "zh-Hans"),
  4619. fe = _e4.t;
  4620. var ge = /*#__PURE__*/function () {
  4621. function ge(e) {
  4622. var _this3 = this;
  4623. (0, _classCallCheck2.default)(this, ge);
  4624. ["spaceId", "clientSecret"].forEach(function (t) {
  4625. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(fe("uniCloud.init.paramRequired", {
  4626. param: t
  4627. }));
  4628. }), this.config = Object.assign({}, {
  4629. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  4630. }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = re, this._getAccessTokenPromiseHub = new S({
  4631. createPromise: function createPromise() {
  4632. return _this3.requestAuth(_this3.setupRequest({
  4633. method: "serverless.auth.user.anonymousAuthorize",
  4634. params: "{}"
  4635. }, "auth")).then(function (e) {
  4636. if (!e.result || !e.result.accessToken) throw new se({
  4637. code: "AUTH_FAILED",
  4638. message: "获取accessToken失败"
  4639. });
  4640. _this3.setAccessToken(e.result.accessToken);
  4641. });
  4642. },
  4643. retryRule: v
  4644. });
  4645. }
  4646. (0, _createClass2.default)(ge, [{
  4647. key: "hasAccessToken",
  4648. get: function get() {
  4649. return !!this.accessToken;
  4650. }
  4651. }, {
  4652. key: "setAccessToken",
  4653. value: function setAccessToken(e) {
  4654. this.accessToken = e;
  4655. }
  4656. }, {
  4657. key: "requestWrapped",
  4658. value: function requestWrapped(e) {
  4659. return de.wrappedRequest(e, this.adapter.request);
  4660. }
  4661. }, {
  4662. key: "requestAuth",
  4663. value: function requestAuth(e) {
  4664. return this.requestWrapped(e);
  4665. }
  4666. }, {
  4667. key: "request",
  4668. value: function request(e, t) {
  4669. var _this4 = this;
  4670. return Promise.resolve().then(function () {
  4671. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  4672. return new Promise(function (e, n) {
  4673. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  4674. }).then(function () {
  4675. return _this4.getAccessToken();
  4676. }).then(function () {
  4677. var t = _this4.rebuildRequest(e);
  4678. return _this4.request(t, !0);
  4679. });
  4680. }) : _this4.getAccessToken().then(function () {
  4681. var t = _this4.rebuildRequest(e);
  4682. return _this4.request(t, !0);
  4683. });
  4684. });
  4685. }
  4686. }, {
  4687. key: "rebuildRequest",
  4688. value: function rebuildRequest(e) {
  4689. var t = Object.assign({}, e);
  4690. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = de.sign(t.data, this.config.clientSecret), t;
  4691. }
  4692. }, {
  4693. key: "setupRequest",
  4694. value: function setupRequest(e, t) {
  4695. var n = Object.assign({}, e, {
  4696. spaceId: this.config.spaceId,
  4697. timestamp: Date.now()
  4698. }),
  4699. s = {
  4700. "Content-Type": "application/json"
  4701. };
  4702. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = de.sign(n, this.config.clientSecret), {
  4703. url: this.config.requestUrl,
  4704. method: "POST",
  4705. data: n,
  4706. dataType: "json",
  4707. header: s
  4708. };
  4709. }
  4710. }, {
  4711. key: "getAccessToken",
  4712. value: function getAccessToken() {
  4713. return this._getAccessTokenPromiseHub.exec();
  4714. }
  4715. }, {
  4716. key: "authorize",
  4717. value: function () {
  4718. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  4719. return _regenerator.default.wrap(function _callee$(_context) {
  4720. while (1) {
  4721. switch (_context.prev = _context.next) {
  4722. case 0:
  4723. _context.next = 2;
  4724. return this.getAccessToken();
  4725. case 2:
  4726. case "end":
  4727. return _context.stop();
  4728. }
  4729. }
  4730. }, _callee, this);
  4731. }));
  4732. function authorize() {
  4733. return _authorize.apply(this, arguments);
  4734. }
  4735. return authorize;
  4736. }()
  4737. }, {
  4738. key: "callFunction",
  4739. value: function callFunction(e) {
  4740. var t = {
  4741. method: "serverless.function.runtime.invoke",
  4742. params: JSON.stringify({
  4743. functionTarget: e.name,
  4744. functionArgs: e.data || {}
  4745. })
  4746. };
  4747. return this.request(this.setupRequest(t));
  4748. }
  4749. }, {
  4750. key: "getOSSUploadOptionsFromPath",
  4751. value: function getOSSUploadOptionsFromPath(e) {
  4752. var t = {
  4753. method: "serverless.file.resource.generateProximalSign",
  4754. params: JSON.stringify(e)
  4755. };
  4756. return this.request(this.setupRequest(t));
  4757. }
  4758. }, {
  4759. key: "uploadFileToOSS",
  4760. value: function uploadFileToOSS(_ref3) {
  4761. var _this5 = this;
  4762. var e = _ref3.url,
  4763. t = _ref3.formData,
  4764. n = _ref3.name,
  4765. s = _ref3.filePath,
  4766. r = _ref3.fileType,
  4767. i = _ref3.onUploadProgress;
  4768. return new Promise(function (o, a) {
  4769. var c = _this5.adapter.uploadFile({
  4770. url: e,
  4771. formData: t,
  4772. name: n,
  4773. filePath: s,
  4774. fileType: r,
  4775. header: {
  4776. "X-OSS-server-side-encrpytion": "AES256"
  4777. },
  4778. success: function success(e) {
  4779. e && e.statusCode < 400 ? o(e) : a(new se({
  4780. code: "UPLOAD_FAILED",
  4781. message: "文件上传失败"
  4782. }));
  4783. },
  4784. fail: function fail(e) {
  4785. a(new se({
  4786. code: e.code || "UPLOAD_FAILED",
  4787. message: e.message || e.errMsg || "文件上传失败"
  4788. }));
  4789. }
  4790. });
  4791. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  4792. i({
  4793. loaded: e.totalBytesSent,
  4794. total: e.totalBytesExpectedToSend
  4795. });
  4796. });
  4797. });
  4798. }
  4799. }, {
  4800. key: "reportOSSUpload",
  4801. value: function reportOSSUpload(e) {
  4802. var t = {
  4803. method: "serverless.file.resource.report",
  4804. params: JSON.stringify(e)
  4805. };
  4806. return this.request(this.setupRequest(t));
  4807. }
  4808. }, {
  4809. key: "uploadFile",
  4810. value: function () {
  4811. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  4812. var e, t, _ref4$fileType, n, s, r, i, o, a, c, u, h, l, d, p, f, m, y, _e5, _;
  4813. return _regenerator.default.wrap(function _callee2$(_context2) {
  4814. while (1) {
  4815. switch (_context2.prev = _context2.next) {
  4816. case 0:
  4817. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, s = _ref4.onUploadProgress, r = _ref4.config;
  4818. if (!("string" !== g(t))) {
  4819. _context2.next = 3;
  4820. break;
  4821. }
  4822. throw new se({
  4823. code: "INVALID_PARAM",
  4824. message: "cloudPath必须为字符串类型"
  4825. });
  4826. case 3:
  4827. if (t = t.trim()) {
  4828. _context2.next = 5;
  4829. break;
  4830. }
  4831. throw new se({
  4832. code: "CLOUDPATH_REQUIRED",
  4833. message: "cloudPath不可为空"
  4834. });
  4835. case 5:
  4836. if (!/:\/\//.test(t)) {
  4837. _context2.next = 7;
  4838. break;
  4839. }
  4840. throw new se({
  4841. code: "INVALID_PARAM",
  4842. message: "cloudPath不合法"
  4843. });
  4844. case 7:
  4845. i = r && r.envType || this.config.envType;
  4846. _context2.next = 10;
  4847. return this.getOSSUploadOptionsFromPath({
  4848. env: i,
  4849. filename: t
  4850. });
  4851. case 10:
  4852. o = _context2.sent.result;
  4853. a = "https://" + o.cdnDomain + "/" + o.ossPath;
  4854. c = o.securityToken;
  4855. u = o.accessKeyId;
  4856. h = o.signature;
  4857. l = o.host;
  4858. d = o.ossPath;
  4859. p = o.id;
  4860. f = o.policy;
  4861. m = o.ossCallbackUrl;
  4862. y = {
  4863. "Cache-Control": "max-age=2592000",
  4864. "Content-Disposition": "attachment",
  4865. OSSAccessKeyId: u,
  4866. Signature: h,
  4867. host: l,
  4868. id: p,
  4869. key: d,
  4870. policy: f,
  4871. success_action_status: 200
  4872. };
  4873. if (c && (y["x-oss-security-token"] = c), m) {
  4874. _e5 = JSON.stringify({
  4875. callbackUrl: m,
  4876. callbackBody: JSON.stringify({
  4877. fileId: p,
  4878. spaceId: this.config.spaceId
  4879. }),
  4880. callbackBodyType: "application/json"
  4881. });
  4882. y.callback = de.toBase64(_e5);
  4883. }
  4884. _ = {
  4885. url: "https://" + o.host,
  4886. formData: y,
  4887. fileName: "file",
  4888. name: "file",
  4889. filePath: e,
  4890. fileType: n
  4891. };
  4892. _context2.next = 25;
  4893. return this.uploadFileToOSS(Object.assign({}, _, {
  4894. onUploadProgress: s
  4895. }));
  4896. case 25:
  4897. if (!m) {
  4898. _context2.next = 27;
  4899. break;
  4900. }
  4901. return _context2.abrupt("return", {
  4902. success: !0,
  4903. filePath: e,
  4904. fileID: a
  4905. });
  4906. case 27:
  4907. _context2.next = 29;
  4908. return this.reportOSSUpload({
  4909. id: p
  4910. });
  4911. case 29:
  4912. if (!_context2.sent.success) {
  4913. _context2.next = 31;
  4914. break;
  4915. }
  4916. return _context2.abrupt("return", {
  4917. success: !0,
  4918. filePath: e,
  4919. fileID: a
  4920. });
  4921. case 31:
  4922. throw new se({
  4923. code: "UPLOAD_FAILED",
  4924. message: "文件上传失败"
  4925. });
  4926. case 32:
  4927. case "end":
  4928. return _context2.stop();
  4929. }
  4930. }
  4931. }, _callee2, this);
  4932. }));
  4933. function uploadFile(_x) {
  4934. return _uploadFile.apply(this, arguments);
  4935. }
  4936. return uploadFile;
  4937. }()
  4938. }, {
  4939. key: "getTempFileURL",
  4940. value: function getTempFileURL() {
  4941. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  4942. e = _ref5.fileList;
  4943. return new Promise(function (t, n) {
  4944. Array.isArray(e) && 0 !== e.length || n(new se({
  4945. code: "INVALID_PARAM",
  4946. message: "fileList的元素必须是非空的字符串"
  4947. })), t({
  4948. fileList: e.map(function (e) {
  4949. return {
  4950. fileID: e,
  4951. tempFileURL: e
  4952. };
  4953. })
  4954. });
  4955. });
  4956. }
  4957. }, {
  4958. key: "getFileInfo",
  4959. value: function () {
  4960. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  4961. var _ref6,
  4962. e,
  4963. t,
  4964. _args3 = arguments;
  4965. return _regenerator.default.wrap(function _callee3$(_context3) {
  4966. while (1) {
  4967. switch (_context3.prev = _context3.next) {
  4968. case 0:
  4969. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  4970. if (!(!Array.isArray(e) || 0 === e.length)) {
  4971. _context3.next = 3;
  4972. break;
  4973. }
  4974. throw new se({
  4975. code: "INVALID_PARAM",
  4976. message: "fileList的元素必须是非空的字符串"
  4977. });
  4978. case 3:
  4979. t = {
  4980. method: "serverless.file.resource.info",
  4981. params: JSON.stringify({
  4982. id: e.map(function (e) {
  4983. return e.split("?")[0];
  4984. }).join(",")
  4985. })
  4986. };
  4987. _context3.next = 6;
  4988. return this.request(this.setupRequest(t));
  4989. case 6:
  4990. _context3.t0 = _context3.sent.result;
  4991. return _context3.abrupt("return", {
  4992. fileList: _context3.t0
  4993. });
  4994. case 8:
  4995. case "end":
  4996. return _context3.stop();
  4997. }
  4998. }
  4999. }, _callee3, this);
  5000. }));
  5001. function getFileInfo() {
  5002. return _getFileInfo.apply(this, arguments);
  5003. }
  5004. return getFileInfo;
  5005. }()
  5006. }]);
  5007. return ge;
  5008. }();
  5009. var me = {
  5010. init: function init(e) {
  5011. var t = new ge(e),
  5012. n = {
  5013. signInAnonymously: function signInAnonymously() {
  5014. return t.authorize();
  5015. },
  5016. getLoginState: function getLoginState() {
  5017. return Promise.resolve(!1);
  5018. }
  5019. };
  5020. return t.auth = function () {
  5021. return n;
  5022. }, t.customAuth = t.auth, t;
  5023. }
  5024. };
  5025. var ye = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  5026. var _e;
  5027. !function (e) {
  5028. e.local = "local", e.none = "none", e.session = "session";
  5029. }(_e || (_e = {}));
  5030. var we = function we() {};
  5031. var ve = function ve() {
  5032. var e;
  5033. if (!Promise) {
  5034. e = function e() {}, e.promise = {};
  5035. var _t3 = function _t3() {
  5036. throw new se({
  5037. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  5038. });
  5039. };
  5040. return Object.defineProperty(e.promise, "then", {
  5041. get: _t3
  5042. }), Object.defineProperty(e.promise, "catch", {
  5043. get: _t3
  5044. }), e;
  5045. }
  5046. var t = new Promise(function (t, n) {
  5047. e = function e(_e6, s) {
  5048. return _e6 ? n(_e6) : t(s);
  5049. };
  5050. });
  5051. return e.promise = t, e;
  5052. };
  5053. function Se(e) {
  5054. return void 0 === e;
  5055. }
  5056. function Ie(e) {
  5057. return "[object Null]" === Object.prototype.toString.call(e);
  5058. }
  5059. var be;
  5060. function ke(e) {
  5061. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  5062. var n;
  5063. var _iterator = _createForOfIteratorHelper(t),
  5064. _step;
  5065. try {
  5066. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5067. var _e7 = _step.value;
  5068. var _t4 = _e7.isMatch,
  5069. _n4 = _e7.genAdapter,
  5070. _s4 = _e7.runtime;
  5071. if (_t4()) return {
  5072. adapter: _n4(),
  5073. runtime: _s4
  5074. };
  5075. }
  5076. } catch (err) {
  5077. _iterator.e(err);
  5078. } finally {
  5079. _iterator.f();
  5080. }
  5081. }
  5082. !function (e) {
  5083. e.WEB = "web", e.WX_MP = "wx_mp";
  5084. }(be || (be = {}));
  5085. var Te = {
  5086. adapter: null,
  5087. runtime: void 0
  5088. },
  5089. Ce = ["anonymousUuidKey"];
  5090. var Pe = /*#__PURE__*/function (_we) {
  5091. (0, _inherits2.default)(Pe, _we);
  5092. var _super2 = _createSuper(Pe);
  5093. function Pe() {
  5094. var _this6;
  5095. (0, _classCallCheck2.default)(this, Pe);
  5096. _this6 = _super2.call(this), Te.adapter.root.tcbObject || (Te.adapter.root.tcbObject = {});
  5097. return _this6;
  5098. }
  5099. (0, _createClass2.default)(Pe, [{
  5100. key: "setItem",
  5101. value: function setItem(e, t) {
  5102. Te.adapter.root.tcbObject[e] = t;
  5103. }
  5104. }, {
  5105. key: "getItem",
  5106. value: function getItem(e) {
  5107. return Te.adapter.root.tcbObject[e];
  5108. }
  5109. }, {
  5110. key: "removeItem",
  5111. value: function removeItem(e) {
  5112. delete Te.adapter.root.tcbObject[e];
  5113. }
  5114. }, {
  5115. key: "clear",
  5116. value: function clear() {
  5117. delete Te.adapter.root.tcbObject;
  5118. }
  5119. }]);
  5120. return Pe;
  5121. }(we);
  5122. function Ae(e, t) {
  5123. switch (e) {
  5124. case "local":
  5125. return t.localStorage || new Pe();
  5126. case "none":
  5127. return new Pe();
  5128. default:
  5129. return t.sessionStorage || new Pe();
  5130. }
  5131. }
  5132. var Ee = /*#__PURE__*/function () {
  5133. function Ee(e) {
  5134. (0, _classCallCheck2.default)(this, Ee);
  5135. if (!this._storage) {
  5136. this._persistence = Te.adapter.primaryStorage || e.persistence, this._storage = Ae(this._persistence, Te.adapter);
  5137. var _t5 = "access_token_".concat(e.env),
  5138. _n5 = "access_token_expire_".concat(e.env),
  5139. _s5 = "refresh_token_".concat(e.env),
  5140. _r = "anonymous_uuid_".concat(e.env),
  5141. _i = "login_type_".concat(e.env),
  5142. _o = "user_info_".concat(e.env);
  5143. this.keys = {
  5144. accessTokenKey: _t5,
  5145. accessTokenExpireKey: _n5,
  5146. refreshTokenKey: _s5,
  5147. anonymousUuidKey: _r,
  5148. loginTypeKey: _i,
  5149. userInfoKey: _o
  5150. };
  5151. }
  5152. }
  5153. (0, _createClass2.default)(Ee, [{
  5154. key: "updatePersistence",
  5155. value: function updatePersistence(e) {
  5156. if (e === this._persistence) return;
  5157. var t = "local" === this._persistence;
  5158. this._persistence = e;
  5159. var n = Ae(e, Te.adapter);
  5160. for (var _e8 in this.keys) {
  5161. var _s6 = this.keys[_e8];
  5162. if (t && Ce.includes(_e8)) continue;
  5163. var _r2 = this._storage.getItem(_s6);
  5164. Se(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  5165. }
  5166. this._storage = n;
  5167. }
  5168. }, {
  5169. key: "setStore",
  5170. value: function setStore(e, t, n) {
  5171. if (!this._storage) return;
  5172. var s = {
  5173. version: n || "localCachev1",
  5174. content: t
  5175. },
  5176. r = JSON.stringify(s);
  5177. try {
  5178. this._storage.setItem(e, r);
  5179. } catch (e) {
  5180. throw e;
  5181. }
  5182. }
  5183. }, {
  5184. key: "getStore",
  5185. value: function getStore(e, t) {
  5186. try {
  5187. if (!this._storage) return;
  5188. } catch (e) {
  5189. return "";
  5190. }
  5191. t = t || "localCachev1";
  5192. var n = this._storage.getItem(e);
  5193. if (!n) return "";
  5194. if (n.indexOf(t) >= 0) {
  5195. return JSON.parse(n).content;
  5196. }
  5197. return "";
  5198. }
  5199. }, {
  5200. key: "removeStore",
  5201. value: function removeStore(e) {
  5202. this._storage.removeItem(e);
  5203. }
  5204. }]);
  5205. return Ee;
  5206. }();
  5207. var Oe = {},
  5208. xe = {};
  5209. function Re(e) {
  5210. return Oe[e];
  5211. }
  5212. var Ue = /*#__PURE__*/(0, _createClass2.default)(function Ue(e, t) {
  5213. (0, _classCallCheck2.default)(this, Ue);
  5214. this.data = t || null, this.name = e;
  5215. });
  5216. var Le = /*#__PURE__*/function (_Ue) {
  5217. (0, _inherits2.default)(Le, _Ue);
  5218. var _super3 = _createSuper(Le);
  5219. function Le(e, t) {
  5220. var _this7;
  5221. (0, _classCallCheck2.default)(this, Le);
  5222. _this7 = _super3.call(this, "error", {
  5223. error: e,
  5224. data: t
  5225. }), _this7.error = e;
  5226. return _this7;
  5227. }
  5228. return (0, _createClass2.default)(Le);
  5229. }(Ue);
  5230. var Ne = new ( /*#__PURE__*/function () {
  5231. function _class() {
  5232. (0, _classCallCheck2.default)(this, _class);
  5233. this._listeners = {};
  5234. }
  5235. (0, _createClass2.default)(_class, [{
  5236. key: "on",
  5237. value: function on(e, t) {
  5238. return function (e, t, n) {
  5239. n[e] = n[e] || [], n[e].push(t);
  5240. }(e, t, this._listeners), this;
  5241. }
  5242. }, {
  5243. key: "off",
  5244. value: function off(e, t) {
  5245. return function (e, t, n) {
  5246. if (n && n[e]) {
  5247. var _s7 = n[e].indexOf(t);
  5248. -1 !== _s7 && n[e].splice(_s7, 1);
  5249. }
  5250. }(e, t, this._listeners), this;
  5251. }
  5252. }, {
  5253. key: "fire",
  5254. value: function fire(e, t) {
  5255. if (e instanceof Le) return console.error(e.error), this;
  5256. var n = "string" == typeof e ? new Ue(e, t || {}) : e;
  5257. var s = n.name;
  5258. if (this._listens(s)) {
  5259. n.target = this;
  5260. var _e9 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  5261. var _iterator2 = _createForOfIteratorHelper(_e9),
  5262. _step2;
  5263. try {
  5264. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  5265. var _t6 = _step2.value;
  5266. _t6.call(this, n);
  5267. }
  5268. } catch (err) {
  5269. _iterator2.e(err);
  5270. } finally {
  5271. _iterator2.f();
  5272. }
  5273. }
  5274. return this;
  5275. }
  5276. }, {
  5277. key: "_listens",
  5278. value: function _listens(e) {
  5279. return this._listeners[e] && this._listeners[e].length > 0;
  5280. }
  5281. }]);
  5282. return _class;
  5283. }())();
  5284. function De(e, t) {
  5285. Ne.on(e, t);
  5286. }
  5287. function Fe(e) {
  5288. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5289. Ne.fire(e, t);
  5290. }
  5291. function qe(e, t) {
  5292. Ne.off(e, t);
  5293. }
  5294. var Me = "loginStateChanged",
  5295. Ke = "loginStateExpire",
  5296. je = "loginTypeChanged",
  5297. Be = "anonymousConverted",
  5298. $e = "refreshAccessToken";
  5299. var We;
  5300. !function (e) {
  5301. 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";
  5302. }(We || (We = {}));
  5303. var ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  5304. Je = {
  5305. "X-SDK-Version": "1.3.5"
  5306. };
  5307. function He(e, t, n) {
  5308. var s = e[t];
  5309. e[t] = function (t) {
  5310. var r = {},
  5311. i = {};
  5312. n.forEach(function (n) {
  5313. var _n$call = n.call(e, t),
  5314. s = _n$call.data,
  5315. o = _n$call.headers;
  5316. Object.assign(r, s), Object.assign(i, o);
  5317. });
  5318. var o = t.data;
  5319. return o && function () {
  5320. var e;
  5321. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e10 in r) {
  5322. o.append(_e10, r[_e10]);
  5323. }
  5324. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  5325. };
  5326. }
  5327. function Ge() {
  5328. var e = Math.random().toString(16).slice(2);
  5329. return {
  5330. data: {
  5331. seqId: e
  5332. },
  5333. headers: _objectSpread(_objectSpread({}, Je), {}, {
  5334. "x-seqid": e
  5335. })
  5336. };
  5337. }
  5338. var Ve = /*#__PURE__*/function () {
  5339. function Ve() {
  5340. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5341. (0, _classCallCheck2.default)(this, Ve);
  5342. var t;
  5343. this.config = e, this._reqClass = new Te.adapter.reqClass({
  5344. timeout: this.config.timeout,
  5345. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  5346. restrictedMethods: ["post"]
  5347. }), this._cache = Re(this.config.env), this._localCache = (t = this.config.env, xe[t]), He(this._reqClass, "post", [Ge]), He(this._reqClass, "upload", [Ge]), He(this._reqClass, "download", [Ge]);
  5348. }
  5349. (0, _createClass2.default)(Ve, [{
  5350. key: "post",
  5351. value: function () {
  5352. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  5353. return _regenerator.default.wrap(function _callee4$(_context4) {
  5354. while (1) {
  5355. switch (_context4.prev = _context4.next) {
  5356. case 0:
  5357. _context4.next = 2;
  5358. return this._reqClass.post(e);
  5359. case 2:
  5360. return _context4.abrupt("return", _context4.sent);
  5361. case 3:
  5362. case "end":
  5363. return _context4.stop();
  5364. }
  5365. }
  5366. }, _callee4, this);
  5367. }));
  5368. function post(_x2) {
  5369. return _post.apply(this, arguments);
  5370. }
  5371. return post;
  5372. }()
  5373. }, {
  5374. key: "upload",
  5375. value: function () {
  5376. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  5377. return _regenerator.default.wrap(function _callee5$(_context5) {
  5378. while (1) {
  5379. switch (_context5.prev = _context5.next) {
  5380. case 0:
  5381. _context5.next = 2;
  5382. return this._reqClass.upload(e);
  5383. case 2:
  5384. return _context5.abrupt("return", _context5.sent);
  5385. case 3:
  5386. case "end":
  5387. return _context5.stop();
  5388. }
  5389. }
  5390. }, _callee5, this);
  5391. }));
  5392. function upload(_x3) {
  5393. return _upload.apply(this, arguments);
  5394. }
  5395. return upload;
  5396. }()
  5397. }, {
  5398. key: "download",
  5399. value: function () {
  5400. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  5401. return _regenerator.default.wrap(function _callee6$(_context6) {
  5402. while (1) {
  5403. switch (_context6.prev = _context6.next) {
  5404. case 0:
  5405. _context6.next = 2;
  5406. return this._reqClass.download(e);
  5407. case 2:
  5408. return _context6.abrupt("return", _context6.sent);
  5409. case 3:
  5410. case "end":
  5411. return _context6.stop();
  5412. }
  5413. }
  5414. }, _callee6, this);
  5415. }));
  5416. function download(_x4) {
  5417. return _download.apply(this, arguments);
  5418. }
  5419. return download;
  5420. }()
  5421. }, {
  5422. key: "refreshAccessToken",
  5423. value: function () {
  5424. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  5425. var e, t;
  5426. return _regenerator.default.wrap(function _callee7$(_context7) {
  5427. while (1) {
  5428. switch (_context7.prev = _context7.next) {
  5429. case 0:
  5430. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  5431. _context7.prev = 1;
  5432. _context7.next = 4;
  5433. return this._refreshAccessTokenPromise;
  5434. case 4:
  5435. e = _context7.sent;
  5436. _context7.next = 10;
  5437. break;
  5438. case 7:
  5439. _context7.prev = 7;
  5440. _context7.t0 = _context7["catch"](1);
  5441. t = _context7.t0;
  5442. case 10:
  5443. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  5444. _context7.next = 12;
  5445. break;
  5446. }
  5447. throw t;
  5448. case 12:
  5449. return _context7.abrupt("return", e);
  5450. case 13:
  5451. case "end":
  5452. return _context7.stop();
  5453. }
  5454. }
  5455. }, _callee7, this, [[1, 7]]);
  5456. }));
  5457. function refreshAccessToken() {
  5458. return _refreshAccessToken2.apply(this, arguments);
  5459. }
  5460. return refreshAccessToken;
  5461. }()
  5462. }, {
  5463. key: "_refreshAccessToken",
  5464. value: function () {
  5465. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  5466. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e11, _e12, _t7, _s8;
  5467. return _regenerator.default.wrap(function _callee8$(_context8) {
  5468. while (1) {
  5469. switch (_context8.prev = _context8.next) {
  5470. case 0:
  5471. _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;
  5472. this._cache.removeStore(e), this._cache.removeStore(t);
  5473. i = this._cache.getStore(n);
  5474. if (i) {
  5475. _context8.next = 5;
  5476. break;
  5477. }
  5478. throw new se({
  5479. message: "未登录CloudBase"
  5480. });
  5481. case 5:
  5482. o = {
  5483. refresh_token: i
  5484. };
  5485. _context8.next = 8;
  5486. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  5487. case 8:
  5488. a = _context8.sent;
  5489. if (!a.data.code) {
  5490. _context8.next = 21;
  5491. break;
  5492. }
  5493. _e11 = a.data.code;
  5494. if (!("SIGN_PARAM_INVALID" === _e11 || "REFRESH_TOKEN_EXPIRED" === _e11 || "INVALID_REFRESH_TOKEN" === _e11)) {
  5495. _context8.next = 20;
  5496. break;
  5497. }
  5498. if (!(this._cache.getStore(s) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e11)) {
  5499. _context8.next = 19;
  5500. break;
  5501. }
  5502. _e12 = this._cache.getStore(r);
  5503. _t7 = this._cache.getStore(n);
  5504. _context8.next = 17;
  5505. return this.send("auth.signInAnonymously", {
  5506. anonymous_uuid: _e12,
  5507. refresh_token: _t7
  5508. });
  5509. case 17:
  5510. _s8 = _context8.sent;
  5511. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  5512. case 19:
  5513. Fe(Ke), this._cache.removeStore(n);
  5514. case 20:
  5515. throw new se({
  5516. code: a.data.code,
  5517. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  5518. });
  5519. case 21:
  5520. if (!a.data.access_token) {
  5521. _context8.next = 23;
  5522. break;
  5523. }
  5524. return _context8.abrupt("return", (Fe($e), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  5525. accessToken: a.data.access_token,
  5526. accessTokenExpire: a.data.access_token_expire
  5527. }));
  5528. case 23:
  5529. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  5530. case 24:
  5531. case "end":
  5532. return _context8.stop();
  5533. }
  5534. }
  5535. }, _callee8, this);
  5536. }));
  5537. function _refreshAccessToken() {
  5538. return _refreshAccessToken3.apply(this, arguments);
  5539. }
  5540. return _refreshAccessToken;
  5541. }()
  5542. }, {
  5543. key: "getAccessToken",
  5544. value: function () {
  5545. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  5546. var _this$_cache$keys2, e, t, n, s, r, i;
  5547. return _regenerator.default.wrap(function _callee9$(_context9) {
  5548. while (1) {
  5549. switch (_context9.prev = _context9.next) {
  5550. case 0:
  5551. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  5552. if (this._cache.getStore(n)) {
  5553. _context9.next = 3;
  5554. break;
  5555. }
  5556. throw new se({
  5557. message: "refresh token不存在,登录状态异常"
  5558. });
  5559. case 3:
  5560. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  5561. _context9.t0 = this._shouldRefreshAccessTokenHook;
  5562. if (!_context9.t0) {
  5563. _context9.next = 9;
  5564. break;
  5565. }
  5566. _context9.next = 8;
  5567. return this._shouldRefreshAccessTokenHook(s, r);
  5568. case 8:
  5569. _context9.t0 = !_context9.sent;
  5570. case 9:
  5571. _context9.t1 = _context9.t0;
  5572. if (!_context9.t1) {
  5573. _context9.next = 12;
  5574. break;
  5575. }
  5576. i = !1;
  5577. case 12:
  5578. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  5579. accessToken: s,
  5580. accessTokenExpire: r
  5581. });
  5582. case 13:
  5583. case "end":
  5584. return _context9.stop();
  5585. }
  5586. }
  5587. }, _callee9, this);
  5588. }));
  5589. function getAccessToken() {
  5590. return _getAccessToken.apply(this, arguments);
  5591. }
  5592. return getAccessToken;
  5593. }()
  5594. }, {
  5595. key: "request",
  5596. value: function () {
  5597. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  5598. var s, r, i, _e13, o, _e14, _e15, a, c, u, h, l, d, p, f, g;
  5599. return _regenerator.default.wrap(function _callee10$(_context10) {
  5600. while (1) {
  5601. switch (_context10.prev = _context10.next) {
  5602. case 0:
  5603. s = "x-tcb-trace_".concat(this.config.env);
  5604. r = "application/x-www-form-urlencoded";
  5605. i = _objectSpread({
  5606. action: e,
  5607. env: this.config.env,
  5608. dataVersion: "2019-08-16"
  5609. }, t);
  5610. if (!(-1 === ze.indexOf(e))) {
  5611. _context10.next = 10;
  5612. break;
  5613. }
  5614. _e13 = this._cache.keys.refreshTokenKey;
  5615. _context10.t0 = this._cache.getStore(_e13);
  5616. if (!_context10.t0) {
  5617. _context10.next = 10;
  5618. break;
  5619. }
  5620. _context10.next = 9;
  5621. return this.getAccessToken();
  5622. case 9:
  5623. i.access_token = _context10.sent.accessToken;
  5624. case 10:
  5625. if ("storage.uploadFile" === e) {
  5626. o = new FormData();
  5627. for (_e14 in o) {
  5628. o.hasOwnProperty(_e14) && void 0 !== o[_e14] && o.append(_e14, i[_e14]);
  5629. }
  5630. r = "multipart/form-data";
  5631. } else {
  5632. r = "application/json", o = {};
  5633. for (_e15 in i) {
  5634. void 0 !== i[_e15] && (o[_e15] = i[_e15]);
  5635. }
  5636. }
  5637. a = {
  5638. headers: {
  5639. "content-type": r
  5640. }
  5641. };
  5642. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  5643. c = this._localCache.getStore(s);
  5644. c && (a.headers["X-TCB-Trace"] = c);
  5645. u = t.parse, h = t.inQuery, l = t.search;
  5646. d = {
  5647. env: this.config.env
  5648. };
  5649. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  5650. p = function (e, t) {
  5651. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5652. var s = /\?/.test(t);
  5653. var r = "";
  5654. for (var _e16 in n) {
  5655. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e16, "=").concat(encodeURIComponent(n[_e16]));
  5656. }
  5657. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  5658. }(ye, "//tcb-api.tencentcloudapi.com/web", d);
  5659. l && (p += l);
  5660. _context10.next = 22;
  5661. return this.post(_objectSpread({
  5662. url: p,
  5663. data: o
  5664. }, a));
  5665. case 22:
  5666. f = _context10.sent;
  5667. g = f.header && f.header["x-tcb-trace"];
  5668. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  5669. _context10.next = 26;
  5670. break;
  5671. }
  5672. throw new se({
  5673. code: "NETWORK_ERROR",
  5674. message: "network request error"
  5675. });
  5676. case 26:
  5677. return _context10.abrupt("return", f);
  5678. case 27:
  5679. case "end":
  5680. return _context10.stop();
  5681. }
  5682. }
  5683. }, _callee10, this);
  5684. }));
  5685. function request(_x5, _x6, _x7) {
  5686. return _request.apply(this, arguments);
  5687. }
  5688. return request;
  5689. }()
  5690. }, {
  5691. key: "send",
  5692. value: function () {
  5693. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  5694. var t,
  5695. n,
  5696. _n6,
  5697. _args11 = arguments;
  5698. return _regenerator.default.wrap(function _callee11$(_context11) {
  5699. while (1) {
  5700. switch (_context11.prev = _context11.next) {
  5701. case 0:
  5702. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  5703. _context11.next = 3;
  5704. return this.request(e, t, {
  5705. onUploadProgress: t.onUploadProgress
  5706. });
  5707. case 3:
  5708. n = _context11.sent;
  5709. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === ze.indexOf(e))) {
  5710. _context11.next = 13;
  5711. break;
  5712. }
  5713. _context11.next = 7;
  5714. return this.refreshAccessToken();
  5715. case 7:
  5716. _context11.next = 9;
  5717. return this.request(e, t, {
  5718. onUploadProgress: t.onUploadProgress
  5719. });
  5720. case 9:
  5721. _n6 = _context11.sent;
  5722. if (!_n6.data.code) {
  5723. _context11.next = 12;
  5724. break;
  5725. }
  5726. throw new se({
  5727. code: _n6.data.code,
  5728. message: _n6.data.message
  5729. });
  5730. case 12:
  5731. return _context11.abrupt("return", _n6.data);
  5732. case 13:
  5733. if (!n.data.code) {
  5734. _context11.next = 15;
  5735. break;
  5736. }
  5737. throw new se({
  5738. code: n.data.code,
  5739. message: n.data.message
  5740. });
  5741. case 15:
  5742. return _context11.abrupt("return", n.data);
  5743. case 16:
  5744. case "end":
  5745. return _context11.stop();
  5746. }
  5747. }
  5748. }, _callee11, this);
  5749. }));
  5750. function send(_x8) {
  5751. return _send.apply(this, arguments);
  5752. }
  5753. return send;
  5754. }()
  5755. }, {
  5756. key: "setRefreshToken",
  5757. value: function setRefreshToken(e) {
  5758. var _this$_cache$keys3 = this._cache.keys,
  5759. t = _this$_cache$keys3.accessTokenKey,
  5760. n = _this$_cache$keys3.accessTokenExpireKey,
  5761. s = _this$_cache$keys3.refreshTokenKey;
  5762. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  5763. }
  5764. }]);
  5765. return Ve;
  5766. }();
  5767. var Qe = {};
  5768. function Ye(e) {
  5769. return Qe[e];
  5770. }
  5771. var Xe = /*#__PURE__*/function () {
  5772. function Xe(e) {
  5773. (0, _classCallCheck2.default)(this, Xe);
  5774. this.config = e, this._cache = Re(e.env), this._request = Ye(e.env);
  5775. }
  5776. (0, _createClass2.default)(Xe, [{
  5777. key: "setRefreshToken",
  5778. value: function setRefreshToken(e) {
  5779. var _this$_cache$keys4 = this._cache.keys,
  5780. t = _this$_cache$keys4.accessTokenKey,
  5781. n = _this$_cache$keys4.accessTokenExpireKey,
  5782. s = _this$_cache$keys4.refreshTokenKey;
  5783. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  5784. }
  5785. }, {
  5786. key: "setAccessToken",
  5787. value: function setAccessToken(e, t) {
  5788. var _this$_cache$keys5 = this._cache.keys,
  5789. n = _this$_cache$keys5.accessTokenKey,
  5790. s = _this$_cache$keys5.accessTokenExpireKey;
  5791. this._cache.setStore(n, e), this._cache.setStore(s, t);
  5792. }
  5793. }, {
  5794. key: "refreshUserInfo",
  5795. value: function () {
  5796. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  5797. var _yield$this$_request$, e;
  5798. return _regenerator.default.wrap(function _callee12$(_context12) {
  5799. while (1) {
  5800. switch (_context12.prev = _context12.next) {
  5801. case 0:
  5802. _context12.next = 2;
  5803. return this._request.send("auth.getUserInfo", {});
  5804. case 2:
  5805. _yield$this$_request$ = _context12.sent;
  5806. e = _yield$this$_request$.data;
  5807. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  5808. case 5:
  5809. case "end":
  5810. return _context12.stop();
  5811. }
  5812. }
  5813. }, _callee12, this);
  5814. }));
  5815. function refreshUserInfo() {
  5816. return _refreshUserInfo.apply(this, arguments);
  5817. }
  5818. return refreshUserInfo;
  5819. }()
  5820. }, {
  5821. key: "setLocalUserInfo",
  5822. value: function setLocalUserInfo(e) {
  5823. var t = this._cache.keys.userInfoKey;
  5824. this._cache.setStore(t, e);
  5825. }
  5826. }]);
  5827. return Xe;
  5828. }();
  5829. var Ze = /*#__PURE__*/function () {
  5830. function Ze(e) {
  5831. (0, _classCallCheck2.default)(this, Ze);
  5832. if (!e) throw new se({
  5833. code: "PARAM_ERROR",
  5834. message: "envId is not defined"
  5835. });
  5836. this._envId = e, this._cache = Re(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  5837. }
  5838. (0, _createClass2.default)(Ze, [{
  5839. key: "linkWithTicket",
  5840. value: function linkWithTicket(e) {
  5841. if ("string" != typeof e) throw new se({
  5842. code: "PARAM_ERROR",
  5843. message: "ticket must be string"
  5844. });
  5845. return this._request.send("auth.linkWithTicket", {
  5846. ticket: e
  5847. });
  5848. }
  5849. }, {
  5850. key: "linkWithRedirect",
  5851. value: function linkWithRedirect(e) {
  5852. e.signInWithRedirect();
  5853. }
  5854. }, {
  5855. key: "updatePassword",
  5856. value: function updatePassword(e, t) {
  5857. return this._request.send("auth.updatePassword", {
  5858. oldPassword: t,
  5859. newPassword: e
  5860. });
  5861. }
  5862. }, {
  5863. key: "updateEmail",
  5864. value: function updateEmail(e) {
  5865. return this._request.send("auth.updateEmail", {
  5866. newEmail: e
  5867. });
  5868. }
  5869. }, {
  5870. key: "updateUsername",
  5871. value: function updateUsername(e) {
  5872. if ("string" != typeof e) throw new se({
  5873. code: "PARAM_ERROR",
  5874. message: "username must be a string"
  5875. });
  5876. return this._request.send("auth.updateUsername", {
  5877. username: e
  5878. });
  5879. }
  5880. }, {
  5881. key: "getLinkedUidList",
  5882. value: function () {
  5883. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  5884. var _yield$this$_request$2, e, t, n;
  5885. return _regenerator.default.wrap(function _callee13$(_context13) {
  5886. while (1) {
  5887. switch (_context13.prev = _context13.next) {
  5888. case 0:
  5889. _context13.next = 2;
  5890. return this._request.send("auth.getLinkedUidList", {});
  5891. case 2:
  5892. _yield$this$_request$2 = _context13.sent;
  5893. e = _yield$this$_request$2.data;
  5894. t = !1;
  5895. n = e.users;
  5896. return _context13.abrupt("return", (n.forEach(function (e) {
  5897. e.wxOpenId && e.wxPublicId && (t = !0);
  5898. }), {
  5899. users: n,
  5900. hasPrimaryUid: t
  5901. }));
  5902. case 7:
  5903. case "end":
  5904. return _context13.stop();
  5905. }
  5906. }
  5907. }, _callee13, this);
  5908. }));
  5909. function getLinkedUidList() {
  5910. return _getLinkedUidList.apply(this, arguments);
  5911. }
  5912. return getLinkedUidList;
  5913. }()
  5914. }, {
  5915. key: "setPrimaryUid",
  5916. value: function setPrimaryUid(e) {
  5917. return this._request.send("auth.setPrimaryUid", {
  5918. uid: e
  5919. });
  5920. }
  5921. }, {
  5922. key: "unlink",
  5923. value: function unlink(e) {
  5924. return this._request.send("auth.unlink", {
  5925. platform: e
  5926. });
  5927. }
  5928. }, {
  5929. key: "update",
  5930. value: function () {
  5931. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  5932. var t, n, s, r, i, o, _yield$this$_request$3, a;
  5933. return _regenerator.default.wrap(function _callee14$(_context14) {
  5934. while (1) {
  5935. switch (_context14.prev = _context14.next) {
  5936. case 0:
  5937. t = e.nickName;
  5938. n = e.gender;
  5939. s = e.avatarUrl;
  5940. r = e.province;
  5941. i = e.country;
  5942. o = e.city;
  5943. _context14.next = 8;
  5944. return this._request.send("auth.updateUserInfo", {
  5945. nickName: t,
  5946. gender: n,
  5947. avatarUrl: s,
  5948. province: r,
  5949. country: i,
  5950. city: o
  5951. });
  5952. case 8:
  5953. _yield$this$_request$3 = _context14.sent;
  5954. a = _yield$this$_request$3.data;
  5955. this.setLocalUserInfo(a);
  5956. case 11:
  5957. case "end":
  5958. return _context14.stop();
  5959. }
  5960. }
  5961. }, _callee14, this);
  5962. }));
  5963. function update(_x9) {
  5964. return _update.apply(this, arguments);
  5965. }
  5966. return update;
  5967. }()
  5968. }, {
  5969. key: "refresh",
  5970. value: function () {
  5971. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  5972. var _yield$this$_request$4, e;
  5973. return _regenerator.default.wrap(function _callee15$(_context15) {
  5974. while (1) {
  5975. switch (_context15.prev = _context15.next) {
  5976. case 0:
  5977. _context15.next = 2;
  5978. return this._request.send("auth.getUserInfo", {});
  5979. case 2:
  5980. _yield$this$_request$4 = _context15.sent;
  5981. e = _yield$this$_request$4.data;
  5982. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  5983. case 5:
  5984. case "end":
  5985. return _context15.stop();
  5986. }
  5987. }
  5988. }, _callee15, this);
  5989. }));
  5990. function refresh() {
  5991. return _refresh.apply(this, arguments);
  5992. }
  5993. return refresh;
  5994. }()
  5995. }, {
  5996. key: "setUserInfo",
  5997. value: function setUserInfo() {
  5998. var _this8 = this;
  5999. var e = this._cache.keys.userInfoKey,
  6000. t = this._cache.getStore(e);
  6001. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  6002. _this8[e] = t[e];
  6003. }), this.location = {
  6004. country: t.country,
  6005. province: t.province,
  6006. city: t.city
  6007. };
  6008. }
  6009. }, {
  6010. key: "setLocalUserInfo",
  6011. value: function setLocalUserInfo(e) {
  6012. var t = this._cache.keys.userInfoKey;
  6013. this._cache.setStore(t, e), this.setUserInfo();
  6014. }
  6015. }]);
  6016. return Ze;
  6017. }();
  6018. var et = /*#__PURE__*/function () {
  6019. function et(e) {
  6020. (0, _classCallCheck2.default)(this, et);
  6021. if (!e) throw new se({
  6022. code: "PARAM_ERROR",
  6023. message: "envId is not defined"
  6024. });
  6025. this._cache = Re(e);
  6026. var _this$_cache$keys6 = this._cache.keys,
  6027. t = _this$_cache$keys6.refreshTokenKey,
  6028. n = _this$_cache$keys6.accessTokenKey,
  6029. s = _this$_cache$keys6.accessTokenExpireKey,
  6030. r = this._cache.getStore(t),
  6031. i = this._cache.getStore(n),
  6032. o = this._cache.getStore(s);
  6033. this.credential = {
  6034. refreshToken: r,
  6035. accessToken: i,
  6036. accessTokenExpire: o
  6037. }, this.user = new Ze(e);
  6038. }
  6039. (0, _createClass2.default)(et, [{
  6040. key: "isAnonymousAuth",
  6041. get: function get() {
  6042. return this.loginType === We.ANONYMOUS;
  6043. }
  6044. }, {
  6045. key: "isCustomAuth",
  6046. get: function get() {
  6047. return this.loginType === We.CUSTOM;
  6048. }
  6049. }, {
  6050. key: "isWeixinAuth",
  6051. get: function get() {
  6052. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  6053. }
  6054. }, {
  6055. key: "loginType",
  6056. get: function get() {
  6057. return this._cache.getStore(this._cache.keys.loginTypeKey);
  6058. }
  6059. }]);
  6060. return et;
  6061. }();
  6062. var tt = /*#__PURE__*/function (_Xe) {
  6063. (0, _inherits2.default)(tt, _Xe);
  6064. var _super4 = _createSuper(tt);
  6065. function tt() {
  6066. (0, _classCallCheck2.default)(this, tt);
  6067. return _super4.apply(this, arguments);
  6068. }
  6069. (0, _createClass2.default)(tt, [{
  6070. key: "signIn",
  6071. value: function () {
  6072. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  6073. var _this$_cache$keys7, e, t, n, s, r, _e17;
  6074. return _regenerator.default.wrap(function _callee16$(_context16) {
  6075. while (1) {
  6076. switch (_context16.prev = _context16.next) {
  6077. case 0:
  6078. this._cache.updatePersistence("local");
  6079. _this$_cache$keys7 = this._cache.keys;
  6080. e = _this$_cache$keys7.anonymousUuidKey;
  6081. t = _this$_cache$keys7.refreshTokenKey;
  6082. n = this._cache.getStore(e) || void 0;
  6083. s = this._cache.getStore(t) || void 0;
  6084. _context16.next = 8;
  6085. return this._request.send("auth.signInAnonymously", {
  6086. anonymous_uuid: n,
  6087. refresh_token: s
  6088. });
  6089. case 8:
  6090. r = _context16.sent;
  6091. if (!(r.uuid && r.refresh_token)) {
  6092. _context16.next = 20;
  6093. break;
  6094. }
  6095. this._setAnonymousUUID(r.uuid);
  6096. this.setRefreshToken(r.refresh_token);
  6097. _context16.next = 14;
  6098. return this._request.refreshAccessToken();
  6099. case 14:
  6100. Fe(Me);
  6101. Fe(je, {
  6102. env: this.config.env,
  6103. loginType: We.ANONYMOUS,
  6104. persistence: "local"
  6105. });
  6106. _e17 = new et(this.config.env);
  6107. _context16.next = 19;
  6108. return _e17.user.refresh();
  6109. case 19:
  6110. return _context16.abrupt("return", _e17);
  6111. case 20:
  6112. throw new se({
  6113. message: "匿名登录失败"
  6114. });
  6115. case 21:
  6116. case "end":
  6117. return _context16.stop();
  6118. }
  6119. }
  6120. }, _callee16, this);
  6121. }));
  6122. function signIn() {
  6123. return _signIn.apply(this, arguments);
  6124. }
  6125. return signIn;
  6126. }()
  6127. }, {
  6128. key: "linkAndRetrieveDataWithTicket",
  6129. value: function () {
  6130. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  6131. var _this$_cache$keys8, t, n, s, r, i;
  6132. return _regenerator.default.wrap(function _callee17$(_context17) {
  6133. while (1) {
  6134. switch (_context17.prev = _context17.next) {
  6135. case 0:
  6136. _this$_cache$keys8 = this._cache.keys;
  6137. t = _this$_cache$keys8.anonymousUuidKey;
  6138. n = _this$_cache$keys8.refreshTokenKey;
  6139. s = this._cache.getStore(t);
  6140. r = this._cache.getStore(n);
  6141. _context17.next = 7;
  6142. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  6143. anonymous_uuid: s,
  6144. refresh_token: r,
  6145. ticket: e
  6146. });
  6147. case 7:
  6148. i = _context17.sent;
  6149. if (!i.refresh_token) {
  6150. _context17.next = 16;
  6151. break;
  6152. }
  6153. this._clearAnonymousUUID();
  6154. this.setRefreshToken(i.refresh_token);
  6155. _context17.next = 13;
  6156. return this._request.refreshAccessToken();
  6157. case 13:
  6158. Fe(Be, {
  6159. env: this.config.env
  6160. });
  6161. Fe(je, {
  6162. loginType: We.CUSTOM,
  6163. persistence: "local"
  6164. });
  6165. return _context17.abrupt("return", {
  6166. credential: {
  6167. refreshToken: i.refresh_token
  6168. }
  6169. });
  6170. case 16:
  6171. throw new se({
  6172. message: "匿名转化失败"
  6173. });
  6174. case 17:
  6175. case "end":
  6176. return _context17.stop();
  6177. }
  6178. }
  6179. }, _callee17, this);
  6180. }));
  6181. function linkAndRetrieveDataWithTicket(_x10) {
  6182. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  6183. }
  6184. return linkAndRetrieveDataWithTicket;
  6185. }()
  6186. }, {
  6187. key: "_setAnonymousUUID",
  6188. value: function _setAnonymousUUID(e) {
  6189. var _this$_cache$keys9 = this._cache.keys,
  6190. t = _this$_cache$keys9.anonymousUuidKey,
  6191. n = _this$_cache$keys9.loginTypeKey;
  6192. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, We.ANONYMOUS);
  6193. }
  6194. }, {
  6195. key: "_clearAnonymousUUID",
  6196. value: function _clearAnonymousUUID() {
  6197. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  6198. }
  6199. }]);
  6200. return tt;
  6201. }(Xe);
  6202. var nt = /*#__PURE__*/function (_Xe2) {
  6203. (0, _inherits2.default)(nt, _Xe2);
  6204. var _super5 = _createSuper(nt);
  6205. function nt() {
  6206. (0, _classCallCheck2.default)(this, nt);
  6207. return _super5.apply(this, arguments);
  6208. }
  6209. (0, _createClass2.default)(nt, [{
  6210. key: "signIn",
  6211. value: function () {
  6212. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  6213. var t, n;
  6214. return _regenerator.default.wrap(function _callee18$(_context18) {
  6215. while (1) {
  6216. switch (_context18.prev = _context18.next) {
  6217. case 0:
  6218. if (!("string" != typeof e)) {
  6219. _context18.next = 2;
  6220. break;
  6221. }
  6222. throw new se({
  6223. code: "PARAM_ERROR",
  6224. message: "ticket must be a string"
  6225. });
  6226. case 2:
  6227. t = this._cache.keys.refreshTokenKey;
  6228. _context18.next = 5;
  6229. return this._request.send("auth.signInWithTicket", {
  6230. ticket: e,
  6231. refresh_token: this._cache.getStore(t) || ""
  6232. });
  6233. case 5:
  6234. n = _context18.sent;
  6235. if (!n.refresh_token) {
  6236. _context18.next = 15;
  6237. break;
  6238. }
  6239. this.setRefreshToken(n.refresh_token);
  6240. _context18.next = 10;
  6241. return this._request.refreshAccessToken();
  6242. case 10:
  6243. Fe(Me);
  6244. Fe(je, {
  6245. env: this.config.env,
  6246. loginType: We.CUSTOM,
  6247. persistence: this.config.persistence
  6248. });
  6249. _context18.next = 14;
  6250. return this.refreshUserInfo();
  6251. case 14:
  6252. return _context18.abrupt("return", new et(this.config.env));
  6253. case 15:
  6254. throw new se({
  6255. message: "自定义登录失败"
  6256. });
  6257. case 16:
  6258. case "end":
  6259. return _context18.stop();
  6260. }
  6261. }
  6262. }, _callee18, this);
  6263. }));
  6264. function signIn(_x11) {
  6265. return _signIn2.apply(this, arguments);
  6266. }
  6267. return signIn;
  6268. }()
  6269. }]);
  6270. return nt;
  6271. }(Xe);
  6272. var st = /*#__PURE__*/function (_Xe3) {
  6273. (0, _inherits2.default)(st, _Xe3);
  6274. var _super6 = _createSuper(st);
  6275. function st() {
  6276. (0, _classCallCheck2.default)(this, st);
  6277. return _super6.apply(this, arguments);
  6278. }
  6279. (0, _createClass2.default)(st, [{
  6280. key: "signIn",
  6281. value: function () {
  6282. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  6283. var n, s, r, i, o;
  6284. return _regenerator.default.wrap(function _callee19$(_context19) {
  6285. while (1) {
  6286. switch (_context19.prev = _context19.next) {
  6287. case 0:
  6288. if (!("string" != typeof e)) {
  6289. _context19.next = 2;
  6290. break;
  6291. }
  6292. throw new se({
  6293. code: "PARAM_ERROR",
  6294. message: "email must be a string"
  6295. });
  6296. case 2:
  6297. n = this._cache.keys.refreshTokenKey;
  6298. _context19.next = 5;
  6299. return this._request.send("auth.signIn", {
  6300. loginType: "EMAIL",
  6301. email: e,
  6302. password: t,
  6303. refresh_token: this._cache.getStore(n) || ""
  6304. });
  6305. case 5:
  6306. s = _context19.sent;
  6307. r = s.refresh_token;
  6308. i = s.access_token;
  6309. o = s.access_token_expire;
  6310. if (!r) {
  6311. _context19.next = 22;
  6312. break;
  6313. }
  6314. this.setRefreshToken(r);
  6315. if (!(i && o)) {
  6316. _context19.next = 15;
  6317. break;
  6318. }
  6319. this.setAccessToken(i, o);
  6320. _context19.next = 17;
  6321. break;
  6322. case 15:
  6323. _context19.next = 17;
  6324. return this._request.refreshAccessToken();
  6325. case 17:
  6326. _context19.next = 19;
  6327. return this.refreshUserInfo();
  6328. case 19:
  6329. Fe(Me);
  6330. Fe(je, {
  6331. env: this.config.env,
  6332. loginType: We.EMAIL,
  6333. persistence: this.config.persistence
  6334. });
  6335. return _context19.abrupt("return", new et(this.config.env));
  6336. case 22:
  6337. throw s.code ? new se({
  6338. code: s.code,
  6339. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  6340. }) : new se({
  6341. message: "邮箱登录失败"
  6342. });
  6343. case 23:
  6344. case "end":
  6345. return _context19.stop();
  6346. }
  6347. }
  6348. }, _callee19, this);
  6349. }));
  6350. function signIn(_x12, _x13) {
  6351. return _signIn3.apply(this, arguments);
  6352. }
  6353. return signIn;
  6354. }()
  6355. }, {
  6356. key: "activate",
  6357. value: function () {
  6358. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  6359. return _regenerator.default.wrap(function _callee20$(_context20) {
  6360. while (1) {
  6361. switch (_context20.prev = _context20.next) {
  6362. case 0:
  6363. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  6364. token: e
  6365. }));
  6366. case 1:
  6367. case "end":
  6368. return _context20.stop();
  6369. }
  6370. }
  6371. }, _callee20, this);
  6372. }));
  6373. function activate(_x14) {
  6374. return _activate.apply(this, arguments);
  6375. }
  6376. return activate;
  6377. }()
  6378. }, {
  6379. key: "resetPasswordWithToken",
  6380. value: function () {
  6381. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  6382. return _regenerator.default.wrap(function _callee21$(_context21) {
  6383. while (1) {
  6384. switch (_context21.prev = _context21.next) {
  6385. case 0:
  6386. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  6387. token: e,
  6388. newPassword: t
  6389. }));
  6390. case 1:
  6391. case "end":
  6392. return _context21.stop();
  6393. }
  6394. }
  6395. }, _callee21, this);
  6396. }));
  6397. function resetPasswordWithToken(_x15, _x16) {
  6398. return _resetPasswordWithToken.apply(this, arguments);
  6399. }
  6400. return resetPasswordWithToken;
  6401. }()
  6402. }]);
  6403. return st;
  6404. }(Xe);
  6405. var rt = /*#__PURE__*/function (_Xe4) {
  6406. (0, _inherits2.default)(rt, _Xe4);
  6407. var _super7 = _createSuper(rt);
  6408. function rt() {
  6409. (0, _classCallCheck2.default)(this, rt);
  6410. return _super7.apply(this, arguments);
  6411. }
  6412. (0, _createClass2.default)(rt, [{
  6413. key: "signIn",
  6414. value: function () {
  6415. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  6416. var n, s, r, i, o;
  6417. return _regenerator.default.wrap(function _callee22$(_context22) {
  6418. while (1) {
  6419. switch (_context22.prev = _context22.next) {
  6420. case 0:
  6421. if (!("string" != typeof e)) {
  6422. _context22.next = 2;
  6423. break;
  6424. }
  6425. throw new se({
  6426. code: "PARAM_ERROR",
  6427. message: "username must be a string"
  6428. });
  6429. case 2:
  6430. "string" != typeof t && (t = "", console.warn("password is empty"));
  6431. n = this._cache.keys.refreshTokenKey;
  6432. _context22.next = 6;
  6433. return this._request.send("auth.signIn", {
  6434. loginType: We.USERNAME,
  6435. username: e,
  6436. password: t,
  6437. refresh_token: this._cache.getStore(n) || ""
  6438. });
  6439. case 6:
  6440. s = _context22.sent;
  6441. r = s.refresh_token;
  6442. i = s.access_token_expire;
  6443. o = s.access_token;
  6444. if (!r) {
  6445. _context22.next = 23;
  6446. break;
  6447. }
  6448. this.setRefreshToken(r);
  6449. if (!(o && i)) {
  6450. _context22.next = 16;
  6451. break;
  6452. }
  6453. this.setAccessToken(o, i);
  6454. _context22.next = 18;
  6455. break;
  6456. case 16:
  6457. _context22.next = 18;
  6458. return this._request.refreshAccessToken();
  6459. case 18:
  6460. _context22.next = 20;
  6461. return this.refreshUserInfo();
  6462. case 20:
  6463. Fe(Me);
  6464. Fe(je, {
  6465. env: this.config.env,
  6466. loginType: We.USERNAME,
  6467. persistence: this.config.persistence
  6468. });
  6469. return _context22.abrupt("return", new et(this.config.env));
  6470. case 23:
  6471. throw s.code ? new se({
  6472. code: s.code,
  6473. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  6474. }) : new se({
  6475. message: "用户名密码登录失败"
  6476. });
  6477. case 24:
  6478. case "end":
  6479. return _context22.stop();
  6480. }
  6481. }
  6482. }, _callee22, this);
  6483. }));
  6484. function signIn(_x17, _x18) {
  6485. return _signIn4.apply(this, arguments);
  6486. }
  6487. return signIn;
  6488. }()
  6489. }]);
  6490. return rt;
  6491. }(Xe);
  6492. var it = /*#__PURE__*/function () {
  6493. function it(e) {
  6494. (0, _classCallCheck2.default)(this, it);
  6495. this.config = e, this._cache = Re(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  6496. }
  6497. (0, _createClass2.default)(it, [{
  6498. key: "currentUser",
  6499. get: function get() {
  6500. var e = this.hasLoginState();
  6501. return e && e.user || null;
  6502. }
  6503. }, {
  6504. key: "loginType",
  6505. get: function get() {
  6506. return this._cache.getStore(this._cache.keys.loginTypeKey);
  6507. }
  6508. }, {
  6509. key: "anonymousAuthProvider",
  6510. value: function anonymousAuthProvider() {
  6511. return new tt(this.config);
  6512. }
  6513. }, {
  6514. key: "customAuthProvider",
  6515. value: function customAuthProvider() {
  6516. return new nt(this.config);
  6517. }
  6518. }, {
  6519. key: "emailAuthProvider",
  6520. value: function emailAuthProvider() {
  6521. return new st(this.config);
  6522. }
  6523. }, {
  6524. key: "usernameAuthProvider",
  6525. value: function usernameAuthProvider() {
  6526. return new rt(this.config);
  6527. }
  6528. }, {
  6529. key: "signInAnonymously",
  6530. value: function () {
  6531. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  6532. return _regenerator.default.wrap(function _callee23$(_context23) {
  6533. while (1) {
  6534. switch (_context23.prev = _context23.next) {
  6535. case 0:
  6536. return _context23.abrupt("return", new tt(this.config).signIn());
  6537. case 1:
  6538. case "end":
  6539. return _context23.stop();
  6540. }
  6541. }
  6542. }, _callee23, this);
  6543. }));
  6544. function signInAnonymously() {
  6545. return _signInAnonymously.apply(this, arguments);
  6546. }
  6547. return signInAnonymously;
  6548. }()
  6549. }, {
  6550. key: "signInWithEmailAndPassword",
  6551. value: function () {
  6552. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  6553. return _regenerator.default.wrap(function _callee24$(_context24) {
  6554. while (1) {
  6555. switch (_context24.prev = _context24.next) {
  6556. case 0:
  6557. return _context24.abrupt("return", new st(this.config).signIn(e, t));
  6558. case 1:
  6559. case "end":
  6560. return _context24.stop();
  6561. }
  6562. }
  6563. }, _callee24, this);
  6564. }));
  6565. function signInWithEmailAndPassword(_x19, _x20) {
  6566. return _signInWithEmailAndPassword.apply(this, arguments);
  6567. }
  6568. return signInWithEmailAndPassword;
  6569. }()
  6570. }, {
  6571. key: "signInWithUsernameAndPassword",
  6572. value: function signInWithUsernameAndPassword(e, t) {
  6573. return new rt(this.config).signIn(e, t);
  6574. }
  6575. }, {
  6576. key: "linkAndRetrieveDataWithTicket",
  6577. value: function () {
  6578. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  6579. return _regenerator.default.wrap(function _callee25$(_context25) {
  6580. while (1) {
  6581. switch (_context25.prev = _context25.next) {
  6582. case 0:
  6583. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De(Be, this._onAnonymousConverted);
  6584. _context25.next = 3;
  6585. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  6586. case 3:
  6587. return _context25.abrupt("return", _context25.sent);
  6588. case 4:
  6589. case "end":
  6590. return _context25.stop();
  6591. }
  6592. }
  6593. }, _callee25, this);
  6594. }));
  6595. function linkAndRetrieveDataWithTicket(_x21) {
  6596. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  6597. }
  6598. return linkAndRetrieveDataWithTicket;
  6599. }()
  6600. }, {
  6601. key: "signOut",
  6602. value: function () {
  6603. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  6604. var _this$_cache$keys10, e, t, n, s, r;
  6605. return _regenerator.default.wrap(function _callee26$(_context26) {
  6606. while (1) {
  6607. switch (_context26.prev = _context26.next) {
  6608. case 0:
  6609. if (!(this.loginType === We.ANONYMOUS)) {
  6610. _context26.next = 2;
  6611. break;
  6612. }
  6613. throw new se({
  6614. message: "匿名用户不支持登出操作"
  6615. });
  6616. case 2:
  6617. _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);
  6618. if (s) {
  6619. _context26.next = 5;
  6620. break;
  6621. }
  6622. return _context26.abrupt("return");
  6623. case 5:
  6624. _context26.next = 7;
  6625. return this._request.send("auth.logout", {
  6626. refresh_token: s
  6627. });
  6628. case 7:
  6629. r = _context26.sent;
  6630. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), Fe(Me), Fe(je, {
  6631. env: this.config.env,
  6632. loginType: We.NULL,
  6633. persistence: this.config.persistence
  6634. }), r));
  6635. case 9:
  6636. case "end":
  6637. return _context26.stop();
  6638. }
  6639. }
  6640. }, _callee26, this);
  6641. }));
  6642. function signOut() {
  6643. return _signOut.apply(this, arguments);
  6644. }
  6645. return signOut;
  6646. }()
  6647. }, {
  6648. key: "signUpWithEmailAndPassword",
  6649. value: function () {
  6650. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  6651. return _regenerator.default.wrap(function _callee27$(_context27) {
  6652. while (1) {
  6653. switch (_context27.prev = _context27.next) {
  6654. case 0:
  6655. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  6656. email: e,
  6657. password: t
  6658. }));
  6659. case 1:
  6660. case "end":
  6661. return _context27.stop();
  6662. }
  6663. }
  6664. }, _callee27, this);
  6665. }));
  6666. function signUpWithEmailAndPassword(_x22, _x23) {
  6667. return _signUpWithEmailAndPassword.apply(this, arguments);
  6668. }
  6669. return signUpWithEmailAndPassword;
  6670. }()
  6671. }, {
  6672. key: "sendPasswordResetEmail",
  6673. value: function () {
  6674. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  6675. return _regenerator.default.wrap(function _callee28$(_context28) {
  6676. while (1) {
  6677. switch (_context28.prev = _context28.next) {
  6678. case 0:
  6679. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  6680. email: e
  6681. }));
  6682. case 1:
  6683. case "end":
  6684. return _context28.stop();
  6685. }
  6686. }
  6687. }, _callee28, this);
  6688. }));
  6689. function sendPasswordResetEmail(_x24) {
  6690. return _sendPasswordResetEmail.apply(this, arguments);
  6691. }
  6692. return sendPasswordResetEmail;
  6693. }()
  6694. }, {
  6695. key: "onLoginStateChanged",
  6696. value: function onLoginStateChanged(e) {
  6697. var _this9 = this;
  6698. De(Me, function () {
  6699. var t = _this9.hasLoginState();
  6700. e.call(_this9, t);
  6701. });
  6702. var t = this.hasLoginState();
  6703. e.call(this, t);
  6704. }
  6705. }, {
  6706. key: "onLoginStateExpired",
  6707. value: function onLoginStateExpired(e) {
  6708. De(Ke, e.bind(this));
  6709. }
  6710. }, {
  6711. key: "onAccessTokenRefreshed",
  6712. value: function onAccessTokenRefreshed(e) {
  6713. De($e, e.bind(this));
  6714. }
  6715. }, {
  6716. key: "onAnonymousConverted",
  6717. value: function onAnonymousConverted(e) {
  6718. De(Be, e.bind(this));
  6719. }
  6720. }, {
  6721. key: "onLoginTypeChanged",
  6722. value: function onLoginTypeChanged(e) {
  6723. var _this10 = this;
  6724. De(je, function () {
  6725. var t = _this10.hasLoginState();
  6726. e.call(_this10, t);
  6727. });
  6728. }
  6729. }, {
  6730. key: "getAccessToken",
  6731. value: function () {
  6732. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  6733. return _regenerator.default.wrap(function _callee29$(_context29) {
  6734. while (1) {
  6735. switch (_context29.prev = _context29.next) {
  6736. case 0:
  6737. _context29.next = 2;
  6738. return this._request.getAccessToken();
  6739. case 2:
  6740. _context29.t0 = _context29.sent.accessToken;
  6741. _context29.t1 = this.config.env;
  6742. return _context29.abrupt("return", {
  6743. accessToken: _context29.t0,
  6744. env: _context29.t1
  6745. });
  6746. case 5:
  6747. case "end":
  6748. return _context29.stop();
  6749. }
  6750. }
  6751. }, _callee29, this);
  6752. }));
  6753. function getAccessToken() {
  6754. return _getAccessToken2.apply(this, arguments);
  6755. }
  6756. return getAccessToken;
  6757. }()
  6758. }, {
  6759. key: "hasLoginState",
  6760. value: function hasLoginState() {
  6761. var e = this._cache.keys.refreshTokenKey;
  6762. return this._cache.getStore(e) ? new et(this.config.env) : null;
  6763. }
  6764. }, {
  6765. key: "isUsernameRegistered",
  6766. value: function () {
  6767. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  6768. var _yield$this$_request$5, t;
  6769. return _regenerator.default.wrap(function _callee30$(_context30) {
  6770. while (1) {
  6771. switch (_context30.prev = _context30.next) {
  6772. case 0:
  6773. if (!("string" != typeof e)) {
  6774. _context30.next = 2;
  6775. break;
  6776. }
  6777. throw new se({
  6778. code: "PARAM_ERROR",
  6779. message: "username must be a string"
  6780. });
  6781. case 2:
  6782. _context30.next = 4;
  6783. return this._request.send("auth.isUsernameRegistered", {
  6784. username: e
  6785. });
  6786. case 4:
  6787. _yield$this$_request$5 = _context30.sent;
  6788. t = _yield$this$_request$5.data;
  6789. return _context30.abrupt("return", t && t.isRegistered);
  6790. case 7:
  6791. case "end":
  6792. return _context30.stop();
  6793. }
  6794. }
  6795. }, _callee30, this);
  6796. }));
  6797. function isUsernameRegistered(_x25) {
  6798. return _isUsernameRegistered.apply(this, arguments);
  6799. }
  6800. return isUsernameRegistered;
  6801. }()
  6802. }, {
  6803. key: "getLoginState",
  6804. value: function getLoginState() {
  6805. return Promise.resolve(this.hasLoginState());
  6806. }
  6807. }, {
  6808. key: "signInWithTicket",
  6809. value: function () {
  6810. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  6811. return _regenerator.default.wrap(function _callee31$(_context31) {
  6812. while (1) {
  6813. switch (_context31.prev = _context31.next) {
  6814. case 0:
  6815. return _context31.abrupt("return", new nt(this.config).signIn(e));
  6816. case 1:
  6817. case "end":
  6818. return _context31.stop();
  6819. }
  6820. }
  6821. }, _callee31, this);
  6822. }));
  6823. function signInWithTicket(_x26) {
  6824. return _signInWithTicket.apply(this, arguments);
  6825. }
  6826. return signInWithTicket;
  6827. }()
  6828. }, {
  6829. key: "shouldRefreshAccessToken",
  6830. value: function shouldRefreshAccessToken(e) {
  6831. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  6832. }
  6833. }, {
  6834. key: "getUserInfo",
  6835. value: function getUserInfo() {
  6836. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  6837. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  6838. requestId: e.seqId
  6839. });
  6840. });
  6841. }
  6842. }, {
  6843. key: "getAuthHeader",
  6844. value: function getAuthHeader() {
  6845. var _this$_cache$keys11 = this._cache.keys,
  6846. e = _this$_cache$keys11.refreshTokenKey,
  6847. t = _this$_cache$keys11.accessTokenKey,
  6848. n = this._cache.getStore(e);
  6849. return {
  6850. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  6851. };
  6852. }
  6853. }, {
  6854. key: "_onAnonymousConverted",
  6855. value: function _onAnonymousConverted(e) {
  6856. var t = e.data.env;
  6857. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  6858. }
  6859. }, {
  6860. key: "_onLoginTypeChanged",
  6861. value: function _onLoginTypeChanged(e) {
  6862. var _e$data = e.data,
  6863. t = _e$data.loginType,
  6864. n = _e$data.persistence,
  6865. s = _e$data.env;
  6866. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  6867. }
  6868. }]);
  6869. return it;
  6870. }();
  6871. var ot = function ot(e, t) {
  6872. t = t || ve();
  6873. var n = Ye(this.config.env),
  6874. s = e.cloudPath,
  6875. r = e.filePath,
  6876. i = e.onUploadProgress,
  6877. _e$fileType = e.fileType,
  6878. o = _e$fileType === void 0 ? "image" : _e$fileType;
  6879. return n.send("storage.getUploadMetadata", {
  6880. path: s
  6881. }).then(function (e) {
  6882. var _e$data2 = e.data,
  6883. a = _e$data2.url,
  6884. c = _e$data2.authorization,
  6885. u = _e$data2.token,
  6886. h = _e$data2.fileId,
  6887. l = _e$data2.cosFileId,
  6888. d = e.requestId,
  6889. p = {
  6890. key: s,
  6891. signature: c,
  6892. "x-cos-meta-fileid": l,
  6893. success_action_status: "201",
  6894. "x-cos-security-token": u
  6895. };
  6896. n.upload({
  6897. url: a,
  6898. data: p,
  6899. file: r,
  6900. name: s,
  6901. fileType: o,
  6902. onUploadProgress: i
  6903. }).then(function (e) {
  6904. 201 === e.statusCode ? t(null, {
  6905. fileID: h,
  6906. requestId: d
  6907. }) : t(new se({
  6908. code: "STORAGE_REQUEST_FAIL",
  6909. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  6910. }));
  6911. }).catch(function (e) {
  6912. t(e);
  6913. });
  6914. }).catch(function (e) {
  6915. t(e);
  6916. }), t.promise;
  6917. },
  6918. at = function at(e, t) {
  6919. t = t || ve();
  6920. var n = Ye(this.config.env),
  6921. s = e.cloudPath;
  6922. return n.send("storage.getUploadMetadata", {
  6923. path: s
  6924. }).then(function (e) {
  6925. t(null, e);
  6926. }).catch(function (e) {
  6927. t(e);
  6928. }), t.promise;
  6929. },
  6930. ct = function ct(_ref7, t) {
  6931. var e = _ref7.fileList;
  6932. if (t = t || ve(), !e || !Array.isArray(e)) return {
  6933. code: "INVALID_PARAM",
  6934. message: "fileList必须是非空的数组"
  6935. };
  6936. var _iterator3 = _createForOfIteratorHelper(e),
  6937. _step3;
  6938. try {
  6939. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  6940. var _t8 = _step3.value;
  6941. if (!_t8 || "string" != typeof _t8) return {
  6942. code: "INVALID_PARAM",
  6943. message: "fileList的元素必须是非空的字符串"
  6944. };
  6945. }
  6946. } catch (err) {
  6947. _iterator3.e(err);
  6948. } finally {
  6949. _iterator3.f();
  6950. }
  6951. var n = {
  6952. fileid_list: e
  6953. };
  6954. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  6955. e.code ? t(null, e) : t(null, {
  6956. fileList: e.data.delete_list,
  6957. requestId: e.requestId
  6958. });
  6959. }).catch(function (e) {
  6960. t(e);
  6961. }), t.promise;
  6962. },
  6963. ut = function ut(_ref8, t) {
  6964. var e = _ref8.fileList;
  6965. t = t || ve(), e && Array.isArray(e) || t(null, {
  6966. code: "INVALID_PARAM",
  6967. message: "fileList必须是非空的数组"
  6968. });
  6969. var n = [];
  6970. var _iterator4 = _createForOfIteratorHelper(e),
  6971. _step4;
  6972. try {
  6973. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  6974. var _s9 = _step4.value;
  6975. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  6976. code: "INVALID_PARAM",
  6977. message: "fileList的元素必须是包含fileID和maxAge的对象"
  6978. }), n.push({
  6979. fileid: _s9.fileID,
  6980. max_age: _s9.maxAge
  6981. })) : "string" == typeof _s9 ? n.push({
  6982. fileid: _s9
  6983. }) : t(null, {
  6984. code: "INVALID_PARAM",
  6985. message: "fileList的元素必须是字符串"
  6986. });
  6987. }
  6988. } catch (err) {
  6989. _iterator4.e(err);
  6990. } finally {
  6991. _iterator4.f();
  6992. }
  6993. var s = {
  6994. file_list: n
  6995. };
  6996. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  6997. e.code ? t(null, e) : t(null, {
  6998. fileList: e.data.download_list,
  6999. requestId: e.requestId
  7000. });
  7001. }).catch(function (e) {
  7002. t(e);
  7003. }), t.promise;
  7004. },
  7005. ht = /*#__PURE__*/function () {
  7006. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  7007. var e, n, s, r;
  7008. return _regenerator.default.wrap(function _callee32$(_context32) {
  7009. while (1) {
  7010. switch (_context32.prev = _context32.next) {
  7011. case 0:
  7012. e = _ref9.fileID;
  7013. _context32.next = 3;
  7014. return ut.call(this, {
  7015. fileList: [{
  7016. fileID: e,
  7017. maxAge: 600
  7018. }]
  7019. });
  7020. case 3:
  7021. n = _context32.sent.fileList[0];
  7022. if (!("SUCCESS" !== n.code)) {
  7023. _context32.next = 6;
  7024. break;
  7025. }
  7026. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  7027. e(n);
  7028. }));
  7029. case 6:
  7030. s = Ye(this.config.env);
  7031. r = n.download_url;
  7032. if (!(r = encodeURI(r), !t)) {
  7033. _context32.next = 10;
  7034. break;
  7035. }
  7036. return _context32.abrupt("return", s.download({
  7037. url: r
  7038. }));
  7039. case 10:
  7040. _context32.t0 = t;
  7041. _context32.next = 13;
  7042. return s.download({
  7043. url: r
  7044. });
  7045. case 13:
  7046. _context32.t1 = _context32.sent;
  7047. (0, _context32.t0)(_context32.t1);
  7048. case 15:
  7049. case "end":
  7050. return _context32.stop();
  7051. }
  7052. }
  7053. }, _callee32, this);
  7054. }));
  7055. return function ht(_x27, _x28) {
  7056. return _ref10.apply(this, arguments);
  7057. };
  7058. }(),
  7059. lt = function lt(_ref11, i) {
  7060. var e = _ref11.name,
  7061. t = _ref11.data,
  7062. n = _ref11.query,
  7063. s = _ref11.parse,
  7064. r = _ref11.search;
  7065. var o = i || ve();
  7066. var a;
  7067. try {
  7068. a = t ? JSON.stringify(t) : "";
  7069. } catch (e) {
  7070. return Promise.reject(e);
  7071. }
  7072. if (!e) return Promise.reject(new se({
  7073. code: "PARAM_ERROR",
  7074. message: "函数名不能为空"
  7075. }));
  7076. var c = {
  7077. inQuery: n,
  7078. parse: s,
  7079. search: r,
  7080. function_name: e,
  7081. request_data: a
  7082. };
  7083. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  7084. if (e.code) o(null, e);else {
  7085. var _t9 = e.data.response_data;
  7086. if (s) o(null, {
  7087. result: _t9,
  7088. requestId: e.requestId
  7089. });else try {
  7090. _t9 = JSON.parse(e.data.response_data), o(null, {
  7091. result: _t9,
  7092. requestId: e.requestId
  7093. });
  7094. } catch (e) {
  7095. o(new se({
  7096. message: "response data must be json"
  7097. }));
  7098. }
  7099. }
  7100. return o.promise;
  7101. }).catch(function (e) {
  7102. o(e);
  7103. }), o.promise;
  7104. },
  7105. dt = {
  7106. timeout: 15e3,
  7107. persistence: "session"
  7108. },
  7109. pt = {};
  7110. var ft = /*#__PURE__*/function () {
  7111. function ft(e) {
  7112. (0, _classCallCheck2.default)(this, ft);
  7113. this.config = e || this.config, this.authObj = void 0;
  7114. }
  7115. (0, _createClass2.default)(ft, [{
  7116. key: "init",
  7117. value: function init(e) {
  7118. switch (Te.adapter || (this.requestClient = new Te.adapter.reqClass({
  7119. timeout: e.timeout || 5e3,
  7120. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  7121. })), this.config = _objectSpread(_objectSpread({}, dt), e), !0) {
  7122. case this.config.timeout > 6e5:
  7123. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  7124. break;
  7125. case this.config.timeout < 100:
  7126. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  7127. }
  7128. return new ft(this.config);
  7129. }
  7130. }, {
  7131. key: "auth",
  7132. value: function auth() {
  7133. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7134. e = _ref12.persistence;
  7135. if (this.authObj) return this.authObj;
  7136. var t = e || Te.adapter.primaryStorage || dt.persistence;
  7137. var n;
  7138. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  7139. var t = e.env;
  7140. Oe[t] = new Ee(e), xe[t] = new Ee(_objectSpread(_objectSpread({}, e), {}, {
  7141. persistence: "local"
  7142. }));
  7143. }(this.config), n = this.config, Qe[n.env] = new Ve(n), this.authObj = new it(this.config), this.authObj;
  7144. }
  7145. }, {
  7146. key: "on",
  7147. value: function on(e, t) {
  7148. return De.apply(this, [e, t]);
  7149. }
  7150. }, {
  7151. key: "off",
  7152. value: function off(e, t) {
  7153. return qe.apply(this, [e, t]);
  7154. }
  7155. }, {
  7156. key: "callFunction",
  7157. value: function callFunction(e, t) {
  7158. return lt.apply(this, [e, t]);
  7159. }
  7160. }, {
  7161. key: "deleteFile",
  7162. value: function deleteFile(e, t) {
  7163. return ct.apply(this, [e, t]);
  7164. }
  7165. }, {
  7166. key: "getTempFileURL",
  7167. value: function getTempFileURL(e, t) {
  7168. return ut.apply(this, [e, t]);
  7169. }
  7170. }, {
  7171. key: "downloadFile",
  7172. value: function downloadFile(e, t) {
  7173. return ht.apply(this, [e, t]);
  7174. }
  7175. }, {
  7176. key: "uploadFile",
  7177. value: function uploadFile(e, t) {
  7178. return ot.apply(this, [e, t]);
  7179. }
  7180. }, {
  7181. key: "getUploadMetadata",
  7182. value: function getUploadMetadata(e, t) {
  7183. return at.apply(this, [e, t]);
  7184. }
  7185. }, {
  7186. key: "registerExtension",
  7187. value: function registerExtension(e) {
  7188. pt[e.name] = e;
  7189. }
  7190. }, {
  7191. key: "invokeExtension",
  7192. value: function () {
  7193. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  7194. var n;
  7195. return _regenerator.default.wrap(function _callee33$(_context33) {
  7196. while (1) {
  7197. switch (_context33.prev = _context33.next) {
  7198. case 0:
  7199. n = pt[e];
  7200. if (n) {
  7201. _context33.next = 3;
  7202. break;
  7203. }
  7204. throw new se({
  7205. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  7206. });
  7207. case 3:
  7208. _context33.next = 5;
  7209. return n.invoke(t, this);
  7210. case 5:
  7211. return _context33.abrupt("return", _context33.sent);
  7212. case 6:
  7213. case "end":
  7214. return _context33.stop();
  7215. }
  7216. }
  7217. }, _callee33, this);
  7218. }));
  7219. function invokeExtension(_x29, _x30) {
  7220. return _invokeExtension.apply(this, arguments);
  7221. }
  7222. return invokeExtension;
  7223. }()
  7224. }, {
  7225. key: "useAdapters",
  7226. value: function useAdapters(e) {
  7227. var _ref13 = ke(e) || {},
  7228. t = _ref13.adapter,
  7229. n = _ref13.runtime;
  7230. t && (Te.adapter = t), n && (Te.runtime = n);
  7231. }
  7232. }]);
  7233. return ft;
  7234. }();
  7235. var gt = new ft();
  7236. function mt(e, t, n) {
  7237. void 0 === n && (n = {});
  7238. var s = /\?/.test(t),
  7239. r = "";
  7240. for (var i in n) {
  7241. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  7242. }
  7243. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  7244. }
  7245. var yt = /*#__PURE__*/function () {
  7246. function yt() {
  7247. (0, _classCallCheck2.default)(this, yt);
  7248. }
  7249. (0, _createClass2.default)(yt, [{
  7250. key: "post",
  7251. value: function post(e) {
  7252. var t = e.url,
  7253. n = e.data,
  7254. s = e.headers;
  7255. return new Promise(function (e, r) {
  7256. re.request({
  7257. url: mt("https:", t),
  7258. data: n,
  7259. method: "POST",
  7260. header: s,
  7261. success: function success(t) {
  7262. e(t);
  7263. },
  7264. fail: function fail(e) {
  7265. r(e);
  7266. }
  7267. });
  7268. });
  7269. }
  7270. }, {
  7271. key: "upload",
  7272. value: function upload(e) {
  7273. return new Promise(function (t, n) {
  7274. var s = e.url,
  7275. r = e.file,
  7276. i = e.data,
  7277. o = e.headers,
  7278. a = e.fileType,
  7279. c = re.uploadFile({
  7280. url: mt("https:", s),
  7281. name: "file",
  7282. formData: Object.assign({}, i),
  7283. filePath: r,
  7284. fileType: a,
  7285. header: o,
  7286. success: function success(e) {
  7287. var n = {
  7288. statusCode: e.statusCode,
  7289. data: e.data || {}
  7290. };
  7291. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  7292. },
  7293. fail: function fail(e) {
  7294. n(new Error(e.errMsg || "uploadFile:fail"));
  7295. }
  7296. });
  7297. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  7298. e.onUploadProgress({
  7299. loaded: t.totalBytesSent,
  7300. total: t.totalBytesExpectedToSend
  7301. });
  7302. });
  7303. });
  7304. }
  7305. }]);
  7306. return yt;
  7307. }();
  7308. var _t = {
  7309. setItem: function setItem(e, t) {
  7310. re.setStorageSync(e, t);
  7311. },
  7312. getItem: function getItem(e) {
  7313. return re.getStorageSync(e);
  7314. },
  7315. removeItem: function removeItem(e) {
  7316. re.removeStorageSync(e);
  7317. },
  7318. clear: function clear() {
  7319. re.clearStorageSync();
  7320. }
  7321. };
  7322. var wt = {
  7323. genAdapter: function genAdapter() {
  7324. return {
  7325. root: {},
  7326. reqClass: yt,
  7327. localStorage: _t,
  7328. primaryStorage: "local"
  7329. };
  7330. },
  7331. isMatch: function isMatch() {
  7332. return !0;
  7333. },
  7334. runtime: "uni_app"
  7335. };
  7336. gt.useAdapters(wt);
  7337. var vt = gt,
  7338. St = vt.init;
  7339. vt.init = function (e) {
  7340. e.env = e.spaceId;
  7341. var t = St.call(this, e);
  7342. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  7343. var n = t.auth;
  7344. return t.auth = function (e) {
  7345. var t = n.call(this, e);
  7346. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  7347. var n;
  7348. t[e] = (n = t[e], function (e) {
  7349. e = e || {};
  7350. var _ne = ne(e),
  7351. t = _ne.success,
  7352. s = _ne.fail,
  7353. r = _ne.complete;
  7354. if (!(t || s || r)) return n.call(this, e);
  7355. n.call(this, e).then(function (e) {
  7356. t && t(e), r && r(e);
  7357. }, function (e) {
  7358. s && s(e), r && r(e);
  7359. });
  7360. }).bind(t);
  7361. }), t;
  7362. }, t.customAuth = t.auth, t;
  7363. };
  7364. var It = vt;
  7365. var bt = /*#__PURE__*/function (_ge) {
  7366. (0, _inherits2.default)(bt, _ge);
  7367. var _super8 = _createSuper(bt);
  7368. function bt() {
  7369. (0, _classCallCheck2.default)(this, bt);
  7370. return _super8.apply(this, arguments);
  7371. }
  7372. (0, _createClass2.default)(bt, [{
  7373. key: "getAccessToken",
  7374. value: function getAccessToken() {
  7375. var _this11 = this;
  7376. return new Promise(function (e, t) {
  7377. var n = "Anonymous_Access_token";
  7378. _this11.setAccessToken(n), e(n);
  7379. });
  7380. }
  7381. }, {
  7382. key: "setupRequest",
  7383. value: function setupRequest(e, t) {
  7384. var n = Object.assign({}, e, {
  7385. spaceId: this.config.spaceId,
  7386. timestamp: Date.now()
  7387. }),
  7388. s = {
  7389. "Content-Type": "application/json"
  7390. };
  7391. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = de.sign(n, this.config.clientSecret);
  7392. var r = le();
  7393. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  7394. var _ie = ie(),
  7395. i = _ie.token;
  7396. return s["x-client-token"] = i, {
  7397. url: this.config.requestUrl,
  7398. method: "POST",
  7399. data: n,
  7400. dataType: "json",
  7401. header: JSON.parse(JSON.stringify(s))
  7402. };
  7403. }
  7404. }, {
  7405. key: "uploadFileToOSS",
  7406. value: function uploadFileToOSS(_ref14) {
  7407. var _this12 = this;
  7408. var e = _ref14.url,
  7409. t = _ref14.formData,
  7410. n = _ref14.name,
  7411. s = _ref14.filePath,
  7412. r = _ref14.fileType,
  7413. i = _ref14.onUploadProgress;
  7414. return new Promise(function (o, a) {
  7415. var c = _this12.adapter.uploadFile({
  7416. url: e,
  7417. formData: t,
  7418. name: n,
  7419. filePath: s,
  7420. fileType: r,
  7421. success: function success(e) {
  7422. e && e.statusCode < 400 ? o(e) : a(new se({
  7423. code: "UPLOAD_FAILED",
  7424. message: "文件上传失败"
  7425. }));
  7426. },
  7427. fail: function fail(e) {
  7428. a(new se({
  7429. code: e.code || "UPLOAD_FAILED",
  7430. message: e.message || e.errMsg || "文件上传失败"
  7431. }));
  7432. }
  7433. });
  7434. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  7435. i({
  7436. loaded: e.totalBytesSent,
  7437. total: e.totalBytesExpectedToSend
  7438. });
  7439. });
  7440. });
  7441. }
  7442. }, {
  7443. key: "uploadFile",
  7444. value: function uploadFile(_ref15) {
  7445. var _this13 = this;
  7446. var e = _ref15.filePath,
  7447. t = _ref15.cloudPath,
  7448. _ref15$fileType = _ref15.fileType,
  7449. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  7450. s = _ref15.onUploadProgress;
  7451. if (!t) throw new se({
  7452. code: "CLOUDPATH_REQUIRED",
  7453. message: "cloudPath不可为空"
  7454. });
  7455. var r;
  7456. return this.getOSSUploadOptionsFromPath({
  7457. cloudPath: t
  7458. }).then(function (t) {
  7459. var _t$result = t.result,
  7460. i = _t$result.url,
  7461. o = _t$result.formData,
  7462. a = _t$result.name;
  7463. r = t.result.fileUrl;
  7464. var c = {
  7465. url: i,
  7466. formData: o,
  7467. name: a,
  7468. filePath: e,
  7469. fileType: n
  7470. };
  7471. return _this13.uploadFileToOSS(Object.assign({}, c, {
  7472. onUploadProgress: s
  7473. }));
  7474. }).then(function () {
  7475. return _this13.reportOSSUpload({
  7476. cloudPath: t
  7477. });
  7478. }).then(function (t) {
  7479. return new Promise(function (n, s) {
  7480. t.success ? n({
  7481. success: !0,
  7482. filePath: e,
  7483. fileID: r
  7484. }) : s(new se({
  7485. code: "UPLOAD_FAILED",
  7486. message: "文件上传失败"
  7487. }));
  7488. });
  7489. });
  7490. }
  7491. }, {
  7492. key: "deleteFile",
  7493. value: function deleteFile(_ref16) {
  7494. var e = _ref16.fileList;
  7495. var t = {
  7496. method: "serverless.file.resource.delete",
  7497. params: JSON.stringify({
  7498. fileList: e
  7499. })
  7500. };
  7501. return this.request(this.setupRequest(t)).then(function (e) {
  7502. if (e.success) return e.result;
  7503. throw new se({
  7504. code: "DELETE_FILE_FAILED",
  7505. message: "删除文件失败"
  7506. });
  7507. });
  7508. }
  7509. }, {
  7510. key: "getTempFileURL",
  7511. value: function getTempFileURL() {
  7512. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7513. e = _ref17.fileList;
  7514. if (!Array.isArray(e) || 0 === e.length) throw new se({
  7515. code: "INVALID_PARAM",
  7516. message: "fileList的元素必须是非空的字符串"
  7517. });
  7518. var t = {
  7519. method: "serverless.file.resource.getTempFileURL",
  7520. params: JSON.stringify({
  7521. fileList: e
  7522. })
  7523. };
  7524. return this.request(this.setupRequest(t)).then(function (e) {
  7525. if (e.success) return {
  7526. fileList: e.result.fileList.map(function (e) {
  7527. return {
  7528. fileID: e.fileID,
  7529. tempFileURL: e.tempFileURL
  7530. };
  7531. })
  7532. };
  7533. throw new se({
  7534. code: "GET_TEMP_FILE_URL_FAILED",
  7535. message: "获取临时文件链接失败"
  7536. });
  7537. });
  7538. }
  7539. }]);
  7540. return bt;
  7541. }(ge);
  7542. var kt = {
  7543. init: function init(e) {
  7544. var t = new bt(e),
  7545. n = {
  7546. signInAnonymously: function signInAnonymously() {
  7547. return t.authorize();
  7548. },
  7549. getLoginState: function getLoginState() {
  7550. return Promise.resolve(!1);
  7551. }
  7552. };
  7553. return t.auth = function () {
  7554. return n;
  7555. }, t.customAuth = t.auth, t;
  7556. }
  7557. };
  7558. function Tt(_ref18) {
  7559. var e = _ref18.data;
  7560. var t;
  7561. t = le();
  7562. var n = JSON.parse(JSON.stringify(e || {}));
  7563. if (Object.assign(n, {
  7564. clientInfo: t
  7565. }), !n.uniIdToken) {
  7566. var _ie2 = ie(),
  7567. _e18 = _ie2.token;
  7568. _e18 && (n.uniIdToken = _e18);
  7569. }
  7570. return n;
  7571. }
  7572. function Ct() {
  7573. return _Ct.apply(this, arguments);
  7574. }
  7575. function _Ct() {
  7576. _Ct = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  7577. var _this26 = this;
  7578. var _ref60,
  7579. e,
  7580. t,
  7581. _this$__dev__,
  7582. n,
  7583. s,
  7584. r,
  7585. i,
  7586. o,
  7587. a,
  7588. _args6 = arguments;
  7589. return _regenerator.default.wrap(function _callee54$(_context54) {
  7590. while (1) {
  7591. switch (_context54.prev = _context54.next) {
  7592. case 0:
  7593. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.name, t = _ref60.data;
  7594. _context54.next = 3;
  7595. return this.__dev__.initLocalNetwork();
  7596. case 3:
  7597. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  7598. aliyun: "aliyun",
  7599. tencent: "tcb"
  7600. }[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);
  7601. return _context54.abrupt("return", new Promise(function (t, n) {
  7602. re.request({
  7603. method: "POST",
  7604. url: o,
  7605. data: {
  7606. name: e,
  7607. platform: A,
  7608. provider: r,
  7609. spaceId: i
  7610. },
  7611. timeout: 3e3,
  7612. success: function success(e) {
  7613. t(e);
  7614. },
  7615. fail: function fail() {
  7616. t({
  7617. data: {
  7618. code: "NETWORK_ERROR",
  7619. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  7620. }
  7621. });
  7622. }
  7623. });
  7624. }).then(function () {
  7625. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7626. e = _ref61.data;
  7627. var _ref62 = e || {},
  7628. t = _ref62.code,
  7629. n = _ref62.message;
  7630. return {
  7631. code: 0 === t ? 0 : t || "SYS_ERR",
  7632. message: n || "SYS_ERR"
  7633. };
  7634. }).then(function (_ref63) {
  7635. var n = _ref63.code,
  7636. s = _ref63.message;
  7637. if (0 !== n) {
  7638. switch (n) {
  7639. case "MODULE_ENCRYPTED":
  7640. 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"));
  7641. break;
  7642. case "FUNCTION_ENCRYPTED":
  7643. 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"));
  7644. break;
  7645. case "ACTION_ENCRYPTED":
  7646. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  7647. break;
  7648. case "NETWORK_ERROR":
  7649. {
  7650. var _e30 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  7651. throw console.error(_e30), new Error(_e30);
  7652. }
  7653. case "SWITCH_TO_CLOUD":
  7654. break;
  7655. default:
  7656. {
  7657. 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");
  7658. throw console.error(_e31), new Error(_e31);
  7659. }
  7660. }
  7661. return _this26._callCloudFunction({
  7662. name: e,
  7663. data: t
  7664. });
  7665. }
  7666. return new Promise(function (e, n) {
  7667. var s = Tt.call(_this26, {
  7668. data: t
  7669. });
  7670. re.request({
  7671. method: "POST",
  7672. url: a,
  7673. data: {
  7674. provider: r,
  7675. platform: A,
  7676. param: s
  7677. },
  7678. success: function success() {
  7679. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7680. t = _ref64.statusCode,
  7681. s = _ref64.data;
  7682. return !t || t >= 400 ? n(new se({
  7683. code: s.code || "SYS_ERR",
  7684. message: s.message || "request:fail"
  7685. })) : e({
  7686. result: s
  7687. });
  7688. },
  7689. fail: function fail(e) {
  7690. n(new se({
  7691. code: e.code || e.errCode || "SYS_ERR",
  7692. message: e.message || e.errMsg || "request:fail"
  7693. }));
  7694. }
  7695. });
  7696. });
  7697. }));
  7698. case 5:
  7699. case "end":
  7700. return _context54.stop();
  7701. }
  7702. }
  7703. }, _callee54, this);
  7704. }));
  7705. return _Ct.apply(this, arguments);
  7706. }
  7707. var Pt = [{
  7708. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  7709. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  7710. mode: "append"
  7711. }];
  7712. var At = /[\\^$.*+?()[\]{}|]/g,
  7713. Et = RegExp(At.source);
  7714. function Ot(e, t, n) {
  7715. return e.replace(new RegExp((s = t) && Et.test(s) ? s.replace(At, "\\$&") : s, "g"), n);
  7716. var s;
  7717. }
  7718. var xt = "none",
  7719. Rt = "request",
  7720. Ut = "response",
  7721. Lt = "both";
  7722. var Nt = /*#__PURE__*/function () {
  7723. function Nt() {
  7724. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7725. e = _ref19.secretType,
  7726. t = _ref19.uniCloudIns;
  7727. (0, _classCallCheck2.default)(this, Nt);
  7728. this.clientType = "", this.secretType = e || xt, this.uniCloudIns = t;
  7729. var _this$uniCloudIns$con = this.uniCloudIns.config,
  7730. n = _this$uniCloudIns$con.provider,
  7731. s = _this$uniCloudIns$con.spaceId;
  7732. var r;
  7733. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  7734. }
  7735. (0, _createClass2.default)(Nt, [{
  7736. key: "getSystemInfo",
  7737. value: function getSystemInfo() {
  7738. return this._systemInfo || (this._systemInfo = ue()), this._systemInfo;
  7739. }
  7740. }, {
  7741. key: "appId",
  7742. get: function get() {
  7743. return this.getSystemInfo().appId;
  7744. }
  7745. }, {
  7746. key: "deviceId",
  7747. get: function get() {
  7748. return this.getSystemInfo().deviceId;
  7749. }
  7750. }, {
  7751. key: "encryptData",
  7752. value: function () {
  7753. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  7754. return _regenerator.default.wrap(function _callee34$(_context34) {
  7755. while (1) {
  7756. switch (_context34.prev = _context34.next) {
  7757. case 0:
  7758. return _context34.abrupt("return", this.secretType === xt ? e : this.platformEncryptData(e));
  7759. case 1:
  7760. case "end":
  7761. return _context34.stop();
  7762. }
  7763. }
  7764. }, _callee34, this);
  7765. }));
  7766. function encryptData(_x31) {
  7767. return _encryptData.apply(this, arguments);
  7768. }
  7769. return encryptData;
  7770. }()
  7771. }, {
  7772. key: "decryptResult",
  7773. value: function () {
  7774. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  7775. var _ref20, t, n;
  7776. return _regenerator.default.wrap(function _callee35$(_context35) {
  7777. while (1) {
  7778. switch (_context35.prev = _context35.next) {
  7779. case 0:
  7780. if (!(this.secretType === xt)) {
  7781. _context35.next = 2;
  7782. break;
  7783. }
  7784. return _context35.abrupt("return", e);
  7785. case 2:
  7786. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  7787. return _context35.abrupt("return", t || !n ? e : this.secretType === Rt ? n : this.platformDecryptResult(e));
  7788. case 4:
  7789. case "end":
  7790. return _context35.stop();
  7791. }
  7792. }
  7793. }, _callee35, this);
  7794. }));
  7795. function decryptResult(_x32) {
  7796. return _decryptResult.apply(this, arguments);
  7797. }
  7798. return decryptResult;
  7799. }()
  7800. }, {
  7801. key: "wrapVerifyClientCallFunction",
  7802. value: function wrapVerifyClientCallFunction(e) {
  7803. var t = this;
  7804. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  7805. var _ref22,
  7806. n,
  7807. _ref22$data,
  7808. s,
  7809. r,
  7810. _args36 = arguments;
  7811. return _regenerator.default.wrap(function _callee36$(_context36) {
  7812. while (1) {
  7813. switch (_context36.prev = _context36.next) {
  7814. case 0:
  7815. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  7816. _context36.next = 3;
  7817. return t.prepare();
  7818. case 3:
  7819. _context36.next = 5;
  7820. return t.platformGetSignOption();
  7821. case 5:
  7822. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  7823. _context36.next = 8;
  7824. return e({
  7825. name: n,
  7826. data: s
  7827. });
  7828. case 8:
  7829. r = _context36.sent;
  7830. _context36.t0 = t.isClientKeyNotFound(r);
  7831. if (!_context36.t0) {
  7832. _context36.next = 19;
  7833. break;
  7834. }
  7835. _context36.next = 13;
  7836. return t.prepare({
  7837. forceUpdate: !0
  7838. });
  7839. case 13:
  7840. _context36.next = 15;
  7841. return t.platformGetSignOption();
  7842. case 15:
  7843. s._uniCloudOptions = _context36.sent;
  7844. _context36.next = 18;
  7845. return e({
  7846. name: n,
  7847. data: s
  7848. });
  7849. case 18:
  7850. r = _context36.sent;
  7851. case 19:
  7852. return _context36.abrupt("return", r);
  7853. case 20:
  7854. case "end":
  7855. return _context36.stop();
  7856. }
  7857. }
  7858. }, _callee36);
  7859. }));
  7860. }
  7861. }, {
  7862. key: "wrapEncryptDataCallFunction",
  7863. value: function wrapEncryptDataCallFunction(e) {
  7864. var t = this;
  7865. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  7866. var _ref24,
  7867. n,
  7868. _ref24$data,
  7869. s,
  7870. r,
  7871. i,
  7872. _r3,
  7873. _args37 = arguments;
  7874. return _regenerator.default.wrap(function _callee37$(_context37) {
  7875. while (1) {
  7876. switch (_context37.prev = _context37.next) {
  7877. case 0:
  7878. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  7879. _context37.next = 3;
  7880. return t.prepare();
  7881. case 3:
  7882. _context37.next = 5;
  7883. return t.encryptData(s);
  7884. case 5:
  7885. r = _context37.sent;
  7886. _context37.next = 8;
  7887. return e({
  7888. name: n,
  7889. data: r
  7890. });
  7891. case 8:
  7892. i = _context37.sent;
  7893. if (!t.isClientKeyNotFound(i)) {
  7894. _context37.next = 21;
  7895. break;
  7896. }
  7897. _context37.next = 12;
  7898. return t.prepare({
  7899. forceUpdate: !0
  7900. });
  7901. case 12:
  7902. _context37.next = 14;
  7903. return t.encryptData(s);
  7904. case 14:
  7905. _r3 = _context37.sent;
  7906. _context37.next = 17;
  7907. return t.platformGetSignOption();
  7908. case 17:
  7909. s._uniCloudOptions = _context37.sent;
  7910. _context37.next = 20;
  7911. return e({
  7912. name: n,
  7913. data: _r3
  7914. });
  7915. case 20:
  7916. i = _context37.sent;
  7917. case 21:
  7918. _context37.next = 23;
  7919. return t.decryptResult(i.result);
  7920. case 23:
  7921. i.result = _context37.sent;
  7922. return _context37.abrupt("return", i);
  7923. case 25:
  7924. case "end":
  7925. return _context37.stop();
  7926. }
  7927. }
  7928. }, _callee37);
  7929. }));
  7930. }
  7931. }]);
  7932. return Nt;
  7933. }();
  7934. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  7935. function Dt(e) {
  7936. return parseInt(e) === e;
  7937. }
  7938. function Ft(e) {
  7939. if (!Dt(e.length)) return !1;
  7940. for (var t = 0; t < e.length; t++) {
  7941. if (!Dt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  7942. }
  7943. return !0;
  7944. }
  7945. function qt(e, t) {
  7946. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  7947. if (Array.isArray(e)) {
  7948. if (!Ft(e)) throw new Error("Array contains invalid value: " + e);
  7949. return new Uint8Array(e);
  7950. }
  7951. if (Dt(e.length) && Ft(e)) return new Uint8Array(e);
  7952. throw new Error("unsupported array-like object");
  7953. }
  7954. function Mt(e) {
  7955. return new Uint8Array(e);
  7956. }
  7957. function Kt(e, t, n, s, r) {
  7958. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  7959. }
  7960. var jt,
  7961. Bt = {
  7962. toBytes: function toBytes(e) {
  7963. var t = [],
  7964. n = 0;
  7965. for (e = encodeURI(e); n < e.length;) {
  7966. var s = e.charCodeAt(n++);
  7967. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  7968. }
  7969. return qt(t);
  7970. },
  7971. fromBytes: function fromBytes(e) {
  7972. for (var t = [], n = 0; n < e.length;) {
  7973. var s = e[n];
  7974. 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);
  7975. }
  7976. return t.join("");
  7977. }
  7978. },
  7979. $t = (jt = "0123456789abcdef", {
  7980. toBytes: function toBytes(e) {
  7981. for (var t = [], n = 0; n < e.length; n += 2) {
  7982. t.push(parseInt(e.substr(n, 2), 16));
  7983. }
  7984. return t;
  7985. },
  7986. fromBytes: function fromBytes(e) {
  7987. for (var t = [], n = 0; n < e.length; n++) {
  7988. var s = e[n];
  7989. t.push(jt[(240 & s) >> 4] + jt[15 & s]);
  7990. }
  7991. return t.join("");
  7992. }
  7993. }),
  7994. Wt = {
  7995. 16: 10,
  7996. 24: 12,
  7997. 32: 14
  7998. },
  7999. zt = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  8000. Jt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  8001. Ht = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  8002. Gt = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  8003. Vt = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  8004. Qt = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  8005. Yt = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  8006. Xt = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  8007. Zt = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  8008. en = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  8009. tn = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  8010. nn = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  8011. sn = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  8012. rn = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  8013. on = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  8014. function an(e) {
  8015. for (var t = [], n = 0; n < e.length; n += 4) {
  8016. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  8017. }
  8018. return t;
  8019. }
  8020. var cn = /*#__PURE__*/function () {
  8021. function cn(e) {
  8022. (0, _classCallCheck2.default)(this, cn);
  8023. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  8024. Object.defineProperty(this, "key", {
  8025. value: qt(e, !0)
  8026. }), this._prepare();
  8027. }
  8028. (0, _createClass2.default)(cn, [{
  8029. key: "_prepare",
  8030. value: function _prepare() {
  8031. var e = Wt[this.key.length];
  8032. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  8033. this._Ke = [], this._Kd = [];
  8034. for (var t = 0; t <= e; t++) {
  8035. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  8036. }
  8037. var n,
  8038. s = 4 * (e + 1),
  8039. r = this.key.length / 4,
  8040. i = an(this.key);
  8041. for (t = 0; t < r; t++) {
  8042. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  8043. }
  8044. for (var o, a = 0, c = r; c < s;) {
  8045. if (o = i[r - 1], i[0] ^= Jt[o >> 16 & 255] << 24 ^ Jt[o >> 8 & 255] << 16 ^ Jt[255 & o] << 8 ^ Jt[o >> 24 & 255] ^ zt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  8046. i[t] ^= i[t - 1];
  8047. } else {
  8048. for (t = 1; t < r / 2; t++) {
  8049. i[t] ^= i[t - 1];
  8050. }
  8051. o = i[r / 2 - 1], i[r / 2] ^= Jt[255 & o] ^ Jt[o >> 8 & 255] << 8 ^ Jt[o >> 16 & 255] << 16 ^ Jt[o >> 24 & 255] << 24;
  8052. for (t = r / 2 + 1; t < r; t++) {
  8053. i[t] ^= i[t - 1];
  8054. }
  8055. }
  8056. for (t = 0; t < r && c < s;) {
  8057. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  8058. }
  8059. }
  8060. for (var u = 1; u < e; u++) {
  8061. for (var h = 0; h < 4; h++) {
  8062. o = this._Kd[u][h], this._Kd[u][h] = nn[o >> 24 & 255] ^ sn[o >> 16 & 255] ^ rn[o >> 8 & 255] ^ on[255 & o];
  8063. }
  8064. }
  8065. }
  8066. }, {
  8067. key: "encrypt",
  8068. value: function encrypt(e) {
  8069. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  8070. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = an(e), r = 0; r < 4; r++) {
  8071. s[r] ^= this._Ke[0][r];
  8072. }
  8073. for (var i = 1; i < t; i++) {
  8074. for (r = 0; r < 4; r++) {
  8075. n[r] = Gt[s[r] >> 24 & 255] ^ Vt[s[(r + 1) % 4] >> 16 & 255] ^ Qt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  8076. }
  8077. s = n.slice();
  8078. }
  8079. var o,
  8080. a = Mt(16);
  8081. for (r = 0; r < 4; r++) {
  8082. o = this._Ke[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 3) % 4]] ^ o);
  8083. }
  8084. return a;
  8085. }
  8086. }, {
  8087. key: "decrypt",
  8088. value: function decrypt(e) {
  8089. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  8090. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = an(e), r = 0; r < 4; r++) {
  8091. s[r] ^= this._Kd[0][r];
  8092. }
  8093. for (var i = 1; i < t; i++) {
  8094. for (r = 0; r < 4; r++) {
  8095. n[r] = Xt[s[r] >> 24 & 255] ^ Zt[s[(r + 3) % 4] >> 16 & 255] ^ en[s[(r + 2) % 4] >> 8 & 255] ^ tn[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  8096. }
  8097. s = n.slice();
  8098. }
  8099. var o,
  8100. a = Mt(16);
  8101. for (r = 0; r < 4; r++) {
  8102. o = this._Kd[t][r], a[4 * r] = 255 & (Ht[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Ht[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Ht[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Ht[255 & s[(r + 1) % 4]] ^ o);
  8103. }
  8104. return a;
  8105. }
  8106. }]);
  8107. return cn;
  8108. }();
  8109. var un = /*#__PURE__*/function () {
  8110. function un(e) {
  8111. (0, _classCallCheck2.default)(this, un);
  8112. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  8113. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new cn(e);
  8114. }
  8115. (0, _createClass2.default)(un, [{
  8116. key: "encrypt",
  8117. value: function encrypt(e) {
  8118. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8119. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  8120. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.encrypt(n), t, s);
  8121. }
  8122. return t;
  8123. }
  8124. }, {
  8125. key: "decrypt",
  8126. value: function decrypt(e) {
  8127. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8128. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  8129. Kt(e, n, 0, s, s + 16), Kt(n = this._aes.decrypt(n), t, s);
  8130. }
  8131. return t;
  8132. }
  8133. }]);
  8134. return un;
  8135. }();
  8136. var hn = /*#__PURE__*/function () {
  8137. function hn(e, t) {
  8138. (0, _classCallCheck2.default)(this, hn);
  8139. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  8140. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  8141. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8142. } else t = Mt(16);
  8143. this._lastCipherblock = qt(t, !0), this._aes = new cn(e);
  8144. }
  8145. (0, _createClass2.default)(hn, [{
  8146. key: "encrypt",
  8147. value: function encrypt(e) {
  8148. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8149. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  8150. Kt(e, n, 0, s, s + 16);
  8151. for (var r = 0; r < 16; r++) {
  8152. n[r] ^= this._lastCipherblock[r];
  8153. }
  8154. this._lastCipherblock = this._aes.encrypt(n), Kt(this._lastCipherblock, t, s);
  8155. }
  8156. return t;
  8157. }
  8158. }, {
  8159. key: "decrypt",
  8160. value: function decrypt(e) {
  8161. if ((e = qt(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8162. for (var t = Mt(e.length), n = Mt(16), s = 0; s < e.length; s += 16) {
  8163. Kt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  8164. for (var r = 0; r < 16; r++) {
  8165. t[s + r] = n[r] ^ this._lastCipherblock[r];
  8166. }
  8167. Kt(e, this._lastCipherblock, 0, s, s + 16);
  8168. }
  8169. return t;
  8170. }
  8171. }]);
  8172. return hn;
  8173. }();
  8174. var ln = /*#__PURE__*/function () {
  8175. function ln(e, t, n) {
  8176. (0, _classCallCheck2.default)(this, ln);
  8177. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  8178. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  8179. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  8180. } else t = Mt(16);
  8181. n || (n = 1), this.segmentSize = n, this._shiftRegister = qt(t, !0), this._aes = new cn(e);
  8182. }
  8183. (0, _createClass2.default)(ln, [{
  8184. key: "encrypt",
  8185. value: function encrypt(e) {
  8186. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  8187. for (var t, n = qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8188. t = this._aes.encrypt(this._shiftRegister);
  8189. for (var r = 0; r < this.segmentSize; r++) {
  8190. n[s + r] ^= t[r];
  8191. }
  8192. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8193. }
  8194. return n;
  8195. }
  8196. }, {
  8197. key: "decrypt",
  8198. value: function decrypt(e) {
  8199. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  8200. for (var t, n = qt(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8201. t = this._aes.encrypt(this._shiftRegister);
  8202. for (var r = 0; r < this.segmentSize; r++) {
  8203. n[s + r] ^= t[r];
  8204. }
  8205. Kt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Kt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8206. }
  8207. return n;
  8208. }
  8209. }]);
  8210. return ln;
  8211. }();
  8212. var dn = /*#__PURE__*/function () {
  8213. function dn(e, t) {
  8214. (0, _classCallCheck2.default)(this, dn);
  8215. if (!(this instanceof dn)) throw Error("AES must be instanitated with `new`");
  8216. if (this.description = "Output Feedback", this.name = "ofb", t) {
  8217. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8218. } else t = Mt(16);
  8219. this._lastPrecipher = qt(t, !0), this._lastPrecipherIndex = 16, this._aes = new cn(e);
  8220. }
  8221. (0, _createClass2.default)(dn, [{
  8222. key: "encrypt",
  8223. value: function encrypt(e) {
  8224. for (var t = qt(e, !0), n = 0; n < t.length; n++) {
  8225. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  8226. }
  8227. return t;
  8228. }
  8229. }, {
  8230. key: "decrypt",
  8231. value: function decrypt(e) {
  8232. return this.encrypt(e);
  8233. }
  8234. }]);
  8235. return dn;
  8236. }();
  8237. var pn = /*#__PURE__*/function () {
  8238. function pn(e) {
  8239. (0, _classCallCheck2.default)(this, pn);
  8240. if (!(this instanceof pn)) throw Error("Counter must be instanitated with `new`");
  8241. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = Mt(16), this.setValue(e)) : this.setBytes(e);
  8242. }
  8243. (0, _createClass2.default)(pn, [{
  8244. key: "setValue",
  8245. value: function setValue(e) {
  8246. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  8247. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  8248. for (var t = 15; t >= 0; --t) {
  8249. this._counter[t] = e % 256, e = parseInt(e / 256);
  8250. }
  8251. }
  8252. }, {
  8253. key: "setBytes",
  8254. value: function setBytes(e) {
  8255. if (16 != (e = qt(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  8256. this._counter = e;
  8257. }
  8258. }, {
  8259. key: "increment",
  8260. value: function increment() {
  8261. for (var e = 15; e >= 0; e--) {
  8262. if (255 !== this._counter[e]) {
  8263. this._counter[e]++;
  8264. break;
  8265. }
  8266. this._counter[e] = 0;
  8267. }
  8268. }
  8269. }]);
  8270. return pn;
  8271. }();
  8272. var fn = /*#__PURE__*/function () {
  8273. function fn(e, t) {
  8274. (0, _classCallCheck2.default)(this, fn);
  8275. if (!(this instanceof fn)) throw Error("AES must be instanitated with `new`");
  8276. this.description = "Counter", this.name = "ctr", t instanceof pn || (t = new pn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new cn(e);
  8277. }
  8278. (0, _createClass2.default)(fn, [{
  8279. key: "encrypt",
  8280. value: function encrypt(e) {
  8281. for (var t = qt(e, !0), n = 0; n < t.length; n++) {
  8282. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  8283. }
  8284. return t;
  8285. }
  8286. }, {
  8287. key: "decrypt",
  8288. value: function decrypt(e) {
  8289. return this.encrypt(e);
  8290. }
  8291. }]);
  8292. return fn;
  8293. }();
  8294. var gn = {
  8295. AES: cn,
  8296. Counter: pn,
  8297. ModeOfOperation: {
  8298. ecb: un,
  8299. cbc: hn,
  8300. cfb: ln,
  8301. ofb: dn,
  8302. ctr: fn
  8303. },
  8304. utils: {
  8305. hex: $t,
  8306. utf8: Bt
  8307. },
  8308. padding: {
  8309. pkcs7: {
  8310. pad: function pad(e) {
  8311. var t = 16 - (e = qt(e, !0)).length % 16,
  8312. n = Mt(e.length + t);
  8313. Kt(e, n);
  8314. for (var s = e.length; s < n.length; s++) {
  8315. n[s] = t;
  8316. }
  8317. return n;
  8318. },
  8319. strip: function strip(e) {
  8320. if ((e = qt(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  8321. var t = e[e.length - 1];
  8322. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  8323. for (var n = e.length - t, s = 0; s < t; s++) {
  8324. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  8325. }
  8326. var r = Mt(n);
  8327. return Kt(e, r, 0, 0, n), r;
  8328. }
  8329. }
  8330. },
  8331. _arrayTest: {
  8332. coerceArray: qt,
  8333. createArray: Mt,
  8334. copyArray: Kt
  8335. }
  8336. };
  8337. function mn(e, t, n) {
  8338. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  8339. r = gn.utils.utf8.toBytes(n),
  8340. i = gn.utils.utf8.toBytes(e),
  8341. o = new gn.ModeOfOperation.cbc(s, r),
  8342. a = gn.padding.pkcs7.pad(i),
  8343. c = o.encrypt(a);
  8344. return uni.arrayBufferToBase64(c);
  8345. }
  8346. var yn = {
  8347. code: 2e4,
  8348. message: "System error"
  8349. },
  8350. _n = {
  8351. code: 20101,
  8352. message: "Invalid client"
  8353. },
  8354. wn = {
  8355. code: 20102,
  8356. message: "Get encrypt key failed"
  8357. },
  8358. vn = {
  8359. 10001: "Secure network is not supported on current playground or unimpsdk",
  8360. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  8361. 10009: "Encrypt payload failed",
  8362. 10010: "Decrypt response failed"
  8363. };
  8364. function Sn(e) {
  8365. var _ref25 = e || {},
  8366. t = _ref25.errSubject,
  8367. n = _ref25.subject,
  8368. s = _ref25.errCode,
  8369. r = _ref25.errMsg,
  8370. i = _ref25.code,
  8371. o = _ref25.message,
  8372. a = _ref25.cause;
  8373. return new se({
  8374. subject: t || n || "uni-secure-network",
  8375. code: s || i || yn.code,
  8376. message: r || o,
  8377. cause: a
  8378. });
  8379. }
  8380. var In,
  8381. bn,
  8382. kn = null;
  8383. var Tn = /*#__PURE__*/function (_Nt) {
  8384. (0, _inherits2.default)(Tn, _Nt);
  8385. var _super9 = _createSuper(Tn);
  8386. function Tn(e) {
  8387. var _this14;
  8388. (0, _classCallCheck2.default)(this, Tn);
  8389. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  8390. return _this14;
  8391. }
  8392. (0, _createClass2.default)(Tn, [{
  8393. key: "isLogin",
  8394. value: function isLogin() {
  8395. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  8396. }
  8397. }, {
  8398. key: "prepare",
  8399. value: function () {
  8400. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  8401. return _regenerator.default.wrap(function _callee38$(_context38) {
  8402. while (1) {
  8403. switch (_context38.prev = _context38.next) {
  8404. case 0:
  8405. if (this.isLogin()) {
  8406. _context38.next = 7;
  8407. break;
  8408. }
  8409. if (this.scopedGlobalCache.initPromise) {
  8410. _context38.next = 3;
  8411. break;
  8412. }
  8413. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  8414. case 3:
  8415. _context38.next = 5;
  8416. return this.scopedGlobalCache.initPromise;
  8417. case 5:
  8418. if (this.isLogin()) {
  8419. _context38.next = 7;
  8420. break;
  8421. }
  8422. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  8423. case 7:
  8424. case "end":
  8425. return _context38.stop();
  8426. }
  8427. }
  8428. }, _callee38, this);
  8429. }));
  8430. function prepare() {
  8431. return _prepare2.apply(this, arguments);
  8432. }
  8433. return prepare;
  8434. }()
  8435. }, {
  8436. key: "getUserEncryptKey",
  8437. value: function () {
  8438. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  8439. var _this15 = this;
  8440. var e;
  8441. return _regenerator.default.wrap(function _callee39$(_context39) {
  8442. while (1) {
  8443. switch (_context39.prev = _context39.next) {
  8444. case 0:
  8445. if (!this.userEncryptKey) {
  8446. _context39.next = 2;
  8447. break;
  8448. }
  8449. return _context39.abrupt("return", this.userEncryptKey);
  8450. case 2:
  8451. if (!(kn && kn.expireTime)) {
  8452. _context39.next = 6;
  8453. break;
  8454. }
  8455. e = Date.now();
  8456. if (!(kn.expireTime - e > 0)) {
  8457. _context39.next = 6;
  8458. break;
  8459. }
  8460. return _context39.abrupt("return", (this.userEncryptKey = kn, this.userEncryptKey));
  8461. case 6:
  8462. return _context39.abrupt("return", new Promise(function (e, t) {
  8463. uni.getUserCryptoManager().getLatestUserKey({
  8464. success: function success(t) {
  8465. kn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  8466. },
  8467. fail: function fail(e) {
  8468. t(Sn(_objectSpread(_objectSpread({}, wn), {}, {
  8469. cause: e
  8470. })));
  8471. }
  8472. });
  8473. }));
  8474. case 7:
  8475. case "end":
  8476. return _context39.stop();
  8477. }
  8478. }
  8479. }, _callee39, this);
  8480. }));
  8481. function getUserEncryptKey() {
  8482. return _getUserEncryptKey.apply(this, arguments);
  8483. }
  8484. return getUserEncryptKey;
  8485. }()
  8486. }, {
  8487. key: "getWxAppId",
  8488. value: function getWxAppId() {
  8489. return wx.getAccountInfoSync().miniProgram.appId;
  8490. }
  8491. }, {
  8492. key: "platformGetSignOption",
  8493. value: function () {
  8494. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  8495. var _yield$this$getUserEn, e, t, n;
  8496. return _regenerator.default.wrap(function _callee40$(_context40) {
  8497. while (1) {
  8498. switch (_context40.prev = _context40.next) {
  8499. case 0:
  8500. _context40.next = 2;
  8501. return this.getUserEncryptKey();
  8502. case 2:
  8503. _yield$this$getUserEn = _context40.sent;
  8504. e = _yield$this$getUserEn.encryptKey;
  8505. t = _yield$this$getUserEn.iv;
  8506. n = _yield$this$getUserEn.version;
  8507. return _context40.abrupt("return", {
  8508. verifyClientSign: mn(JSON.stringify({
  8509. data: JSON.stringify({}),
  8510. appId: this.appId,
  8511. deviceId: this.deviceId,
  8512. wxAppId: this.getWxAppId(),
  8513. simulator: "devtools" === ue().platform,
  8514. timestamp: Date.now()
  8515. }), e, t),
  8516. encryptKeyId: n,
  8517. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  8518. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  8519. });
  8520. case 7:
  8521. case "end":
  8522. return _context40.stop();
  8523. }
  8524. }
  8525. }, _callee40, this);
  8526. }));
  8527. function platformGetSignOption() {
  8528. return _platformGetSignOption.apply(this, arguments);
  8529. }
  8530. return platformGetSignOption;
  8531. }()
  8532. }, {
  8533. key: "platformEncryptData",
  8534. value: function () {
  8535. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  8536. var _yield$this$getUserEn2, t, n, s, r;
  8537. return _regenerator.default.wrap(function _callee41$(_context41) {
  8538. while (1) {
  8539. switch (_context41.prev = _context41.next) {
  8540. case 0:
  8541. _context41.next = 2;
  8542. return this.getUserEncryptKey();
  8543. case 2:
  8544. _yield$this$getUserEn2 = _context41.sent;
  8545. t = _yield$this$getUserEn2.encryptKey;
  8546. n = _yield$this$getUserEn2.iv;
  8547. s = _yield$this$getUserEn2.version;
  8548. r = {
  8549. secretType: this.secretType,
  8550. encryptKeyId: s,
  8551. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  8552. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  8553. };
  8554. return _context41.abrupt("return", this.secretType === Ut ? {
  8555. content: e,
  8556. _uniCloudOptions: r
  8557. } : {
  8558. content: mn(JSON.stringify({
  8559. data: JSON.stringify(e),
  8560. appId: this.appId,
  8561. deviceId: this.deviceId,
  8562. wxAppId: this.getWxAppId(),
  8563. simulator: "devtools" === ue().platform,
  8564. timestamp: Date.now()
  8565. }), t, n),
  8566. _uniCloudOptions: r
  8567. });
  8568. case 8:
  8569. case "end":
  8570. return _context41.stop();
  8571. }
  8572. }
  8573. }, _callee41, this);
  8574. }));
  8575. function platformEncryptData(_x33) {
  8576. return _platformEncryptData.apply(this, arguments);
  8577. }
  8578. return platformEncryptData;
  8579. }()
  8580. }, {
  8581. key: "platformDecryptResult",
  8582. value: function () {
  8583. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  8584. var t, _yield$this$getUserEn3, n, s;
  8585. return _regenerator.default.wrap(function _callee42$(_context42) {
  8586. while (1) {
  8587. switch (_context42.prev = _context42.next) {
  8588. case 0:
  8589. t = e.content;
  8590. _context42.next = 3;
  8591. return this.getUserEncryptKey();
  8592. case 3:
  8593. _yield$this$getUserEn3 = _context42.sent;
  8594. n = _yield$this$getUserEn3.encryptKey;
  8595. s = _yield$this$getUserEn3.iv;
  8596. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  8597. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  8598. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  8599. i = gn.utils.utf8.toBytes(n),
  8600. o = new gn.ModeOfOperation.cbc(r, i),
  8601. a = gn.padding.pkcs7.strip(o.decrypt(s));
  8602. return gn.utils.utf8.fromBytes(a);
  8603. }(t, n, s)));
  8604. case 7:
  8605. case "end":
  8606. return _context42.stop();
  8607. }
  8608. }
  8609. }, _callee42, this);
  8610. }));
  8611. function platformDecryptResult(_x34) {
  8612. return _platformDecryptResult.apply(this, arguments);
  8613. }
  8614. return platformDecryptResult;
  8615. }()
  8616. }, {
  8617. key: "isClientKeyNotFound",
  8618. value: function isClientKeyNotFound() {
  8619. return !1;
  8620. }
  8621. }]);
  8622. return Tn;
  8623. }(Nt);
  8624. function Cn(e) {
  8625. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  8626. n = {};
  8627. var _loop = function _loop(_s10) {
  8628. var r = t[_s10];
  8629. n[r] = function () {
  8630. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  8631. t[_key] = arguments[_key];
  8632. }
  8633. return new Promise(function (n, s) {
  8634. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  8635. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8636. e = _ref26.type,
  8637. t = _ref26.data,
  8638. r = _ref26.errCode,
  8639. i = _ref26.errMsg,
  8640. o = _ref26.errSubject,
  8641. a = _ref26.message;
  8642. "success" === e ? n(t) : s(Sn({
  8643. errCode: r,
  8644. errMsg: vn[r] || i || a,
  8645. errSubject: o
  8646. }));
  8647. }])) : s(Sn({
  8648. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  8649. }));
  8650. });
  8651. };
  8652. };
  8653. for (var _s10 = 0; _s10 < t.length; _s10++) {
  8654. _loop(_s10);
  8655. }
  8656. return n;
  8657. }
  8658. var Pn = /*#__PURE__*/function (_Nt2) {
  8659. (0, _inherits2.default)(Pn, _Nt2);
  8660. var _super10 = _createSuper(Pn);
  8661. function Pn(e) {
  8662. var _this16;
  8663. (0, _classCallCheck2.default)(this, Pn);
  8664. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Cn(uni.requireNativePlugin("plus"))), _this16.systemInfo = In || (In = ue());
  8665. return _this16;
  8666. }
  8667. (0, _createClass2.default)(Pn, [{
  8668. key: "hasClientKey",
  8669. value: function () {
  8670. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  8671. return _regenerator.default.wrap(function _callee43$(_context43) {
  8672. while (1) {
  8673. switch (_context43.prev = _context43.next) {
  8674. case 0:
  8675. _context43.next = 2;
  8676. return this.appUtils.hasClientKey({
  8677. provider: this.provider,
  8678. spaceId: this.spaceId
  8679. });
  8680. case 2:
  8681. this._hasClientKey = _context43.sent;
  8682. return _context43.abrupt("return", this._hasClientKey);
  8683. case 4:
  8684. case "end":
  8685. return _context43.stop();
  8686. }
  8687. }
  8688. }, _callee43, this);
  8689. }));
  8690. function hasClientKey() {
  8691. return _hasClientKey.apply(this, arguments);
  8692. }
  8693. return hasClientKey;
  8694. }()
  8695. }, {
  8696. key: "getAppClientKey",
  8697. value: function () {
  8698. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  8699. var _yield$this$appUtils$, e, t, n, s, r;
  8700. return _regenerator.default.wrap(function _callee44$(_context44) {
  8701. while (1) {
  8702. switch (_context44.prev = _context44.next) {
  8703. case 0:
  8704. _context44.next = 2;
  8705. return this.appUtils.encryptGetClientKeyPayload({
  8706. data: JSON.stringify({})
  8707. });
  8708. case 2:
  8709. _yield$this$appUtils$ = _context44.sent;
  8710. e = _yield$this$appUtils$.data;
  8711. t = _yield$this$appUtils$.key;
  8712. _context44.next = 7;
  8713. return this.uniCloudIns.callFunction({
  8714. name: "DCloud-clientDB",
  8715. data: {
  8716. redirectTo: "encryption",
  8717. action: "getAppClientKey",
  8718. data: e,
  8719. key: t
  8720. }
  8721. });
  8722. case 7:
  8723. _context44.t0 = _context44.sent.result;
  8724. if (_context44.t0) {
  8725. _context44.next = 10;
  8726. break;
  8727. }
  8728. _context44.t0 = {};
  8729. case 10:
  8730. n = _context44.t0;
  8731. if (!(0 !== n.errCode)) {
  8732. _context44.next = 13;
  8733. break;
  8734. }
  8735. throw function (e) {
  8736. return new se({
  8737. subject: e.errSubject || "uni-secure-network",
  8738. code: e.errCode || e.code || yn.code,
  8739. message: e.errMsg || e.message
  8740. });
  8741. }(n);
  8742. case 13:
  8743. s = n.clientKey, r = n.key;
  8744. _context44.next = 16;
  8745. return this.appUtils.setClientKey({
  8746. provider: this.provider,
  8747. spaceId: this.spaceId,
  8748. clientKey: s,
  8749. key: r
  8750. });
  8751. case 16:
  8752. case "end":
  8753. return _context44.stop();
  8754. }
  8755. }
  8756. }, _callee44, this);
  8757. }));
  8758. function getAppClientKey() {
  8759. return _getAppClientKey.apply(this, arguments);
  8760. }
  8761. return getAppClientKey;
  8762. }()
  8763. }, {
  8764. key: "ensureClientKey",
  8765. value: function () {
  8766. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  8767. var _this17 = this;
  8768. var _ref27,
  8769. _ref27$forceUpdate,
  8770. e,
  8771. _args45 = arguments;
  8772. return _regenerator.default.wrap(function _callee45$(_context45) {
  8773. while (1) {
  8774. switch (_context45.prev = _context45.next) {
  8775. case 0:
  8776. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  8777. _context45.t1 = !0;
  8778. _context45.next = 4;
  8779. return this.hasClientKey();
  8780. case 4:
  8781. _context45.t2 = _context45.sent;
  8782. _context45.t0 = _context45.t1 !== _context45.t2;
  8783. if (_context45.t0) {
  8784. _context45.next = 8;
  8785. break;
  8786. }
  8787. _context45.t0 = e;
  8788. case 8:
  8789. if (!_context45.t0) {
  8790. _context45.next = 10;
  8791. break;
  8792. }
  8793. return _context45.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === d || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== f || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  8794. _this17.scopedGlobalCache.initStatus = p;
  8795. }).catch(function (e) {
  8796. throw _this17.scopedGlobalCache.initStatus = f, e;
  8797. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  8798. case 10:
  8799. case "end":
  8800. return _context45.stop();
  8801. }
  8802. }
  8803. }, _callee45, this);
  8804. }));
  8805. function ensureClientKey() {
  8806. return _ensureClientKey.apply(this, arguments);
  8807. }
  8808. return ensureClientKey;
  8809. }()
  8810. }, {
  8811. key: "prepare",
  8812. value: function () {
  8813. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  8814. var _ref28,
  8815. _ref28$forceUpdate,
  8816. e,
  8817. _args46 = arguments;
  8818. return _regenerator.default.wrap(function _callee46$(_context46) {
  8819. while (1) {
  8820. switch (_context46.prev = _context46.next) {
  8821. case 0:
  8822. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  8823. _context46.next = 3;
  8824. return this.ensureClientKey({
  8825. forceUpdate: e
  8826. });
  8827. case 3:
  8828. case "end":
  8829. return _context46.stop();
  8830. }
  8831. }
  8832. }, _callee46, this);
  8833. }));
  8834. function prepare() {
  8835. return _prepare3.apply(this, arguments);
  8836. }
  8837. return prepare;
  8838. }()
  8839. }, {
  8840. key: "platformGetSignOption",
  8841. value: function () {
  8842. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  8843. var _yield$this$appUtils$2, e, t;
  8844. return _regenerator.default.wrap(function _callee47$(_context47) {
  8845. while (1) {
  8846. switch (_context47.prev = _context47.next) {
  8847. case 0:
  8848. _context47.next = 2;
  8849. return this.appUtils.encrypt({
  8850. provider: this.provider,
  8851. spaceId: this.spaceId,
  8852. data: JSON.stringify({})
  8853. });
  8854. case 2:
  8855. _yield$this$appUtils$2 = _context47.sent;
  8856. e = _yield$this$appUtils$2.data;
  8857. t = _yield$this$appUtils$2.key;
  8858. return _context47.abrupt("return", {
  8859. verifyClientSign: e,
  8860. encryptKeyId: t
  8861. });
  8862. case 6:
  8863. case "end":
  8864. return _context47.stop();
  8865. }
  8866. }
  8867. }, _callee47, this);
  8868. }));
  8869. function platformGetSignOption() {
  8870. return _platformGetSignOption2.apply(this, arguments);
  8871. }
  8872. return platformGetSignOption;
  8873. }()
  8874. }, {
  8875. key: "platformEncryptData",
  8876. value: function () {
  8877. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  8878. var _yield$this$appUtils$3, t, n, s;
  8879. return _regenerator.default.wrap(function _callee48$(_context48) {
  8880. while (1) {
  8881. switch (_context48.prev = _context48.next) {
  8882. case 0:
  8883. _context48.next = 2;
  8884. return this.appUtils.encrypt({
  8885. provider: this.provider,
  8886. spaceId: this.spaceId,
  8887. data: JSON.stringify(e)
  8888. });
  8889. case 2:
  8890. _yield$this$appUtils$3 = _context48.sent;
  8891. t = _yield$this$appUtils$3.data;
  8892. n = _yield$this$appUtils$3.key;
  8893. s = {
  8894. secretType: this.secretType,
  8895. encryptKeyId: n
  8896. };
  8897. return _context48.abrupt("return", this.secretType === Ut ? {
  8898. content: e,
  8899. _uniCloudOptions: s
  8900. } : {
  8901. content: t,
  8902. _uniCloudOptions: s
  8903. });
  8904. case 7:
  8905. case "end":
  8906. return _context48.stop();
  8907. }
  8908. }
  8909. }, _callee48, this);
  8910. }));
  8911. function platformEncryptData(_x35) {
  8912. return _platformEncryptData2.apply(this, arguments);
  8913. }
  8914. return platformEncryptData;
  8915. }()
  8916. }, {
  8917. key: "platformDecryptResult",
  8918. value: function () {
  8919. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  8920. var t, _e$_uniCloudOptions, n, s, r;
  8921. return _regenerator.default.wrap(function _callee49$(_context49) {
  8922. while (1) {
  8923. switch (_context49.prev = _context49.next) {
  8924. case 0:
  8925. t = e.content;
  8926. _e$_uniCloudOptions = e._uniCloudOptions;
  8927. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  8928. s = n.encryptKeyId;
  8929. _context49.next = 6;
  8930. return this.appUtils.decrypt({
  8931. provider: this.provider,
  8932. spaceId: this.spaceId,
  8933. data: t,
  8934. key: s
  8935. });
  8936. case 6:
  8937. r = _context49.sent;
  8938. return _context49.abrupt("return", JSON.parse(r.data));
  8939. case 8:
  8940. case "end":
  8941. return _context49.stop();
  8942. }
  8943. }
  8944. }, _callee49, this);
  8945. }));
  8946. function platformDecryptResult(_x36) {
  8947. return _platformDecryptResult2.apply(this, arguments);
  8948. }
  8949. return platformDecryptResult;
  8950. }()
  8951. }, {
  8952. key: "isClientKeyNotFound",
  8953. value: function isClientKeyNotFound() {
  8954. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8955. var t = e.result || {};
  8956. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  8957. }
  8958. }]);
  8959. return Pn;
  8960. }(Nt);
  8961. function An() {
  8962. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8963. e = _ref29.secretType;
  8964. return e === Rt || e === Ut || e === Lt;
  8965. }
  8966. function En() {
  8967. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8968. e = _ref30.name,
  8969. _ref30$data = _ref30.data,
  8970. t = _ref30$data === void 0 ? {} : _ref30$data;
  8971. return "app" === A && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  8972. }
  8973. function On() {
  8974. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8975. e = _ref31.provider,
  8976. t = _ref31.spaceId,
  8977. n = _ref31.functionName;
  8978. var _ue = ue(),
  8979. s = _ue.appId,
  8980. r = _ue.uniPlatform,
  8981. i = _ue.osName;
  8982. var o = r;
  8983. "app" === r && (o = i);
  8984. var a = function () {
  8985. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8986. e = _ref32.provider,
  8987. t = _ref32.spaceId;
  8988. var n = P;
  8989. if (!n) return {};
  8990. e = function (e) {
  8991. return "tencent" === e ? "tcb" : e;
  8992. }(e);
  8993. var s = n.find(function (n) {
  8994. return n.provider === e && n.spaceId === t;
  8995. });
  8996. return s && s.config;
  8997. }({
  8998. provider: e,
  8999. spaceId: t
  9000. });
  9001. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  9002. var c = a.accessControl.function || {},
  9003. u = Object.keys(c);
  9004. if (0 === u.length) return !0;
  9005. var h = function (e, t) {
  9006. var n, s, r;
  9007. for (var _i2 = 0; _i2 < e.length; _i2++) {
  9008. var _o2 = e[_i2];
  9009. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  9010. return e.trim();
  9011. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  9012. }
  9013. return n || s || r;
  9014. }(u, n);
  9015. if (!h) return !1;
  9016. if ((c[h] || []).find(function () {
  9017. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9018. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  9019. })) return !0;
  9020. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), Sn(_n);
  9021. }
  9022. function xn(_ref33) {
  9023. var e = _ref33.functionName,
  9024. t = _ref33.result,
  9025. n = _ref33.logPvd;
  9026. if (k && this.__dev__.debugLog && t && t.requestId) {
  9027. var _s11 = JSON.stringify({
  9028. spaceId: this.config.spaceId,
  9029. functionName: e,
  9030. requestId: t.requestId
  9031. });
  9032. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  9033. }
  9034. }
  9035. function Rn(e) {
  9036. var t = e.callFunction,
  9037. n = function n(_n7) {
  9038. var _this18 = this;
  9039. var s = _n7.name;
  9040. _n7.data = Tt.call(e, {
  9041. data: _n7.data
  9042. });
  9043. var r = {
  9044. aliyun: "aliyun",
  9045. tencent: "tcb",
  9046. tcb: "tcb"
  9047. }[this.config.provider],
  9048. i = An(_n7),
  9049. o = En(_n7),
  9050. a = i || o;
  9051. return t.call(this, _n7).then(function (e) {
  9052. return e.errCode = 0, !a && xn.call(_this18, {
  9053. functionName: s,
  9054. result: e,
  9055. logPvd: r
  9056. }), Promise.resolve(e);
  9057. }, function (e) {
  9058. return !a && xn.call(_this18, {
  9059. functionName: s,
  9060. result: e,
  9061. logPvd: r
  9062. }), e && e.message && (e.message = function () {
  9063. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9064. _ref34$message = _ref34.message,
  9065. e = _ref34$message === void 0 ? "" : _ref34$message,
  9066. _ref34$extraInfo = _ref34.extraInfo,
  9067. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  9068. _ref34$formatter = _ref34.formatter,
  9069. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  9070. for (var _s12 = 0; _s12 < n.length; _s12++) {
  9071. var _n$_s = n[_s12],
  9072. _r4 = _n$_s.rule,
  9073. _i3 = _n$_s.content,
  9074. _o3 = _n$_s.mode,
  9075. _a = e.match(_r4);
  9076. if (!_a) continue;
  9077. var _c = _i3;
  9078. for (var _e19 = 1; _e19 < _a.length; _e19++) {
  9079. _c = Ot(_c, "{$".concat(_e19, "}"), _a[_e19]);
  9080. }
  9081. for (var _e20 in t) {
  9082. _c = Ot(_c, "{".concat(_e20, "}"), t[_e20]);
  9083. }
  9084. return "replace" === _o3 ? _c : e + _c;
  9085. }
  9086. return e;
  9087. }({
  9088. message: "[".concat(_n7.name, "]: ").concat(e.message),
  9089. formatter: Pt,
  9090. extraInfo: {
  9091. functionName: s
  9092. }
  9093. })), Promise.reject(e);
  9094. });
  9095. };
  9096. e.callFunction = function (t) {
  9097. var _e$config = e.config,
  9098. s = _e$config.provider,
  9099. r = _e$config.spaceId,
  9100. i = t.name;
  9101. var o, a;
  9102. if (t.data = t.data || {}, k && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && O ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ct), o = Ct) : o = n, o = o.bind(e), En(t)) a = n.call(e, t);else if (function (_ref35) {
  9103. var e = _ref35.name,
  9104. _ref35$data = _ref35.data,
  9105. t = _ref35$data === void 0 ? {} : _ref35$data;
  9106. return "mp-weixin" === A && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  9107. }(t)) a = o.call(e, t);else if (An(t)) {
  9108. a = new bn({
  9109. secretType: t.secretType,
  9110. uniCloudIns: e
  9111. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  9112. } else if (On({
  9113. provider: s,
  9114. spaceId: r,
  9115. functionName: i
  9116. })) {
  9117. a = new bn({
  9118. secretType: t.secretType,
  9119. uniCloudIns: e
  9120. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  9121. } else a = o(t);
  9122. return Object.defineProperty(a, "result", {
  9123. get: function get() {
  9124. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  9125. }
  9126. }), a;
  9127. };
  9128. }
  9129. bn = "mp-weixin" !== A && "app" !== A ? /*#__PURE__*/function () {
  9130. function _class2() {
  9131. (0, _classCallCheck2.default)(this, _class2);
  9132. throw Sn({
  9133. message: "Platform ".concat(A, " is not supported by secure network")
  9134. });
  9135. }
  9136. return (0, _createClass2.default)(_class2);
  9137. }() : C ? "mp-weixin" === A ? Tn : Pn : /*#__PURE__*/function () {
  9138. function _class3() {
  9139. (0, _classCallCheck2.default)(this, _class3);
  9140. throw Sn({
  9141. message: "Platform ".concat(A, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  9142. });
  9143. }
  9144. return (0, _createClass2.default)(_class3);
  9145. }();
  9146. var Un = Symbol("CLIENT_DB_INTERNAL");
  9147. function Ln(e, t) {
  9148. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Un, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  9149. get: function get(e, n, s) {
  9150. if ("_uniClient" === n) return null;
  9151. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  9152. if (n in e || "string" != typeof n) {
  9153. var _t10 = e[n];
  9154. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  9155. }
  9156. return t.get(e, n, s);
  9157. }
  9158. });
  9159. }
  9160. function Nn(e) {
  9161. return {
  9162. on: function on(t, n) {
  9163. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  9164. },
  9165. off: function off(t, n) {
  9166. e[t] = e[t] || [];
  9167. var s = e[t].indexOf(n);
  9168. -1 !== s && e[t].splice(s, 1);
  9169. }
  9170. };
  9171. }
  9172. var Dn = ["db.Geo", "db.command", "command.aggregate"];
  9173. function Fn(e, t) {
  9174. return Dn.indexOf("".concat(e, ".").concat(t)) > -1;
  9175. }
  9176. function qn(e) {
  9177. switch (g(e)) {
  9178. case "array":
  9179. return e.map(function (e) {
  9180. return qn(e);
  9181. });
  9182. case "object":
  9183. return e._internalType === Un || Object.keys(e).forEach(function (t) {
  9184. e[t] = qn(e[t]);
  9185. }), e;
  9186. case "regexp":
  9187. return {
  9188. $regexp: {
  9189. source: e.source,
  9190. flags: e.flags
  9191. }
  9192. };
  9193. case "date":
  9194. return {
  9195. $date: e.toISOString()
  9196. };
  9197. default:
  9198. return e;
  9199. }
  9200. }
  9201. function Mn(e) {
  9202. return e && e.content && e.content.$method;
  9203. }
  9204. var Kn = /*#__PURE__*/function () {
  9205. function Kn(e, t, n) {
  9206. (0, _classCallCheck2.default)(this, Kn);
  9207. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  9208. }
  9209. (0, _createClass2.default)(Kn, [{
  9210. key: "toJSON",
  9211. value: function toJSON() {
  9212. var e = this;
  9213. var t = [e.content];
  9214. for (; e.prevStage;) {
  9215. e = e.prevStage, t.push(e.content);
  9216. }
  9217. return {
  9218. $db: t.reverse().map(function (e) {
  9219. return {
  9220. $method: e.$method,
  9221. $param: qn(e.$param)
  9222. };
  9223. })
  9224. };
  9225. }
  9226. }, {
  9227. key: "toString",
  9228. value: function toString() {
  9229. return JSON.stringify(this.toJSON());
  9230. }
  9231. }, {
  9232. key: "getAction",
  9233. value: function getAction() {
  9234. var e = this.toJSON().$db.find(function (e) {
  9235. return "action" === e.$method;
  9236. });
  9237. return e && e.$param && e.$param[0];
  9238. }
  9239. }, {
  9240. key: "getCommand",
  9241. value: function getCommand() {
  9242. return {
  9243. $db: this.toJSON().$db.filter(function (e) {
  9244. return "action" !== e.$method;
  9245. })
  9246. };
  9247. }
  9248. }, {
  9249. key: "isAggregate",
  9250. get: function get() {
  9251. var e = this;
  9252. for (; e;) {
  9253. var t = Mn(e),
  9254. _n8 = Mn(e.prevStage);
  9255. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  9256. e = e.prevStage;
  9257. }
  9258. return !1;
  9259. }
  9260. }, {
  9261. key: "isCommand",
  9262. get: function get() {
  9263. var e = this;
  9264. for (; e;) {
  9265. if ("command" === Mn(e)) return !0;
  9266. e = e.prevStage;
  9267. }
  9268. return !1;
  9269. }
  9270. }, {
  9271. key: "isAggregateCommand",
  9272. get: function get() {
  9273. var e = this;
  9274. for (; e;) {
  9275. var t = Mn(e),
  9276. _n9 = Mn(e.prevStage);
  9277. if ("aggregate" === t && "command" === _n9) return !0;
  9278. e = e.prevStage;
  9279. }
  9280. return !1;
  9281. }
  9282. }, {
  9283. key: "getNextStageFn",
  9284. value: function getNextStageFn(e) {
  9285. var t = this;
  9286. return function () {
  9287. return jn({
  9288. $method: e,
  9289. $param: qn(Array.from(arguments))
  9290. }, t, t._database);
  9291. };
  9292. }
  9293. }, {
  9294. key: "count",
  9295. get: function get() {
  9296. return this.isAggregate ? this.getNextStageFn("count") : function () {
  9297. return this._send("count", Array.from(arguments));
  9298. };
  9299. }
  9300. }, {
  9301. key: "remove",
  9302. get: function get() {
  9303. return this.isCommand ? this.getNextStageFn("remove") : function () {
  9304. return this._send("remove", Array.from(arguments));
  9305. };
  9306. }
  9307. }, {
  9308. key: "get",
  9309. value: function get() {
  9310. return this._send("get", Array.from(arguments));
  9311. }
  9312. }, {
  9313. key: "add",
  9314. get: function get() {
  9315. return this.isCommand ? this.getNextStageFn("add") : function () {
  9316. return this._send("add", Array.from(arguments));
  9317. };
  9318. }
  9319. }, {
  9320. key: "update",
  9321. value: function update() {
  9322. return this._send("update", Array.from(arguments));
  9323. }
  9324. }, {
  9325. key: "end",
  9326. value: function end() {
  9327. return this._send("end", Array.from(arguments));
  9328. }
  9329. }, {
  9330. key: "set",
  9331. get: function get() {
  9332. return this.isCommand ? this.getNextStageFn("set") : function () {
  9333. throw new Error("JQL禁止使用set方法");
  9334. };
  9335. }
  9336. }, {
  9337. key: "_send",
  9338. value: function _send(e, t) {
  9339. var n = this.getAction(),
  9340. s = this.getCommand();
  9341. if (s.$db.push({
  9342. $method: e,
  9343. $param: qn(t)
  9344. }), k) {
  9345. var _e21 = s.$db.find(function (e) {
  9346. return "collection" === e.$method;
  9347. }),
  9348. _t11 = _e21 && _e21.$param;
  9349. _t11 && 1 === _t11.length && "string" == typeof _e21.$param[0] && _e21.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  9350. }
  9351. return this._database._callCloudFunction({
  9352. action: n,
  9353. command: s
  9354. });
  9355. }
  9356. }]);
  9357. return Kn;
  9358. }();
  9359. function jn(e, t, n) {
  9360. return Ln(new Kn(e, t, n), {
  9361. get: function get(e, t) {
  9362. var s = "db";
  9363. return e && e.content && (s = e.content.$method), Fn(s, t) ? jn({
  9364. $method: t
  9365. }, e, n) : function () {
  9366. return jn({
  9367. $method: t,
  9368. $param: qn(Array.from(arguments))
  9369. }, e, n);
  9370. };
  9371. }
  9372. });
  9373. }
  9374. function Bn(_ref36) {
  9375. var e = _ref36.path,
  9376. t = _ref36.method;
  9377. return /*#__PURE__*/function () {
  9378. function _class4() {
  9379. (0, _classCallCheck2.default)(this, _class4);
  9380. this.param = Array.from(arguments);
  9381. }
  9382. (0, _createClass2.default)(_class4, [{
  9383. key: "toJSON",
  9384. value: function toJSON() {
  9385. return {
  9386. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  9387. return {
  9388. $method: e
  9389. };
  9390. })), [{
  9391. $method: t,
  9392. $param: this.param
  9393. }])
  9394. };
  9395. }
  9396. }, {
  9397. key: "toString",
  9398. value: function toString() {
  9399. return JSON.stringify(this.toJSON());
  9400. }
  9401. }]);
  9402. return _class4;
  9403. }();
  9404. }
  9405. function $n(e) {
  9406. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9407. return Ln(new e(t), {
  9408. get: function get(e, t) {
  9409. return Fn("db", t) ? jn({
  9410. $method: t
  9411. }, null, e) : function () {
  9412. return jn({
  9413. $method: t,
  9414. $param: qn(Array.from(arguments))
  9415. }, null, e);
  9416. };
  9417. }
  9418. });
  9419. }
  9420. var Wn = /*#__PURE__*/function (_ref37) {
  9421. (0, _inherits2.default)(Wn, _ref37);
  9422. var _super11 = _createSuper(Wn);
  9423. function Wn() {
  9424. (0, _classCallCheck2.default)(this, Wn);
  9425. return _super11.apply(this, arguments);
  9426. }
  9427. (0, _createClass2.default)(Wn, [{
  9428. key: "_parseResult",
  9429. value: function _parseResult(e) {
  9430. return this._isJQL ? e.result : e;
  9431. }
  9432. }, {
  9433. key: "_callCloudFunction",
  9434. value: function _callCloudFunction(_ref38) {
  9435. var _this19 = this;
  9436. var e = _ref38.action,
  9437. t = _ref38.command,
  9438. n = _ref38.multiCommand,
  9439. s = _ref38.queryList;
  9440. function r(e, t) {
  9441. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  9442. var _r5 = s[_n10];
  9443. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  9444. }
  9445. }
  9446. var i = this,
  9447. o = this._isJQL ? "databaseForJQL" : "database";
  9448. function a(e) {
  9449. return i._callback("error", [e]), M(K(o, "fail"), e).then(function () {
  9450. return M(K(o, "complete"), e);
  9451. }).then(function () {
  9452. return r(null, e), X($, {
  9453. type: J,
  9454. content: e
  9455. }), Promise.reject(e);
  9456. });
  9457. }
  9458. var c = M(K(o, "invoke")),
  9459. u = this._uniClient;
  9460. return c.then(function () {
  9461. return u.callFunction({
  9462. name: "DCloud-clientDB",
  9463. type: l,
  9464. data: {
  9465. action: e,
  9466. command: t,
  9467. multiCommand: n
  9468. }
  9469. });
  9470. }).then(function (e) {
  9471. var _e$result = e.result,
  9472. t = _e$result.code,
  9473. n = _e$result.message,
  9474. s = _e$result.token,
  9475. c = _e$result.tokenExpired,
  9476. _e$result$systemInfo = _e$result.systemInfo,
  9477. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  9478. if (u) for (var _e22 = 0; _e22 < u.length; _e22++) {
  9479. var _u$_e = u[_e22],
  9480. _t12 = _u$_e.level,
  9481. _n11 = _u$_e.message,
  9482. _s13 = _u$_e.detail,
  9483. _r6 = console["app" === A && "warn" === _t12 ? "error" : _t12] || console.log;
  9484. var _i4 = "[System Info]" + _n11;
  9485. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  9486. }
  9487. if (t) {
  9488. return a(new se({
  9489. code: t,
  9490. message: n,
  9491. requestId: e.requestId
  9492. }));
  9493. }
  9494. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (oe({
  9495. token: s,
  9496. tokenExpired: c
  9497. }), _this19._callbackAuth("refreshToken", [{
  9498. token: s,
  9499. tokenExpired: c
  9500. }]), _this19._callback("refreshToken", [{
  9501. token: s,
  9502. tokenExpired: c
  9503. }]), X(z, {
  9504. token: s,
  9505. tokenExpired: c
  9506. }));
  9507. var h = [{
  9508. prop: "affectedDocs",
  9509. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  9510. }, {
  9511. prop: "code",
  9512. tips: "code不再推荐使用,请使用errCode替代"
  9513. }, {
  9514. prop: "message",
  9515. tips: "message不再推荐使用,请使用errMsg替代"
  9516. }];
  9517. var _loop2 = function _loop2(_t13) {
  9518. var _h$_t = h[_t13],
  9519. n = _h$_t.prop,
  9520. s = _h$_t.tips;
  9521. if (n in e.result) {
  9522. var _t14 = e.result[n];
  9523. Object.defineProperty(e.result, n, {
  9524. get: function get() {
  9525. return console.warn(s), _t14;
  9526. }
  9527. });
  9528. }
  9529. };
  9530. for (var _t13 = 0; _t13 < h.length; _t13++) {
  9531. _loop2(_t13);
  9532. }
  9533. return function (e) {
  9534. return M(K(o, "success"), e).then(function () {
  9535. return M(K(o, "complete"), e);
  9536. }).then(function () {
  9537. r(e, null);
  9538. var t = i._parseResult(e);
  9539. return X($, {
  9540. type: J,
  9541. content: t
  9542. }), Promise.resolve(t);
  9543. });
  9544. }(e);
  9545. }, function (e) {
  9546. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  9547. return a(new se({
  9548. code: e.code || "SYSTEM_ERROR",
  9549. message: e.message,
  9550. requestId: e.requestId
  9551. }));
  9552. });
  9553. }
  9554. }]);
  9555. return Wn;
  9556. }( /*#__PURE__*/function () {
  9557. function _class5() {
  9558. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9559. _ref39$uniClient = _ref39.uniClient,
  9560. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  9561. _ref39$isJQL = _ref39.isJQL,
  9562. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  9563. (0, _classCallCheck2.default)(this, _class5);
  9564. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = L("_globalUniCloudDatabaseCallback")), t || (this.auth = Nn(this._authCallBacks)), this._isJQL = t, Object.assign(this, Nn(this._dbCallBacks)), this.env = Ln({}, {
  9565. get: function get(e, t) {
  9566. return {
  9567. $env: t
  9568. };
  9569. }
  9570. }), this.Geo = Ln({}, {
  9571. get: function get(e, t) {
  9572. return Bn({
  9573. path: ["Geo"],
  9574. method: t
  9575. });
  9576. }
  9577. }), this.serverDate = Bn({
  9578. path: [],
  9579. method: "serverDate"
  9580. }), this.RegExp = Bn({
  9581. path: [],
  9582. method: "RegExp"
  9583. });
  9584. }
  9585. (0, _createClass2.default)(_class5, [{
  9586. key: "getCloudEnv",
  9587. value: function getCloudEnv(e) {
  9588. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  9589. return {
  9590. $env: e.replace("$cloudEnv_", "")
  9591. };
  9592. }
  9593. }, {
  9594. key: "_callback",
  9595. value: function _callback(e, t) {
  9596. var n = this._dbCallBacks;
  9597. n[e] && n[e].forEach(function (e) {
  9598. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  9599. });
  9600. }
  9601. }, {
  9602. key: "_callbackAuth",
  9603. value: function _callbackAuth(e, t) {
  9604. var n = this._authCallBacks;
  9605. n[e] && n[e].forEach(function (e) {
  9606. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  9607. });
  9608. }
  9609. }, {
  9610. key: "multiSend",
  9611. value: function multiSend() {
  9612. var e = Array.from(arguments),
  9613. t = e.map(function (e) {
  9614. var t = e.getAction(),
  9615. n = e.getCommand();
  9616. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  9617. return {
  9618. action: t,
  9619. command: n
  9620. };
  9621. });
  9622. return this._callCloudFunction({
  9623. multiCommand: t,
  9624. queryList: e
  9625. });
  9626. }
  9627. }]);
  9628. return _class5;
  9629. }());
  9630. var zn = "token无效,跳转登录页面",
  9631. Jn = "token过期,跳转登录页面",
  9632. Hn = {
  9633. TOKEN_INVALID_TOKEN_EXPIRED: Jn,
  9634. TOKEN_INVALID_INVALID_CLIENTID: zn,
  9635. TOKEN_INVALID: zn,
  9636. TOKEN_INVALID_WRONG_TOKEN: zn,
  9637. TOKEN_INVALID_ANONYMOUS_USER: zn
  9638. },
  9639. Gn = {
  9640. "uni-id-token-expired": Jn,
  9641. "uni-id-check-token-failed": zn,
  9642. "uni-id-token-not-exist": zn,
  9643. "uni-id-check-device-feature-failed": zn
  9644. };
  9645. function Vn(e, t) {
  9646. var n = "";
  9647. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  9648. }
  9649. function Qn() {
  9650. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9651. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  9652. var n = [],
  9653. s = [];
  9654. return e.forEach(function (e) {
  9655. !0 === e.needLogin ? n.push(Vn(t, e.path)) : !1 === e.needLogin && s.push(Vn(t, e.path));
  9656. }), {
  9657. needLoginPage: n,
  9658. notNeedLoginPage: s
  9659. };
  9660. }
  9661. function Yn(e) {
  9662. return e.split("?")[0].replace(/^\//, "");
  9663. }
  9664. function Xn() {
  9665. return function (e) {
  9666. var t = e && e.$page && e.$page.fullPath || "";
  9667. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  9668. }(function () {
  9669. var e = getCurrentPages();
  9670. return e[e.length - 1];
  9671. }());
  9672. }
  9673. function Zn() {
  9674. return Yn(Xn());
  9675. }
  9676. function es() {
  9677. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  9678. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9679. if (!e) return !1;
  9680. if (!(t && t.list && t.list.length)) return !1;
  9681. var n = t.list,
  9682. s = Yn(e);
  9683. return n.some(function (e) {
  9684. return e.pagePath === s;
  9685. });
  9686. }
  9687. var ts = !!_pages.default.uniIdRouter;
  9688. var _ref40 = function () {
  9689. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  9690. _ref21$pages = _ref21.pages,
  9691. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  9692. _ref21$subPackages = _ref21.subPackages,
  9693. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  9694. _ref21$uniIdRouter = _ref21.uniIdRouter,
  9695. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  9696. _ref21$tabBar = _ref21.tabBar,
  9697. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  9698. var i = s.loginPage,
  9699. _s$needLogin = s.needLogin,
  9700. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  9701. _s$resToLogin = s.resToLogin,
  9702. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  9703. _Qn = Qn(e),
  9704. c = _Qn.needLoginPage,
  9705. u = _Qn.notNeedLoginPage,
  9706. _ref23 = function () {
  9707. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9708. var t = [],
  9709. n = [];
  9710. return e.forEach(function (e) {
  9711. var s = e.root,
  9712. _e$pages = e.pages,
  9713. r = _e$pages === void 0 ? [] : _e$pages,
  9714. _Qn2 = Qn(r, s),
  9715. i = _Qn2.needLoginPage,
  9716. o = _Qn2.notNeedLoginPage;
  9717. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  9718. }), {
  9719. needLoginPage: t,
  9720. notNeedLoginPage: n
  9721. };
  9722. }(n),
  9723. h = _ref23.needLoginPage,
  9724. l = _ref23.notNeedLoginPage;
  9725. return {
  9726. loginPage: i,
  9727. routerNeedLogin: o,
  9728. resToLogin: a,
  9729. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  9730. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  9731. loginPageInTabBar: es(i, r)
  9732. };
  9733. }(),
  9734. ns = _ref40.loginPage,
  9735. ss = _ref40.routerNeedLogin,
  9736. rs = _ref40.resToLogin,
  9737. is = _ref40.needLoginPage,
  9738. os = _ref40.notNeedLoginPage,
  9739. as = _ref40.loginPageInTabBar;
  9740. if (is.indexOf(ns) > -1) throw new Error("Login page [".concat(ns, "] should not be \"needLogin\", please check your pages.json"));
  9741. function cs(e) {
  9742. var t = Zn();
  9743. if ("/" === e.charAt(0)) return e;
  9744. var _e$split = e.split("?"),
  9745. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  9746. n = _e$split2[0],
  9747. s = _e$split2[1],
  9748. r = n.replace(/^\//, "").split("/"),
  9749. i = t.split("/");
  9750. i.pop();
  9751. for (var _e23 = 0; _e23 < r.length; _e23++) {
  9752. var _t15 = r[_e23];
  9753. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  9754. }
  9755. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  9756. }
  9757. function us(e) {
  9758. var t = Yn(cs(e));
  9759. return !(os.indexOf(t) > -1) && (is.indexOf(t) > -1 || ss.some(function (t) {
  9760. return function (e, t) {
  9761. return new RegExp(t).test(e);
  9762. }(e, t);
  9763. }));
  9764. }
  9765. function hs(_ref41) {
  9766. var e = _ref41.redirect;
  9767. var t = Yn(e),
  9768. n = Yn(ns);
  9769. return Zn() !== n && t !== n;
  9770. }
  9771. function ls() {
  9772. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9773. e = _ref42.api,
  9774. t = _ref42.redirect;
  9775. if (!t || !hs({
  9776. redirect: t
  9777. })) return;
  9778. var n = function (e, t) {
  9779. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  9780. }(ns, t);
  9781. as ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  9782. var s = {
  9783. navigateTo: uni.navigateTo,
  9784. redirectTo: uni.redirectTo,
  9785. switchTab: uni.switchTab,
  9786. reLaunch: uni.reLaunch
  9787. };
  9788. setTimeout(function () {
  9789. s[e]({
  9790. url: n
  9791. });
  9792. });
  9793. }
  9794. function ds() {
  9795. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9796. e = _ref43.url;
  9797. var t = {
  9798. abortLoginPageJump: !1,
  9799. autoToLoginPage: !1
  9800. },
  9801. n = function () {
  9802. var _ie3 = ie(),
  9803. e = _ie3.token,
  9804. t = _ie3.tokenExpired;
  9805. var n;
  9806. if (e) {
  9807. if (t < Date.now()) {
  9808. var _e24 = "uni-id-token-expired";
  9809. n = {
  9810. errCode: _e24,
  9811. errMsg: Gn[_e24]
  9812. };
  9813. }
  9814. } else {
  9815. var _e25 = "uni-id-check-token-failed";
  9816. n = {
  9817. errCode: _e25,
  9818. errMsg: Gn[_e25]
  9819. };
  9820. }
  9821. return n;
  9822. }();
  9823. if (us(e) && n) {
  9824. n.uniIdRedirectUrl = e;
  9825. if (V(W).length > 0) return setTimeout(function () {
  9826. X(W, n);
  9827. }, 0), t.abortLoginPageJump = !0, t;
  9828. t.autoToLoginPage = !0;
  9829. }
  9830. return t;
  9831. }
  9832. function ps() {
  9833. !function () {
  9834. var e = Xn(),
  9835. _ds = ds({
  9836. url: e
  9837. }),
  9838. t = _ds.abortLoginPageJump,
  9839. n = _ds.autoToLoginPage;
  9840. t || n && ls({
  9841. api: "redirectTo",
  9842. redirect: e
  9843. });
  9844. }();
  9845. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  9846. var _loop3 = function _loop3(_t16) {
  9847. var n = e[_t16];
  9848. uni.addInterceptor(n, {
  9849. invoke: function invoke(e) {
  9850. var _ds2 = ds({
  9851. url: e.url
  9852. }),
  9853. t = _ds2.abortLoginPageJump,
  9854. s = _ds2.autoToLoginPage;
  9855. return t ? e : s ? (ls({
  9856. api: n,
  9857. redirect: cs(e.url)
  9858. }), !1) : e;
  9859. }
  9860. });
  9861. };
  9862. for (var _t16 = 0; _t16 < e.length; _t16++) {
  9863. _loop3(_t16);
  9864. }
  9865. }
  9866. function fs() {
  9867. this.onResponse(function (e) {
  9868. var t = e.type,
  9869. n = e.content;
  9870. var s = !1;
  9871. switch (t) {
  9872. case "cloudobject":
  9873. s = function (e) {
  9874. if ("object" != (0, _typeof2.default)(e)) return !1;
  9875. var _ref44 = e || {},
  9876. t = _ref44.errCode;
  9877. return t in Gn;
  9878. }(n);
  9879. break;
  9880. case "clientdb":
  9881. s = function (e) {
  9882. if ("object" != (0, _typeof2.default)(e)) return !1;
  9883. var _ref45 = e || {},
  9884. t = _ref45.errCode;
  9885. return t in Hn;
  9886. }(n);
  9887. }
  9888. s && function () {
  9889. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9890. var t = V(W);
  9891. te().then(function () {
  9892. var n = Xn();
  9893. if (n && hs({
  9894. redirect: n
  9895. })) return t.length > 0 ? X(W, Object.assign({
  9896. uniIdRedirectUrl: n
  9897. }, e)) : void (ns && ls({
  9898. api: "navigateTo",
  9899. redirect: n
  9900. }));
  9901. });
  9902. }(n);
  9903. });
  9904. }
  9905. function gs(e) {
  9906. !function (e) {
  9907. e.onResponse = function (e) {
  9908. Q($, e);
  9909. }, e.offResponse = function (e) {
  9910. Y($, e);
  9911. };
  9912. }(e), function (e) {
  9913. e.onNeedLogin = function (e) {
  9914. Q(W, e);
  9915. }, e.offNeedLogin = function (e) {
  9916. Y(W, e);
  9917. }, ts && (L("_globalUniCloudStatus").needLoginInit || (L("_globalUniCloudStatus").needLoginInit = !0, te().then(function () {
  9918. ps.call(e);
  9919. }), rs && fs.call(e)));
  9920. }(e), function (e) {
  9921. e.onRefreshToken = function (e) {
  9922. Q(z, e);
  9923. }, e.offRefreshToken = function (e) {
  9924. Y(z, e);
  9925. };
  9926. }(e);
  9927. }
  9928. var ms;
  9929. var ys = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  9930. _s = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  9931. function ws() {
  9932. var e = ie().token || "",
  9933. t = e.split(".");
  9934. if (!e || 3 !== t.length) return {
  9935. uid: null,
  9936. role: [],
  9937. permission: [],
  9938. tokenExpired: 0
  9939. };
  9940. var n;
  9941. try {
  9942. n = JSON.parse((s = t[1], decodeURIComponent(ms(s).split("").map(function (e) {
  9943. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  9944. }).join(""))));
  9945. } catch (e) {
  9946. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  9947. }
  9948. var s;
  9949. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  9950. }
  9951. ms = "function" != typeof atob ? function (e) {
  9952. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !_s.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  9953. var t;
  9954. e += "==".slice(2 - (3 & e.length));
  9955. for (var n, s, r = "", i = 0; i < e.length;) {
  9956. t = ys.indexOf(e.charAt(i++)) << 18 | ys.indexOf(e.charAt(i++)) << 12 | (n = ys.indexOf(e.charAt(i++))) << 6 | (s = ys.indexOf(e.charAt(i++))), r += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);
  9957. }
  9958. return r;
  9959. } : atob;
  9960. var vs = s(function (e, t) {
  9961. Object.defineProperty(t, "__esModule", {
  9962. value: !0
  9963. });
  9964. var n = "chooseAndUploadFile:ok",
  9965. s = "chooseAndUploadFile:fail";
  9966. function r(e, t) {
  9967. return e.tempFiles.forEach(function (e, n) {
  9968. 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("."));
  9969. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  9970. return e.path;
  9971. })), e;
  9972. }
  9973. function i(e, t, _ref46) {
  9974. var s = _ref46.onChooseFile,
  9975. r = _ref46.onUploadProgress;
  9976. return t.then(function (e) {
  9977. if (s) {
  9978. var _t17 = s(e);
  9979. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  9980. return void 0 === t ? e : t;
  9981. });
  9982. }
  9983. return e;
  9984. }).then(function (t) {
  9985. return !1 === t ? {
  9986. errMsg: n,
  9987. tempFilePaths: [],
  9988. tempFiles: []
  9989. } : function (e, t) {
  9990. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  9991. var r = arguments.length > 3 ? arguments[3] : undefined;
  9992. (t = Object.assign({}, t)).errMsg = n;
  9993. var i = t.tempFiles,
  9994. o = i.length;
  9995. var a = 0;
  9996. return new Promise(function (n) {
  9997. for (; a < s;) {
  9998. c();
  9999. }
  10000. function c() {
  10001. var s = a++;
  10002. if (s >= o) return void (!i.find(function (e) {
  10003. return !e.url && !e.errMsg;
  10004. }) && n(t));
  10005. var u = i[s];
  10006. e.uploadFile({
  10007. filePath: u.path,
  10008. cloudPath: u.cloudPath,
  10009. fileType: u.fileType,
  10010. onUploadProgress: function onUploadProgress(e) {
  10011. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  10012. }
  10013. }).then(function (e) {
  10014. u.url = e.fileID, s < o && c();
  10015. }).catch(function (e) {
  10016. u.errMsg = e.errMsg || e.message, s < o && c();
  10017. });
  10018. }
  10019. });
  10020. }(e, t, 5, r);
  10021. });
  10022. }
  10023. t.initChooseAndUploadFile = function (e) {
  10024. return function () {
  10025. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  10026. type: "all"
  10027. };
  10028. return "image" === t.type ? i(e, function (e) {
  10029. var t = e.count,
  10030. n = e.sizeType,
  10031. _e$sourceType = e.sourceType,
  10032. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  10033. o = e.extension;
  10034. return new Promise(function (e, a) {
  10035. uni.chooseImage({
  10036. count: t,
  10037. sizeType: n,
  10038. sourceType: i,
  10039. extension: o,
  10040. success: function success(t) {
  10041. e(r(t, "image"));
  10042. },
  10043. fail: function fail(e) {
  10044. a({
  10045. errMsg: e.errMsg.replace("chooseImage:fail", s)
  10046. });
  10047. }
  10048. });
  10049. });
  10050. }(t), t) : "video" === t.type ? i(e, function (e) {
  10051. var t = e.camera,
  10052. n = e.compressed,
  10053. i = e.maxDuration,
  10054. _e$sourceType2 = e.sourceType,
  10055. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  10056. a = e.extension;
  10057. return new Promise(function (e, c) {
  10058. uni.chooseVideo({
  10059. camera: t,
  10060. compressed: n,
  10061. maxDuration: i,
  10062. sourceType: o,
  10063. extension: a,
  10064. success: function success(t) {
  10065. var n = t.tempFilePath,
  10066. s = t.duration,
  10067. i = t.size,
  10068. o = t.height,
  10069. a = t.width;
  10070. e(r({
  10071. errMsg: "chooseVideo:ok",
  10072. tempFilePaths: [n],
  10073. tempFiles: [{
  10074. name: t.tempFile && t.tempFile.name || "",
  10075. path: n,
  10076. size: i,
  10077. type: t.tempFile && t.tempFile.type || "",
  10078. width: a,
  10079. height: o,
  10080. duration: s,
  10081. fileType: "video",
  10082. cloudPath: ""
  10083. }]
  10084. }, "video"));
  10085. },
  10086. fail: function fail(e) {
  10087. c({
  10088. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  10089. });
  10090. }
  10091. });
  10092. });
  10093. }(t), t) : i(e, function (e) {
  10094. var t = e.count,
  10095. n = e.extension;
  10096. return new Promise(function (e, i) {
  10097. var o = uni.chooseFile;
  10098. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  10099. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  10100. });
  10101. o({
  10102. type: "all",
  10103. count: t,
  10104. extension: n,
  10105. success: function success(t) {
  10106. e(r(t));
  10107. },
  10108. fail: function fail(e) {
  10109. i({
  10110. errMsg: e.errMsg.replace("chooseFile:fail", s)
  10111. });
  10112. }
  10113. });
  10114. });
  10115. }(t), t);
  10116. };
  10117. };
  10118. }),
  10119. Ss = n(vs);
  10120. var Is = "manual";
  10121. function bs(e) {
  10122. return {
  10123. props: {
  10124. localdata: {
  10125. type: Array,
  10126. default: function _default() {
  10127. return [];
  10128. }
  10129. },
  10130. options: {
  10131. type: [Object, Array],
  10132. default: function _default() {
  10133. return {};
  10134. }
  10135. },
  10136. spaceInfo: {
  10137. type: Object,
  10138. default: function _default() {
  10139. return {};
  10140. }
  10141. },
  10142. collection: {
  10143. type: [String, Array],
  10144. default: ""
  10145. },
  10146. action: {
  10147. type: String,
  10148. default: ""
  10149. },
  10150. field: {
  10151. type: String,
  10152. default: ""
  10153. },
  10154. orderby: {
  10155. type: String,
  10156. default: ""
  10157. },
  10158. where: {
  10159. type: [String, Object],
  10160. default: ""
  10161. },
  10162. pageData: {
  10163. type: String,
  10164. default: "add"
  10165. },
  10166. pageCurrent: {
  10167. type: Number,
  10168. default: 1
  10169. },
  10170. pageSize: {
  10171. type: Number,
  10172. default: 20
  10173. },
  10174. getcount: {
  10175. type: [Boolean, String],
  10176. default: !1
  10177. },
  10178. gettree: {
  10179. type: [Boolean, String],
  10180. default: !1
  10181. },
  10182. gettreepath: {
  10183. type: [Boolean, String],
  10184. default: !1
  10185. },
  10186. startwith: {
  10187. type: String,
  10188. default: ""
  10189. },
  10190. limitlevel: {
  10191. type: Number,
  10192. default: 10
  10193. },
  10194. groupby: {
  10195. type: String,
  10196. default: ""
  10197. },
  10198. groupField: {
  10199. type: String,
  10200. default: ""
  10201. },
  10202. distinct: {
  10203. type: [Boolean, String],
  10204. default: !1
  10205. },
  10206. foreignKey: {
  10207. type: String,
  10208. default: ""
  10209. },
  10210. loadtime: {
  10211. type: String,
  10212. default: "auto"
  10213. },
  10214. manual: {
  10215. type: Boolean,
  10216. default: !1
  10217. }
  10218. },
  10219. data: function data() {
  10220. return {
  10221. mixinDatacomLoading: !1,
  10222. mixinDatacomHasMore: !1,
  10223. mixinDatacomResData: [],
  10224. mixinDatacomErrorMessage: "",
  10225. mixinDatacomPage: {}
  10226. };
  10227. },
  10228. created: function created() {
  10229. var _this20 = this;
  10230. this.mixinDatacomPage = {
  10231. current: this.pageCurrent,
  10232. size: this.pageSize,
  10233. count: 0
  10234. }, this.$watch(function () {
  10235. var e = [];
  10236. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  10237. e.push(_this20[t]);
  10238. }), e;
  10239. }, function (e, t) {
  10240. if (_this20.loadtime === Is) return;
  10241. var n = !1;
  10242. var s = [];
  10243. for (var _r7 = 2; _r7 < e.length; _r7++) {
  10244. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  10245. }
  10246. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  10247. });
  10248. },
  10249. methods: {
  10250. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  10251. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  10252. var _this21 = this;
  10253. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10254. _ref47$getone = _ref47.getone,
  10255. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  10256. t = _ref47.success,
  10257. n = _ref47.fail;
  10258. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  10259. _this21.mixinDatacomLoading = !1;
  10260. var _n$result = n.result,
  10261. s = _n$result.data,
  10262. r = _n$result.count;
  10263. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  10264. var i = e ? s.length ? s[0] : void 0 : s;
  10265. _this21.mixinDatacomResData = i, t && t(i);
  10266. }).catch(function (e) {
  10267. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  10268. }));
  10269. },
  10270. mixinDatacomGet: function mixinDatacomGet() {
  10271. var _n12;
  10272. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10273. var n = e.database(this.spaceInfo);
  10274. var s = t.action || this.action;
  10275. s && (n = n.action(s));
  10276. var r = t.collection || this.collection;
  10277. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  10278. var i = t.where || this.where;
  10279. i && Object.keys(i).length && (n = n.where(i));
  10280. var o = t.field || this.field;
  10281. o && (n = n.field(o));
  10282. var a = t.foreignKey || this.foreignKey;
  10283. a && (n = n.foreignKey(a));
  10284. var c = t.groupby || this.groupby;
  10285. c && (n = n.groupBy(c));
  10286. var u = t.groupField || this.groupField;
  10287. u && (n = n.groupField(u));
  10288. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  10289. var h = t.orderby || this.orderby;
  10290. h && (n = n.orderBy(h));
  10291. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  10292. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  10293. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  10294. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  10295. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  10296. m = {
  10297. getCount: p
  10298. },
  10299. y = {
  10300. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  10301. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  10302. };
  10303. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  10304. }
  10305. }
  10306. };
  10307. }
  10308. function ks(e) {
  10309. return function (t) {
  10310. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10311. n = function (e) {
  10312. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10313. 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;
  10314. }({
  10315. customUI: !1,
  10316. loadingOptions: {
  10317. title: "加载中...",
  10318. mask: !0
  10319. },
  10320. errorOptions: {
  10321. type: "modal",
  10322. retry: !1
  10323. }
  10324. }, n);
  10325. var _n13 = n,
  10326. s = _n13.customUI,
  10327. r = _n13.loadingOptions,
  10328. i = _n13.errorOptions,
  10329. o = _n13.parseSystemError,
  10330. a = !s;
  10331. return new Proxy({}, {
  10332. get: function get(s, c) {
  10333. return function () {
  10334. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10335. e = _ref48.fn,
  10336. t = _ref48.interceptorName,
  10337. n = _ref48.getCallbackArgs;
  10338. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  10339. var _len2,
  10340. s,
  10341. _key2,
  10342. r,
  10343. i,
  10344. o,
  10345. _args = arguments;
  10346. return _regenerator.default.wrap(function _callee50$(_context50) {
  10347. while (1) {
  10348. switch (_context50.prev = _context50.next) {
  10349. case 0:
  10350. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  10351. s[_key2] = _args[_key2];
  10352. }
  10353. r = n ? n({
  10354. params: s
  10355. }) : {};
  10356. _context50.prev = 2;
  10357. _context50.next = 5;
  10358. return M(K(t, "invoke"), _objectSpread({}, r));
  10359. case 5:
  10360. _context50.next = 7;
  10361. return e.apply(void 0, s);
  10362. case 7:
  10363. i = _context50.sent;
  10364. _context50.next = 10;
  10365. return M(K(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  10366. result: i
  10367. }));
  10368. case 10:
  10369. return _context50.abrupt("return", i);
  10370. case 13:
  10371. _context50.prev = 13;
  10372. _context50.t0 = _context50["catch"](2);
  10373. o = _context50.t0;
  10374. _context50.next = 18;
  10375. return M(K(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  10376. error: o
  10377. }));
  10378. case 18:
  10379. throw o;
  10380. case 19:
  10381. _context50.prev = 19;
  10382. _context50.next = 22;
  10383. return M(K(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  10384. error: o
  10385. }) : _objectSpread(_objectSpread({}, r), {}, {
  10386. result: i
  10387. }));
  10388. case 22:
  10389. return _context50.finish(19);
  10390. case 23:
  10391. case "end":
  10392. return _context50.stop();
  10393. }
  10394. }
  10395. }, _callee50, null, [[2, 13, 19, 23]]);
  10396. }));
  10397. }({
  10398. fn: function () {
  10399. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  10400. var l,
  10401. _len3,
  10402. u,
  10403. _key3,
  10404. d,
  10405. p,
  10406. _ref50,
  10407. f,
  10408. g,
  10409. m,
  10410. y,
  10411. _e26,
  10412. _yield,
  10413. _t18,
  10414. _n14,
  10415. _args4 = arguments;
  10416. return _regenerator.default.wrap(function _callee52$(_context52) {
  10417. while (1) {
  10418. switch (_context52.prev = _context52.next) {
  10419. case 0:
  10420. a && uni.showLoading({
  10421. title: r.title,
  10422. mask: r.mask
  10423. });
  10424. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  10425. u[_key3] = _args4[_key3];
  10426. }
  10427. d = {
  10428. name: t,
  10429. type: h,
  10430. data: {
  10431. method: c,
  10432. params: u
  10433. }
  10434. };
  10435. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  10436. var n = t.data.method,
  10437. s = e.secretMethods || {},
  10438. r = s[n] || s["*"];
  10439. r && (t.secretType = r);
  10440. }(n, d);
  10441. p = !1;
  10442. _context52.prev = 5;
  10443. _context52.next = 8;
  10444. return e.callFunction(d);
  10445. case 8:
  10446. l = _context52.sent;
  10447. _context52.next = 14;
  10448. break;
  10449. case 11:
  10450. _context52.prev = 11;
  10451. _context52.t0 = _context52["catch"](5);
  10452. p = !0, l = {
  10453. result: new se(_context52.t0)
  10454. };
  10455. case 14:
  10456. _ref50 = l.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  10457. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (oe(y), X(z, _objectSpread({}, y))), g)) {
  10458. _context52.next = 39;
  10459. break;
  10460. }
  10461. _e26 = m;
  10462. if (!(p && o)) {
  10463. _context52.next = 24;
  10464. break;
  10465. }
  10466. _context52.next = 20;
  10467. return o({
  10468. objectName: t,
  10469. methodName: c,
  10470. params: u,
  10471. errSubject: f,
  10472. errCode: g,
  10473. errMsg: m
  10474. });
  10475. case 20:
  10476. _context52.t1 = _context52.sent.errMsg;
  10477. if (_context52.t1) {
  10478. _context52.next = 23;
  10479. break;
  10480. }
  10481. _context52.t1 = m;
  10482. case 23:
  10483. _e26 = _context52.t1;
  10484. case 24:
  10485. if (!a) {
  10486. _context52.next = 37;
  10487. break;
  10488. }
  10489. if (!("toast" === i.type)) {
  10490. _context52.next = 29;
  10491. break;
  10492. }
  10493. uni.showToast({
  10494. title: _e26,
  10495. icon: "none"
  10496. });
  10497. _context52.next = 37;
  10498. break;
  10499. case 29:
  10500. if (!("modal" !== i.type)) {
  10501. _context52.next = 31;
  10502. break;
  10503. }
  10504. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  10505. case 31:
  10506. _context52.next = 33;
  10507. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  10508. var _ref52,
  10509. e,
  10510. t,
  10511. n,
  10512. s,
  10513. r,
  10514. _args2 = arguments;
  10515. return _regenerator.default.wrap(function _callee51$(_context51) {
  10516. while (1) {
  10517. switch (_context51.prev = _context51.next) {
  10518. case 0:
  10519. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  10520. return _context51.abrupt("return", new Promise(function (i, o) {
  10521. uni.showModal({
  10522. title: e,
  10523. content: t,
  10524. showCancel: n,
  10525. cancelText: s,
  10526. confirmText: r,
  10527. success: function success(e) {
  10528. i(e);
  10529. },
  10530. fail: function fail() {
  10531. i({
  10532. confirm: !1,
  10533. cancel: !0
  10534. });
  10535. }
  10536. });
  10537. }));
  10538. case 2:
  10539. case "end":
  10540. return _context51.stop();
  10541. }
  10542. }
  10543. }, _callee51);
  10544. }))({
  10545. title: "提示",
  10546. content: _e26,
  10547. showCancel: i.retry,
  10548. cancelText: "取消",
  10549. confirmText: i.retry ? "重试" : "确定"
  10550. });
  10551. case 33:
  10552. _yield = _context52.sent;
  10553. _t18 = _yield.confirm;
  10554. if (!(i.retry && _t18)) {
  10555. _context52.next = 37;
  10556. break;
  10557. }
  10558. return _context52.abrupt("return", s.apply(void 0, u));
  10559. case 37:
  10560. _n14 = new se({
  10561. subject: f,
  10562. code: g,
  10563. message: m,
  10564. requestId: l.requestId
  10565. });
  10566. throw _n14.detail = l.result, X($, {
  10567. type: G,
  10568. content: _n14
  10569. }), _n14;
  10570. case 39:
  10571. return _context52.abrupt("return", (X($, {
  10572. type: G,
  10573. content: l.result
  10574. }), l.result));
  10575. case 40:
  10576. case "end":
  10577. return _context52.stop();
  10578. }
  10579. }
  10580. }, _callee52, null, [[5, 11]]);
  10581. }));
  10582. function s() {
  10583. return _s14.apply(this, arguments);
  10584. }
  10585. return s;
  10586. }(),
  10587. interceptorName: "callObject",
  10588. getCallbackArgs: function getCallbackArgs() {
  10589. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10590. e = _ref53.params;
  10591. return {
  10592. objectName: t,
  10593. methodName: c,
  10594. params: e
  10595. };
  10596. }
  10597. });
  10598. }
  10599. });
  10600. };
  10601. }
  10602. function Ts(e) {
  10603. return L("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  10604. }
  10605. function Cs() {
  10606. return _Cs.apply(this, arguments);
  10607. }
  10608. function _Cs() {
  10609. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  10610. var _ref65,
  10611. e,
  10612. _ref65$callLoginByWei,
  10613. t,
  10614. n,
  10615. s,
  10616. r,
  10617. _args7 = arguments;
  10618. return _regenerator.default.wrap(function _callee55$(_context55) {
  10619. while (1) {
  10620. switch (_context55.prev = _context55.next) {
  10621. case 0:
  10622. _ref65 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref65.openid, _ref65$callLoginByWei = _ref65.callLoginByWeixin, t = _ref65$callLoginByWei === void 0 ? !1 : _ref65$callLoginByWei;
  10623. n = Ts(this);
  10624. if (!("mp-weixin" !== A)) {
  10625. _context55.next = 4;
  10626. break;
  10627. }
  10628. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(A, "`"));
  10629. case 4:
  10630. if (!(e && t)) {
  10631. _context55.next = 6;
  10632. break;
  10633. }
  10634. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  10635. case 6:
  10636. if (!e) {
  10637. _context55.next = 8;
  10638. break;
  10639. }
  10640. return _context55.abrupt("return", (n.mpWeixinOpenid = e, {}));
  10641. case 8:
  10642. _context55.next = 10;
  10643. return new Promise(function (e, t) {
  10644. uni.login({
  10645. success: function success(t) {
  10646. e(t.code);
  10647. },
  10648. fail: function fail(e) {
  10649. t(new Error(e.errMsg));
  10650. }
  10651. });
  10652. });
  10653. case 10:
  10654. s = _context55.sent;
  10655. r = this.importObject("uni-id-co", {
  10656. customUI: !0
  10657. });
  10658. _context55.next = 14;
  10659. return r.secureNetworkHandshakeByWeixin({
  10660. code: s,
  10661. callLoginByWeixin: t
  10662. });
  10663. case 14:
  10664. n.mpWeixinCode = s;
  10665. return _context55.abrupt("return", {
  10666. code: s
  10667. });
  10668. case 16:
  10669. case "end":
  10670. return _context55.stop();
  10671. }
  10672. }
  10673. }, _callee55, this);
  10674. }));
  10675. return _Cs.apply(this, arguments);
  10676. }
  10677. function Ps(_x37) {
  10678. return _Ps.apply(this, arguments);
  10679. }
  10680. function _Ps() {
  10681. _Ps = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e) {
  10682. var t;
  10683. return _regenerator.default.wrap(function _callee56$(_context56) {
  10684. while (1) {
  10685. switch (_context56.prev = _context56.next) {
  10686. case 0:
  10687. t = Ts(this);
  10688. return _context56.abrupt("return", (t.initPromise || (t.initPromise = Cs.call(this, e)), t.initPromise));
  10689. case 2:
  10690. case "end":
  10691. return _context56.stop();
  10692. }
  10693. }
  10694. }, _callee56, this);
  10695. }));
  10696. return _Ps.apply(this, arguments);
  10697. }
  10698. function As(e) {
  10699. return function () {
  10700. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10701. t = _ref54.openid,
  10702. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  10703. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  10704. return Ps.call(e, {
  10705. openid: t,
  10706. callLoginByWeixin: n
  10707. });
  10708. };
  10709. }
  10710. var Es = /*#__PURE__*/function (_ref55) {
  10711. (0, _inherits2.default)(Es, _ref55);
  10712. var _super12 = _createSuper(Es);
  10713. function Es() {
  10714. var _this22;
  10715. (0, _classCallCheck2.default)(this, Es);
  10716. _this22 = _super12.call(this), _this22._uniPushMessageCallback = _this22._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this22)), _this22._currentMessageId = -1, _this22._payloadQueue = [];
  10717. return _this22;
  10718. }
  10719. (0, _createClass2.default)(Es, [{
  10720. key: "init",
  10721. value: function init() {
  10722. var _this23 = this;
  10723. return Promise.all([I("getSystemInfo")(), I("getPushClientId")()]).then(function () {
  10724. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  10725. _ref57 = (0, _slicedToArray2.default)(_ref56, 2),
  10726. _ref57$ = _ref57[0];
  10727. _ref57$ = _ref57$ === void 0 ? {} : _ref57$;
  10728. var e = _ref57$.appId,
  10729. _ref57$2 = _ref57[1];
  10730. _ref57$2 = _ref57$2 === void 0 ? {} : _ref57$2;
  10731. var t = _ref57$2.cid;
  10732. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  10733. if (!t) throw new Error("Invalid push client id");
  10734. _this23._appId = e, _this23._pushClientId = t, _this23._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this23.emit("open"), _this23._initMessageListener();
  10735. }, function (e) {
  10736. throw _this23.emit("error", e), _this23.close(), e;
  10737. });
  10738. }
  10739. }, {
  10740. key: "open",
  10741. value: function () {
  10742. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  10743. return _regenerator.default.wrap(function _callee53$(_context53) {
  10744. while (1) {
  10745. switch (_context53.prev = _context53.next) {
  10746. case 0:
  10747. return _context53.abrupt("return", this.init());
  10748. case 1:
  10749. case "end":
  10750. return _context53.stop();
  10751. }
  10752. }
  10753. }, _callee53, this);
  10754. }));
  10755. function open() {
  10756. return _open.apply(this, arguments);
  10757. }
  10758. return open;
  10759. }()
  10760. }, {
  10761. key: "_isUniCloudSSE",
  10762. value: function _isUniCloudSSE(e) {
  10763. if ("receive" !== e.type) return !1;
  10764. var t = e && e.data && e.data.payload;
  10765. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  10766. }
  10767. }, {
  10768. key: "_receivePushMessage",
  10769. value: function _receivePushMessage(e) {
  10770. if (!this._isUniCloudSSE(e)) return;
  10771. var t = e && e.data && e.data.payload,
  10772. n = t.action,
  10773. s = t.messageId,
  10774. r = t.message;
  10775. this._payloadQueue.push({
  10776. action: n,
  10777. messageId: s,
  10778. message: r
  10779. }), this._consumMessage();
  10780. }
  10781. }, {
  10782. key: "_consumMessage",
  10783. value: function _consumMessage() {
  10784. var _this24 = this;
  10785. for (;;) {
  10786. var _e27 = this._payloadQueue.find(function (e) {
  10787. return e.messageId === _this24._currentMessageId + 1;
  10788. });
  10789. if (!_e27) break;
  10790. this._currentMessageId++, this._parseMessagePayload(_e27);
  10791. }
  10792. }
  10793. }, {
  10794. key: "_parseMessagePayload",
  10795. value: function _parseMessagePayload(e) {
  10796. var t = e.action,
  10797. n = e.messageId,
  10798. s = e.message;
  10799. "end" === t ? this._end({
  10800. messageId: n,
  10801. message: s
  10802. }) : "message" === t && this._appendMessage({
  10803. messageId: n,
  10804. message: s
  10805. });
  10806. }
  10807. }, {
  10808. key: "_appendMessage",
  10809. value: function _appendMessage() {
  10810. var _ref58 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10811. e = _ref58.messageId,
  10812. t = _ref58.message;
  10813. this.emit("message", t);
  10814. }
  10815. }, {
  10816. key: "_end",
  10817. value: function _end() {
  10818. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10819. e = _ref59.messageId,
  10820. t = _ref59.message;
  10821. this.emit("end", t), this.close();
  10822. }
  10823. }, {
  10824. key: "_initMessageListener",
  10825. value: function _initMessageListener() {
  10826. uni.onPushMessage(this._uniPushMessageCallback);
  10827. }
  10828. }, {
  10829. key: "_destroy",
  10830. value: function _destroy() {
  10831. uni.offPushMessage(this._uniPushMessageCallback);
  10832. }
  10833. }, {
  10834. key: "toJSON",
  10835. value: function toJSON() {
  10836. return {
  10837. appId: this._appId,
  10838. pushClientId: this._pushClientId,
  10839. seqId: this._seqId
  10840. };
  10841. }
  10842. }, {
  10843. key: "close",
  10844. value: function close() {
  10845. this._destroy(), this.emit("close");
  10846. }
  10847. }]);
  10848. return Es;
  10849. }( /*#__PURE__*/function () {
  10850. function _class6() {
  10851. (0, _classCallCheck2.default)(this, _class6);
  10852. this._callback = {};
  10853. }
  10854. (0, _createClass2.default)(_class6, [{
  10855. key: "addListener",
  10856. value: function addListener(e, t) {
  10857. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  10858. }
  10859. }, {
  10860. key: "on",
  10861. value: function on(e, t) {
  10862. return this.addListener(e, t);
  10863. }
  10864. }, {
  10865. key: "removeListener",
  10866. value: function removeListener(e, t) {
  10867. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  10868. var n = this._callback[e];
  10869. if (!n) return;
  10870. var s = function (e, t) {
  10871. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  10872. if (e[_n15] === t) return _n15;
  10873. }
  10874. return -1;
  10875. }(n, t);
  10876. n.splice(s, 1);
  10877. }
  10878. }, {
  10879. key: "off",
  10880. value: function off(e, t) {
  10881. return this.removeListener(e, t);
  10882. }
  10883. }, {
  10884. key: "removeAllListener",
  10885. value: function removeAllListener(e) {
  10886. delete this._callback[e];
  10887. }
  10888. }, {
  10889. key: "emit",
  10890. value: function emit(e) {
  10891. var n = this._callback[e];
  10892. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  10893. t[_key4 - 1] = arguments[_key4];
  10894. }
  10895. if (n) for (var _e28 = 0; _e28 < n.length; _e28++) {
  10896. n[_e28].apply(n, t);
  10897. }
  10898. }
  10899. }]);
  10900. return _class6;
  10901. }());
  10902. function Os(_x38, _x39) {
  10903. return _Os.apply(this, arguments);
  10904. }
  10905. function _Os() {
  10906. _Os = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  10907. var n, _e32, s;
  10908. return _regenerator.default.wrap(function _callee57$(_context57) {
  10909. while (1) {
  10910. switch (_context57.prev = _context57.next) {
  10911. case 0:
  10912. n = "http://".concat(e, ":").concat(t, "/system/ping");
  10913. _context57.prev = 1;
  10914. _context57.next = 4;
  10915. return s = {
  10916. url: n,
  10917. timeout: 500
  10918. }, new Promise(function (e, t) {
  10919. re.request(_objectSpread(_objectSpread({}, s), {}, {
  10920. success: function success(t) {
  10921. e(t);
  10922. },
  10923. fail: function fail(e) {
  10924. t(e);
  10925. }
  10926. }));
  10927. });
  10928. case 4:
  10929. _e32 = _context57.sent;
  10930. return _context57.abrupt("return", !(!_e32.data || 0 !== _e32.data.code));
  10931. case 8:
  10932. _context57.prev = 8;
  10933. _context57.t0 = _context57["catch"](1);
  10934. return _context57.abrupt("return", !1);
  10935. case 11:
  10936. case "end":
  10937. return _context57.stop();
  10938. }
  10939. }
  10940. }, _callee57, null, [[1, 8]]);
  10941. }));
  10942. return _Os.apply(this, arguments);
  10943. }
  10944. function xs(_x40) {
  10945. return _xs.apply(this, arguments);
  10946. }
  10947. function _xs() {
  10948. _xs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  10949. var _ue2, _e33, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  10950. return _regenerator.default.wrap(function _callee59$(_context59) {
  10951. while (1) {
  10952. switch (_context59.prev = _context59.next) {
  10953. case 0:
  10954. if (k) {
  10955. _context59.next = 2;
  10956. break;
  10957. }
  10958. return _context59.abrupt("return", Promise.resolve());
  10959. case 2:
  10960. if ("app" === A) {
  10961. _ue2 = ue(), _e33 = _ue2.osName, _t20 = _ue2.osVersion;
  10962. "ios" === _e33 && function (e) {
  10963. if (!e || "string" != typeof e) return 0;
  10964. var t = e.match(/^(\d+)./);
  10965. return t && t[1] ? parseInt(t[1]) : 0;
  10966. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  10967. }
  10968. t = e.__dev__;
  10969. if (t.debugInfo) {
  10970. _context59.next = 6;
  10971. break;
  10972. }
  10973. return _context59.abrupt("return");
  10974. case 6:
  10975. _t$debugInfo = t.debugInfo;
  10976. n = _t$debugInfo.address;
  10977. s = _t$debugInfo.servePort;
  10978. _context59.next = 11;
  10979. return function () {
  10980. var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e, t) {
  10981. var n, _s15, _r8;
  10982. return _regenerator.default.wrap(function _callee58$(_context58) {
  10983. while (1) {
  10984. switch (_context58.prev = _context58.next) {
  10985. case 0:
  10986. _s15 = 0;
  10987. case 1:
  10988. if (!(_s15 < e.length)) {
  10989. _context58.next = 11;
  10990. break;
  10991. }
  10992. _r8 = e[_s15];
  10993. _context58.next = 5;
  10994. return Os(_r8, t);
  10995. case 5:
  10996. if (!_context58.sent) {
  10997. _context58.next = 8;
  10998. break;
  10999. }
  11000. n = _r8;
  11001. return _context58.abrupt("break", 11);
  11002. case 8:
  11003. _s15++;
  11004. _context58.next = 1;
  11005. break;
  11006. case 11:
  11007. return _context58.abrupt("return", {
  11008. address: n,
  11009. port: t
  11010. });
  11011. case 12:
  11012. case "end":
  11013. return _context58.stop();
  11014. }
  11015. }
  11016. }, _callee58);
  11017. }));
  11018. return function (_x41, _x42) {
  11019. return _ref66.apply(this, arguments);
  11020. };
  11021. }()(n, s);
  11022. case 11:
  11023. _yield2 = _context59.sent;
  11024. r = _yield2.address;
  11025. if (!r) {
  11026. _context59.next = 15;
  11027. break;
  11028. }
  11029. return _context59.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  11030. case 15:
  11031. i = console["app" === A ? "error" : "warn"];
  11032. o = "";
  11033. if (!("remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, o = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === A && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === A.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  11034. _context59.next = 19;
  11035. break;
  11036. }
  11037. throw new Error(o);
  11038. case 19:
  11039. i(o);
  11040. case 20:
  11041. case "end":
  11042. return _context59.stop();
  11043. }
  11044. }
  11045. }, _callee59);
  11046. }));
  11047. return _xs.apply(this, arguments);
  11048. }
  11049. function Rs(e) {
  11050. e._initPromiseHub || (e._initPromiseHub = new S({
  11051. createPromise: function createPromise() {
  11052. var t = Promise.resolve();
  11053. var n;
  11054. n = 1, t = new Promise(function (e) {
  11055. setTimeout(function () {
  11056. e();
  11057. }, n);
  11058. });
  11059. var s = e.auth();
  11060. return t.then(function () {
  11061. return s.getLoginState();
  11062. }).then(function (e) {
  11063. return e ? Promise.resolve() : s.signInAnonymously();
  11064. });
  11065. }
  11066. }));
  11067. }
  11068. var Us = {
  11069. tcb: It,
  11070. tencent: It,
  11071. aliyun: me,
  11072. private: kt
  11073. };
  11074. var Ls = new ( /*#__PURE__*/function () {
  11075. function _class7() {
  11076. (0, _classCallCheck2.default)(this, _class7);
  11077. }
  11078. (0, _createClass2.default)(_class7, [{
  11079. key: "init",
  11080. value: function init(e) {
  11081. var t = {};
  11082. var n = Us[e.provider];
  11083. if (!n) throw new Error("未提供正确的provider参数");
  11084. t = n.init(e), k && function (e) {
  11085. if (!k) return;
  11086. var t = {};
  11087. e.__dev__ = t, t.debugLog = k && ("web" === A && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === A);
  11088. var n = E;
  11089. n && !n.code && (t.debugInfo = n);
  11090. var s = new S({
  11091. createPromise: function createPromise() {
  11092. return xs(e);
  11093. }
  11094. });
  11095. t.initLocalNetwork = function () {
  11096. return s.exec();
  11097. };
  11098. }(t), Rs(t), Rn(t), function (e) {
  11099. var t = e.uploadFile;
  11100. e.uploadFile = function (e) {
  11101. return t.call(this, e);
  11102. };
  11103. }(t), function (e) {
  11104. e.database = function (t) {
  11105. if (t && Object.keys(t).length > 0) return e.init(t).database();
  11106. if (this._database) return this._database;
  11107. var n = $n(Wn, {
  11108. uniClient: e
  11109. });
  11110. return this._database = n, n;
  11111. }, e.databaseForJQL = function (t) {
  11112. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  11113. if (this._databaseForJQL) return this._databaseForJQL;
  11114. var n = $n(Wn, {
  11115. uniClient: e,
  11116. isJQL: !0
  11117. });
  11118. return this._databaseForJQL = n, n;
  11119. };
  11120. }(t), function (e) {
  11121. e.getCurrentUserInfo = ws, e.chooseAndUploadFile = Ss.initChooseAndUploadFile(e), Object.assign(e, {
  11122. get mixinDatacom() {
  11123. return bs(e);
  11124. }
  11125. }), e.SSEChannel = Es, e.initSecureNetworkByWeixin = As(e), e.importObject = ks(e);
  11126. }(t);
  11127. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  11128. if (!t[e]) return;
  11129. var n = t[e];
  11130. t[e] = function () {
  11131. return n.apply(t, Array.from(arguments));
  11132. }, t[e] = function (e, t) {
  11133. return function (n) {
  11134. var _this25 = this;
  11135. var s = !1;
  11136. if ("callFunction" === t) {
  11137. var _e29 = n && n.type || u;
  11138. s = _e29 !== u;
  11139. }
  11140. var r = "callFunction" === t && !s,
  11141. i = this._initPromiseHub.exec();
  11142. n = n || {};
  11143. var _ne2 = ne(n),
  11144. o = _ne2.success,
  11145. a = _ne2.fail,
  11146. c = _ne2.complete,
  11147. h = i.then(function () {
  11148. return s ? Promise.resolve() : M(K(t, "invoke"), n);
  11149. }).then(function () {
  11150. return e.call(_this25, n);
  11151. }).then(function (e) {
  11152. return s ? Promise.resolve(e) : M(K(t, "success"), e).then(function () {
  11153. return M(K(t, "complete"), e);
  11154. }).then(function () {
  11155. return r && X($, {
  11156. type: H,
  11157. content: e
  11158. }), Promise.resolve(e);
  11159. });
  11160. }, function (e) {
  11161. return s ? Promise.reject(e) : M(K(t, "fail"), e).then(function () {
  11162. return M(K(t, "complete"), e);
  11163. }).then(function () {
  11164. return X($, {
  11165. type: H,
  11166. content: e
  11167. }), Promise.reject(e);
  11168. });
  11169. });
  11170. if (!(o || a || c)) return h;
  11171. h.then(function (e) {
  11172. o && o(e), c && c(e), r && X($, {
  11173. type: H,
  11174. content: e
  11175. });
  11176. }, function (e) {
  11177. a && a(e), c && c(e), r && X($, {
  11178. type: H,
  11179. content: e
  11180. });
  11181. });
  11182. };
  11183. }(t[e], e).bind(t);
  11184. }), t.init = this.init, t;
  11185. }
  11186. }]);
  11187. return _class7;
  11188. }())();
  11189. (function () {
  11190. var e = O;
  11191. var t = {};
  11192. if (e && 1 === e.length) t = e[0], Ls = Ls.init(t), Ls._isDefault = !0;else {
  11193. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  11194. var _n16;
  11195. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : x ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  11196. Ls[e] = function () {
  11197. return console.error(_n16), Promise.reject(new se({
  11198. code: "SYS_ERR",
  11199. message: _n16
  11200. }));
  11201. };
  11202. });
  11203. }
  11204. Object.assign(Ls, {
  11205. get mixinDatacom() {
  11206. return bs(Ls);
  11207. }
  11208. }), gs(Ls), Ls.addInterceptor = F, Ls.removeInterceptor = q, Ls.interceptObject = j, k && "web" === A && (window.uniCloud = Ls);
  11209. })();
  11210. var Ns = Ls;
  11211. exports.default = Ns;
  11212. /* 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"]))
  11213. /***/ }),
  11214. /***/ 211:
  11215. /*!****************************************************************!*\
  11216. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  11217. \****************************************************************/
  11218. /*! no static exports found */
  11219. /***/ (function(module, exports, __webpack_require__) {
  11220. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 187);
  11221. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  11222. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 212);
  11223. var construct = __webpack_require__(/*! ./construct.js */ 15);
  11224. function _wrapNativeSuper(Class) {
  11225. var _cache = typeof Map === "function" ? new Map() : undefined;
  11226. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  11227. if (Class === null || !isNativeFunction(Class)) return Class;
  11228. if (typeof Class !== "function") {
  11229. throw new TypeError("Super expression must either be null or a function");
  11230. }
  11231. if (typeof _cache !== "undefined") {
  11232. if (_cache.has(Class)) return _cache.get(Class);
  11233. _cache.set(Class, Wrapper);
  11234. }
  11235. function Wrapper() {
  11236. return construct(Class, arguments, getPrototypeOf(this).constructor);
  11237. }
  11238. Wrapper.prototype = Object.create(Class.prototype, {
  11239. constructor: {
  11240. value: Wrapper,
  11241. enumerable: false,
  11242. writable: true,
  11243. configurable: true
  11244. }
  11245. });
  11246. return setPrototypeOf(Wrapper, Class);
  11247. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11248. return _wrapNativeSuper(Class);
  11249. }
  11250. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11251. /***/ }),
  11252. /***/ 212:
  11253. /*!*****************************************************************!*\
  11254. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  11255. \*****************************************************************/
  11256. /*! no static exports found */
  11257. /***/ (function(module, exports) {
  11258. function _isNativeFunction(fn) {
  11259. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  11260. }
  11261. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11262. /***/ }),
  11263. /***/ 213:
  11264. /*!******************************************************************************!*\
  11265. !*** E:/work/Project_newGit/CKQ/app/pages.json?{"type":"origin-pages-json"} ***!
  11266. \******************************************************************************/
  11267. /*! no static exports found */
  11268. /***/ (function(module, exports, __webpack_require__) {
  11269. "use strict";
  11270. Object.defineProperty(exports, "__esModule", {
  11271. value: true
  11272. });
  11273. exports.default = void 0;
  11274. var _default = {
  11275. "pages": [{
  11276. "path": "pages/login/login",
  11277. "style": {
  11278. "navigationBarTitleText": "登录"
  11279. }
  11280. }, {
  11281. "path": "pages/index/index",
  11282. "style": {
  11283. "navigationBarTitleText": "任务",
  11284. "navigationStyle": "custom"
  11285. }
  11286. }, {
  11287. "path": "pages/risk/risk",
  11288. "style": {
  11289. "navigationBarTitleText": "风险",
  11290. "navigationStyle": "custom"
  11291. }
  11292. }, {
  11293. "path": "pages/mine/mine",
  11294. "style": {
  11295. "navigationBarTitleText": "我的",
  11296. "navigationStyle": "custom"
  11297. }
  11298. }, {
  11299. "path": "pages/mine/password/password",
  11300. "style": {
  11301. "navigationBarTitleText": "修改密码"
  11302. }
  11303. }, {
  11304. "path": "pages/task/task",
  11305. "style": {
  11306. "navigationBarTitleText": "预警处置"
  11307. }
  11308. }, {
  11309. "path": "pages/task/form/form",
  11310. "style": {
  11311. "navigationBarTitleText": "处置"
  11312. }
  11313. }, {
  11314. "path": "pages/risk/review/review",
  11315. "style": {
  11316. "navigationBarTitleText": "待评审",
  11317. "enablePullDownRefresh": false
  11318. }
  11319. }, {
  11320. "path": "pages/risk/review/form/form",
  11321. "style": {
  11322. "navigationBarTitleText": "评审",
  11323. "enablePullDownRefresh": false
  11324. }
  11325. }, {
  11326. "path": "pages/risk/check/check",
  11327. "style": {
  11328. "navigationBarTitleText": "待验收",
  11329. "enablePullDownRefresh": false
  11330. }
  11331. }, {
  11332. "path": "pages/risk/check/form/form",
  11333. "style": {
  11334. "navigationBarTitleText": "验收",
  11335. "enablePullDownRefresh": false
  11336. }
  11337. }, {
  11338. "path": "pages/risk/rectify/rectify",
  11339. "style": {
  11340. "navigationBarTitleText": "待整改",
  11341. "enablePullDownRefresh": false
  11342. }
  11343. }, {
  11344. "path": "pages/risk/rectify/form/form",
  11345. "style": {
  11346. "navigationBarTitleText": "整改",
  11347. "enablePullDownRefresh": false
  11348. }
  11349. }, {
  11350. "path": "pages/risk/repeal/repeal",
  11351. "style": {
  11352. "navigationBarTitleText": "已撤销",
  11353. "enablePullDownRefresh": false
  11354. }
  11355. }, {
  11356. "path": "pages/task/taskList/taskList",
  11357. "style": {
  11358. "navigationBarTitleText": "检查任务",
  11359. "enablePullDownRefresh": false
  11360. }
  11361. }, {
  11362. "path": "pages/task/submit/submit",
  11363. "style": {
  11364. "navigationBarTitleText": "登记预警",
  11365. "enablePullDownRefresh": false
  11366. }
  11367. }],
  11368. "tabBar": {
  11369. "color": "#999999",
  11370. "selectedColor": "#3384ff",
  11371. "borderStyle": "white",
  11372. "backgroundColor": "#ffffff",
  11373. "height": "50px",
  11374. "fontSize": "10px",
  11375. "iconWidth": "24px",
  11376. "spacing": "3px",
  11377. "list": [{
  11378. "pagePath": "pages/index/index",
  11379. "iconPath": "static/tabBar/Home.png",
  11380. "selectedIconPath": "static/tabBar/HomeEd.png",
  11381. "text": "任务"
  11382. }, {
  11383. "pagePath": "pages/risk/risk",
  11384. "iconPath": "static/tabBar/risk.png",
  11385. "selectedIconPath": "static/tabBar/riskEd.png",
  11386. "text": "预警"
  11387. }, {
  11388. "pagePath": "pages/mine/mine",
  11389. "iconPath": "static/tabBar/mine.png",
  11390. "selectedIconPath": "static/tabBar/mineEd.png",
  11391. "text": "我的"
  11392. }]
  11393. },
  11394. "globalStyle": {
  11395. "navigationBarTextStyle": "black",
  11396. "navigationBarTitleText": "uni-app",
  11397. "navigationBarBackgroundColor": "#F3F5FB",
  11398. "backgroundColor": "#F8F8F8",
  11399. "app-plus": {
  11400. "background": "#efeff4"
  11401. }
  11402. }
  11403. };
  11404. exports.default = _default;
  11405. /***/ }),
  11406. /***/ 214:
  11407. /*!*****************************************************************!*\
  11408. !*** E:/work/Project_newGit/CKQ/app/pages.json?{"type":"stat"} ***!
  11409. \*****************************************************************/
  11410. /*! no static exports found */
  11411. /***/ (function(module, exports, __webpack_require__) {
  11412. "use strict";
  11413. Object.defineProperty(exports, "__esModule", {
  11414. value: true
  11415. });
  11416. exports.default = void 0;
  11417. var _default = {
  11418. "appid": "__UNI__ED9AEA5"
  11419. };
  11420. exports.default = _default;
  11421. /***/ }),
  11422. /***/ 22:
  11423. /*!*************************************************************!*\
  11424. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  11425. \*************************************************************/
  11426. /*! no static exports found */
  11427. /***/ (function(module, exports, __webpack_require__) {
  11428. "use strict";
  11429. /* WEBPACK VAR INJECTION */(function(uni, global) {
  11430. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11431. Object.defineProperty(exports, "__esModule", {
  11432. value: true
  11433. });
  11434. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  11435. exports.compileI18nJsonStr = compileI18nJsonStr;
  11436. exports.hasI18nJson = hasI18nJson;
  11437. exports.initVueI18n = initVueI18n;
  11438. exports.isI18nStr = isI18nStr;
  11439. exports.isString = void 0;
  11440. exports.normalizeLocale = normalizeLocale;
  11441. exports.parseI18nJson = parseI18nJson;
  11442. exports.resolveLocale = resolveLocale;
  11443. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11444. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11445. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11446. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11447. var isArray = Array.isArray;
  11448. var isObject = function isObject(val) {
  11449. return val !== null && (0, _typeof2.default)(val) === 'object';
  11450. };
  11451. var defaultDelimiters = ['{', '}'];
  11452. var BaseFormatter = /*#__PURE__*/function () {
  11453. function BaseFormatter() {
  11454. (0, _classCallCheck2.default)(this, BaseFormatter);
  11455. this._caches = Object.create(null);
  11456. }
  11457. (0, _createClass2.default)(BaseFormatter, [{
  11458. key: "interpolate",
  11459. value: function interpolate(message, values) {
  11460. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  11461. if (!values) {
  11462. return [message];
  11463. }
  11464. var tokens = this._caches[message];
  11465. if (!tokens) {
  11466. tokens = parse(message, delimiters);
  11467. this._caches[message] = tokens;
  11468. }
  11469. return compile(tokens, values);
  11470. }
  11471. }]);
  11472. return BaseFormatter;
  11473. }();
  11474. exports.Formatter = BaseFormatter;
  11475. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  11476. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  11477. function parse(format, _ref) {
  11478. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  11479. startDelimiter = _ref2[0],
  11480. endDelimiter = _ref2[1];
  11481. var tokens = [];
  11482. var position = 0;
  11483. var text = '';
  11484. while (position < format.length) {
  11485. var char = format[position++];
  11486. if (char === startDelimiter) {
  11487. if (text) {
  11488. tokens.push({
  11489. type: 'text',
  11490. value: text
  11491. });
  11492. }
  11493. text = '';
  11494. var sub = '';
  11495. char = format[position++];
  11496. while (char !== undefined && char !== endDelimiter) {
  11497. sub += char;
  11498. char = format[position++];
  11499. }
  11500. var isClosed = char === endDelimiter;
  11501. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  11502. tokens.push({
  11503. value: sub,
  11504. type: type
  11505. });
  11506. }
  11507. // else if (char === '%') {
  11508. // // when found rails i18n syntax, skip text capture
  11509. // if (format[position] !== '{') {
  11510. // text += char
  11511. // }
  11512. // }
  11513. else {
  11514. text += char;
  11515. }
  11516. }
  11517. text && tokens.push({
  11518. type: 'text',
  11519. value: text
  11520. });
  11521. return tokens;
  11522. }
  11523. function compile(tokens, values) {
  11524. var compiled = [];
  11525. var index = 0;
  11526. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  11527. if (mode === 'unknown') {
  11528. return compiled;
  11529. }
  11530. while (index < tokens.length) {
  11531. var token = tokens[index];
  11532. switch (token.type) {
  11533. case 'text':
  11534. compiled.push(token.value);
  11535. break;
  11536. case 'list':
  11537. compiled.push(values[parseInt(token.value, 10)]);
  11538. break;
  11539. case 'named':
  11540. if (mode === 'named') {
  11541. compiled.push(values[token.value]);
  11542. } else {
  11543. if (true) {
  11544. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  11545. }
  11546. }
  11547. break;
  11548. case 'unknown':
  11549. if (true) {
  11550. console.warn("Detect 'unknown' type of token!");
  11551. }
  11552. break;
  11553. }
  11554. index++;
  11555. }
  11556. return compiled;
  11557. }
  11558. var LOCALE_ZH_HANS = 'zh-Hans';
  11559. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  11560. var LOCALE_ZH_HANT = 'zh-Hant';
  11561. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  11562. var LOCALE_EN = 'en';
  11563. exports.LOCALE_EN = LOCALE_EN;
  11564. var LOCALE_FR = 'fr';
  11565. exports.LOCALE_FR = LOCALE_FR;
  11566. var LOCALE_ES = 'es';
  11567. exports.LOCALE_ES = LOCALE_ES;
  11568. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11569. var hasOwn = function hasOwn(val, key) {
  11570. return hasOwnProperty.call(val, key);
  11571. };
  11572. var defaultFormatter = new BaseFormatter();
  11573. function include(str, parts) {
  11574. return !!parts.find(function (part) {
  11575. return str.indexOf(part) !== -1;
  11576. });
  11577. }
  11578. function startsWith(str, parts) {
  11579. return parts.find(function (part) {
  11580. return str.indexOf(part) === 0;
  11581. });
  11582. }
  11583. function normalizeLocale(locale, messages) {
  11584. if (!locale) {
  11585. return;
  11586. }
  11587. locale = locale.trim().replace(/_/g, '-');
  11588. if (messages && messages[locale]) {
  11589. return locale;
  11590. }
  11591. locale = locale.toLowerCase();
  11592. if (locale.indexOf('zh') === 0) {
  11593. if (locale.indexOf('-hans') > -1) {
  11594. return LOCALE_ZH_HANS;
  11595. }
  11596. if (locale.indexOf('-hant') > -1) {
  11597. return LOCALE_ZH_HANT;
  11598. }
  11599. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  11600. return LOCALE_ZH_HANT;
  11601. }
  11602. return LOCALE_ZH_HANS;
  11603. }
  11604. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  11605. if (lang) {
  11606. return lang;
  11607. }
  11608. }
  11609. var I18n = /*#__PURE__*/function () {
  11610. function I18n(_ref3) {
  11611. var locale = _ref3.locale,
  11612. fallbackLocale = _ref3.fallbackLocale,
  11613. messages = _ref3.messages,
  11614. watcher = _ref3.watcher,
  11615. formater = _ref3.formater;
  11616. (0, _classCallCheck2.default)(this, I18n);
  11617. this.locale = LOCALE_EN;
  11618. this.fallbackLocale = LOCALE_EN;
  11619. this.message = {};
  11620. this.messages = {};
  11621. this.watchers = [];
  11622. if (fallbackLocale) {
  11623. this.fallbackLocale = fallbackLocale;
  11624. }
  11625. this.formater = formater || defaultFormatter;
  11626. this.messages = messages || {};
  11627. this.setLocale(locale || LOCALE_EN);
  11628. if (watcher) {
  11629. this.watchLocale(watcher);
  11630. }
  11631. }
  11632. (0, _createClass2.default)(I18n, [{
  11633. key: "setLocale",
  11634. value: function setLocale(locale) {
  11635. var _this = this;
  11636. var oldLocale = this.locale;
  11637. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  11638. if (!this.messages[this.locale]) {
  11639. // 可能初始化时不存在
  11640. this.messages[this.locale] = {};
  11641. }
  11642. this.message = this.messages[this.locale];
  11643. // 仅发生变化时,通知
  11644. if (oldLocale !== this.locale) {
  11645. this.watchers.forEach(function (watcher) {
  11646. watcher(_this.locale, oldLocale);
  11647. });
  11648. }
  11649. }
  11650. }, {
  11651. key: "getLocale",
  11652. value: function getLocale() {
  11653. return this.locale;
  11654. }
  11655. }, {
  11656. key: "watchLocale",
  11657. value: function watchLocale(fn) {
  11658. var _this2 = this;
  11659. var index = this.watchers.push(fn) - 1;
  11660. return function () {
  11661. _this2.watchers.splice(index, 1);
  11662. };
  11663. }
  11664. }, {
  11665. key: "add",
  11666. value: function add(locale, message) {
  11667. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11668. var curMessages = this.messages[locale];
  11669. if (curMessages) {
  11670. if (override) {
  11671. Object.assign(curMessages, message);
  11672. } else {
  11673. Object.keys(message).forEach(function (key) {
  11674. if (!hasOwn(curMessages, key)) {
  11675. curMessages[key] = message[key];
  11676. }
  11677. });
  11678. }
  11679. } else {
  11680. this.messages[locale] = message;
  11681. }
  11682. }
  11683. }, {
  11684. key: "f",
  11685. value: function f(message, values, delimiters) {
  11686. return this.formater.interpolate(message, values, delimiters).join('');
  11687. }
  11688. }, {
  11689. key: "t",
  11690. value: function t(key, locale, values) {
  11691. var message = this.message;
  11692. if (typeof locale === 'string') {
  11693. locale = normalizeLocale(locale, this.messages);
  11694. locale && (message = this.messages[locale]);
  11695. } else {
  11696. values = locale;
  11697. }
  11698. if (!hasOwn(message, key)) {
  11699. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  11700. return key;
  11701. }
  11702. return this.formater.interpolate(message[key], values).join('');
  11703. }
  11704. }]);
  11705. return I18n;
  11706. }();
  11707. exports.I18n = I18n;
  11708. function watchAppLocale(appVm, i18n) {
  11709. // 需要保证 watch 的触发在组件渲染之前
  11710. if (appVm.$watchLocale) {
  11711. // vue2
  11712. appVm.$watchLocale(function (newLocale) {
  11713. i18n.setLocale(newLocale);
  11714. });
  11715. } else {
  11716. appVm.$watch(function () {
  11717. return appVm.$locale;
  11718. }, function (newLocale) {
  11719. i18n.setLocale(newLocale);
  11720. });
  11721. }
  11722. }
  11723. function getDefaultLocale() {
  11724. if (typeof uni !== 'undefined' && uni.getLocale) {
  11725. return uni.getLocale();
  11726. }
  11727. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  11728. if (typeof global !== 'undefined' && global.getLocale) {
  11729. return global.getLocale();
  11730. }
  11731. return LOCALE_EN;
  11732. }
  11733. function initVueI18n(locale) {
  11734. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11735. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  11736. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  11737. // 兼容旧版本入参
  11738. if (typeof locale !== 'string') {
  11739. var _ref4 = [messages, locale];
  11740. locale = _ref4[0];
  11741. messages = _ref4[1];
  11742. }
  11743. if (typeof locale !== 'string') {
  11744. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  11745. locale = getDefaultLocale();
  11746. }
  11747. if (typeof fallbackLocale !== 'string') {
  11748. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  11749. }
  11750. var i18n = new I18n({
  11751. locale: locale,
  11752. fallbackLocale: fallbackLocale,
  11753. messages: messages,
  11754. watcher: watcher
  11755. });
  11756. var _t = function t(key, values) {
  11757. if (typeof getApp !== 'function') {
  11758. // app view
  11759. /* eslint-disable no-func-assign */
  11760. _t = function t(key, values) {
  11761. return i18n.t(key, values);
  11762. };
  11763. } else {
  11764. var isWatchedAppLocale = false;
  11765. _t = function t(key, values) {
  11766. var appVm = getApp().$vm;
  11767. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  11768. // options: {
  11769. // type: Array,
  11770. // default () {
  11771. // return [{
  11772. // icon: 'shop',
  11773. // text: t("uni-goods-nav.options.shop"),
  11774. // }, {
  11775. // icon: 'cart',
  11776. // text: t("uni-goods-nav.options.cart")
  11777. // }]
  11778. // }
  11779. // },
  11780. if (appVm) {
  11781. // 触发响应式
  11782. appVm.$locale;
  11783. if (!isWatchedAppLocale) {
  11784. isWatchedAppLocale = true;
  11785. watchAppLocale(appVm, i18n);
  11786. }
  11787. }
  11788. return i18n.t(key, values);
  11789. };
  11790. }
  11791. return _t(key, values);
  11792. };
  11793. return {
  11794. i18n: i18n,
  11795. f: function f(message, values, delimiters) {
  11796. return i18n.f(message, values, delimiters);
  11797. },
  11798. t: function t(key, values) {
  11799. return _t(key, values);
  11800. },
  11801. add: function add(locale, message) {
  11802. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11803. return i18n.add(locale, message, override);
  11804. },
  11805. watch: function watch(fn) {
  11806. return i18n.watchLocale(fn);
  11807. },
  11808. getLocale: function getLocale() {
  11809. return i18n.getLocale();
  11810. },
  11811. setLocale: function setLocale(newLocale) {
  11812. return i18n.setLocale(newLocale);
  11813. }
  11814. };
  11815. }
  11816. var isString = function isString(val) {
  11817. return typeof val === 'string';
  11818. };
  11819. exports.isString = isString;
  11820. var formater;
  11821. function hasI18nJson(jsonObj, delimiters) {
  11822. if (!formater) {
  11823. formater = new BaseFormatter();
  11824. }
  11825. return walkJsonObj(jsonObj, function (jsonObj, key) {
  11826. var value = jsonObj[key];
  11827. if (isString(value)) {
  11828. if (isI18nStr(value, delimiters)) {
  11829. return true;
  11830. }
  11831. } else {
  11832. return hasI18nJson(value, delimiters);
  11833. }
  11834. });
  11835. }
  11836. function parseI18nJson(jsonObj, values, delimiters) {
  11837. if (!formater) {
  11838. formater = new BaseFormatter();
  11839. }
  11840. walkJsonObj(jsonObj, function (jsonObj, key) {
  11841. var value = jsonObj[key];
  11842. if (isString(value)) {
  11843. if (isI18nStr(value, delimiters)) {
  11844. jsonObj[key] = compileStr(value, values, delimiters);
  11845. }
  11846. } else {
  11847. parseI18nJson(value, values, delimiters);
  11848. }
  11849. });
  11850. return jsonObj;
  11851. }
  11852. function compileI18nJsonStr(jsonStr, _ref5) {
  11853. var locale = _ref5.locale,
  11854. locales = _ref5.locales,
  11855. delimiters = _ref5.delimiters;
  11856. if (!isI18nStr(jsonStr, delimiters)) {
  11857. return jsonStr;
  11858. }
  11859. if (!formater) {
  11860. formater = new BaseFormatter();
  11861. }
  11862. var localeValues = [];
  11863. Object.keys(locales).forEach(function (name) {
  11864. if (name !== locale) {
  11865. localeValues.push({
  11866. locale: name,
  11867. values: locales[name]
  11868. });
  11869. }
  11870. });
  11871. localeValues.unshift({
  11872. locale: locale,
  11873. values: locales[locale]
  11874. });
  11875. try {
  11876. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  11877. } catch (e) {}
  11878. return jsonStr;
  11879. }
  11880. function isI18nStr(value, delimiters) {
  11881. return value.indexOf(delimiters[0]) > -1;
  11882. }
  11883. function compileStr(value, values, delimiters) {
  11884. return formater.interpolate(value, values, delimiters).join('');
  11885. }
  11886. function compileValue(jsonObj, key, localeValues, delimiters) {
  11887. var value = jsonObj[key];
  11888. if (isString(value)) {
  11889. // 存在国际化
  11890. if (isI18nStr(value, delimiters)) {
  11891. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  11892. if (localeValues.length > 1) {
  11893. // 格式化国际化语言
  11894. var valueLocales = jsonObj[key + 'Locales'] = {};
  11895. localeValues.forEach(function (localValue) {
  11896. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  11897. });
  11898. }
  11899. }
  11900. } else {
  11901. compileJsonObj(value, localeValues, delimiters);
  11902. }
  11903. }
  11904. function compileJsonObj(jsonObj, localeValues, delimiters) {
  11905. walkJsonObj(jsonObj, function (jsonObj, key) {
  11906. compileValue(jsonObj, key, localeValues, delimiters);
  11907. });
  11908. return jsonObj;
  11909. }
  11910. function walkJsonObj(jsonObj, walk) {
  11911. if (isArray(jsonObj)) {
  11912. for (var i = 0; i < jsonObj.length; i++) {
  11913. if (walk(jsonObj, i)) {
  11914. return true;
  11915. }
  11916. }
  11917. } else if (isObject(jsonObj)) {
  11918. for (var key in jsonObj) {
  11919. if (walk(jsonObj, key)) {
  11920. return true;
  11921. }
  11922. }
  11923. }
  11924. return false;
  11925. }
  11926. function resolveLocale(locales) {
  11927. return function (locale) {
  11928. if (!locale) {
  11929. return locale;
  11930. }
  11931. locale = normalizeLocale(locale) || locale;
  11932. return resolveLocaleChain(locale).find(function (locale) {
  11933. return locales.indexOf(locale) > -1;
  11934. });
  11935. };
  11936. }
  11937. function resolveLocaleChain(locale) {
  11938. var chain = [];
  11939. var tokens = locale.split('-');
  11940. while (tokens.length) {
  11941. chain.push(tokens.join('-'));
  11942. tokens.pop();
  11943. }
  11944. return chain;
  11945. }
  11946. /* 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)))
  11947. /***/ }),
  11948. /***/ 23:
  11949. /*!***************************************************************!*\
  11950. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  11951. \***************************************************************/
  11952. /*! no static exports found */
  11953. /***/ (function(module, exports) {
  11954. function _classCallCheck(instance, Constructor) {
  11955. if (!(instance instanceof Constructor)) {
  11956. throw new TypeError("Cannot call a class as a function");
  11957. }
  11958. }
  11959. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11960. /***/ }),
  11961. /***/ 24:
  11962. /*!************************************************************!*\
  11963. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  11964. \************************************************************/
  11965. /*! no static exports found */
  11966. /***/ (function(module, exports, __webpack_require__) {
  11967. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  11968. function _defineProperties(target, props) {
  11969. for (var i = 0; i < props.length; i++) {
  11970. var descriptor = props[i];
  11971. descriptor.enumerable = descriptor.enumerable || false;
  11972. descriptor.configurable = true;
  11973. if ("value" in descriptor) descriptor.writable = true;
  11974. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  11975. }
  11976. }
  11977. function _createClass(Constructor, protoProps, staticProps) {
  11978. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  11979. if (staticProps) _defineProperties(Constructor, staticProps);
  11980. Object.defineProperty(Constructor, "prototype", {
  11981. writable: false
  11982. });
  11983. return Constructor;
  11984. }
  11985. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11986. /***/ }),
  11987. /***/ 241:
  11988. /*!*******************************************************************************************************************!*\
  11989. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  11990. \*******************************************************************************************************************/
  11991. /*! no static exports found */
  11992. /***/ (function(module, exports, __webpack_require__) {
  11993. "use strict";
  11994. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11995. Object.defineProperty(exports, "__esModule", {
  11996. value: true
  11997. });
  11998. exports.default = void 0;
  11999. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 242));
  12000. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 243));
  12001. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 244));
  12002. var _default = {
  12003. en: _en.default,
  12004. 'zh-Hans': _zhHans.default,
  12005. 'zh-Hant': _zhHant.default
  12006. };
  12007. exports.default = _default;
  12008. /***/ }),
  12009. /***/ 242:
  12010. /*!******************************************************************************************************************!*\
  12011. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  12012. \******************************************************************************************************************/
  12013. /*! 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 */
  12014. /***/ (function(module) {
  12015. 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\"}");
  12016. /***/ }),
  12017. /***/ 243:
  12018. /*!***********************************************************************************************************************!*\
  12019. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  12020. \***********************************************************************************************************************/
  12021. /*! 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 */
  12022. /***/ (function(module) {
  12023. 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\":\"确认\"}");
  12024. /***/ }),
  12025. /***/ 244:
  12026. /*!***********************************************************************************************************************!*\
  12027. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  12028. \***********************************************************************************************************************/
  12029. /*! 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 */
  12030. /***/ (function(module) {
  12031. 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\":\"確認\"}");
  12032. /***/ }),
  12033. /***/ 25:
  12034. /*!******************************************************************************************!*\
  12035. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  12036. \******************************************************************************************/
  12037. /*! exports provided: default */
  12038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12039. "use strict";
  12040. __webpack_require__.r(__webpack_exports__);
  12041. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12042. * Vue.js v2.6.11
  12043. * (c) 2014-2022 Evan You
  12044. * Released under the MIT License.
  12045. */
  12046. /* */
  12047. var emptyObject = Object.freeze({});
  12048. // These helpers produce better VM code in JS engines due to their
  12049. // explicitness and function inlining.
  12050. function isUndef (v) {
  12051. return v === undefined || v === null
  12052. }
  12053. function isDef (v) {
  12054. return v !== undefined && v !== null
  12055. }
  12056. function isTrue (v) {
  12057. return v === true
  12058. }
  12059. function isFalse (v) {
  12060. return v === false
  12061. }
  12062. /**
  12063. * Check if value is primitive.
  12064. */
  12065. function isPrimitive (value) {
  12066. return (
  12067. typeof value === 'string' ||
  12068. typeof value === 'number' ||
  12069. // $flow-disable-line
  12070. typeof value === 'symbol' ||
  12071. typeof value === 'boolean'
  12072. )
  12073. }
  12074. /**
  12075. * Quick object check - this is primarily used to tell
  12076. * Objects from primitive values when we know the value
  12077. * is a JSON-compliant type.
  12078. */
  12079. function isObject (obj) {
  12080. return obj !== null && typeof obj === 'object'
  12081. }
  12082. /**
  12083. * Get the raw type string of a value, e.g., [object Object].
  12084. */
  12085. var _toString = Object.prototype.toString;
  12086. function toRawType (value) {
  12087. return _toString.call(value).slice(8, -1)
  12088. }
  12089. /**
  12090. * Strict object type check. Only returns true
  12091. * for plain JavaScript objects.
  12092. */
  12093. function isPlainObject (obj) {
  12094. return _toString.call(obj) === '[object Object]'
  12095. }
  12096. function isRegExp (v) {
  12097. return _toString.call(v) === '[object RegExp]'
  12098. }
  12099. /**
  12100. * Check if val is a valid array index.
  12101. */
  12102. function isValidArrayIndex (val) {
  12103. var n = parseFloat(String(val));
  12104. return n >= 0 && Math.floor(n) === n && isFinite(val)
  12105. }
  12106. function isPromise (val) {
  12107. return (
  12108. isDef(val) &&
  12109. typeof val.then === 'function' &&
  12110. typeof val.catch === 'function'
  12111. )
  12112. }
  12113. /**
  12114. * Convert a value to a string that is actually rendered.
  12115. */
  12116. function toString (val) {
  12117. return val == null
  12118. ? ''
  12119. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  12120. ? JSON.stringify(val, null, 2)
  12121. : String(val)
  12122. }
  12123. /**
  12124. * Convert an input value to a number for persistence.
  12125. * If the conversion fails, return original string.
  12126. */
  12127. function toNumber (val) {
  12128. var n = parseFloat(val);
  12129. return isNaN(n) ? val : n
  12130. }
  12131. /**
  12132. * Make a map and return a function for checking if a key
  12133. * is in that map.
  12134. */
  12135. function makeMap (
  12136. str,
  12137. expectsLowerCase
  12138. ) {
  12139. var map = Object.create(null);
  12140. var list = str.split(',');
  12141. for (var i = 0; i < list.length; i++) {
  12142. map[list[i]] = true;
  12143. }
  12144. return expectsLowerCase
  12145. ? function (val) { return map[val.toLowerCase()]; }
  12146. : function (val) { return map[val]; }
  12147. }
  12148. /**
  12149. * Check if a tag is a built-in tag.
  12150. */
  12151. var isBuiltInTag = makeMap('slot,component', true);
  12152. /**
  12153. * Check if an attribute is a reserved attribute.
  12154. */
  12155. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  12156. /**
  12157. * Remove an item from an array.
  12158. */
  12159. function remove (arr, item) {
  12160. if (arr.length) {
  12161. var index = arr.indexOf(item);
  12162. if (index > -1) {
  12163. return arr.splice(index, 1)
  12164. }
  12165. }
  12166. }
  12167. /**
  12168. * Check whether an object has the property.
  12169. */
  12170. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12171. function hasOwn (obj, key) {
  12172. return hasOwnProperty.call(obj, key)
  12173. }
  12174. /**
  12175. * Create a cached version of a pure function.
  12176. */
  12177. function cached (fn) {
  12178. var cache = Object.create(null);
  12179. return (function cachedFn (str) {
  12180. var hit = cache[str];
  12181. return hit || (cache[str] = fn(str))
  12182. })
  12183. }
  12184. /**
  12185. * Camelize a hyphen-delimited string.
  12186. */
  12187. var camelizeRE = /-(\w)/g;
  12188. var camelize = cached(function (str) {
  12189. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  12190. });
  12191. /**
  12192. * Capitalize a string.
  12193. */
  12194. var capitalize = cached(function (str) {
  12195. return str.charAt(0).toUpperCase() + str.slice(1)
  12196. });
  12197. /**
  12198. * Hyphenate a camelCase string.
  12199. */
  12200. var hyphenateRE = /\B([A-Z])/g;
  12201. var hyphenate = cached(function (str) {
  12202. return str.replace(hyphenateRE, '-$1').toLowerCase()
  12203. });
  12204. /**
  12205. * Simple bind polyfill for environments that do not support it,
  12206. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  12207. * since native bind is now performant enough in most browsers.
  12208. * But removing it would mean breaking code that was able to run in
  12209. * PhantomJS 1.x, so this must be kept for backward compatibility.
  12210. */
  12211. /* istanbul ignore next */
  12212. function polyfillBind (fn, ctx) {
  12213. function boundFn (a) {
  12214. var l = arguments.length;
  12215. return l
  12216. ? l > 1
  12217. ? fn.apply(ctx, arguments)
  12218. : fn.call(ctx, a)
  12219. : fn.call(ctx)
  12220. }
  12221. boundFn._length = fn.length;
  12222. return boundFn
  12223. }
  12224. function nativeBind (fn, ctx) {
  12225. return fn.bind(ctx)
  12226. }
  12227. var bind = Function.prototype.bind
  12228. ? nativeBind
  12229. : polyfillBind;
  12230. /**
  12231. * Convert an Array-like object to a real Array.
  12232. */
  12233. function toArray (list, start) {
  12234. start = start || 0;
  12235. var i = list.length - start;
  12236. var ret = new Array(i);
  12237. while (i--) {
  12238. ret[i] = list[i + start];
  12239. }
  12240. return ret
  12241. }
  12242. /**
  12243. * Mix properties into target object.
  12244. */
  12245. function extend (to, _from) {
  12246. for (var key in _from) {
  12247. to[key] = _from[key];
  12248. }
  12249. return to
  12250. }
  12251. /**
  12252. * Merge an Array of Objects into a single Object.
  12253. */
  12254. function toObject (arr) {
  12255. var res = {};
  12256. for (var i = 0; i < arr.length; i++) {
  12257. if (arr[i]) {
  12258. extend(res, arr[i]);
  12259. }
  12260. }
  12261. return res
  12262. }
  12263. /* eslint-disable no-unused-vars */
  12264. /**
  12265. * Perform no operation.
  12266. * Stubbing args to make Flow happy without leaving useless transpiled code
  12267. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  12268. */
  12269. function noop (a, b, c) {}
  12270. /**
  12271. * Always return false.
  12272. */
  12273. var no = function (a, b, c) { return false; };
  12274. /* eslint-enable no-unused-vars */
  12275. /**
  12276. * Return the same value.
  12277. */
  12278. var identity = function (_) { return _; };
  12279. /**
  12280. * Check if two values are loosely equal - that is,
  12281. * if they are plain objects, do they have the same shape?
  12282. */
  12283. function looseEqual (a, b) {
  12284. if (a === b) { return true }
  12285. var isObjectA = isObject(a);
  12286. var isObjectB = isObject(b);
  12287. if (isObjectA && isObjectB) {
  12288. try {
  12289. var isArrayA = Array.isArray(a);
  12290. var isArrayB = Array.isArray(b);
  12291. if (isArrayA && isArrayB) {
  12292. return a.length === b.length && a.every(function (e, i) {
  12293. return looseEqual(e, b[i])
  12294. })
  12295. } else if (a instanceof Date && b instanceof Date) {
  12296. return a.getTime() === b.getTime()
  12297. } else if (!isArrayA && !isArrayB) {
  12298. var keysA = Object.keys(a);
  12299. var keysB = Object.keys(b);
  12300. return keysA.length === keysB.length && keysA.every(function (key) {
  12301. return looseEqual(a[key], b[key])
  12302. })
  12303. } else {
  12304. /* istanbul ignore next */
  12305. return false
  12306. }
  12307. } catch (e) {
  12308. /* istanbul ignore next */
  12309. return false
  12310. }
  12311. } else if (!isObjectA && !isObjectB) {
  12312. return String(a) === String(b)
  12313. } else {
  12314. return false
  12315. }
  12316. }
  12317. /**
  12318. * Return the first index at which a loosely equal value can be
  12319. * found in the array (if value is a plain object, the array must
  12320. * contain an object of the same shape), or -1 if it is not present.
  12321. */
  12322. function looseIndexOf (arr, val) {
  12323. for (var i = 0; i < arr.length; i++) {
  12324. if (looseEqual(arr[i], val)) { return i }
  12325. }
  12326. return -1
  12327. }
  12328. /**
  12329. * Ensure a function is called only once.
  12330. */
  12331. function once (fn) {
  12332. var called = false;
  12333. return function () {
  12334. if (!called) {
  12335. called = true;
  12336. fn.apply(this, arguments);
  12337. }
  12338. }
  12339. }
  12340. var ASSET_TYPES = [
  12341. 'component',
  12342. 'directive',
  12343. 'filter'
  12344. ];
  12345. var LIFECYCLE_HOOKS = [
  12346. 'beforeCreate',
  12347. 'created',
  12348. 'beforeMount',
  12349. 'mounted',
  12350. 'beforeUpdate',
  12351. 'updated',
  12352. 'beforeDestroy',
  12353. 'destroyed',
  12354. 'activated',
  12355. 'deactivated',
  12356. 'errorCaptured',
  12357. 'serverPrefetch'
  12358. ];
  12359. /* */
  12360. var config = ({
  12361. /**
  12362. * Option merge strategies (used in core/util/options)
  12363. */
  12364. // $flow-disable-line
  12365. optionMergeStrategies: Object.create(null),
  12366. /**
  12367. * Whether to suppress warnings.
  12368. */
  12369. silent: false,
  12370. /**
  12371. * Show production mode tip message on boot?
  12372. */
  12373. productionTip: "development" !== 'production',
  12374. /**
  12375. * Whether to enable devtools
  12376. */
  12377. devtools: "development" !== 'production',
  12378. /**
  12379. * Whether to record perf
  12380. */
  12381. performance: false,
  12382. /**
  12383. * Error handler for watcher errors
  12384. */
  12385. errorHandler: null,
  12386. /**
  12387. * Warn handler for watcher warns
  12388. */
  12389. warnHandler: null,
  12390. /**
  12391. * Ignore certain custom elements
  12392. */
  12393. ignoredElements: [],
  12394. /**
  12395. * Custom user key aliases for v-on
  12396. */
  12397. // $flow-disable-line
  12398. keyCodes: Object.create(null),
  12399. /**
  12400. * Check if a tag is reserved so that it cannot be registered as a
  12401. * component. This is platform-dependent and may be overwritten.
  12402. */
  12403. isReservedTag: no,
  12404. /**
  12405. * Check if an attribute is reserved so that it cannot be used as a component
  12406. * prop. This is platform-dependent and may be overwritten.
  12407. */
  12408. isReservedAttr: no,
  12409. /**
  12410. * Check if a tag is an unknown element.
  12411. * Platform-dependent.
  12412. */
  12413. isUnknownElement: no,
  12414. /**
  12415. * Get the namespace of an element
  12416. */
  12417. getTagNamespace: noop,
  12418. /**
  12419. * Parse the real tag name for the specific platform.
  12420. */
  12421. parsePlatformTagName: identity,
  12422. /**
  12423. * Check if an attribute must be bound using property, e.g. value
  12424. * Platform-dependent.
  12425. */
  12426. mustUseProp: no,
  12427. /**
  12428. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  12429. * This will significantly reduce performance if set to false.
  12430. */
  12431. async: true,
  12432. /**
  12433. * Exposed for legacy reasons
  12434. */
  12435. _lifecycleHooks: LIFECYCLE_HOOKS
  12436. });
  12437. /* */
  12438. /**
  12439. * unicode letters used for parsing html tags, component names and property paths.
  12440. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  12441. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  12442. */
  12443. 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/;
  12444. /**
  12445. * Check if a string starts with $ or _
  12446. */
  12447. function isReserved (str) {
  12448. var c = (str + '').charCodeAt(0);
  12449. return c === 0x24 || c === 0x5F
  12450. }
  12451. /**
  12452. * Define a property.
  12453. */
  12454. function def (obj, key, val, enumerable) {
  12455. Object.defineProperty(obj, key, {
  12456. value: val,
  12457. enumerable: !!enumerable,
  12458. writable: true,
  12459. configurable: true
  12460. });
  12461. }
  12462. /**
  12463. * Parse simple path.
  12464. */
  12465. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  12466. function parsePath (path) {
  12467. if (bailRE.test(path)) {
  12468. return
  12469. }
  12470. var segments = path.split('.');
  12471. return function (obj) {
  12472. for (var i = 0; i < segments.length; i++) {
  12473. if (!obj) { return }
  12474. obj = obj[segments[i]];
  12475. }
  12476. return obj
  12477. }
  12478. }
  12479. /* */
  12480. // can we use __proto__?
  12481. var hasProto = '__proto__' in {};
  12482. // Browser environment sniffing
  12483. var inBrowser = typeof window !== 'undefined';
  12484. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  12485. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  12486. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  12487. var isIE = UA && /msie|trident/.test(UA);
  12488. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12489. var isEdge = UA && UA.indexOf('edge/') > 0;
  12490. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  12491. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  12492. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  12493. var isPhantomJS = UA && /phantomjs/.test(UA);
  12494. var isFF = UA && UA.match(/firefox\/(\d+)/);
  12495. // Firefox has a "watch" function on Object.prototype...
  12496. var nativeWatch = ({}).watch;
  12497. if (inBrowser) {
  12498. try {
  12499. var opts = {};
  12500. Object.defineProperty(opts, 'passive', ({
  12501. get: function get () {
  12502. }
  12503. })); // https://github.com/facebook/flow/issues/285
  12504. window.addEventListener('test-passive', null, opts);
  12505. } catch (e) {}
  12506. }
  12507. // this needs to be lazy-evaled because vue may be required before
  12508. // vue-server-renderer can set VUE_ENV
  12509. var _isServer;
  12510. var isServerRendering = function () {
  12511. if (_isServer === undefined) {
  12512. /* istanbul ignore if */
  12513. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  12514. // detect presence of vue-server-renderer and avoid
  12515. // Webpack shimming the process
  12516. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  12517. } else {
  12518. _isServer = false;
  12519. }
  12520. }
  12521. return _isServer
  12522. };
  12523. // detect devtools
  12524. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12525. /* istanbul ignore next */
  12526. function isNative (Ctor) {
  12527. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  12528. }
  12529. var hasSymbol =
  12530. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  12531. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  12532. var _Set;
  12533. /* istanbul ignore if */ // $flow-disable-line
  12534. if (typeof Set !== 'undefined' && isNative(Set)) {
  12535. // use native Set when available.
  12536. _Set = Set;
  12537. } else {
  12538. // a non-standard Set polyfill that only works with primitive keys.
  12539. _Set = /*@__PURE__*/(function () {
  12540. function Set () {
  12541. this.set = Object.create(null);
  12542. }
  12543. Set.prototype.has = function has (key) {
  12544. return this.set[key] === true
  12545. };
  12546. Set.prototype.add = function add (key) {
  12547. this.set[key] = true;
  12548. };
  12549. Set.prototype.clear = function clear () {
  12550. this.set = Object.create(null);
  12551. };
  12552. return Set;
  12553. }());
  12554. }
  12555. /* */
  12556. var warn = noop;
  12557. var tip = noop;
  12558. var generateComponentTrace = (noop); // work around flow check
  12559. var formatComponentName = (noop);
  12560. if (true) {
  12561. var hasConsole = typeof console !== 'undefined';
  12562. var classifyRE = /(?:^|[-_])(\w)/g;
  12563. var classify = function (str) { return str
  12564. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  12565. .replace(/[-_]/g, ''); };
  12566. warn = function (msg, vm) {
  12567. var trace = vm ? generateComponentTrace(vm) : '';
  12568. if (config.warnHandler) {
  12569. config.warnHandler.call(null, msg, vm, trace);
  12570. } else if (hasConsole && (!config.silent)) {
  12571. console.error(("[Vue warn]: " + msg + trace));
  12572. }
  12573. };
  12574. tip = function (msg, vm) {
  12575. if (hasConsole && (!config.silent)) {
  12576. console.warn("[Vue tip]: " + msg + (
  12577. vm ? generateComponentTrace(vm) : ''
  12578. ));
  12579. }
  12580. };
  12581. formatComponentName = function (vm, includeFile) {
  12582. if (vm.$root === vm) {
  12583. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  12584. return ('') + vm.$options.__file
  12585. }
  12586. return '<Root>'
  12587. }
  12588. var options = typeof vm === 'function' && vm.cid != null
  12589. ? vm.options
  12590. : vm._isVue
  12591. ? vm.$options || vm.constructor.options
  12592. : vm;
  12593. var name = options.name || options._componentTag;
  12594. var file = options.__file;
  12595. if (!name && file) {
  12596. var match = file.match(/([^/\\]+)\.vue$/);
  12597. name = match && match[1];
  12598. }
  12599. return (
  12600. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  12601. (file && includeFile !== false ? (" at " + file) : '')
  12602. )
  12603. };
  12604. var repeat = function (str, n) {
  12605. var res = '';
  12606. while (n) {
  12607. if (n % 2 === 1) { res += str; }
  12608. if (n > 1) { str += str; }
  12609. n >>= 1;
  12610. }
  12611. return res
  12612. };
  12613. generateComponentTrace = function (vm) {
  12614. if (vm._isVue && vm.$parent) {
  12615. var tree = [];
  12616. var currentRecursiveSequence = 0;
  12617. while (vm && vm.$options.name !== 'PageBody') {
  12618. if (tree.length > 0) {
  12619. var last = tree[tree.length - 1];
  12620. if (last.constructor === vm.constructor) {
  12621. currentRecursiveSequence++;
  12622. vm = vm.$parent;
  12623. continue
  12624. } else if (currentRecursiveSequence > 0) {
  12625. tree[tree.length - 1] = [last, currentRecursiveSequence];
  12626. currentRecursiveSequence = 0;
  12627. }
  12628. }
  12629. !vm.$options.isReserved && tree.push(vm);
  12630. vm = vm.$parent;
  12631. }
  12632. return '\n\nfound in\n\n' + tree
  12633. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  12634. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  12635. : formatComponentName(vm))); })
  12636. .join('\n')
  12637. } else {
  12638. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  12639. }
  12640. };
  12641. }
  12642. /* */
  12643. var uid = 0;
  12644. /**
  12645. * A dep is an observable that can have multiple
  12646. * directives subscribing to it.
  12647. */
  12648. var Dep = function Dep () {
  12649. this.id = uid++;
  12650. this.subs = [];
  12651. };
  12652. Dep.prototype.addSub = function addSub (sub) {
  12653. this.subs.push(sub);
  12654. };
  12655. Dep.prototype.removeSub = function removeSub (sub) {
  12656. remove(this.subs, sub);
  12657. };
  12658. Dep.prototype.depend = function depend () {
  12659. if (Dep.SharedObject.target) {
  12660. Dep.SharedObject.target.addDep(this);
  12661. }
  12662. };
  12663. Dep.prototype.notify = function notify () {
  12664. // stabilize the subscriber list first
  12665. var subs = this.subs.slice();
  12666. if ( true && !config.async) {
  12667. // subs aren't sorted in scheduler if not running async
  12668. // we need to sort them now to make sure they fire in correct
  12669. // order
  12670. subs.sort(function (a, b) { return a.id - b.id; });
  12671. }
  12672. for (var i = 0, l = subs.length; i < l; i++) {
  12673. subs[i].update();
  12674. }
  12675. };
  12676. // The current target watcher being evaluated.
  12677. // This is globally unique because only one watcher
  12678. // can be evaluated at a time.
  12679. // fixed by xxxxxx (nvue shared vuex)
  12680. /* eslint-disable no-undef */
  12681. Dep.SharedObject = {};
  12682. Dep.SharedObject.target = null;
  12683. Dep.SharedObject.targetStack = [];
  12684. function pushTarget (target) {
  12685. Dep.SharedObject.targetStack.push(target);
  12686. Dep.SharedObject.target = target;
  12687. Dep.target = target;
  12688. }
  12689. function popTarget () {
  12690. Dep.SharedObject.targetStack.pop();
  12691. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  12692. Dep.target = Dep.SharedObject.target;
  12693. }
  12694. /* */
  12695. var VNode = function VNode (
  12696. tag,
  12697. data,
  12698. children,
  12699. text,
  12700. elm,
  12701. context,
  12702. componentOptions,
  12703. asyncFactory
  12704. ) {
  12705. this.tag = tag;
  12706. this.data = data;
  12707. this.children = children;
  12708. this.text = text;
  12709. this.elm = elm;
  12710. this.ns = undefined;
  12711. this.context = context;
  12712. this.fnContext = undefined;
  12713. this.fnOptions = undefined;
  12714. this.fnScopeId = undefined;
  12715. this.key = data && data.key;
  12716. this.componentOptions = componentOptions;
  12717. this.componentInstance = undefined;
  12718. this.parent = undefined;
  12719. this.raw = false;
  12720. this.isStatic = false;
  12721. this.isRootInsert = true;
  12722. this.isComment = false;
  12723. this.isCloned = false;
  12724. this.isOnce = false;
  12725. this.asyncFactory = asyncFactory;
  12726. this.asyncMeta = undefined;
  12727. this.isAsyncPlaceholder = false;
  12728. };
  12729. var prototypeAccessors = { child: { configurable: true } };
  12730. // DEPRECATED: alias for componentInstance for backwards compat.
  12731. /* istanbul ignore next */
  12732. prototypeAccessors.child.get = function () {
  12733. return this.componentInstance
  12734. };
  12735. Object.defineProperties( VNode.prototype, prototypeAccessors );
  12736. var createEmptyVNode = function (text) {
  12737. if ( text === void 0 ) text = '';
  12738. var node = new VNode();
  12739. node.text = text;
  12740. node.isComment = true;
  12741. return node
  12742. };
  12743. function createTextVNode (val) {
  12744. return new VNode(undefined, undefined, undefined, String(val))
  12745. }
  12746. // optimized shallow clone
  12747. // used for static nodes and slot nodes because they may be reused across
  12748. // multiple renders, cloning them avoids errors when DOM manipulations rely
  12749. // on their elm reference.
  12750. function cloneVNode (vnode) {
  12751. var cloned = new VNode(
  12752. vnode.tag,
  12753. vnode.data,
  12754. // #7975
  12755. // clone children array to avoid mutating original in case of cloning
  12756. // a child.
  12757. vnode.children && vnode.children.slice(),
  12758. vnode.text,
  12759. vnode.elm,
  12760. vnode.context,
  12761. vnode.componentOptions,
  12762. vnode.asyncFactory
  12763. );
  12764. cloned.ns = vnode.ns;
  12765. cloned.isStatic = vnode.isStatic;
  12766. cloned.key = vnode.key;
  12767. cloned.isComment = vnode.isComment;
  12768. cloned.fnContext = vnode.fnContext;
  12769. cloned.fnOptions = vnode.fnOptions;
  12770. cloned.fnScopeId = vnode.fnScopeId;
  12771. cloned.asyncMeta = vnode.asyncMeta;
  12772. cloned.isCloned = true;
  12773. return cloned
  12774. }
  12775. /*
  12776. * not type checking this file because flow doesn't play well with
  12777. * dynamically accessing methods on Array prototype
  12778. */
  12779. var arrayProto = Array.prototype;
  12780. var arrayMethods = Object.create(arrayProto);
  12781. var methodsToPatch = [
  12782. 'push',
  12783. 'pop',
  12784. 'shift',
  12785. 'unshift',
  12786. 'splice',
  12787. 'sort',
  12788. 'reverse'
  12789. ];
  12790. /**
  12791. * Intercept mutating methods and emit events
  12792. */
  12793. methodsToPatch.forEach(function (method) {
  12794. // cache original method
  12795. var original = arrayProto[method];
  12796. def(arrayMethods, method, function mutator () {
  12797. var args = [], len = arguments.length;
  12798. while ( len-- ) args[ len ] = arguments[ len ];
  12799. var result = original.apply(this, args);
  12800. var ob = this.__ob__;
  12801. var inserted;
  12802. switch (method) {
  12803. case 'push':
  12804. case 'unshift':
  12805. inserted = args;
  12806. break
  12807. case 'splice':
  12808. inserted = args.slice(2);
  12809. break
  12810. }
  12811. if (inserted) { ob.observeArray(inserted); }
  12812. // notify change
  12813. ob.dep.notify();
  12814. return result
  12815. });
  12816. });
  12817. /* */
  12818. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  12819. /**
  12820. * In some cases we may want to disable observation inside a component's
  12821. * update computation.
  12822. */
  12823. var shouldObserve = true;
  12824. function toggleObserving (value) {
  12825. shouldObserve = value;
  12826. }
  12827. /**
  12828. * Observer class that is attached to each observed
  12829. * object. Once attached, the observer converts the target
  12830. * object's property keys into getter/setters that
  12831. * collect dependencies and dispatch updates.
  12832. */
  12833. var Observer = function Observer (value) {
  12834. this.value = value;
  12835. this.dep = new Dep();
  12836. this.vmCount = 0;
  12837. def(value, '__ob__', this);
  12838. if (Array.isArray(value)) {
  12839. if (hasProto) {
  12840. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  12841. if(value.push !== value.__proto__.push){
  12842. copyAugment(value, arrayMethods, arrayKeys);
  12843. } else {
  12844. protoAugment(value, arrayMethods);
  12845. }
  12846. }
  12847. } else {
  12848. copyAugment(value, arrayMethods, arrayKeys);
  12849. }
  12850. this.observeArray(value);
  12851. } else {
  12852. this.walk(value);
  12853. }
  12854. };
  12855. /**
  12856. * Walk through all properties and convert them into
  12857. * getter/setters. This method should only be called when
  12858. * value type is Object.
  12859. */
  12860. Observer.prototype.walk = function walk (obj) {
  12861. var keys = Object.keys(obj);
  12862. for (var i = 0; i < keys.length; i++) {
  12863. defineReactive$$1(obj, keys[i]);
  12864. }
  12865. };
  12866. /**
  12867. * Observe a list of Array items.
  12868. */
  12869. Observer.prototype.observeArray = function observeArray (items) {
  12870. for (var i = 0, l = items.length; i < l; i++) {
  12871. observe(items[i]);
  12872. }
  12873. };
  12874. // helpers
  12875. /**
  12876. * Augment a target Object or Array by intercepting
  12877. * the prototype chain using __proto__
  12878. */
  12879. function protoAugment (target, src) {
  12880. /* eslint-disable no-proto */
  12881. target.__proto__ = src;
  12882. /* eslint-enable no-proto */
  12883. }
  12884. /**
  12885. * Augment a target Object or Array by defining
  12886. * hidden properties.
  12887. */
  12888. /* istanbul ignore next */
  12889. function copyAugment (target, src, keys) {
  12890. for (var i = 0, l = keys.length; i < l; i++) {
  12891. var key = keys[i];
  12892. def(target, key, src[key]);
  12893. }
  12894. }
  12895. /**
  12896. * Attempt to create an observer instance for a value,
  12897. * returns the new observer if successfully observed,
  12898. * or the existing observer if the value already has one.
  12899. */
  12900. function observe (value, asRootData) {
  12901. if (!isObject(value) || value instanceof VNode) {
  12902. return
  12903. }
  12904. var ob;
  12905. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  12906. ob = value.__ob__;
  12907. } else if (
  12908. shouldObserve &&
  12909. !isServerRendering() &&
  12910. (Array.isArray(value) || isPlainObject(value)) &&
  12911. Object.isExtensible(value) &&
  12912. !value._isVue &&
  12913. !value.__v_isMPComponent
  12914. ) {
  12915. ob = new Observer(value);
  12916. }
  12917. if (asRootData && ob) {
  12918. ob.vmCount++;
  12919. }
  12920. return ob
  12921. }
  12922. /**
  12923. * Define a reactive property on an Object.
  12924. */
  12925. function defineReactive$$1 (
  12926. obj,
  12927. key,
  12928. val,
  12929. customSetter,
  12930. shallow
  12931. ) {
  12932. var dep = new Dep();
  12933. var property = Object.getOwnPropertyDescriptor(obj, key);
  12934. if (property && property.configurable === false) {
  12935. return
  12936. }
  12937. // cater for pre-defined getter/setters
  12938. var getter = property && property.get;
  12939. var setter = property && property.set;
  12940. if ((!getter || setter) && arguments.length === 2) {
  12941. val = obj[key];
  12942. }
  12943. var childOb = !shallow && observe(val);
  12944. Object.defineProperty(obj, key, {
  12945. enumerable: true,
  12946. configurable: true,
  12947. get: function reactiveGetter () {
  12948. var value = getter ? getter.call(obj) : val;
  12949. if (Dep.SharedObject.target) { // fixed by xxxxxx
  12950. dep.depend();
  12951. if (childOb) {
  12952. childOb.dep.depend();
  12953. if (Array.isArray(value)) {
  12954. dependArray(value);
  12955. }
  12956. }
  12957. }
  12958. return value
  12959. },
  12960. set: function reactiveSetter (newVal) {
  12961. var value = getter ? getter.call(obj) : val;
  12962. /* eslint-disable no-self-compare */
  12963. if (newVal === value || (newVal !== newVal && value !== value)) {
  12964. return
  12965. }
  12966. /* eslint-enable no-self-compare */
  12967. if ( true && customSetter) {
  12968. customSetter();
  12969. }
  12970. // #7981: for accessor properties without setter
  12971. if (getter && !setter) { return }
  12972. if (setter) {
  12973. setter.call(obj, newVal);
  12974. } else {
  12975. val = newVal;
  12976. }
  12977. childOb = !shallow && observe(newVal);
  12978. dep.notify();
  12979. }
  12980. });
  12981. }
  12982. /**
  12983. * Set a property on an object. Adds the new property and
  12984. * triggers change notification if the property doesn't
  12985. * already exist.
  12986. */
  12987. function set (target, key, val) {
  12988. if ( true &&
  12989. (isUndef(target) || isPrimitive(target))
  12990. ) {
  12991. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  12992. }
  12993. if (Array.isArray(target) && isValidArrayIndex(key)) {
  12994. target.length = Math.max(target.length, key);
  12995. target.splice(key, 1, val);
  12996. return val
  12997. }
  12998. if (key in target && !(key in Object.prototype)) {
  12999. target[key] = val;
  13000. return val
  13001. }
  13002. var ob = (target).__ob__;
  13003. if (target._isVue || (ob && ob.vmCount)) {
  13004. true && warn(
  13005. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  13006. 'at runtime - declare it upfront in the data option.'
  13007. );
  13008. return val
  13009. }
  13010. if (!ob) {
  13011. target[key] = val;
  13012. return val
  13013. }
  13014. defineReactive$$1(ob.value, key, val);
  13015. ob.dep.notify();
  13016. return val
  13017. }
  13018. /**
  13019. * Delete a property and trigger change if necessary.
  13020. */
  13021. function del (target, key) {
  13022. if ( true &&
  13023. (isUndef(target) || isPrimitive(target))
  13024. ) {
  13025. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  13026. }
  13027. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13028. target.splice(key, 1);
  13029. return
  13030. }
  13031. var ob = (target).__ob__;
  13032. if (target._isVue || (ob && ob.vmCount)) {
  13033. true && warn(
  13034. 'Avoid deleting properties on a Vue instance or its root $data ' +
  13035. '- just set it to null.'
  13036. );
  13037. return
  13038. }
  13039. if (!hasOwn(target, key)) {
  13040. return
  13041. }
  13042. delete target[key];
  13043. if (!ob) {
  13044. return
  13045. }
  13046. ob.dep.notify();
  13047. }
  13048. /**
  13049. * Collect dependencies on array elements when the array is touched, since
  13050. * we cannot intercept array element access like property getters.
  13051. */
  13052. function dependArray (value) {
  13053. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  13054. e = value[i];
  13055. e && e.__ob__ && e.__ob__.dep.depend();
  13056. if (Array.isArray(e)) {
  13057. dependArray(e);
  13058. }
  13059. }
  13060. }
  13061. /* */
  13062. /**
  13063. * Option overwriting strategies are functions that handle
  13064. * how to merge a parent option value and a child option
  13065. * value into the final value.
  13066. */
  13067. var strats = config.optionMergeStrategies;
  13068. /**
  13069. * Options with restrictions
  13070. */
  13071. if (true) {
  13072. strats.el = strats.propsData = function (parent, child, vm, key) {
  13073. if (!vm) {
  13074. warn(
  13075. "option \"" + key + "\" can only be used during instance " +
  13076. 'creation with the `new` keyword.'
  13077. );
  13078. }
  13079. return defaultStrat(parent, child)
  13080. };
  13081. }
  13082. /**
  13083. * Helper that recursively merges two data objects together.
  13084. */
  13085. function mergeData (to, from) {
  13086. if (!from) { return to }
  13087. var key, toVal, fromVal;
  13088. var keys = hasSymbol
  13089. ? Reflect.ownKeys(from)
  13090. : Object.keys(from);
  13091. for (var i = 0; i < keys.length; i++) {
  13092. key = keys[i];
  13093. // in case the object is already observed...
  13094. if (key === '__ob__') { continue }
  13095. toVal = to[key];
  13096. fromVal = from[key];
  13097. if (!hasOwn(to, key)) {
  13098. set(to, key, fromVal);
  13099. } else if (
  13100. toVal !== fromVal &&
  13101. isPlainObject(toVal) &&
  13102. isPlainObject(fromVal)
  13103. ) {
  13104. mergeData(toVal, fromVal);
  13105. }
  13106. }
  13107. return to
  13108. }
  13109. /**
  13110. * Data
  13111. */
  13112. function mergeDataOrFn (
  13113. parentVal,
  13114. childVal,
  13115. vm
  13116. ) {
  13117. if (!vm) {
  13118. // in a Vue.extend merge, both should be functions
  13119. if (!childVal) {
  13120. return parentVal
  13121. }
  13122. if (!parentVal) {
  13123. return childVal
  13124. }
  13125. // when parentVal & childVal are both present,
  13126. // we need to return a function that returns the
  13127. // merged result of both functions... no need to
  13128. // check if parentVal is a function here because
  13129. // it has to be a function to pass previous merges.
  13130. return function mergedDataFn () {
  13131. return mergeData(
  13132. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  13133. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  13134. )
  13135. }
  13136. } else {
  13137. return function mergedInstanceDataFn () {
  13138. // instance merge
  13139. var instanceData = typeof childVal === 'function'
  13140. ? childVal.call(vm, vm)
  13141. : childVal;
  13142. var defaultData = typeof parentVal === 'function'
  13143. ? parentVal.call(vm, vm)
  13144. : parentVal;
  13145. if (instanceData) {
  13146. return mergeData(instanceData, defaultData)
  13147. } else {
  13148. return defaultData
  13149. }
  13150. }
  13151. }
  13152. }
  13153. strats.data = function (
  13154. parentVal,
  13155. childVal,
  13156. vm
  13157. ) {
  13158. if (!vm) {
  13159. if (childVal && typeof childVal !== 'function') {
  13160. true && warn(
  13161. 'The "data" option should be a function ' +
  13162. 'that returns a per-instance value in component ' +
  13163. 'definitions.',
  13164. vm
  13165. );
  13166. return parentVal
  13167. }
  13168. return mergeDataOrFn(parentVal, childVal)
  13169. }
  13170. return mergeDataOrFn(parentVal, childVal, vm)
  13171. };
  13172. /**
  13173. * Hooks and props are merged as arrays.
  13174. */
  13175. function mergeHook (
  13176. parentVal,
  13177. childVal
  13178. ) {
  13179. var res = childVal
  13180. ? parentVal
  13181. ? parentVal.concat(childVal)
  13182. : Array.isArray(childVal)
  13183. ? childVal
  13184. : [childVal]
  13185. : parentVal;
  13186. return res
  13187. ? dedupeHooks(res)
  13188. : res
  13189. }
  13190. function dedupeHooks (hooks) {
  13191. var res = [];
  13192. for (var i = 0; i < hooks.length; i++) {
  13193. if (res.indexOf(hooks[i]) === -1) {
  13194. res.push(hooks[i]);
  13195. }
  13196. }
  13197. return res
  13198. }
  13199. LIFECYCLE_HOOKS.forEach(function (hook) {
  13200. strats[hook] = mergeHook;
  13201. });
  13202. /**
  13203. * Assets
  13204. *
  13205. * When a vm is present (instance creation), we need to do
  13206. * a three-way merge between constructor options, instance
  13207. * options and parent options.
  13208. */
  13209. function mergeAssets (
  13210. parentVal,
  13211. childVal,
  13212. vm,
  13213. key
  13214. ) {
  13215. var res = Object.create(parentVal || null);
  13216. if (childVal) {
  13217. true && assertObjectType(key, childVal, vm);
  13218. return extend(res, childVal)
  13219. } else {
  13220. return res
  13221. }
  13222. }
  13223. ASSET_TYPES.forEach(function (type) {
  13224. strats[type + 's'] = mergeAssets;
  13225. });
  13226. /**
  13227. * Watchers.
  13228. *
  13229. * Watchers hashes should not overwrite one
  13230. * another, so we merge them as arrays.
  13231. */
  13232. strats.watch = function (
  13233. parentVal,
  13234. childVal,
  13235. vm,
  13236. key
  13237. ) {
  13238. // work around Firefox's Object.prototype.watch...
  13239. if (parentVal === nativeWatch) { parentVal = undefined; }
  13240. if (childVal === nativeWatch) { childVal = undefined; }
  13241. /* istanbul ignore if */
  13242. if (!childVal) { return Object.create(parentVal || null) }
  13243. if (true) {
  13244. assertObjectType(key, childVal, vm);
  13245. }
  13246. if (!parentVal) { return childVal }
  13247. var ret = {};
  13248. extend(ret, parentVal);
  13249. for (var key$1 in childVal) {
  13250. var parent = ret[key$1];
  13251. var child = childVal[key$1];
  13252. if (parent && !Array.isArray(parent)) {
  13253. parent = [parent];
  13254. }
  13255. ret[key$1] = parent
  13256. ? parent.concat(child)
  13257. : Array.isArray(child) ? child : [child];
  13258. }
  13259. return ret
  13260. };
  13261. /**
  13262. * Other object hashes.
  13263. */
  13264. strats.props =
  13265. strats.methods =
  13266. strats.inject =
  13267. strats.computed = function (
  13268. parentVal,
  13269. childVal,
  13270. vm,
  13271. key
  13272. ) {
  13273. if (childVal && "development" !== 'production') {
  13274. assertObjectType(key, childVal, vm);
  13275. }
  13276. if (!parentVal) { return childVal }
  13277. var ret = Object.create(null);
  13278. extend(ret, parentVal);
  13279. if (childVal) { extend(ret, childVal); }
  13280. return ret
  13281. };
  13282. strats.provide = mergeDataOrFn;
  13283. /**
  13284. * Default strategy.
  13285. */
  13286. var defaultStrat = function (parentVal, childVal) {
  13287. return childVal === undefined
  13288. ? parentVal
  13289. : childVal
  13290. };
  13291. /**
  13292. * Validate component names
  13293. */
  13294. function checkComponents (options) {
  13295. for (var key in options.components) {
  13296. validateComponentName(key);
  13297. }
  13298. }
  13299. function validateComponentName (name) {
  13300. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  13301. warn(
  13302. 'Invalid component name: "' + name + '". Component names ' +
  13303. 'should conform to valid custom element name in html5 specification.'
  13304. );
  13305. }
  13306. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  13307. warn(
  13308. 'Do not use built-in or reserved HTML elements as component ' +
  13309. 'id: ' + name
  13310. );
  13311. }
  13312. }
  13313. /**
  13314. * Ensure all props option syntax are normalized into the
  13315. * Object-based format.
  13316. */
  13317. function normalizeProps (options, vm) {
  13318. var props = options.props;
  13319. if (!props) { return }
  13320. var res = {};
  13321. var i, val, name;
  13322. if (Array.isArray(props)) {
  13323. i = props.length;
  13324. while (i--) {
  13325. val = props[i];
  13326. if (typeof val === 'string') {
  13327. name = camelize(val);
  13328. res[name] = { type: null };
  13329. } else if (true) {
  13330. warn('props must be strings when using array syntax.');
  13331. }
  13332. }
  13333. } else if (isPlainObject(props)) {
  13334. for (var key in props) {
  13335. val = props[key];
  13336. name = camelize(key);
  13337. res[name] = isPlainObject(val)
  13338. ? val
  13339. : { type: val };
  13340. }
  13341. } else if (true) {
  13342. warn(
  13343. "Invalid value for option \"props\": expected an Array or an Object, " +
  13344. "but got " + (toRawType(props)) + ".",
  13345. vm
  13346. );
  13347. }
  13348. options.props = res;
  13349. }
  13350. /**
  13351. * Normalize all injections into Object-based format
  13352. */
  13353. function normalizeInject (options, vm) {
  13354. var inject = options.inject;
  13355. if (!inject) { return }
  13356. var normalized = options.inject = {};
  13357. if (Array.isArray(inject)) {
  13358. for (var i = 0; i < inject.length; i++) {
  13359. normalized[inject[i]] = { from: inject[i] };
  13360. }
  13361. } else if (isPlainObject(inject)) {
  13362. for (var key in inject) {
  13363. var val = inject[key];
  13364. normalized[key] = isPlainObject(val)
  13365. ? extend({ from: key }, val)
  13366. : { from: val };
  13367. }
  13368. } else if (true) {
  13369. warn(
  13370. "Invalid value for option \"inject\": expected an Array or an Object, " +
  13371. "but got " + (toRawType(inject)) + ".",
  13372. vm
  13373. );
  13374. }
  13375. }
  13376. /**
  13377. * Normalize raw function directives into object format.
  13378. */
  13379. function normalizeDirectives (options) {
  13380. var dirs = options.directives;
  13381. if (dirs) {
  13382. for (var key in dirs) {
  13383. var def$$1 = dirs[key];
  13384. if (typeof def$$1 === 'function') {
  13385. dirs[key] = { bind: def$$1, update: def$$1 };
  13386. }
  13387. }
  13388. }
  13389. }
  13390. function assertObjectType (name, value, vm) {
  13391. if (!isPlainObject(value)) {
  13392. warn(
  13393. "Invalid value for option \"" + name + "\": expected an Object, " +
  13394. "but got " + (toRawType(value)) + ".",
  13395. vm
  13396. );
  13397. }
  13398. }
  13399. /**
  13400. * Merge two option objects into a new one.
  13401. * Core utility used in both instantiation and inheritance.
  13402. */
  13403. function mergeOptions (
  13404. parent,
  13405. child,
  13406. vm
  13407. ) {
  13408. if (true) {
  13409. checkComponents(child);
  13410. }
  13411. if (typeof child === 'function') {
  13412. child = child.options;
  13413. }
  13414. normalizeProps(child, vm);
  13415. normalizeInject(child, vm);
  13416. normalizeDirectives(child);
  13417. // Apply extends and mixins on the child options,
  13418. // but only if it is a raw options object that isn't
  13419. // the result of another mergeOptions call.
  13420. // Only merged options has the _base property.
  13421. if (!child._base) {
  13422. if (child.extends) {
  13423. parent = mergeOptions(parent, child.extends, vm);
  13424. }
  13425. if (child.mixins) {
  13426. for (var i = 0, l = child.mixins.length; i < l; i++) {
  13427. parent = mergeOptions(parent, child.mixins[i], vm);
  13428. }
  13429. }
  13430. }
  13431. var options = {};
  13432. var key;
  13433. for (key in parent) {
  13434. mergeField(key);
  13435. }
  13436. for (key in child) {
  13437. if (!hasOwn(parent, key)) {
  13438. mergeField(key);
  13439. }
  13440. }
  13441. function mergeField (key) {
  13442. var strat = strats[key] || defaultStrat;
  13443. options[key] = strat(parent[key], child[key], vm, key);
  13444. }
  13445. return options
  13446. }
  13447. /**
  13448. * Resolve an asset.
  13449. * This function is used because child instances need access
  13450. * to assets defined in its ancestor chain.
  13451. */
  13452. function resolveAsset (
  13453. options,
  13454. type,
  13455. id,
  13456. warnMissing
  13457. ) {
  13458. /* istanbul ignore if */
  13459. if (typeof id !== 'string') {
  13460. return
  13461. }
  13462. var assets = options[type];
  13463. // check local registration variations first
  13464. if (hasOwn(assets, id)) { return assets[id] }
  13465. var camelizedId = camelize(id);
  13466. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  13467. var PascalCaseId = capitalize(camelizedId);
  13468. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  13469. // fallback to prototype chain
  13470. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  13471. if ( true && warnMissing && !res) {
  13472. warn(
  13473. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  13474. options
  13475. );
  13476. }
  13477. return res
  13478. }
  13479. /* */
  13480. function validateProp (
  13481. key,
  13482. propOptions,
  13483. propsData,
  13484. vm
  13485. ) {
  13486. var prop = propOptions[key];
  13487. var absent = !hasOwn(propsData, key);
  13488. var value = propsData[key];
  13489. // boolean casting
  13490. var booleanIndex = getTypeIndex(Boolean, prop.type);
  13491. if (booleanIndex > -1) {
  13492. if (absent && !hasOwn(prop, 'default')) {
  13493. value = false;
  13494. } else if (value === '' || value === hyphenate(key)) {
  13495. // only cast empty string / same name to boolean if
  13496. // boolean has higher priority
  13497. var stringIndex = getTypeIndex(String, prop.type);
  13498. if (stringIndex < 0 || booleanIndex < stringIndex) {
  13499. value = true;
  13500. }
  13501. }
  13502. }
  13503. // check default value
  13504. if (value === undefined) {
  13505. value = getPropDefaultValue(vm, prop, key);
  13506. // since the default value is a fresh copy,
  13507. // make sure to observe it.
  13508. var prevShouldObserve = shouldObserve;
  13509. toggleObserving(true);
  13510. observe(value);
  13511. toggleObserving(prevShouldObserve);
  13512. }
  13513. if (
  13514. true
  13515. ) {
  13516. assertProp(prop, key, value, vm, absent);
  13517. }
  13518. return value
  13519. }
  13520. /**
  13521. * Get the default value of a prop.
  13522. */
  13523. function getPropDefaultValue (vm, prop, key) {
  13524. // no default, return undefined
  13525. if (!hasOwn(prop, 'default')) {
  13526. return undefined
  13527. }
  13528. var def = prop.default;
  13529. // warn against non-factory defaults for Object & Array
  13530. if ( true && isObject(def)) {
  13531. warn(
  13532. 'Invalid default value for prop "' + key + '": ' +
  13533. 'Props with type Object/Array must use a factory function ' +
  13534. 'to return the default value.',
  13535. vm
  13536. );
  13537. }
  13538. // the raw prop value was also undefined from previous render,
  13539. // return previous default value to avoid unnecessary watcher trigger
  13540. if (vm && vm.$options.propsData &&
  13541. vm.$options.propsData[key] === undefined &&
  13542. vm._props[key] !== undefined
  13543. ) {
  13544. return vm._props[key]
  13545. }
  13546. // call factory function for non-Function types
  13547. // a value is Function if its prototype is function even across different execution context
  13548. return typeof def === 'function' && getType(prop.type) !== 'Function'
  13549. ? def.call(vm)
  13550. : def
  13551. }
  13552. /**
  13553. * Assert whether a prop is valid.
  13554. */
  13555. function assertProp (
  13556. prop,
  13557. name,
  13558. value,
  13559. vm,
  13560. absent
  13561. ) {
  13562. if (prop.required && absent) {
  13563. warn(
  13564. 'Missing required prop: "' + name + '"',
  13565. vm
  13566. );
  13567. return
  13568. }
  13569. if (value == null && !prop.required) {
  13570. return
  13571. }
  13572. var type = prop.type;
  13573. var valid = !type || type === true;
  13574. var expectedTypes = [];
  13575. if (type) {
  13576. if (!Array.isArray(type)) {
  13577. type = [type];
  13578. }
  13579. for (var i = 0; i < type.length && !valid; i++) {
  13580. var assertedType = assertType(value, type[i]);
  13581. expectedTypes.push(assertedType.expectedType || '');
  13582. valid = assertedType.valid;
  13583. }
  13584. }
  13585. if (!valid) {
  13586. warn(
  13587. getInvalidTypeMessage(name, value, expectedTypes),
  13588. vm
  13589. );
  13590. return
  13591. }
  13592. var validator = prop.validator;
  13593. if (validator) {
  13594. if (!validator(value)) {
  13595. warn(
  13596. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  13597. vm
  13598. );
  13599. }
  13600. }
  13601. }
  13602. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  13603. function assertType (value, type) {
  13604. var valid;
  13605. var expectedType = getType(type);
  13606. if (simpleCheckRE.test(expectedType)) {
  13607. var t = typeof value;
  13608. valid = t === expectedType.toLowerCase();
  13609. // for primitive wrapper objects
  13610. if (!valid && t === 'object') {
  13611. valid = value instanceof type;
  13612. }
  13613. } else if (expectedType === 'Object') {
  13614. valid = isPlainObject(value);
  13615. } else if (expectedType === 'Array') {
  13616. valid = Array.isArray(value);
  13617. } else {
  13618. valid = value instanceof type;
  13619. }
  13620. return {
  13621. valid: valid,
  13622. expectedType: expectedType
  13623. }
  13624. }
  13625. /**
  13626. * Use function string name to check built-in types,
  13627. * because a simple equality check will fail when running
  13628. * across different vms / iframes.
  13629. */
  13630. function getType (fn) {
  13631. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  13632. return match ? match[1] : ''
  13633. }
  13634. function isSameType (a, b) {
  13635. return getType(a) === getType(b)
  13636. }
  13637. function getTypeIndex (type, expectedTypes) {
  13638. if (!Array.isArray(expectedTypes)) {
  13639. return isSameType(expectedTypes, type) ? 0 : -1
  13640. }
  13641. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  13642. if (isSameType(expectedTypes[i], type)) {
  13643. return i
  13644. }
  13645. }
  13646. return -1
  13647. }
  13648. function getInvalidTypeMessage (name, value, expectedTypes) {
  13649. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  13650. " Expected " + (expectedTypes.map(capitalize).join(', '));
  13651. var expectedType = expectedTypes[0];
  13652. var receivedType = toRawType(value);
  13653. var expectedValue = styleValue(value, expectedType);
  13654. var receivedValue = styleValue(value, receivedType);
  13655. // check if we need to specify expected value
  13656. if (expectedTypes.length === 1 &&
  13657. isExplicable(expectedType) &&
  13658. !isBoolean(expectedType, receivedType)) {
  13659. message += " with value " + expectedValue;
  13660. }
  13661. message += ", got " + receivedType + " ";
  13662. // check if we need to specify received value
  13663. if (isExplicable(receivedType)) {
  13664. message += "with value " + receivedValue + ".";
  13665. }
  13666. return message
  13667. }
  13668. function styleValue (value, type) {
  13669. if (type === 'String') {
  13670. return ("\"" + value + "\"")
  13671. } else if (type === 'Number') {
  13672. return ("" + (Number(value)))
  13673. } else {
  13674. return ("" + value)
  13675. }
  13676. }
  13677. function isExplicable (value) {
  13678. var explicitTypes = ['string', 'number', 'boolean'];
  13679. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  13680. }
  13681. function isBoolean () {
  13682. var args = [], len = arguments.length;
  13683. while ( len-- ) args[ len ] = arguments[ len ];
  13684. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  13685. }
  13686. /* */
  13687. function handleError (err, vm, info) {
  13688. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  13689. // See: https://github.com/vuejs/vuex/issues/1505
  13690. pushTarget();
  13691. try {
  13692. if (vm) {
  13693. var cur = vm;
  13694. while ((cur = cur.$parent)) {
  13695. var hooks = cur.$options.errorCaptured;
  13696. if (hooks) {
  13697. for (var i = 0; i < hooks.length; i++) {
  13698. try {
  13699. var capture = hooks[i].call(cur, err, vm, info) === false;
  13700. if (capture) { return }
  13701. } catch (e) {
  13702. globalHandleError(e, cur, 'errorCaptured hook');
  13703. }
  13704. }
  13705. }
  13706. }
  13707. }
  13708. globalHandleError(err, vm, info);
  13709. } finally {
  13710. popTarget();
  13711. }
  13712. }
  13713. function invokeWithErrorHandling (
  13714. handler,
  13715. context,
  13716. args,
  13717. vm,
  13718. info
  13719. ) {
  13720. var res;
  13721. try {
  13722. res = args ? handler.apply(context, args) : handler.call(context);
  13723. if (res && !res._isVue && isPromise(res) && !res._handled) {
  13724. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  13725. // issue #9511
  13726. // avoid catch triggering multiple times when nested calls
  13727. res._handled = true;
  13728. }
  13729. } catch (e) {
  13730. handleError(e, vm, info);
  13731. }
  13732. return res
  13733. }
  13734. function globalHandleError (err, vm, info) {
  13735. if (config.errorHandler) {
  13736. try {
  13737. return config.errorHandler.call(null, err, vm, info)
  13738. } catch (e) {
  13739. // if the user intentionally throws the original error in the handler,
  13740. // do not log it twice
  13741. if (e !== err) {
  13742. logError(e, null, 'config.errorHandler');
  13743. }
  13744. }
  13745. }
  13746. logError(err, vm, info);
  13747. }
  13748. function logError (err, vm, info) {
  13749. if (true) {
  13750. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  13751. }
  13752. /* istanbul ignore else */
  13753. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  13754. console.error(err);
  13755. } else {
  13756. throw err
  13757. }
  13758. }
  13759. /* */
  13760. var callbacks = [];
  13761. var pending = false;
  13762. function flushCallbacks () {
  13763. pending = false;
  13764. var copies = callbacks.slice(0);
  13765. callbacks.length = 0;
  13766. for (var i = 0; i < copies.length; i++) {
  13767. copies[i]();
  13768. }
  13769. }
  13770. // Here we have async deferring wrappers using microtasks.
  13771. // In 2.5 we used (macro) tasks (in combination with microtasks).
  13772. // However, it has subtle problems when state is changed right before repaint
  13773. // (e.g. #6813, out-in transitions).
  13774. // Also, using (macro) tasks in event handler would cause some weird behaviors
  13775. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  13776. // So we now use microtasks everywhere, again.
  13777. // A major drawback of this tradeoff is that there are some scenarios
  13778. // where microtasks have too high a priority and fire in between supposedly
  13779. // sequential events (e.g. #4521, #6690, which have workarounds)
  13780. // or even between bubbling of the same event (#6566).
  13781. var timerFunc;
  13782. // The nextTick behavior leverages the microtask queue, which can be accessed
  13783. // via either native Promise.then or MutationObserver.
  13784. // MutationObserver has wider support, however it is seriously bugged in
  13785. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  13786. // completely stops working after triggering a few times... so, if native
  13787. // Promise is available, we will use it:
  13788. /* istanbul ignore next, $flow-disable-line */
  13789. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  13790. var p = Promise.resolve();
  13791. timerFunc = function () {
  13792. p.then(flushCallbacks);
  13793. // In problematic UIWebViews, Promise.then doesn't completely break, but
  13794. // it can get stuck in a weird state where callbacks are pushed into the
  13795. // microtask queue but the queue isn't being flushed, until the browser
  13796. // needs to do some other work, e.g. handle a timer. Therefore we can
  13797. // "force" the microtask queue to be flushed by adding an empty timer.
  13798. if (isIOS) { setTimeout(noop); }
  13799. };
  13800. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  13801. isNative(MutationObserver) ||
  13802. // PhantomJS and iOS 7.x
  13803. MutationObserver.toString() === '[object MutationObserverConstructor]'
  13804. )) {
  13805. // Use MutationObserver where native Promise is not available,
  13806. // e.g. PhantomJS, iOS7, Android 4.4
  13807. // (#6466 MutationObserver is unreliable in IE11)
  13808. var counter = 1;
  13809. var observer = new MutationObserver(flushCallbacks);
  13810. var textNode = document.createTextNode(String(counter));
  13811. observer.observe(textNode, {
  13812. characterData: true
  13813. });
  13814. timerFunc = function () {
  13815. counter = (counter + 1) % 2;
  13816. textNode.data = String(counter);
  13817. };
  13818. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  13819. // Fallback to setImmediate.
  13820. // Technically it leverages the (macro) task queue,
  13821. // but it is still a better choice than setTimeout.
  13822. timerFunc = function () {
  13823. setImmediate(flushCallbacks);
  13824. };
  13825. } else {
  13826. // Fallback to setTimeout.
  13827. timerFunc = function () {
  13828. setTimeout(flushCallbacks, 0);
  13829. };
  13830. }
  13831. function nextTick (cb, ctx) {
  13832. var _resolve;
  13833. callbacks.push(function () {
  13834. if (cb) {
  13835. try {
  13836. cb.call(ctx);
  13837. } catch (e) {
  13838. handleError(e, ctx, 'nextTick');
  13839. }
  13840. } else if (_resolve) {
  13841. _resolve(ctx);
  13842. }
  13843. });
  13844. if (!pending) {
  13845. pending = true;
  13846. timerFunc();
  13847. }
  13848. // $flow-disable-line
  13849. if (!cb && typeof Promise !== 'undefined') {
  13850. return new Promise(function (resolve) {
  13851. _resolve = resolve;
  13852. })
  13853. }
  13854. }
  13855. /* */
  13856. /* not type checking this file because flow doesn't play well with Proxy */
  13857. var initProxy;
  13858. if (true) {
  13859. var allowedGlobals = makeMap(
  13860. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  13861. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  13862. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  13863. 'require' // for Webpack/Browserify
  13864. );
  13865. var warnNonPresent = function (target, key) {
  13866. warn(
  13867. "Property or method \"" + key + "\" is not defined on the instance but " +
  13868. 'referenced during render. Make sure that this property is reactive, ' +
  13869. 'either in the data option, or for class-based components, by ' +
  13870. 'initializing the property. ' +
  13871. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  13872. target
  13873. );
  13874. };
  13875. var warnReservedPrefix = function (target, key) {
  13876. warn(
  13877. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  13878. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  13879. 'prevent conflicts with Vue internals. ' +
  13880. 'See: https://vuejs.org/v2/api/#data',
  13881. target
  13882. );
  13883. };
  13884. var hasProxy =
  13885. typeof Proxy !== 'undefined' && isNative(Proxy);
  13886. if (hasProxy) {
  13887. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  13888. config.keyCodes = new Proxy(config.keyCodes, {
  13889. set: function set (target, key, value) {
  13890. if (isBuiltInModifier(key)) {
  13891. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  13892. return false
  13893. } else {
  13894. target[key] = value;
  13895. return true
  13896. }
  13897. }
  13898. });
  13899. }
  13900. var hasHandler = {
  13901. has: function has (target, key) {
  13902. var has = key in target;
  13903. var isAllowed = allowedGlobals(key) ||
  13904. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  13905. if (!has && !isAllowed) {
  13906. if (key in target.$data) { warnReservedPrefix(target, key); }
  13907. else { warnNonPresent(target, key); }
  13908. }
  13909. return has || !isAllowed
  13910. }
  13911. };
  13912. var getHandler = {
  13913. get: function get (target, key) {
  13914. if (typeof key === 'string' && !(key in target)) {
  13915. if (key in target.$data) { warnReservedPrefix(target, key); }
  13916. else { warnNonPresent(target, key); }
  13917. }
  13918. return target[key]
  13919. }
  13920. };
  13921. initProxy = function initProxy (vm) {
  13922. if (hasProxy) {
  13923. // determine which proxy handler to use
  13924. var options = vm.$options;
  13925. var handlers = options.render && options.render._withStripped
  13926. ? getHandler
  13927. : hasHandler;
  13928. vm._renderProxy = new Proxy(vm, handlers);
  13929. } else {
  13930. vm._renderProxy = vm;
  13931. }
  13932. };
  13933. }
  13934. /* */
  13935. var seenObjects = new _Set();
  13936. /**
  13937. * Recursively traverse an object to evoke all converted
  13938. * getters, so that every nested property inside the object
  13939. * is collected as a "deep" dependency.
  13940. */
  13941. function traverse (val) {
  13942. _traverse(val, seenObjects);
  13943. seenObjects.clear();
  13944. }
  13945. function _traverse (val, seen) {
  13946. var i, keys;
  13947. var isA = Array.isArray(val);
  13948. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  13949. return
  13950. }
  13951. if (val.__ob__) {
  13952. var depId = val.__ob__.dep.id;
  13953. if (seen.has(depId)) {
  13954. return
  13955. }
  13956. seen.add(depId);
  13957. }
  13958. if (isA) {
  13959. i = val.length;
  13960. while (i--) { _traverse(val[i], seen); }
  13961. } else {
  13962. keys = Object.keys(val);
  13963. i = keys.length;
  13964. while (i--) { _traverse(val[keys[i]], seen); }
  13965. }
  13966. }
  13967. var mark;
  13968. var measure;
  13969. if (true) {
  13970. var perf = inBrowser && window.performance;
  13971. /* istanbul ignore if */
  13972. if (
  13973. perf &&
  13974. perf.mark &&
  13975. perf.measure &&
  13976. perf.clearMarks &&
  13977. perf.clearMeasures
  13978. ) {
  13979. mark = function (tag) { return perf.mark(tag); };
  13980. measure = function (name, startTag, endTag) {
  13981. perf.measure(name, startTag, endTag);
  13982. perf.clearMarks(startTag);
  13983. perf.clearMarks(endTag);
  13984. // perf.clearMeasures(name)
  13985. };
  13986. }
  13987. }
  13988. /* */
  13989. var normalizeEvent = cached(function (name) {
  13990. var passive = name.charAt(0) === '&';
  13991. name = passive ? name.slice(1) : name;
  13992. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  13993. name = once$$1 ? name.slice(1) : name;
  13994. var capture = name.charAt(0) === '!';
  13995. name = capture ? name.slice(1) : name;
  13996. return {
  13997. name: name,
  13998. once: once$$1,
  13999. capture: capture,
  14000. passive: passive
  14001. }
  14002. });
  14003. function createFnInvoker (fns, vm) {
  14004. function invoker () {
  14005. var arguments$1 = arguments;
  14006. var fns = invoker.fns;
  14007. if (Array.isArray(fns)) {
  14008. var cloned = fns.slice();
  14009. for (var i = 0; i < cloned.length; i++) {
  14010. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  14011. }
  14012. } else {
  14013. // return handler return value for single handlers
  14014. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  14015. }
  14016. }
  14017. invoker.fns = fns;
  14018. return invoker
  14019. }
  14020. function updateListeners (
  14021. on,
  14022. oldOn,
  14023. add,
  14024. remove$$1,
  14025. createOnceHandler,
  14026. vm
  14027. ) {
  14028. var name, def$$1, cur, old, event;
  14029. for (name in on) {
  14030. def$$1 = cur = on[name];
  14031. old = oldOn[name];
  14032. event = normalizeEvent(name);
  14033. if (isUndef(cur)) {
  14034. true && warn(
  14035. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  14036. vm
  14037. );
  14038. } else if (isUndef(old)) {
  14039. if (isUndef(cur.fns)) {
  14040. cur = on[name] = createFnInvoker(cur, vm);
  14041. }
  14042. if (isTrue(event.once)) {
  14043. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  14044. }
  14045. add(event.name, cur, event.capture, event.passive, event.params);
  14046. } else if (cur !== old) {
  14047. old.fns = cur;
  14048. on[name] = old;
  14049. }
  14050. }
  14051. for (name in oldOn) {
  14052. if (isUndef(on[name])) {
  14053. event = normalizeEvent(name);
  14054. remove$$1(event.name, oldOn[name], event.capture);
  14055. }
  14056. }
  14057. }
  14058. /* */
  14059. /* */
  14060. // fixed by xxxxxx (mp properties)
  14061. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  14062. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  14063. if (isUndef(propOptions)) {
  14064. return res
  14065. }
  14066. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  14067. var attrs = data.attrs;
  14068. var props = data.props;
  14069. if (isDef(attrs) || isDef(props)) {
  14070. for (var key in propOptions) {
  14071. var altKey = hyphenate(key);
  14072. var result = checkProp(res, props, key, altKey, true) ||
  14073. checkProp(res, attrs, key, altKey, false);
  14074. // externalClass
  14075. if (
  14076. result &&
  14077. res[key] &&
  14078. externalClasses.indexOf(altKey) !== -1 &&
  14079. context[camelize(res[key])]
  14080. ) {
  14081. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  14082. res[key] = context[camelize(res[key])];
  14083. }
  14084. }
  14085. }
  14086. return res
  14087. }
  14088. function extractPropsFromVNodeData (
  14089. data,
  14090. Ctor,
  14091. tag,
  14092. context// fixed by xxxxxx
  14093. ) {
  14094. // we are only extracting raw values here.
  14095. // validation and default values are handled in the child
  14096. // component itself.
  14097. var propOptions = Ctor.options.props;
  14098. if (isUndef(propOptions)) {
  14099. // fixed by xxxxxx
  14100. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  14101. }
  14102. var res = {};
  14103. var attrs = data.attrs;
  14104. var props = data.props;
  14105. if (isDef(attrs) || isDef(props)) {
  14106. for (var key in propOptions) {
  14107. var altKey = hyphenate(key);
  14108. if (true) {
  14109. var keyInLowerCase = key.toLowerCase();
  14110. if (
  14111. key !== keyInLowerCase &&
  14112. attrs && hasOwn(attrs, keyInLowerCase)
  14113. ) {
  14114. tip(
  14115. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  14116. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  14117. " \"" + key + "\". " +
  14118. "Note that HTML attributes are case-insensitive and camelCased " +
  14119. "props need to use their kebab-case equivalents when using in-DOM " +
  14120. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  14121. );
  14122. }
  14123. }
  14124. checkProp(res, props, key, altKey, true) ||
  14125. checkProp(res, attrs, key, altKey, false);
  14126. }
  14127. }
  14128. // fixed by xxxxxx
  14129. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  14130. }
  14131. function checkProp (
  14132. res,
  14133. hash,
  14134. key,
  14135. altKey,
  14136. preserve
  14137. ) {
  14138. if (isDef(hash)) {
  14139. if (hasOwn(hash, key)) {
  14140. res[key] = hash[key];
  14141. if (!preserve) {
  14142. delete hash[key];
  14143. }
  14144. return true
  14145. } else if (hasOwn(hash, altKey)) {
  14146. res[key] = hash[altKey];
  14147. if (!preserve) {
  14148. delete hash[altKey];
  14149. }
  14150. return true
  14151. }
  14152. }
  14153. return false
  14154. }
  14155. /* */
  14156. // The template compiler attempts to minimize the need for normalization by
  14157. // statically analyzing the template at compile time.
  14158. //
  14159. // For plain HTML markup, normalization can be completely skipped because the
  14160. // generated render function is guaranteed to return Array<VNode>. There are
  14161. // two cases where extra normalization is needed:
  14162. // 1. When the children contains components - because a functional component
  14163. // may return an Array instead of a single root. In this case, just a simple
  14164. // normalization is needed - if any child is an Array, we flatten the whole
  14165. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  14166. // because functional components already normalize their own children.
  14167. function simpleNormalizeChildren (children) {
  14168. for (var i = 0; i < children.length; i++) {
  14169. if (Array.isArray(children[i])) {
  14170. return Array.prototype.concat.apply([], children)
  14171. }
  14172. }
  14173. return children
  14174. }
  14175. // 2. When the children contains constructs that always generated nested Arrays,
  14176. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  14177. // with hand-written render functions / JSX. In such cases a full normalization
  14178. // is needed to cater to all possible types of children values.
  14179. function normalizeChildren (children) {
  14180. return isPrimitive(children)
  14181. ? [createTextVNode(children)]
  14182. : Array.isArray(children)
  14183. ? normalizeArrayChildren(children)
  14184. : undefined
  14185. }
  14186. function isTextNode (node) {
  14187. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  14188. }
  14189. function normalizeArrayChildren (children, nestedIndex) {
  14190. var res = [];
  14191. var i, c, lastIndex, last;
  14192. for (i = 0; i < children.length; i++) {
  14193. c = children[i];
  14194. if (isUndef(c) || typeof c === 'boolean') { continue }
  14195. lastIndex = res.length - 1;
  14196. last = res[lastIndex];
  14197. // nested
  14198. if (Array.isArray(c)) {
  14199. if (c.length > 0) {
  14200. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  14201. // merge adjacent text nodes
  14202. if (isTextNode(c[0]) && isTextNode(last)) {
  14203. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  14204. c.shift();
  14205. }
  14206. res.push.apply(res, c);
  14207. }
  14208. } else if (isPrimitive(c)) {
  14209. if (isTextNode(last)) {
  14210. // merge adjacent text nodes
  14211. // this is necessary for SSR hydration because text nodes are
  14212. // essentially merged when rendered to HTML strings
  14213. res[lastIndex] = createTextVNode(last.text + c);
  14214. } else if (c !== '') {
  14215. // convert primitive to vnode
  14216. res.push(createTextVNode(c));
  14217. }
  14218. } else {
  14219. if (isTextNode(c) && isTextNode(last)) {
  14220. // merge adjacent text nodes
  14221. res[lastIndex] = createTextVNode(last.text + c.text);
  14222. } else {
  14223. // default key for nested array children (likely generated by v-for)
  14224. if (isTrue(children._isVList) &&
  14225. isDef(c.tag) &&
  14226. isUndef(c.key) &&
  14227. isDef(nestedIndex)) {
  14228. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  14229. }
  14230. res.push(c);
  14231. }
  14232. }
  14233. }
  14234. return res
  14235. }
  14236. /* */
  14237. function initProvide (vm) {
  14238. var provide = vm.$options.provide;
  14239. if (provide) {
  14240. vm._provided = typeof provide === 'function'
  14241. ? provide.call(vm)
  14242. : provide;
  14243. }
  14244. }
  14245. function initInjections (vm) {
  14246. var result = resolveInject(vm.$options.inject, vm);
  14247. if (result) {
  14248. toggleObserving(false);
  14249. Object.keys(result).forEach(function (key) {
  14250. /* istanbul ignore else */
  14251. if (true) {
  14252. defineReactive$$1(vm, key, result[key], function () {
  14253. warn(
  14254. "Avoid mutating an injected value directly since the changes will be " +
  14255. "overwritten whenever the provided component re-renders. " +
  14256. "injection being mutated: \"" + key + "\"",
  14257. vm
  14258. );
  14259. });
  14260. } else {}
  14261. });
  14262. toggleObserving(true);
  14263. }
  14264. }
  14265. function resolveInject (inject, vm) {
  14266. if (inject) {
  14267. // inject is :any because flow is not smart enough to figure out cached
  14268. var result = Object.create(null);
  14269. var keys = hasSymbol
  14270. ? Reflect.ownKeys(inject)
  14271. : Object.keys(inject);
  14272. for (var i = 0; i < keys.length; i++) {
  14273. var key = keys[i];
  14274. // #6574 in case the inject object is observed...
  14275. if (key === '__ob__') { continue }
  14276. var provideKey = inject[key].from;
  14277. var source = vm;
  14278. while (source) {
  14279. if (source._provided && hasOwn(source._provided, provideKey)) {
  14280. result[key] = source._provided[provideKey];
  14281. break
  14282. }
  14283. source = source.$parent;
  14284. }
  14285. if (!source) {
  14286. if ('default' in inject[key]) {
  14287. var provideDefault = inject[key].default;
  14288. result[key] = typeof provideDefault === 'function'
  14289. ? provideDefault.call(vm)
  14290. : provideDefault;
  14291. } else if (true) {
  14292. warn(("Injection \"" + key + "\" not found"), vm);
  14293. }
  14294. }
  14295. }
  14296. return result
  14297. }
  14298. }
  14299. /* */
  14300. /**
  14301. * Runtime helper for resolving raw children VNodes into a slot object.
  14302. */
  14303. function resolveSlots (
  14304. children,
  14305. context
  14306. ) {
  14307. if (!children || !children.length) {
  14308. return {}
  14309. }
  14310. var slots = {};
  14311. for (var i = 0, l = children.length; i < l; i++) {
  14312. var child = children[i];
  14313. var data = child.data;
  14314. // remove slot attribute if the node is resolved as a Vue slot node
  14315. if (data && data.attrs && data.attrs.slot) {
  14316. delete data.attrs.slot;
  14317. }
  14318. // named slots should only be respected if the vnode was rendered in the
  14319. // same context.
  14320. if ((child.context === context || child.fnContext === context) &&
  14321. data && data.slot != null
  14322. ) {
  14323. var name = data.slot;
  14324. var slot = (slots[name] || (slots[name] = []));
  14325. if (child.tag === 'template') {
  14326. slot.push.apply(slot, child.children || []);
  14327. } else {
  14328. slot.push(child);
  14329. }
  14330. } else {
  14331. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  14332. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  14333. (slots['page'] || (slots['page'] = [])).push(child);
  14334. }else{
  14335. (slots.default || (slots.default = [])).push(child);
  14336. }
  14337. }
  14338. }
  14339. // ignore slots that contains only whitespace
  14340. for (var name$1 in slots) {
  14341. if (slots[name$1].every(isWhitespace)) {
  14342. delete slots[name$1];
  14343. }
  14344. }
  14345. return slots
  14346. }
  14347. function isWhitespace (node) {
  14348. return (node.isComment && !node.asyncFactory) || node.text === ' '
  14349. }
  14350. /* */
  14351. function normalizeScopedSlots (
  14352. slots,
  14353. normalSlots,
  14354. prevSlots
  14355. ) {
  14356. var res;
  14357. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  14358. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  14359. var key = slots && slots.$key;
  14360. if (!slots) {
  14361. res = {};
  14362. } else if (slots._normalized) {
  14363. // fast path 1: child component re-render only, parent did not change
  14364. return slots._normalized
  14365. } else if (
  14366. isStable &&
  14367. prevSlots &&
  14368. prevSlots !== emptyObject &&
  14369. key === prevSlots.$key &&
  14370. !hasNormalSlots &&
  14371. !prevSlots.$hasNormal
  14372. ) {
  14373. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  14374. // only need to normalize once
  14375. return prevSlots
  14376. } else {
  14377. res = {};
  14378. for (var key$1 in slots) {
  14379. if (slots[key$1] && key$1[0] !== '$') {
  14380. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  14381. }
  14382. }
  14383. }
  14384. // expose normal slots on scopedSlots
  14385. for (var key$2 in normalSlots) {
  14386. if (!(key$2 in res)) {
  14387. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  14388. }
  14389. }
  14390. // avoriaz seems to mock a non-extensible $scopedSlots object
  14391. // and when that is passed down this would cause an error
  14392. if (slots && Object.isExtensible(slots)) {
  14393. (slots)._normalized = res;
  14394. }
  14395. def(res, '$stable', isStable);
  14396. def(res, '$key', key);
  14397. def(res, '$hasNormal', hasNormalSlots);
  14398. return res
  14399. }
  14400. function normalizeScopedSlot(normalSlots, key, fn) {
  14401. var normalized = function () {
  14402. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  14403. res = res && typeof res === 'object' && !Array.isArray(res)
  14404. ? [res] // single vnode
  14405. : normalizeChildren(res);
  14406. return res && (
  14407. res.length === 0 ||
  14408. (res.length === 1 && res[0].isComment) // #9658
  14409. ) ? undefined
  14410. : res
  14411. };
  14412. // this is a slot using the new v-slot syntax without scope. although it is
  14413. // compiled as a scoped slot, render fn users would expect it to be present
  14414. // on this.$slots because the usage is semantically a normal slot.
  14415. if (fn.proxy) {
  14416. Object.defineProperty(normalSlots, key, {
  14417. get: normalized,
  14418. enumerable: true,
  14419. configurable: true
  14420. });
  14421. }
  14422. return normalized
  14423. }
  14424. function proxyNormalSlot(slots, key) {
  14425. return function () { return slots[key]; }
  14426. }
  14427. /* */
  14428. /**
  14429. * Runtime helper for rendering v-for lists.
  14430. */
  14431. function renderList (
  14432. val,
  14433. render
  14434. ) {
  14435. var ret, i, l, keys, key;
  14436. if (Array.isArray(val) || typeof val === 'string') {
  14437. ret = new Array(val.length);
  14438. for (i = 0, l = val.length; i < l; i++) {
  14439. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  14440. }
  14441. } else if (typeof val === 'number') {
  14442. ret = new Array(val);
  14443. for (i = 0; i < val; i++) {
  14444. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  14445. }
  14446. } else if (isObject(val)) {
  14447. if (hasSymbol && val[Symbol.iterator]) {
  14448. ret = [];
  14449. var iterator = val[Symbol.iterator]();
  14450. var result = iterator.next();
  14451. while (!result.done) {
  14452. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  14453. result = iterator.next();
  14454. }
  14455. } else {
  14456. keys = Object.keys(val);
  14457. ret = new Array(keys.length);
  14458. for (i = 0, l = keys.length; i < l; i++) {
  14459. key = keys[i];
  14460. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  14461. }
  14462. }
  14463. }
  14464. if (!isDef(ret)) {
  14465. ret = [];
  14466. }
  14467. (ret)._isVList = true;
  14468. return ret
  14469. }
  14470. /* */
  14471. /**
  14472. * Runtime helper for rendering <slot>
  14473. */
  14474. function renderSlot (
  14475. name,
  14476. fallback,
  14477. props,
  14478. bindObject
  14479. ) {
  14480. var scopedSlotFn = this.$scopedSlots[name];
  14481. var nodes;
  14482. if (scopedSlotFn) { // scoped slot
  14483. props = props || {};
  14484. if (bindObject) {
  14485. if ( true && !isObject(bindObject)) {
  14486. warn(
  14487. 'slot v-bind without argument expects an Object',
  14488. this
  14489. );
  14490. }
  14491. props = extend(extend({}, bindObject), props);
  14492. }
  14493. // fixed by xxxxxx app-plus scopedSlot
  14494. nodes = scopedSlotFn(props, this, props._i) || fallback;
  14495. } else {
  14496. nodes = this.$slots[name] || fallback;
  14497. }
  14498. var target = props && props.slot;
  14499. if (target) {
  14500. return this.$createElement('template', { slot: target }, nodes)
  14501. } else {
  14502. return nodes
  14503. }
  14504. }
  14505. /* */
  14506. /**
  14507. * Runtime helper for resolving filters
  14508. */
  14509. function resolveFilter (id) {
  14510. return resolveAsset(this.$options, 'filters', id, true) || identity
  14511. }
  14512. /* */
  14513. function isKeyNotMatch (expect, actual) {
  14514. if (Array.isArray(expect)) {
  14515. return expect.indexOf(actual) === -1
  14516. } else {
  14517. return expect !== actual
  14518. }
  14519. }
  14520. /**
  14521. * Runtime helper for checking keyCodes from config.
  14522. * exposed as Vue.prototype._k
  14523. * passing in eventKeyName as last argument separately for backwards compat
  14524. */
  14525. function checkKeyCodes (
  14526. eventKeyCode,
  14527. key,
  14528. builtInKeyCode,
  14529. eventKeyName,
  14530. builtInKeyName
  14531. ) {
  14532. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  14533. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  14534. return isKeyNotMatch(builtInKeyName, eventKeyName)
  14535. } else if (mappedKeyCode) {
  14536. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  14537. } else if (eventKeyName) {
  14538. return hyphenate(eventKeyName) !== key
  14539. }
  14540. }
  14541. /* */
  14542. /**
  14543. * Runtime helper for merging v-bind="object" into a VNode's data.
  14544. */
  14545. function bindObjectProps (
  14546. data,
  14547. tag,
  14548. value,
  14549. asProp,
  14550. isSync
  14551. ) {
  14552. if (value) {
  14553. if (!isObject(value)) {
  14554. true && warn(
  14555. 'v-bind without argument expects an Object or Array value',
  14556. this
  14557. );
  14558. } else {
  14559. if (Array.isArray(value)) {
  14560. value = toObject(value);
  14561. }
  14562. var hash;
  14563. var loop = function ( key ) {
  14564. if (
  14565. key === 'class' ||
  14566. key === 'style' ||
  14567. isReservedAttribute(key)
  14568. ) {
  14569. hash = data;
  14570. } else {
  14571. var type = data.attrs && data.attrs.type;
  14572. hash = asProp || config.mustUseProp(tag, type, key)
  14573. ? data.domProps || (data.domProps = {})
  14574. : data.attrs || (data.attrs = {});
  14575. }
  14576. var camelizedKey = camelize(key);
  14577. var hyphenatedKey = hyphenate(key);
  14578. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  14579. hash[key] = value[key];
  14580. if (isSync) {
  14581. var on = data.on || (data.on = {});
  14582. on[("update:" + key)] = function ($event) {
  14583. value[key] = $event;
  14584. };
  14585. }
  14586. }
  14587. };
  14588. for (var key in value) loop( key );
  14589. }
  14590. }
  14591. return data
  14592. }
  14593. /* */
  14594. /**
  14595. * Runtime helper for rendering static trees.
  14596. */
  14597. function renderStatic (
  14598. index,
  14599. isInFor
  14600. ) {
  14601. var cached = this._staticTrees || (this._staticTrees = []);
  14602. var tree = cached[index];
  14603. // if has already-rendered static tree and not inside v-for,
  14604. // we can reuse the same tree.
  14605. if (tree && !isInFor) {
  14606. return tree
  14607. }
  14608. // otherwise, render a fresh tree.
  14609. tree = cached[index] = this.$options.staticRenderFns[index].call(
  14610. this._renderProxy,
  14611. null,
  14612. this // for render fns generated for functional component templates
  14613. );
  14614. markStatic(tree, ("__static__" + index), false);
  14615. return tree
  14616. }
  14617. /**
  14618. * Runtime helper for v-once.
  14619. * Effectively it means marking the node as static with a unique key.
  14620. */
  14621. function markOnce (
  14622. tree,
  14623. index,
  14624. key
  14625. ) {
  14626. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  14627. return tree
  14628. }
  14629. function markStatic (
  14630. tree,
  14631. key,
  14632. isOnce
  14633. ) {
  14634. if (Array.isArray(tree)) {
  14635. for (var i = 0; i < tree.length; i++) {
  14636. if (tree[i] && typeof tree[i] !== 'string') {
  14637. markStaticNode(tree[i], (key + "_" + i), isOnce);
  14638. }
  14639. }
  14640. } else {
  14641. markStaticNode(tree, key, isOnce);
  14642. }
  14643. }
  14644. function markStaticNode (node, key, isOnce) {
  14645. node.isStatic = true;
  14646. node.key = key;
  14647. node.isOnce = isOnce;
  14648. }
  14649. /* */
  14650. function bindObjectListeners (data, value) {
  14651. if (value) {
  14652. if (!isPlainObject(value)) {
  14653. true && warn(
  14654. 'v-on without argument expects an Object value',
  14655. this
  14656. );
  14657. } else {
  14658. var on = data.on = data.on ? extend({}, data.on) : {};
  14659. for (var key in value) {
  14660. var existing = on[key];
  14661. var ours = value[key];
  14662. on[key] = existing ? [].concat(existing, ours) : ours;
  14663. }
  14664. }
  14665. }
  14666. return data
  14667. }
  14668. /* */
  14669. function resolveScopedSlots (
  14670. fns, // see flow/vnode
  14671. res,
  14672. // the following are added in 2.6
  14673. hasDynamicKeys,
  14674. contentHashKey
  14675. ) {
  14676. res = res || { $stable: !hasDynamicKeys };
  14677. for (var i = 0; i < fns.length; i++) {
  14678. var slot = fns[i];
  14679. if (Array.isArray(slot)) {
  14680. resolveScopedSlots(slot, res, hasDynamicKeys);
  14681. } else if (slot) {
  14682. // marker for reverse proxying v-slot without scope on this.$slots
  14683. if (slot.proxy) {
  14684. slot.fn.proxy = true;
  14685. }
  14686. res[slot.key] = slot.fn;
  14687. }
  14688. }
  14689. if (contentHashKey) {
  14690. (res).$key = contentHashKey;
  14691. }
  14692. return res
  14693. }
  14694. /* */
  14695. function bindDynamicKeys (baseObj, values) {
  14696. for (var i = 0; i < values.length; i += 2) {
  14697. var key = values[i];
  14698. if (typeof key === 'string' && key) {
  14699. baseObj[values[i]] = values[i + 1];
  14700. } else if ( true && key !== '' && key !== null) {
  14701. // null is a special value for explicitly removing a binding
  14702. warn(
  14703. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  14704. this
  14705. );
  14706. }
  14707. }
  14708. return baseObj
  14709. }
  14710. // helper to dynamically append modifier runtime markers to event names.
  14711. // ensure only append when value is already string, otherwise it will be cast
  14712. // to string and cause the type check to miss.
  14713. function prependModifier (value, symbol) {
  14714. return typeof value === 'string' ? symbol + value : value
  14715. }
  14716. /* */
  14717. function installRenderHelpers (target) {
  14718. target._o = markOnce;
  14719. target._n = toNumber;
  14720. target._s = toString;
  14721. target._l = renderList;
  14722. target._t = renderSlot;
  14723. target._q = looseEqual;
  14724. target._i = looseIndexOf;
  14725. target._m = renderStatic;
  14726. target._f = resolveFilter;
  14727. target._k = checkKeyCodes;
  14728. target._b = bindObjectProps;
  14729. target._v = createTextVNode;
  14730. target._e = createEmptyVNode;
  14731. target._u = resolveScopedSlots;
  14732. target._g = bindObjectListeners;
  14733. target._d = bindDynamicKeys;
  14734. target._p = prependModifier;
  14735. }
  14736. /* */
  14737. function FunctionalRenderContext (
  14738. data,
  14739. props,
  14740. children,
  14741. parent,
  14742. Ctor
  14743. ) {
  14744. var this$1 = this;
  14745. var options = Ctor.options;
  14746. // ensure the createElement function in functional components
  14747. // gets a unique context - this is necessary for correct named slot check
  14748. var contextVm;
  14749. if (hasOwn(parent, '_uid')) {
  14750. contextVm = Object.create(parent);
  14751. // $flow-disable-line
  14752. contextVm._original = parent;
  14753. } else {
  14754. // the context vm passed in is a functional context as well.
  14755. // in this case we want to make sure we are able to get a hold to the
  14756. // real context instance.
  14757. contextVm = parent;
  14758. // $flow-disable-line
  14759. parent = parent._original;
  14760. }
  14761. var isCompiled = isTrue(options._compiled);
  14762. var needNormalization = !isCompiled;
  14763. this.data = data;
  14764. this.props = props;
  14765. this.children = children;
  14766. this.parent = parent;
  14767. this.listeners = data.on || emptyObject;
  14768. this.injections = resolveInject(options.inject, parent);
  14769. this.slots = function () {
  14770. if (!this$1.$slots) {
  14771. normalizeScopedSlots(
  14772. data.scopedSlots,
  14773. this$1.$slots = resolveSlots(children, parent)
  14774. );
  14775. }
  14776. return this$1.$slots
  14777. };
  14778. Object.defineProperty(this, 'scopedSlots', ({
  14779. enumerable: true,
  14780. get: function get () {
  14781. return normalizeScopedSlots(data.scopedSlots, this.slots())
  14782. }
  14783. }));
  14784. // support for compiled functional template
  14785. if (isCompiled) {
  14786. // exposing $options for renderStatic()
  14787. this.$options = options;
  14788. // pre-resolve slots for renderSlot()
  14789. this.$slots = this.slots();
  14790. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  14791. }
  14792. if (options._scopeId) {
  14793. this._c = function (a, b, c, d) {
  14794. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  14795. if (vnode && !Array.isArray(vnode)) {
  14796. vnode.fnScopeId = options._scopeId;
  14797. vnode.fnContext = parent;
  14798. }
  14799. return vnode
  14800. };
  14801. } else {
  14802. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  14803. }
  14804. }
  14805. installRenderHelpers(FunctionalRenderContext.prototype);
  14806. function createFunctionalComponent (
  14807. Ctor,
  14808. propsData,
  14809. data,
  14810. contextVm,
  14811. children
  14812. ) {
  14813. var options = Ctor.options;
  14814. var props = {};
  14815. var propOptions = options.props;
  14816. if (isDef(propOptions)) {
  14817. for (var key in propOptions) {
  14818. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  14819. }
  14820. } else {
  14821. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  14822. if (isDef(data.props)) { mergeProps(props, data.props); }
  14823. }
  14824. var renderContext = new FunctionalRenderContext(
  14825. data,
  14826. props,
  14827. children,
  14828. contextVm,
  14829. Ctor
  14830. );
  14831. var vnode = options.render.call(null, renderContext._c, renderContext);
  14832. if (vnode instanceof VNode) {
  14833. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  14834. } else if (Array.isArray(vnode)) {
  14835. var vnodes = normalizeChildren(vnode) || [];
  14836. var res = new Array(vnodes.length);
  14837. for (var i = 0; i < vnodes.length; i++) {
  14838. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  14839. }
  14840. return res
  14841. }
  14842. }
  14843. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  14844. // #7817 clone node before setting fnContext, otherwise if the node is reused
  14845. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  14846. // that should not be matched to match.
  14847. var clone = cloneVNode(vnode);
  14848. clone.fnContext = contextVm;
  14849. clone.fnOptions = options;
  14850. if (true) {
  14851. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  14852. }
  14853. if (data.slot) {
  14854. (clone.data || (clone.data = {})).slot = data.slot;
  14855. }
  14856. return clone
  14857. }
  14858. function mergeProps (to, from) {
  14859. for (var key in from) {
  14860. to[camelize(key)] = from[key];
  14861. }
  14862. }
  14863. /* */
  14864. /* */
  14865. /* */
  14866. /* */
  14867. // inline hooks to be invoked on component VNodes during patch
  14868. var componentVNodeHooks = {
  14869. init: function init (vnode, hydrating) {
  14870. if (
  14871. vnode.componentInstance &&
  14872. !vnode.componentInstance._isDestroyed &&
  14873. vnode.data.keepAlive
  14874. ) {
  14875. // kept-alive components, treat as a patch
  14876. var mountedNode = vnode; // work around flow
  14877. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  14878. } else {
  14879. var child = vnode.componentInstance = createComponentInstanceForVnode(
  14880. vnode,
  14881. activeInstance
  14882. );
  14883. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  14884. }
  14885. },
  14886. prepatch: function prepatch (oldVnode, vnode) {
  14887. var options = vnode.componentOptions;
  14888. var child = vnode.componentInstance = oldVnode.componentInstance;
  14889. updateChildComponent(
  14890. child,
  14891. options.propsData, // updated props
  14892. options.listeners, // updated listeners
  14893. vnode, // new parent vnode
  14894. options.children // new children
  14895. );
  14896. },
  14897. insert: function insert (vnode) {
  14898. var context = vnode.context;
  14899. var componentInstance = vnode.componentInstance;
  14900. if (!componentInstance._isMounted) {
  14901. callHook(componentInstance, 'onServiceCreated');
  14902. callHook(componentInstance, 'onServiceAttached');
  14903. componentInstance._isMounted = true;
  14904. callHook(componentInstance, 'mounted');
  14905. }
  14906. if (vnode.data.keepAlive) {
  14907. if (context._isMounted) {
  14908. // vue-router#1212
  14909. // During updates, a kept-alive component's child components may
  14910. // change, so directly walking the tree here may call activated hooks
  14911. // on incorrect children. Instead we push them into a queue which will
  14912. // be processed after the whole patch process ended.
  14913. queueActivatedComponent(componentInstance);
  14914. } else {
  14915. activateChildComponent(componentInstance, true /* direct */);
  14916. }
  14917. }
  14918. },
  14919. destroy: function destroy (vnode) {
  14920. var componentInstance = vnode.componentInstance;
  14921. if (!componentInstance._isDestroyed) {
  14922. if (!vnode.data.keepAlive) {
  14923. componentInstance.$destroy();
  14924. } else {
  14925. deactivateChildComponent(componentInstance, true /* direct */);
  14926. }
  14927. }
  14928. }
  14929. };
  14930. var hooksToMerge = Object.keys(componentVNodeHooks);
  14931. function createComponent (
  14932. Ctor,
  14933. data,
  14934. context,
  14935. children,
  14936. tag
  14937. ) {
  14938. if (isUndef(Ctor)) {
  14939. return
  14940. }
  14941. var baseCtor = context.$options._base;
  14942. // plain options object: turn it into a constructor
  14943. if (isObject(Ctor)) {
  14944. Ctor = baseCtor.extend(Ctor);
  14945. }
  14946. // if at this stage it's not a constructor or an async component factory,
  14947. // reject.
  14948. if (typeof Ctor !== 'function') {
  14949. if (true) {
  14950. warn(("Invalid Component definition: " + (String(Ctor))), context);
  14951. }
  14952. return
  14953. }
  14954. // async component
  14955. var asyncFactory;
  14956. if (isUndef(Ctor.cid)) {
  14957. asyncFactory = Ctor;
  14958. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  14959. if (Ctor === undefined) {
  14960. // return a placeholder node for async component, which is rendered
  14961. // as a comment node but preserves all the raw information for the node.
  14962. // the information will be used for async server-rendering and hydration.
  14963. return createAsyncPlaceholder(
  14964. asyncFactory,
  14965. data,
  14966. context,
  14967. children,
  14968. tag
  14969. )
  14970. }
  14971. }
  14972. data = data || {};
  14973. // resolve constructor options in case global mixins are applied after
  14974. // component constructor creation
  14975. resolveConstructorOptions(Ctor);
  14976. // transform component v-model data into props & events
  14977. if (isDef(data.model)) {
  14978. transformModel(Ctor.options, data);
  14979. }
  14980. // extract props
  14981. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  14982. // functional component
  14983. if (isTrue(Ctor.options.functional)) {
  14984. return createFunctionalComponent(Ctor, propsData, data, context, children)
  14985. }
  14986. // extract listeners, since these needs to be treated as
  14987. // child component listeners instead of DOM listeners
  14988. var listeners = data.on;
  14989. // replace with listeners with .native modifier
  14990. // so it gets processed during parent component patch.
  14991. data.on = data.nativeOn;
  14992. if (isTrue(Ctor.options.abstract)) {
  14993. // abstract components do not keep anything
  14994. // other than props & listeners & slot
  14995. // work around flow
  14996. var slot = data.slot;
  14997. data = {};
  14998. if (slot) {
  14999. data.slot = slot;
  15000. }
  15001. }
  15002. // install component management hooks onto the placeholder node
  15003. installComponentHooks(data);
  15004. // return a placeholder vnode
  15005. var name = Ctor.options.name || tag;
  15006. var vnode = new VNode(
  15007. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  15008. data, undefined, undefined, undefined, context,
  15009. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  15010. asyncFactory
  15011. );
  15012. return vnode
  15013. }
  15014. function createComponentInstanceForVnode (
  15015. vnode, // we know it's MountedComponentVNode but flow doesn't
  15016. parent // activeInstance in lifecycle state
  15017. ) {
  15018. var options = {
  15019. _isComponent: true,
  15020. _parentVnode: vnode,
  15021. parent: parent
  15022. };
  15023. // check inline-template render functions
  15024. var inlineTemplate = vnode.data.inlineTemplate;
  15025. if (isDef(inlineTemplate)) {
  15026. options.render = inlineTemplate.render;
  15027. options.staticRenderFns = inlineTemplate.staticRenderFns;
  15028. }
  15029. return new vnode.componentOptions.Ctor(options)
  15030. }
  15031. function installComponentHooks (data) {
  15032. var hooks = data.hook || (data.hook = {});
  15033. for (var i = 0; i < hooksToMerge.length; i++) {
  15034. var key = hooksToMerge[i];
  15035. var existing = hooks[key];
  15036. var toMerge = componentVNodeHooks[key];
  15037. if (existing !== toMerge && !(existing && existing._merged)) {
  15038. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  15039. }
  15040. }
  15041. }
  15042. function mergeHook$1 (f1, f2) {
  15043. var merged = function (a, b) {
  15044. // flow complains about extra args which is why we use any
  15045. f1(a, b);
  15046. f2(a, b);
  15047. };
  15048. merged._merged = true;
  15049. return merged
  15050. }
  15051. // transform component v-model info (value and callback) into
  15052. // prop and event handler respectively.
  15053. function transformModel (options, data) {
  15054. var prop = (options.model && options.model.prop) || 'value';
  15055. var event = (options.model && options.model.event) || 'input'
  15056. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  15057. var on = data.on || (data.on = {});
  15058. var existing = on[event];
  15059. var callback = data.model.callback;
  15060. if (isDef(existing)) {
  15061. if (
  15062. Array.isArray(existing)
  15063. ? existing.indexOf(callback) === -1
  15064. : existing !== callback
  15065. ) {
  15066. on[event] = [callback].concat(existing);
  15067. }
  15068. } else {
  15069. on[event] = callback;
  15070. }
  15071. }
  15072. /* */
  15073. var SIMPLE_NORMALIZE = 1;
  15074. var ALWAYS_NORMALIZE = 2;
  15075. // wrapper function for providing a more flexible interface
  15076. // without getting yelled at by flow
  15077. function createElement (
  15078. context,
  15079. tag,
  15080. data,
  15081. children,
  15082. normalizationType,
  15083. alwaysNormalize
  15084. ) {
  15085. if (Array.isArray(data) || isPrimitive(data)) {
  15086. normalizationType = children;
  15087. children = data;
  15088. data = undefined;
  15089. }
  15090. if (isTrue(alwaysNormalize)) {
  15091. normalizationType = ALWAYS_NORMALIZE;
  15092. }
  15093. return _createElement(context, tag, data, children, normalizationType)
  15094. }
  15095. function _createElement (
  15096. context,
  15097. tag,
  15098. data,
  15099. children,
  15100. normalizationType
  15101. ) {
  15102. if (isDef(data) && isDef((data).__ob__)) {
  15103. true && warn(
  15104. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  15105. 'Always create fresh vnode data objects in each render!',
  15106. context
  15107. );
  15108. return createEmptyVNode()
  15109. }
  15110. // object syntax in v-bind
  15111. if (isDef(data) && isDef(data.is)) {
  15112. tag = data.is;
  15113. }
  15114. if (!tag) {
  15115. // in case of component :is set to falsy value
  15116. return createEmptyVNode()
  15117. }
  15118. // warn against non-primitive key
  15119. if ( true &&
  15120. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  15121. ) {
  15122. {
  15123. warn(
  15124. 'Avoid using non-primitive value as key, ' +
  15125. 'use string/number value instead.',
  15126. context
  15127. );
  15128. }
  15129. }
  15130. // support single function children as default scoped slot
  15131. if (Array.isArray(children) &&
  15132. typeof children[0] === 'function'
  15133. ) {
  15134. data = data || {};
  15135. data.scopedSlots = { default: children[0] };
  15136. children.length = 0;
  15137. }
  15138. if (normalizationType === ALWAYS_NORMALIZE) {
  15139. children = normalizeChildren(children);
  15140. } else if (normalizationType === SIMPLE_NORMALIZE) {
  15141. children = simpleNormalizeChildren(children);
  15142. }
  15143. var vnode, ns;
  15144. if (typeof tag === 'string') {
  15145. var Ctor;
  15146. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  15147. if (config.isReservedTag(tag)) {
  15148. // platform built-in elements
  15149. if ( true && isDef(data) && isDef(data.nativeOn)) {
  15150. warn(
  15151. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  15152. context
  15153. );
  15154. }
  15155. vnode = new VNode(
  15156. config.parsePlatformTagName(tag), data, children,
  15157. undefined, undefined, context
  15158. );
  15159. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  15160. // component
  15161. vnode = createComponent(Ctor, data, context, children, tag);
  15162. } else {
  15163. // unknown or unlisted namespaced elements
  15164. // check at runtime because it may get assigned a namespace when its
  15165. // parent normalizes children
  15166. vnode = new VNode(
  15167. tag, data, children,
  15168. undefined, undefined, context
  15169. );
  15170. }
  15171. } else {
  15172. // direct component options / constructor
  15173. vnode = createComponent(tag, data, context, children);
  15174. }
  15175. if (Array.isArray(vnode)) {
  15176. return vnode
  15177. } else if (isDef(vnode)) {
  15178. if (isDef(ns)) { applyNS(vnode, ns); }
  15179. if (isDef(data)) { registerDeepBindings(data); }
  15180. return vnode
  15181. } else {
  15182. return createEmptyVNode()
  15183. }
  15184. }
  15185. function applyNS (vnode, ns, force) {
  15186. vnode.ns = ns;
  15187. if (vnode.tag === 'foreignObject') {
  15188. // use default namespace inside foreignObject
  15189. ns = undefined;
  15190. force = true;
  15191. }
  15192. if (isDef(vnode.children)) {
  15193. for (var i = 0, l = vnode.children.length; i < l; i++) {
  15194. var child = vnode.children[i];
  15195. if (isDef(child.tag) && (
  15196. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  15197. applyNS(child, ns, force);
  15198. }
  15199. }
  15200. }
  15201. }
  15202. // ref #5318
  15203. // necessary to ensure parent re-render when deep bindings like :style and
  15204. // :class are used on slot nodes
  15205. function registerDeepBindings (data) {
  15206. if (isObject(data.style)) {
  15207. traverse(data.style);
  15208. }
  15209. if (isObject(data.class)) {
  15210. traverse(data.class);
  15211. }
  15212. }
  15213. /* */
  15214. function initRender (vm) {
  15215. vm._vnode = null; // the root of the child tree
  15216. vm._staticTrees = null; // v-once cached trees
  15217. var options = vm.$options;
  15218. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  15219. var renderContext = parentVnode && parentVnode.context;
  15220. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  15221. vm.$scopedSlots = emptyObject;
  15222. // bind the createElement fn to this instance
  15223. // so that we get proper render context inside it.
  15224. // args order: tag, data, children, normalizationType, alwaysNormalize
  15225. // internal version is used by render functions compiled from templates
  15226. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  15227. // normalization is always applied for the public version, used in
  15228. // user-written render functions.
  15229. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  15230. // $attrs & $listeners are exposed for easier HOC creation.
  15231. // they need to be reactive so that HOCs using them are always updated
  15232. var parentData = parentVnode && parentVnode.data;
  15233. /* istanbul ignore else */
  15234. if (true) {
  15235. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  15236. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  15237. }, true);
  15238. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  15239. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  15240. }, true);
  15241. } else {}
  15242. }
  15243. var currentRenderingInstance = null;
  15244. function renderMixin (Vue) {
  15245. // install runtime convenience helpers
  15246. installRenderHelpers(Vue.prototype);
  15247. Vue.prototype.$nextTick = function (fn) {
  15248. return nextTick(fn, this)
  15249. };
  15250. Vue.prototype._render = function () {
  15251. var vm = this;
  15252. var ref = vm.$options;
  15253. var render = ref.render;
  15254. var _parentVnode = ref._parentVnode;
  15255. if (_parentVnode) {
  15256. vm.$scopedSlots = normalizeScopedSlots(
  15257. _parentVnode.data.scopedSlots,
  15258. vm.$slots,
  15259. vm.$scopedSlots
  15260. );
  15261. }
  15262. // set parent vnode. this allows render functions to have access
  15263. // to the data on the placeholder node.
  15264. vm.$vnode = _parentVnode;
  15265. // render self
  15266. var vnode;
  15267. try {
  15268. // There's no need to maintain a stack because all render fns are called
  15269. // separately from one another. Nested component's render fns are called
  15270. // when parent component is patched.
  15271. currentRenderingInstance = vm;
  15272. vnode = render.call(vm._renderProxy, vm.$createElement);
  15273. } catch (e) {
  15274. handleError(e, vm, "render");
  15275. // return error render result,
  15276. // or previous vnode to prevent render error causing blank component
  15277. /* istanbul ignore else */
  15278. if ( true && vm.$options.renderError) {
  15279. try {
  15280. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  15281. } catch (e) {
  15282. handleError(e, vm, "renderError");
  15283. vnode = vm._vnode;
  15284. }
  15285. } else {
  15286. vnode = vm._vnode;
  15287. }
  15288. } finally {
  15289. currentRenderingInstance = null;
  15290. }
  15291. // if the returned array contains only a single node, allow it
  15292. if (Array.isArray(vnode) && vnode.length === 1) {
  15293. vnode = vnode[0];
  15294. }
  15295. // return empty vnode in case the render function errored out
  15296. if (!(vnode instanceof VNode)) {
  15297. if ( true && Array.isArray(vnode)) {
  15298. warn(
  15299. 'Multiple root nodes returned from render function. Render function ' +
  15300. 'should return a single root node.',
  15301. vm
  15302. );
  15303. }
  15304. vnode = createEmptyVNode();
  15305. }
  15306. // set parent
  15307. vnode.parent = _parentVnode;
  15308. return vnode
  15309. };
  15310. }
  15311. /* */
  15312. function ensureCtor (comp, base) {
  15313. if (
  15314. comp.__esModule ||
  15315. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  15316. ) {
  15317. comp = comp.default;
  15318. }
  15319. return isObject(comp)
  15320. ? base.extend(comp)
  15321. : comp
  15322. }
  15323. function createAsyncPlaceholder (
  15324. factory,
  15325. data,
  15326. context,
  15327. children,
  15328. tag
  15329. ) {
  15330. var node = createEmptyVNode();
  15331. node.asyncFactory = factory;
  15332. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  15333. return node
  15334. }
  15335. function resolveAsyncComponent (
  15336. factory,
  15337. baseCtor
  15338. ) {
  15339. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  15340. return factory.errorComp
  15341. }
  15342. if (isDef(factory.resolved)) {
  15343. return factory.resolved
  15344. }
  15345. var owner = currentRenderingInstance;
  15346. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  15347. // already pending
  15348. factory.owners.push(owner);
  15349. }
  15350. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  15351. return factory.loadingComp
  15352. }
  15353. if (owner && !isDef(factory.owners)) {
  15354. var owners = factory.owners = [owner];
  15355. var sync = true;
  15356. var timerLoading = null;
  15357. var timerTimeout = null
  15358. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  15359. var forceRender = function (renderCompleted) {
  15360. for (var i = 0, l = owners.length; i < l; i++) {
  15361. (owners[i]).$forceUpdate();
  15362. }
  15363. if (renderCompleted) {
  15364. owners.length = 0;
  15365. if (timerLoading !== null) {
  15366. clearTimeout(timerLoading);
  15367. timerLoading = null;
  15368. }
  15369. if (timerTimeout !== null) {
  15370. clearTimeout(timerTimeout);
  15371. timerTimeout = null;
  15372. }
  15373. }
  15374. };
  15375. var resolve = once(function (res) {
  15376. // cache resolved
  15377. factory.resolved = ensureCtor(res, baseCtor);
  15378. // invoke callbacks only if this is not a synchronous resolve
  15379. // (async resolves are shimmed as synchronous during SSR)
  15380. if (!sync) {
  15381. forceRender(true);
  15382. } else {
  15383. owners.length = 0;
  15384. }
  15385. });
  15386. var reject = once(function (reason) {
  15387. true && warn(
  15388. "Failed to resolve async component: " + (String(factory)) +
  15389. (reason ? ("\nReason: " + reason) : '')
  15390. );
  15391. if (isDef(factory.errorComp)) {
  15392. factory.error = true;
  15393. forceRender(true);
  15394. }
  15395. });
  15396. var res = factory(resolve, reject);
  15397. if (isObject(res)) {
  15398. if (isPromise(res)) {
  15399. // () => Promise
  15400. if (isUndef(factory.resolved)) {
  15401. res.then(resolve, reject);
  15402. }
  15403. } else if (isPromise(res.component)) {
  15404. res.component.then(resolve, reject);
  15405. if (isDef(res.error)) {
  15406. factory.errorComp = ensureCtor(res.error, baseCtor);
  15407. }
  15408. if (isDef(res.loading)) {
  15409. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  15410. if (res.delay === 0) {
  15411. factory.loading = true;
  15412. } else {
  15413. timerLoading = setTimeout(function () {
  15414. timerLoading = null;
  15415. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  15416. factory.loading = true;
  15417. forceRender(false);
  15418. }
  15419. }, res.delay || 200);
  15420. }
  15421. }
  15422. if (isDef(res.timeout)) {
  15423. timerTimeout = setTimeout(function () {
  15424. timerTimeout = null;
  15425. if (isUndef(factory.resolved)) {
  15426. reject(
  15427. true
  15428. ? ("timeout (" + (res.timeout) + "ms)")
  15429. : undefined
  15430. );
  15431. }
  15432. }, res.timeout);
  15433. }
  15434. }
  15435. }
  15436. sync = false;
  15437. // return in case resolved synchronously
  15438. return factory.loading
  15439. ? factory.loadingComp
  15440. : factory.resolved
  15441. }
  15442. }
  15443. /* */
  15444. function isAsyncPlaceholder (node) {
  15445. return node.isComment && node.asyncFactory
  15446. }
  15447. /* */
  15448. function getFirstComponentChild (children) {
  15449. if (Array.isArray(children)) {
  15450. for (var i = 0; i < children.length; i++) {
  15451. var c = children[i];
  15452. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  15453. return c
  15454. }
  15455. }
  15456. }
  15457. }
  15458. /* */
  15459. /* */
  15460. function initEvents (vm) {
  15461. vm._events = Object.create(null);
  15462. vm._hasHookEvent = false;
  15463. // init parent attached events
  15464. var listeners = vm.$options._parentListeners;
  15465. if (listeners) {
  15466. updateComponentListeners(vm, listeners);
  15467. }
  15468. }
  15469. var target;
  15470. function add (event, fn) {
  15471. target.$on(event, fn);
  15472. }
  15473. function remove$1 (event, fn) {
  15474. target.$off(event, fn);
  15475. }
  15476. function createOnceHandler (event, fn) {
  15477. var _target = target;
  15478. return function onceHandler () {
  15479. var res = fn.apply(null, arguments);
  15480. if (res !== null) {
  15481. _target.$off(event, onceHandler);
  15482. }
  15483. }
  15484. }
  15485. function updateComponentListeners (
  15486. vm,
  15487. listeners,
  15488. oldListeners
  15489. ) {
  15490. target = vm;
  15491. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  15492. target = undefined;
  15493. }
  15494. function eventsMixin (Vue) {
  15495. var hookRE = /^hook:/;
  15496. Vue.prototype.$on = function (event, fn) {
  15497. var vm = this;
  15498. if (Array.isArray(event)) {
  15499. for (var i = 0, l = event.length; i < l; i++) {
  15500. vm.$on(event[i], fn);
  15501. }
  15502. } else {
  15503. (vm._events[event] || (vm._events[event] = [])).push(fn);
  15504. // optimize hook:event cost by using a boolean flag marked at registration
  15505. // instead of a hash lookup
  15506. if (hookRE.test(event)) {
  15507. vm._hasHookEvent = true;
  15508. }
  15509. }
  15510. return vm
  15511. };
  15512. Vue.prototype.$once = function (event, fn) {
  15513. var vm = this;
  15514. function on () {
  15515. vm.$off(event, on);
  15516. fn.apply(vm, arguments);
  15517. }
  15518. on.fn = fn;
  15519. vm.$on(event, on);
  15520. return vm
  15521. };
  15522. Vue.prototype.$off = function (event, fn) {
  15523. var vm = this;
  15524. // all
  15525. if (!arguments.length) {
  15526. vm._events = Object.create(null);
  15527. return vm
  15528. }
  15529. // array of events
  15530. if (Array.isArray(event)) {
  15531. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  15532. vm.$off(event[i$1], fn);
  15533. }
  15534. return vm
  15535. }
  15536. // specific event
  15537. var cbs = vm._events[event];
  15538. if (!cbs) {
  15539. return vm
  15540. }
  15541. if (!fn) {
  15542. vm._events[event] = null;
  15543. return vm
  15544. }
  15545. // specific handler
  15546. var cb;
  15547. var i = cbs.length;
  15548. while (i--) {
  15549. cb = cbs[i];
  15550. if (cb === fn || cb.fn === fn) {
  15551. cbs.splice(i, 1);
  15552. break
  15553. }
  15554. }
  15555. return vm
  15556. };
  15557. Vue.prototype.$emit = function (event) {
  15558. var vm = this;
  15559. if (true) {
  15560. var lowerCaseEvent = event.toLowerCase();
  15561. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  15562. tip(
  15563. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  15564. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  15565. "Note that HTML attributes are case-insensitive and you cannot use " +
  15566. "v-on to listen to camelCase events when using in-DOM templates. " +
  15567. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  15568. );
  15569. }
  15570. }
  15571. var cbs = vm._events[event];
  15572. if (cbs) {
  15573. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  15574. var args = toArray(arguments, 1);
  15575. var info = "event handler for \"" + event + "\"";
  15576. for (var i = 0, l = cbs.length; i < l; i++) {
  15577. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  15578. }
  15579. }
  15580. return vm
  15581. };
  15582. }
  15583. /* */
  15584. var activeInstance = null;
  15585. var isUpdatingChildComponent = false;
  15586. function setActiveInstance(vm) {
  15587. var prevActiveInstance = activeInstance;
  15588. activeInstance = vm;
  15589. return function () {
  15590. activeInstance = prevActiveInstance;
  15591. }
  15592. }
  15593. function initLifecycle (vm) {
  15594. var options = vm.$options;
  15595. // locate first non-abstract parent
  15596. var parent = options.parent;
  15597. if (parent && !options.abstract) {
  15598. while (parent.$options.abstract && parent.$parent) {
  15599. parent = parent.$parent;
  15600. }
  15601. parent.$children.push(vm);
  15602. }
  15603. vm.$parent = parent;
  15604. vm.$root = parent ? parent.$root : vm;
  15605. vm.$children = [];
  15606. vm.$refs = {};
  15607. vm._watcher = null;
  15608. vm._inactive = null;
  15609. vm._directInactive = false;
  15610. vm._isMounted = false;
  15611. vm._isDestroyed = false;
  15612. vm._isBeingDestroyed = false;
  15613. }
  15614. function lifecycleMixin (Vue) {
  15615. Vue.prototype._update = function (vnode, hydrating) {
  15616. var vm = this;
  15617. var prevEl = vm.$el;
  15618. var prevVnode = vm._vnode;
  15619. var restoreActiveInstance = setActiveInstance(vm);
  15620. vm._vnode = vnode;
  15621. // Vue.prototype.__patch__ is injected in entry points
  15622. // based on the rendering backend used.
  15623. if (!prevVnode) {
  15624. // initial render
  15625. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  15626. } else {
  15627. // updates
  15628. vm.$el = vm.__patch__(prevVnode, vnode);
  15629. }
  15630. restoreActiveInstance();
  15631. // update __vue__ reference
  15632. if (prevEl) {
  15633. prevEl.__vue__ = null;
  15634. }
  15635. if (vm.$el) {
  15636. vm.$el.__vue__ = vm;
  15637. }
  15638. // if parent is an HOC, update its $el as well
  15639. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  15640. vm.$parent.$el = vm.$el;
  15641. }
  15642. // updated hook is called by the scheduler to ensure that children are
  15643. // updated in a parent's updated hook.
  15644. };
  15645. Vue.prototype.$forceUpdate = function () {
  15646. var vm = this;
  15647. if (vm._watcher) {
  15648. vm._watcher.update();
  15649. }
  15650. };
  15651. Vue.prototype.$destroy = function () {
  15652. var vm = this;
  15653. if (vm._isBeingDestroyed) {
  15654. return
  15655. }
  15656. callHook(vm, 'beforeDestroy');
  15657. vm._isBeingDestroyed = true;
  15658. // remove self from parent
  15659. var parent = vm.$parent;
  15660. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  15661. remove(parent.$children, vm);
  15662. }
  15663. // teardown watchers
  15664. if (vm._watcher) {
  15665. vm._watcher.teardown();
  15666. }
  15667. var i = vm._watchers.length;
  15668. while (i--) {
  15669. vm._watchers[i].teardown();
  15670. }
  15671. // remove reference from data ob
  15672. // frozen object may not have observer.
  15673. if (vm._data.__ob__) {
  15674. vm._data.__ob__.vmCount--;
  15675. }
  15676. // call the last hook...
  15677. vm._isDestroyed = true;
  15678. // invoke destroy hooks on current rendered tree
  15679. vm.__patch__(vm._vnode, null);
  15680. // fire destroyed hook
  15681. callHook(vm, 'destroyed');
  15682. // turn off all instance listeners.
  15683. vm.$off();
  15684. // remove __vue__ reference
  15685. if (vm.$el) {
  15686. vm.$el.__vue__ = null;
  15687. }
  15688. // release circular reference (#6759)
  15689. if (vm.$vnode) {
  15690. vm.$vnode.parent = null;
  15691. }
  15692. };
  15693. }
  15694. function updateChildComponent (
  15695. vm,
  15696. propsData,
  15697. listeners,
  15698. parentVnode,
  15699. renderChildren
  15700. ) {
  15701. if (true) {
  15702. isUpdatingChildComponent = true;
  15703. }
  15704. // determine whether component has slot children
  15705. // we need to do this before overwriting $options._renderChildren.
  15706. // check if there are dynamic scopedSlots (hand-written or compiled but with
  15707. // dynamic slot names). Static scoped slots compiled from template has the
  15708. // "$stable" marker.
  15709. var newScopedSlots = parentVnode.data.scopedSlots;
  15710. var oldScopedSlots = vm.$scopedSlots;
  15711. var hasDynamicScopedSlot = !!(
  15712. (newScopedSlots && !newScopedSlots.$stable) ||
  15713. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  15714. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  15715. );
  15716. // Any static slot children from the parent may have changed during parent's
  15717. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  15718. // update is necessary to ensure correctness.
  15719. var needsForceUpdate = !!(
  15720. renderChildren || // has new static slots
  15721. vm.$options._renderChildren || // has old static slots
  15722. hasDynamicScopedSlot
  15723. );
  15724. vm.$options._parentVnode = parentVnode;
  15725. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  15726. if (vm._vnode) { // update child tree's parent
  15727. vm._vnode.parent = parentVnode;
  15728. }
  15729. vm.$options._renderChildren = renderChildren;
  15730. // update $attrs and $listeners hash
  15731. // these are also reactive so they may trigger child update if the child
  15732. // used them during render
  15733. vm.$attrs = parentVnode.data.attrs || emptyObject;
  15734. vm.$listeners = listeners || emptyObject;
  15735. // update props
  15736. if (propsData && vm.$options.props) {
  15737. toggleObserving(false);
  15738. var props = vm._props;
  15739. var propKeys = vm.$options._propKeys || [];
  15740. for (var i = 0; i < propKeys.length; i++) {
  15741. var key = propKeys[i];
  15742. var propOptions = vm.$options.props; // wtf flow?
  15743. props[key] = validateProp(key, propOptions, propsData, vm);
  15744. }
  15745. toggleObserving(true);
  15746. // keep a copy of raw propsData
  15747. vm.$options.propsData = propsData;
  15748. }
  15749. // fixed by xxxxxx update properties(mp runtime)
  15750. vm._$updateProperties && vm._$updateProperties(vm);
  15751. // update listeners
  15752. listeners = listeners || emptyObject;
  15753. var oldListeners = vm.$options._parentListeners;
  15754. vm.$options._parentListeners = listeners;
  15755. updateComponentListeners(vm, listeners, oldListeners);
  15756. // resolve slots + force update if has children
  15757. if (needsForceUpdate) {
  15758. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  15759. vm.$forceUpdate();
  15760. }
  15761. if (true) {
  15762. isUpdatingChildComponent = false;
  15763. }
  15764. }
  15765. function isInInactiveTree (vm) {
  15766. while (vm && (vm = vm.$parent)) {
  15767. if (vm._inactive) { return true }
  15768. }
  15769. return false
  15770. }
  15771. function activateChildComponent (vm, direct) {
  15772. if (direct) {
  15773. vm._directInactive = false;
  15774. if (isInInactiveTree(vm)) {
  15775. return
  15776. }
  15777. } else if (vm._directInactive) {
  15778. return
  15779. }
  15780. if (vm._inactive || vm._inactive === null) {
  15781. vm._inactive = false;
  15782. for (var i = 0; i < vm.$children.length; i++) {
  15783. activateChildComponent(vm.$children[i]);
  15784. }
  15785. callHook(vm, 'activated');
  15786. }
  15787. }
  15788. function deactivateChildComponent (vm, direct) {
  15789. if (direct) {
  15790. vm._directInactive = true;
  15791. if (isInInactiveTree(vm)) {
  15792. return
  15793. }
  15794. }
  15795. if (!vm._inactive) {
  15796. vm._inactive = true;
  15797. for (var i = 0; i < vm.$children.length; i++) {
  15798. deactivateChildComponent(vm.$children[i]);
  15799. }
  15800. callHook(vm, 'deactivated');
  15801. }
  15802. }
  15803. function callHook (vm, hook) {
  15804. // #7573 disable dep collection when invoking lifecycle hooks
  15805. pushTarget();
  15806. var handlers = vm.$options[hook];
  15807. var info = hook + " hook";
  15808. if (handlers) {
  15809. for (var i = 0, j = handlers.length; i < j; i++) {
  15810. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  15811. }
  15812. }
  15813. if (vm._hasHookEvent) {
  15814. vm.$emit('hook:' + hook);
  15815. }
  15816. popTarget();
  15817. }
  15818. /* */
  15819. var MAX_UPDATE_COUNT = 100;
  15820. var queue = [];
  15821. var activatedChildren = [];
  15822. var has = {};
  15823. var circular = {};
  15824. var waiting = false;
  15825. var flushing = false;
  15826. var index = 0;
  15827. /**
  15828. * Reset the scheduler's state.
  15829. */
  15830. function resetSchedulerState () {
  15831. index = queue.length = activatedChildren.length = 0;
  15832. has = {};
  15833. if (true) {
  15834. circular = {};
  15835. }
  15836. waiting = flushing = false;
  15837. }
  15838. // Async edge case #6566 requires saving the timestamp when event listeners are
  15839. // attached. However, calling performance.now() has a perf overhead especially
  15840. // if the page has thousands of event listeners. Instead, we take a timestamp
  15841. // every time the scheduler flushes and use that for all event listeners
  15842. // attached during that flush.
  15843. var currentFlushTimestamp = 0;
  15844. // Async edge case fix requires storing an event listener's attach timestamp.
  15845. var getNow = Date.now;
  15846. // Determine what event timestamp the browser is using. Annoyingly, the
  15847. // timestamp can either be hi-res (relative to page load) or low-res
  15848. // (relative to UNIX epoch), so in order to compare time we have to use the
  15849. // same timestamp type when saving the flush timestamp.
  15850. // All IE versions use low-res event timestamps, and have problematic clock
  15851. // implementations (#9632)
  15852. if (inBrowser && !isIE) {
  15853. var performance = window.performance;
  15854. if (
  15855. performance &&
  15856. typeof performance.now === 'function' &&
  15857. getNow() > document.createEvent('Event').timeStamp
  15858. ) {
  15859. // if the event timestamp, although evaluated AFTER the Date.now(), is
  15860. // smaller than it, it means the event is using a hi-res timestamp,
  15861. // and we need to use the hi-res version for event listener timestamps as
  15862. // well.
  15863. getNow = function () { return performance.now(); };
  15864. }
  15865. }
  15866. /**
  15867. * Flush both queues and run the watchers.
  15868. */
  15869. function flushSchedulerQueue () {
  15870. currentFlushTimestamp = getNow();
  15871. flushing = true;
  15872. var watcher, id;
  15873. // Sort queue before flush.
  15874. // This ensures that:
  15875. // 1. Components are updated from parent to child. (because parent is always
  15876. // created before the child)
  15877. // 2. A component's user watchers are run before its render watcher (because
  15878. // user watchers are created before the render watcher)
  15879. // 3. If a component is destroyed during a parent component's watcher run,
  15880. // its watchers can be skipped.
  15881. queue.sort(function (a, b) { return a.id - b.id; });
  15882. // do not cache length because more watchers might be pushed
  15883. // as we run existing watchers
  15884. for (index = 0; index < queue.length; index++) {
  15885. watcher = queue[index];
  15886. if (watcher.before) {
  15887. watcher.before();
  15888. }
  15889. id = watcher.id;
  15890. has[id] = null;
  15891. watcher.run();
  15892. // in dev build, check and stop circular updates.
  15893. if ( true && has[id] != null) {
  15894. circular[id] = (circular[id] || 0) + 1;
  15895. if (circular[id] > MAX_UPDATE_COUNT) {
  15896. warn(
  15897. 'You may have an infinite update loop ' + (
  15898. watcher.user
  15899. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  15900. : "in a component render function."
  15901. ),
  15902. watcher.vm
  15903. );
  15904. break
  15905. }
  15906. }
  15907. }
  15908. // keep copies of post queues before resetting state
  15909. var activatedQueue = activatedChildren.slice();
  15910. var updatedQueue = queue.slice();
  15911. resetSchedulerState();
  15912. // call component updated and activated hooks
  15913. callActivatedHooks(activatedQueue);
  15914. callUpdatedHooks(updatedQueue);
  15915. // devtool hook
  15916. /* istanbul ignore if */
  15917. if (devtools && config.devtools) {
  15918. devtools.emit('flush');
  15919. }
  15920. }
  15921. function callUpdatedHooks (queue) {
  15922. var i = queue.length;
  15923. while (i--) {
  15924. var watcher = queue[i];
  15925. var vm = watcher.vm;
  15926. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  15927. callHook(vm, 'updated');
  15928. }
  15929. }
  15930. }
  15931. /**
  15932. * Queue a kept-alive component that was activated during patch.
  15933. * The queue will be processed after the entire tree has been patched.
  15934. */
  15935. function queueActivatedComponent (vm) {
  15936. // setting _inactive to false here so that a render function can
  15937. // rely on checking whether it's in an inactive tree (e.g. router-view)
  15938. vm._inactive = false;
  15939. activatedChildren.push(vm);
  15940. }
  15941. function callActivatedHooks (queue) {
  15942. for (var i = 0; i < queue.length; i++) {
  15943. queue[i]._inactive = true;
  15944. activateChildComponent(queue[i], true /* true */);
  15945. }
  15946. }
  15947. /**
  15948. * Push a watcher into the watcher queue.
  15949. * Jobs with duplicate IDs will be skipped unless it's
  15950. * pushed when the queue is being flushed.
  15951. */
  15952. function queueWatcher (watcher) {
  15953. var id = watcher.id;
  15954. if (has[id] == null) {
  15955. has[id] = true;
  15956. if (!flushing) {
  15957. queue.push(watcher);
  15958. } else {
  15959. // if already flushing, splice the watcher based on its id
  15960. // if already past its id, it will be run next immediately.
  15961. var i = queue.length - 1;
  15962. while (i > index && queue[i].id > watcher.id) {
  15963. i--;
  15964. }
  15965. queue.splice(i + 1, 0, watcher);
  15966. }
  15967. // queue the flush
  15968. if (!waiting) {
  15969. waiting = true;
  15970. if ( true && !config.async) {
  15971. flushSchedulerQueue();
  15972. return
  15973. }
  15974. nextTick(flushSchedulerQueue);
  15975. }
  15976. }
  15977. }
  15978. /* */
  15979. var uid$2 = 0;
  15980. /**
  15981. * A watcher parses an expression, collects dependencies,
  15982. * and fires callback when the expression value changes.
  15983. * This is used for both the $watch() api and directives.
  15984. */
  15985. var Watcher = function Watcher (
  15986. vm,
  15987. expOrFn,
  15988. cb,
  15989. options,
  15990. isRenderWatcher
  15991. ) {
  15992. this.vm = vm;
  15993. if (isRenderWatcher) {
  15994. vm._watcher = this;
  15995. }
  15996. vm._watchers.push(this);
  15997. // options
  15998. if (options) {
  15999. this.deep = !!options.deep;
  16000. this.user = !!options.user;
  16001. this.lazy = !!options.lazy;
  16002. this.sync = !!options.sync;
  16003. this.before = options.before;
  16004. } else {
  16005. this.deep = this.user = this.lazy = this.sync = false;
  16006. }
  16007. this.cb = cb;
  16008. this.id = ++uid$2; // uid for batching
  16009. this.active = true;
  16010. this.dirty = this.lazy; // for lazy watchers
  16011. this.deps = [];
  16012. this.newDeps = [];
  16013. this.depIds = new _Set();
  16014. this.newDepIds = new _Set();
  16015. this.expression = true
  16016. ? expOrFn.toString()
  16017. : undefined;
  16018. // parse expression for getter
  16019. if (typeof expOrFn === 'function') {
  16020. this.getter = expOrFn;
  16021. } else {
  16022. this.getter = parsePath(expOrFn);
  16023. if (!this.getter) {
  16024. this.getter = noop;
  16025. true && warn(
  16026. "Failed watching path: \"" + expOrFn + "\" " +
  16027. 'Watcher only accepts simple dot-delimited paths. ' +
  16028. 'For full control, use a function instead.',
  16029. vm
  16030. );
  16031. }
  16032. }
  16033. this.value = this.lazy
  16034. ? undefined
  16035. : this.get();
  16036. };
  16037. /**
  16038. * Evaluate the getter, and re-collect dependencies.
  16039. */
  16040. Watcher.prototype.get = function get () {
  16041. pushTarget(this);
  16042. var value;
  16043. var vm = this.vm;
  16044. try {
  16045. value = this.getter.call(vm, vm);
  16046. } catch (e) {
  16047. if (this.user) {
  16048. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  16049. } else {
  16050. throw e
  16051. }
  16052. } finally {
  16053. // "touch" every property so they are all tracked as
  16054. // dependencies for deep watching
  16055. if (this.deep) {
  16056. traverse(value);
  16057. }
  16058. popTarget();
  16059. this.cleanupDeps();
  16060. }
  16061. return value
  16062. };
  16063. /**
  16064. * Add a dependency to this directive.
  16065. */
  16066. Watcher.prototype.addDep = function addDep (dep) {
  16067. var id = dep.id;
  16068. if (!this.newDepIds.has(id)) {
  16069. this.newDepIds.add(id);
  16070. this.newDeps.push(dep);
  16071. if (!this.depIds.has(id)) {
  16072. dep.addSub(this);
  16073. }
  16074. }
  16075. };
  16076. /**
  16077. * Clean up for dependency collection.
  16078. */
  16079. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  16080. var i = this.deps.length;
  16081. while (i--) {
  16082. var dep = this.deps[i];
  16083. if (!this.newDepIds.has(dep.id)) {
  16084. dep.removeSub(this);
  16085. }
  16086. }
  16087. var tmp = this.depIds;
  16088. this.depIds = this.newDepIds;
  16089. this.newDepIds = tmp;
  16090. this.newDepIds.clear();
  16091. tmp = this.deps;
  16092. this.deps = this.newDeps;
  16093. this.newDeps = tmp;
  16094. this.newDeps.length = 0;
  16095. };
  16096. /**
  16097. * Subscriber interface.
  16098. * Will be called when a dependency changes.
  16099. */
  16100. Watcher.prototype.update = function update () {
  16101. /* istanbul ignore else */
  16102. if (this.lazy) {
  16103. this.dirty = true;
  16104. } else if (this.sync) {
  16105. this.run();
  16106. } else {
  16107. queueWatcher(this);
  16108. }
  16109. };
  16110. /**
  16111. * Scheduler job interface.
  16112. * Will be called by the scheduler.
  16113. */
  16114. Watcher.prototype.run = function run () {
  16115. if (this.active) {
  16116. var value = this.get();
  16117. if (
  16118. value !== this.value ||
  16119. // Deep watchers and watchers on Object/Arrays should fire even
  16120. // when the value is the same, because the value may
  16121. // have mutated.
  16122. isObject(value) ||
  16123. this.deep
  16124. ) {
  16125. // set new value
  16126. var oldValue = this.value;
  16127. this.value = value;
  16128. if (this.user) {
  16129. try {
  16130. this.cb.call(this.vm, value, oldValue);
  16131. } catch (e) {
  16132. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  16133. }
  16134. } else {
  16135. this.cb.call(this.vm, value, oldValue);
  16136. }
  16137. }
  16138. }
  16139. };
  16140. /**
  16141. * Evaluate the value of the watcher.
  16142. * This only gets called for lazy watchers.
  16143. */
  16144. Watcher.prototype.evaluate = function evaluate () {
  16145. this.value = this.get();
  16146. this.dirty = false;
  16147. };
  16148. /**
  16149. * Depend on all deps collected by this watcher.
  16150. */
  16151. Watcher.prototype.depend = function depend () {
  16152. var i = this.deps.length;
  16153. while (i--) {
  16154. this.deps[i].depend();
  16155. }
  16156. };
  16157. /**
  16158. * Remove self from all dependencies' subscriber list.
  16159. */
  16160. Watcher.prototype.teardown = function teardown () {
  16161. if (this.active) {
  16162. // remove self from vm's watcher list
  16163. // this is a somewhat expensive operation so we skip it
  16164. // if the vm is being destroyed.
  16165. if (!this.vm._isBeingDestroyed) {
  16166. remove(this.vm._watchers, this);
  16167. }
  16168. var i = this.deps.length;
  16169. while (i--) {
  16170. this.deps[i].removeSub(this);
  16171. }
  16172. this.active = false;
  16173. }
  16174. };
  16175. /* */
  16176. var sharedPropertyDefinition = {
  16177. enumerable: true,
  16178. configurable: true,
  16179. get: noop,
  16180. set: noop
  16181. };
  16182. function proxy (target, sourceKey, key) {
  16183. sharedPropertyDefinition.get = function proxyGetter () {
  16184. return this[sourceKey][key]
  16185. };
  16186. sharedPropertyDefinition.set = function proxySetter (val) {
  16187. this[sourceKey][key] = val;
  16188. };
  16189. Object.defineProperty(target, key, sharedPropertyDefinition);
  16190. }
  16191. function initState (vm) {
  16192. vm._watchers = [];
  16193. var opts = vm.$options;
  16194. if (opts.props) { initProps(vm, opts.props); }
  16195. if (opts.methods) { initMethods(vm, opts.methods); }
  16196. if (opts.data) {
  16197. initData(vm);
  16198. } else {
  16199. observe(vm._data = {}, true /* asRootData */);
  16200. }
  16201. if (opts.computed) { initComputed(vm, opts.computed); }
  16202. if (opts.watch && opts.watch !== nativeWatch) {
  16203. initWatch(vm, opts.watch);
  16204. }
  16205. }
  16206. function initProps (vm, propsOptions) {
  16207. var propsData = vm.$options.propsData || {};
  16208. var props = vm._props = {};
  16209. // cache prop keys so that future props updates can iterate using Array
  16210. // instead of dynamic object key enumeration.
  16211. var keys = vm.$options._propKeys = [];
  16212. var isRoot = !vm.$parent;
  16213. // root instance props should be converted
  16214. if (!isRoot) {
  16215. toggleObserving(false);
  16216. }
  16217. var loop = function ( key ) {
  16218. keys.push(key);
  16219. var value = validateProp(key, propsOptions, propsData, vm);
  16220. /* istanbul ignore else */
  16221. if (true) {
  16222. var hyphenatedKey = hyphenate(key);
  16223. if (isReservedAttribute(hyphenatedKey) ||
  16224. config.isReservedAttr(hyphenatedKey)) {
  16225. warn(
  16226. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  16227. vm
  16228. );
  16229. }
  16230. defineReactive$$1(props, key, value, function () {
  16231. if (!isRoot && !isUpdatingChildComponent) {
  16232. {
  16233. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  16234. return
  16235. }
  16236. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  16237. if(
  16238. key === 'value' &&
  16239. Array.isArray(vm.$options.behaviors) &&
  16240. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  16241. ){
  16242. return
  16243. }
  16244. if(vm._getFormData){
  16245. return
  16246. }
  16247. var $parent = vm.$parent;
  16248. while($parent){
  16249. if($parent.__next_tick_pending){
  16250. return
  16251. }
  16252. $parent = $parent.$parent;
  16253. }
  16254. }
  16255. warn(
  16256. "Avoid mutating a prop directly since the value will be " +
  16257. "overwritten whenever the parent component re-renders. " +
  16258. "Instead, use a data or computed property based on the prop's " +
  16259. "value. Prop being mutated: \"" + key + "\"",
  16260. vm
  16261. );
  16262. }
  16263. });
  16264. } else {}
  16265. // static props are already proxied on the component's prototype
  16266. // during Vue.extend(). We only need to proxy props defined at
  16267. // instantiation here.
  16268. if (!(key in vm)) {
  16269. proxy(vm, "_props", key);
  16270. }
  16271. };
  16272. for (var key in propsOptions) loop( key );
  16273. toggleObserving(true);
  16274. }
  16275. function initData (vm) {
  16276. var data = vm.$options.data;
  16277. data = vm._data = typeof data === 'function'
  16278. ? getData(data, vm)
  16279. : data || {};
  16280. if (!isPlainObject(data)) {
  16281. data = {};
  16282. true && warn(
  16283. 'data functions should return an object:\n' +
  16284. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  16285. vm
  16286. );
  16287. }
  16288. // proxy data on instance
  16289. var keys = Object.keys(data);
  16290. var props = vm.$options.props;
  16291. var methods = vm.$options.methods;
  16292. var i = keys.length;
  16293. while (i--) {
  16294. var key = keys[i];
  16295. if (true) {
  16296. if (methods && hasOwn(methods, key)) {
  16297. warn(
  16298. ("Method \"" + key + "\" has already been defined as a data property."),
  16299. vm
  16300. );
  16301. }
  16302. }
  16303. if (props && hasOwn(props, key)) {
  16304. true && warn(
  16305. "The data property \"" + key + "\" is already declared as a prop. " +
  16306. "Use prop default value instead.",
  16307. vm
  16308. );
  16309. } else if (!isReserved(key)) {
  16310. proxy(vm, "_data", key);
  16311. }
  16312. }
  16313. // observe data
  16314. observe(data, true /* asRootData */);
  16315. }
  16316. function getData (data, vm) {
  16317. // #7573 disable dep collection when invoking data getters
  16318. pushTarget();
  16319. try {
  16320. return data.call(vm, vm)
  16321. } catch (e) {
  16322. handleError(e, vm, "data()");
  16323. return {}
  16324. } finally {
  16325. popTarget();
  16326. }
  16327. }
  16328. var computedWatcherOptions = { lazy: true };
  16329. function initComputed (vm, computed) {
  16330. // $flow-disable-line
  16331. var watchers = vm._computedWatchers = Object.create(null);
  16332. // computed properties are just getters during SSR
  16333. var isSSR = isServerRendering();
  16334. for (var key in computed) {
  16335. var userDef = computed[key];
  16336. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  16337. if ( true && getter == null) {
  16338. warn(
  16339. ("Getter is missing for computed property \"" + key + "\"."),
  16340. vm
  16341. );
  16342. }
  16343. if (!isSSR) {
  16344. // create internal watcher for the computed property.
  16345. watchers[key] = new Watcher(
  16346. vm,
  16347. getter || noop,
  16348. noop,
  16349. computedWatcherOptions
  16350. );
  16351. }
  16352. // component-defined computed properties are already defined on the
  16353. // component prototype. We only need to define computed properties defined
  16354. // at instantiation here.
  16355. if (!(key in vm)) {
  16356. defineComputed(vm, key, userDef);
  16357. } else if (true) {
  16358. if (key in vm.$data) {
  16359. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  16360. } else if (vm.$options.props && key in vm.$options.props) {
  16361. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  16362. }
  16363. }
  16364. }
  16365. }
  16366. function defineComputed (
  16367. target,
  16368. key,
  16369. userDef
  16370. ) {
  16371. var shouldCache = !isServerRendering();
  16372. if (typeof userDef === 'function') {
  16373. sharedPropertyDefinition.get = shouldCache
  16374. ? createComputedGetter(key)
  16375. : createGetterInvoker(userDef);
  16376. sharedPropertyDefinition.set = noop;
  16377. } else {
  16378. sharedPropertyDefinition.get = userDef.get
  16379. ? shouldCache && userDef.cache !== false
  16380. ? createComputedGetter(key)
  16381. : createGetterInvoker(userDef.get)
  16382. : noop;
  16383. sharedPropertyDefinition.set = userDef.set || noop;
  16384. }
  16385. if ( true &&
  16386. sharedPropertyDefinition.set === noop) {
  16387. sharedPropertyDefinition.set = function () {
  16388. warn(
  16389. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  16390. this
  16391. );
  16392. };
  16393. }
  16394. Object.defineProperty(target, key, sharedPropertyDefinition);
  16395. }
  16396. function createComputedGetter (key) {
  16397. return function computedGetter () {
  16398. var watcher = this._computedWatchers && this._computedWatchers[key];
  16399. if (watcher) {
  16400. if (watcher.dirty) {
  16401. watcher.evaluate();
  16402. }
  16403. if (Dep.SharedObject.target) {// fixed by xxxxxx
  16404. watcher.depend();
  16405. }
  16406. return watcher.value
  16407. }
  16408. }
  16409. }
  16410. function createGetterInvoker(fn) {
  16411. return function computedGetter () {
  16412. return fn.call(this, this)
  16413. }
  16414. }
  16415. function initMethods (vm, methods) {
  16416. var props = vm.$options.props;
  16417. for (var key in methods) {
  16418. if (true) {
  16419. if (typeof methods[key] !== 'function') {
  16420. warn(
  16421. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  16422. "Did you reference the function correctly?",
  16423. vm
  16424. );
  16425. }
  16426. if (props && hasOwn(props, key)) {
  16427. warn(
  16428. ("Method \"" + key + "\" has already been defined as a prop."),
  16429. vm
  16430. );
  16431. }
  16432. if ((key in vm) && isReserved(key)) {
  16433. warn(
  16434. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  16435. "Avoid defining component methods that start with _ or $."
  16436. );
  16437. }
  16438. }
  16439. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  16440. }
  16441. }
  16442. function initWatch (vm, watch) {
  16443. for (var key in watch) {
  16444. var handler = watch[key];
  16445. if (Array.isArray(handler)) {
  16446. for (var i = 0; i < handler.length; i++) {
  16447. createWatcher(vm, key, handler[i]);
  16448. }
  16449. } else {
  16450. createWatcher(vm, key, handler);
  16451. }
  16452. }
  16453. }
  16454. function createWatcher (
  16455. vm,
  16456. expOrFn,
  16457. handler,
  16458. options
  16459. ) {
  16460. if (isPlainObject(handler)) {
  16461. options = handler;
  16462. handler = handler.handler;
  16463. }
  16464. if (typeof handler === 'string') {
  16465. handler = vm[handler];
  16466. }
  16467. return vm.$watch(expOrFn, handler, options)
  16468. }
  16469. function stateMixin (Vue) {
  16470. // flow somehow has problems with directly declared definition object
  16471. // when using Object.defineProperty, so we have to procedurally build up
  16472. // the object here.
  16473. var dataDef = {};
  16474. dataDef.get = function () { return this._data };
  16475. var propsDef = {};
  16476. propsDef.get = function () { return this._props };
  16477. if (true) {
  16478. dataDef.set = function () {
  16479. warn(
  16480. 'Avoid replacing instance root $data. ' +
  16481. 'Use nested data properties instead.',
  16482. this
  16483. );
  16484. };
  16485. propsDef.set = function () {
  16486. warn("$props is readonly.", this);
  16487. };
  16488. }
  16489. Object.defineProperty(Vue.prototype, '$data', dataDef);
  16490. Object.defineProperty(Vue.prototype, '$props', propsDef);
  16491. Vue.prototype.$set = set;
  16492. Vue.prototype.$delete = del;
  16493. Vue.prototype.$watch = function (
  16494. expOrFn,
  16495. cb,
  16496. options
  16497. ) {
  16498. var vm = this;
  16499. if (isPlainObject(cb)) {
  16500. return createWatcher(vm, expOrFn, cb, options)
  16501. }
  16502. options = options || {};
  16503. options.user = true;
  16504. var watcher = new Watcher(vm, expOrFn, cb, options);
  16505. if (options.immediate) {
  16506. try {
  16507. cb.call(vm, watcher.value);
  16508. } catch (error) {
  16509. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  16510. }
  16511. }
  16512. return function unwatchFn () {
  16513. watcher.teardown();
  16514. }
  16515. };
  16516. }
  16517. /* */
  16518. var uid$3 = 0;
  16519. function initMixin (Vue) {
  16520. Vue.prototype._init = function (options) {
  16521. var vm = this;
  16522. // a uid
  16523. vm._uid = uid$3++;
  16524. var startTag, endTag;
  16525. /* istanbul ignore if */
  16526. if ( true && config.performance && mark) {
  16527. startTag = "vue-perf-start:" + (vm._uid);
  16528. endTag = "vue-perf-end:" + (vm._uid);
  16529. mark(startTag);
  16530. }
  16531. // a flag to avoid this being observed
  16532. vm._isVue = true;
  16533. // merge options
  16534. if (options && options._isComponent) {
  16535. // optimize internal component instantiation
  16536. // since dynamic options merging is pretty slow, and none of the
  16537. // internal component options needs special treatment.
  16538. initInternalComponent(vm, options);
  16539. } else {
  16540. vm.$options = mergeOptions(
  16541. resolveConstructorOptions(vm.constructor),
  16542. options || {},
  16543. vm
  16544. );
  16545. }
  16546. /* istanbul ignore else */
  16547. if (true) {
  16548. initProxy(vm);
  16549. } else {}
  16550. // expose real self
  16551. vm._self = vm;
  16552. initLifecycle(vm);
  16553. initEvents(vm);
  16554. initRender(vm);
  16555. callHook(vm, 'beforeCreate');
  16556. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  16557. initState(vm);
  16558. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  16559. !vm._$fallback && callHook(vm, 'created');
  16560. /* istanbul ignore if */
  16561. if ( true && config.performance && mark) {
  16562. vm._name = formatComponentName(vm, false);
  16563. mark(endTag);
  16564. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  16565. }
  16566. if (vm.$options.el) {
  16567. vm.$mount(vm.$options.el);
  16568. }
  16569. };
  16570. }
  16571. function initInternalComponent (vm, options) {
  16572. var opts = vm.$options = Object.create(vm.constructor.options);
  16573. // doing this because it's faster than dynamic enumeration.
  16574. var parentVnode = options._parentVnode;
  16575. opts.parent = options.parent;
  16576. opts._parentVnode = parentVnode;
  16577. var vnodeComponentOptions = parentVnode.componentOptions;
  16578. opts.propsData = vnodeComponentOptions.propsData;
  16579. opts._parentListeners = vnodeComponentOptions.listeners;
  16580. opts._renderChildren = vnodeComponentOptions.children;
  16581. opts._componentTag = vnodeComponentOptions.tag;
  16582. if (options.render) {
  16583. opts.render = options.render;
  16584. opts.staticRenderFns = options.staticRenderFns;
  16585. }
  16586. }
  16587. function resolveConstructorOptions (Ctor) {
  16588. var options = Ctor.options;
  16589. if (Ctor.super) {
  16590. var superOptions = resolveConstructorOptions(Ctor.super);
  16591. var cachedSuperOptions = Ctor.superOptions;
  16592. if (superOptions !== cachedSuperOptions) {
  16593. // super option changed,
  16594. // need to resolve new options.
  16595. Ctor.superOptions = superOptions;
  16596. // check if there are any late-modified/attached options (#4976)
  16597. var modifiedOptions = resolveModifiedOptions(Ctor);
  16598. // update base extend options
  16599. if (modifiedOptions) {
  16600. extend(Ctor.extendOptions, modifiedOptions);
  16601. }
  16602. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  16603. if (options.name) {
  16604. options.components[options.name] = Ctor;
  16605. }
  16606. }
  16607. }
  16608. return options
  16609. }
  16610. function resolveModifiedOptions (Ctor) {
  16611. var modified;
  16612. var latest = Ctor.options;
  16613. var sealed = Ctor.sealedOptions;
  16614. for (var key in latest) {
  16615. if (latest[key] !== sealed[key]) {
  16616. if (!modified) { modified = {}; }
  16617. modified[key] = latest[key];
  16618. }
  16619. }
  16620. return modified
  16621. }
  16622. function Vue (options) {
  16623. if ( true &&
  16624. !(this instanceof Vue)
  16625. ) {
  16626. warn('Vue is a constructor and should be called with the `new` keyword');
  16627. }
  16628. this._init(options);
  16629. }
  16630. initMixin(Vue);
  16631. stateMixin(Vue);
  16632. eventsMixin(Vue);
  16633. lifecycleMixin(Vue);
  16634. renderMixin(Vue);
  16635. /* */
  16636. function initUse (Vue) {
  16637. Vue.use = function (plugin) {
  16638. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  16639. if (installedPlugins.indexOf(plugin) > -1) {
  16640. return this
  16641. }
  16642. // additional parameters
  16643. var args = toArray(arguments, 1);
  16644. args.unshift(this);
  16645. if (typeof plugin.install === 'function') {
  16646. plugin.install.apply(plugin, args);
  16647. } else if (typeof plugin === 'function') {
  16648. plugin.apply(null, args);
  16649. }
  16650. installedPlugins.push(plugin);
  16651. return this
  16652. };
  16653. }
  16654. /* */
  16655. function initMixin$1 (Vue) {
  16656. Vue.mixin = function (mixin) {
  16657. this.options = mergeOptions(this.options, mixin);
  16658. return this
  16659. };
  16660. }
  16661. /* */
  16662. function initExtend (Vue) {
  16663. /**
  16664. * Each instance constructor, including Vue, has a unique
  16665. * cid. This enables us to create wrapped "child
  16666. * constructors" for prototypal inheritance and cache them.
  16667. */
  16668. Vue.cid = 0;
  16669. var cid = 1;
  16670. /**
  16671. * Class inheritance
  16672. */
  16673. Vue.extend = function (extendOptions) {
  16674. extendOptions = extendOptions || {};
  16675. var Super = this;
  16676. var SuperId = Super.cid;
  16677. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  16678. if (cachedCtors[SuperId]) {
  16679. return cachedCtors[SuperId]
  16680. }
  16681. var name = extendOptions.name || Super.options.name;
  16682. if ( true && name) {
  16683. validateComponentName(name);
  16684. }
  16685. var Sub = function VueComponent (options) {
  16686. this._init(options);
  16687. };
  16688. Sub.prototype = Object.create(Super.prototype);
  16689. Sub.prototype.constructor = Sub;
  16690. Sub.cid = cid++;
  16691. Sub.options = mergeOptions(
  16692. Super.options,
  16693. extendOptions
  16694. );
  16695. Sub['super'] = Super;
  16696. // For props and computed properties, we define the proxy getters on
  16697. // the Vue instances at extension time, on the extended prototype. This
  16698. // avoids Object.defineProperty calls for each instance created.
  16699. if (Sub.options.props) {
  16700. initProps$1(Sub);
  16701. }
  16702. if (Sub.options.computed) {
  16703. initComputed$1(Sub);
  16704. }
  16705. // allow further extension/mixin/plugin usage
  16706. Sub.extend = Super.extend;
  16707. Sub.mixin = Super.mixin;
  16708. Sub.use = Super.use;
  16709. // create asset registers, so extended classes
  16710. // can have their private assets too.
  16711. ASSET_TYPES.forEach(function (type) {
  16712. Sub[type] = Super[type];
  16713. });
  16714. // enable recursive self-lookup
  16715. if (name) {
  16716. Sub.options.components[name] = Sub;
  16717. }
  16718. // keep a reference to the super options at extension time.
  16719. // later at instantiation we can check if Super's options have
  16720. // been updated.
  16721. Sub.superOptions = Super.options;
  16722. Sub.extendOptions = extendOptions;
  16723. Sub.sealedOptions = extend({}, Sub.options);
  16724. // cache constructor
  16725. cachedCtors[SuperId] = Sub;
  16726. return Sub
  16727. };
  16728. }
  16729. function initProps$1 (Comp) {
  16730. var props = Comp.options.props;
  16731. for (var key in props) {
  16732. proxy(Comp.prototype, "_props", key);
  16733. }
  16734. }
  16735. function initComputed$1 (Comp) {
  16736. var computed = Comp.options.computed;
  16737. for (var key in computed) {
  16738. defineComputed(Comp.prototype, key, computed[key]);
  16739. }
  16740. }
  16741. /* */
  16742. function initAssetRegisters (Vue) {
  16743. /**
  16744. * Create asset registration methods.
  16745. */
  16746. ASSET_TYPES.forEach(function (type) {
  16747. Vue[type] = function (
  16748. id,
  16749. definition
  16750. ) {
  16751. if (!definition) {
  16752. return this.options[type + 's'][id]
  16753. } else {
  16754. /* istanbul ignore if */
  16755. if ( true && type === 'component') {
  16756. validateComponentName(id);
  16757. }
  16758. if (type === 'component' && isPlainObject(definition)) {
  16759. definition.name = definition.name || id;
  16760. definition = this.options._base.extend(definition);
  16761. }
  16762. if (type === 'directive' && typeof definition === 'function') {
  16763. definition = { bind: definition, update: definition };
  16764. }
  16765. this.options[type + 's'][id] = definition;
  16766. return definition
  16767. }
  16768. };
  16769. });
  16770. }
  16771. /* */
  16772. function getComponentName (opts) {
  16773. return opts && (opts.Ctor.options.name || opts.tag)
  16774. }
  16775. function matches (pattern, name) {
  16776. if (Array.isArray(pattern)) {
  16777. return pattern.indexOf(name) > -1
  16778. } else if (typeof pattern === 'string') {
  16779. return pattern.split(',').indexOf(name) > -1
  16780. } else if (isRegExp(pattern)) {
  16781. return pattern.test(name)
  16782. }
  16783. /* istanbul ignore next */
  16784. return false
  16785. }
  16786. function pruneCache (keepAliveInstance, filter) {
  16787. var cache = keepAliveInstance.cache;
  16788. var keys = keepAliveInstance.keys;
  16789. var _vnode = keepAliveInstance._vnode;
  16790. for (var key in cache) {
  16791. var cachedNode = cache[key];
  16792. if (cachedNode) {
  16793. var name = getComponentName(cachedNode.componentOptions);
  16794. if (name && !filter(name)) {
  16795. pruneCacheEntry(cache, key, keys, _vnode);
  16796. }
  16797. }
  16798. }
  16799. }
  16800. function pruneCacheEntry (
  16801. cache,
  16802. key,
  16803. keys,
  16804. current
  16805. ) {
  16806. var cached$$1 = cache[key];
  16807. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  16808. cached$$1.componentInstance.$destroy();
  16809. }
  16810. cache[key] = null;
  16811. remove(keys, key);
  16812. }
  16813. var patternTypes = [String, RegExp, Array];
  16814. var KeepAlive = {
  16815. name: 'keep-alive',
  16816. abstract: true,
  16817. props: {
  16818. include: patternTypes,
  16819. exclude: patternTypes,
  16820. max: [String, Number]
  16821. },
  16822. created: function created () {
  16823. this.cache = Object.create(null);
  16824. this.keys = [];
  16825. },
  16826. destroyed: function destroyed () {
  16827. for (var key in this.cache) {
  16828. pruneCacheEntry(this.cache, key, this.keys);
  16829. }
  16830. },
  16831. mounted: function mounted () {
  16832. var this$1 = this;
  16833. this.$watch('include', function (val) {
  16834. pruneCache(this$1, function (name) { return matches(val, name); });
  16835. });
  16836. this.$watch('exclude', function (val) {
  16837. pruneCache(this$1, function (name) { return !matches(val, name); });
  16838. });
  16839. },
  16840. render: function render () {
  16841. var slot = this.$slots.default;
  16842. var vnode = getFirstComponentChild(slot);
  16843. var componentOptions = vnode && vnode.componentOptions;
  16844. if (componentOptions) {
  16845. // check pattern
  16846. var name = getComponentName(componentOptions);
  16847. var ref = this;
  16848. var include = ref.include;
  16849. var exclude = ref.exclude;
  16850. if (
  16851. // not included
  16852. (include && (!name || !matches(include, name))) ||
  16853. // excluded
  16854. (exclude && name && matches(exclude, name))
  16855. ) {
  16856. return vnode
  16857. }
  16858. var ref$1 = this;
  16859. var cache = ref$1.cache;
  16860. var keys = ref$1.keys;
  16861. var key = vnode.key == null
  16862. // same constructor may get registered as different local components
  16863. // so cid alone is not enough (#3269)
  16864. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  16865. : vnode.key;
  16866. if (cache[key]) {
  16867. vnode.componentInstance = cache[key].componentInstance;
  16868. // make current key freshest
  16869. remove(keys, key);
  16870. keys.push(key);
  16871. } else {
  16872. cache[key] = vnode;
  16873. keys.push(key);
  16874. // prune oldest entry
  16875. if (this.max && keys.length > parseInt(this.max)) {
  16876. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  16877. }
  16878. }
  16879. vnode.data.keepAlive = true;
  16880. }
  16881. return vnode || (slot && slot[0])
  16882. }
  16883. };
  16884. var builtInComponents = {
  16885. KeepAlive: KeepAlive
  16886. };
  16887. /* */
  16888. function initGlobalAPI (Vue) {
  16889. // config
  16890. var configDef = {};
  16891. configDef.get = function () { return config; };
  16892. if (true) {
  16893. configDef.set = function () {
  16894. warn(
  16895. 'Do not replace the Vue.config object, set individual fields instead.'
  16896. );
  16897. };
  16898. }
  16899. Object.defineProperty(Vue, 'config', configDef);
  16900. // exposed util methods.
  16901. // NOTE: these are not considered part of the public API - avoid relying on
  16902. // them unless you are aware of the risk.
  16903. Vue.util = {
  16904. warn: warn,
  16905. extend: extend,
  16906. mergeOptions: mergeOptions,
  16907. defineReactive: defineReactive$$1
  16908. };
  16909. Vue.set = set;
  16910. Vue.delete = del;
  16911. Vue.nextTick = nextTick;
  16912. // 2.6 explicit observable API
  16913. Vue.observable = function (obj) {
  16914. observe(obj);
  16915. return obj
  16916. };
  16917. Vue.options = Object.create(null);
  16918. ASSET_TYPES.forEach(function (type) {
  16919. Vue.options[type + 's'] = Object.create(null);
  16920. });
  16921. // this is used to identify the "base" constructor to extend all plain-object
  16922. // components with in Weex's multi-instance scenarios.
  16923. Vue.options._base = Vue;
  16924. extend(Vue.options.components, builtInComponents);
  16925. initUse(Vue);
  16926. initMixin$1(Vue);
  16927. initExtend(Vue);
  16928. initAssetRegisters(Vue);
  16929. }
  16930. initGlobalAPI(Vue);
  16931. Object.defineProperty(Vue.prototype, '$isServer', {
  16932. get: isServerRendering
  16933. });
  16934. Object.defineProperty(Vue.prototype, '$ssrContext', {
  16935. get: function get () {
  16936. /* istanbul ignore next */
  16937. return this.$vnode && this.$vnode.ssrContext
  16938. }
  16939. });
  16940. // expose FunctionalRenderContext for ssr runtime helper installation
  16941. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  16942. value: FunctionalRenderContext
  16943. });
  16944. Vue.version = '2.6.11';
  16945. /**
  16946. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  16947. */
  16948. var ARRAYTYPE = '[object Array]';
  16949. var OBJECTTYPE = '[object Object]';
  16950. var NULLTYPE = '[object Null]';
  16951. var UNDEFINEDTYPE = '[object Undefined]';
  16952. // const FUNCTIONTYPE = '[object Function]'
  16953. function diff(current, pre) {
  16954. var result = {};
  16955. syncKeys(current, pre);
  16956. _diff(current, pre, '', result);
  16957. return result
  16958. }
  16959. function syncKeys(current, pre) {
  16960. if (current === pre) { return }
  16961. var rootCurrentType = type(current);
  16962. var rootPreType = type(pre);
  16963. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  16964. if(Object.keys(current).length >= Object.keys(pre).length){
  16965. for (var key in pre) {
  16966. var currentValue = current[key];
  16967. if (currentValue === undefined) {
  16968. current[key] = null;
  16969. } else {
  16970. syncKeys(currentValue, pre[key]);
  16971. }
  16972. }
  16973. }
  16974. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  16975. if (current.length >= pre.length) {
  16976. pre.forEach(function (item, index) {
  16977. syncKeys(current[index], item);
  16978. });
  16979. }
  16980. }
  16981. }
  16982. function nullOrUndefined(currentType, preType) {
  16983. if(
  16984. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  16985. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  16986. ) {
  16987. return false
  16988. }
  16989. return true
  16990. }
  16991. function _diff(current, pre, path, result) {
  16992. if (current === pre) { return }
  16993. var rootCurrentType = type(current);
  16994. var rootPreType = type(pre);
  16995. if (rootCurrentType == OBJECTTYPE) {
  16996. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  16997. setResult(result, path, current);
  16998. } else {
  16999. var loop = function ( key ) {
  17000. var currentValue = current[key];
  17001. var preValue = pre[key];
  17002. var currentType = type(currentValue);
  17003. var preType = type(preValue);
  17004. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  17005. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  17006. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17007. }
  17008. } else if (currentType == ARRAYTYPE) {
  17009. if (preType != ARRAYTYPE) {
  17010. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17011. } else {
  17012. if (currentValue.length < preValue.length) {
  17013. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17014. } else {
  17015. currentValue.forEach(function (item, index) {
  17016. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  17017. });
  17018. }
  17019. }
  17020. } else if (currentType == OBJECTTYPE) {
  17021. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  17022. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17023. } else {
  17024. for (var subKey in currentValue) {
  17025. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  17026. }
  17027. }
  17028. }
  17029. };
  17030. for (var key in current) loop( key );
  17031. }
  17032. } else if (rootCurrentType == ARRAYTYPE) {
  17033. if (rootPreType != ARRAYTYPE) {
  17034. setResult(result, path, current);
  17035. } else {
  17036. if (current.length < pre.length) {
  17037. setResult(result, path, current);
  17038. } else {
  17039. current.forEach(function (item, index) {
  17040. _diff(item, pre[index], path + '[' + index + ']', result);
  17041. });
  17042. }
  17043. }
  17044. } else {
  17045. setResult(result, path, current);
  17046. }
  17047. }
  17048. function setResult(result, k, v) {
  17049. // if (type(v) != FUNCTIONTYPE) {
  17050. result[k] = v;
  17051. // }
  17052. }
  17053. function type(obj) {
  17054. return Object.prototype.toString.call(obj)
  17055. }
  17056. /* */
  17057. function flushCallbacks$1(vm) {
  17058. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  17059. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"采空区巡检","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17060. var mpInstance = vm.$scope;
  17061. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17062. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  17063. }
  17064. var copies = vm.__next_tick_callbacks.slice(0);
  17065. vm.__next_tick_callbacks.length = 0;
  17066. for (var i = 0; i < copies.length; i++) {
  17067. copies[i]();
  17068. }
  17069. }
  17070. }
  17071. function hasRenderWatcher(vm) {
  17072. return queue.find(function (watcher) { return vm._watcher === watcher; })
  17073. }
  17074. function nextTick$1(vm, cb) {
  17075. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  17076. //2.nextTick 之前存在 render watcher
  17077. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  17078. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"采空区巡检","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  17079. var mpInstance = vm.$scope;
  17080. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17081. ']:nextVueTick');
  17082. }
  17083. return nextTick(cb, vm)
  17084. }else{
  17085. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"采空区巡检","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  17086. var mpInstance$1 = vm.$scope;
  17087. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  17088. ']:nextMPTick');
  17089. }
  17090. }
  17091. var _resolve;
  17092. if (!vm.__next_tick_callbacks) {
  17093. vm.__next_tick_callbacks = [];
  17094. }
  17095. vm.__next_tick_callbacks.push(function () {
  17096. if (cb) {
  17097. try {
  17098. cb.call(vm);
  17099. } catch (e) {
  17100. handleError(e, vm, 'nextTick');
  17101. }
  17102. } else if (_resolve) {
  17103. _resolve(vm);
  17104. }
  17105. });
  17106. // $flow-disable-line
  17107. if (!cb && typeof Promise !== 'undefined') {
  17108. return new Promise(function (resolve) {
  17109. _resolve = resolve;
  17110. })
  17111. }
  17112. }
  17113. /* */
  17114. function clearInstance(key, value) {
  17115. // 简易去除 Vue 和小程序组件实例
  17116. if (value) {
  17117. if (value._isVue || value.__v_isMPComponent) {
  17118. return {}
  17119. }
  17120. }
  17121. return value
  17122. }
  17123. function cloneWithData(vm) {
  17124. // 确保当前 vm 所有数据被同步
  17125. var ret = Object.create(null);
  17126. var dataKeys = [].concat(
  17127. Object.keys(vm._data || {}),
  17128. Object.keys(vm._computedWatchers || {}));
  17129. dataKeys.reduce(function(ret, key) {
  17130. ret[key] = vm[key];
  17131. return ret
  17132. }, ret);
  17133. // vue-composition-api
  17134. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  17135. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  17136. if (rawBindings) {
  17137. Object.keys(rawBindings).forEach(function (key) {
  17138. ret[key] = vm[key];
  17139. });
  17140. }
  17141. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  17142. Object.assign(ret, vm.$mp.data || {});
  17143. if (
  17144. Array.isArray(vm.$options.behaviors) &&
  17145. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  17146. ) { //form-field
  17147. ret['name'] = vm.name;
  17148. ret['value'] = vm.value;
  17149. }
  17150. return JSON.parse(JSON.stringify(ret, clearInstance))
  17151. }
  17152. var patch = function(oldVnode, vnode) {
  17153. var this$1 = this;
  17154. if (vnode === null) { //destroy
  17155. return
  17156. }
  17157. if (this.mpType === 'page' || this.mpType === 'component') {
  17158. var mpInstance = this.$scope;
  17159. var data = Object.create(null);
  17160. try {
  17161. data = cloneWithData(this);
  17162. } catch (err) {
  17163. console.error(err);
  17164. }
  17165. data.__webviewId__ = mpInstance.data.__webviewId__;
  17166. var mpData = Object.create(null);
  17167. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  17168. mpData[key] = mpInstance.data[key];
  17169. });
  17170. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  17171. if (Object.keys(diffData).length) {
  17172. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"采空区巡检","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17173. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  17174. ']差量更新',
  17175. JSON.stringify(diffData));
  17176. }
  17177. this.__next_tick_pending = true;
  17178. mpInstance.setData(diffData, function () {
  17179. this$1.__next_tick_pending = false;
  17180. flushCallbacks$1(this$1);
  17181. });
  17182. } else {
  17183. flushCallbacks$1(this);
  17184. }
  17185. }
  17186. };
  17187. /* */
  17188. function createEmptyRender() {
  17189. }
  17190. function mountComponent$1(
  17191. vm,
  17192. el,
  17193. hydrating
  17194. ) {
  17195. if (!vm.mpType) {//main.js 中的 new Vue
  17196. return vm
  17197. }
  17198. if (vm.mpType === 'app') {
  17199. vm.$options.render = createEmptyRender;
  17200. }
  17201. if (!vm.$options.render) {
  17202. vm.$options.render = createEmptyRender;
  17203. if (true) {
  17204. /* istanbul ignore if */
  17205. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  17206. vm.$options.el || el) {
  17207. warn(
  17208. 'You are using the runtime-only build of Vue where the template ' +
  17209. 'compiler is not available. Either pre-compile the templates into ' +
  17210. 'render functions, or use the compiler-included build.',
  17211. vm
  17212. );
  17213. } else {
  17214. warn(
  17215. 'Failed to mount component: template or render function not defined.',
  17216. vm
  17217. );
  17218. }
  17219. }
  17220. }
  17221. !vm._$fallback && callHook(vm, 'beforeMount');
  17222. var updateComponent = function () {
  17223. vm._update(vm._render(), hydrating);
  17224. };
  17225. // we set this to vm._watcher inside the watcher's constructor
  17226. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  17227. // component's mounted hook), which relies on vm._watcher being already defined
  17228. new Watcher(vm, updateComponent, noop, {
  17229. before: function before() {
  17230. if (vm._isMounted && !vm._isDestroyed) {
  17231. callHook(vm, 'beforeUpdate');
  17232. }
  17233. }
  17234. }, true /* isRenderWatcher */);
  17235. hydrating = false;
  17236. return vm
  17237. }
  17238. /* */
  17239. function renderClass (
  17240. staticClass,
  17241. dynamicClass
  17242. ) {
  17243. if (isDef(staticClass) || isDef(dynamicClass)) {
  17244. return concat(staticClass, stringifyClass(dynamicClass))
  17245. }
  17246. /* istanbul ignore next */
  17247. return ''
  17248. }
  17249. function concat (a, b) {
  17250. return a ? b ? (a + ' ' + b) : a : (b || '')
  17251. }
  17252. function stringifyClass (value) {
  17253. if (Array.isArray(value)) {
  17254. return stringifyArray(value)
  17255. }
  17256. if (isObject(value)) {
  17257. return stringifyObject(value)
  17258. }
  17259. if (typeof value === 'string') {
  17260. return value
  17261. }
  17262. /* istanbul ignore next */
  17263. return ''
  17264. }
  17265. function stringifyArray (value) {
  17266. var res = '';
  17267. var stringified;
  17268. for (var i = 0, l = value.length; i < l; i++) {
  17269. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  17270. if (res) { res += ' '; }
  17271. res += stringified;
  17272. }
  17273. }
  17274. return res
  17275. }
  17276. function stringifyObject (value) {
  17277. var res = '';
  17278. for (var key in value) {
  17279. if (value[key]) {
  17280. if (res) { res += ' '; }
  17281. res += key;
  17282. }
  17283. }
  17284. return res
  17285. }
  17286. /* */
  17287. var parseStyleText = cached(function (cssText) {
  17288. var res = {};
  17289. var listDelimiter = /;(?![^(]*\))/g;
  17290. var propertyDelimiter = /:(.+)/;
  17291. cssText.split(listDelimiter).forEach(function (item) {
  17292. if (item) {
  17293. var tmp = item.split(propertyDelimiter);
  17294. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  17295. }
  17296. });
  17297. return res
  17298. });
  17299. // normalize possible array / string values into Object
  17300. function normalizeStyleBinding (bindingStyle) {
  17301. if (Array.isArray(bindingStyle)) {
  17302. return toObject(bindingStyle)
  17303. }
  17304. if (typeof bindingStyle === 'string') {
  17305. return parseStyleText(bindingStyle)
  17306. }
  17307. return bindingStyle
  17308. }
  17309. /* */
  17310. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  17311. function getTarget(obj, path) {
  17312. var parts = path.split('.');
  17313. var key = parts[0];
  17314. if (key.indexOf('__$n') === 0) { //number index
  17315. key = parseInt(key.replace('__$n', ''));
  17316. }
  17317. if (parts.length === 1) {
  17318. return obj[key]
  17319. }
  17320. return getTarget(obj[key], parts.slice(1).join('.'))
  17321. }
  17322. function internalMixin(Vue) {
  17323. Vue.config.errorHandler = function(err, vm, info) {
  17324. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  17325. console.error(err);
  17326. /* eslint-disable no-undef */
  17327. var app = typeof getApp === 'function' && getApp();
  17328. if (app && app.onError) {
  17329. app.onError(err);
  17330. }
  17331. };
  17332. var oldEmit = Vue.prototype.$emit;
  17333. Vue.prototype.$emit = function(event) {
  17334. if (this.$scope && event) {
  17335. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  17336. if (triggerEvent) {
  17337. try {
  17338. triggerEvent.call(this.$scope, event, {
  17339. __args__: toArray(arguments, 1)
  17340. });
  17341. } catch (error) {
  17342. }
  17343. }
  17344. }
  17345. return oldEmit.apply(this, arguments)
  17346. };
  17347. Vue.prototype.$nextTick = function(fn) {
  17348. return nextTick$1(this, fn)
  17349. };
  17350. MP_METHODS.forEach(function (method) {
  17351. Vue.prototype[method] = function(args) {
  17352. if (this.$scope && this.$scope[method]) {
  17353. return this.$scope[method](args)
  17354. }
  17355. // mp-alipay
  17356. if (typeof my === 'undefined') {
  17357. return
  17358. }
  17359. if (method === 'createSelectorQuery') {
  17360. /* eslint-disable no-undef */
  17361. return my.createSelectorQuery(args)
  17362. } else if (method === 'createIntersectionObserver') {
  17363. /* eslint-disable no-undef */
  17364. return my.createIntersectionObserver(args)
  17365. }
  17366. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  17367. };
  17368. });
  17369. Vue.prototype.__init_provide = initProvide;
  17370. Vue.prototype.__init_injections = initInjections;
  17371. Vue.prototype.__call_hook = function(hook, args) {
  17372. var vm = this;
  17373. // #7573 disable dep collection when invoking lifecycle hooks
  17374. pushTarget();
  17375. var handlers = vm.$options[hook];
  17376. var info = hook + " hook";
  17377. var ret;
  17378. if (handlers) {
  17379. for (var i = 0, j = handlers.length; i < j; i++) {
  17380. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  17381. }
  17382. }
  17383. if (vm._hasHookEvent) {
  17384. vm.$emit('hook:' + hook, args);
  17385. }
  17386. popTarget();
  17387. return ret
  17388. };
  17389. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  17390. if (Array.isArray(modifiers)) {
  17391. if (modifiers.indexOf('trim') !== -1) {
  17392. value = value.trim();
  17393. }
  17394. if (modifiers.indexOf('number') !== -1) {
  17395. value = this._n(value);
  17396. }
  17397. }
  17398. if (!target) {
  17399. target = this;
  17400. }
  17401. // 解决动态属性添加
  17402. Vue.set(target, key, value);
  17403. };
  17404. Vue.prototype.__set_sync = function(target, key, value) {
  17405. if (!target) {
  17406. target = this;
  17407. }
  17408. // 解决动态属性添加
  17409. Vue.set(target, key, value);
  17410. };
  17411. Vue.prototype.__get_orig = function(item) {
  17412. if (isPlainObject(item)) {
  17413. return item['$orig'] || item
  17414. }
  17415. return item
  17416. };
  17417. Vue.prototype.__get_value = function(dataPath, target) {
  17418. return getTarget(target || this, dataPath)
  17419. };
  17420. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  17421. return renderClass(staticClass, dynamicClass)
  17422. };
  17423. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  17424. if (!dynamicStyle && !staticStyle) {
  17425. return ''
  17426. }
  17427. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  17428. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  17429. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  17430. };
  17431. Vue.prototype.__map = function(val, iteratee) {
  17432. //TODO 暂不考虑 string
  17433. var ret, i, l, keys, key;
  17434. if (Array.isArray(val)) {
  17435. ret = new Array(val.length);
  17436. for (i = 0, l = val.length; i < l; i++) {
  17437. ret[i] = iteratee(val[i], i);
  17438. }
  17439. return ret
  17440. } else if (isObject(val)) {
  17441. keys = Object.keys(val);
  17442. ret = Object.create(null);
  17443. for (i = 0, l = keys.length; i < l; i++) {
  17444. key = keys[i];
  17445. ret[key] = iteratee(val[key], key, i);
  17446. }
  17447. return ret
  17448. } else if (typeof val === 'number') {
  17449. ret = new Array(val);
  17450. for (i = 0, l = val; i < l; i++) {
  17451. // 第一个参数暂时仍和小程序一致
  17452. ret[i] = iteratee(i, i);
  17453. }
  17454. return ret
  17455. }
  17456. return []
  17457. };
  17458. }
  17459. /* */
  17460. var LIFECYCLE_HOOKS$1 = [
  17461. //App
  17462. 'onLaunch',
  17463. 'onShow',
  17464. 'onHide',
  17465. 'onUniNViewMessage',
  17466. 'onPageNotFound',
  17467. 'onThemeChange',
  17468. 'onError',
  17469. 'onUnhandledRejection',
  17470. //Page
  17471. 'onInit',
  17472. 'onLoad',
  17473. // 'onShow',
  17474. 'onReady',
  17475. // 'onHide',
  17476. 'onUnload',
  17477. 'onPullDownRefresh',
  17478. 'onReachBottom',
  17479. 'onTabItemTap',
  17480. 'onAddToFavorites',
  17481. 'onShareTimeline',
  17482. 'onShareAppMessage',
  17483. 'onResize',
  17484. 'onPageScroll',
  17485. 'onNavigationBarButtonTap',
  17486. 'onBackPress',
  17487. 'onNavigationBarSearchInputChanged',
  17488. 'onNavigationBarSearchInputConfirmed',
  17489. 'onNavigationBarSearchInputClicked',
  17490. //Component
  17491. // 'onReady', // 兼容旧版本,应该移除该事件
  17492. 'onPageShow',
  17493. 'onPageHide',
  17494. 'onPageResize',
  17495. 'onUploadDouyinVideo'
  17496. ];
  17497. function lifecycleMixin$1(Vue) {
  17498. //fixed vue-class-component
  17499. var oldExtend = Vue.extend;
  17500. Vue.extend = function(extendOptions) {
  17501. extendOptions = extendOptions || {};
  17502. var methods = extendOptions.methods;
  17503. if (methods) {
  17504. Object.keys(methods).forEach(function (methodName) {
  17505. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  17506. extendOptions[methodName] = methods[methodName];
  17507. delete methods[methodName];
  17508. }
  17509. });
  17510. }
  17511. return oldExtend.call(this, extendOptions)
  17512. };
  17513. var strategies = Vue.config.optionMergeStrategies;
  17514. var mergeHook = strategies.created;
  17515. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  17516. strategies[hook] = mergeHook;
  17517. });
  17518. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  17519. }
  17520. /* */
  17521. // install platform patch function
  17522. Vue.prototype.__patch__ = patch;
  17523. // public mount method
  17524. Vue.prototype.$mount = function(
  17525. el ,
  17526. hydrating
  17527. ) {
  17528. return mountComponent$1(this, el, hydrating)
  17529. };
  17530. lifecycleMixin$1(Vue);
  17531. internalMixin(Vue);
  17532. /* */
  17533. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  17534. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  17535. /***/ }),
  17536. /***/ 252:
  17537. /*!******************************************************************************************!*\
  17538. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  17539. \******************************************************************************************/
  17540. /*! no static exports found */
  17541. /***/ (function(module, exports, __webpack_require__) {
  17542. "use strict";
  17543. Object.defineProperty(exports, "__esModule", {
  17544. value: true
  17545. });
  17546. exports.default = void 0;
  17547. var _default = {
  17548. "id": "2852637",
  17549. "name": "uniui图标库",
  17550. "font_family": "uniicons",
  17551. "css_prefix_text": "uniui-",
  17552. "description": "",
  17553. "glyphs": [{
  17554. "icon_id": "25027049",
  17555. "name": "yanse",
  17556. "font_class": "color",
  17557. "unicode": "e6cf",
  17558. "unicode_decimal": 59087
  17559. }, {
  17560. "icon_id": "25027048",
  17561. "name": "wallet",
  17562. "font_class": "wallet",
  17563. "unicode": "e6b1",
  17564. "unicode_decimal": 59057
  17565. }, {
  17566. "icon_id": "25015720",
  17567. "name": "settings-filled",
  17568. "font_class": "settings-filled",
  17569. "unicode": "e6ce",
  17570. "unicode_decimal": 59086
  17571. }, {
  17572. "icon_id": "25015434",
  17573. "name": "shimingrenzheng-filled",
  17574. "font_class": "auth-filled",
  17575. "unicode": "e6cc",
  17576. "unicode_decimal": 59084
  17577. }, {
  17578. "icon_id": "24934246",
  17579. "name": "shop-filled",
  17580. "font_class": "shop-filled",
  17581. "unicode": "e6cd",
  17582. "unicode_decimal": 59085
  17583. }, {
  17584. "icon_id": "24934159",
  17585. "name": "staff-filled-01",
  17586. "font_class": "staff-filled",
  17587. "unicode": "e6cb",
  17588. "unicode_decimal": 59083
  17589. }, {
  17590. "icon_id": "24932461",
  17591. "name": "VIP-filled",
  17592. "font_class": "vip-filled",
  17593. "unicode": "e6c6",
  17594. "unicode_decimal": 59078
  17595. }, {
  17596. "icon_id": "24932462",
  17597. "name": "plus_circle_fill",
  17598. "font_class": "plus-filled",
  17599. "unicode": "e6c7",
  17600. "unicode_decimal": 59079
  17601. }, {
  17602. "icon_id": "24932463",
  17603. "name": "folder_add-filled",
  17604. "font_class": "folder-add-filled",
  17605. "unicode": "e6c8",
  17606. "unicode_decimal": 59080
  17607. }, {
  17608. "icon_id": "24932464",
  17609. "name": "yanse-filled",
  17610. "font_class": "color-filled",
  17611. "unicode": "e6c9",
  17612. "unicode_decimal": 59081
  17613. }, {
  17614. "icon_id": "24932465",
  17615. "name": "tune-filled",
  17616. "font_class": "tune-filled",
  17617. "unicode": "e6ca",
  17618. "unicode_decimal": 59082
  17619. }, {
  17620. "icon_id": "24932455",
  17621. "name": "a-rilidaka-filled",
  17622. "font_class": "calendar-filled",
  17623. "unicode": "e6c0",
  17624. "unicode_decimal": 59072
  17625. }, {
  17626. "icon_id": "24932456",
  17627. "name": "notification-filled",
  17628. "font_class": "notification-filled",
  17629. "unicode": "e6c1",
  17630. "unicode_decimal": 59073
  17631. }, {
  17632. "icon_id": "24932457",
  17633. "name": "wallet-filled",
  17634. "font_class": "wallet-filled",
  17635. "unicode": "e6c2",
  17636. "unicode_decimal": 59074
  17637. }, {
  17638. "icon_id": "24932458",
  17639. "name": "paihangbang-filled",
  17640. "font_class": "medal-filled",
  17641. "unicode": "e6c3",
  17642. "unicode_decimal": 59075
  17643. }, {
  17644. "icon_id": "24932459",
  17645. "name": "gift-filled",
  17646. "font_class": "gift-filled",
  17647. "unicode": "e6c4",
  17648. "unicode_decimal": 59076
  17649. }, {
  17650. "icon_id": "24932460",
  17651. "name": "fire-filled",
  17652. "font_class": "fire-filled",
  17653. "unicode": "e6c5",
  17654. "unicode_decimal": 59077
  17655. }, {
  17656. "icon_id": "24928001",
  17657. "name": "refreshempty",
  17658. "font_class": "refreshempty",
  17659. "unicode": "e6bf",
  17660. "unicode_decimal": 59071
  17661. }, {
  17662. "icon_id": "24926853",
  17663. "name": "location-ellipse",
  17664. "font_class": "location-filled",
  17665. "unicode": "e6af",
  17666. "unicode_decimal": 59055
  17667. }, {
  17668. "icon_id": "24926735",
  17669. "name": "person-filled",
  17670. "font_class": "person-filled",
  17671. "unicode": "e69d",
  17672. "unicode_decimal": 59037
  17673. }, {
  17674. "icon_id": "24926703",
  17675. "name": "personadd-filled",
  17676. "font_class": "personadd-filled",
  17677. "unicode": "e698",
  17678. "unicode_decimal": 59032
  17679. }, {
  17680. "icon_id": "24923351",
  17681. "name": "back",
  17682. "font_class": "back",
  17683. "unicode": "e6b9",
  17684. "unicode_decimal": 59065
  17685. }, {
  17686. "icon_id": "24923352",
  17687. "name": "forward",
  17688. "font_class": "forward",
  17689. "unicode": "e6ba",
  17690. "unicode_decimal": 59066
  17691. }, {
  17692. "icon_id": "24923353",
  17693. "name": "arrowthinright",
  17694. "font_class": "arrow-right",
  17695. "unicode": "e6bb",
  17696. "unicode_decimal": 59067
  17697. }, {
  17698. "icon_id": "24923353",
  17699. "name": "arrowthinright",
  17700. "font_class": "arrowthinright",
  17701. "unicode": "e6bb",
  17702. "unicode_decimal": 59067
  17703. }, {
  17704. "icon_id": "24923354",
  17705. "name": "arrowthinleft",
  17706. "font_class": "arrow-left",
  17707. "unicode": "e6bc",
  17708. "unicode_decimal": 59068
  17709. }, {
  17710. "icon_id": "24923354",
  17711. "name": "arrowthinleft",
  17712. "font_class": "arrowthinleft",
  17713. "unicode": "e6bc",
  17714. "unicode_decimal": 59068
  17715. }, {
  17716. "icon_id": "24923355",
  17717. "name": "arrowthinup",
  17718. "font_class": "arrow-up",
  17719. "unicode": "e6bd",
  17720. "unicode_decimal": 59069
  17721. }, {
  17722. "icon_id": "24923355",
  17723. "name": "arrowthinup",
  17724. "font_class": "arrowthinup",
  17725. "unicode": "e6bd",
  17726. "unicode_decimal": 59069
  17727. }, {
  17728. "icon_id": "24923356",
  17729. "name": "arrowthindown",
  17730. "font_class": "arrow-down",
  17731. "unicode": "e6be",
  17732. "unicode_decimal": 59070
  17733. }, {
  17734. "icon_id": "24923356",
  17735. "name": "arrowthindown",
  17736. "font_class": "arrowthindown",
  17737. "unicode": "e6be",
  17738. "unicode_decimal": 59070
  17739. }, {
  17740. "icon_id": "24923349",
  17741. "name": "arrowdown",
  17742. "font_class": "bottom",
  17743. "unicode": "e6b8",
  17744. "unicode_decimal": 59064
  17745. }, {
  17746. "icon_id": "24923349",
  17747. "name": "arrowdown",
  17748. "font_class": "arrowdown",
  17749. "unicode": "e6b8",
  17750. "unicode_decimal": 59064
  17751. }, {
  17752. "icon_id": "24923346",
  17753. "name": "arrowright",
  17754. "font_class": "right",
  17755. "unicode": "e6b5",
  17756. "unicode_decimal": 59061
  17757. }, {
  17758. "icon_id": "24923346",
  17759. "name": "arrowright",
  17760. "font_class": "arrowright",
  17761. "unicode": "e6b5",
  17762. "unicode_decimal": 59061
  17763. }, {
  17764. "icon_id": "24923347",
  17765. "name": "arrowup",
  17766. "font_class": "top",
  17767. "unicode": "e6b6",
  17768. "unicode_decimal": 59062
  17769. }, {
  17770. "icon_id": "24923347",
  17771. "name": "arrowup",
  17772. "font_class": "arrowup",
  17773. "unicode": "e6b6",
  17774. "unicode_decimal": 59062
  17775. }, {
  17776. "icon_id": "24923348",
  17777. "name": "arrowleft",
  17778. "font_class": "left",
  17779. "unicode": "e6b7",
  17780. "unicode_decimal": 59063
  17781. }, {
  17782. "icon_id": "24923348",
  17783. "name": "arrowleft",
  17784. "font_class": "arrowleft",
  17785. "unicode": "e6b7",
  17786. "unicode_decimal": 59063
  17787. }, {
  17788. "icon_id": "24923334",
  17789. "name": "eye",
  17790. "font_class": "eye",
  17791. "unicode": "e651",
  17792. "unicode_decimal": 58961
  17793. }, {
  17794. "icon_id": "24923335",
  17795. "name": "eye-filled",
  17796. "font_class": "eye-filled",
  17797. "unicode": "e66a",
  17798. "unicode_decimal": 58986
  17799. }, {
  17800. "icon_id": "24923336",
  17801. "name": "eye-slash",
  17802. "font_class": "eye-slash",
  17803. "unicode": "e6b3",
  17804. "unicode_decimal": 59059
  17805. }, {
  17806. "icon_id": "24923337",
  17807. "name": "eye-slash-filled",
  17808. "font_class": "eye-slash-filled",
  17809. "unicode": "e6b4",
  17810. "unicode_decimal": 59060
  17811. }, {
  17812. "icon_id": "24923305",
  17813. "name": "info-filled",
  17814. "font_class": "info-filled",
  17815. "unicode": "e649",
  17816. "unicode_decimal": 58953
  17817. }, {
  17818. "icon_id": "24923299",
  17819. "name": "reload-01",
  17820. "font_class": "reload",
  17821. "unicode": "e6b2",
  17822. "unicode_decimal": 59058
  17823. }, {
  17824. "icon_id": "24923195",
  17825. "name": "mic_slash_fill",
  17826. "font_class": "micoff-filled",
  17827. "unicode": "e6b0",
  17828. "unicode_decimal": 59056
  17829. }, {
  17830. "icon_id": "24923165",
  17831. "name": "map-pin-ellipse",
  17832. "font_class": "map-pin-ellipse",
  17833. "unicode": "e6ac",
  17834. "unicode_decimal": 59052
  17835. }, {
  17836. "icon_id": "24923166",
  17837. "name": "map-pin",
  17838. "font_class": "map-pin",
  17839. "unicode": "e6ad",
  17840. "unicode_decimal": 59053
  17841. }, {
  17842. "icon_id": "24923167",
  17843. "name": "location",
  17844. "font_class": "location",
  17845. "unicode": "e6ae",
  17846. "unicode_decimal": 59054
  17847. }, {
  17848. "icon_id": "24923064",
  17849. "name": "starhalf",
  17850. "font_class": "starhalf",
  17851. "unicode": "e683",
  17852. "unicode_decimal": 59011
  17853. }, {
  17854. "icon_id": "24923065",
  17855. "name": "star",
  17856. "font_class": "star",
  17857. "unicode": "e688",
  17858. "unicode_decimal": 59016
  17859. }, {
  17860. "icon_id": "24923066",
  17861. "name": "star-filled",
  17862. "font_class": "star-filled",
  17863. "unicode": "e68f",
  17864. "unicode_decimal": 59023
  17865. }, {
  17866. "icon_id": "24899646",
  17867. "name": "a-rilidaka",
  17868. "font_class": "calendar",
  17869. "unicode": "e6a0",
  17870. "unicode_decimal": 59040
  17871. }, {
  17872. "icon_id": "24899647",
  17873. "name": "fire",
  17874. "font_class": "fire",
  17875. "unicode": "e6a1",
  17876. "unicode_decimal": 59041
  17877. }, {
  17878. "icon_id": "24899648",
  17879. "name": "paihangbang",
  17880. "font_class": "medal",
  17881. "unicode": "e6a2",
  17882. "unicode_decimal": 59042
  17883. }, {
  17884. "icon_id": "24899649",
  17885. "name": "font",
  17886. "font_class": "font",
  17887. "unicode": "e6a3",
  17888. "unicode_decimal": 59043
  17889. }, {
  17890. "icon_id": "24899650",
  17891. "name": "gift",
  17892. "font_class": "gift",
  17893. "unicode": "e6a4",
  17894. "unicode_decimal": 59044
  17895. }, {
  17896. "icon_id": "24899651",
  17897. "name": "link",
  17898. "font_class": "link",
  17899. "unicode": "e6a5",
  17900. "unicode_decimal": 59045
  17901. }, {
  17902. "icon_id": "24899652",
  17903. "name": "notification",
  17904. "font_class": "notification",
  17905. "unicode": "e6a6",
  17906. "unicode_decimal": 59046
  17907. }, {
  17908. "icon_id": "24899653",
  17909. "name": "staff",
  17910. "font_class": "staff",
  17911. "unicode": "e6a7",
  17912. "unicode_decimal": 59047
  17913. }, {
  17914. "icon_id": "24899654",
  17915. "name": "VIP",
  17916. "font_class": "vip",
  17917. "unicode": "e6a8",
  17918. "unicode_decimal": 59048
  17919. }, {
  17920. "icon_id": "24899655",
  17921. "name": "folder_add",
  17922. "font_class": "folder-add",
  17923. "unicode": "e6a9",
  17924. "unicode_decimal": 59049
  17925. }, {
  17926. "icon_id": "24899656",
  17927. "name": "tune",
  17928. "font_class": "tune",
  17929. "unicode": "e6aa",
  17930. "unicode_decimal": 59050
  17931. }, {
  17932. "icon_id": "24899657",
  17933. "name": "shimingrenzheng",
  17934. "font_class": "auth",
  17935. "unicode": "e6ab",
  17936. "unicode_decimal": 59051
  17937. }, {
  17938. "icon_id": "24899565",
  17939. "name": "person",
  17940. "font_class": "person",
  17941. "unicode": "e699",
  17942. "unicode_decimal": 59033
  17943. }, {
  17944. "icon_id": "24899566",
  17945. "name": "email-filled",
  17946. "font_class": "email-filled",
  17947. "unicode": "e69a",
  17948. "unicode_decimal": 59034
  17949. }, {
  17950. "icon_id": "24899567",
  17951. "name": "phone-filled",
  17952. "font_class": "phone-filled",
  17953. "unicode": "e69b",
  17954. "unicode_decimal": 59035
  17955. }, {
  17956. "icon_id": "24899568",
  17957. "name": "phone",
  17958. "font_class": "phone",
  17959. "unicode": "e69c",
  17960. "unicode_decimal": 59036
  17961. }, {
  17962. "icon_id": "24899570",
  17963. "name": "email",
  17964. "font_class": "email",
  17965. "unicode": "e69e",
  17966. "unicode_decimal": 59038
  17967. }, {
  17968. "icon_id": "24899571",
  17969. "name": "personadd",
  17970. "font_class": "personadd",
  17971. "unicode": "e69f",
  17972. "unicode_decimal": 59039
  17973. }, {
  17974. "icon_id": "24899558",
  17975. "name": "chatboxes-filled",
  17976. "font_class": "chatboxes-filled",
  17977. "unicode": "e692",
  17978. "unicode_decimal": 59026
  17979. }, {
  17980. "icon_id": "24899559",
  17981. "name": "contact",
  17982. "font_class": "contact",
  17983. "unicode": "e693",
  17984. "unicode_decimal": 59027
  17985. }, {
  17986. "icon_id": "24899560",
  17987. "name": "chatbubble-filled",
  17988. "font_class": "chatbubble-filled",
  17989. "unicode": "e694",
  17990. "unicode_decimal": 59028
  17991. }, {
  17992. "icon_id": "24899561",
  17993. "name": "contact-filled",
  17994. "font_class": "contact-filled",
  17995. "unicode": "e695",
  17996. "unicode_decimal": 59029
  17997. }, {
  17998. "icon_id": "24899562",
  17999. "name": "chatboxes",
  18000. "font_class": "chatboxes",
  18001. "unicode": "e696",
  18002. "unicode_decimal": 59030
  18003. }, {
  18004. "icon_id": "24899563",
  18005. "name": "chatbubble",
  18006. "font_class": "chatbubble",
  18007. "unicode": "e697",
  18008. "unicode_decimal": 59031
  18009. }, {
  18010. "icon_id": "24881290",
  18011. "name": "upload-filled",
  18012. "font_class": "upload-filled",
  18013. "unicode": "e68e",
  18014. "unicode_decimal": 59022
  18015. }, {
  18016. "icon_id": "24881292",
  18017. "name": "upload",
  18018. "font_class": "upload",
  18019. "unicode": "e690",
  18020. "unicode_decimal": 59024
  18021. }, {
  18022. "icon_id": "24881293",
  18023. "name": "weixin",
  18024. "font_class": "weixin",
  18025. "unicode": "e691",
  18026. "unicode_decimal": 59025
  18027. }, {
  18028. "icon_id": "24881274",
  18029. "name": "compose",
  18030. "font_class": "compose",
  18031. "unicode": "e67f",
  18032. "unicode_decimal": 59007
  18033. }, {
  18034. "icon_id": "24881275",
  18035. "name": "qq",
  18036. "font_class": "qq",
  18037. "unicode": "e680",
  18038. "unicode_decimal": 59008
  18039. }, {
  18040. "icon_id": "24881276",
  18041. "name": "download-filled",
  18042. "font_class": "download-filled",
  18043. "unicode": "e681",
  18044. "unicode_decimal": 59009
  18045. }, {
  18046. "icon_id": "24881277",
  18047. "name": "pengyouquan",
  18048. "font_class": "pyq",
  18049. "unicode": "e682",
  18050. "unicode_decimal": 59010
  18051. }, {
  18052. "icon_id": "24881279",
  18053. "name": "sound",
  18054. "font_class": "sound",
  18055. "unicode": "e684",
  18056. "unicode_decimal": 59012
  18057. }, {
  18058. "icon_id": "24881280",
  18059. "name": "trash-filled",
  18060. "font_class": "trash-filled",
  18061. "unicode": "e685",
  18062. "unicode_decimal": 59013
  18063. }, {
  18064. "icon_id": "24881281",
  18065. "name": "sound-filled",
  18066. "font_class": "sound-filled",
  18067. "unicode": "e686",
  18068. "unicode_decimal": 59014
  18069. }, {
  18070. "icon_id": "24881282",
  18071. "name": "trash",
  18072. "font_class": "trash",
  18073. "unicode": "e687",
  18074. "unicode_decimal": 59015
  18075. }, {
  18076. "icon_id": "24881284",
  18077. "name": "videocam-filled",
  18078. "font_class": "videocam-filled",
  18079. "unicode": "e689",
  18080. "unicode_decimal": 59017
  18081. }, {
  18082. "icon_id": "24881285",
  18083. "name": "spinner-cycle",
  18084. "font_class": "spinner-cycle",
  18085. "unicode": "e68a",
  18086. "unicode_decimal": 59018
  18087. }, {
  18088. "icon_id": "24881286",
  18089. "name": "weibo",
  18090. "font_class": "weibo",
  18091. "unicode": "e68b",
  18092. "unicode_decimal": 59019
  18093. }, {
  18094. "icon_id": "24881288",
  18095. "name": "videocam",
  18096. "font_class": "videocam",
  18097. "unicode": "e68c",
  18098. "unicode_decimal": 59020
  18099. }, {
  18100. "icon_id": "24881289",
  18101. "name": "download",
  18102. "font_class": "download",
  18103. "unicode": "e68d",
  18104. "unicode_decimal": 59021
  18105. }, {
  18106. "icon_id": "24879601",
  18107. "name": "help",
  18108. "font_class": "help",
  18109. "unicode": "e679",
  18110. "unicode_decimal": 59001
  18111. }, {
  18112. "icon_id": "24879602",
  18113. "name": "navigate-filled",
  18114. "font_class": "navigate-filled",
  18115. "unicode": "e67a",
  18116. "unicode_decimal": 59002
  18117. }, {
  18118. "icon_id": "24879603",
  18119. "name": "plusempty",
  18120. "font_class": "plusempty",
  18121. "unicode": "e67b",
  18122. "unicode_decimal": 59003
  18123. }, {
  18124. "icon_id": "24879604",
  18125. "name": "smallcircle",
  18126. "font_class": "smallcircle",
  18127. "unicode": "e67c",
  18128. "unicode_decimal": 59004
  18129. }, {
  18130. "icon_id": "24879605",
  18131. "name": "minus-filled",
  18132. "font_class": "minus-filled",
  18133. "unicode": "e67d",
  18134. "unicode_decimal": 59005
  18135. }, {
  18136. "icon_id": "24879606",
  18137. "name": "micoff",
  18138. "font_class": "micoff",
  18139. "unicode": "e67e",
  18140. "unicode_decimal": 59006
  18141. }, {
  18142. "icon_id": "24879588",
  18143. "name": "closeempty",
  18144. "font_class": "closeempty",
  18145. "unicode": "e66c",
  18146. "unicode_decimal": 58988
  18147. }, {
  18148. "icon_id": "24879589",
  18149. "name": "clear",
  18150. "font_class": "clear",
  18151. "unicode": "e66d",
  18152. "unicode_decimal": 58989
  18153. }, {
  18154. "icon_id": "24879590",
  18155. "name": "navigate",
  18156. "font_class": "navigate",
  18157. "unicode": "e66e",
  18158. "unicode_decimal": 58990
  18159. }, {
  18160. "icon_id": "24879591",
  18161. "name": "minus",
  18162. "font_class": "minus",
  18163. "unicode": "e66f",
  18164. "unicode_decimal": 58991
  18165. }, {
  18166. "icon_id": "24879592",
  18167. "name": "image",
  18168. "font_class": "image",
  18169. "unicode": "e670",
  18170. "unicode_decimal": 58992
  18171. }, {
  18172. "icon_id": "24879593",
  18173. "name": "mic",
  18174. "font_class": "mic",
  18175. "unicode": "e671",
  18176. "unicode_decimal": 58993
  18177. }, {
  18178. "icon_id": "24879594",
  18179. "name": "paperplane",
  18180. "font_class": "paperplane",
  18181. "unicode": "e672",
  18182. "unicode_decimal": 58994
  18183. }, {
  18184. "icon_id": "24879595",
  18185. "name": "close",
  18186. "font_class": "close",
  18187. "unicode": "e673",
  18188. "unicode_decimal": 58995
  18189. }, {
  18190. "icon_id": "24879596",
  18191. "name": "help-filled",
  18192. "font_class": "help-filled",
  18193. "unicode": "e674",
  18194. "unicode_decimal": 58996
  18195. }, {
  18196. "icon_id": "24879597",
  18197. "name": "plus-filled",
  18198. "font_class": "paperplane-filled",
  18199. "unicode": "e675",
  18200. "unicode_decimal": 58997
  18201. }, {
  18202. "icon_id": "24879598",
  18203. "name": "plus",
  18204. "font_class": "plus",
  18205. "unicode": "e676",
  18206. "unicode_decimal": 58998
  18207. }, {
  18208. "icon_id": "24879599",
  18209. "name": "mic-filled",
  18210. "font_class": "mic-filled",
  18211. "unicode": "e677",
  18212. "unicode_decimal": 58999
  18213. }, {
  18214. "icon_id": "24879600",
  18215. "name": "image-filled",
  18216. "font_class": "image-filled",
  18217. "unicode": "e678",
  18218. "unicode_decimal": 59000
  18219. }, {
  18220. "icon_id": "24855900",
  18221. "name": "locked-filled",
  18222. "font_class": "locked-filled",
  18223. "unicode": "e668",
  18224. "unicode_decimal": 58984
  18225. }, {
  18226. "icon_id": "24855901",
  18227. "name": "info",
  18228. "font_class": "info",
  18229. "unicode": "e669",
  18230. "unicode_decimal": 58985
  18231. }, {
  18232. "icon_id": "24855903",
  18233. "name": "locked",
  18234. "font_class": "locked",
  18235. "unicode": "e66b",
  18236. "unicode_decimal": 58987
  18237. }, {
  18238. "icon_id": "24855884",
  18239. "name": "camera-filled",
  18240. "font_class": "camera-filled",
  18241. "unicode": "e658",
  18242. "unicode_decimal": 58968
  18243. }, {
  18244. "icon_id": "24855885",
  18245. "name": "chat-filled",
  18246. "font_class": "chat-filled",
  18247. "unicode": "e659",
  18248. "unicode_decimal": 58969
  18249. }, {
  18250. "icon_id": "24855886",
  18251. "name": "camera",
  18252. "font_class": "camera",
  18253. "unicode": "e65a",
  18254. "unicode_decimal": 58970
  18255. }, {
  18256. "icon_id": "24855887",
  18257. "name": "circle",
  18258. "font_class": "circle",
  18259. "unicode": "e65b",
  18260. "unicode_decimal": 58971
  18261. }, {
  18262. "icon_id": "24855888",
  18263. "name": "checkmarkempty",
  18264. "font_class": "checkmarkempty",
  18265. "unicode": "e65c",
  18266. "unicode_decimal": 58972
  18267. }, {
  18268. "icon_id": "24855889",
  18269. "name": "chat",
  18270. "font_class": "chat",
  18271. "unicode": "e65d",
  18272. "unicode_decimal": 58973
  18273. }, {
  18274. "icon_id": "24855890",
  18275. "name": "circle-filled",
  18276. "font_class": "circle-filled",
  18277. "unicode": "e65e",
  18278. "unicode_decimal": 58974
  18279. }, {
  18280. "icon_id": "24855891",
  18281. "name": "flag",
  18282. "font_class": "flag",
  18283. "unicode": "e65f",
  18284. "unicode_decimal": 58975
  18285. }, {
  18286. "icon_id": "24855892",
  18287. "name": "flag-filled",
  18288. "font_class": "flag-filled",
  18289. "unicode": "e660",
  18290. "unicode_decimal": 58976
  18291. }, {
  18292. "icon_id": "24855893",
  18293. "name": "gear-filled",
  18294. "font_class": "gear-filled",
  18295. "unicode": "e661",
  18296. "unicode_decimal": 58977
  18297. }, {
  18298. "icon_id": "24855894",
  18299. "name": "home",
  18300. "font_class": "home",
  18301. "unicode": "e662",
  18302. "unicode_decimal": 58978
  18303. }, {
  18304. "icon_id": "24855895",
  18305. "name": "home-filled",
  18306. "font_class": "home-filled",
  18307. "unicode": "e663",
  18308. "unicode_decimal": 58979
  18309. }, {
  18310. "icon_id": "24855896",
  18311. "name": "gear",
  18312. "font_class": "gear",
  18313. "unicode": "e664",
  18314. "unicode_decimal": 58980
  18315. }, {
  18316. "icon_id": "24855897",
  18317. "name": "smallcircle-filled",
  18318. "font_class": "smallcircle-filled",
  18319. "unicode": "e665",
  18320. "unicode_decimal": 58981
  18321. }, {
  18322. "icon_id": "24855898",
  18323. "name": "map-filled",
  18324. "font_class": "map-filled",
  18325. "unicode": "e666",
  18326. "unicode_decimal": 58982
  18327. }, {
  18328. "icon_id": "24855899",
  18329. "name": "map",
  18330. "font_class": "map",
  18331. "unicode": "e667",
  18332. "unicode_decimal": 58983
  18333. }, {
  18334. "icon_id": "24855825",
  18335. "name": "refresh-filled",
  18336. "font_class": "refresh-filled",
  18337. "unicode": "e656",
  18338. "unicode_decimal": 58966
  18339. }, {
  18340. "icon_id": "24855826",
  18341. "name": "refresh",
  18342. "font_class": "refresh",
  18343. "unicode": "e657",
  18344. "unicode_decimal": 58967
  18345. }, {
  18346. "icon_id": "24855808",
  18347. "name": "cloud-upload",
  18348. "font_class": "cloud-upload",
  18349. "unicode": "e645",
  18350. "unicode_decimal": 58949
  18351. }, {
  18352. "icon_id": "24855809",
  18353. "name": "cloud-download-filled",
  18354. "font_class": "cloud-download-filled",
  18355. "unicode": "e646",
  18356. "unicode_decimal": 58950
  18357. }, {
  18358. "icon_id": "24855810",
  18359. "name": "cloud-download",
  18360. "font_class": "cloud-download",
  18361. "unicode": "e647",
  18362. "unicode_decimal": 58951
  18363. }, {
  18364. "icon_id": "24855811",
  18365. "name": "cloud-upload-filled",
  18366. "font_class": "cloud-upload-filled",
  18367. "unicode": "e648",
  18368. "unicode_decimal": 58952
  18369. }, {
  18370. "icon_id": "24855813",
  18371. "name": "redo",
  18372. "font_class": "redo",
  18373. "unicode": "e64a",
  18374. "unicode_decimal": 58954
  18375. }, {
  18376. "icon_id": "24855814",
  18377. "name": "images-filled",
  18378. "font_class": "images-filled",
  18379. "unicode": "e64b",
  18380. "unicode_decimal": 58955
  18381. }, {
  18382. "icon_id": "24855815",
  18383. "name": "undo-filled",
  18384. "font_class": "undo-filled",
  18385. "unicode": "e64c",
  18386. "unicode_decimal": 58956
  18387. }, {
  18388. "icon_id": "24855816",
  18389. "name": "more",
  18390. "font_class": "more",
  18391. "unicode": "e64d",
  18392. "unicode_decimal": 58957
  18393. }, {
  18394. "icon_id": "24855817",
  18395. "name": "more-filled",
  18396. "font_class": "more-filled",
  18397. "unicode": "e64e",
  18398. "unicode_decimal": 58958
  18399. }, {
  18400. "icon_id": "24855818",
  18401. "name": "undo",
  18402. "font_class": "undo",
  18403. "unicode": "e64f",
  18404. "unicode_decimal": 58959
  18405. }, {
  18406. "icon_id": "24855819",
  18407. "name": "images",
  18408. "font_class": "images",
  18409. "unicode": "e650",
  18410. "unicode_decimal": 58960
  18411. }, {
  18412. "icon_id": "24855821",
  18413. "name": "paperclip",
  18414. "font_class": "paperclip",
  18415. "unicode": "e652",
  18416. "unicode_decimal": 58962
  18417. }, {
  18418. "icon_id": "24855822",
  18419. "name": "settings",
  18420. "font_class": "settings",
  18421. "unicode": "e653",
  18422. "unicode_decimal": 58963
  18423. }, {
  18424. "icon_id": "24855823",
  18425. "name": "search",
  18426. "font_class": "search",
  18427. "unicode": "e654",
  18428. "unicode_decimal": 58964
  18429. }, {
  18430. "icon_id": "24855824",
  18431. "name": "redo-filled",
  18432. "font_class": "redo-filled",
  18433. "unicode": "e655",
  18434. "unicode_decimal": 58965
  18435. }, {
  18436. "icon_id": "24841702",
  18437. "name": "list",
  18438. "font_class": "list",
  18439. "unicode": "e644",
  18440. "unicode_decimal": 58948
  18441. }, {
  18442. "icon_id": "24841489",
  18443. "name": "mail-open-filled",
  18444. "font_class": "mail-open-filled",
  18445. "unicode": "e63a",
  18446. "unicode_decimal": 58938
  18447. }, {
  18448. "icon_id": "24841491",
  18449. "name": "hand-thumbsdown-filled",
  18450. "font_class": "hand-down-filled",
  18451. "unicode": "e63c",
  18452. "unicode_decimal": 58940
  18453. }, {
  18454. "icon_id": "24841492",
  18455. "name": "hand-thumbsdown",
  18456. "font_class": "hand-down",
  18457. "unicode": "e63d",
  18458. "unicode_decimal": 58941
  18459. }, {
  18460. "icon_id": "24841493",
  18461. "name": "hand-thumbsup-filled",
  18462. "font_class": "hand-up-filled",
  18463. "unicode": "e63e",
  18464. "unicode_decimal": 58942
  18465. }, {
  18466. "icon_id": "24841494",
  18467. "name": "hand-thumbsup",
  18468. "font_class": "hand-up",
  18469. "unicode": "e63f",
  18470. "unicode_decimal": 58943
  18471. }, {
  18472. "icon_id": "24841496",
  18473. "name": "heart-filled",
  18474. "font_class": "heart-filled",
  18475. "unicode": "e641",
  18476. "unicode_decimal": 58945
  18477. }, {
  18478. "icon_id": "24841498",
  18479. "name": "mail-open",
  18480. "font_class": "mail-open",
  18481. "unicode": "e643",
  18482. "unicode_decimal": 58947
  18483. }, {
  18484. "icon_id": "24841488",
  18485. "name": "heart",
  18486. "font_class": "heart",
  18487. "unicode": "e639",
  18488. "unicode_decimal": 58937
  18489. }, {
  18490. "icon_id": "24839963",
  18491. "name": "loop",
  18492. "font_class": "loop",
  18493. "unicode": "e633",
  18494. "unicode_decimal": 58931
  18495. }, {
  18496. "icon_id": "24839866",
  18497. "name": "pulldown",
  18498. "font_class": "pulldown",
  18499. "unicode": "e632",
  18500. "unicode_decimal": 58930
  18501. }, {
  18502. "icon_id": "24813798",
  18503. "name": "scan",
  18504. "font_class": "scan",
  18505. "unicode": "e62a",
  18506. "unicode_decimal": 58922
  18507. }, {
  18508. "icon_id": "24813786",
  18509. "name": "bars",
  18510. "font_class": "bars",
  18511. "unicode": "e627",
  18512. "unicode_decimal": 58919
  18513. }, {
  18514. "icon_id": "24813788",
  18515. "name": "cart-filled",
  18516. "font_class": "cart-filled",
  18517. "unicode": "e629",
  18518. "unicode_decimal": 58921
  18519. }, {
  18520. "icon_id": "24813790",
  18521. "name": "checkbox",
  18522. "font_class": "checkbox",
  18523. "unicode": "e62b",
  18524. "unicode_decimal": 58923
  18525. }, {
  18526. "icon_id": "24813791",
  18527. "name": "checkbox-filled",
  18528. "font_class": "checkbox-filled",
  18529. "unicode": "e62c",
  18530. "unicode_decimal": 58924
  18531. }, {
  18532. "icon_id": "24813794",
  18533. "name": "shop",
  18534. "font_class": "shop",
  18535. "unicode": "e62f",
  18536. "unicode_decimal": 58927
  18537. }, {
  18538. "icon_id": "24813795",
  18539. "name": "headphones",
  18540. "font_class": "headphones",
  18541. "unicode": "e630",
  18542. "unicode_decimal": 58928
  18543. }, {
  18544. "icon_id": "24813796",
  18545. "name": "cart",
  18546. "font_class": "cart",
  18547. "unicode": "e631",
  18548. "unicode_decimal": 58929
  18549. }]
  18550. };
  18551. exports.default = _default;
  18552. /***/ }),
  18553. /***/ 26:
  18554. /*!*************************************************!*\
  18555. !*** E:/work/Project_newGit/CKQ/app/pages.json ***!
  18556. \*************************************************/
  18557. /*! no static exports found */
  18558. /***/ (function(module, exports) {
  18559. /***/ }),
  18560. /***/ 260:
  18561. /*!*******************************************************************************************************!*\
  18562. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  18563. \*******************************************************************************************************/
  18564. /*! no static exports found */
  18565. /***/ (function(module, exports, __webpack_require__) {
  18566. "use strict";
  18567. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18568. Object.defineProperty(exports, "__esModule", {
  18569. value: true
  18570. });
  18571. exports.default = void 0;
  18572. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 261));
  18573. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 262));
  18574. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 263));
  18575. var _default = {
  18576. en: _en.default,
  18577. 'zh-Hans': _zhHans.default,
  18578. 'zh-Hant': _zhHant.default
  18579. };
  18580. exports.default = _default;
  18581. /***/ }),
  18582. /***/ 261:
  18583. /*!******************************************************************************************************!*\
  18584. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  18585. \******************************************************************************************************/
  18586. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18587. /***/ (function(module) {
  18588. 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\"}");
  18589. /***/ }),
  18590. /***/ 262:
  18591. /*!***********************************************************************************************************!*\
  18592. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  18593. \***********************************************************************************************************/
  18594. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18595. /***/ (function(module) {
  18596. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  18597. /***/ }),
  18598. /***/ 263:
  18599. /*!***********************************************************************************************************!*\
  18600. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  18601. \***********************************************************************************************************/
  18602. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  18603. /***/ (function(module) {
  18604. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  18605. /***/ }),
  18606. /***/ 271:
  18607. /*!*************************************************************************************************************!*\
  18608. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  18609. \*************************************************************************************************************/
  18610. /*! no static exports found */
  18611. /***/ (function(module, exports, __webpack_require__) {
  18612. "use strict";
  18613. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18614. Object.defineProperty(exports, "__esModule", {
  18615. value: true
  18616. });
  18617. exports.Calendar = void 0;
  18618. exports.addZero = addZero;
  18619. exports.checkDate = checkDate;
  18620. exports.dateCompare = dateCompare;
  18621. exports.fixIosDateFormat = fixIosDateFormat;
  18622. exports.getDate = getDate;
  18623. exports.getDateTime = getDateTime;
  18624. exports.getDefaultSecond = getDefaultSecond;
  18625. exports.getTime = getTime;
  18626. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  18627. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  18628. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  18629. var Calendar = /*#__PURE__*/function () {
  18630. function Calendar() {
  18631. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  18632. selected = _ref.selected,
  18633. startDate = _ref.startDate,
  18634. endDate = _ref.endDate,
  18635. range = _ref.range;
  18636. (0, _classCallCheck2.default)(this, Calendar);
  18637. // 当前日期
  18638. this.date = this.getDateObj(new Date()); // 当前初入日期
  18639. // 打点信息
  18640. this.selected = selected || [];
  18641. // 起始时间
  18642. this.startDate = startDate;
  18643. // 终止时间
  18644. this.endDate = endDate;
  18645. // 是否范围选择
  18646. this.range = range;
  18647. // 多选状态
  18648. this.cleanMultipleStatus();
  18649. // 每周日期
  18650. this.weeks = {};
  18651. this.lastHover = false;
  18652. }
  18653. /**
  18654. * 设置日期
  18655. * @param {Object} date
  18656. */
  18657. (0, _createClass2.default)(Calendar, [{
  18658. key: "setDate",
  18659. value: function setDate(date) {
  18660. var selectDate = this.getDateObj(date);
  18661. this.getWeeks(selectDate.fullDate);
  18662. }
  18663. /**
  18664. * 清理多选状态
  18665. */
  18666. }, {
  18667. key: "cleanMultipleStatus",
  18668. value: function cleanMultipleStatus() {
  18669. this.multipleStatus = {
  18670. before: '',
  18671. after: '',
  18672. data: []
  18673. };
  18674. }
  18675. }, {
  18676. key: "setStartDate",
  18677. value: function setStartDate(startDate) {
  18678. this.startDate = startDate;
  18679. }
  18680. }, {
  18681. key: "setEndDate",
  18682. value: function setEndDate(endDate) {
  18683. this.endDate = endDate;
  18684. }
  18685. }, {
  18686. key: "getPreMonthObj",
  18687. value: function getPreMonthObj(date) {
  18688. date = fixIosDateFormat(date);
  18689. date = new Date(date);
  18690. var oldMonth = date.getMonth();
  18691. date.setMonth(oldMonth - 1);
  18692. var newMonth = date.getMonth();
  18693. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  18694. date.setMonth(newMonth - 1);
  18695. }
  18696. return this.getDateObj(date);
  18697. }
  18698. }, {
  18699. key: "getNextMonthObj",
  18700. value: function getNextMonthObj(date) {
  18701. date = fixIosDateFormat(date);
  18702. date = new Date(date);
  18703. var oldMonth = date.getMonth();
  18704. date.setMonth(oldMonth + 1);
  18705. var newMonth = date.getMonth();
  18706. if (newMonth - oldMonth > 1) {
  18707. date.setMonth(newMonth - 1);
  18708. }
  18709. return this.getDateObj(date);
  18710. }
  18711. /**
  18712. * 获取指定格式Date对象
  18713. */
  18714. }, {
  18715. key: "getDateObj",
  18716. value: function getDateObj(date) {
  18717. date = fixIosDateFormat(date);
  18718. date = new Date(date);
  18719. return {
  18720. fullDate: getDate(date),
  18721. year: date.getFullYear(),
  18722. month: addZero(date.getMonth() + 1),
  18723. date: addZero(date.getDate()),
  18724. day: date.getDay()
  18725. };
  18726. }
  18727. /**
  18728. * 获取上一个月日期集合
  18729. */
  18730. }, {
  18731. key: "getPreMonthDays",
  18732. value: function getPreMonthDays(amount, dateObj) {
  18733. var result = [];
  18734. for (var i = amount - 1; i >= 0; i--) {
  18735. var month = dateObj.month - 1;
  18736. result.push({
  18737. date: new Date(dateObj.year, month, -i).getDate(),
  18738. month: month,
  18739. disable: true
  18740. });
  18741. }
  18742. return result;
  18743. }
  18744. /**
  18745. * 获取本月日期集合
  18746. */
  18747. }, {
  18748. key: "getCurrentMonthDays",
  18749. value: function getCurrentMonthDays(amount, dateObj) {
  18750. var _this = this;
  18751. var result = [];
  18752. var fullDate = this.date.fullDate;
  18753. var _loop = function _loop(i) {
  18754. var currentDate = "".concat(dateObj.year, "-").concat(dateObj.month, "-").concat(addZero(i));
  18755. var isToday = fullDate === currentDate;
  18756. // 获取打点信息
  18757. var info = _this.selected && _this.selected.find(function (item) {
  18758. if (_this.dateEqual(currentDate, item.date)) {
  18759. return item;
  18760. }
  18761. });
  18762. // 日期禁用
  18763. var disableBefore = true;
  18764. var disableAfter = true;
  18765. if (_this.startDate) {
  18766. disableBefore = dateCompare(_this.startDate, currentDate);
  18767. }
  18768. if (_this.endDate) {
  18769. disableAfter = dateCompare(currentDate, _this.endDate);
  18770. }
  18771. var multiples = _this.multipleStatus.data;
  18772. var multiplesStatus = -1;
  18773. if (_this.range && multiples) {
  18774. multiplesStatus = multiples.findIndex(function (item) {
  18775. return _this.dateEqual(item, currentDate);
  18776. });
  18777. }
  18778. var checked = multiplesStatus !== -1;
  18779. result.push({
  18780. fullDate: currentDate,
  18781. year: dateObj.year,
  18782. date: i,
  18783. multiple: _this.range ? checked : false,
  18784. beforeMultiple: _this.isLogicBefore(currentDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18785. afterMultiple: _this.isLogicAfter(currentDate, _this.multipleStatus.before, _this.multipleStatus.after),
  18786. month: dateObj.month,
  18787. disable: _this.startDate && !dateCompare(_this.startDate, currentDate) || _this.endDate && !dateCompare(currentDate, _this.endDate),
  18788. isToday: isToday,
  18789. userChecked: false,
  18790. extraInfo: info
  18791. });
  18792. };
  18793. for (var i = 1; i <= amount; i++) {
  18794. _loop(i);
  18795. }
  18796. return result;
  18797. }
  18798. /**
  18799. * 获取下一个月日期集合
  18800. */
  18801. }, {
  18802. key: "_getNextMonthDays",
  18803. value: function _getNextMonthDays(amount, dateObj) {
  18804. var result = [];
  18805. var month = dateObj.month + 1;
  18806. for (var i = 1; i <= amount; i++) {
  18807. result.push({
  18808. date: i,
  18809. month: month,
  18810. disable: true
  18811. });
  18812. }
  18813. return result;
  18814. }
  18815. /**
  18816. * 获取当前日期详情
  18817. * @param {Object} date
  18818. */
  18819. }, {
  18820. key: "getInfo",
  18821. value: function getInfo(date) {
  18822. var _this2 = this;
  18823. if (!date) {
  18824. date = new Date();
  18825. }
  18826. return this.calendar.find(function (item) {
  18827. return item.fullDate === _this2.getDateObj(date).fullDate;
  18828. });
  18829. }
  18830. /**
  18831. * 比较时间是否相等
  18832. */
  18833. }, {
  18834. key: "dateEqual",
  18835. value: function dateEqual(before, after) {
  18836. before = new Date(fixIosDateFormat(before));
  18837. after = new Date(fixIosDateFormat(after));
  18838. return before.valueOf() === after.valueOf();
  18839. }
  18840. /**
  18841. * 比较真实起始日期
  18842. */
  18843. }, {
  18844. key: "isLogicBefore",
  18845. value: function isLogicBefore(currentDate, before, after) {
  18846. var logicBefore = before;
  18847. if (before && after) {
  18848. logicBefore = dateCompare(before, after) ? before : after;
  18849. }
  18850. return this.dateEqual(logicBefore, currentDate);
  18851. }
  18852. }, {
  18853. key: "isLogicAfter",
  18854. value: function isLogicAfter(currentDate, before, after) {
  18855. var logicAfter = after;
  18856. if (before && after) {
  18857. logicAfter = dateCompare(before, after) ? after : before;
  18858. }
  18859. return this.dateEqual(logicAfter, currentDate);
  18860. }
  18861. /**
  18862. * 获取日期范围内所有日期
  18863. * @param {Object} begin
  18864. * @param {Object} end
  18865. */
  18866. }, {
  18867. key: "geDateAll",
  18868. value: function geDateAll(begin, end) {
  18869. var arr = [];
  18870. var ab = begin.split('-');
  18871. var ae = end.split('-');
  18872. var db = new Date();
  18873. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  18874. var de = new Date();
  18875. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  18876. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  18877. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  18878. for (var k = unixDb; k <= unixDe;) {
  18879. k = k + 24 * 60 * 60 * 1000;
  18880. arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
  18881. }
  18882. return arr;
  18883. }
  18884. /**
  18885. * 获取多选状态
  18886. */
  18887. }, {
  18888. key: "setMultiple",
  18889. value: function setMultiple(fullDate) {
  18890. if (!this.range) return;
  18891. var _this$multipleStatus = this.multipleStatus,
  18892. before = _this$multipleStatus.before,
  18893. after = _this$multipleStatus.after;
  18894. if (before && after) {
  18895. if (!this.lastHover) {
  18896. this.lastHover = true;
  18897. return;
  18898. }
  18899. this.multipleStatus.before = fullDate;
  18900. this.multipleStatus.after = '';
  18901. this.multipleStatus.data = [];
  18902. this.multipleStatus.fulldate = '';
  18903. this.lastHover = false;
  18904. } else {
  18905. if (!before) {
  18906. this.multipleStatus.before = fullDate;
  18907. this.lastHover = false;
  18908. } else {
  18909. this.multipleStatus.after = fullDate;
  18910. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18911. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18912. } else {
  18913. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18914. }
  18915. this.lastHover = true;
  18916. }
  18917. }
  18918. this.getWeeks(fullDate);
  18919. }
  18920. /**
  18921. * 鼠标 hover 更新多选状态
  18922. */
  18923. }, {
  18924. key: "setHoverMultiple",
  18925. value: function setHoverMultiple(fullDate) {
  18926. if (!this.range || this.lastHover) return;
  18927. var before = this.multipleStatus.before;
  18928. if (!before) {
  18929. this.multipleStatus.before = fullDate;
  18930. } else {
  18931. this.multipleStatus.after = fullDate;
  18932. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18933. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18934. } else {
  18935. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18936. }
  18937. }
  18938. this.getWeeks(fullDate);
  18939. }
  18940. /**
  18941. * 更新默认值多选状态
  18942. */
  18943. }, {
  18944. key: "setDefaultMultiple",
  18945. value: function setDefaultMultiple(before, after) {
  18946. this.multipleStatus.before = before;
  18947. this.multipleStatus.after = after;
  18948. if (before && after) {
  18949. if (dateCompare(before, after)) {
  18950. this.multipleStatus.data = this.geDateAll(before, after);
  18951. this.getWeeks(after);
  18952. } else {
  18953. this.multipleStatus.data = this.geDateAll(after, before);
  18954. this.getWeeks(before);
  18955. }
  18956. }
  18957. }
  18958. /**
  18959. * 获取每周数据
  18960. * @param {Object} dateData
  18961. */
  18962. }, {
  18963. key: "getWeeks",
  18964. value: function getWeeks(dateData) {
  18965. var _this$getDateObj = this.getDateObj(dateData),
  18966. year = _this$getDateObj.year,
  18967. month = _this$getDateObj.month;
  18968. var preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  18969. var preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  18970. var currentMonthDayAmount = new Date(year, month, 0).getDate();
  18971. var currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  18972. var nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  18973. var nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  18974. var calendarDays = [].concat((0, _toConsumableArray2.default)(preMonthDays), (0, _toConsumableArray2.default)(currentMonthDays), (0, _toConsumableArray2.default)(nextMonthDays));
  18975. var weeks = new Array(6);
  18976. for (var i = 0; i < calendarDays.length; i++) {
  18977. var index = Math.floor(i / 7);
  18978. if (!weeks[index]) {
  18979. weeks[index] = new Array(7);
  18980. }
  18981. weeks[index][i % 7] = calendarDays[i];
  18982. }
  18983. this.calendar = calendarDays;
  18984. this.weeks = weeks;
  18985. }
  18986. }]);
  18987. return Calendar;
  18988. }();
  18989. exports.Calendar = Calendar;
  18990. function getDateTime(date, hideSecond) {
  18991. return "".concat(getDate(date), " ").concat(getTime(date, hideSecond));
  18992. }
  18993. function getDate(date) {
  18994. date = fixIosDateFormat(date);
  18995. date = new Date(date);
  18996. var year = date.getFullYear();
  18997. var month = date.getMonth() + 1;
  18998. var day = date.getDate();
  18999. return "".concat(year, "-").concat(addZero(month), "-").concat(addZero(day));
  19000. }
  19001. function getTime(date, hideSecond) {
  19002. date = fixIosDateFormat(date);
  19003. date = new Date(date);
  19004. var hour = date.getHours();
  19005. var minute = date.getMinutes();
  19006. var second = date.getSeconds();
  19007. return hideSecond ? "".concat(addZero(hour), ":").concat(addZero(minute)) : "".concat(addZero(hour), ":").concat(addZero(minute), ":").concat(addZero(second));
  19008. }
  19009. function addZero(num) {
  19010. if (num < 10) {
  19011. num = "0".concat(num);
  19012. }
  19013. return num;
  19014. }
  19015. function getDefaultSecond(hideSecond) {
  19016. return hideSecond ? '00:00' : '00:00:00';
  19017. }
  19018. function dateCompare(startDate, endDate) {
  19019. startDate = new Date(fixIosDateFormat(startDate));
  19020. endDate = new Date(fixIosDateFormat(endDate));
  19021. return startDate <= endDate;
  19022. }
  19023. function checkDate(date) {
  19024. var dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  19025. return date.match(dateReg);
  19026. }
  19027. 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])?$/;
  19028. function fixIosDateFormat(value) {
  19029. if (typeof value === 'string' && dateTimeReg.test(value)) {
  19030. value = value.replace(/-/g, '/');
  19031. }
  19032. return value;
  19033. }
  19034. /***/ }),
  19035. /***/ 3:
  19036. /*!***********************************!*\
  19037. !*** (webpack)/buildin/global.js ***!
  19038. \***********************************/
  19039. /*! no static exports found */
  19040. /***/ (function(module, exports) {
  19041. var g;
  19042. // This works in non-strict mode
  19043. g = (function() {
  19044. return this;
  19045. })();
  19046. try {
  19047. // This works if eval is allowed (see CSP)
  19048. g = g || new Function("return this")();
  19049. } catch (e) {
  19050. // This works if the window reference is available
  19051. if (typeof window === "object") g = window;
  19052. }
  19053. // g can still be undefined, but nothing to do about it...
  19054. // We return undefined, instead of nothing here, so it's
  19055. // easier to handle this case. if(!global) { ...}
  19056. module.exports = g;
  19057. /***/ }),
  19058. /***/ 32:
  19059. /*!**********************************************************************************************************!*\
  19060. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  19061. \**********************************************************************************************************/
  19062. /*! exports provided: default */
  19063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19064. "use strict";
  19065. __webpack_require__.r(__webpack_exports__);
  19066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  19067. /* globals __VUE_SSR_CONTEXT__ */
  19068. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  19069. // This module is a runtime utility for cleaner component module output and will
  19070. // be included in the final webpack user bundle.
  19071. function normalizeComponent (
  19072. scriptExports,
  19073. render,
  19074. staticRenderFns,
  19075. functionalTemplate,
  19076. injectStyles,
  19077. scopeId,
  19078. moduleIdentifier, /* server only */
  19079. shadowMode, /* vue-cli only */
  19080. components, // fixed by xxxxxx auto components
  19081. renderjs // fixed by xxxxxx renderjs
  19082. ) {
  19083. // Vue.extend constructor export interop
  19084. var options = typeof scriptExports === 'function'
  19085. ? scriptExports.options
  19086. : scriptExports
  19087. // fixed by xxxxxx auto components
  19088. if (components) {
  19089. if (!options.components) {
  19090. options.components = {}
  19091. }
  19092. var hasOwn = Object.prototype.hasOwnProperty
  19093. for (var name in components) {
  19094. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  19095. options.components[name] = components[name]
  19096. }
  19097. }
  19098. }
  19099. // fixed by xxxxxx renderjs
  19100. if (renderjs) {
  19101. if(typeof renderjs.beforeCreate === 'function'){
  19102. renderjs.beforeCreate = [renderjs.beforeCreate]
  19103. }
  19104. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  19105. this[renderjs.__module] = this
  19106. });
  19107. (options.mixins || (options.mixins = [])).push(renderjs)
  19108. }
  19109. // render functions
  19110. if (render) {
  19111. options.render = render
  19112. options.staticRenderFns = staticRenderFns
  19113. options._compiled = true
  19114. }
  19115. // functional template
  19116. if (functionalTemplate) {
  19117. options.functional = true
  19118. }
  19119. // scopedId
  19120. if (scopeId) {
  19121. options._scopeId = 'data-v-' + scopeId
  19122. }
  19123. var hook
  19124. if (moduleIdentifier) { // server build
  19125. hook = function (context) {
  19126. // 2.3 injection
  19127. context =
  19128. context || // cached call
  19129. (this.$vnode && this.$vnode.ssrContext) || // stateful
  19130. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  19131. // 2.2 with runInNewContext: true
  19132. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  19133. context = __VUE_SSR_CONTEXT__
  19134. }
  19135. // inject component styles
  19136. if (injectStyles) {
  19137. injectStyles.call(this, context)
  19138. }
  19139. // register component module identifier for async chunk inferrence
  19140. if (context && context._registeredComponents) {
  19141. context._registeredComponents.add(moduleIdentifier)
  19142. }
  19143. }
  19144. // used by ssr in case component is cached and beforeCreate
  19145. // never gets called
  19146. options._ssrRegister = hook
  19147. } else if (injectStyles) {
  19148. hook = shadowMode
  19149. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  19150. : injectStyles
  19151. }
  19152. if (hook) {
  19153. if (options.functional) {
  19154. // for template-only hot-reload because in that case the render fn doesn't
  19155. // go through the normalizer
  19156. options._injectStyles = hook
  19157. // register for functioal component in vue file
  19158. var originalRender = options.render
  19159. options.render = function renderWithStyleInjection (h, context) {
  19160. hook.call(context)
  19161. return originalRender(h, context)
  19162. }
  19163. } else {
  19164. // inject component registration as beforeCreate hook
  19165. var existing = options.beforeCreate
  19166. options.beforeCreate = existing
  19167. ? [].concat(existing, hook)
  19168. : [hook]
  19169. }
  19170. }
  19171. return {
  19172. exports: scriptExports,
  19173. options: options
  19174. }
  19175. }
  19176. /***/ }),
  19177. /***/ 381:
  19178. /*!********************************************************************************************************************!*\
  19179. !*** E:/work/Project_newGit/CKQ/app/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js ***!
  19180. \********************************************************************************************************************/
  19181. /*! no static exports found */
  19182. /***/ (function(module, exports, __webpack_require__) {
  19183. "use strict";
  19184. /* WEBPACK VAR INJECTION */(function(uniCloud) {
  19185. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19186. Object.defineProperty(exports, "__esModule", {
  19187. value: true
  19188. });
  19189. exports.default = void 0;
  19190. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  19191. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  19192. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  19193. var _default2 = {
  19194. props: {
  19195. localdata: {
  19196. type: [Array, Object],
  19197. default: function _default() {
  19198. return [];
  19199. }
  19200. },
  19201. spaceInfo: {
  19202. type: Object,
  19203. default: function _default() {
  19204. return {};
  19205. }
  19206. },
  19207. collection: {
  19208. type: String,
  19209. default: ''
  19210. },
  19211. action: {
  19212. type: String,
  19213. default: ''
  19214. },
  19215. field: {
  19216. type: String,
  19217. default: ''
  19218. },
  19219. orderby: {
  19220. type: String,
  19221. default: ''
  19222. },
  19223. where: {
  19224. type: [String, Object],
  19225. default: ''
  19226. },
  19227. pageData: {
  19228. type: String,
  19229. default: 'add'
  19230. },
  19231. pageCurrent: {
  19232. type: Number,
  19233. default: 1
  19234. },
  19235. pageSize: {
  19236. type: Number,
  19237. default: 500
  19238. },
  19239. getcount: {
  19240. type: [Boolean, String],
  19241. default: false
  19242. },
  19243. getone: {
  19244. type: [Boolean, String],
  19245. default: false
  19246. },
  19247. gettree: {
  19248. type: [Boolean, String],
  19249. default: false
  19250. },
  19251. manual: {
  19252. type: Boolean,
  19253. default: false
  19254. },
  19255. value: {
  19256. type: [Array, String, Number],
  19257. default: function _default() {
  19258. return [];
  19259. }
  19260. },
  19261. modelValue: {
  19262. type: [Array, String, Number],
  19263. default: function _default() {
  19264. return [];
  19265. }
  19266. },
  19267. preload: {
  19268. type: Boolean,
  19269. default: false
  19270. },
  19271. stepSearh: {
  19272. type: Boolean,
  19273. default: true
  19274. },
  19275. selfField: {
  19276. type: String,
  19277. default: ''
  19278. },
  19279. parentField: {
  19280. type: String,
  19281. default: ''
  19282. },
  19283. multiple: {
  19284. type: Boolean,
  19285. default: false
  19286. },
  19287. map: {
  19288. type: Object,
  19289. default: function _default() {
  19290. return {
  19291. text: "text",
  19292. value: "value"
  19293. };
  19294. }
  19295. }
  19296. },
  19297. data: function data() {
  19298. return {
  19299. loading: false,
  19300. errorMessage: '',
  19301. loadMore: {
  19302. contentdown: '',
  19303. contentrefresh: '',
  19304. contentnomore: ''
  19305. },
  19306. dataList: [],
  19307. selected: [],
  19308. selectedIndex: 0,
  19309. page: {
  19310. current: this.pageCurrent,
  19311. size: this.pageSize,
  19312. count: 0
  19313. }
  19314. };
  19315. },
  19316. computed: {
  19317. isLocalData: function isLocalData() {
  19318. return !this.collection.length;
  19319. },
  19320. isCloudData: function isCloudData() {
  19321. return this.collection.length > 0;
  19322. },
  19323. isCloudDataList: function isCloudDataList() {
  19324. return this.isCloudData && !this.parentField && !this.selfField;
  19325. },
  19326. isCloudDataTree: function isCloudDataTree() {
  19327. return this.isCloudData && this.parentField && this.selfField;
  19328. },
  19329. dataValue: function dataValue() {
  19330. var isModelValue = Array.isArray(this.modelValue) ? this.modelValue.length > 0 : this.modelValue !== null || this.modelValue !== undefined;
  19331. return isModelValue ? this.modelValue : this.value;
  19332. },
  19333. hasValue: function hasValue() {
  19334. if (typeof this.dataValue === 'number') {
  19335. return true;
  19336. }
  19337. return this.dataValue != null && this.dataValue.length > 0;
  19338. }
  19339. },
  19340. created: function created() {
  19341. var _this = this;
  19342. this.$watch(function () {
  19343. var al = [];
  19344. ['pageCurrent', 'pageSize', 'spaceInfo', 'value', 'modelValue', 'localdata', 'collection', 'action', 'field', 'orderby', 'where', 'getont', 'getcount', 'gettree'].forEach(function (key) {
  19345. al.push(_this[key]);
  19346. });
  19347. return al;
  19348. }, function (newValue, oldValue) {
  19349. var needReset = false;
  19350. for (var i = 2; i < newValue.length; i++) {
  19351. if (newValue[i] != oldValue[i]) {
  19352. needReset = true;
  19353. break;
  19354. }
  19355. }
  19356. if (newValue[0] != oldValue[0]) {
  19357. _this.page.current = _this.pageCurrent;
  19358. }
  19359. _this.page.size = _this.pageSize;
  19360. _this.onPropsChange();
  19361. });
  19362. this._treeData = [];
  19363. },
  19364. methods: {
  19365. onPropsChange: function onPropsChange() {
  19366. this._treeData = [];
  19367. },
  19368. // 填充 pickview 数据
  19369. loadData: function loadData() {
  19370. var _this2 = this;
  19371. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  19372. return _regenerator.default.wrap(function _callee$(_context) {
  19373. while (1) {
  19374. switch (_context.prev = _context.next) {
  19375. case 0:
  19376. if (_this2.isLocalData) {
  19377. _this2.loadLocalData();
  19378. } else if (_this2.isCloudDataList) {
  19379. _this2.loadCloudDataList();
  19380. } else if (_this2.isCloudDataTree) {
  19381. _this2.loadCloudDataTree();
  19382. }
  19383. case 1:
  19384. case "end":
  19385. return _context.stop();
  19386. }
  19387. }
  19388. }, _callee);
  19389. }))();
  19390. },
  19391. // 加载本地数据
  19392. loadLocalData: function loadLocalData() {
  19393. var _this3 = this;
  19394. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
  19395. var inputValue;
  19396. return _regenerator.default.wrap(function _callee2$(_context2) {
  19397. while (1) {
  19398. switch (_context2.prev = _context2.next) {
  19399. case 0:
  19400. _this3._treeData = [];
  19401. _this3._extractTree(_this3.localdata, _this3._treeData);
  19402. inputValue = _this3.dataValue;
  19403. if (!(inputValue === undefined)) {
  19404. _context2.next = 5;
  19405. break;
  19406. }
  19407. return _context2.abrupt("return");
  19408. case 5:
  19409. if (Array.isArray(inputValue)) {
  19410. inputValue = inputValue[inputValue.length - 1];
  19411. if ((0, _typeof2.default)(inputValue) === 'object' && inputValue[_this3.map.value]) {
  19412. inputValue = inputValue[_this3.map.value];
  19413. }
  19414. }
  19415. _this3.selected = _this3._findNodePath(inputValue, _this3.localdata);
  19416. case 7:
  19417. case "end":
  19418. return _context2.stop();
  19419. }
  19420. }
  19421. }, _callee2);
  19422. }))();
  19423. },
  19424. // 加载 Cloud 数据 (单列)
  19425. loadCloudDataList: function loadCloudDataList() {
  19426. var _this4 = this;
  19427. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  19428. var response, responseData;
  19429. return _regenerator.default.wrap(function _callee3$(_context3) {
  19430. while (1) {
  19431. switch (_context3.prev = _context3.next) {
  19432. case 0:
  19433. if (!_this4.loading) {
  19434. _context3.next = 2;
  19435. break;
  19436. }
  19437. return _context3.abrupt("return");
  19438. case 2:
  19439. _this4.loading = true;
  19440. _context3.prev = 3;
  19441. _context3.next = 6;
  19442. return _this4.getCommand();
  19443. case 6:
  19444. response = _context3.sent;
  19445. responseData = response.result.data;
  19446. _this4._treeData = responseData;
  19447. _this4._updateBindData();
  19448. _this4._updateSelected();
  19449. _this4.onDataChange();
  19450. _context3.next = 17;
  19451. break;
  19452. case 14:
  19453. _context3.prev = 14;
  19454. _context3.t0 = _context3["catch"](3);
  19455. _this4.errorMessage = _context3.t0;
  19456. case 17:
  19457. _context3.prev = 17;
  19458. _this4.loading = false;
  19459. return _context3.finish(17);
  19460. case 20:
  19461. case "end":
  19462. return _context3.stop();
  19463. }
  19464. }
  19465. }, _callee3, null, [[3, 14, 17, 20]]);
  19466. }))();
  19467. },
  19468. // 加载 Cloud 数据 (树形)
  19469. loadCloudDataTree: function loadCloudDataTree() {
  19470. var _this5 = this;
  19471. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
  19472. var commandOptions, response, responseData;
  19473. return _regenerator.default.wrap(function _callee4$(_context4) {
  19474. while (1) {
  19475. switch (_context4.prev = _context4.next) {
  19476. case 0:
  19477. if (!_this5.loading) {
  19478. _context4.next = 2;
  19479. break;
  19480. }
  19481. return _context4.abrupt("return");
  19482. case 2:
  19483. _this5.loading = true;
  19484. _context4.prev = 3;
  19485. commandOptions = {
  19486. field: _this5._cloudDataPostField(),
  19487. where: _this5._cloudDataTreeWhere()
  19488. };
  19489. if (_this5.gettree) {
  19490. commandOptions.startwith = "".concat(_this5.selfField, "=='").concat(_this5.dataValue, "'");
  19491. }
  19492. _context4.next = 8;
  19493. return _this5.getCommand(commandOptions);
  19494. case 8:
  19495. response = _context4.sent;
  19496. responseData = response.result.data;
  19497. _this5._treeData = responseData;
  19498. _this5._updateBindData();
  19499. _this5._updateSelected();
  19500. _this5.onDataChange();
  19501. _context4.next = 19;
  19502. break;
  19503. case 16:
  19504. _context4.prev = 16;
  19505. _context4.t0 = _context4["catch"](3);
  19506. _this5.errorMessage = _context4.t0;
  19507. case 19:
  19508. _context4.prev = 19;
  19509. _this5.loading = false;
  19510. return _context4.finish(19);
  19511. case 22:
  19512. case "end":
  19513. return _context4.stop();
  19514. }
  19515. }
  19516. }, _callee4, null, [[3, 16, 19, 22]]);
  19517. }))();
  19518. },
  19519. // 加载 Cloud 数据 (节点)
  19520. loadCloudDataNode: function loadCloudDataNode(callback) {
  19521. var _this6 = this;
  19522. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
  19523. var commandOptions, response, responseData;
  19524. return _regenerator.default.wrap(function _callee5$(_context5) {
  19525. while (1) {
  19526. switch (_context5.prev = _context5.next) {
  19527. case 0:
  19528. if (!_this6.loading) {
  19529. _context5.next = 2;
  19530. break;
  19531. }
  19532. return _context5.abrupt("return");
  19533. case 2:
  19534. _this6.loading = true;
  19535. _context5.prev = 3;
  19536. commandOptions = {
  19537. field: _this6._cloudDataPostField(),
  19538. where: _this6._cloudDataNodeWhere()
  19539. };
  19540. _context5.next = 7;
  19541. return _this6.getCommand(commandOptions);
  19542. case 7:
  19543. response = _context5.sent;
  19544. responseData = response.result.data;
  19545. callback(responseData);
  19546. _context5.next = 15;
  19547. break;
  19548. case 12:
  19549. _context5.prev = 12;
  19550. _context5.t0 = _context5["catch"](3);
  19551. _this6.errorMessage = _context5.t0;
  19552. case 15:
  19553. _context5.prev = 15;
  19554. _this6.loading = false;
  19555. return _context5.finish(15);
  19556. case 18:
  19557. case "end":
  19558. return _context5.stop();
  19559. }
  19560. }
  19561. }, _callee5, null, [[3, 12, 15, 18]]);
  19562. }))();
  19563. },
  19564. // 回显 Cloud 数据
  19565. getCloudDataValue: function getCloudDataValue() {
  19566. if (this.isCloudDataList) {
  19567. return this.getCloudDataListValue();
  19568. }
  19569. if (this.isCloudDataTree) {
  19570. return this.getCloudDataTreeValue();
  19571. }
  19572. },
  19573. // 回显 Cloud 数据 (单列)
  19574. getCloudDataListValue: function getCloudDataListValue() {
  19575. var _this7 = this;
  19576. // 根据 field's as value标识匹配 where 条件
  19577. var where = [];
  19578. var whereField = this._getForeignKeyByField();
  19579. if (whereField) {
  19580. where.push("".concat(whereField, " == '").concat(this.dataValue, "'"));
  19581. }
  19582. where = where.join(' || ');
  19583. if (this.where) {
  19584. where = "(".concat(this.where, ") && (").concat(where, ")");
  19585. }
  19586. return this.getCommand({
  19587. field: this._cloudDataPostField(),
  19588. where: where
  19589. }).then(function (res) {
  19590. _this7.selected = res.result.data;
  19591. return res.result.data;
  19592. });
  19593. },
  19594. // 回显 Cloud 数据 (树形)
  19595. getCloudDataTreeValue: function getCloudDataTreeValue() {
  19596. var _this8 = this;
  19597. return this.getCommand({
  19598. field: this._cloudDataPostField(),
  19599. getTreePath: {
  19600. startWith: "".concat(this.selfField, "=='").concat(this.dataValue, "'")
  19601. }
  19602. }).then(function (res) {
  19603. var treePath = [];
  19604. _this8._extractTreePath(res.result.data, treePath);
  19605. _this8.selected = treePath;
  19606. return treePath;
  19607. });
  19608. },
  19609. getCommand: function getCommand() {
  19610. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  19611. /* eslint-disable no-undef */
  19612. var db = uniCloud.database(this.spaceInfo);
  19613. var action = options.action || this.action;
  19614. if (action) {
  19615. db = db.action(action);
  19616. }
  19617. var collection = options.collection || this.collection;
  19618. db = db.collection(collection);
  19619. var where = options.where || this.where;
  19620. if (!(!where || !Object.keys(where).length)) {
  19621. db = db.where(where);
  19622. }
  19623. var field = options.field || this.field;
  19624. if (field) {
  19625. db = db.field(field);
  19626. }
  19627. var orderby = options.orderby || this.orderby;
  19628. if (orderby) {
  19629. db = db.orderBy(orderby);
  19630. }
  19631. var current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current;
  19632. var size = options.pageSize !== undefined ? options.pageSize : this.page.size;
  19633. var getCount = options.getcount !== undefined ? options.getcount : this.getcount;
  19634. var getTree = options.gettree !== undefined ? options.gettree : this.gettree;
  19635. var getOptions = {
  19636. getCount: getCount,
  19637. getTree: getTree
  19638. };
  19639. if (options.getTreePath) {
  19640. getOptions.getTreePath = options.getTreePath;
  19641. }
  19642. db = db.skip(size * (current - 1)).limit(size).get(getOptions);
  19643. return db;
  19644. },
  19645. _cloudDataPostField: function _cloudDataPostField() {
  19646. var fields = [this.field];
  19647. if (this.parentField) {
  19648. fields.push("".concat(this.parentField, " as parent_value"));
  19649. }
  19650. return fields.join(',');
  19651. },
  19652. _cloudDataTreeWhere: function _cloudDataTreeWhere() {
  19653. var result = [];
  19654. var selected = this.selected;
  19655. var parentField = this.parentField;
  19656. if (parentField) {
  19657. result.push("".concat(parentField, " == null || ").concat(parentField, " == \"\""));
  19658. }
  19659. if (selected.length) {
  19660. for (var i = 0; i < selected.length - 1; i++) {
  19661. result.push("".concat(parentField, " == '").concat(selected[i].value, "'"));
  19662. }
  19663. }
  19664. var where = [];
  19665. if (this.where) {
  19666. where.push("(".concat(this.where, ")"));
  19667. }
  19668. if (result.length) {
  19669. where.push("(".concat(result.join(' || '), ")"));
  19670. }
  19671. return where.join(' && ');
  19672. },
  19673. _cloudDataNodeWhere: function _cloudDataNodeWhere() {
  19674. var where = [];
  19675. var selected = this.selected;
  19676. if (selected.length) {
  19677. where.push("".concat(this.parentField, " == '").concat(selected[selected.length - 1].value, "'"));
  19678. }
  19679. where = where.join(' || ');
  19680. if (this.where) {
  19681. return "(".concat(this.where, ") && (").concat(where, ")");
  19682. }
  19683. return where;
  19684. },
  19685. _getWhereByForeignKey: function _getWhereByForeignKey() {
  19686. var result = [];
  19687. var whereField = this._getForeignKeyByField();
  19688. if (whereField) {
  19689. result.push("".concat(whereField, " == '").concat(this.dataValue, "'"));
  19690. }
  19691. if (this.where) {
  19692. return "(".concat(this.where, ") && (").concat(result.join(' || '), ")");
  19693. }
  19694. return result.join(' || ');
  19695. },
  19696. _getForeignKeyByField: function _getForeignKeyByField() {
  19697. var fields = this.field.split(',');
  19698. var whereField = null;
  19699. for (var i = 0; i < fields.length; i++) {
  19700. var items = fields[i].split('as');
  19701. if (items.length < 2) {
  19702. continue;
  19703. }
  19704. if (items[1].trim() === 'value') {
  19705. whereField = items[0].trim();
  19706. break;
  19707. }
  19708. }
  19709. return whereField;
  19710. },
  19711. _updateBindData: function _updateBindData(node) {
  19712. var _this$_filterData = this._filterData(this._treeData, this.selected),
  19713. dataList = _this$_filterData.dataList,
  19714. hasNodes = _this$_filterData.hasNodes;
  19715. var isleaf = this._stepSearh === false && !hasNodes;
  19716. if (node) {
  19717. node.isleaf = isleaf;
  19718. }
  19719. this.dataList = dataList;
  19720. this.selectedIndex = dataList.length - 1;
  19721. if (!isleaf && this.selected.length < dataList.length) {
  19722. this.selected.push({
  19723. value: null,
  19724. text: "请选择"
  19725. });
  19726. }
  19727. return {
  19728. isleaf: isleaf,
  19729. hasNodes: hasNodes
  19730. };
  19731. },
  19732. _updateSelected: function _updateSelected() {
  19733. var dl = this.dataList;
  19734. var sl = this.selected;
  19735. var textField = this.map.text;
  19736. var valueField = this.map.value;
  19737. for (var i = 0; i < sl.length; i++) {
  19738. var value = sl[i].value;
  19739. var dl2 = dl[i];
  19740. for (var j = 0; j < dl2.length; j++) {
  19741. var item2 = dl2[j];
  19742. if (item2[valueField] === value) {
  19743. sl[i].text = item2[textField];
  19744. break;
  19745. }
  19746. }
  19747. }
  19748. },
  19749. _filterData: function _filterData(data, paths) {
  19750. var dataList = [];
  19751. var hasNodes = true;
  19752. dataList.push(data.filter(function (item) {
  19753. return item.parent_value === null || item.parent_value === undefined || item.parent_value === '';
  19754. }));
  19755. var _loop = function _loop(i) {
  19756. var value = paths[i].value;
  19757. var nodes = data.filter(function (item) {
  19758. return item.parent_value === value;
  19759. });
  19760. if (nodes.length) {
  19761. dataList.push(nodes);
  19762. } else {
  19763. hasNodes = false;
  19764. }
  19765. };
  19766. for (var i = 0; i < paths.length; i++) {
  19767. _loop(i);
  19768. }
  19769. return {
  19770. dataList: dataList,
  19771. hasNodes: hasNodes
  19772. };
  19773. },
  19774. _extractTree: function _extractTree(nodes, result, parent_value) {
  19775. var list = result || [];
  19776. var valueField = this.map.value;
  19777. for (var i = 0; i < nodes.length; i++) {
  19778. var node = nodes[i];
  19779. var child = {};
  19780. for (var key in node) {
  19781. if (key !== 'children') {
  19782. child[key] = node[key];
  19783. }
  19784. }
  19785. if (parent_value !== null && parent_value !== undefined && parent_value !== '') {
  19786. child.parent_value = parent_value;
  19787. }
  19788. result.push(child);
  19789. var children = node.children;
  19790. if (children) {
  19791. this._extractTree(children, result, node[valueField]);
  19792. }
  19793. }
  19794. },
  19795. _extractTreePath: function _extractTreePath(nodes, result) {
  19796. var list = result || [];
  19797. for (var i = 0; i < nodes.length; i++) {
  19798. var node = nodes[i];
  19799. var child = {};
  19800. for (var key in node) {
  19801. if (key !== 'children') {
  19802. child[key] = node[key];
  19803. }
  19804. }
  19805. result.push(child);
  19806. var children = node.children;
  19807. if (children) {
  19808. this._extractTreePath(children, result);
  19809. }
  19810. }
  19811. },
  19812. _findNodePath: function _findNodePath(key, nodes) {
  19813. var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  19814. var textField = this.map.text;
  19815. var valueField = this.map.value;
  19816. for (var i = 0; i < nodes.length; i++) {
  19817. var node = nodes[i];
  19818. var children = node.children;
  19819. var text = node[textField];
  19820. var value = node[valueField];
  19821. path.push({
  19822. value: value,
  19823. text: text
  19824. });
  19825. if (value === key) {
  19826. return path;
  19827. }
  19828. if (children) {
  19829. var p = this._findNodePath(key, children, path);
  19830. if (p.length) {
  19831. return p;
  19832. }
  19833. }
  19834. path.pop();
  19835. }
  19836. return [];
  19837. }
  19838. }
  19839. };
  19840. exports.default = _default2;
  19841. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 210)["default"]))
  19842. /***/ }),
  19843. /***/ 39:
  19844. /*!**************************************************!*\
  19845. !*** E:/work/Project_newGit/CKQ/app/api/user.js ***!
  19846. \**************************************************/
  19847. /*! no static exports found */
  19848. /***/ (function(module, exports, __webpack_require__) {
  19849. "use strict";
  19850. Object.defineProperty(exports, "__esModule", {
  19851. value: true
  19852. });
  19853. exports.getUserByPage = getUserByPage;
  19854. exports.getUserInfo = getUserInfo;
  19855. exports.getUserList = getUserList;
  19856. exports.login = login;
  19857. exports.logout = logout;
  19858. exports.updatePassword = updatePassword;
  19859. exports.uploadFile = uploadFile;
  19860. exports.wxWorkLogin = wxWorkLogin;
  19861. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  19862. function login(data) {
  19863. return (0, _request.request)({
  19864. url: '/login',
  19865. method: 'post',
  19866. header: {
  19867. 'content-type': "application/x-www-form-urlencoded"
  19868. },
  19869. data: data
  19870. });
  19871. }
  19872. function getUserInfo() {
  19873. return (0, _request.request)({
  19874. url: '/user/profile'
  19875. });
  19876. }
  19877. function logout() {
  19878. return (0, _request.request)({
  19879. url: '/logout',
  19880. method: 'GET'
  19881. });
  19882. }
  19883. /**公用上传接口 */
  19884. function uploadFile(data) {
  19885. return (0, _request.request)({
  19886. url: '/upload/file',
  19887. method: "post",
  19888. headers: {
  19889. 'Content-Type': 'multipart/form-data'
  19890. },
  19891. data: data
  19892. });
  19893. }
  19894. /**
  19895. * 更新密码
  19896. * @param data
  19897. * @returns
  19898. */
  19899. function updatePassword(data) {
  19900. return (0, _request.request)({
  19901. url: "/user/updatePassword",
  19902. method: 'PUT',
  19903. data: data
  19904. });
  19905. }
  19906. //查询用户的带岗位
  19907. function getUserList() {
  19908. return (0, _request.request)({
  19909. url: '/user/select',
  19910. method: 'get'
  19911. });
  19912. }
  19913. //企业微信登录
  19914. function wxWorkLogin(_ref) {
  19915. var userId = _ref.userId,
  19916. code = _ref.code;
  19917. return (0, _request.request)({
  19918. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  19919. method: 'post'
  19920. });
  19921. }
  19922. /**
  19923. * 分页获取用户
  19924. * @param data
  19925. * @returns
  19926. */
  19927. function getUserByPage(data) {
  19928. return (0, _request.request)({
  19929. url: '/user/page',
  19930. method: 'GET',
  19931. header: {
  19932. 'content-type': "application/x-www-form-urlencoded"
  19933. },
  19934. data: data
  19935. });
  19936. }
  19937. /***/ }),
  19938. /***/ 393:
  19939. /*!*************************************************************!*\
  19940. !*** E:/work/Project_newGit/CKQ/app/api/system/groupApi.js ***!
  19941. \*************************************************************/
  19942. /*! no static exports found */
  19943. /***/ (function(module, exports, __webpack_require__) {
  19944. "use strict";
  19945. Object.defineProperty(exports, "__esModule", {
  19946. value: true
  19947. });
  19948. exports.getGroupByList = getGroupByList;
  19949. var _request = __webpack_require__(/*! @/libs/request.js */ 40);
  19950. /**
  19951. * 获取部门列表
  19952. * @param data
  19953. * @returns {AxiosPromise}
  19954. */
  19955. function getGroupByList() {
  19956. return (0, _request.request)({
  19957. url: '/group',
  19958. method: 'GET'
  19959. });
  19960. }
  19961. /***/ }),
  19962. /***/ 4:
  19963. /*!**********************************************************************!*\
  19964. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  19965. \**********************************************************************/
  19966. /*! no static exports found */
  19967. /***/ (function(module, exports) {
  19968. function _interopRequireDefault(obj) {
  19969. return obj && obj.__esModule ? obj : {
  19970. "default": obj
  19971. };
  19972. }
  19973. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19974. /***/ }),
  19975. /***/ 40:
  19976. /*!******************************************************!*\
  19977. !*** E:/work/Project_newGit/CKQ/app/libs/request.js ***!
  19978. \******************************************************/
  19979. /*! no static exports found */
  19980. /***/ (function(module, exports, __webpack_require__) {
  19981. "use strict";
  19982. /* WEBPACK VAR INJECTION */(function(uni) {
  19983. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19984. Object.defineProperty(exports, "__esModule", {
  19985. value: true
  19986. });
  19987. exports.request = request;
  19988. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  19989. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  19990. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  19991. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 44));
  19992. var _auth = __webpack_require__(/*! ../libs/auth.js */ 45);
  19993. 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; }
  19994. 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; }
  19995. var baseUrl = true ? _index.default.base.dev : undefined;
  19996. function request(_x) {
  19997. return _request.apply(this, arguments);
  19998. }
  19999. function _request() {
  20000. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  20001. return _regenerator.default.wrap(function _callee$(_context) {
  20002. while (1) {
  20003. switch (_context.prev = _context.next) {
  20004. case 0:
  20005. return _context.abrupt("return", new Promise(function (resolve, reject) {
  20006. try {
  20007. uni.showLoading({
  20008. title: '加载中',
  20009. mask: true
  20010. });
  20011. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  20012. success: function success(response) {
  20013. var data = response.data;
  20014. var code = data.code;
  20015. var msg = data.msg;
  20016. if (code === 0) {
  20017. resolve(data);
  20018. } else {
  20019. if (code === 401) {
  20020. uni.showToast({
  20021. title: msg || "登录失效!",
  20022. mask: true,
  20023. icon: "none",
  20024. complete: function complete() {
  20025. uni.navigateTo({
  20026. url: '/pages/login/login'
  20027. });
  20028. }
  20029. });
  20030. } else {
  20031. reject(data);
  20032. uni.showToast({
  20033. title: msg,
  20034. mask: true,
  20035. icon: "none"
  20036. });
  20037. }
  20038. }
  20039. },
  20040. fail: function fail(res) {
  20041. uni.showToast({
  20042. title: res,
  20043. mask: true,
  20044. icon: "none"
  20045. });
  20046. reject(res);
  20047. },
  20048. complete: function complete(res) {
  20049. uni.hideLoading();
  20050. }
  20051. }));
  20052. } catch (err) {
  20053. uni.hideLoading();
  20054. reject(err);
  20055. }
  20056. }));
  20057. case 1:
  20058. case "end":
  20059. return _context.stop();
  20060. }
  20061. }
  20062. }, _callee);
  20063. }));
  20064. return _request.apply(this, arguments);
  20065. }
  20066. function formatRequestBody(parmas) {
  20067. var url = parmas.url;
  20068. url = baseUrl + url;
  20069. var data = _objectSpread({}, parmas.data);
  20070. var header = _objectSpread({}, parmas.header);
  20071. header[_index.default.TokenKey] = (0, _auth.getToken)();
  20072. header.appID = _index.default.appID;
  20073. header.appKey = _index.default.appKey;
  20074. header.appSecret = _index.default.appSecret;
  20075. header.permitTplId = _index.default.permitTplId;
  20076. var method = parmas.method || "get";
  20077. var dataType = parmas.dataType || "json";
  20078. var requestBody = {
  20079. url: url,
  20080. data: data,
  20081. header: header,
  20082. method: method,
  20083. dataType: dataType
  20084. };
  20085. return requestBody;
  20086. }
  20087. ;
  20088. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20089. /***/ }),
  20090. /***/ 41:
  20091. /*!************************************************************************************************!*\
  20092. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  20093. \************************************************************************************************/
  20094. /*! no static exports found */
  20095. /***/ (function(module, exports, __webpack_require__) {
  20096. // TODO(Babel 8): Remove this file.
  20097. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  20098. module.exports = runtime;
  20099. /***/ }),
  20100. /***/ 42:
  20101. /*!*******************************************************************!*\
  20102. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  20103. \*******************************************************************/
  20104. /*! no static exports found */
  20105. /***/ (function(module, exports, __webpack_require__) {
  20106. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  20107. function _regeneratorRuntime() {
  20108. "use strict";
  20109. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  20110. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  20111. return exports;
  20112. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20113. var exports = {},
  20114. Op = Object.prototype,
  20115. hasOwn = Op.hasOwnProperty,
  20116. defineProperty = Object.defineProperty || function (obj, key, desc) {
  20117. obj[key] = desc.value;
  20118. },
  20119. $Symbol = "function" == typeof Symbol ? Symbol : {},
  20120. iteratorSymbol = $Symbol.iterator || "@@iterator",
  20121. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  20122. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  20123. function define(obj, key, value) {
  20124. return Object.defineProperty(obj, key, {
  20125. value: value,
  20126. enumerable: !0,
  20127. configurable: !0,
  20128. writable: !0
  20129. }), obj[key];
  20130. }
  20131. try {
  20132. define({}, "");
  20133. } catch (err) {
  20134. define = function define(obj, key, value) {
  20135. return obj[key] = value;
  20136. };
  20137. }
  20138. function wrap(innerFn, outerFn, self, tryLocsList) {
  20139. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  20140. generator = Object.create(protoGenerator.prototype),
  20141. context = new Context(tryLocsList || []);
  20142. return defineProperty(generator, "_invoke", {
  20143. value: makeInvokeMethod(innerFn, self, context)
  20144. }), generator;
  20145. }
  20146. function tryCatch(fn, obj, arg) {
  20147. try {
  20148. return {
  20149. type: "normal",
  20150. arg: fn.call(obj, arg)
  20151. };
  20152. } catch (err) {
  20153. return {
  20154. type: "throw",
  20155. arg: err
  20156. };
  20157. }
  20158. }
  20159. exports.wrap = wrap;
  20160. var ContinueSentinel = {};
  20161. function Generator() {}
  20162. function GeneratorFunction() {}
  20163. function GeneratorFunctionPrototype() {}
  20164. var IteratorPrototype = {};
  20165. define(IteratorPrototype, iteratorSymbol, function () {
  20166. return this;
  20167. });
  20168. var getProto = Object.getPrototypeOf,
  20169. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  20170. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  20171. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  20172. function defineIteratorMethods(prototype) {
  20173. ["next", "throw", "return"].forEach(function (method) {
  20174. define(prototype, method, function (arg) {
  20175. return this._invoke(method, arg);
  20176. });
  20177. });
  20178. }
  20179. function AsyncIterator(generator, PromiseImpl) {
  20180. function invoke(method, arg, resolve, reject) {
  20181. var record = tryCatch(generator[method], generator, arg);
  20182. if ("throw" !== record.type) {
  20183. var result = record.arg,
  20184. value = result.value;
  20185. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  20186. invoke("next", value, resolve, reject);
  20187. }, function (err) {
  20188. invoke("throw", err, resolve, reject);
  20189. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  20190. result.value = unwrapped, resolve(result);
  20191. }, function (error) {
  20192. return invoke("throw", error, resolve, reject);
  20193. });
  20194. }
  20195. reject(record.arg);
  20196. }
  20197. var previousPromise;
  20198. defineProperty(this, "_invoke", {
  20199. value: function value(method, arg) {
  20200. function callInvokeWithMethodAndArg() {
  20201. return new PromiseImpl(function (resolve, reject) {
  20202. invoke(method, arg, resolve, reject);
  20203. });
  20204. }
  20205. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  20206. }
  20207. });
  20208. }
  20209. function makeInvokeMethod(innerFn, self, context) {
  20210. var state = "suspendedStart";
  20211. return function (method, arg) {
  20212. if ("executing" === state) throw new Error("Generator is already running");
  20213. if ("completed" === state) {
  20214. if ("throw" === method) throw arg;
  20215. return doneResult();
  20216. }
  20217. for (context.method = method, context.arg = arg;;) {
  20218. var delegate = context.delegate;
  20219. if (delegate) {
  20220. var delegateResult = maybeInvokeDelegate(delegate, context);
  20221. if (delegateResult) {
  20222. if (delegateResult === ContinueSentinel) continue;
  20223. return delegateResult;
  20224. }
  20225. }
  20226. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  20227. if ("suspendedStart" === state) throw state = "completed", context.arg;
  20228. context.dispatchException(context.arg);
  20229. } else "return" === context.method && context.abrupt("return", context.arg);
  20230. state = "executing";
  20231. var record = tryCatch(innerFn, self, context);
  20232. if ("normal" === record.type) {
  20233. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  20234. return {
  20235. value: record.arg,
  20236. done: context.done
  20237. };
  20238. }
  20239. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  20240. }
  20241. };
  20242. }
  20243. function maybeInvokeDelegate(delegate, context) {
  20244. var methodName = context.method,
  20245. method = delegate.iterator[methodName];
  20246. 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;
  20247. var record = tryCatch(method, delegate.iterator, context.arg);
  20248. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  20249. var info = record.arg;
  20250. 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);
  20251. }
  20252. function pushTryEntry(locs) {
  20253. var entry = {
  20254. tryLoc: locs[0]
  20255. };
  20256. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  20257. }
  20258. function resetTryEntry(entry) {
  20259. var record = entry.completion || {};
  20260. record.type = "normal", delete record.arg, entry.completion = record;
  20261. }
  20262. function Context(tryLocsList) {
  20263. this.tryEntries = [{
  20264. tryLoc: "root"
  20265. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  20266. }
  20267. function values(iterable) {
  20268. if (iterable) {
  20269. var iteratorMethod = iterable[iteratorSymbol];
  20270. if (iteratorMethod) return iteratorMethod.call(iterable);
  20271. if ("function" == typeof iterable.next) return iterable;
  20272. if (!isNaN(iterable.length)) {
  20273. var i = -1,
  20274. next = function next() {
  20275. for (; ++i < iterable.length;) {
  20276. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  20277. }
  20278. return next.value = undefined, next.done = !0, next;
  20279. };
  20280. return next.next = next;
  20281. }
  20282. }
  20283. return {
  20284. next: doneResult
  20285. };
  20286. }
  20287. function doneResult() {
  20288. return {
  20289. value: undefined,
  20290. done: !0
  20291. };
  20292. }
  20293. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  20294. value: GeneratorFunctionPrototype,
  20295. configurable: !0
  20296. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  20297. value: GeneratorFunction,
  20298. configurable: !0
  20299. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  20300. var ctor = "function" == typeof genFun && genFun.constructor;
  20301. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  20302. }, exports.mark = function (genFun) {
  20303. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  20304. }, exports.awrap = function (arg) {
  20305. return {
  20306. __await: arg
  20307. };
  20308. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  20309. return this;
  20310. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  20311. void 0 === PromiseImpl && (PromiseImpl = Promise);
  20312. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  20313. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  20314. return result.done ? result.value : iter.next();
  20315. });
  20316. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  20317. return this;
  20318. }), define(Gp, "toString", function () {
  20319. return "[object Generator]";
  20320. }), exports.keys = function (val) {
  20321. var object = Object(val),
  20322. keys = [];
  20323. for (var key in object) {
  20324. keys.push(key);
  20325. }
  20326. return keys.reverse(), function next() {
  20327. for (; keys.length;) {
  20328. var key = keys.pop();
  20329. if (key in object) return next.value = key, next.done = !1, next;
  20330. }
  20331. return next.done = !0, next;
  20332. };
  20333. }, exports.values = values, Context.prototype = {
  20334. constructor: Context,
  20335. reset: function reset(skipTempReset) {
  20336. 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) {
  20337. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  20338. }
  20339. },
  20340. stop: function stop() {
  20341. this.done = !0;
  20342. var rootRecord = this.tryEntries[0].completion;
  20343. if ("throw" === rootRecord.type) throw rootRecord.arg;
  20344. return this.rval;
  20345. },
  20346. dispatchException: function dispatchException(exception) {
  20347. if (this.done) throw exception;
  20348. var context = this;
  20349. function handle(loc, caught) {
  20350. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  20351. }
  20352. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20353. var entry = this.tryEntries[i],
  20354. record = entry.completion;
  20355. if ("root" === entry.tryLoc) return handle("end");
  20356. if (entry.tryLoc <= this.prev) {
  20357. var hasCatch = hasOwn.call(entry, "catchLoc"),
  20358. hasFinally = hasOwn.call(entry, "finallyLoc");
  20359. if (hasCatch && hasFinally) {
  20360. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20361. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20362. } else if (hasCatch) {
  20363. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20364. } else {
  20365. if (!hasFinally) throw new Error("try statement without catch or finally");
  20366. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20367. }
  20368. }
  20369. }
  20370. },
  20371. abrupt: function abrupt(type, arg) {
  20372. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20373. var entry = this.tryEntries[i];
  20374. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  20375. var finallyEntry = entry;
  20376. break;
  20377. }
  20378. }
  20379. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  20380. var record = finallyEntry ? finallyEntry.completion : {};
  20381. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  20382. },
  20383. complete: function complete(record, afterLoc) {
  20384. if ("throw" === record.type) throw record.arg;
  20385. 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;
  20386. },
  20387. finish: function finish(finallyLoc) {
  20388. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20389. var entry = this.tryEntries[i];
  20390. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  20391. }
  20392. },
  20393. "catch": function _catch(tryLoc) {
  20394. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20395. var entry = this.tryEntries[i];
  20396. if (entry.tryLoc === tryLoc) {
  20397. var record = entry.completion;
  20398. if ("throw" === record.type) {
  20399. var thrown = record.arg;
  20400. resetTryEntry(entry);
  20401. }
  20402. return thrown;
  20403. }
  20404. }
  20405. throw new Error("illegal catch attempt");
  20406. },
  20407. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  20408. return this.delegate = {
  20409. iterator: values(iterable),
  20410. resultName: resultName,
  20411. nextLoc: nextLoc
  20412. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  20413. }
  20414. }, exports;
  20415. }
  20416. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20417. /***/ }),
  20418. /***/ 43:
  20419. /*!*****************************************************************!*\
  20420. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  20421. \*****************************************************************/
  20422. /*! no static exports found */
  20423. /***/ (function(module, exports) {
  20424. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  20425. try {
  20426. var info = gen[key](arg);
  20427. var value = info.value;
  20428. } catch (error) {
  20429. reject(error);
  20430. return;
  20431. }
  20432. if (info.done) {
  20433. resolve(value);
  20434. } else {
  20435. Promise.resolve(value).then(_next, _throw);
  20436. }
  20437. }
  20438. function _asyncToGenerator(fn) {
  20439. return function () {
  20440. var self = this,
  20441. args = arguments;
  20442. return new Promise(function (resolve, reject) {
  20443. var gen = fn.apply(self, args);
  20444. function _next(value) {
  20445. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  20446. }
  20447. function _throw(err) {
  20448. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  20449. }
  20450. _next(undefined);
  20451. });
  20452. };
  20453. }
  20454. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20455. /***/ }),
  20456. /***/ 44:
  20457. /*!******************************************************!*\
  20458. !*** E:/work/Project_newGit/CKQ/app/config/index.js ***!
  20459. \******************************************************/
  20460. /*! no static exports found */
  20461. /***/ (function(module, exports, __webpack_require__) {
  20462. "use strict";
  20463. Object.defineProperty(exports, "__esModule", {
  20464. value: true
  20465. });
  20466. exports.default = void 0;
  20467. var _default = {
  20468. base: {
  20469. dev: 'http://192.168.3.5:8080',
  20470. pro: 'http://192.168.3.5:8080'
  20471. },
  20472. appID: '10001',
  20473. appKey: '82a8bf439373e305',
  20474. appSecret: '82a8bf439373e305',
  20475. permitTplId: 7,
  20476. TokenKey: "Authorization",
  20477. uploadFile: 'http://192.168.3.5:8080'
  20478. };
  20479. exports.default = _default;
  20480. /***/ }),
  20481. /***/ 45:
  20482. /*!***************************************************!*\
  20483. !*** E:/work/Project_newGit/CKQ/app/libs/auth.js ***!
  20484. \***************************************************/
  20485. /*! no static exports found */
  20486. /***/ (function(module, exports, __webpack_require__) {
  20487. "use strict";
  20488. /* WEBPACK VAR INJECTION */(function(uni) {
  20489. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20490. Object.defineProperty(exports, "__esModule", {
  20491. value: true
  20492. });
  20493. exports.getToken = getToken;
  20494. exports.removeToken = removeToken;
  20495. exports.setToken = setToken;
  20496. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 44));
  20497. var TokenKey = _index.default.TokenKey;
  20498. function getToken() {
  20499. return uni.getStorageSync(TokenKey);
  20500. }
  20501. function setToken(token) {
  20502. return uni.setStorageSync(TokenKey, token);
  20503. }
  20504. function removeToken() {
  20505. return uni.removeStorageSync(TokenKey);
  20506. }
  20507. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20508. /***/ }),
  20509. /***/ 5:
  20510. /*!**************************************************************!*\
  20511. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  20512. \**************************************************************/
  20513. /*! no static exports found */
  20514. /***/ (function(module, exports, __webpack_require__) {
  20515. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  20516. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  20517. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  20518. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  20519. function _slicedToArray(arr, i) {
  20520. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  20521. }
  20522. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20523. /***/ }),
  20524. /***/ 54:
  20525. /*!**************************************************!*\
  20526. !*** E:/work/Project_newGit/CKQ/app/api/task.js ***!
  20527. \**************************************************/
  20528. /*! no static exports found */
  20529. /***/ (function(module, exports, __webpack_require__) {
  20530. "use strict";
  20531. Object.defineProperty(exports, "__esModule", {
  20532. value: true
  20533. });
  20534. exports.batchUpdateCheckTaskDoingItem = batchUpdateCheckTaskDoingItem;
  20535. exports.cancelCheckTask = cancelCheckTask;
  20536. exports.completeCheckTask = completeCheckTask;
  20537. exports.getCheckTaskByList = getCheckTaskByList;
  20538. exports.getCheckTaskByPage = getCheckTaskByPage;
  20539. exports.getTaskDetailById = getTaskDetailById;
  20540. exports.goaftaskstatis = goaftaskstatis;
  20541. exports.handleCheckTask = handleCheckTask;
  20542. exports.manageTaskById = manageTaskById;
  20543. exports.transferCheckTask = transferCheckTask;
  20544. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  20545. /**
  20546. * 获取分页任务列表
  20547. * @param {Object} params
  20548. */
  20549. function getCheckTaskByList(data) {
  20550. return (0, _request.request)({
  20551. url: "/goaf/goaftask/list",
  20552. method: 'GET',
  20553. data: data
  20554. });
  20555. }
  20556. /**
  20557. * 获取分页任务列表
  20558. * @param {Object} data
  20559. */
  20560. function getCheckTaskByPage(data) {
  20561. return (0, _request.request)({
  20562. url: '/check/task/page',
  20563. header: {
  20564. 'content-type': "application/x-www-form-urlencoded"
  20565. },
  20566. data: data
  20567. });
  20568. }
  20569. /**
  20570. * 通过id获取详情
  20571. * @param id
  20572. */
  20573. function getTaskDetailById(id) {
  20574. return (0, _request.request)({
  20575. url: '/check/task/view/' + id
  20576. });
  20577. }
  20578. /**
  20579. * 通过id进行任务的处理操作
  20580. * @param id
  20581. */
  20582. function manageTaskById(id) {
  20583. return (0, _request.request)({
  20584. url: '/check/task/handle/' + id,
  20585. method: 'PUT'
  20586. });
  20587. }
  20588. /**
  20589. * Transfer CheckTask
  20590. * 转交任务
  20591. * @param data
  20592. * @returns {AxiosPromise}
  20593. */
  20594. function transferCheckTask(data) {
  20595. return (0, _request.request)({
  20596. url: "/check/task/transfer",
  20597. method: 'PUT',
  20598. data: data
  20599. });
  20600. }
  20601. /**
  20602. * Cancel CheckTask
  20603. * 取消任务
  20604. * @param data
  20605. * @returns {AxiosPromise}
  20606. */
  20607. function cancelCheckTask(checkTaskId) {
  20608. return (0, _request.request)({
  20609. url: "/check/task/cancel/".concat(checkTaskId),
  20610. method: 'PUT'
  20611. });
  20612. }
  20613. /**
  20614. * Complete CheckTask
  20615. * @param data
  20616. * @returns {AxiosPromise}
  20617. * 完成任务
  20618. */
  20619. function completeCheckTask(checkTaskId) {
  20620. return (0, _request.request)({
  20621. url: "/check/task/complete/".concat(checkTaskId),
  20622. method: 'PUT'
  20623. });
  20624. }
  20625. /**
  20626. * 批量更新CheckTaskDoing Item
  20627. * @param data
  20628. * @returns {AxiosPromise}
  20629. */
  20630. function batchUpdateCheckTaskDoingItem(taskId, checkResult) {
  20631. return (0, _request.request)({
  20632. url: "/check/task/doing/item/batchUpdate/".concat(taskId, "/").concat(checkResult),
  20633. method: 'PUT'
  20634. });
  20635. }
  20636. // 提交任务
  20637. function handleCheckTask(data) {
  20638. return (0, _request.request)({
  20639. url: '/goaf/goaftask/completed',
  20640. method: 'POST',
  20641. data: data
  20642. });
  20643. }
  20644. // 任务统计
  20645. function goaftaskstatis(data) {
  20646. return (0, _request.request)({
  20647. url: "/goaf/goaftaskstatis",
  20648. method: 'GET',
  20649. data: data
  20650. });
  20651. }
  20652. /***/ }),
  20653. /***/ 55:
  20654. /*!***************************************************!*\
  20655. !*** E:/work/Project_newGit/CKQ/app/libs/tool.js ***!
  20656. \***************************************************/
  20657. /*! no static exports found */
  20658. /***/ (function(module, exports, __webpack_require__) {
  20659. "use strict";
  20660. Object.defineProperty(exports, "__esModule", {
  20661. value: true
  20662. });
  20663. exports.NumConvertLM = NumConvertLM;
  20664. exports.levelConversion = levelConversion;
  20665. exports.toTreeText = toTreeText;
  20666. /**
  20667. * 预警等级、风险等级、风险点等级、危险源等级、级别转换
  20668. */
  20669. function levelConversion(level) {
  20670. var levelStr;
  20671. if (level == 1) {
  20672. levelStr = '重大';
  20673. } else if (level == 2) {
  20674. levelStr = '较大';
  20675. } else if (level == 3) {
  20676. levelStr = '一般';
  20677. } else if (level == 4) {
  20678. levelStr = '低';
  20679. } else {
  20680. levelStr = '暂无';
  20681. }
  20682. return levelStr;
  20683. }
  20684. /**
  20685. * 构建树JS
  20686. * @param {Object} data
  20687. */
  20688. function toTreeText(data) {
  20689. var val = [];
  20690. data.forEach(function (item) {
  20691. var items = {};
  20692. items.value = item.groupId;
  20693. items.text = item.groupName;
  20694. if (item.children) {
  20695. items.children = toTreeText(item.children);
  20696. val.push(items);
  20697. } else {
  20698. val.push(items);
  20699. }
  20700. });
  20701. return val;
  20702. }
  20703. // 只能转换 4000 以下的正整数阿拉伯数字
  20704. function NumConvertLM(num) {
  20705. var Roman = [['', 'I', 'Ⅱ', 'Ⅲ', 'Ⅳ', 'Ⅴ', 'Ⅵ', 'Ⅶ', 'Ⅷ', 'Ⅸ'], ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'], ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'], ['', 'M', 'MM', 'MMM', ' ', ' ', ' ', ' ', ' ', ' ']];
  20706. if (isNaN(num)) return num;
  20707. var ReverseArr = num.toString().split('').reverse();
  20708. var CorrectArr = [];
  20709. for (var i = 0; i < ReverseArr.length; i++) {
  20710. CorrectArr.unshift(Roman[i][ReverseArr[i]]);
  20711. }
  20712. return CorrectArr.join('');
  20713. }
  20714. /***/ }),
  20715. /***/ 6:
  20716. /*!***************************************************************!*\
  20717. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  20718. \***************************************************************/
  20719. /*! no static exports found */
  20720. /***/ (function(module, exports) {
  20721. function _arrayWithHoles(arr) {
  20722. if (Array.isArray(arr)) return arr;
  20723. }
  20724. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20725. /***/ }),
  20726. /***/ 64:
  20727. /*!*******************************************************!*\
  20728. !*** E:/work/Project_newGit/CKQ/app/api/dangerApi.js ***!
  20729. \*******************************************************/
  20730. /*! no static exports found */
  20731. /***/ (function(module, exports, __webpack_require__) {
  20732. "use strict";
  20733. Object.defineProperty(exports, "__esModule", {
  20734. value: true
  20735. });
  20736. exports.deleteDangerById = deleteDangerById;
  20737. exports.getDangerById = getDangerById;
  20738. exports.getDangerByList = getDangerByList;
  20739. exports.getDangerByPage = getDangerByPage;
  20740. exports.handleDanger = handleDanger;
  20741. exports.updateDanger = updateDanger;
  20742. var _request = __webpack_require__(/*! @/libs/request.js */ 40);
  20743. /**
  20744. * 获取Danger列表
  20745. * @param data
  20746. * @returns
  20747. */
  20748. function getDangerByList(data) {
  20749. return (0, _request.request)({
  20750. url: '/goaf/goafhdanger/list',
  20751. method: 'GET',
  20752. data: data
  20753. });
  20754. }
  20755. /**
  20756. * 获取Danger分页
  20757. * @param data
  20758. * @returns
  20759. */
  20760. function getDangerByPage(data) {
  20761. return (0, _request.request)({
  20762. url: '/goaf/goafhdanger/page',
  20763. method: 'GET',
  20764. params: data
  20765. });
  20766. }
  20767. /**
  20768. * 根据Id获取Danger
  20769. * @param dangerId
  20770. * @returns
  20771. */
  20772. function getDangerById(dangerId) {
  20773. return (0, _request.request)({
  20774. url: "/goaf/goafhdanger/".concat(dangerId),
  20775. method: 'GET'
  20776. });
  20777. }
  20778. // export function getDangerById(dangerId) {
  20779. // return request({
  20780. // url: `/ent/danger/${dangerId}`,
  20781. // method: 'GET'
  20782. // })
  20783. // }
  20784. /**
  20785. * 删除Danger
  20786. * @param dangerId
  20787. * @returns
  20788. */
  20789. function deleteDangerById(dangerId) {
  20790. return (0, _request.request)({
  20791. url: "goaf/goafhdanger/delete/".concat(dangerId),
  20792. method: 'DELETE'
  20793. });
  20794. }
  20795. /**
  20796. * 处理Danger
  20797. * @param data
  20798. * @returns
  20799. */
  20800. function handleDanger(data) {
  20801. return (0, _request.request)({
  20802. url: "/goaf/goafhdanger/add",
  20803. method: 'POST',
  20804. data: data
  20805. });
  20806. }
  20807. /**
  20808. * 修改Danger
  20809. * @param dangerId
  20810. * @returns
  20811. */
  20812. function updateDanger(data) {
  20813. return (0, _request.request)({
  20814. url: "/goaf/goafhdanger/update",
  20815. method: 'PUT',
  20816. data: data
  20817. });
  20818. }
  20819. /***/ }),
  20820. /***/ 7:
  20821. /*!*********************************************************************!*\
  20822. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  20823. \*********************************************************************/
  20824. /*! no static exports found */
  20825. /***/ (function(module, exports) {
  20826. function _iterableToArrayLimit(arr, i) {
  20827. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  20828. if (null != _i) {
  20829. var _s,
  20830. _e,
  20831. _x,
  20832. _r,
  20833. _arr = [],
  20834. _n = !0,
  20835. _d = !1;
  20836. try {
  20837. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  20838. if (Object(_i) !== _i) return;
  20839. _n = !1;
  20840. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  20841. ;
  20842. }
  20843. } catch (err) {
  20844. _d = !0, _e = err;
  20845. } finally {
  20846. try {
  20847. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  20848. } finally {
  20849. if (_d) throw _e;
  20850. }
  20851. }
  20852. return _arr;
  20853. }
  20854. }
  20855. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20856. /***/ }),
  20857. /***/ 73:
  20858. /*!****************************************************************!*\
  20859. !*** E:/work/Project_newGit/CKQ/app/pages/mine/image/head.png ***!
  20860. \****************************************************************/
  20861. /*! no static exports found */
  20862. /***/ (function(module, exports) {
  20863. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAvSSURBVHgBzVpbcFVXGf7W3idAGkgOFyEIIYd7LbeUVpCqQ7B30EFGp+PojBSr9skSffDBF+BJnVEbHJ8cx7Yz2jqlU+pUpVNsk2IrtmNNwkUuAXIIHQhUSriGJJDlv+7/3ueEhBAu/7Cz91l77bX+77+vtRAYZnquSWZ7e7Gorw81iFAjQHcgC4lcqmteCuTRh056bowiNH9/iXgHw0wCw0AK1JUrWC4l6uhnzcHTyH5EbB87S9c5oKsXOH0JoPfSzTvhLmDCaKA0A8yeAFlVDkH3TurRSO9fe3qpeAHDQDcE0AJbr4C1EqidxyB3dQAXu+3gAoKB8nNSu6R2996RvGsExKLJkMuqCOw40q4gzWaw8buLxVEMkYYE0AG71IO6xjZk326D7OrxzMrU+AmARUC7Po4X/TyhDFg5F/hclW7bKGI8PxSg1w3w901ytbyK+rcPI7ftIGmrJzDrmKc7mGYKQKnfYGD0gywAqWk8mfGqORBLp5BGJWnzOk130ACV1ihwbDh9EXV/aIFs/bj4OBagMkPVqtj2mk0BFVYQxYAVaJ40Kp5ZBowrQz0FpE3r7hWdGC6ABC5HWtvacAQ1SmtdV5KTaw4JiB2tv3eeeanAKuCCaZWB5IgB+yU1jCqBVNpcPp0icITawZjsgAAVOArlDdsOIPe3VjgvM0xe6+skqDBhoflC9jE+rNbdXUQ2IFnBqC4rZ0M8Ngf5vkGAFIMB9+IuVL/fnmSYT1gMmI2S15o48b0DkQDIxkvfl1Dw+dYCHL06AEgxELiXdqP6g2NJ5oGBGU8AkHYe/i1vKwaiWP9Un89WQX5zIYEU/YMU/YDLEndNb7ai+o1W9E9JSSdHlSxQFD4J9sP8Nkw7CQkZZoAf3z7b9/rdY2Suj8xGM0l0RbHAE6EYaoqW77YhRwBFZDq5O38WkbBtgl1R8lmEd6q/tM/qLpV/6Xa6x2Y8oT8x7TKO2JxsLhHGA/Eo/5GnkpB4LoalAOALTXJt52XUvXlYBxHNgDDM6IH9c2Teu5TgJnXPrI3fdaT1/WDHMeqUwoE2II2wo9TY8HP7ObYfglQ8E++rC5TFfyi/I0k2/LQRudNd/UdJbyLJfCW8ybFWn/xh0oIzP2ae+ocPSrIwB6b4TTiDG2fWOIinl6CT/HE6N9WEBqnuXfvhcVSTNGTsTIubB9hvY4LO5ITVpkybrWsTwQy1iSrOYmNmQrXH1jxjZn5FTF+mXUGNr749cgb4ZzuyhGF9WiJeeyVA2893AJ90Adzpi8rTSdsGGadVHj0rRkI8sRBS1ZPzJgFTy818e08CH52DfOMgxJa9RSIrS/Z2PLDoygNPyMf0fBcB+PEX0ZkpCVrMuLHp3Yb/dJAtdxvJWBAi1BEFETGIx3AihSvJ6M9T9wM//DxQPrIwUiuwdIlHZwM/+gJE/XvAlj2ecclml248+0IKJFKVFK6WpbbLV0iLx1Dx0CytxU2q3ZsoSaH2rUPeBIU2ARsAIuvULso5h49cFHTOT3+ypcCzq0haX4IgcANSVQXwy5XArx6HyI5ikdcGGze2dw3XbvnQYEMwxM523VKnUp0H+GKLXJvvRO6s1Z6PUjB+YkFC8EjnoqoVgvOnXxCjX5vXfwHRH319AfDbNQGIi7yaSefDIUq7KCqtLzqfFUqLbWdIzjGWe4CRxFebjpsf+iMUyWNIOT0SQUfnLjJJ+cgsDJmUr65/wIwf23wYOx5gQLJcyAOatALQ75pP6Pq2zgMkedfu/x+LUBxAGEh4U7F3JdHYRENMK9fLmevWXJoUwGkV3iwTgnRR2EZcZzWeXwta7v9Y+2SNMtPo5X1yeZ5U2tPr04G/Jwaw0oyj8FuEQfHMA9euUa+HnrzPzKNN383pCgs7ZyYOLuT5tlcPmWl7J7JlMRZF6EFNx0XLvM1nWkoRMwN2acna55jloiVTb1x7jtbcY/jQ/MggZC5g3R6x3Gvigr86zgN9pMWIRFJLaEM0MpLTzKbLLhdUIrZiV00VFP2mlGPYSEVflTN1AAsBL/Bk/dPzxCK7jcA4dUnnzZoMvch2X7XVBkvSKLZYDe+Nqdjy656JGHaaSjupJ86znJfmRySepW+S5tfJ81pZNRliMHfusg/Junqx2kEBsNQi1m//YfjJ5V/fwNeDUWpRnPxQt/VcpT99VLpRinAAk5tBSK6yWTWRBEn/SNLDTrQlqZdXglUqfFJ9i1LbH7AbXNT3fLfGkcv4hCqCybkx9EqgsBJNrLpV/44LgBpwzCAql8EQjQXaHdcVCwJI7j7wezXqjWRlnQhAXaoJkQmJPCjcaiGdLnjUykQmNO/ID1+aoM1k8LLMR3bGR4JXzjMrAozyhNdWWJzaKAUEc/QlkhWg+05JTUWt1/cNnyv+7t8WGPychg3hF9mIGA8+srK+LsoqDeapQJa+FLI92HrQVDMIEvTlHMudTVQe/fUAbpj+sh9QJu8ZjEIp5rUG8K0Q/T5mz+qbsaP0cHnV1kmHHmYg2DKMDyZCMStSCd5PZExDbt6pQ/uQSX37652skBCeHzABuwrLuYqpmdniW90JoHIxAkjncpVlfvmRHDQpJecLwvqnGSz4pD5V+sHrpIEhgFTfqG/VWYcLDn5sm8gjtjvA6+XYKcbyo74vpQUuOVmn8sHmSWOQ3ukKK4UoWYv6cgghCPC120kq+9a9Crll9+DBvbLHfHPygg8mBdbjTM/N7dancVibequiwIdpYzXQxgzF3uZJZaYzbOKG9+pQRfCd6kQfd8DC8tQlOvD8zfuQr+wF1i2GqJkMVI4p1Ni7R2klv1v7nB45YqHf52Ab7BLzgxUm4W8oUIifyaO1sFoyVy+jpWosOktHoEItFoXvgsTWRGRzpJpISa0PRtoerO8ZiDSCn+0wkW30SMjRI0z7BUriKtf5EitKMYmE8AwgzYDdg7H9db4zfX39oSYbmYGkWvbsVz4jGqM1tDmjtEgnqoKt/7xP8vxiHd1E2bC1EL4RwdRjvuNGzxd7NWChQJOfJf0L3g2SZuniQmQXwCLhk84XpY+0wuzczRmvWWvUVqH/ZFA/b6KfwAUO/WHMPmbRLbkw5qHaRTXW7tdqRb6LBQp2wyO24ewTuwhpKeKLcDZmbKPpfMJCq+PXFDa9q9aTwTvTlJlmUNF9he2eWWMVEdIn7b42db7Ij69ZrVqwEmDnDvC7cfy3O6lIbUci8tuYMkLq7EIGX62gc/6qLPKr5pqTYK3BNdP1HmL94k8jmRqklRZQUBrxlTR/FwuWs5zWpN/m8NsK3jTBrEAyM3f9UWApfDtDuLFdqlg2TX/U6GTm90V7RmDzvZWo23USFV09cKsIHzYikToOE+FMYUElsJD2OWeOA2aOh5xYllqtJe8o8k6T8s9TdLV0QPyrHTh8xq7upF/huGUS3G8edVVyV2tTWYKNRSfYdkBuaDmBDVQ4J9daRc7t1BwPzQQepEsBvBl0inLqH5uBvx+yOwhIgEwIWz0+PBPi7k9h4+NzxSYUA7i1TWZLe9H26n9RcfxschDmZ5hfCfm9+yFmjMMtIaXZn2yHVNp1/DghO6sqJ9/79mLkSzKofXBGOAwtMJvtrXI1Hb5sfXkP0N3LTMN0Ft+gswa6BG4D/WkX8NIuZrKGMTmKyrIn5tNOeimefHRW8r+ZROlBHp4t/lw+CpuXTgESu1ZC71neNnCKaG6Q5SCOA18qNSydCtBiuz4NTlFUbKARGWxaOBkt6kMH7qn7IFbMuH3gHH35bojvLLYrClKA4pF4Pdp1EZuK9e+X4W376DC0BA2NR1C9qJKOwRbgjqLnP4Rs/QSonYGjpMWE3w2aFMj38rJN3qH0Qbtse+uIrL4WhgFNjsbJ0a2BrhzuLMrTVUvR5pqaizAA0QB5uq2wA94pRNlxYHDXRaTJLF3PyttPiocsbhbR4GvpapO3ns7QtRq3gmiiHF0b5K2hM3aum6e1AYA+J2+ORm8fsGIkjelutYzdCKgGulYPF7CbUpkQc7V0W0SXuitGcyhMM3m61Dq02V4t6k6RcVD/k3ew9H+W/lIpU9HkZQAAAABJRU5ErkJggg=="
  20864. /***/ }),
  20865. /***/ 74:
  20866. /*!**************************************************************!*\
  20867. !*** E:/work/Project_newGit/CKQ/app/pages/mine/image/bg.png ***!
  20868. \**************************************************************/
  20869. /*! no static exports found */
  20870. /***/ (function(module, exports) {
  20871. module.exports = "/pages/mine/image/bg.png";
  20872. /***/ }),
  20873. /***/ 8:
  20874. /*!***************************************************************************!*\
  20875. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  20876. \***************************************************************************/
  20877. /*! no static exports found */
  20878. /***/ (function(module, exports, __webpack_require__) {
  20879. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  20880. function _unsupportedIterableToArray(o, minLen) {
  20881. if (!o) return;
  20882. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  20883. var n = Object.prototype.toString.call(o).slice(8, -1);
  20884. if (n === "Object" && o.constructor) n = o.constructor.name;
  20885. if (n === "Map" || n === "Set") return Array.from(o);
  20886. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  20887. }
  20888. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20889. /***/ }),
  20890. /***/ 9:
  20891. /*!*****************************************************************!*\
  20892. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  20893. \*****************************************************************/
  20894. /*! no static exports found */
  20895. /***/ (function(module, exports) {
  20896. function _arrayLikeToArray(arr, len) {
  20897. if (len == null || len > arr.length) len = arr.length;
  20898. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  20899. arr2[i] = arr[i];
  20900. }
  20901. return arr2;
  20902. }
  20903. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20904. /***/ }),
  20905. /***/ 91:
  20906. /*!****************************************************!*\
  20907. !*** E:/work/Project_newGit/CKQ/app/libs/index.js ***!
  20908. \****************************************************/
  20909. /*! no static exports found */
  20910. /***/ (function(module, exports, __webpack_require__) {
  20911. "use strict";
  20912. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20913. Object.defineProperty(exports, "__esModule", {
  20914. value: true
  20915. });
  20916. exports.addClass = addClass;
  20917. exports.byteLength = byteLength;
  20918. exports.cleanArray = cleanArray;
  20919. exports.createUniqueString = createUniqueString;
  20920. exports.debounce = debounce;
  20921. exports.deepClone = deepClone;
  20922. exports.distanceTime = distanceTime;
  20923. exports.formatTime = formatTime;
  20924. exports.getQueryObject = getQueryObject;
  20925. exports.getTime = getTime;
  20926. exports.hasClass = hasClass;
  20927. exports.html2Text = html2Text;
  20928. exports.isEmpty = isEmpty;
  20929. exports.objectMerge = objectMerge;
  20930. exports.packageTreeData = packageTreeData;
  20931. exports.param = param;
  20932. exports.param2Obj = param2Obj;
  20933. exports.parseTime = parseTime;
  20934. exports.removeClass = removeClass;
  20935. exports.toggleClass = toggleClass;
  20936. exports.uniqueArr = uniqueArr;
  20937. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  20938. /**
  20939. * Parse the time to string
  20940. * @param {(Object|string|number)} time
  20941. * @param {string} cFormat
  20942. * @returns {string | null}
  20943. */
  20944. function parseTime(time, cFormat) {
  20945. if (arguments.length === 0 || !time) {
  20946. return null;
  20947. }
  20948. var format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}';
  20949. var date;
  20950. if ((0, _typeof2.default)(time) === 'object') {
  20951. date = time;
  20952. } else {
  20953. if (typeof time === 'string') {
  20954. if (/^[0-9]+$/.test(time)) {
  20955. // support "1548221490638"
  20956. time = parseInt(time);
  20957. } else {
  20958. // support safari
  20959. // https://stackoverflow.com/questions/4310953/invalid-date-in-safari
  20960. time = time.replace(new RegExp(/-/gm), '/');
  20961. }
  20962. }
  20963. if (typeof time === 'number' && time.toString().length === 10) {
  20964. time = time * 1000;
  20965. }
  20966. date = new Date(time);
  20967. }
  20968. var formatObj = {
  20969. y: date.getFullYear(),
  20970. m: date.getMonth() + 1,
  20971. d: date.getDate(),
  20972. h: date.getHours(),
  20973. i: date.getMinutes(),
  20974. s: date.getSeconds(),
  20975. a: date.getDay()
  20976. };
  20977. var time_str = format.replace(/{([ymdhisa])+}/g, function (result, key) {
  20978. var value = formatObj[key];
  20979. // Note: getDay() returns 0 on Sunday
  20980. if (key === 'a') {
  20981. return ['日', '一', '二', '三', '四', '五', '六'][value];
  20982. }
  20983. return value.toString().padStart(2, '0');
  20984. });
  20985. return time_str;
  20986. }
  20987. /**
  20988. * @param {number} time
  20989. * @param {string} option
  20990. * @returns {string}
  20991. */
  20992. function formatTime(time, option) {
  20993. if (('' + time).length === 10) {
  20994. time = parseInt(time) * 1000;
  20995. } else {
  20996. time = +time;
  20997. }
  20998. var d = new Date(time);
  20999. var now = Date.now();
  21000. var diff = (now - d) / 1000;
  21001. if (diff < 30) {
  21002. return '刚刚';
  21003. } else if (diff < 3600) {
  21004. // less 1 hour
  21005. return Math.ceil(diff / 60) + '分钟前';
  21006. } else if (diff < 3600 * 24) {
  21007. return Math.ceil(diff / 3600) + '小时前';
  21008. } else if (diff < 3600 * 24 * 2) {
  21009. return '1天前';
  21010. }
  21011. if (option) {
  21012. return parseTime(time, option);
  21013. } else {
  21014. return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分';
  21015. }
  21016. }
  21017. /**
  21018. * @param {string} url
  21019. * @returns {Object}
  21020. */
  21021. function getQueryObject(url) {
  21022. url = url == null ? window.location.href : url;
  21023. var search = url.substring(url.lastIndexOf('?') + 1);
  21024. var obj = {};
  21025. var reg = /([^?&=]+)=([^?&=]*)/g;
  21026. search.replace(reg, function (rs, $1, $2) {
  21027. var name = decodeURIComponent($1);
  21028. var val = decodeURIComponent($2);
  21029. val = String(val);
  21030. obj[name] = val;
  21031. return rs;
  21032. });
  21033. return obj;
  21034. }
  21035. /**
  21036. * @param {string} input value
  21037. * @returns {number} output value
  21038. */
  21039. function byteLength(str) {
  21040. // returns the byte length of an utf8 string
  21041. var s = str.length;
  21042. for (var i = str.length - 1; i >= 0; i--) {
  21043. var code = str.charCodeAt(i);
  21044. if (code > 0x7f && code <= 0x7ff) s++;else if (code > 0x7ff && code <= 0xffff) s += 2;
  21045. if (code >= 0xDC00 && code <= 0xDFFF) i--;
  21046. }
  21047. return s;
  21048. }
  21049. /**
  21050. * @param {Array} actual
  21051. * @returns {Array}
  21052. */
  21053. function cleanArray(actual) {
  21054. var newArray = [];
  21055. for (var i = 0; i < actual.length; i++) {
  21056. if (actual[i]) {
  21057. newArray.push(actual[i]);
  21058. }
  21059. }
  21060. return newArray;
  21061. }
  21062. /**
  21063. * @param {Object} json
  21064. * @returns {Array}
  21065. */
  21066. function param(json) {
  21067. if (!json) return '';
  21068. return cleanArray(Object.keys(json).map(function (key) {
  21069. if (json[key] === undefined) return '';
  21070. return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]);
  21071. })).join('&');
  21072. }
  21073. /**
  21074. * @param {string} url
  21075. * @returns {Object}
  21076. */
  21077. function param2Obj(url) {
  21078. var search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ');
  21079. if (!search) {
  21080. return {};
  21081. }
  21082. var obj = {};
  21083. var searchArr = search.split('&');
  21084. searchArr.forEach(function (v) {
  21085. var index = v.indexOf('=');
  21086. if (index !== -1) {
  21087. var name = v.substring(0, index);
  21088. var val = v.substring(index + 1, v.length);
  21089. obj[name] = val;
  21090. }
  21091. });
  21092. return obj;
  21093. }
  21094. /**
  21095. * @param {string} val
  21096. * @returns {string}
  21097. */
  21098. function html2Text(val) {
  21099. var div = document.createElement('div');
  21100. div.innerHTML = val;
  21101. return div.textContent || div.innerText;
  21102. }
  21103. /**
  21104. * Merges two objects, giving the last one precedence
  21105. * @param {Object} target
  21106. * @param {(Object|Array)} source
  21107. * @returns {Object}
  21108. */
  21109. function objectMerge(target, source) {
  21110. if ((0, _typeof2.default)(target) !== 'object') {
  21111. target = {};
  21112. }
  21113. if (Array.isArray(source)) {
  21114. return source.slice();
  21115. }
  21116. Object.keys(source).forEach(function (property) {
  21117. var sourceProperty = source[property];
  21118. if ((0, _typeof2.default)(sourceProperty) === 'object') {
  21119. target[property] = objectMerge(target[property], sourceProperty);
  21120. } else {
  21121. target[property] = sourceProperty;
  21122. }
  21123. });
  21124. return target;
  21125. }
  21126. /**
  21127. * @param {HTMLElement} element
  21128. * @param {string} className
  21129. */
  21130. function toggleClass(element, className) {
  21131. if (!element || !className) {
  21132. return;
  21133. }
  21134. var classString = element.className;
  21135. var nameIndex = classString.indexOf(className);
  21136. if (nameIndex === -1) {
  21137. classString += '' + className;
  21138. } else {
  21139. classString = classString.substr(0, nameIndex) + classString.substr(nameIndex + className.length);
  21140. }
  21141. element.className = classString;
  21142. }
  21143. /**
  21144. * @param {string} type
  21145. * @returns {Date}
  21146. */
  21147. function getTime(type) {
  21148. if (type === 'start') {
  21149. return new Date().getTime() - 3600 * 1000 * 24 * 90;
  21150. } else {
  21151. return new Date(new Date().toDateString());
  21152. }
  21153. }
  21154. /**
  21155. * @param {Function} func
  21156. * @param {number} wait
  21157. * @param {boolean} immediate
  21158. * @return {*}
  21159. */
  21160. function debounce(func, wait, immediate) {
  21161. var timeout, args, context, timestamp, result;
  21162. var later = function later() {
  21163. // 据上一次触发时间间隔
  21164. var last = +new Date() - timestamp;
  21165. // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
  21166. if (last < wait && last > 0) {
  21167. timeout = setTimeout(later, wait - last);
  21168. } else {
  21169. timeout = null;
  21170. // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
  21171. if (!immediate) {
  21172. result = func.apply(context, args);
  21173. if (!timeout) context = args = null;
  21174. }
  21175. }
  21176. };
  21177. return function () {
  21178. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  21179. args[_key] = arguments[_key];
  21180. }
  21181. context = this;
  21182. timestamp = +new Date();
  21183. var callNow = immediate && !timeout;
  21184. // 如果延时不存在,重新设定延时
  21185. if (!timeout) timeout = setTimeout(later, wait);
  21186. if (callNow) {
  21187. result = func.apply(context, args);
  21188. context = args = null;
  21189. }
  21190. return result;
  21191. };
  21192. }
  21193. /**
  21194. * This is just a simple version of deep copy
  21195. * Has a lot of edge cases bug
  21196. * If you want to use a perfect deep copy, use lodash's _.cloneDeep
  21197. * @param {Object} source
  21198. * @returns {Object}
  21199. */
  21200. function deepClone(source) {
  21201. if (!source && (0, _typeof2.default)(source) !== 'object') {
  21202. throw new Error('error arguments', 'deepClone');
  21203. }
  21204. var targetObj = source.constructor === Array ? [] : {};
  21205. Object.keys(source).forEach(function (keys) {
  21206. if (source[keys] && (0, _typeof2.default)(source[keys]) === 'object') {
  21207. targetObj[keys] = deepClone(source[keys]);
  21208. } else {
  21209. targetObj[keys] = source[keys];
  21210. }
  21211. });
  21212. return targetObj;
  21213. }
  21214. /**
  21215. * @param {Array} arr
  21216. * @returns {Array}
  21217. */
  21218. function uniqueArr(arr) {
  21219. return Array.from(new Set(arr));
  21220. }
  21221. /**
  21222. * @returns {string}
  21223. */
  21224. function createUniqueString() {
  21225. var timestamp = +new Date() + '';
  21226. var randomNum = parseInt((1 + Math.random()) * 65536) + '';
  21227. return (+(randomNum + timestamp)).toString(32);
  21228. }
  21229. /**
  21230. * Check if an element has a class
  21231. * @param {HTMLElement} elm
  21232. * @param {string} cls
  21233. * @returns {boolean}
  21234. */
  21235. function hasClass(ele, cls) {
  21236. return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
  21237. }
  21238. /**
  21239. * Add class to element
  21240. * @param {HTMLElement} elm
  21241. * @param {string} cls
  21242. */
  21243. function addClass(ele, cls) {
  21244. if (!hasClass(ele, cls)) ele.className += ' ' + cls;
  21245. }
  21246. /**
  21247. * Remove class from element
  21248. * @param {HTMLElement} elm
  21249. * @param {string} cls
  21250. */
  21251. function removeClass(ele, cls) {
  21252. if (hasClass(ele, cls)) {
  21253. var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
  21254. ele.className = ele.className.replace(reg, ' ');
  21255. }
  21256. }
  21257. function distanceTime(time) {
  21258. //获取当前时间
  21259. var date = new Date();
  21260. var now = date.getTime();
  21261. //设置截止时间
  21262. var endDate = new Date();
  21263. if (time) {
  21264. endDate = new Date(time);
  21265. }
  21266. var end = endDate.getTime();
  21267. //获取截止时间和当前时间的时间差
  21268. if (now >= end) {
  21269. return '已过期';
  21270. }
  21271. var leftTime = end - now;
  21272. //定义变量 d,h,m,s分别保存天数,小时,分钟,秒
  21273. var d, h, m, s;
  21274. //判断剩余天数,时,分,秒
  21275. if (leftTime >= 0) {
  21276. d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  21277. h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
  21278. m = Math.floor(leftTime / 1000 / 60 % 60);
  21279. s = Math.floor(leftTime / 1000 % 60);
  21280. }
  21281. if (d > 0) {
  21282. return "".concat(d, "\u5929").concat(h, "\u5C0F\u65F6").concat(m, "\u5206\u949F");
  21283. } else {
  21284. if (h > 0) {
  21285. return "".concat(h, "\u5C0F\u65F6").concat(m, "\u5206\u949F");
  21286. } else {
  21287. return "".concat(m, "\u5206\u949F");
  21288. }
  21289. }
  21290. }
  21291. function isEmpty(value) {
  21292. if (value === undefined || value === "undefined" || value === "" || value === null) {
  21293. return true;
  21294. }
  21295. return false;
  21296. }
  21297. // 平级转树结构
  21298. /* treeArr 基础数据
  21299. * id 唯一id
  21300. * parentId 父级id
  21301. * childrenList 子级数组名*/
  21302. function packageTreeData(params) {
  21303. var treeArr = params && params.data || [];
  21304. var id = params && params.id || 'id';
  21305. var parentId = params && params.parentId || 'parentId';
  21306. var childrenList = params && params.children || 'children';
  21307. var cloneData = JSON.parse(JSON.stringify(treeArr));
  21308. return cloneData.filter(function (fatherItem) {
  21309. var warpArr = cloneData.filter(function (sonItem) {
  21310. return fatherItem[id] === sonItem[parentId];
  21311. });
  21312. warpArr.length ? fatherItem[childrenList] = warpArr : null;
  21313. return !fatherItem[parentId];
  21314. });
  21315. }
  21316. /***/ }),
  21317. /***/ 92:
  21318. /*!**************************************************!*\
  21319. !*** E:/work/Project_newGit/CKQ/app/api/goaf.js ***!
  21320. \**************************************************/
  21321. /*! no static exports found */
  21322. /***/ (function(module, exports, __webpack_require__) {
  21323. "use strict";
  21324. Object.defineProperty(exports, "__esModule", {
  21325. value: true
  21326. });
  21327. exports.createGoaf = createGoaf;
  21328. exports.delGoaf = delGoaf;
  21329. exports.getGoafBaseInfo = getGoafBaseInfo;
  21330. exports.getGoafBaseInfoByPage = getGoafBaseInfoByPage;
  21331. exports.getGoafInfoById = getGoafInfoById;
  21332. exports.scanCode = scanCode;
  21333. exports.updateGoaf = updateGoaf;
  21334. var _request = __webpack_require__(/*! ../libs/request.js */ 40);
  21335. // 获取所有采空区信息
  21336. function getGoafBaseInfo(params) {
  21337. return (0, _request.request)({
  21338. url: '/goaf/goafbaseinfo/list',
  21339. params: params
  21340. });
  21341. }
  21342. // 获取所有采空区信息分页
  21343. function getGoafBaseInfoByPage(params) {
  21344. return (0, _request.request)({
  21345. url: '/goaf/goafbaseinfo/page',
  21346. params: params
  21347. });
  21348. }
  21349. // 根据采空区id获取信息
  21350. function getGoafInfoById(id) {
  21351. return (0, _request.request)({
  21352. url: "/goaf/goafbaseinfo/".concat(id)
  21353. });
  21354. }
  21355. // 新增
  21356. function createGoaf(data) {
  21357. return (0, _request.request)({
  21358. url: '/goaf/goafbaseinfo/add',
  21359. method: 'POST',
  21360. data: data
  21361. });
  21362. }
  21363. // 更新
  21364. function updateGoaf(data) {
  21365. return (0, _request.request)({
  21366. url: '/goaf/goafbaseinfo/update',
  21367. method: 'PUT',
  21368. data: data
  21369. });
  21370. }
  21371. // 删除
  21372. function delGoaf(goafId) {
  21373. return (0, _request.request)({
  21374. url: "/goaf/goafbaseinfo/delete/".concat(goafId),
  21375. method: 'DELETE'
  21376. });
  21377. }
  21378. // 扫码
  21379. function scanCode(goafQr) {
  21380. return (0, _request.request)({
  21381. url: "/goaf/goafbaseinfo/goafqr/".concat(goafQr),
  21382. method: 'GET'
  21383. });
  21384. }
  21385. /***/ })
  21386. }]);
  21387. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map