vendor.js 436 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746
  1. "use strict";
  2. const _export_sfc = (sfc, props) => {
  3. const target = sfc.__vccOpts || sfc;
  4. for (const [key, val] of props) {
  5. target[key] = val;
  6. }
  7. return target;
  8. };
  9. function makeMap(str, expectsLowerCase) {
  10. const map2 = /* @__PURE__ */ Object.create(null);
  11. const list = str.split(",");
  12. for (let i2 = 0; i2 < list.length; i2++) {
  13. map2[list[i2]] = true;
  14. }
  15. return expectsLowerCase ? (val) => !!map2[val.toLowerCase()] : (val) => !!map2[val];
  16. }
  17. function normalizeStyle(value) {
  18. if (isArray$1(value)) {
  19. const res = {};
  20. for (let i2 = 0; i2 < value.length; i2++) {
  21. const item = value[i2];
  22. const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item);
  23. if (normalized) {
  24. for (const key in normalized) {
  25. res[key] = normalized[key];
  26. }
  27. }
  28. }
  29. return res;
  30. } else if (isString$1(value)) {
  31. return value;
  32. } else if (isObject$2(value)) {
  33. return value;
  34. }
  35. }
  36. const listDelimiterRE = /;(?![^(]*\))/g;
  37. const propertyDelimiterRE = /:([^]+)/;
  38. const styleCommentRE = /\/\*.*?\*\//gs;
  39. function parseStringStyle(cssText) {
  40. const ret = {};
  41. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  42. if (item) {
  43. const tmp = item.split(propertyDelimiterRE);
  44. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  45. }
  46. });
  47. return ret;
  48. }
  49. function normalizeClass(value) {
  50. let res = "";
  51. if (isString$1(value)) {
  52. res = value;
  53. } else if (isArray$1(value)) {
  54. for (let i2 = 0; i2 < value.length; i2++) {
  55. const normalized = normalizeClass(value[i2]);
  56. if (normalized) {
  57. res += normalized + " ";
  58. }
  59. }
  60. } else if (isObject$2(value)) {
  61. for (const name in value) {
  62. if (value[name]) {
  63. res += name + " ";
  64. }
  65. }
  66. }
  67. return res.trim();
  68. }
  69. const toDisplayString = (val) => {
  70. return isString$1(val) ? val : val == null ? "" : isArray$1(val) || isObject$2(val) && (val.toString === objectToString || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  71. };
  72. const replacer = (_key, val) => {
  73. if (val && val.__v_isRef) {
  74. return replacer(_key, val.value);
  75. } else if (isMap(val)) {
  76. return {
  77. [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
  78. entries[`${key} =>`] = val2;
  79. return entries;
  80. }, {})
  81. };
  82. } else if (isSet(val)) {
  83. return {
  84. [`Set(${val.size})`]: [...val.values()]
  85. };
  86. } else if (isObject$2(val) && !isArray$1(val) && !isPlainObject(val)) {
  87. return String(val);
  88. }
  89. return val;
  90. };
  91. const EMPTY_OBJ = Object.freeze({});
  92. const EMPTY_ARR = Object.freeze([]);
  93. const NOOP = () => {
  94. };
  95. const NO = () => false;
  96. const onRE = /^on[^a-z]/;
  97. const isOn = (key) => onRE.test(key);
  98. const isModelListener = (key) => key.startsWith("onUpdate:");
  99. const extend$1 = Object.assign;
  100. const remove = (arr, el) => {
  101. const i2 = arr.indexOf(el);
  102. if (i2 > -1) {
  103. arr.splice(i2, 1);
  104. }
  105. };
  106. const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  107. const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key);
  108. const isArray$1 = Array.isArray;
  109. const isMap = (val) => toTypeString(val) === "[object Map]";
  110. const isSet = (val) => toTypeString(val) === "[object Set]";
  111. const isFunction$1 = (val) => typeof val === "function";
  112. const isString$1 = (val) => typeof val === "string";
  113. const isSymbol = (val) => typeof val === "symbol";
  114. const isObject$2 = (val) => val !== null && typeof val === "object";
  115. const isPromise = (val) => {
  116. return isObject$2(val) && isFunction$1(val.then) && isFunction$1(val.catch);
  117. };
  118. const objectToString = Object.prototype.toString;
  119. const toTypeString = (value) => objectToString.call(value);
  120. const toRawType = (value) => {
  121. return toTypeString(value).slice(8, -1);
  122. };
  123. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  124. const isIntegerKey = (key) => isString$1(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  125. const isReservedProp = /* @__PURE__ */ makeMap(
  126. // the leading comma is intentional so empty string "" is also included
  127. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  128. );
  129. const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
  130. const cacheStringFunction = (fn) => {
  131. const cache = /* @__PURE__ */ Object.create(null);
  132. return (str) => {
  133. const hit = cache[str];
  134. return hit || (cache[str] = fn(str));
  135. };
  136. };
  137. const camelizeRE = /-(\w)/g;
  138. const camelize = cacheStringFunction((str) => {
  139. return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
  140. });
  141. const hyphenateRE = /\B([A-Z])/g;
  142. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  143. const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
  144. const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
  145. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  146. const invokeArrayFns$1 = (fns, arg) => {
  147. for (let i2 = 0; i2 < fns.length; i2++) {
  148. fns[i2](arg);
  149. }
  150. };
  151. const def = (obj, key, value) => {
  152. Object.defineProperty(obj, key, {
  153. configurable: true,
  154. enumerable: false,
  155. value
  156. });
  157. };
  158. const looseToNumber = (val) => {
  159. const n2 = parseFloat(val);
  160. return isNaN(n2) ? val : n2;
  161. };
  162. const LINEFEED = "\n";
  163. const SLOT_DEFAULT_NAME = "d";
  164. const ON_SHOW = "onShow";
  165. const ON_HIDE = "onHide";
  166. const ON_LAUNCH = "onLaunch";
  167. const ON_ERROR = "onError";
  168. const ON_THEME_CHANGE = "onThemeChange";
  169. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  170. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  171. const ON_LOAD = "onLoad";
  172. const ON_READY = "onReady";
  173. const ON_UNLOAD = "onUnload";
  174. const ON_INIT = "onInit";
  175. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  176. const ON_RESIZE = "onResize";
  177. const ON_BACK_PRESS = "onBackPress";
  178. const ON_PAGE_SCROLL = "onPageScroll";
  179. const ON_TAB_ITEM_TAP = "onTabItemTap";
  180. const ON_REACH_BOTTOM = "onReachBottom";
  181. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  182. const ON_SHARE_TIMELINE = "onShareTimeline";
  183. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  184. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  185. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  186. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  187. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  188. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  189. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  190. const customizeRE = /:/g;
  191. function customizeEvent(str) {
  192. return camelize(str.replace(customizeRE, "-"));
  193. }
  194. function hasLeadingSlash(str) {
  195. return str.indexOf("/") === 0;
  196. }
  197. function addLeadingSlash(str) {
  198. return hasLeadingSlash(str) ? str : "/" + str;
  199. }
  200. const invokeArrayFns = (fns, arg) => {
  201. let ret;
  202. for (let i2 = 0; i2 < fns.length; i2++) {
  203. ret = fns[i2](arg);
  204. }
  205. return ret;
  206. };
  207. function once(fn, ctx = null) {
  208. let res;
  209. return (...args) => {
  210. if (fn) {
  211. res = fn.apply(ctx, args);
  212. fn = null;
  213. }
  214. return res;
  215. };
  216. }
  217. function getValueByDataPath(obj, path) {
  218. if (!isString$1(path)) {
  219. return;
  220. }
  221. path = path.replace(/\[(\d+)\]/g, ".$1");
  222. const parts = path.split(".");
  223. let key = parts[0];
  224. if (!obj) {
  225. obj = {};
  226. }
  227. if (parts.length === 1) {
  228. return obj[key];
  229. }
  230. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  231. }
  232. function sortObject(obj) {
  233. let sortObj = {};
  234. if (isPlainObject(obj)) {
  235. Object.keys(obj).sort().forEach((key) => {
  236. const _key = key;
  237. sortObj[_key] = obj[_key];
  238. });
  239. }
  240. return !Object.keys(sortObj) ? obj : sortObj;
  241. }
  242. const encode = encodeURIComponent;
  243. function stringifyQuery(obj, encodeStr = encode) {
  244. const res = obj ? Object.keys(obj).map((key) => {
  245. let val = obj[key];
  246. if (typeof val === void 0 || val === null) {
  247. val = "";
  248. } else if (isPlainObject(val)) {
  249. val = JSON.stringify(val);
  250. }
  251. return encodeStr(key) + "=" + encodeStr(val);
  252. }).filter((x2) => x2.length > 0).join("&") : null;
  253. return res ? `?${res}` : "";
  254. }
  255. const PAGE_HOOKS = [
  256. ON_INIT,
  257. ON_LOAD,
  258. ON_SHOW,
  259. ON_HIDE,
  260. ON_UNLOAD,
  261. ON_BACK_PRESS,
  262. ON_PAGE_SCROLL,
  263. ON_TAB_ITEM_TAP,
  264. ON_REACH_BOTTOM,
  265. ON_PULL_DOWN_REFRESH,
  266. ON_SHARE_TIMELINE,
  267. ON_SHARE_APP_MESSAGE,
  268. ON_ADD_TO_FAVORITES,
  269. ON_SAVE_EXIT_STATE,
  270. ON_NAVIGATION_BAR_BUTTON_TAP,
  271. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  272. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  273. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  274. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  275. ];
  276. function isRootHook(name) {
  277. return PAGE_HOOKS.indexOf(name) > -1;
  278. }
  279. const UniLifecycleHooks = [
  280. ON_SHOW,
  281. ON_HIDE,
  282. ON_LAUNCH,
  283. ON_ERROR,
  284. ON_THEME_CHANGE,
  285. ON_PAGE_NOT_FOUND,
  286. ON_UNHANDLE_REJECTION,
  287. ON_INIT,
  288. ON_LOAD,
  289. ON_READY,
  290. ON_UNLOAD,
  291. ON_RESIZE,
  292. ON_BACK_PRESS,
  293. ON_PAGE_SCROLL,
  294. ON_TAB_ITEM_TAP,
  295. ON_REACH_BOTTOM,
  296. ON_PULL_DOWN_REFRESH,
  297. ON_SHARE_TIMELINE,
  298. ON_ADD_TO_FAVORITES,
  299. ON_SHARE_APP_MESSAGE,
  300. ON_SAVE_EXIT_STATE,
  301. ON_NAVIGATION_BAR_BUTTON_TAP,
  302. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  303. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  304. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  305. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  306. ];
  307. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  308. return {
  309. onPageScroll: 1,
  310. onShareAppMessage: 1 << 1,
  311. onShareTimeline: 1 << 2
  312. };
  313. })();
  314. function isUniLifecycleHook(name, value, checkType = true) {
  315. if (checkType && !isFunction$1(value)) {
  316. return false;
  317. }
  318. if (UniLifecycleHooks.indexOf(name) > -1) {
  319. return true;
  320. } else if (name.indexOf("on") === 0) {
  321. return true;
  322. }
  323. return false;
  324. }
  325. let vueApp;
  326. const createVueAppHooks = [];
  327. function onCreateVueApp(hook) {
  328. if (vueApp) {
  329. return hook(vueApp);
  330. }
  331. createVueAppHooks.push(hook);
  332. }
  333. function invokeCreateVueAppHook(app) {
  334. vueApp = app;
  335. createVueAppHooks.forEach((hook) => hook(app));
  336. }
  337. const invokeCreateErrorHandler = once((app, createErrorHandler2) => {
  338. if (isFunction$1(app._component.onError)) {
  339. return createErrorHandler2(app);
  340. }
  341. });
  342. const E$1 = function() {
  343. };
  344. E$1.prototype = {
  345. on: function(name, callback, ctx) {
  346. var e2 = this.e || (this.e = {});
  347. (e2[name] || (e2[name] = [])).push({
  348. fn: callback,
  349. ctx
  350. });
  351. return this;
  352. },
  353. once: function(name, callback, ctx) {
  354. var self = this;
  355. function listener() {
  356. self.off(name, listener);
  357. callback.apply(ctx, arguments);
  358. }
  359. listener._ = callback;
  360. return this.on(name, listener, ctx);
  361. },
  362. emit: function(name) {
  363. var data = [].slice.call(arguments, 1);
  364. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  365. var i2 = 0;
  366. var len = evtArr.length;
  367. for (i2; i2 < len; i2++) {
  368. evtArr[i2].fn.apply(evtArr[i2].ctx, data);
  369. }
  370. return this;
  371. },
  372. off: function(name, callback) {
  373. var e2 = this.e || (this.e = {});
  374. var evts = e2[name];
  375. var liveEvents = [];
  376. if (evts && callback) {
  377. for (var i2 = 0, len = evts.length; i2 < len; i2++) {
  378. if (evts[i2].fn !== callback && evts[i2].fn._ !== callback)
  379. liveEvents.push(evts[i2]);
  380. }
  381. }
  382. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  383. return this;
  384. }
  385. };
  386. var E$1$1 = E$1;
  387. const isObject$1 = (val) => val !== null && typeof val === "object";
  388. const defaultDelimiters = ["{", "}"];
  389. class BaseFormatter {
  390. constructor() {
  391. this._caches = /* @__PURE__ */ Object.create(null);
  392. }
  393. interpolate(message, values, delimiters = defaultDelimiters) {
  394. if (!values) {
  395. return [message];
  396. }
  397. let tokens2 = this._caches[message];
  398. if (!tokens2) {
  399. tokens2 = parse(message, delimiters);
  400. this._caches[message] = tokens2;
  401. }
  402. return compile$1(tokens2, values);
  403. }
  404. }
  405. const RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  406. const RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  407. function parse(format2, [startDelimiter, endDelimiter]) {
  408. const tokens2 = [];
  409. let position = 0;
  410. let text = "";
  411. while (position < format2.length) {
  412. let char = format2[position++];
  413. if (char === startDelimiter) {
  414. if (text) {
  415. tokens2.push({ type: "text", value: text });
  416. }
  417. text = "";
  418. let sub = "";
  419. char = format2[position++];
  420. while (char !== void 0 && char !== endDelimiter) {
  421. sub += char;
  422. char = format2[position++];
  423. }
  424. const isClosed = char === endDelimiter;
  425. const type = RE_TOKEN_LIST_VALUE.test(sub) ? "list" : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? "named" : "unknown";
  426. tokens2.push({ value: sub, type });
  427. } else {
  428. text += char;
  429. }
  430. }
  431. text && tokens2.push({ type: "text", value: text });
  432. return tokens2;
  433. }
  434. function compile$1(tokens2, values) {
  435. const compiled = [];
  436. let index2 = 0;
  437. const mode = Array.isArray(values) ? "list" : isObject$1(values) ? "named" : "unknown";
  438. if (mode === "unknown") {
  439. return compiled;
  440. }
  441. while (index2 < tokens2.length) {
  442. const token2 = tokens2[index2];
  443. switch (token2.type) {
  444. case "text":
  445. compiled.push(token2.value);
  446. break;
  447. case "list":
  448. compiled.push(values[parseInt(token2.value, 10)]);
  449. break;
  450. case "named":
  451. if (mode === "named") {
  452. compiled.push(values[token2.value]);
  453. } else {
  454. {
  455. console.warn(`Type of token '${token2.type}' and format of value '${mode}' don't match!`);
  456. }
  457. }
  458. break;
  459. case "unknown":
  460. {
  461. console.warn(`Detect 'unknown' type of token!`);
  462. }
  463. break;
  464. }
  465. index2++;
  466. }
  467. return compiled;
  468. }
  469. const LOCALE_ZH_HANS = "zh-Hans";
  470. const LOCALE_ZH_HANT = "zh-Hant";
  471. const LOCALE_EN = "en";
  472. const LOCALE_FR = "fr";
  473. const LOCALE_ES = "es";
  474. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  475. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  476. const defaultFormatter = new BaseFormatter();
  477. function include(str, parts) {
  478. return !!parts.find((part) => str.indexOf(part) !== -1);
  479. }
  480. function startsWith(str, parts) {
  481. return parts.find((part) => str.indexOf(part) === 0);
  482. }
  483. function normalizeLocale$1(locale2, messages) {
  484. if (!locale2) {
  485. return;
  486. }
  487. locale2 = locale2.trim().replace(/_/g, "-");
  488. if (messages && messages[locale2]) {
  489. return locale2;
  490. }
  491. locale2 = locale2.toLowerCase();
  492. if (locale2 === "chinese") {
  493. return LOCALE_ZH_HANS;
  494. }
  495. if (locale2.indexOf("zh") === 0) {
  496. if (locale2.indexOf("-hans") > -1) {
  497. return LOCALE_ZH_HANS;
  498. }
  499. if (locale2.indexOf("-hant") > -1) {
  500. return LOCALE_ZH_HANT;
  501. }
  502. if (include(locale2, ["-tw", "-hk", "-mo", "-cht"])) {
  503. return LOCALE_ZH_HANT;
  504. }
  505. return LOCALE_ZH_HANS;
  506. }
  507. let locales2 = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  508. if (messages && Object.keys(messages).length > 0) {
  509. locales2 = Object.keys(messages);
  510. }
  511. const lang2 = startsWith(locale2, locales2);
  512. if (lang2) {
  513. return lang2;
  514. }
  515. }
  516. class I18n {
  517. constructor({ locale: locale2, fallbackLocale, messages, watcher, formater }) {
  518. this.locale = LOCALE_EN;
  519. this.fallbackLocale = LOCALE_EN;
  520. this.message = {};
  521. this.messages = {};
  522. this.watchers = [];
  523. if (fallbackLocale) {
  524. this.fallbackLocale = fallbackLocale;
  525. }
  526. this.formater = formater || defaultFormatter;
  527. this.messages = messages || {};
  528. this.setLocale(locale2 || LOCALE_EN);
  529. if (watcher) {
  530. this.watchLocale(watcher);
  531. }
  532. }
  533. setLocale(locale2) {
  534. const oldLocale = this.locale;
  535. this.locale = normalizeLocale$1(locale2, this.messages) || this.fallbackLocale;
  536. if (!this.messages[this.locale]) {
  537. this.messages[this.locale] = {};
  538. }
  539. this.message = this.messages[this.locale];
  540. if (oldLocale !== this.locale) {
  541. this.watchers.forEach((watcher) => {
  542. watcher(this.locale, oldLocale);
  543. });
  544. }
  545. }
  546. getLocale() {
  547. return this.locale;
  548. }
  549. watchLocale(fn) {
  550. const index2 = this.watchers.push(fn) - 1;
  551. return () => {
  552. this.watchers.splice(index2, 1);
  553. };
  554. }
  555. add(locale2, message, override = true) {
  556. const curMessages = this.messages[locale2];
  557. if (curMessages) {
  558. if (override) {
  559. Object.assign(curMessages, message);
  560. } else {
  561. Object.keys(message).forEach((key) => {
  562. if (!hasOwn(curMessages, key)) {
  563. curMessages[key] = message[key];
  564. }
  565. });
  566. }
  567. } else {
  568. this.messages[locale2] = message;
  569. }
  570. }
  571. f(message, values, delimiters) {
  572. return this.formater.interpolate(message, values, delimiters).join("");
  573. }
  574. t(key, locale2, values) {
  575. let message = this.message;
  576. if (typeof locale2 === "string") {
  577. locale2 = normalizeLocale$1(locale2, this.messages);
  578. locale2 && (message = this.messages[locale2]);
  579. } else {
  580. values = locale2;
  581. }
  582. if (!hasOwn(message, key)) {
  583. console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);
  584. return key;
  585. }
  586. return this.formater.interpolate(message[key], values).join("");
  587. }
  588. }
  589. function watchAppLocale(appVm, i18n) {
  590. if (appVm.$watchLocale) {
  591. appVm.$watchLocale((newLocale) => {
  592. i18n.setLocale(newLocale);
  593. });
  594. } else {
  595. appVm.$watch(() => appVm.$locale, (newLocale) => {
  596. i18n.setLocale(newLocale);
  597. });
  598. }
  599. }
  600. function getDefaultLocale() {
  601. if (typeof index !== "undefined" && index.getLocale) {
  602. return index.getLocale();
  603. }
  604. if (typeof global !== "undefined" && global.getLocale) {
  605. return global.getLocale();
  606. }
  607. return LOCALE_EN;
  608. }
  609. function initVueI18n(locale2, messages = {}, fallbackLocale, watcher) {
  610. if (typeof locale2 !== "string") {
  611. [locale2, messages] = [
  612. messages,
  613. locale2
  614. ];
  615. }
  616. if (typeof locale2 !== "string") {
  617. locale2 = getDefaultLocale();
  618. }
  619. if (typeof fallbackLocale !== "string") {
  620. fallbackLocale = typeof __uniConfig !== "undefined" && __uniConfig.fallbackLocale || LOCALE_EN;
  621. }
  622. const i18n = new I18n({
  623. locale: locale2,
  624. fallbackLocale,
  625. messages,
  626. watcher
  627. });
  628. let t2 = (key, values) => {
  629. if (typeof getApp !== "function") {
  630. t2 = function(key2, values2) {
  631. return i18n.t(key2, values2);
  632. };
  633. } else {
  634. let isWatchedAppLocale = false;
  635. t2 = function(key2, values2) {
  636. const appVm = getApp().$vm;
  637. if (appVm) {
  638. appVm.$locale;
  639. if (!isWatchedAppLocale) {
  640. isWatchedAppLocale = true;
  641. watchAppLocale(appVm, i18n);
  642. }
  643. }
  644. return i18n.t(key2, values2);
  645. };
  646. }
  647. return t2(key, values);
  648. };
  649. return {
  650. i18n,
  651. f(message, values, delimiters) {
  652. return i18n.f(message, values, delimiters);
  653. },
  654. t(key, values) {
  655. return t2(key, values);
  656. },
  657. add(locale3, message, override = true) {
  658. return i18n.add(locale3, message, override);
  659. },
  660. watch(fn) {
  661. return i18n.watchLocale(fn);
  662. },
  663. getLocale() {
  664. return i18n.getLocale();
  665. },
  666. setLocale(newLocale) {
  667. return i18n.setLocale(newLocale);
  668. }
  669. };
  670. }
  671. function getBaseSystemInfo() {
  672. return wx.getSystemInfoSync();
  673. }
  674. function validateProtocolFail(name, msg) {
  675. console.warn(`${name}: ${msg}`);
  676. }
  677. function validateProtocol(name, data, protocol, onFail) {
  678. if (!onFail) {
  679. onFail = validateProtocolFail;
  680. }
  681. for (const key in protocol) {
  682. const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn$1(data, key));
  683. if (isString$1(errMsg)) {
  684. onFail(name, errMsg);
  685. }
  686. }
  687. }
  688. function validateProtocols(name, args, protocol, onFail) {
  689. if (!protocol) {
  690. return;
  691. }
  692. if (!isArray$1(protocol)) {
  693. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  694. }
  695. const len = protocol.length;
  696. const argsLen = args.length;
  697. for (let i2 = 0; i2 < len; i2++) {
  698. const opts = protocol[i2];
  699. const data = /* @__PURE__ */ Object.create(null);
  700. if (argsLen > i2) {
  701. data[opts.name] = args[i2];
  702. }
  703. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  704. }
  705. }
  706. function validateProp$1(name, value, prop, isAbsent) {
  707. if (!isPlainObject(prop)) {
  708. prop = { type: prop };
  709. }
  710. const { type, required, validator } = prop;
  711. if (required && isAbsent) {
  712. return 'Missing required args: "' + name + '"';
  713. }
  714. if (value == null && !required) {
  715. return;
  716. }
  717. if (type != null) {
  718. let isValid2 = false;
  719. const types = isArray$1(type) ? type : [type];
  720. const expectedTypes = [];
  721. for (let i2 = 0; i2 < types.length && !isValid2; i2++) {
  722. const { valid, expectedType } = assertType$1(value, types[i2]);
  723. expectedTypes.push(expectedType || "");
  724. isValid2 = valid;
  725. }
  726. if (!isValid2) {
  727. return getInvalidTypeMessage$1(name, value, expectedTypes);
  728. }
  729. }
  730. if (validator) {
  731. return validator(value);
  732. }
  733. }
  734. const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  735. function assertType$1(value, type) {
  736. let valid;
  737. const expectedType = getType$1(type);
  738. if (isSimpleType$1(expectedType)) {
  739. const t2 = typeof value;
  740. valid = t2 === expectedType.toLowerCase();
  741. if (!valid && t2 === "object") {
  742. valid = value instanceof type;
  743. }
  744. } else if (expectedType === "Object") {
  745. valid = isObject$2(value);
  746. } else if (expectedType === "Array") {
  747. valid = isArray$1(value);
  748. } else {
  749. {
  750. valid = value instanceof type;
  751. }
  752. }
  753. return {
  754. valid,
  755. expectedType
  756. };
  757. }
  758. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  759. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  760. const expectedType = expectedTypes[0];
  761. const receivedType = toRawType(value);
  762. const expectedValue = styleValue$1(value, expectedType);
  763. const receivedValue = styleValue$1(value, receivedType);
  764. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  765. message += ` with value ${expectedValue}`;
  766. }
  767. message += `, got ${receivedType} `;
  768. if (isExplicable$1(receivedType)) {
  769. message += `with value ${receivedValue}.`;
  770. }
  771. return message;
  772. }
  773. function getType$1(ctor) {
  774. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  775. return match ? match[1] : "";
  776. }
  777. function styleValue$1(value, type) {
  778. if (type === "String") {
  779. return `"${value}"`;
  780. } else if (type === "Number") {
  781. return `${Number(value)}`;
  782. } else {
  783. return `${value}`;
  784. }
  785. }
  786. function isExplicable$1(type) {
  787. const explicitTypes = ["string", "number", "boolean"];
  788. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  789. }
  790. function isBoolean$1(...args) {
  791. return args.some((elem) => elem.toLowerCase() === "boolean");
  792. }
  793. function tryCatch(fn) {
  794. return function() {
  795. try {
  796. return fn.apply(fn, arguments);
  797. } catch (e2) {
  798. console.error(e2);
  799. }
  800. };
  801. }
  802. let invokeCallbackId = 1;
  803. const invokeCallbacks = {};
  804. function addInvokeCallback(id, name, callback, keepAlive = false) {
  805. invokeCallbacks[id] = {
  806. name,
  807. keepAlive,
  808. callback
  809. };
  810. return id;
  811. }
  812. function invokeCallback(id, res, extras) {
  813. if (typeof id === "number") {
  814. const opts = invokeCallbacks[id];
  815. if (opts) {
  816. if (!opts.keepAlive) {
  817. delete invokeCallbacks[id];
  818. }
  819. return opts.callback(res, extras);
  820. }
  821. }
  822. return res;
  823. }
  824. const API_SUCCESS = "success";
  825. const API_FAIL = "fail";
  826. const API_COMPLETE = "complete";
  827. function getApiCallbacks(args) {
  828. const apiCallbacks = {};
  829. for (const name in args) {
  830. const fn = args[name];
  831. if (isFunction$1(fn)) {
  832. apiCallbacks[name] = tryCatch(fn);
  833. delete args[name];
  834. }
  835. }
  836. return apiCallbacks;
  837. }
  838. function normalizeErrMsg$1(errMsg, name) {
  839. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  840. return name + ":ok";
  841. }
  842. return name + errMsg.substring(errMsg.indexOf(":fail"));
  843. }
  844. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  845. if (!isPlainObject(args)) {
  846. args = {};
  847. }
  848. const { success, fail, complete } = getApiCallbacks(args);
  849. const hasSuccess = isFunction$1(success);
  850. const hasFail = isFunction$1(fail);
  851. const hasComplete = isFunction$1(complete);
  852. const callbackId = invokeCallbackId++;
  853. addInvokeCallback(callbackId, name, (res) => {
  854. res = res || {};
  855. res.errMsg = normalizeErrMsg$1(res.errMsg, name);
  856. isFunction$1(beforeAll) && beforeAll(res);
  857. if (res.errMsg === name + ":ok") {
  858. isFunction$1(beforeSuccess) && beforeSuccess(res, args);
  859. hasSuccess && success(res);
  860. } else {
  861. hasFail && fail(res);
  862. }
  863. hasComplete && complete(res);
  864. });
  865. return callbackId;
  866. }
  867. const HOOK_SUCCESS = "success";
  868. const HOOK_FAIL = "fail";
  869. const HOOK_COMPLETE = "complete";
  870. const globalInterceptors = {};
  871. const scopedInterceptors = {};
  872. function wrapperHook(hook, params) {
  873. return function(data) {
  874. return hook(data, params) || data;
  875. };
  876. }
  877. function queue$1(hooks2, data, params) {
  878. let promise = false;
  879. for (let i2 = 0; i2 < hooks2.length; i2++) {
  880. const hook = hooks2[i2];
  881. if (promise) {
  882. promise = Promise.resolve(wrapperHook(hook, params));
  883. } else {
  884. const res = hook(data, params);
  885. if (isPromise(res)) {
  886. promise = Promise.resolve(res);
  887. }
  888. if (res === false) {
  889. return {
  890. then() {
  891. },
  892. catch() {
  893. }
  894. };
  895. }
  896. }
  897. }
  898. return promise || {
  899. then(callback) {
  900. return callback(data);
  901. },
  902. catch() {
  903. }
  904. };
  905. }
  906. function wrapperOptions(interceptors2, options = {}) {
  907. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  908. const hooks2 = interceptors2[name];
  909. if (!isArray$1(hooks2)) {
  910. return;
  911. }
  912. const oldCallback = options[name];
  913. options[name] = function callbackInterceptor(res) {
  914. queue$1(hooks2, res, options).then((res2) => {
  915. return isFunction$1(oldCallback) && oldCallback(res2) || res2;
  916. });
  917. };
  918. });
  919. return options;
  920. }
  921. function wrapperReturnValue(method, returnValue) {
  922. const returnValueHooks = [];
  923. if (isArray$1(globalInterceptors.returnValue)) {
  924. returnValueHooks.push(...globalInterceptors.returnValue);
  925. }
  926. const interceptor = scopedInterceptors[method];
  927. if (interceptor && isArray$1(interceptor.returnValue)) {
  928. returnValueHooks.push(...interceptor.returnValue);
  929. }
  930. returnValueHooks.forEach((hook) => {
  931. returnValue = hook(returnValue) || returnValue;
  932. });
  933. return returnValue;
  934. }
  935. function getApiInterceptorHooks(method) {
  936. const interceptor = /* @__PURE__ */ Object.create(null);
  937. Object.keys(globalInterceptors).forEach((hook) => {
  938. if (hook !== "returnValue") {
  939. interceptor[hook] = globalInterceptors[hook].slice();
  940. }
  941. });
  942. const scopedInterceptor = scopedInterceptors[method];
  943. if (scopedInterceptor) {
  944. Object.keys(scopedInterceptor).forEach((hook) => {
  945. if (hook !== "returnValue") {
  946. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  947. }
  948. });
  949. }
  950. return interceptor;
  951. }
  952. function invokeApi(method, api, options, params) {
  953. const interceptor = getApiInterceptorHooks(method);
  954. if (interceptor && Object.keys(interceptor).length) {
  955. if (isArray$1(interceptor.invoke)) {
  956. const res = queue$1(interceptor.invoke, options);
  957. return res.then((options2) => {
  958. return api(wrapperOptions(getApiInterceptorHooks(method), options2), ...params);
  959. });
  960. } else {
  961. return api(wrapperOptions(interceptor, options), ...params);
  962. }
  963. }
  964. return api(options, ...params);
  965. }
  966. function hasCallback(args) {
  967. if (isPlainObject(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction$1(args[cb]))) {
  968. return true;
  969. }
  970. return false;
  971. }
  972. function handlePromise(promise) {
  973. return promise;
  974. }
  975. function promisify$1(name, fn) {
  976. return (args = {}, ...rest) => {
  977. if (hasCallback(args)) {
  978. return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
  979. }
  980. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  981. invokeApi(name, fn, extend$1(args, { success: resolve2, fail: reject }), rest);
  982. })));
  983. };
  984. }
  985. function formatApiArgs(args, options) {
  986. const params = args[0];
  987. if (!options || !isPlainObject(options.formatArgs) && isPlainObject(params)) {
  988. return;
  989. }
  990. const formatArgs = options.formatArgs;
  991. const keys2 = Object.keys(formatArgs);
  992. for (let i2 = 0; i2 < keys2.length; i2++) {
  993. const name = keys2[i2];
  994. const formatterOrDefaultValue = formatArgs[name];
  995. if (isFunction$1(formatterOrDefaultValue)) {
  996. const errMsg = formatterOrDefaultValue(args[0][name], params);
  997. if (isString$1(errMsg)) {
  998. return errMsg;
  999. }
  1000. } else {
  1001. if (!hasOwn$1(params, name)) {
  1002. params[name] = formatterOrDefaultValue;
  1003. }
  1004. }
  1005. }
  1006. }
  1007. function invokeSuccess(id, name, res) {
  1008. return invokeCallback(id, extend$1(res || {}, { errMsg: name + ":ok" }));
  1009. }
  1010. function invokeFail(id, name, errMsg, errRes) {
  1011. return invokeCallback(id, extend$1({ errMsg: name + ":fail" + (errMsg ? " " + errMsg : "") }, errRes));
  1012. }
  1013. function beforeInvokeApi(name, args, protocol, options) {
  1014. {
  1015. validateProtocols(name, args, protocol);
  1016. }
  1017. if (options && options.beforeInvoke) {
  1018. const errMsg2 = options.beforeInvoke(args);
  1019. if (isString$1(errMsg2)) {
  1020. return errMsg2;
  1021. }
  1022. }
  1023. const errMsg = formatApiArgs(args, options);
  1024. if (errMsg) {
  1025. return errMsg;
  1026. }
  1027. }
  1028. function normalizeErrMsg(errMsg) {
  1029. if (!errMsg || isString$1(errMsg)) {
  1030. return errMsg;
  1031. }
  1032. if (errMsg.stack) {
  1033. console.error(errMsg.message + LINEFEED + errMsg.stack);
  1034. return errMsg.message;
  1035. }
  1036. return errMsg;
  1037. }
  1038. function wrapperTaskApi(name, fn, protocol, options) {
  1039. return (args) => {
  1040. const id = createAsyncApiCallback(name, args, options);
  1041. const errMsg = beforeInvokeApi(name, [args], protocol, options);
  1042. if (errMsg) {
  1043. return invokeFail(id, name, errMsg);
  1044. }
  1045. return fn(args, {
  1046. resolve: (res) => invokeSuccess(id, name, res),
  1047. reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
  1048. });
  1049. };
  1050. }
  1051. function wrapperSyncApi(name, fn, protocol, options) {
  1052. return (...args) => {
  1053. const errMsg = beforeInvokeApi(name, args, protocol, options);
  1054. if (errMsg) {
  1055. throw new Error(errMsg);
  1056. }
  1057. return fn.apply(null, args);
  1058. };
  1059. }
  1060. function wrapperAsyncApi(name, fn, protocol, options) {
  1061. return wrapperTaskApi(name, fn, protocol, options);
  1062. }
  1063. function defineSyncApi(name, fn, protocol, options) {
  1064. return wrapperSyncApi(name, fn, protocol, options);
  1065. }
  1066. function defineAsyncApi(name, fn, protocol, options) {
  1067. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  1068. }
  1069. const API_UPX2PX = "upx2px";
  1070. const Upx2pxProtocol = [
  1071. {
  1072. name: "upx",
  1073. type: [Number, String],
  1074. required: true
  1075. }
  1076. ];
  1077. const EPS = 1e-4;
  1078. const BASE_DEVICE_WIDTH = 750;
  1079. let isIOS = false;
  1080. let deviceWidth = 0;
  1081. let deviceDPR = 0;
  1082. function checkDeviceWidth() {
  1083. const { platform, pixelRatio, windowWidth } = getBaseSystemInfo();
  1084. deviceWidth = windowWidth;
  1085. deviceDPR = pixelRatio;
  1086. isIOS = platform === "ios";
  1087. }
  1088. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  1089. if (deviceWidth === 0) {
  1090. checkDeviceWidth();
  1091. }
  1092. number = Number(number);
  1093. if (number === 0) {
  1094. return 0;
  1095. }
  1096. let width = newDeviceWidth || deviceWidth;
  1097. let result = number / BASE_DEVICE_WIDTH * width;
  1098. if (result < 0) {
  1099. result = -result;
  1100. }
  1101. result = Math.floor(result + EPS);
  1102. if (result === 0) {
  1103. if (deviceDPR === 1 || !isIOS) {
  1104. result = 1;
  1105. } else {
  1106. result = 0.5;
  1107. }
  1108. }
  1109. return number < 0 ? -result : result;
  1110. }, Upx2pxProtocol);
  1111. const API_ADD_INTERCEPTOR = "addInterceptor";
  1112. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  1113. const AddInterceptorProtocol = [
  1114. {
  1115. name: "method",
  1116. type: [String, Object],
  1117. required: true
  1118. }
  1119. ];
  1120. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  1121. function mergeInterceptorHook(interceptors2, interceptor) {
  1122. Object.keys(interceptor).forEach((hook) => {
  1123. if (isFunction$1(interceptor[hook])) {
  1124. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  1125. }
  1126. });
  1127. }
  1128. function removeInterceptorHook(interceptors2, interceptor) {
  1129. if (!interceptors2 || !interceptor) {
  1130. return;
  1131. }
  1132. Object.keys(interceptor).forEach((name) => {
  1133. const hooks2 = interceptors2[name];
  1134. const hook = interceptor[name];
  1135. if (isArray$1(hooks2) && isFunction$1(hook)) {
  1136. remove(hooks2, hook);
  1137. }
  1138. });
  1139. }
  1140. function mergeHook(parentVal, childVal) {
  1141. const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray$1(childVal) ? childVal : [childVal] : parentVal;
  1142. return res ? dedupeHooks(res) : res;
  1143. }
  1144. function dedupeHooks(hooks2) {
  1145. const res = [];
  1146. for (let i2 = 0; i2 < hooks2.length; i2++) {
  1147. if (res.indexOf(hooks2[i2]) === -1) {
  1148. res.push(hooks2[i2]);
  1149. }
  1150. }
  1151. return res;
  1152. }
  1153. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  1154. if (isString$1(method) && isPlainObject(interceptor)) {
  1155. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  1156. } else if (isPlainObject(method)) {
  1157. mergeInterceptorHook(globalInterceptors, method);
  1158. }
  1159. }, AddInterceptorProtocol);
  1160. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  1161. if (isString$1(method)) {
  1162. if (isPlainObject(interceptor)) {
  1163. removeInterceptorHook(scopedInterceptors[method], interceptor);
  1164. } else {
  1165. delete scopedInterceptors[method];
  1166. }
  1167. } else if (isPlainObject(method)) {
  1168. removeInterceptorHook(globalInterceptors, method);
  1169. }
  1170. }, RemoveInterceptorProtocol);
  1171. const interceptors = {};
  1172. const API_ON = "$on";
  1173. const OnProtocol = [
  1174. {
  1175. name: "event",
  1176. type: String,
  1177. required: true
  1178. },
  1179. {
  1180. name: "callback",
  1181. type: Function,
  1182. required: true
  1183. }
  1184. ];
  1185. const API_ONCE = "$once";
  1186. const OnceProtocol = OnProtocol;
  1187. const API_OFF = "$off";
  1188. const OffProtocol = [
  1189. {
  1190. name: "event",
  1191. type: [String, Array]
  1192. },
  1193. {
  1194. name: "callback",
  1195. type: Function
  1196. }
  1197. ];
  1198. const API_EMIT = "$emit";
  1199. const EmitProtocol = [
  1200. {
  1201. name: "event",
  1202. type: String,
  1203. required: true
  1204. }
  1205. ];
  1206. const emitter = new E$1$1();
  1207. const $on = defineSyncApi(API_ON, (name, callback) => {
  1208. emitter.on(name, callback);
  1209. return () => emitter.off(name, callback);
  1210. }, OnProtocol);
  1211. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  1212. emitter.once(name, callback);
  1213. return () => emitter.off(name, callback);
  1214. }, OnceProtocol);
  1215. const $off = defineSyncApi(API_OFF, (name, callback) => {
  1216. if (!name) {
  1217. emitter.e = {};
  1218. return;
  1219. }
  1220. if (!isArray$1(name))
  1221. name = [name];
  1222. name.forEach((n2) => emitter.off(n2, callback));
  1223. }, OffProtocol);
  1224. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  1225. emitter.emit(name, ...args);
  1226. }, EmitProtocol);
  1227. let cid;
  1228. let cidErrMsg;
  1229. let enabled;
  1230. function normalizePushMessage(message) {
  1231. try {
  1232. return JSON.parse(message);
  1233. } catch (e2) {
  1234. }
  1235. return message;
  1236. }
  1237. function invokePushCallback(args) {
  1238. if (args.type === "enabled") {
  1239. enabled = true;
  1240. } else if (args.type === "clientId") {
  1241. cid = args.cid;
  1242. cidErrMsg = args.errMsg;
  1243. invokeGetPushCidCallbacks(cid, args.errMsg);
  1244. } else if (args.type === "pushMsg") {
  1245. const message = {
  1246. type: "receive",
  1247. data: normalizePushMessage(args.message)
  1248. };
  1249. for (let i2 = 0; i2 < onPushMessageCallbacks.length; i2++) {
  1250. const callback = onPushMessageCallbacks[i2];
  1251. callback(message);
  1252. if (message.stopped) {
  1253. break;
  1254. }
  1255. }
  1256. } else if (args.type === "click") {
  1257. onPushMessageCallbacks.forEach((callback) => {
  1258. callback({
  1259. type: "click",
  1260. data: normalizePushMessage(args.message)
  1261. });
  1262. });
  1263. }
  1264. }
  1265. const getPushCidCallbacks = [];
  1266. function invokeGetPushCidCallbacks(cid2, errMsg) {
  1267. getPushCidCallbacks.forEach((callback) => {
  1268. callback(cid2, errMsg);
  1269. });
  1270. getPushCidCallbacks.length = 0;
  1271. }
  1272. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  1273. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_2, { resolve: resolve2, reject }) => {
  1274. Promise.resolve().then(() => {
  1275. if (typeof enabled === "undefined") {
  1276. enabled = false;
  1277. cid = "";
  1278. cidErrMsg = "uniPush is not enabled";
  1279. }
  1280. getPushCidCallbacks.push((cid2, errMsg) => {
  1281. if (cid2) {
  1282. resolve2({ cid: cid2 });
  1283. } else {
  1284. reject(errMsg);
  1285. }
  1286. });
  1287. if (typeof cid !== "undefined") {
  1288. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1289. }
  1290. });
  1291. });
  1292. const onPushMessageCallbacks = [];
  1293. const onPushMessage = (fn) => {
  1294. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1295. onPushMessageCallbacks.push(fn);
  1296. }
  1297. };
  1298. const offPushMessage = (fn) => {
  1299. if (!fn) {
  1300. onPushMessageCallbacks.length = 0;
  1301. } else {
  1302. const index2 = onPushMessageCallbacks.indexOf(fn);
  1303. if (index2 > -1) {
  1304. onPushMessageCallbacks.splice(index2, 1);
  1305. }
  1306. }
  1307. };
  1308. const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/;
  1309. const CONTEXT_API_RE = /^create|Manager$/;
  1310. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  1311. const ASYNC_API = ["createBLEConnection"];
  1312. const CALLBACK_API_RE = /^on|^off/;
  1313. function isContextApi(name) {
  1314. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1315. }
  1316. function isSyncApi(name) {
  1317. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1318. }
  1319. function isCallbackApi(name) {
  1320. return CALLBACK_API_RE.test(name) && name !== "onPush";
  1321. }
  1322. function shouldPromise(name) {
  1323. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1324. return false;
  1325. }
  1326. return true;
  1327. }
  1328. if (!Promise.prototype.finally) {
  1329. Promise.prototype.finally = function(onfinally) {
  1330. const promise = this.constructor;
  1331. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  1332. throw reason;
  1333. }));
  1334. };
  1335. }
  1336. function promisify(name, api) {
  1337. if (!shouldPromise(name)) {
  1338. return api;
  1339. }
  1340. if (!isFunction$1(api)) {
  1341. return api;
  1342. }
  1343. return function promiseApi(options = {}, ...rest) {
  1344. if (isFunction$1(options.success) || isFunction$1(options.fail) || isFunction$1(options.complete)) {
  1345. return wrapperReturnValue(name, invokeApi(name, api, options, rest));
  1346. }
  1347. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  1348. invokeApi(name, api, extend$1({}, options, {
  1349. success: resolve2,
  1350. fail: reject
  1351. }), rest);
  1352. })));
  1353. };
  1354. }
  1355. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  1356. function initWrapper(protocols2) {
  1357. function processCallback(methodName, method, returnValue) {
  1358. return function(res) {
  1359. return method(processReturnValue(methodName, res, returnValue));
  1360. };
  1361. }
  1362. function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
  1363. if (isPlainObject(fromArgs)) {
  1364. const toArgs = keepFromArgs === true ? fromArgs : {};
  1365. if (isFunction$1(argsOption)) {
  1366. argsOption = argsOption(fromArgs, toArgs) || {};
  1367. }
  1368. for (const key in fromArgs) {
  1369. if (hasOwn$1(argsOption, key)) {
  1370. let keyOption = argsOption[key];
  1371. if (isFunction$1(keyOption)) {
  1372. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1373. }
  1374. if (!keyOption) {
  1375. console.warn(`微信小程序 ${methodName} 暂不支持 ${key}`);
  1376. } else if (isString$1(keyOption)) {
  1377. toArgs[keyOption] = fromArgs[key];
  1378. } else if (isPlainObject(keyOption)) {
  1379. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1380. }
  1381. } else if (CALLBACKS.indexOf(key) !== -1) {
  1382. const callback = fromArgs[key];
  1383. if (isFunction$1(callback)) {
  1384. toArgs[key] = processCallback(methodName, callback, returnValue);
  1385. }
  1386. } else {
  1387. if (!keepFromArgs && !hasOwn$1(toArgs, key)) {
  1388. toArgs[key] = fromArgs[key];
  1389. }
  1390. }
  1391. }
  1392. return toArgs;
  1393. } else if (isFunction$1(fromArgs)) {
  1394. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1395. }
  1396. return fromArgs;
  1397. }
  1398. function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
  1399. if (isFunction$1(protocols2.returnValue)) {
  1400. res = protocols2.returnValue(methodName, res);
  1401. }
  1402. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1403. }
  1404. return function wrapper(methodName, method) {
  1405. if (!hasOwn$1(protocols2, methodName)) {
  1406. return method;
  1407. }
  1408. const protocol = protocols2[methodName];
  1409. if (!protocol) {
  1410. return function() {
  1411. console.error(`微信小程序 暂不支持${methodName}`);
  1412. };
  1413. }
  1414. return function(arg1, arg2) {
  1415. let options = protocol;
  1416. if (isFunction$1(protocol)) {
  1417. options = protocol(arg1);
  1418. }
  1419. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1420. const args = [arg1];
  1421. if (typeof arg2 !== "undefined") {
  1422. args.push(arg2);
  1423. }
  1424. const returnValue = wx[options.name || methodName].apply(wx, args);
  1425. if (isSyncApi(methodName)) {
  1426. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1427. }
  1428. return returnValue;
  1429. };
  1430. };
  1431. }
  1432. const getLocale$1 = () => {
  1433. const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  1434. if (app && app.$vm) {
  1435. return app.$vm.$locale;
  1436. }
  1437. return normalizeLocale$1(wx.getSystemInfoSync().language) || LOCALE_EN;
  1438. };
  1439. const setLocale = (locale2) => {
  1440. const app = isFunction$1(getApp) && getApp();
  1441. if (!app) {
  1442. return false;
  1443. }
  1444. const oldLocale = app.$vm.$locale;
  1445. if (oldLocale !== locale2) {
  1446. app.$vm.$locale = locale2;
  1447. onLocaleChangeCallbacks.forEach((fn) => fn({ locale: locale2 }));
  1448. return true;
  1449. }
  1450. return false;
  1451. };
  1452. const onLocaleChangeCallbacks = [];
  1453. const onLocaleChange = (fn) => {
  1454. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1455. onLocaleChangeCallbacks.push(fn);
  1456. }
  1457. };
  1458. if (typeof global !== "undefined") {
  1459. global.getLocale = getLocale$1;
  1460. }
  1461. const UUID_KEY = "__DC_STAT_UUID";
  1462. let deviceId;
  1463. function useDeviceId(global2 = wx) {
  1464. return function addDeviceId(_2, toRes) {
  1465. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  1466. if (!deviceId) {
  1467. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  1468. wx.setStorage({
  1469. key: UUID_KEY,
  1470. data: deviceId
  1471. });
  1472. }
  1473. toRes.deviceId = deviceId;
  1474. };
  1475. }
  1476. function addSafeAreaInsets(fromRes, toRes) {
  1477. if (fromRes.safeArea) {
  1478. const safeArea = fromRes.safeArea;
  1479. toRes.safeAreaInsets = {
  1480. top: safeArea.top,
  1481. left: safeArea.left,
  1482. right: fromRes.windowWidth - safeArea.right,
  1483. bottom: fromRes.screenHeight - safeArea.bottom
  1484. };
  1485. }
  1486. }
  1487. function populateParameters(fromRes, toRes) {
  1488. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  1489. let osName = "";
  1490. let osVersion = "";
  1491. {
  1492. osName = system.split(" ")[0] || "";
  1493. osVersion = system.split(" ")[1] || "";
  1494. }
  1495. let hostVersion = version2;
  1496. let deviceType = getGetDeviceType(fromRes, model);
  1497. let deviceBrand = getDeviceBrand(brand);
  1498. let _hostName = getHostName(fromRes);
  1499. let _deviceOrientation = deviceOrientation;
  1500. let _devicePixelRatio = pixelRatio;
  1501. let _SDKVersion = SDKVersion;
  1502. const hostLanguage = language.replace(/_/g, "-");
  1503. const parameters = {
  1504. appId: "__UNI__818FE07",
  1505. appName: "match_applet",
  1506. appVersion: "1.0.0",
  1507. appVersionCode: "100",
  1508. appLanguage: getAppLanguage(hostLanguage),
  1509. uniCompileVersion: "3.8.7",
  1510. uniRuntimeVersion: "3.8.7",
  1511. uniPlatform: "mp-weixin",
  1512. deviceBrand,
  1513. deviceModel: model,
  1514. deviceType,
  1515. devicePixelRatio: _devicePixelRatio,
  1516. deviceOrientation: _deviceOrientation,
  1517. osName: osName.toLocaleLowerCase(),
  1518. osVersion,
  1519. hostTheme: theme,
  1520. hostVersion,
  1521. hostLanguage,
  1522. hostName: _hostName,
  1523. hostSDKVersion: _SDKVersion,
  1524. hostFontSizeSetting: fontSizeSetting,
  1525. windowTop: 0,
  1526. windowBottom: 0,
  1527. // TODO
  1528. osLanguage: void 0,
  1529. osTheme: void 0,
  1530. ua: void 0,
  1531. hostPackageName: void 0,
  1532. browserName: void 0,
  1533. browserVersion: void 0
  1534. };
  1535. extend$1(toRes, parameters);
  1536. }
  1537. function getGetDeviceType(fromRes, model) {
  1538. let deviceType = fromRes.deviceType || "phone";
  1539. {
  1540. const deviceTypeMaps = {
  1541. ipad: "pad",
  1542. windows: "pc",
  1543. mac: "pc"
  1544. };
  1545. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1546. const _model = model.toLocaleLowerCase();
  1547. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  1548. const _m = deviceTypeMapsKeys[index2];
  1549. if (_model.indexOf(_m) !== -1) {
  1550. deviceType = deviceTypeMaps[_m];
  1551. break;
  1552. }
  1553. }
  1554. }
  1555. return deviceType;
  1556. }
  1557. function getDeviceBrand(brand) {
  1558. let deviceBrand = brand;
  1559. if (deviceBrand) {
  1560. deviceBrand = deviceBrand.toLocaleLowerCase();
  1561. }
  1562. return deviceBrand;
  1563. }
  1564. function getAppLanguage(defaultLanguage) {
  1565. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1566. }
  1567. function getHostName(fromRes) {
  1568. const _platform = "WeChat";
  1569. let _hostName = fromRes.hostName || _platform;
  1570. {
  1571. if (fromRes.environment) {
  1572. _hostName = fromRes.environment;
  1573. } else if (fromRes.host && fromRes.host.env) {
  1574. _hostName = fromRes.host.env;
  1575. }
  1576. }
  1577. return _hostName;
  1578. }
  1579. const getSystemInfo = {
  1580. returnValue: (fromRes, toRes) => {
  1581. addSafeAreaInsets(fromRes, toRes);
  1582. useDeviceId()(fromRes, toRes);
  1583. populateParameters(fromRes, toRes);
  1584. }
  1585. };
  1586. const getSystemInfoSync = getSystemInfo;
  1587. const redirectTo = {};
  1588. const previewImage = {
  1589. args(fromArgs, toArgs) {
  1590. let currentIndex = parseInt(fromArgs.current);
  1591. if (isNaN(currentIndex)) {
  1592. return;
  1593. }
  1594. const urls = fromArgs.urls;
  1595. if (!isArray$1(urls)) {
  1596. return;
  1597. }
  1598. const len = urls.length;
  1599. if (!len) {
  1600. return;
  1601. }
  1602. if (currentIndex < 0) {
  1603. currentIndex = 0;
  1604. } else if (currentIndex >= len) {
  1605. currentIndex = len - 1;
  1606. }
  1607. if (currentIndex > 0) {
  1608. toArgs.current = urls[currentIndex];
  1609. toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
  1610. } else {
  1611. toArgs.current = urls[0];
  1612. }
  1613. return {
  1614. indicator: false,
  1615. loop: false
  1616. };
  1617. }
  1618. };
  1619. const showActionSheet = {
  1620. args(fromArgs, toArgs) {
  1621. toArgs.alertText = fromArgs.title;
  1622. }
  1623. };
  1624. const getDeviceInfo = {
  1625. returnValue: (fromRes, toRes) => {
  1626. const { brand, model } = fromRes;
  1627. let deviceType = getGetDeviceType(fromRes, model);
  1628. let deviceBrand = getDeviceBrand(brand);
  1629. useDeviceId()(fromRes, toRes);
  1630. toRes = sortObject(extend$1(toRes, {
  1631. deviceType,
  1632. deviceBrand,
  1633. deviceModel: model
  1634. }));
  1635. }
  1636. };
  1637. const getAppBaseInfo = {
  1638. returnValue: (fromRes, toRes) => {
  1639. const { version: version2, language, SDKVersion, theme } = fromRes;
  1640. let _hostName = getHostName(fromRes);
  1641. let hostLanguage = language.replace(/_/g, "-");
  1642. toRes = sortObject(extend$1(toRes, {
  1643. hostVersion: version2,
  1644. hostLanguage,
  1645. hostName: _hostName,
  1646. hostSDKVersion: SDKVersion,
  1647. hostTheme: theme,
  1648. appId: "__UNI__818FE07",
  1649. appName: "match_applet",
  1650. appVersion: "1.0.0",
  1651. appVersionCode: "100",
  1652. appLanguage: getAppLanguage(hostLanguage)
  1653. }));
  1654. }
  1655. };
  1656. const getWindowInfo = {
  1657. returnValue: (fromRes, toRes) => {
  1658. addSafeAreaInsets(fromRes, toRes);
  1659. toRes = sortObject(extend$1(toRes, {
  1660. windowTop: 0,
  1661. windowBottom: 0
  1662. }));
  1663. }
  1664. };
  1665. const getAppAuthorizeSetting = {
  1666. returnValue: function(fromRes, toRes) {
  1667. const { locationReducedAccuracy } = fromRes;
  1668. toRes.locationAccuracy = "unsupported";
  1669. if (locationReducedAccuracy === true) {
  1670. toRes.locationAccuracy = "reduced";
  1671. } else if (locationReducedAccuracy === false) {
  1672. toRes.locationAccuracy = "full";
  1673. }
  1674. }
  1675. };
  1676. const baseApis = {
  1677. $on,
  1678. $off,
  1679. $once,
  1680. $emit,
  1681. upx2px,
  1682. interceptors,
  1683. addInterceptor,
  1684. removeInterceptor,
  1685. onCreateVueApp,
  1686. invokeCreateVueAppHook,
  1687. getLocale: getLocale$1,
  1688. setLocale,
  1689. onLocaleChange,
  1690. getPushClientId,
  1691. onPushMessage,
  1692. offPushMessage,
  1693. invokePushCallback
  1694. };
  1695. function initUni(api, protocols2, platform = wx) {
  1696. const wrapper = initWrapper(protocols2);
  1697. const UniProxyHandlers = {
  1698. get(target, key) {
  1699. if (hasOwn$1(target, key)) {
  1700. return target[key];
  1701. }
  1702. if (hasOwn$1(api, key)) {
  1703. return promisify(key, api[key]);
  1704. }
  1705. if (hasOwn$1(baseApis, key)) {
  1706. return promisify(key, baseApis[key]);
  1707. }
  1708. return promisify(key, wrapper(key, platform[key]));
  1709. }
  1710. };
  1711. return new Proxy({}, UniProxyHandlers);
  1712. }
  1713. function initGetProvider(providers) {
  1714. return function getProvider2({ service, success, fail, complete }) {
  1715. let res;
  1716. if (providers[service]) {
  1717. res = {
  1718. errMsg: "getProvider:ok",
  1719. service,
  1720. provider: providers[service]
  1721. };
  1722. isFunction$1(success) && success(res);
  1723. } else {
  1724. res = {
  1725. errMsg: "getProvider:fail:服务[" + service + "]不存在"
  1726. };
  1727. isFunction$1(fail) && fail(res);
  1728. }
  1729. isFunction$1(complete) && complete(res);
  1730. };
  1731. }
  1732. const objectKeys = [
  1733. "qy",
  1734. "env",
  1735. "error",
  1736. "version",
  1737. "lanDebug",
  1738. "cloud",
  1739. "serviceMarket",
  1740. "router",
  1741. "worklet",
  1742. "__webpack_require_UNI_MP_PLUGIN__"
  1743. ];
  1744. const singlePageDisableKey = ["lanDebug", "router", "worklet"];
  1745. const launchOption = wx.getLaunchOptionsSync ? wx.getLaunchOptionsSync() : null;
  1746. function isWxKey(key) {
  1747. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  1748. return false;
  1749. }
  1750. return objectKeys.indexOf(key) > -1 || typeof wx[key] === "function";
  1751. }
  1752. function initWx() {
  1753. const newWx = {};
  1754. for (const key in wx) {
  1755. if (isWxKey(key)) {
  1756. newWx[key] = wx[key];
  1757. }
  1758. }
  1759. if (typeof globalThis !== "undefined" && typeof requireMiniProgram === "undefined") {
  1760. globalThis.wx = newWx;
  1761. }
  1762. return newWx;
  1763. }
  1764. const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  1765. const getProvider = initGetProvider({
  1766. oauth: ["weixin"],
  1767. share: ["weixin"],
  1768. payment: ["wxpay"],
  1769. push: ["weixin"]
  1770. });
  1771. function initComponentMocks(component) {
  1772. const res = /* @__PURE__ */ Object.create(null);
  1773. mocks$1.forEach((name) => {
  1774. res[name] = component[name];
  1775. });
  1776. return res;
  1777. }
  1778. function createSelectorQuery() {
  1779. const query = wx$2.createSelectorQuery();
  1780. const oldIn = query.in;
  1781. query.in = function newIn(component) {
  1782. return oldIn.call(this, initComponentMocks(component));
  1783. };
  1784. return query;
  1785. }
  1786. const wx$2 = initWx();
  1787. let baseInfo = wx$2.getAppBaseInfo && wx$2.getAppBaseInfo();
  1788. if (!baseInfo) {
  1789. baseInfo = wx$2.getSystemInfoSync();
  1790. }
  1791. const host = baseInfo ? baseInfo.host : null;
  1792. const shareVideoMessage = host && host.env === "SAAASDK" ? wx$2.miniapp.shareVideoMessage : wx$2.shareVideoMessage;
  1793. var shims = /* @__PURE__ */ Object.freeze({
  1794. __proto__: null,
  1795. createSelectorQuery,
  1796. getProvider,
  1797. shareVideoMessage
  1798. });
  1799. const compressImage = {
  1800. args(fromArgs, toArgs) {
  1801. if (fromArgs.compressedHeight && !toArgs.compressHeight) {
  1802. toArgs.compressHeight = fromArgs.compressedHeight;
  1803. }
  1804. if (fromArgs.compressedWidth && !toArgs.compressWidth) {
  1805. toArgs.compressWidth = fromArgs.compressedWidth;
  1806. }
  1807. }
  1808. };
  1809. var protocols = /* @__PURE__ */ Object.freeze({
  1810. __proto__: null,
  1811. compressImage,
  1812. getAppAuthorizeSetting,
  1813. getAppBaseInfo,
  1814. getDeviceInfo,
  1815. getSystemInfo,
  1816. getSystemInfoSync,
  1817. getWindowInfo,
  1818. previewImage,
  1819. redirectTo,
  1820. showActionSheet
  1821. });
  1822. const wx$1 = initWx();
  1823. var index = initUni(shims, protocols, wx$1);
  1824. function warn$1(msg, ...args) {
  1825. console.warn(`[Vue warn] ${msg}`, ...args);
  1826. }
  1827. let activeEffectScope;
  1828. class EffectScope {
  1829. constructor(detached = false) {
  1830. this.detached = detached;
  1831. this._active = true;
  1832. this.effects = [];
  1833. this.cleanups = [];
  1834. this.parent = activeEffectScope;
  1835. if (!detached && activeEffectScope) {
  1836. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1837. }
  1838. }
  1839. get active() {
  1840. return this._active;
  1841. }
  1842. run(fn) {
  1843. if (this._active) {
  1844. const currentEffectScope = activeEffectScope;
  1845. try {
  1846. activeEffectScope = this;
  1847. return fn();
  1848. } finally {
  1849. activeEffectScope = currentEffectScope;
  1850. }
  1851. } else {
  1852. warn$1(`cannot run an inactive effect scope.`);
  1853. }
  1854. }
  1855. /**
  1856. * This should only be called on non-detached scopes
  1857. * @internal
  1858. */
  1859. on() {
  1860. activeEffectScope = this;
  1861. }
  1862. /**
  1863. * This should only be called on non-detached scopes
  1864. * @internal
  1865. */
  1866. off() {
  1867. activeEffectScope = this.parent;
  1868. }
  1869. stop(fromParent) {
  1870. if (this._active) {
  1871. let i2, l2;
  1872. for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
  1873. this.effects[i2].stop();
  1874. }
  1875. for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
  1876. this.cleanups[i2]();
  1877. }
  1878. if (this.scopes) {
  1879. for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
  1880. this.scopes[i2].stop(true);
  1881. }
  1882. }
  1883. if (!this.detached && this.parent && !fromParent) {
  1884. const last = this.parent.scopes.pop();
  1885. if (last && last !== this) {
  1886. this.parent.scopes[this.index] = last;
  1887. last.index = this.index;
  1888. }
  1889. }
  1890. this.parent = void 0;
  1891. this._active = false;
  1892. }
  1893. }
  1894. }
  1895. function recordEffectScope(effect, scope = activeEffectScope) {
  1896. if (scope && scope.active) {
  1897. scope.effects.push(effect);
  1898. }
  1899. }
  1900. function getCurrentScope() {
  1901. return activeEffectScope;
  1902. }
  1903. const createDep = (effects) => {
  1904. const dep = new Set(effects);
  1905. dep.w = 0;
  1906. dep.n = 0;
  1907. return dep;
  1908. };
  1909. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  1910. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  1911. const initDepMarkers = ({ deps }) => {
  1912. if (deps.length) {
  1913. for (let i2 = 0; i2 < deps.length; i2++) {
  1914. deps[i2].w |= trackOpBit;
  1915. }
  1916. }
  1917. };
  1918. const finalizeDepMarkers = (effect) => {
  1919. const { deps } = effect;
  1920. if (deps.length) {
  1921. let ptr = 0;
  1922. for (let i2 = 0; i2 < deps.length; i2++) {
  1923. const dep = deps[i2];
  1924. if (wasTracked(dep) && !newTracked(dep)) {
  1925. dep.delete(effect);
  1926. } else {
  1927. deps[ptr++] = dep;
  1928. }
  1929. dep.w &= ~trackOpBit;
  1930. dep.n &= ~trackOpBit;
  1931. }
  1932. deps.length = ptr;
  1933. }
  1934. };
  1935. const targetMap = /* @__PURE__ */ new WeakMap();
  1936. let effectTrackDepth = 0;
  1937. let trackOpBit = 1;
  1938. const maxMarkerBits = 30;
  1939. let activeEffect;
  1940. const ITERATE_KEY = Symbol("iterate");
  1941. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  1942. class ReactiveEffect {
  1943. constructor(fn, scheduler = null, scope) {
  1944. this.fn = fn;
  1945. this.scheduler = scheduler;
  1946. this.active = true;
  1947. this.deps = [];
  1948. this.parent = void 0;
  1949. recordEffectScope(this, scope);
  1950. }
  1951. run() {
  1952. if (!this.active) {
  1953. return this.fn();
  1954. }
  1955. let parent = activeEffect;
  1956. let lastShouldTrack = shouldTrack;
  1957. while (parent) {
  1958. if (parent === this) {
  1959. return;
  1960. }
  1961. parent = parent.parent;
  1962. }
  1963. try {
  1964. this.parent = activeEffect;
  1965. activeEffect = this;
  1966. shouldTrack = true;
  1967. trackOpBit = 1 << ++effectTrackDepth;
  1968. if (effectTrackDepth <= maxMarkerBits) {
  1969. initDepMarkers(this);
  1970. } else {
  1971. cleanupEffect(this);
  1972. }
  1973. return this.fn();
  1974. } finally {
  1975. if (effectTrackDepth <= maxMarkerBits) {
  1976. finalizeDepMarkers(this);
  1977. }
  1978. trackOpBit = 1 << --effectTrackDepth;
  1979. activeEffect = this.parent;
  1980. shouldTrack = lastShouldTrack;
  1981. this.parent = void 0;
  1982. if (this.deferStop) {
  1983. this.stop();
  1984. }
  1985. }
  1986. }
  1987. stop() {
  1988. if (activeEffect === this) {
  1989. this.deferStop = true;
  1990. } else if (this.active) {
  1991. cleanupEffect(this);
  1992. if (this.onStop) {
  1993. this.onStop();
  1994. }
  1995. this.active = false;
  1996. }
  1997. }
  1998. }
  1999. function cleanupEffect(effect) {
  2000. const { deps } = effect;
  2001. if (deps.length) {
  2002. for (let i2 = 0; i2 < deps.length; i2++) {
  2003. deps[i2].delete(effect);
  2004. }
  2005. deps.length = 0;
  2006. }
  2007. }
  2008. let shouldTrack = true;
  2009. const trackStack = [];
  2010. function pauseTracking() {
  2011. trackStack.push(shouldTrack);
  2012. shouldTrack = false;
  2013. }
  2014. function resetTracking() {
  2015. const last = trackStack.pop();
  2016. shouldTrack = last === void 0 ? true : last;
  2017. }
  2018. function track(target, type, key) {
  2019. if (shouldTrack && activeEffect) {
  2020. let depsMap = targetMap.get(target);
  2021. if (!depsMap) {
  2022. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  2023. }
  2024. let dep = depsMap.get(key);
  2025. if (!dep) {
  2026. depsMap.set(key, dep = createDep());
  2027. }
  2028. const eventInfo = { effect: activeEffect, target, type, key };
  2029. trackEffects(dep, eventInfo);
  2030. }
  2031. }
  2032. function trackEffects(dep, debuggerEventExtraInfo) {
  2033. let shouldTrack2 = false;
  2034. if (effectTrackDepth <= maxMarkerBits) {
  2035. if (!newTracked(dep)) {
  2036. dep.n |= trackOpBit;
  2037. shouldTrack2 = !wasTracked(dep);
  2038. }
  2039. } else {
  2040. shouldTrack2 = !dep.has(activeEffect);
  2041. }
  2042. if (shouldTrack2) {
  2043. dep.add(activeEffect);
  2044. activeEffect.deps.push(dep);
  2045. if (activeEffect.onTrack) {
  2046. activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
  2047. }
  2048. }
  2049. }
  2050. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  2051. const depsMap = targetMap.get(target);
  2052. if (!depsMap) {
  2053. return;
  2054. }
  2055. let deps = [];
  2056. if (type === "clear") {
  2057. deps = [...depsMap.values()];
  2058. } else if (key === "length" && isArray$1(target)) {
  2059. const newLength = Number(newValue);
  2060. depsMap.forEach((dep, key2) => {
  2061. if (key2 === "length" || key2 >= newLength) {
  2062. deps.push(dep);
  2063. }
  2064. });
  2065. } else {
  2066. if (key !== void 0) {
  2067. deps.push(depsMap.get(key));
  2068. }
  2069. switch (type) {
  2070. case "add":
  2071. if (!isArray$1(target)) {
  2072. deps.push(depsMap.get(ITERATE_KEY));
  2073. if (isMap(target)) {
  2074. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  2075. }
  2076. } else if (isIntegerKey(key)) {
  2077. deps.push(depsMap.get("length"));
  2078. }
  2079. break;
  2080. case "delete":
  2081. if (!isArray$1(target)) {
  2082. deps.push(depsMap.get(ITERATE_KEY));
  2083. if (isMap(target)) {
  2084. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  2085. }
  2086. }
  2087. break;
  2088. case "set":
  2089. if (isMap(target)) {
  2090. deps.push(depsMap.get(ITERATE_KEY));
  2091. }
  2092. break;
  2093. }
  2094. }
  2095. const eventInfo = { target, type, key, newValue, oldValue, oldTarget };
  2096. if (deps.length === 1) {
  2097. if (deps[0]) {
  2098. {
  2099. triggerEffects(deps[0], eventInfo);
  2100. }
  2101. }
  2102. } else {
  2103. const effects = [];
  2104. for (const dep of deps) {
  2105. if (dep) {
  2106. effects.push(...dep);
  2107. }
  2108. }
  2109. {
  2110. triggerEffects(createDep(effects), eventInfo);
  2111. }
  2112. }
  2113. }
  2114. function triggerEffects(dep, debuggerEventExtraInfo) {
  2115. const effects = isArray$1(dep) ? dep : [...dep];
  2116. for (const effect of effects) {
  2117. if (effect.computed) {
  2118. triggerEffect(effect, debuggerEventExtraInfo);
  2119. }
  2120. }
  2121. for (const effect of effects) {
  2122. if (!effect.computed) {
  2123. triggerEffect(effect, debuggerEventExtraInfo);
  2124. }
  2125. }
  2126. }
  2127. function triggerEffect(effect, debuggerEventExtraInfo) {
  2128. if (effect !== activeEffect || effect.allowRecurse) {
  2129. if (effect.onTrigger) {
  2130. effect.onTrigger(extend$1({ effect }, debuggerEventExtraInfo));
  2131. }
  2132. if (effect.scheduler) {
  2133. effect.scheduler();
  2134. } else {
  2135. effect.run();
  2136. }
  2137. }
  2138. }
  2139. function getDepFromReactive(object, key) {
  2140. var _a2;
  2141. return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key);
  2142. }
  2143. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  2144. const builtInSymbols = new Set(
  2145. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  2146. );
  2147. const get$1$1 = /* @__PURE__ */ createGetter();
  2148. const shallowGet = /* @__PURE__ */ createGetter(false, true);
  2149. const readonlyGet = /* @__PURE__ */ createGetter(true);
  2150. const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
  2151. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  2152. function createArrayInstrumentations() {
  2153. const instrumentations = {};
  2154. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  2155. instrumentations[key] = function(...args) {
  2156. const arr = toRaw(this);
  2157. for (let i2 = 0, l2 = this.length; i2 < l2; i2++) {
  2158. track(arr, "get", i2 + "");
  2159. }
  2160. const res = arr[key](...args);
  2161. if (res === -1 || res === false) {
  2162. return arr[key](...args.map(toRaw));
  2163. } else {
  2164. return res;
  2165. }
  2166. };
  2167. });
  2168. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  2169. instrumentations[key] = function(...args) {
  2170. pauseTracking();
  2171. const res = toRaw(this)[key].apply(this, args);
  2172. resetTracking();
  2173. return res;
  2174. };
  2175. });
  2176. return instrumentations;
  2177. }
  2178. function hasOwnProperty(key) {
  2179. const obj = toRaw(this);
  2180. track(obj, "has", key);
  2181. return obj.hasOwnProperty(key);
  2182. }
  2183. function createGetter(isReadonly2 = false, shallow = false) {
  2184. return function get2(target, key, receiver) {
  2185. if (key === "__v_isReactive") {
  2186. return !isReadonly2;
  2187. } else if (key === "__v_isReadonly") {
  2188. return isReadonly2;
  2189. } else if (key === "__v_isShallow") {
  2190. return shallow;
  2191. } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
  2192. return target;
  2193. }
  2194. const targetIsArray = isArray$1(target);
  2195. if (!isReadonly2) {
  2196. if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) {
  2197. return Reflect.get(arrayInstrumentations, key, receiver);
  2198. }
  2199. if (key === "hasOwnProperty") {
  2200. return hasOwnProperty;
  2201. }
  2202. }
  2203. const res = Reflect.get(target, key, receiver);
  2204. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  2205. return res;
  2206. }
  2207. if (!isReadonly2) {
  2208. track(target, "get", key);
  2209. }
  2210. if (shallow) {
  2211. return res;
  2212. }
  2213. if (isRef(res)) {
  2214. return targetIsArray && isIntegerKey(key) ? res : res.value;
  2215. }
  2216. if (isObject$2(res)) {
  2217. return isReadonly2 ? readonly(res) : reactive(res);
  2218. }
  2219. return res;
  2220. };
  2221. }
  2222. const set$1$1 = /* @__PURE__ */ createSetter();
  2223. const shallowSet = /* @__PURE__ */ createSetter(true);
  2224. function createSetter(shallow = false) {
  2225. return function set2(target, key, value, receiver) {
  2226. let oldValue = target[key];
  2227. if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
  2228. return false;
  2229. }
  2230. if (!shallow) {
  2231. if (!isShallow(value) && !isReadonly(value)) {
  2232. oldValue = toRaw(oldValue);
  2233. value = toRaw(value);
  2234. }
  2235. if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) {
  2236. oldValue.value = value;
  2237. return true;
  2238. }
  2239. }
  2240. const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
  2241. const result = Reflect.set(target, key, value, receiver);
  2242. if (target === toRaw(receiver)) {
  2243. if (!hadKey) {
  2244. trigger(target, "add", key, value);
  2245. } else if (hasChanged(value, oldValue)) {
  2246. trigger(target, "set", key, value, oldValue);
  2247. }
  2248. }
  2249. return result;
  2250. };
  2251. }
  2252. function deleteProperty(target, key) {
  2253. const hadKey = hasOwn$1(target, key);
  2254. const oldValue = target[key];
  2255. const result = Reflect.deleteProperty(target, key);
  2256. if (result && hadKey) {
  2257. trigger(target, "delete", key, void 0, oldValue);
  2258. }
  2259. return result;
  2260. }
  2261. function has$1(target, key) {
  2262. const result = Reflect.has(target, key);
  2263. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  2264. track(target, "has", key);
  2265. }
  2266. return result;
  2267. }
  2268. function ownKeys(target) {
  2269. track(target, "iterate", isArray$1(target) ? "length" : ITERATE_KEY);
  2270. return Reflect.ownKeys(target);
  2271. }
  2272. const mutableHandlers = {
  2273. get: get$1$1,
  2274. set: set$1$1,
  2275. deleteProperty,
  2276. has: has$1,
  2277. ownKeys
  2278. };
  2279. const readonlyHandlers = {
  2280. get: readonlyGet,
  2281. set(target, key) {
  2282. {
  2283. warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
  2284. }
  2285. return true;
  2286. },
  2287. deleteProperty(target, key) {
  2288. {
  2289. warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
  2290. }
  2291. return true;
  2292. }
  2293. };
  2294. const shallowReactiveHandlers = /* @__PURE__ */ extend$1({}, mutableHandlers, {
  2295. get: shallowGet,
  2296. set: shallowSet
  2297. });
  2298. const shallowReadonlyHandlers = /* @__PURE__ */ extend$1({}, readonlyHandlers, {
  2299. get: shallowReadonlyGet
  2300. });
  2301. const toShallow = (value) => value;
  2302. const getProto = (v2) => Reflect.getPrototypeOf(v2);
  2303. function get$3(target, key, isReadonly2 = false, isShallow2 = false) {
  2304. target = target[
  2305. "__v_raw"
  2306. /* ReactiveFlags.RAW */
  2307. ];
  2308. const rawTarget = toRaw(target);
  2309. const rawKey = toRaw(key);
  2310. if (!isReadonly2) {
  2311. if (key !== rawKey) {
  2312. track(rawTarget, "get", key);
  2313. }
  2314. track(rawTarget, "get", rawKey);
  2315. }
  2316. const { has: has2 } = getProto(rawTarget);
  2317. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2318. if (has2.call(rawTarget, key)) {
  2319. return wrap(target.get(key));
  2320. } else if (has2.call(rawTarget, rawKey)) {
  2321. return wrap(target.get(rawKey));
  2322. } else if (target !== rawTarget) {
  2323. target.get(key);
  2324. }
  2325. }
  2326. function has(key, isReadonly2 = false) {
  2327. const target = this[
  2328. "__v_raw"
  2329. /* ReactiveFlags.RAW */
  2330. ];
  2331. const rawTarget = toRaw(target);
  2332. const rawKey = toRaw(key);
  2333. if (!isReadonly2) {
  2334. if (key !== rawKey) {
  2335. track(rawTarget, "has", key);
  2336. }
  2337. track(rawTarget, "has", rawKey);
  2338. }
  2339. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  2340. }
  2341. function size(target, isReadonly2 = false) {
  2342. target = target[
  2343. "__v_raw"
  2344. /* ReactiveFlags.RAW */
  2345. ];
  2346. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  2347. return Reflect.get(target, "size", target);
  2348. }
  2349. function add$2(value) {
  2350. value = toRaw(value);
  2351. const target = toRaw(this);
  2352. const proto2 = getProto(target);
  2353. const hadKey = proto2.has.call(target, value);
  2354. if (!hadKey) {
  2355. target.add(value);
  2356. trigger(target, "add", value, value);
  2357. }
  2358. return this;
  2359. }
  2360. function set$2(key, value) {
  2361. value = toRaw(value);
  2362. const target = toRaw(this);
  2363. const { has: has2, get: get2 } = getProto(target);
  2364. let hadKey = has2.call(target, key);
  2365. if (!hadKey) {
  2366. key = toRaw(key);
  2367. hadKey = has2.call(target, key);
  2368. } else {
  2369. checkIdentityKeys(target, has2, key);
  2370. }
  2371. const oldValue = get2.call(target, key);
  2372. target.set(key, value);
  2373. if (!hadKey) {
  2374. trigger(target, "add", key, value);
  2375. } else if (hasChanged(value, oldValue)) {
  2376. trigger(target, "set", key, value, oldValue);
  2377. }
  2378. return this;
  2379. }
  2380. function deleteEntry(key) {
  2381. const target = toRaw(this);
  2382. const { has: has2, get: get2 } = getProto(target);
  2383. let hadKey = has2.call(target, key);
  2384. if (!hadKey) {
  2385. key = toRaw(key);
  2386. hadKey = has2.call(target, key);
  2387. } else {
  2388. checkIdentityKeys(target, has2, key);
  2389. }
  2390. const oldValue = get2 ? get2.call(target, key) : void 0;
  2391. const result = target.delete(key);
  2392. if (hadKey) {
  2393. trigger(target, "delete", key, void 0, oldValue);
  2394. }
  2395. return result;
  2396. }
  2397. function clear() {
  2398. const target = toRaw(this);
  2399. const hadItems = target.size !== 0;
  2400. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  2401. const result = target.clear();
  2402. if (hadItems) {
  2403. trigger(target, "clear", void 0, void 0, oldTarget);
  2404. }
  2405. return result;
  2406. }
  2407. function createForEach(isReadonly2, isShallow2) {
  2408. return function forEach(callback, thisArg) {
  2409. const observed = this;
  2410. const target = observed[
  2411. "__v_raw"
  2412. /* ReactiveFlags.RAW */
  2413. ];
  2414. const rawTarget = toRaw(target);
  2415. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2416. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  2417. return target.forEach((value, key) => {
  2418. return callback.call(thisArg, wrap(value), wrap(key), observed);
  2419. });
  2420. };
  2421. }
  2422. function createIterableMethod(method, isReadonly2, isShallow2) {
  2423. return function(...args) {
  2424. const target = this[
  2425. "__v_raw"
  2426. /* ReactiveFlags.RAW */
  2427. ];
  2428. const rawTarget = toRaw(target);
  2429. const targetIsMap = isMap(rawTarget);
  2430. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  2431. const isKeyOnly = method === "keys" && targetIsMap;
  2432. const innerIterator = target[method](...args);
  2433. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2434. !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
  2435. return {
  2436. // iterator protocol
  2437. next() {
  2438. const { value, done } = innerIterator.next();
  2439. return done ? { value, done } : {
  2440. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  2441. done
  2442. };
  2443. },
  2444. // iterable protocol
  2445. [Symbol.iterator]() {
  2446. return this;
  2447. }
  2448. };
  2449. };
  2450. }
  2451. function createReadonlyMethod(type) {
  2452. return function(...args) {
  2453. {
  2454. const key = args[0] ? `on key "${args[0]}" ` : ``;
  2455. console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
  2456. }
  2457. return type === "delete" ? false : this;
  2458. };
  2459. }
  2460. function createInstrumentations() {
  2461. const mutableInstrumentations2 = {
  2462. get(key) {
  2463. return get$3(this, key);
  2464. },
  2465. get size() {
  2466. return size(this);
  2467. },
  2468. has,
  2469. add: add$2,
  2470. set: set$2,
  2471. delete: deleteEntry,
  2472. clear,
  2473. forEach: createForEach(false, false)
  2474. };
  2475. const shallowInstrumentations2 = {
  2476. get(key) {
  2477. return get$3(this, key, false, true);
  2478. },
  2479. get size() {
  2480. return size(this);
  2481. },
  2482. has,
  2483. add: add$2,
  2484. set: set$2,
  2485. delete: deleteEntry,
  2486. clear,
  2487. forEach: createForEach(false, true)
  2488. };
  2489. const readonlyInstrumentations2 = {
  2490. get(key) {
  2491. return get$3(this, key, true);
  2492. },
  2493. get size() {
  2494. return size(this, true);
  2495. },
  2496. has(key) {
  2497. return has.call(this, key, true);
  2498. },
  2499. add: createReadonlyMethod(
  2500. "add"
  2501. /* TriggerOpTypes.ADD */
  2502. ),
  2503. set: createReadonlyMethod(
  2504. "set"
  2505. /* TriggerOpTypes.SET */
  2506. ),
  2507. delete: createReadonlyMethod(
  2508. "delete"
  2509. /* TriggerOpTypes.DELETE */
  2510. ),
  2511. clear: createReadonlyMethod(
  2512. "clear"
  2513. /* TriggerOpTypes.CLEAR */
  2514. ),
  2515. forEach: createForEach(true, false)
  2516. };
  2517. const shallowReadonlyInstrumentations2 = {
  2518. get(key) {
  2519. return get$3(this, key, true, true);
  2520. },
  2521. get size() {
  2522. return size(this, true);
  2523. },
  2524. has(key) {
  2525. return has.call(this, key, true);
  2526. },
  2527. add: createReadonlyMethod(
  2528. "add"
  2529. /* TriggerOpTypes.ADD */
  2530. ),
  2531. set: createReadonlyMethod(
  2532. "set"
  2533. /* TriggerOpTypes.SET */
  2534. ),
  2535. delete: createReadonlyMethod(
  2536. "delete"
  2537. /* TriggerOpTypes.DELETE */
  2538. ),
  2539. clear: createReadonlyMethod(
  2540. "clear"
  2541. /* TriggerOpTypes.CLEAR */
  2542. ),
  2543. forEach: createForEach(true, true)
  2544. };
  2545. const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
  2546. iteratorMethods.forEach((method) => {
  2547. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  2548. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  2549. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  2550. shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
  2551. });
  2552. return [
  2553. mutableInstrumentations2,
  2554. readonlyInstrumentations2,
  2555. shallowInstrumentations2,
  2556. shallowReadonlyInstrumentations2
  2557. ];
  2558. }
  2559. const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
  2560. function createInstrumentationGetter(isReadonly2, shallow) {
  2561. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  2562. return (target, key, receiver) => {
  2563. if (key === "__v_isReactive") {
  2564. return !isReadonly2;
  2565. } else if (key === "__v_isReadonly") {
  2566. return isReadonly2;
  2567. } else if (key === "__v_raw") {
  2568. return target;
  2569. }
  2570. return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
  2571. };
  2572. }
  2573. const mutableCollectionHandlers = {
  2574. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  2575. };
  2576. const shallowCollectionHandlers = {
  2577. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  2578. };
  2579. const readonlyCollectionHandlers = {
  2580. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  2581. };
  2582. const shallowReadonlyCollectionHandlers = {
  2583. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  2584. };
  2585. function checkIdentityKeys(target, has2, key) {
  2586. const rawKey = toRaw(key);
  2587. if (rawKey !== key && has2.call(target, rawKey)) {
  2588. const type = toRawType(target);
  2589. console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
  2590. }
  2591. }
  2592. const reactiveMap = /* @__PURE__ */ new WeakMap();
  2593. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  2594. const readonlyMap = /* @__PURE__ */ new WeakMap();
  2595. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  2596. function targetTypeMap(rawType) {
  2597. switch (rawType) {
  2598. case "Object":
  2599. case "Array":
  2600. return 1;
  2601. case "Map":
  2602. case "Set":
  2603. case "WeakMap":
  2604. case "WeakSet":
  2605. return 2;
  2606. default:
  2607. return 0;
  2608. }
  2609. }
  2610. function getTargetType(value) {
  2611. return value[
  2612. "__v_skip"
  2613. /* ReactiveFlags.SKIP */
  2614. ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  2615. }
  2616. function reactive(target) {
  2617. if (isReadonly(target)) {
  2618. return target;
  2619. }
  2620. return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
  2621. }
  2622. function shallowReactive(target) {
  2623. return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
  2624. }
  2625. function readonly(target) {
  2626. return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
  2627. }
  2628. function shallowReadonly(target) {
  2629. return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
  2630. }
  2631. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  2632. if (!isObject$2(target)) {
  2633. {
  2634. console.warn(`value cannot be made reactive: ${String(target)}`);
  2635. }
  2636. return target;
  2637. }
  2638. if (target[
  2639. "__v_raw"
  2640. /* ReactiveFlags.RAW */
  2641. ] && !(isReadonly2 && target[
  2642. "__v_isReactive"
  2643. /* ReactiveFlags.IS_REACTIVE */
  2644. ])) {
  2645. return target;
  2646. }
  2647. const existingProxy = proxyMap.get(target);
  2648. if (existingProxy) {
  2649. return existingProxy;
  2650. }
  2651. const targetType = getTargetType(target);
  2652. if (targetType === 0) {
  2653. return target;
  2654. }
  2655. const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
  2656. proxyMap.set(target, proxy);
  2657. return proxy;
  2658. }
  2659. function isReactive(value) {
  2660. if (isReadonly(value)) {
  2661. return isReactive(value[
  2662. "__v_raw"
  2663. /* ReactiveFlags.RAW */
  2664. ]);
  2665. }
  2666. return !!(value && value[
  2667. "__v_isReactive"
  2668. /* ReactiveFlags.IS_REACTIVE */
  2669. ]);
  2670. }
  2671. function isReadonly(value) {
  2672. return !!(value && value[
  2673. "__v_isReadonly"
  2674. /* ReactiveFlags.IS_READONLY */
  2675. ]);
  2676. }
  2677. function isShallow(value) {
  2678. return !!(value && value[
  2679. "__v_isShallow"
  2680. /* ReactiveFlags.IS_SHALLOW */
  2681. ]);
  2682. }
  2683. function isProxy(value) {
  2684. return isReactive(value) || isReadonly(value);
  2685. }
  2686. function toRaw(observed) {
  2687. const raw = observed && observed[
  2688. "__v_raw"
  2689. /* ReactiveFlags.RAW */
  2690. ];
  2691. return raw ? toRaw(raw) : observed;
  2692. }
  2693. function markRaw(value) {
  2694. def(value, "__v_skip", true);
  2695. return value;
  2696. }
  2697. const toReactive = (value) => isObject$2(value) ? reactive(value) : value;
  2698. const toReadonly = (value) => isObject$2(value) ? readonly(value) : value;
  2699. function trackRefValue(ref2) {
  2700. if (shouldTrack && activeEffect) {
  2701. ref2 = toRaw(ref2);
  2702. {
  2703. trackEffects(ref2.dep || (ref2.dep = createDep()), {
  2704. target: ref2,
  2705. type: "get",
  2706. key: "value"
  2707. });
  2708. }
  2709. }
  2710. }
  2711. function triggerRefValue(ref2, newVal) {
  2712. ref2 = toRaw(ref2);
  2713. const dep = ref2.dep;
  2714. if (dep) {
  2715. {
  2716. triggerEffects(dep, {
  2717. target: ref2,
  2718. type: "set",
  2719. key: "value",
  2720. newValue: newVal
  2721. });
  2722. }
  2723. }
  2724. }
  2725. function isRef(r2) {
  2726. return !!(r2 && r2.__v_isRef === true);
  2727. }
  2728. function ref(value) {
  2729. return createRef(value, false);
  2730. }
  2731. function createRef(rawValue, shallow) {
  2732. if (isRef(rawValue)) {
  2733. return rawValue;
  2734. }
  2735. return new RefImpl(rawValue, shallow);
  2736. }
  2737. class RefImpl {
  2738. constructor(value, __v_isShallow) {
  2739. this.__v_isShallow = __v_isShallow;
  2740. this.dep = void 0;
  2741. this.__v_isRef = true;
  2742. this._rawValue = __v_isShallow ? value : toRaw(value);
  2743. this._value = __v_isShallow ? value : toReactive(value);
  2744. }
  2745. get value() {
  2746. trackRefValue(this);
  2747. return this._value;
  2748. }
  2749. set value(newVal) {
  2750. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  2751. newVal = useDirectValue ? newVal : toRaw(newVal);
  2752. if (hasChanged(newVal, this._rawValue)) {
  2753. this._rawValue = newVal;
  2754. this._value = useDirectValue ? newVal : toReactive(newVal);
  2755. triggerRefValue(this, newVal);
  2756. }
  2757. }
  2758. }
  2759. function unref(ref2) {
  2760. return isRef(ref2) ? ref2.value : ref2;
  2761. }
  2762. const shallowUnwrapHandlers = {
  2763. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  2764. set: (target, key, value, receiver) => {
  2765. const oldValue = target[key];
  2766. if (isRef(oldValue) && !isRef(value)) {
  2767. oldValue.value = value;
  2768. return true;
  2769. } else {
  2770. return Reflect.set(target, key, value, receiver);
  2771. }
  2772. }
  2773. };
  2774. function proxyRefs(objectWithRefs) {
  2775. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  2776. }
  2777. function toRefs(object) {
  2778. if (!isProxy(object)) {
  2779. console.warn(`toRefs() expects a reactive object but received a plain one.`);
  2780. }
  2781. const ret = isArray$1(object) ? new Array(object.length) : {};
  2782. for (const key in object) {
  2783. ret[key] = toRef(object, key);
  2784. }
  2785. return ret;
  2786. }
  2787. class ObjectRefImpl {
  2788. constructor(_object, _key, _defaultValue) {
  2789. this._object = _object;
  2790. this._key = _key;
  2791. this._defaultValue = _defaultValue;
  2792. this.__v_isRef = true;
  2793. }
  2794. get value() {
  2795. const val = this._object[this._key];
  2796. return val === void 0 ? this._defaultValue : val;
  2797. }
  2798. set value(newVal) {
  2799. this._object[this._key] = newVal;
  2800. }
  2801. get dep() {
  2802. return getDepFromReactive(toRaw(this._object), this._key);
  2803. }
  2804. }
  2805. function toRef(object, key, defaultValue) {
  2806. const val = object[key];
  2807. return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
  2808. }
  2809. var _a;
  2810. class ComputedRefImpl {
  2811. constructor(getter, _setter, isReadonly2, isSSR) {
  2812. this._setter = _setter;
  2813. this.dep = void 0;
  2814. this.__v_isRef = true;
  2815. this[_a] = false;
  2816. this._dirty = true;
  2817. this.effect = new ReactiveEffect(getter, () => {
  2818. if (!this._dirty) {
  2819. this._dirty = true;
  2820. triggerRefValue(this);
  2821. }
  2822. });
  2823. this.effect.computed = this;
  2824. this.effect.active = this._cacheable = !isSSR;
  2825. this[
  2826. "__v_isReadonly"
  2827. /* ReactiveFlags.IS_READONLY */
  2828. ] = isReadonly2;
  2829. }
  2830. get value() {
  2831. const self = toRaw(this);
  2832. trackRefValue(self);
  2833. if (self._dirty || !self._cacheable) {
  2834. self._dirty = false;
  2835. self._value = self.effect.run();
  2836. }
  2837. return self._value;
  2838. }
  2839. set value(newValue) {
  2840. this._setter(newValue);
  2841. }
  2842. }
  2843. _a = "__v_isReadonly";
  2844. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  2845. let getter;
  2846. let setter;
  2847. const onlyGetter = isFunction$1(getterOrOptions);
  2848. if (onlyGetter) {
  2849. getter = getterOrOptions;
  2850. setter = () => {
  2851. console.warn("Write operation failed: computed value is readonly");
  2852. };
  2853. } else {
  2854. getter = getterOrOptions.get;
  2855. setter = getterOrOptions.set;
  2856. }
  2857. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  2858. if (debugOptions && !isSSR) {
  2859. cRef.effect.onTrack = debugOptions.onTrack;
  2860. cRef.effect.onTrigger = debugOptions.onTrigger;
  2861. }
  2862. return cRef;
  2863. }
  2864. const stack = [];
  2865. function pushWarningContext(vnode) {
  2866. stack.push(vnode);
  2867. }
  2868. function popWarningContext() {
  2869. stack.pop();
  2870. }
  2871. function warn$2(msg, ...args) {
  2872. pauseTracking();
  2873. const instance = stack.length ? stack[stack.length - 1].component : null;
  2874. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2875. const trace = getComponentTrace();
  2876. if (appWarnHandler) {
  2877. callWithErrorHandling(appWarnHandler, instance, 11, [
  2878. msg + args.join(""),
  2879. instance && instance.proxy,
  2880. trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
  2881. trace
  2882. ]);
  2883. } else {
  2884. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2885. if (trace.length && // avoid spamming console during tests
  2886. true) {
  2887. warnArgs.push(`
  2888. `, ...formatTrace(trace));
  2889. }
  2890. console.warn(...warnArgs);
  2891. }
  2892. resetTracking();
  2893. }
  2894. function getComponentTrace() {
  2895. let currentVNode = stack[stack.length - 1];
  2896. if (!currentVNode) {
  2897. return [];
  2898. }
  2899. const normalizedStack = [];
  2900. while (currentVNode) {
  2901. const last = normalizedStack[0];
  2902. if (last && last.vnode === currentVNode) {
  2903. last.recurseCount++;
  2904. } else {
  2905. normalizedStack.push({
  2906. vnode: currentVNode,
  2907. recurseCount: 0
  2908. });
  2909. }
  2910. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2911. currentVNode = parentInstance && parentInstance.vnode;
  2912. }
  2913. return normalizedStack;
  2914. }
  2915. function formatTrace(trace) {
  2916. const logs = [];
  2917. trace.forEach((entry, i2) => {
  2918. logs.push(...i2 === 0 ? [] : [`
  2919. `], ...formatTraceEntry(entry));
  2920. });
  2921. return logs;
  2922. }
  2923. function formatTraceEntry({ vnode, recurseCount }) {
  2924. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2925. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2926. const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
  2927. const close = `>` + postfix;
  2928. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2929. }
  2930. function formatProps(props) {
  2931. const res = [];
  2932. const keys2 = Object.keys(props);
  2933. keys2.slice(0, 3).forEach((key) => {
  2934. res.push(...formatProp(key, props[key]));
  2935. });
  2936. if (keys2.length > 3) {
  2937. res.push(` ...`);
  2938. }
  2939. return res;
  2940. }
  2941. function formatProp(key, value, raw) {
  2942. if (isString$1(value)) {
  2943. value = JSON.stringify(value);
  2944. return raw ? value : [`${key}=${value}`];
  2945. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2946. return raw ? value : [`${key}=${value}`];
  2947. } else if (isRef(value)) {
  2948. value = formatProp(key, toRaw(value.value), true);
  2949. return raw ? value : [`${key}=Ref<`, value, `>`];
  2950. } else if (isFunction$1(value)) {
  2951. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2952. } else {
  2953. value = toRaw(value);
  2954. return raw ? value : [`${key}=`, value];
  2955. }
  2956. }
  2957. const ErrorTypeStrings = {
  2958. [
  2959. "sp"
  2960. /* LifecycleHooks.SERVER_PREFETCH */
  2961. ]: "serverPrefetch hook",
  2962. [
  2963. "bc"
  2964. /* LifecycleHooks.BEFORE_CREATE */
  2965. ]: "beforeCreate hook",
  2966. [
  2967. "c"
  2968. /* LifecycleHooks.CREATED */
  2969. ]: "created hook",
  2970. [
  2971. "bm"
  2972. /* LifecycleHooks.BEFORE_MOUNT */
  2973. ]: "beforeMount hook",
  2974. [
  2975. "m"
  2976. /* LifecycleHooks.MOUNTED */
  2977. ]: "mounted hook",
  2978. [
  2979. "bu"
  2980. /* LifecycleHooks.BEFORE_UPDATE */
  2981. ]: "beforeUpdate hook",
  2982. [
  2983. "u"
  2984. /* LifecycleHooks.UPDATED */
  2985. ]: "updated",
  2986. [
  2987. "bum"
  2988. /* LifecycleHooks.BEFORE_UNMOUNT */
  2989. ]: "beforeUnmount hook",
  2990. [
  2991. "um"
  2992. /* LifecycleHooks.UNMOUNTED */
  2993. ]: "unmounted hook",
  2994. [
  2995. "a"
  2996. /* LifecycleHooks.ACTIVATED */
  2997. ]: "activated hook",
  2998. [
  2999. "da"
  3000. /* LifecycleHooks.DEACTIVATED */
  3001. ]: "deactivated hook",
  3002. [
  3003. "ec"
  3004. /* LifecycleHooks.ERROR_CAPTURED */
  3005. ]: "errorCaptured hook",
  3006. [
  3007. "rtc"
  3008. /* LifecycleHooks.RENDER_TRACKED */
  3009. ]: "renderTracked hook",
  3010. [
  3011. "rtg"
  3012. /* LifecycleHooks.RENDER_TRIGGERED */
  3013. ]: "renderTriggered hook",
  3014. [
  3015. 0
  3016. /* ErrorCodes.SETUP_FUNCTION */
  3017. ]: "setup function",
  3018. [
  3019. 1
  3020. /* ErrorCodes.RENDER_FUNCTION */
  3021. ]: "render function",
  3022. [
  3023. 2
  3024. /* ErrorCodes.WATCH_GETTER */
  3025. ]: "watcher getter",
  3026. [
  3027. 3
  3028. /* ErrorCodes.WATCH_CALLBACK */
  3029. ]: "watcher callback",
  3030. [
  3031. 4
  3032. /* ErrorCodes.WATCH_CLEANUP */
  3033. ]: "watcher cleanup function",
  3034. [
  3035. 5
  3036. /* ErrorCodes.NATIVE_EVENT_HANDLER */
  3037. ]: "native event handler",
  3038. [
  3039. 6
  3040. /* ErrorCodes.COMPONENT_EVENT_HANDLER */
  3041. ]: "component event handler",
  3042. [
  3043. 7
  3044. /* ErrorCodes.VNODE_HOOK */
  3045. ]: "vnode hook",
  3046. [
  3047. 8
  3048. /* ErrorCodes.DIRECTIVE_HOOK */
  3049. ]: "directive hook",
  3050. [
  3051. 9
  3052. /* ErrorCodes.TRANSITION_HOOK */
  3053. ]: "transition hook",
  3054. [
  3055. 10
  3056. /* ErrorCodes.APP_ERROR_HANDLER */
  3057. ]: "app errorHandler",
  3058. [
  3059. 11
  3060. /* ErrorCodes.APP_WARN_HANDLER */
  3061. ]: "app warnHandler",
  3062. [
  3063. 12
  3064. /* ErrorCodes.FUNCTION_REF */
  3065. ]: "ref function",
  3066. [
  3067. 13
  3068. /* ErrorCodes.ASYNC_COMPONENT_LOADER */
  3069. ]: "async component loader",
  3070. [
  3071. 14
  3072. /* ErrorCodes.SCHEDULER */
  3073. ]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
  3074. };
  3075. function callWithErrorHandling(fn, instance, type, args) {
  3076. let res;
  3077. try {
  3078. res = args ? fn(...args) : fn();
  3079. } catch (err) {
  3080. handleError(err, instance, type);
  3081. }
  3082. return res;
  3083. }
  3084. function callWithAsyncErrorHandling(fn, instance, type, args) {
  3085. if (isFunction$1(fn)) {
  3086. const res = callWithErrorHandling(fn, instance, type, args);
  3087. if (res && isPromise(res)) {
  3088. res.catch((err) => {
  3089. handleError(err, instance, type);
  3090. });
  3091. }
  3092. return res;
  3093. }
  3094. const values = [];
  3095. for (let i2 = 0; i2 < fn.length; i2++) {
  3096. values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
  3097. }
  3098. return values;
  3099. }
  3100. function handleError(err, instance, type, throwInDev = true) {
  3101. const contextVNode = instance ? instance.vnode : null;
  3102. if (instance) {
  3103. let cur = instance.parent;
  3104. const exposedInstance = instance.proxy;
  3105. const errorInfo = ErrorTypeStrings[type] || type;
  3106. while (cur) {
  3107. const errorCapturedHooks = cur.ec;
  3108. if (errorCapturedHooks) {
  3109. for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
  3110. if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
  3111. return;
  3112. }
  3113. }
  3114. }
  3115. cur = cur.parent;
  3116. }
  3117. const appErrorHandler = instance.appContext.config.errorHandler;
  3118. if (appErrorHandler) {
  3119. callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
  3120. return;
  3121. }
  3122. }
  3123. logError(err, type, contextVNode, throwInDev);
  3124. }
  3125. function logError(err, type, contextVNode, throwInDev = true) {
  3126. {
  3127. const info = ErrorTypeStrings[type] || type;
  3128. if (contextVNode) {
  3129. pushWarningContext(contextVNode);
  3130. }
  3131. warn$2(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  3132. if (contextVNode) {
  3133. popWarningContext();
  3134. }
  3135. if (throwInDev) {
  3136. console.error(err);
  3137. } else {
  3138. console.error(err);
  3139. }
  3140. }
  3141. }
  3142. let isFlushing = false;
  3143. let isFlushPending = false;
  3144. const queue = [];
  3145. let flushIndex = 0;
  3146. const pendingPostFlushCbs = [];
  3147. let activePostFlushCbs = null;
  3148. let postFlushIndex = 0;
  3149. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  3150. let currentFlushPromise = null;
  3151. const RECURSION_LIMIT = 100;
  3152. function nextTick$1(fn) {
  3153. const p2 = currentFlushPromise || resolvedPromise;
  3154. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  3155. }
  3156. function findInsertionIndex(id) {
  3157. let start = flushIndex + 1;
  3158. let end = queue.length;
  3159. while (start < end) {
  3160. const middle = start + end >>> 1;
  3161. const middleJobId = getId(queue[middle]);
  3162. middleJobId < id ? start = middle + 1 : end = middle;
  3163. }
  3164. return start;
  3165. }
  3166. function queueJob(job) {
  3167. if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
  3168. if (job.id == null) {
  3169. queue.push(job);
  3170. } else {
  3171. queue.splice(findInsertionIndex(job.id), 0, job);
  3172. }
  3173. queueFlush();
  3174. }
  3175. }
  3176. function queueFlush() {
  3177. if (!isFlushing && !isFlushPending) {
  3178. isFlushPending = true;
  3179. currentFlushPromise = resolvedPromise.then(flushJobs);
  3180. }
  3181. }
  3182. function hasQueueJob(job) {
  3183. return queue.indexOf(job) > -1;
  3184. }
  3185. function invalidateJob(job) {
  3186. const i2 = queue.indexOf(job);
  3187. if (i2 > flushIndex) {
  3188. queue.splice(i2, 1);
  3189. }
  3190. }
  3191. function queuePostFlushCb(cb) {
  3192. if (!isArray$1(cb)) {
  3193. if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
  3194. pendingPostFlushCbs.push(cb);
  3195. }
  3196. } else {
  3197. pendingPostFlushCbs.push(...cb);
  3198. }
  3199. queueFlush();
  3200. }
  3201. function flushPreFlushCbs(seen, i2 = isFlushing ? flushIndex + 1 : 0) {
  3202. {
  3203. seen = seen || /* @__PURE__ */ new Map();
  3204. }
  3205. for (; i2 < queue.length; i2++) {
  3206. const cb = queue[i2];
  3207. if (cb && cb.pre) {
  3208. if (checkRecursiveUpdates(seen, cb)) {
  3209. continue;
  3210. }
  3211. queue.splice(i2, 1);
  3212. i2--;
  3213. cb();
  3214. }
  3215. }
  3216. }
  3217. function flushPostFlushCbs(seen) {
  3218. if (pendingPostFlushCbs.length) {
  3219. const deduped = [...new Set(pendingPostFlushCbs)];
  3220. pendingPostFlushCbs.length = 0;
  3221. if (activePostFlushCbs) {
  3222. activePostFlushCbs.push(...deduped);
  3223. return;
  3224. }
  3225. activePostFlushCbs = deduped;
  3226. {
  3227. seen = seen || /* @__PURE__ */ new Map();
  3228. }
  3229. activePostFlushCbs.sort((a2, b2) => getId(a2) - getId(b2));
  3230. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  3231. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  3232. continue;
  3233. }
  3234. activePostFlushCbs[postFlushIndex]();
  3235. }
  3236. activePostFlushCbs = null;
  3237. postFlushIndex = 0;
  3238. }
  3239. }
  3240. const getId = (job) => job.id == null ? Infinity : job.id;
  3241. const comparator = (a2, b2) => {
  3242. const diff2 = getId(a2) - getId(b2);
  3243. if (diff2 === 0) {
  3244. if (a2.pre && !b2.pre)
  3245. return -1;
  3246. if (b2.pre && !a2.pre)
  3247. return 1;
  3248. }
  3249. return diff2;
  3250. };
  3251. function flushJobs(seen) {
  3252. isFlushPending = false;
  3253. isFlushing = true;
  3254. {
  3255. seen = seen || /* @__PURE__ */ new Map();
  3256. }
  3257. queue.sort(comparator);
  3258. const check = (job) => checkRecursiveUpdates(seen, job);
  3259. try {
  3260. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  3261. const job = queue[flushIndex];
  3262. if (job && job.active !== false) {
  3263. if (check(job)) {
  3264. continue;
  3265. }
  3266. callWithErrorHandling(
  3267. job,
  3268. null,
  3269. 14
  3270. /* ErrorCodes.SCHEDULER */
  3271. );
  3272. }
  3273. }
  3274. } finally {
  3275. flushIndex = 0;
  3276. queue.length = 0;
  3277. flushPostFlushCbs(seen);
  3278. isFlushing = false;
  3279. currentFlushPromise = null;
  3280. if (queue.length || pendingPostFlushCbs.length) {
  3281. flushJobs(seen);
  3282. }
  3283. }
  3284. }
  3285. function checkRecursiveUpdates(seen, fn) {
  3286. if (!seen.has(fn)) {
  3287. seen.set(fn, 1);
  3288. } else {
  3289. const count = seen.get(fn);
  3290. if (count > RECURSION_LIMIT) {
  3291. const instance = fn.ownerInstance;
  3292. const componentName = instance && getComponentName(instance.type);
  3293. warn$2(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`);
  3294. return true;
  3295. } else {
  3296. seen.set(fn, count + 1);
  3297. }
  3298. }
  3299. }
  3300. let devtools;
  3301. let buffer = [];
  3302. let devtoolsNotInstalled = false;
  3303. function emit$1(event, ...args) {
  3304. if (devtools) {
  3305. devtools.emit(event, ...args);
  3306. } else if (!devtoolsNotInstalled) {
  3307. buffer.push({ event, args });
  3308. }
  3309. }
  3310. function setDevtoolsHook(hook, target) {
  3311. var _a2, _b;
  3312. devtools = hook;
  3313. if (devtools) {
  3314. devtools.enabled = true;
  3315. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  3316. buffer = [];
  3317. } else if (
  3318. // handle late devtools injection - only do this if we are in an actual
  3319. // browser environment to avoid the timer handle stalling test runner exit
  3320. // (#4815)
  3321. typeof window !== "undefined" && // some envs mock window but not fully
  3322. // eslint-disable-next-line no-restricted-globals
  3323. window.HTMLElement && // also exclude jsdom
  3324. // eslint-disable-next-line no-restricted-globals
  3325. !((_b = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b === void 0 ? void 0 : _b.includes("jsdom"))
  3326. ) {
  3327. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  3328. replay.push((newHook) => {
  3329. setDevtoolsHook(newHook, target);
  3330. });
  3331. setTimeout(() => {
  3332. if (!devtools) {
  3333. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  3334. devtoolsNotInstalled = true;
  3335. buffer = [];
  3336. }
  3337. }, 3e3);
  3338. } else {
  3339. devtoolsNotInstalled = true;
  3340. buffer = [];
  3341. }
  3342. }
  3343. function devtoolsInitApp(app, version2) {
  3344. emit$1("app:init", app, version2, {
  3345. Fragment,
  3346. Text,
  3347. Comment,
  3348. Static
  3349. });
  3350. }
  3351. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  3352. "component:added"
  3353. /* DevtoolsHooks.COMPONENT_ADDED */
  3354. );
  3355. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
  3356. "component:updated"
  3357. /* DevtoolsHooks.COMPONENT_UPDATED */
  3358. );
  3359. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  3360. "component:removed"
  3361. /* DevtoolsHooks.COMPONENT_REMOVED */
  3362. );
  3363. const devtoolsComponentRemoved = (component) => {
  3364. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  3365. !devtools.cleanupBuffer(component)) {
  3366. _devtoolsComponentRemoved(component);
  3367. }
  3368. };
  3369. function createDevtoolsComponentHook(hook) {
  3370. return (component) => {
  3371. emit$1(
  3372. hook,
  3373. component.appContext.app,
  3374. component.uid,
  3375. // fixed by xxxxxx
  3376. // 为 0 是 App,无 parent 是 Page 指向 App
  3377. component.uid === 0 ? void 0 : component.parent ? component.parent.uid : 0,
  3378. component
  3379. );
  3380. };
  3381. }
  3382. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3383. "perf:start"
  3384. /* DevtoolsHooks.PERFORMANCE_START */
  3385. );
  3386. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  3387. "perf:end"
  3388. /* DevtoolsHooks.PERFORMANCE_END */
  3389. );
  3390. function createDevtoolsPerformanceHook(hook) {
  3391. return (component, type, time) => {
  3392. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  3393. };
  3394. }
  3395. function devtoolsComponentEmit(component, event, params) {
  3396. emit$1("component:emit", component.appContext.app, component, event, params);
  3397. }
  3398. function emit(instance, event, ...rawArgs) {
  3399. if (instance.isUnmounted)
  3400. return;
  3401. const props = instance.vnode.props || EMPTY_OBJ;
  3402. {
  3403. const { emitsOptions, propsOptions: [propsOptions] } = instance;
  3404. if (emitsOptions) {
  3405. if (!(event in emitsOptions) && true) {
  3406. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  3407. warn$2(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`);
  3408. }
  3409. } else {
  3410. const validator = emitsOptions[event];
  3411. if (isFunction$1(validator)) {
  3412. const isValid2 = validator(...rawArgs);
  3413. if (!isValid2) {
  3414. warn$2(`Invalid event arguments: event validation failed for event "${event}".`);
  3415. }
  3416. }
  3417. }
  3418. }
  3419. }
  3420. let args = rawArgs;
  3421. const isModelListener2 = event.startsWith("update:");
  3422. const modelArg = isModelListener2 && event.slice(7);
  3423. if (modelArg && modelArg in props) {
  3424. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  3425. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  3426. if (trim) {
  3427. args = rawArgs.map((a2) => isString$1(a2) ? a2.trim() : a2);
  3428. }
  3429. if (number) {
  3430. args = rawArgs.map(looseToNumber);
  3431. }
  3432. }
  3433. {
  3434. devtoolsComponentEmit(instance, event, args);
  3435. }
  3436. {
  3437. const lowerCaseEvent = event.toLowerCase();
  3438. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  3439. warn$2(`Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`);
  3440. }
  3441. }
  3442. let handlerName;
  3443. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  3444. props[handlerName = toHandlerKey(camelize(event))];
  3445. if (!handler && isModelListener2) {
  3446. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  3447. }
  3448. if (handler) {
  3449. callWithAsyncErrorHandling(handler, instance, 6, args);
  3450. }
  3451. const onceHandler = props[handlerName + `Once`];
  3452. if (onceHandler) {
  3453. if (!instance.emitted) {
  3454. instance.emitted = {};
  3455. } else if (instance.emitted[handlerName]) {
  3456. return;
  3457. }
  3458. instance.emitted[handlerName] = true;
  3459. callWithAsyncErrorHandling(onceHandler, instance, 6, args);
  3460. }
  3461. }
  3462. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  3463. const cache = appContext.emitsCache;
  3464. const cached = cache.get(comp);
  3465. if (cached !== void 0) {
  3466. return cached;
  3467. }
  3468. const raw = comp.emits;
  3469. let normalized = {};
  3470. let hasExtends = false;
  3471. if (!isFunction$1(comp)) {
  3472. const extendEmits = (raw2) => {
  3473. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  3474. if (normalizedFromExtend) {
  3475. hasExtends = true;
  3476. extend$1(normalized, normalizedFromExtend);
  3477. }
  3478. };
  3479. if (!asMixin && appContext.mixins.length) {
  3480. appContext.mixins.forEach(extendEmits);
  3481. }
  3482. if (comp.extends) {
  3483. extendEmits(comp.extends);
  3484. }
  3485. if (comp.mixins) {
  3486. comp.mixins.forEach(extendEmits);
  3487. }
  3488. }
  3489. if (!raw && !hasExtends) {
  3490. if (isObject$2(comp)) {
  3491. cache.set(comp, null);
  3492. }
  3493. return null;
  3494. }
  3495. if (isArray$1(raw)) {
  3496. raw.forEach((key) => normalized[key] = null);
  3497. } else {
  3498. extend$1(normalized, raw);
  3499. }
  3500. if (isObject$2(comp)) {
  3501. cache.set(comp, normalized);
  3502. }
  3503. return normalized;
  3504. }
  3505. function isEmitListener(options, key) {
  3506. if (!options || !isOn(key)) {
  3507. return false;
  3508. }
  3509. key = key.slice(2).replace(/Once$/, "");
  3510. return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
  3511. }
  3512. let currentRenderingInstance = null;
  3513. function setCurrentRenderingInstance(instance) {
  3514. const prev = currentRenderingInstance;
  3515. currentRenderingInstance = instance;
  3516. instance && instance.type.__scopeId || null;
  3517. return prev;
  3518. }
  3519. function provide(key, value) {
  3520. if (!currentInstance) {
  3521. {
  3522. warn$2(`provide() can only be used inside setup().`);
  3523. }
  3524. } else {
  3525. let provides = currentInstance.provides;
  3526. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  3527. if (parentProvides === provides) {
  3528. provides = currentInstance.provides = Object.create(parentProvides);
  3529. }
  3530. provides[key] = value;
  3531. if (currentInstance.type.mpType === "app") {
  3532. currentInstance.appContext.app.provide(key, value);
  3533. }
  3534. }
  3535. }
  3536. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3537. const instance = currentInstance || currentRenderingInstance;
  3538. if (instance) {
  3539. const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
  3540. if (provides && key in provides) {
  3541. return provides[key];
  3542. } else if (arguments.length > 1) {
  3543. return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
  3544. } else {
  3545. warn$2(`injection "${String(key)}" not found.`);
  3546. }
  3547. } else {
  3548. warn$2(`inject() can only be used inside setup() or functional components.`);
  3549. }
  3550. }
  3551. const INITIAL_WATCHER_VALUE = {};
  3552. function watch(source, cb, options) {
  3553. if (!isFunction$1(cb)) {
  3554. warn$2(`\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`);
  3555. }
  3556. return doWatch(source, cb, options);
  3557. }
  3558. function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
  3559. if (!cb) {
  3560. if (immediate !== void 0) {
  3561. warn$2(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
  3562. }
  3563. if (deep !== void 0) {
  3564. warn$2(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
  3565. }
  3566. }
  3567. const warnInvalidSource = (s2) => {
  3568. warn$2(`Invalid watch source: `, s2, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`);
  3569. };
  3570. const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
  3571. let getter;
  3572. let forceTrigger = false;
  3573. let isMultiSource = false;
  3574. if (isRef(source)) {
  3575. getter = () => source.value;
  3576. forceTrigger = isShallow(source);
  3577. } else if (isReactive(source)) {
  3578. getter = () => source;
  3579. deep = true;
  3580. } else if (isArray$1(source)) {
  3581. isMultiSource = true;
  3582. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  3583. getter = () => source.map((s2) => {
  3584. if (isRef(s2)) {
  3585. return s2.value;
  3586. } else if (isReactive(s2)) {
  3587. return traverse(s2);
  3588. } else if (isFunction$1(s2)) {
  3589. return callWithErrorHandling(
  3590. s2,
  3591. instance,
  3592. 2
  3593. /* ErrorCodes.WATCH_GETTER */
  3594. );
  3595. } else {
  3596. warnInvalidSource(s2);
  3597. }
  3598. });
  3599. } else if (isFunction$1(source)) {
  3600. if (cb) {
  3601. getter = () => callWithErrorHandling(
  3602. source,
  3603. instance,
  3604. 2
  3605. /* ErrorCodes.WATCH_GETTER */
  3606. );
  3607. } else {
  3608. getter = () => {
  3609. if (instance && instance.isUnmounted) {
  3610. return;
  3611. }
  3612. if (cleanup) {
  3613. cleanup();
  3614. }
  3615. return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
  3616. };
  3617. }
  3618. } else {
  3619. getter = NOOP;
  3620. warnInvalidSource(source);
  3621. }
  3622. if (cb && deep) {
  3623. const baseGetter = getter;
  3624. getter = () => traverse(baseGetter());
  3625. }
  3626. let cleanup;
  3627. let onCleanup = (fn) => {
  3628. cleanup = effect.onStop = () => {
  3629. callWithErrorHandling(
  3630. fn,
  3631. instance,
  3632. 4
  3633. /* ErrorCodes.WATCH_CLEANUP */
  3634. );
  3635. };
  3636. };
  3637. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  3638. const job = () => {
  3639. if (!effect.active) {
  3640. return;
  3641. }
  3642. if (cb) {
  3643. const newValue = effect.run();
  3644. if (deep || forceTrigger || (isMultiSource ? newValue.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue, oldValue)) || false) {
  3645. if (cleanup) {
  3646. cleanup();
  3647. }
  3648. callWithAsyncErrorHandling(cb, instance, 3, [
  3649. newValue,
  3650. // pass undefined as the old value when it's changed for the first time
  3651. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  3652. onCleanup
  3653. ]);
  3654. oldValue = newValue;
  3655. }
  3656. } else {
  3657. effect.run();
  3658. }
  3659. };
  3660. job.allowRecurse = !!cb;
  3661. let scheduler;
  3662. if (flush === "sync") {
  3663. scheduler = job;
  3664. } else if (flush === "post") {
  3665. scheduler = () => queuePostRenderEffect$1(job, instance && instance.suspense);
  3666. } else {
  3667. job.pre = true;
  3668. if (instance)
  3669. job.id = instance.uid;
  3670. scheduler = () => queueJob(job);
  3671. }
  3672. const effect = new ReactiveEffect(getter, scheduler);
  3673. {
  3674. effect.onTrack = onTrack;
  3675. effect.onTrigger = onTrigger;
  3676. }
  3677. if (cb) {
  3678. if (immediate) {
  3679. job();
  3680. } else {
  3681. oldValue = effect.run();
  3682. }
  3683. } else if (flush === "post") {
  3684. queuePostRenderEffect$1(effect.run.bind(effect), instance && instance.suspense);
  3685. } else {
  3686. effect.run();
  3687. }
  3688. const unwatch = () => {
  3689. effect.stop();
  3690. if (instance && instance.scope) {
  3691. remove(instance.scope.effects, effect);
  3692. }
  3693. };
  3694. return unwatch;
  3695. }
  3696. function instanceWatch(source, value, options) {
  3697. const publicThis = this.proxy;
  3698. const getter = isString$1(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3699. let cb;
  3700. if (isFunction$1(value)) {
  3701. cb = value;
  3702. } else {
  3703. cb = value.handler;
  3704. options = value;
  3705. }
  3706. const cur = currentInstance;
  3707. setCurrentInstance(this);
  3708. const res = doWatch(getter, cb.bind(publicThis), options);
  3709. if (cur) {
  3710. setCurrentInstance(cur);
  3711. } else {
  3712. unsetCurrentInstance();
  3713. }
  3714. return res;
  3715. }
  3716. function createPathGetter(ctx, path) {
  3717. const segments = path.split(".");
  3718. return () => {
  3719. let cur = ctx;
  3720. for (let i2 = 0; i2 < segments.length && cur; i2++) {
  3721. cur = cur[segments[i2]];
  3722. }
  3723. return cur;
  3724. };
  3725. }
  3726. function traverse(value, seen) {
  3727. if (!isObject$2(value) || value[
  3728. "__v_skip"
  3729. /* ReactiveFlags.SKIP */
  3730. ]) {
  3731. return value;
  3732. }
  3733. seen = seen || /* @__PURE__ */ new Set();
  3734. if (seen.has(value)) {
  3735. return value;
  3736. }
  3737. seen.add(value);
  3738. if (isRef(value)) {
  3739. traverse(value.value, seen);
  3740. } else if (isArray$1(value)) {
  3741. for (let i2 = 0; i2 < value.length; i2++) {
  3742. traverse(value[i2], seen);
  3743. }
  3744. } else if (isSet(value) || isMap(value)) {
  3745. value.forEach((v2) => {
  3746. traverse(v2, seen);
  3747. });
  3748. } else if (isPlainObject(value)) {
  3749. for (const key in value) {
  3750. traverse(value[key], seen);
  3751. }
  3752. }
  3753. return value;
  3754. }
  3755. function defineComponent(options) {
  3756. return isFunction$1(options) ? { setup: options, name: options.name } : options;
  3757. }
  3758. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3759. function onActivated(hook, target) {
  3760. registerKeepAliveHook(hook, "a", target);
  3761. }
  3762. function onDeactivated(hook, target) {
  3763. registerKeepAliveHook(hook, "da", target);
  3764. }
  3765. function registerKeepAliveHook(hook, type, target = currentInstance) {
  3766. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  3767. let current = target;
  3768. while (current) {
  3769. if (current.isDeactivated) {
  3770. return;
  3771. }
  3772. current = current.parent;
  3773. }
  3774. return hook();
  3775. });
  3776. injectHook(type, wrappedHook, target);
  3777. if (target) {
  3778. let current = target.parent;
  3779. while (current && current.parent) {
  3780. if (isKeepAlive(current.parent.vnode)) {
  3781. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3782. }
  3783. current = current.parent;
  3784. }
  3785. }
  3786. }
  3787. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3788. const injected = injectHook(
  3789. type,
  3790. hook,
  3791. keepAliveRoot,
  3792. true
  3793. /* prepend */
  3794. );
  3795. onUnmounted(() => {
  3796. remove(keepAliveRoot[type], injected);
  3797. }, target);
  3798. }
  3799. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3800. if (target) {
  3801. if (isRootHook(type)) {
  3802. target = target.root;
  3803. }
  3804. const hooks2 = target[type] || (target[type] = []);
  3805. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3806. if (target.isUnmounted) {
  3807. return;
  3808. }
  3809. pauseTracking();
  3810. setCurrentInstance(target);
  3811. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3812. unsetCurrentInstance();
  3813. resetTracking();
  3814. return res;
  3815. });
  3816. if (prepend) {
  3817. hooks2.unshift(wrappedHook);
  3818. } else {
  3819. hooks2.push(wrappedHook);
  3820. }
  3821. return wrappedHook;
  3822. } else {
  3823. const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, ""));
  3824. warn$2(`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`);
  3825. }
  3826. }
  3827. const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (
  3828. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  3829. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  3830. );
  3831. const onBeforeMount = createHook$1(
  3832. "bm"
  3833. /* LifecycleHooks.BEFORE_MOUNT */
  3834. );
  3835. const onMounted = createHook$1(
  3836. "m"
  3837. /* LifecycleHooks.MOUNTED */
  3838. );
  3839. const onBeforeUpdate = createHook$1(
  3840. "bu"
  3841. /* LifecycleHooks.BEFORE_UPDATE */
  3842. );
  3843. const onUpdated = createHook$1(
  3844. "u"
  3845. /* LifecycleHooks.UPDATED */
  3846. );
  3847. const onBeforeUnmount = createHook$1(
  3848. "bum"
  3849. /* LifecycleHooks.BEFORE_UNMOUNT */
  3850. );
  3851. const onUnmounted = createHook$1(
  3852. "um"
  3853. /* LifecycleHooks.UNMOUNTED */
  3854. );
  3855. const onServerPrefetch = createHook$1(
  3856. "sp"
  3857. /* LifecycleHooks.SERVER_PREFETCH */
  3858. );
  3859. const onRenderTriggered = createHook$1(
  3860. "rtg"
  3861. /* LifecycleHooks.RENDER_TRIGGERED */
  3862. );
  3863. const onRenderTracked = createHook$1(
  3864. "rtc"
  3865. /* LifecycleHooks.RENDER_TRACKED */
  3866. );
  3867. function onErrorCaptured(hook, target = currentInstance) {
  3868. injectHook("ec", hook, target);
  3869. }
  3870. function validateDirectiveName(name) {
  3871. if (isBuiltInDirective(name)) {
  3872. warn$2("Do not use built-in directive ids as custom directive id: " + name);
  3873. }
  3874. }
  3875. const COMPONENTS = "components";
  3876. function resolveComponent(name, maybeSelfReference) {
  3877. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3878. }
  3879. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3880. const instance = currentRenderingInstance || currentInstance;
  3881. if (instance) {
  3882. const Component2 = instance.type;
  3883. if (type === COMPONENTS) {
  3884. const selfName = getComponentName(
  3885. Component2,
  3886. false
  3887. /* do not include inferred name to avoid breaking existing code */
  3888. );
  3889. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3890. return Component2;
  3891. }
  3892. }
  3893. const res = (
  3894. // local registration
  3895. // check instance[type] first which is resolved for options API
  3896. resolve(instance[type] || Component2[type], name) || // global registration
  3897. resolve(instance.appContext[type], name)
  3898. );
  3899. if (!res && maybeSelfReference) {
  3900. return Component2;
  3901. }
  3902. if (warnMissing && !res) {
  3903. const extra = type === COMPONENTS ? `
  3904. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3905. warn$2(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3906. }
  3907. return res;
  3908. } else {
  3909. warn$2(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
  3910. }
  3911. }
  3912. function resolve(registry, name) {
  3913. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3914. }
  3915. const getPublicInstance = (i2) => {
  3916. if (!i2)
  3917. return null;
  3918. if (isStatefulComponent(i2))
  3919. return getExposeProxy(i2) || i2.proxy;
  3920. return getPublicInstance(i2.parent);
  3921. };
  3922. const publicPropertiesMap = (
  3923. // Move PURE marker to new line to workaround compiler discarding it
  3924. // due to type annotation
  3925. /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
  3926. $: (i2) => i2,
  3927. // fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el,故模拟一个假的
  3928. // $el: i => i.vnode.el,
  3929. $el: (i2) => i2.__$el || (i2.__$el = {}),
  3930. $data: (i2) => i2.data,
  3931. $props: (i2) => shallowReadonly(i2.props),
  3932. $attrs: (i2) => shallowReadonly(i2.attrs),
  3933. $slots: (i2) => shallowReadonly(i2.slots),
  3934. $refs: (i2) => shallowReadonly(i2.refs),
  3935. $parent: (i2) => getPublicInstance(i2.parent),
  3936. $root: (i2) => getPublicInstance(i2.root),
  3937. $emit: (i2) => i2.emit,
  3938. $options: (i2) => resolveMergedOptions(i2),
  3939. $forceUpdate: (i2) => i2.f || (i2.f = () => queueJob(i2.update)),
  3940. // $nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),// fixed by xxxxxx
  3941. $watch: (i2) => instanceWatch.bind(i2)
  3942. })
  3943. );
  3944. const isReservedPrefix = (key) => key === "_" || key === "$";
  3945. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key);
  3946. const PublicInstanceProxyHandlers = {
  3947. get({ _: instance }, key) {
  3948. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3949. if (key === "__isVue") {
  3950. return true;
  3951. }
  3952. let normalizedProps;
  3953. if (key[0] !== "$") {
  3954. const n2 = accessCache[key];
  3955. if (n2 !== void 0) {
  3956. switch (n2) {
  3957. case 1:
  3958. return setupState[key];
  3959. case 2:
  3960. return data[key];
  3961. case 4:
  3962. return ctx[key];
  3963. case 3:
  3964. return props[key];
  3965. }
  3966. } else if (hasSetupBinding(setupState, key)) {
  3967. accessCache[key] = 1;
  3968. return setupState[key];
  3969. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  3970. accessCache[key] = 2;
  3971. return data[key];
  3972. } else if (
  3973. // only cache other properties when instance has declared (thus stable)
  3974. // props
  3975. (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
  3976. ) {
  3977. accessCache[key] = 3;
  3978. return props[key];
  3979. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  3980. accessCache[key] = 4;
  3981. return ctx[key];
  3982. } else if (shouldCacheAccess) {
  3983. accessCache[key] = 0;
  3984. }
  3985. }
  3986. const publicGetter = publicPropertiesMap[key];
  3987. let cssModule, globalProperties;
  3988. if (publicGetter) {
  3989. if (key === "$attrs") {
  3990. track(instance, "get", key);
  3991. }
  3992. return publicGetter(instance);
  3993. } else if (
  3994. // css module (injected by vue-loader)
  3995. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3996. ) {
  3997. return cssModule;
  3998. } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) {
  3999. accessCache[key] = 4;
  4000. return ctx[key];
  4001. } else if (
  4002. // global properties
  4003. globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
  4004. ) {
  4005. {
  4006. return globalProperties[key];
  4007. }
  4008. } else if (currentRenderingInstance && (!isString$1(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  4009. // to infinite warning loop
  4010. key.indexOf("__v") !== 0)) {
  4011. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) {
  4012. warn$2(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`);
  4013. } else if (instance === currentRenderingInstance) {
  4014. warn$2(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
  4015. }
  4016. }
  4017. },
  4018. set({ _: instance }, key, value) {
  4019. const { data, setupState, ctx } = instance;
  4020. if (hasSetupBinding(setupState, key)) {
  4021. setupState[key] = value;
  4022. return true;
  4023. } else if (setupState.__isScriptSetup && hasOwn$1(setupState, key)) {
  4024. warn$2(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  4025. return false;
  4026. } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) {
  4027. data[key] = value;
  4028. return true;
  4029. } else if (hasOwn$1(instance.props, key)) {
  4030. warn$2(`Attempting to mutate prop "${key}". Props are readonly.`);
  4031. return false;
  4032. }
  4033. if (key[0] === "$" && key.slice(1) in instance) {
  4034. warn$2(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`);
  4035. return false;
  4036. } else {
  4037. if (key in instance.appContext.config.globalProperties) {
  4038. Object.defineProperty(ctx, key, {
  4039. enumerable: true,
  4040. configurable: true,
  4041. value
  4042. });
  4043. } else {
  4044. ctx[key] = value;
  4045. }
  4046. }
  4047. return true;
  4048. },
  4049. has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
  4050. let normalizedProps;
  4051. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
  4052. },
  4053. defineProperty(target, key, descriptor) {
  4054. if (descriptor.get != null) {
  4055. target._.accessCache[key] = 0;
  4056. } else if (hasOwn$1(descriptor, "value")) {
  4057. this.set(target, key, descriptor.value, null);
  4058. }
  4059. return Reflect.defineProperty(target, key, descriptor);
  4060. }
  4061. };
  4062. {
  4063. PublicInstanceProxyHandlers.ownKeys = (target) => {
  4064. warn$2(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
  4065. return Reflect.ownKeys(target);
  4066. };
  4067. }
  4068. function createDevRenderContext(instance) {
  4069. const target = {};
  4070. Object.defineProperty(target, `_`, {
  4071. configurable: true,
  4072. enumerable: false,
  4073. get: () => instance
  4074. });
  4075. Object.keys(publicPropertiesMap).forEach((key) => {
  4076. Object.defineProperty(target, key, {
  4077. configurable: true,
  4078. enumerable: false,
  4079. get: () => publicPropertiesMap[key](instance),
  4080. // intercepted by the proxy so no need for implementation,
  4081. // but needed to prevent set errors
  4082. set: NOOP
  4083. });
  4084. });
  4085. return target;
  4086. }
  4087. function exposePropsOnRenderContext(instance) {
  4088. const { ctx, propsOptions: [propsOptions] } = instance;
  4089. if (propsOptions) {
  4090. Object.keys(propsOptions).forEach((key) => {
  4091. Object.defineProperty(ctx, key, {
  4092. enumerable: true,
  4093. configurable: true,
  4094. get: () => instance.props[key],
  4095. set: NOOP
  4096. });
  4097. });
  4098. }
  4099. }
  4100. function exposeSetupStateOnRenderContext(instance) {
  4101. const { ctx, setupState } = instance;
  4102. Object.keys(toRaw(setupState)).forEach((key) => {
  4103. if (!setupState.__isScriptSetup) {
  4104. if (isReservedPrefix(key[0])) {
  4105. warn$2(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
  4106. return;
  4107. }
  4108. Object.defineProperty(ctx, key, {
  4109. enumerable: true,
  4110. configurable: true,
  4111. get: () => setupState[key],
  4112. set: NOOP
  4113. });
  4114. }
  4115. });
  4116. }
  4117. function createDuplicateChecker() {
  4118. const cache = /* @__PURE__ */ Object.create(null);
  4119. return (type, key) => {
  4120. if (cache[key]) {
  4121. warn$2(`${type} property "${key}" is already defined in ${cache[key]}.`);
  4122. } else {
  4123. cache[key] = type;
  4124. }
  4125. };
  4126. }
  4127. let shouldCacheAccess = true;
  4128. function applyOptions$1(instance) {
  4129. const options = resolveMergedOptions(instance);
  4130. const publicThis = instance.proxy;
  4131. const ctx = instance.ctx;
  4132. shouldCacheAccess = false;
  4133. if (options.beforeCreate) {
  4134. callHook$1(
  4135. options.beforeCreate,
  4136. instance,
  4137. "bc"
  4138. /* LifecycleHooks.BEFORE_CREATE */
  4139. );
  4140. }
  4141. const {
  4142. // state
  4143. data: dataOptions,
  4144. computed: computedOptions,
  4145. methods,
  4146. watch: watchOptions,
  4147. provide: provideOptions,
  4148. inject: injectOptions,
  4149. // lifecycle
  4150. created,
  4151. beforeMount,
  4152. mounted,
  4153. beforeUpdate,
  4154. updated,
  4155. activated,
  4156. deactivated,
  4157. beforeDestroy,
  4158. beforeUnmount,
  4159. destroyed,
  4160. unmounted,
  4161. render,
  4162. renderTracked,
  4163. renderTriggered,
  4164. errorCaptured,
  4165. serverPrefetch,
  4166. // public API
  4167. expose,
  4168. inheritAttrs,
  4169. // assets
  4170. components,
  4171. directives,
  4172. filters
  4173. } = options;
  4174. const checkDuplicateProperties = createDuplicateChecker();
  4175. {
  4176. const [propsOptions] = instance.propsOptions;
  4177. if (propsOptions) {
  4178. for (const key in propsOptions) {
  4179. checkDuplicateProperties("Props", key);
  4180. }
  4181. }
  4182. }
  4183. if (injectOptions) {
  4184. resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
  4185. }
  4186. if (methods) {
  4187. for (const key in methods) {
  4188. const methodHandler = methods[key];
  4189. if (isFunction$1(methodHandler)) {
  4190. {
  4191. Object.defineProperty(ctx, key, {
  4192. value: methodHandler.bind(publicThis),
  4193. configurable: true,
  4194. enumerable: true,
  4195. writable: true
  4196. });
  4197. }
  4198. {
  4199. checkDuplicateProperties("Methods", key);
  4200. }
  4201. } else {
  4202. warn$2(`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`);
  4203. }
  4204. }
  4205. }
  4206. if (dataOptions) {
  4207. if (!isFunction$1(dataOptions)) {
  4208. warn$2(`The data option must be a function. Plain object usage is no longer supported.`);
  4209. }
  4210. const data = dataOptions.call(publicThis, publicThis);
  4211. if (isPromise(data)) {
  4212. warn$2(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
  4213. }
  4214. if (!isObject$2(data)) {
  4215. warn$2(`data() should return an object.`);
  4216. } else {
  4217. instance.data = reactive(data);
  4218. {
  4219. for (const key in data) {
  4220. checkDuplicateProperties("Data", key);
  4221. if (!isReservedPrefix(key[0])) {
  4222. Object.defineProperty(ctx, key, {
  4223. configurable: true,
  4224. enumerable: true,
  4225. get: () => data[key],
  4226. set: NOOP
  4227. });
  4228. }
  4229. }
  4230. }
  4231. }
  4232. }
  4233. shouldCacheAccess = true;
  4234. if (computedOptions) {
  4235. for (const key in computedOptions) {
  4236. const opt = computedOptions[key];
  4237. const get2 = isFunction$1(opt) ? opt.bind(publicThis, publicThis) : isFunction$1(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  4238. if (get2 === NOOP) {
  4239. warn$2(`Computed property "${key}" has no getter.`);
  4240. }
  4241. const set2 = !isFunction$1(opt) && isFunction$1(opt.set) ? opt.set.bind(publicThis) : () => {
  4242. warn$2(`Write operation failed: computed property "${key}" is readonly.`);
  4243. };
  4244. const c2 = computed({
  4245. get: get2,
  4246. set: set2
  4247. });
  4248. Object.defineProperty(ctx, key, {
  4249. enumerable: true,
  4250. configurable: true,
  4251. get: () => c2.value,
  4252. set: (v2) => c2.value = v2
  4253. });
  4254. {
  4255. checkDuplicateProperties("Computed", key);
  4256. }
  4257. }
  4258. }
  4259. if (watchOptions) {
  4260. for (const key in watchOptions) {
  4261. createWatcher(watchOptions[key], ctx, publicThis, key);
  4262. }
  4263. }
  4264. {
  4265. if (provideOptions) {
  4266. const provides = isFunction$1(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  4267. Reflect.ownKeys(provides).forEach((key) => {
  4268. provide(key, provides[key]);
  4269. });
  4270. }
  4271. }
  4272. {
  4273. if (created) {
  4274. callHook$1(
  4275. created,
  4276. instance,
  4277. "c"
  4278. /* LifecycleHooks.CREATED */
  4279. );
  4280. }
  4281. }
  4282. function registerLifecycleHook(register, hook) {
  4283. if (isArray$1(hook)) {
  4284. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  4285. } else if (hook) {
  4286. register(hook.bind(publicThis));
  4287. }
  4288. }
  4289. registerLifecycleHook(onBeforeMount, beforeMount);
  4290. registerLifecycleHook(onMounted, mounted);
  4291. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  4292. registerLifecycleHook(onUpdated, updated);
  4293. registerLifecycleHook(onActivated, activated);
  4294. registerLifecycleHook(onDeactivated, deactivated);
  4295. registerLifecycleHook(onErrorCaptured, errorCaptured);
  4296. registerLifecycleHook(onRenderTracked, renderTracked);
  4297. registerLifecycleHook(onRenderTriggered, renderTriggered);
  4298. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  4299. registerLifecycleHook(onUnmounted, unmounted);
  4300. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  4301. if (isArray$1(expose)) {
  4302. if (expose.length) {
  4303. const exposed = instance.exposed || (instance.exposed = {});
  4304. expose.forEach((key) => {
  4305. Object.defineProperty(exposed, key, {
  4306. get: () => publicThis[key],
  4307. set: (val) => publicThis[key] = val
  4308. });
  4309. });
  4310. } else if (!instance.exposed) {
  4311. instance.exposed = {};
  4312. }
  4313. }
  4314. if (render && instance.render === NOOP) {
  4315. instance.render = render;
  4316. }
  4317. if (inheritAttrs != null) {
  4318. instance.inheritAttrs = inheritAttrs;
  4319. }
  4320. if (components)
  4321. instance.components = components;
  4322. if (directives)
  4323. instance.directives = directives;
  4324. if (instance.ctx.$onApplyOptions) {
  4325. instance.ctx.$onApplyOptions(options, instance, publicThis);
  4326. }
  4327. }
  4328. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
  4329. if (isArray$1(injectOptions)) {
  4330. injectOptions = normalizeInject(injectOptions);
  4331. }
  4332. for (const key in injectOptions) {
  4333. const opt = injectOptions[key];
  4334. let injected;
  4335. if (isObject$2(opt)) {
  4336. if ("default" in opt) {
  4337. injected = inject(
  4338. opt.from || key,
  4339. opt.default,
  4340. true
  4341. /* treat default function as factory */
  4342. );
  4343. } else {
  4344. injected = inject(opt.from || key);
  4345. }
  4346. } else {
  4347. injected = inject(opt);
  4348. }
  4349. if (isRef(injected)) {
  4350. if (unwrapRef) {
  4351. Object.defineProperty(ctx, key, {
  4352. enumerable: true,
  4353. configurable: true,
  4354. get: () => injected.value,
  4355. set: (v2) => injected.value = v2
  4356. });
  4357. } else {
  4358. {
  4359. warn$2(`injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`);
  4360. }
  4361. ctx[key] = injected;
  4362. }
  4363. } else {
  4364. ctx[key] = injected;
  4365. }
  4366. {
  4367. checkDuplicateProperties("Inject", key);
  4368. }
  4369. }
  4370. }
  4371. function callHook$1(hook, instance, type) {
  4372. callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
  4373. }
  4374. function createWatcher(raw, ctx, publicThis, key) {
  4375. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  4376. if (isString$1(raw)) {
  4377. const handler = ctx[raw];
  4378. if (isFunction$1(handler)) {
  4379. watch(getter, handler);
  4380. } else {
  4381. warn$2(`Invalid watch handler specified by key "${raw}"`, handler);
  4382. }
  4383. } else if (isFunction$1(raw)) {
  4384. watch(getter, raw.bind(publicThis));
  4385. } else if (isObject$2(raw)) {
  4386. if (isArray$1(raw)) {
  4387. raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key));
  4388. } else {
  4389. const handler = isFunction$1(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  4390. if (isFunction$1(handler)) {
  4391. watch(getter, handler, raw);
  4392. } else {
  4393. warn$2(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  4394. }
  4395. }
  4396. } else {
  4397. warn$2(`Invalid watch option: "${key}"`, raw);
  4398. }
  4399. }
  4400. function resolveMergedOptions(instance) {
  4401. const base = instance.type;
  4402. const { mixins, extends: extendsOptions } = base;
  4403. const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
  4404. const cached = cache.get(base);
  4405. let resolved;
  4406. if (cached) {
  4407. resolved = cached;
  4408. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  4409. {
  4410. resolved = base;
  4411. }
  4412. } else {
  4413. resolved = {};
  4414. if (globalMixins.length) {
  4415. globalMixins.forEach((m2) => mergeOptions(resolved, m2, optionMergeStrategies, true));
  4416. }
  4417. mergeOptions(resolved, base, optionMergeStrategies);
  4418. }
  4419. if (isObject$2(base)) {
  4420. cache.set(base, resolved);
  4421. }
  4422. return resolved;
  4423. }
  4424. function mergeOptions(to2, from2, strats, asMixin = false) {
  4425. const { mixins, extends: extendsOptions } = from2;
  4426. if (extendsOptions) {
  4427. mergeOptions(to2, extendsOptions, strats, true);
  4428. }
  4429. if (mixins) {
  4430. mixins.forEach((m2) => mergeOptions(to2, m2, strats, true));
  4431. }
  4432. for (const key in from2) {
  4433. if (asMixin && key === "expose") {
  4434. warn$2(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
  4435. } else {
  4436. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  4437. to2[key] = strat ? strat(to2[key], from2[key]) : from2[key];
  4438. }
  4439. }
  4440. return to2;
  4441. }
  4442. const internalOptionMergeStrats = {
  4443. data: mergeDataFn,
  4444. props: mergeObjectOptions,
  4445. emits: mergeObjectOptions,
  4446. // objects
  4447. methods: mergeObjectOptions,
  4448. computed: mergeObjectOptions,
  4449. // lifecycle
  4450. beforeCreate: mergeAsArray$1,
  4451. created: mergeAsArray$1,
  4452. beforeMount: mergeAsArray$1,
  4453. mounted: mergeAsArray$1,
  4454. beforeUpdate: mergeAsArray$1,
  4455. updated: mergeAsArray$1,
  4456. beforeDestroy: mergeAsArray$1,
  4457. beforeUnmount: mergeAsArray$1,
  4458. destroyed: mergeAsArray$1,
  4459. unmounted: mergeAsArray$1,
  4460. activated: mergeAsArray$1,
  4461. deactivated: mergeAsArray$1,
  4462. errorCaptured: mergeAsArray$1,
  4463. serverPrefetch: mergeAsArray$1,
  4464. // assets
  4465. components: mergeObjectOptions,
  4466. directives: mergeObjectOptions,
  4467. // watch
  4468. watch: mergeWatchOptions,
  4469. // provide / inject
  4470. provide: mergeDataFn,
  4471. inject: mergeInject
  4472. };
  4473. function mergeDataFn(to2, from2) {
  4474. if (!from2) {
  4475. return to2;
  4476. }
  4477. if (!to2) {
  4478. return from2;
  4479. }
  4480. return function mergedDataFn() {
  4481. return extend$1(isFunction$1(to2) ? to2.call(this, this) : to2, isFunction$1(from2) ? from2.call(this, this) : from2);
  4482. };
  4483. }
  4484. function mergeInject(to2, from2) {
  4485. return mergeObjectOptions(normalizeInject(to2), normalizeInject(from2));
  4486. }
  4487. function normalizeInject(raw) {
  4488. if (isArray$1(raw)) {
  4489. const res = {};
  4490. for (let i2 = 0; i2 < raw.length; i2++) {
  4491. res[raw[i2]] = raw[i2];
  4492. }
  4493. return res;
  4494. }
  4495. return raw;
  4496. }
  4497. function mergeAsArray$1(to2, from2) {
  4498. return to2 ? [...new Set([].concat(to2, from2))] : from2;
  4499. }
  4500. function mergeObjectOptions(to2, from2) {
  4501. return to2 ? extend$1(extend$1(/* @__PURE__ */ Object.create(null), to2), from2) : from2;
  4502. }
  4503. function mergeWatchOptions(to2, from2) {
  4504. if (!to2)
  4505. return from2;
  4506. if (!from2)
  4507. return to2;
  4508. const merged = extend$1(/* @__PURE__ */ Object.create(null), to2);
  4509. for (const key in from2) {
  4510. merged[key] = mergeAsArray$1(to2[key], from2[key]);
  4511. }
  4512. return merged;
  4513. }
  4514. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  4515. const props = {};
  4516. const attrs = {};
  4517. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4518. setFullProps(instance, rawProps, props, attrs);
  4519. for (const key in instance.propsOptions[0]) {
  4520. if (!(key in props)) {
  4521. props[key] = void 0;
  4522. }
  4523. }
  4524. {
  4525. validateProps(rawProps || {}, props, instance);
  4526. }
  4527. if (isStateful) {
  4528. instance.props = isSSR ? props : shallowReactive(props);
  4529. } else {
  4530. if (!instance.type.props) {
  4531. instance.props = attrs;
  4532. } else {
  4533. instance.props = props;
  4534. }
  4535. }
  4536. instance.attrs = attrs;
  4537. }
  4538. function isInHmrContext(instance) {
  4539. while (instance) {
  4540. if (instance.type.__hmrId)
  4541. return true;
  4542. instance = instance.parent;
  4543. }
  4544. }
  4545. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4546. const { props, attrs, vnode: { patchFlag } } = instance;
  4547. const rawCurrentProps = toRaw(props);
  4548. const [options] = instance.propsOptions;
  4549. let hasAttrsChanged = false;
  4550. if (
  4551. // always force full diff in dev
  4552. // - #1942 if hmr is enabled with sfc component
  4553. // - vite#872 non-sfc component used by sfc component
  4554. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4555. ) {
  4556. if (patchFlag & 8) {
  4557. const propsToUpdate = instance.vnode.dynamicProps;
  4558. for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
  4559. let key = propsToUpdate[i2];
  4560. if (isEmitListener(instance.emitsOptions, key)) {
  4561. continue;
  4562. }
  4563. const value = rawProps[key];
  4564. if (options) {
  4565. if (hasOwn$1(attrs, key)) {
  4566. if (value !== attrs[key]) {
  4567. attrs[key] = value;
  4568. hasAttrsChanged = true;
  4569. }
  4570. } else {
  4571. const camelizedKey = camelize(key);
  4572. props[camelizedKey] = resolvePropValue(
  4573. options,
  4574. rawCurrentProps,
  4575. camelizedKey,
  4576. value,
  4577. instance,
  4578. false
  4579. /* isAbsent */
  4580. );
  4581. }
  4582. } else {
  4583. if (value !== attrs[key]) {
  4584. attrs[key] = value;
  4585. hasAttrsChanged = true;
  4586. }
  4587. }
  4588. }
  4589. }
  4590. } else {
  4591. if (setFullProps(instance, rawProps, props, attrs)) {
  4592. hasAttrsChanged = true;
  4593. }
  4594. let kebabKey;
  4595. for (const key in rawCurrentProps) {
  4596. if (!rawProps || // for camelCase
  4597. !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4598. // and converted to camelCase (#955)
  4599. ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
  4600. if (options) {
  4601. if (rawPrevProps && // for camelCase
  4602. (rawPrevProps[key] !== void 0 || // for kebab-case
  4603. rawPrevProps[kebabKey] !== void 0)) {
  4604. props[key] = resolvePropValue(
  4605. options,
  4606. rawCurrentProps,
  4607. key,
  4608. void 0,
  4609. instance,
  4610. true
  4611. /* isAbsent */
  4612. );
  4613. }
  4614. } else {
  4615. delete props[key];
  4616. }
  4617. }
  4618. }
  4619. if (attrs !== rawCurrentProps) {
  4620. for (const key in attrs) {
  4621. if (!rawProps || !hasOwn$1(rawProps, key) && true) {
  4622. delete attrs[key];
  4623. hasAttrsChanged = true;
  4624. }
  4625. }
  4626. }
  4627. }
  4628. if (hasAttrsChanged) {
  4629. trigger(instance, "set", "$attrs");
  4630. }
  4631. {
  4632. validateProps(rawProps || {}, props, instance);
  4633. }
  4634. }
  4635. function setFullProps(instance, rawProps, props, attrs) {
  4636. const [options, needCastKeys] = instance.propsOptions;
  4637. let hasAttrsChanged = false;
  4638. let rawCastValues;
  4639. if (rawProps) {
  4640. for (let key in rawProps) {
  4641. if (isReservedProp(key)) {
  4642. continue;
  4643. }
  4644. const value = rawProps[key];
  4645. let camelKey;
  4646. if (options && hasOwn$1(options, camelKey = camelize(key))) {
  4647. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4648. props[camelKey] = value;
  4649. } else {
  4650. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4651. }
  4652. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4653. if (!(key in attrs) || value !== attrs[key]) {
  4654. attrs[key] = value;
  4655. hasAttrsChanged = true;
  4656. }
  4657. }
  4658. }
  4659. }
  4660. if (needCastKeys) {
  4661. const rawCurrentProps = toRaw(props);
  4662. const castValues = rawCastValues || EMPTY_OBJ;
  4663. for (let i2 = 0; i2 < needCastKeys.length; i2++) {
  4664. const key = needCastKeys[i2];
  4665. props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key));
  4666. }
  4667. }
  4668. return hasAttrsChanged;
  4669. }
  4670. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4671. const opt = options[key];
  4672. if (opt != null) {
  4673. const hasDefault = hasOwn$1(opt, "default");
  4674. if (hasDefault && value === void 0) {
  4675. const defaultValue = opt.default;
  4676. if (opt.type !== Function && isFunction$1(defaultValue)) {
  4677. const { propsDefaults } = instance;
  4678. if (key in propsDefaults) {
  4679. value = propsDefaults[key];
  4680. } else {
  4681. setCurrentInstance(instance);
  4682. value = propsDefaults[key] = defaultValue.call(null, props);
  4683. unsetCurrentInstance();
  4684. }
  4685. } else {
  4686. value = defaultValue;
  4687. }
  4688. }
  4689. if (opt[
  4690. 0
  4691. /* BooleanFlags.shouldCast */
  4692. ]) {
  4693. if (isAbsent && !hasDefault) {
  4694. value = false;
  4695. } else if (opt[
  4696. 1
  4697. /* BooleanFlags.shouldCastTrue */
  4698. ] && (value === "" || value === hyphenate(key))) {
  4699. value = true;
  4700. }
  4701. }
  4702. }
  4703. return value;
  4704. }
  4705. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4706. const cache = appContext.propsCache;
  4707. const cached = cache.get(comp);
  4708. if (cached) {
  4709. return cached;
  4710. }
  4711. const raw = comp.props;
  4712. const normalized = {};
  4713. const needCastKeys = [];
  4714. let hasExtends = false;
  4715. if (!isFunction$1(comp)) {
  4716. const extendProps = (raw2) => {
  4717. hasExtends = true;
  4718. const [props, keys2] = normalizePropsOptions(raw2, appContext, true);
  4719. extend$1(normalized, props);
  4720. if (keys2)
  4721. needCastKeys.push(...keys2);
  4722. };
  4723. if (!asMixin && appContext.mixins.length) {
  4724. appContext.mixins.forEach(extendProps);
  4725. }
  4726. if (comp.extends) {
  4727. extendProps(comp.extends);
  4728. }
  4729. if (comp.mixins) {
  4730. comp.mixins.forEach(extendProps);
  4731. }
  4732. }
  4733. if (!raw && !hasExtends) {
  4734. if (isObject$2(comp)) {
  4735. cache.set(comp, EMPTY_ARR);
  4736. }
  4737. return EMPTY_ARR;
  4738. }
  4739. if (isArray$1(raw)) {
  4740. for (let i2 = 0; i2 < raw.length; i2++) {
  4741. if (!isString$1(raw[i2])) {
  4742. warn$2(`props must be strings when using array syntax.`, raw[i2]);
  4743. }
  4744. const normalizedKey = camelize(raw[i2]);
  4745. if (validatePropName(normalizedKey)) {
  4746. normalized[normalizedKey] = EMPTY_OBJ;
  4747. }
  4748. }
  4749. } else if (raw) {
  4750. if (!isObject$2(raw)) {
  4751. warn$2(`invalid props options`, raw);
  4752. }
  4753. for (const key in raw) {
  4754. const normalizedKey = camelize(key);
  4755. if (validatePropName(normalizedKey)) {
  4756. const opt = raw[key];
  4757. const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction$1(opt) ? { type: opt } : Object.assign({}, opt);
  4758. if (prop) {
  4759. const booleanIndex = getTypeIndex(Boolean, prop.type);
  4760. const stringIndex = getTypeIndex(String, prop.type);
  4761. prop[
  4762. 0
  4763. /* BooleanFlags.shouldCast */
  4764. ] = booleanIndex > -1;
  4765. prop[
  4766. 1
  4767. /* BooleanFlags.shouldCastTrue */
  4768. ] = stringIndex < 0 || booleanIndex < stringIndex;
  4769. if (booleanIndex > -1 || hasOwn$1(prop, "default")) {
  4770. needCastKeys.push(normalizedKey);
  4771. }
  4772. }
  4773. }
  4774. }
  4775. }
  4776. const res = [normalized, needCastKeys];
  4777. if (isObject$2(comp)) {
  4778. cache.set(comp, res);
  4779. }
  4780. return res;
  4781. }
  4782. function validatePropName(key) {
  4783. if (key[0] !== "$") {
  4784. return true;
  4785. } else {
  4786. warn$2(`Invalid prop name: "${key}" is a reserved property.`);
  4787. }
  4788. return false;
  4789. }
  4790. function getType(ctor) {
  4791. const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
  4792. return match ? match[2] : ctor === null ? "null" : "";
  4793. }
  4794. function isSameType(a2, b2) {
  4795. return getType(a2) === getType(b2);
  4796. }
  4797. function getTypeIndex(type, expectedTypes) {
  4798. if (isArray$1(expectedTypes)) {
  4799. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  4800. } else if (isFunction$1(expectedTypes)) {
  4801. return isSameType(expectedTypes, type) ? 0 : -1;
  4802. }
  4803. return -1;
  4804. }
  4805. function validateProps(rawProps, props, instance) {
  4806. const resolvedValues = toRaw(props);
  4807. const options = instance.propsOptions[0];
  4808. for (const key in options) {
  4809. let opt = options[key];
  4810. if (opt == null)
  4811. continue;
  4812. validateProp(key, resolvedValues[key], opt, !hasOwn$1(rawProps, key) && !hasOwn$1(rawProps, hyphenate(key)));
  4813. }
  4814. }
  4815. function validateProp(name, value, prop, isAbsent) {
  4816. const { type, required, validator } = prop;
  4817. if (required && isAbsent) {
  4818. warn$2('Missing required prop: "' + name + '"');
  4819. return;
  4820. }
  4821. if (value == null && !prop.required) {
  4822. return;
  4823. }
  4824. if (type != null && type !== true) {
  4825. let isValid2 = false;
  4826. const types = isArray$1(type) ? type : [type];
  4827. const expectedTypes = [];
  4828. for (let i2 = 0; i2 < types.length && !isValid2; i2++) {
  4829. const { valid, expectedType } = assertType(value, types[i2]);
  4830. expectedTypes.push(expectedType || "");
  4831. isValid2 = valid;
  4832. }
  4833. if (!isValid2) {
  4834. warn$2(getInvalidTypeMessage(name, value, expectedTypes));
  4835. return;
  4836. }
  4837. }
  4838. if (validator && !validator(value)) {
  4839. warn$2('Invalid prop: custom validator check failed for prop "' + name + '".');
  4840. }
  4841. }
  4842. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
  4843. function assertType(value, type) {
  4844. let valid;
  4845. const expectedType = getType(type);
  4846. if (isSimpleType(expectedType)) {
  4847. const t2 = typeof value;
  4848. valid = t2 === expectedType.toLowerCase();
  4849. if (!valid && t2 === "object") {
  4850. valid = value instanceof type;
  4851. }
  4852. } else if (expectedType === "Object") {
  4853. valid = isObject$2(value);
  4854. } else if (expectedType === "Array") {
  4855. valid = isArray$1(value);
  4856. } else if (expectedType === "null") {
  4857. valid = value === null;
  4858. } else {
  4859. valid = value instanceof type;
  4860. }
  4861. return {
  4862. valid,
  4863. expectedType
  4864. };
  4865. }
  4866. function getInvalidTypeMessage(name, value, expectedTypes) {
  4867. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4868. const expectedType = expectedTypes[0];
  4869. const receivedType = toRawType(value);
  4870. const expectedValue = styleValue(value, expectedType);
  4871. const receivedValue = styleValue(value, receivedType);
  4872. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4873. message += ` with value ${expectedValue}`;
  4874. }
  4875. message += `, got ${receivedType} `;
  4876. if (isExplicable(receivedType)) {
  4877. message += `with value ${receivedValue}.`;
  4878. }
  4879. return message;
  4880. }
  4881. function styleValue(value, type) {
  4882. if (type === "String") {
  4883. return `"${value}"`;
  4884. } else if (type === "Number") {
  4885. return `${Number(value)}`;
  4886. } else {
  4887. return `${value}`;
  4888. }
  4889. }
  4890. function isExplicable(type) {
  4891. const explicitTypes = ["string", "number", "boolean"];
  4892. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4893. }
  4894. function isBoolean(...args) {
  4895. return args.some((elem) => elem.toLowerCase() === "boolean");
  4896. }
  4897. function createAppContext() {
  4898. return {
  4899. app: null,
  4900. config: {
  4901. isNativeTag: NO,
  4902. performance: false,
  4903. globalProperties: {},
  4904. optionMergeStrategies: {},
  4905. errorHandler: void 0,
  4906. warnHandler: void 0,
  4907. compilerOptions: {}
  4908. },
  4909. mixins: [],
  4910. components: {},
  4911. directives: {},
  4912. provides: /* @__PURE__ */ Object.create(null),
  4913. optionsCache: /* @__PURE__ */ new WeakMap(),
  4914. propsCache: /* @__PURE__ */ new WeakMap(),
  4915. emitsCache: /* @__PURE__ */ new WeakMap()
  4916. };
  4917. }
  4918. let uid$1 = 0;
  4919. function createAppAPI(render, hydrate) {
  4920. return function createApp2(rootComponent, rootProps = null) {
  4921. if (!isFunction$1(rootComponent)) {
  4922. rootComponent = Object.assign({}, rootComponent);
  4923. }
  4924. if (rootProps != null && !isObject$2(rootProps)) {
  4925. warn$2(`root props passed to app.mount() must be an object.`);
  4926. rootProps = null;
  4927. }
  4928. const context = createAppContext();
  4929. const installedPlugins = /* @__PURE__ */ new Set();
  4930. const app = context.app = {
  4931. _uid: uid$1++,
  4932. _component: rootComponent,
  4933. _props: rootProps,
  4934. _container: null,
  4935. _context: context,
  4936. _instance: null,
  4937. version,
  4938. get config() {
  4939. return context.config;
  4940. },
  4941. set config(v2) {
  4942. {
  4943. warn$2(`app.config cannot be replaced. Modify individual options instead.`);
  4944. }
  4945. },
  4946. use(plugin2, ...options) {
  4947. if (installedPlugins.has(plugin2)) {
  4948. warn$2(`Plugin has already been applied to target app.`);
  4949. } else if (plugin2 && isFunction$1(plugin2.install)) {
  4950. installedPlugins.add(plugin2);
  4951. plugin2.install(app, ...options);
  4952. } else if (isFunction$1(plugin2)) {
  4953. installedPlugins.add(plugin2);
  4954. plugin2(app, ...options);
  4955. } else {
  4956. warn$2(`A plugin must either be a function or an object with an "install" function.`);
  4957. }
  4958. return app;
  4959. },
  4960. mixin(mixin) {
  4961. {
  4962. if (!context.mixins.includes(mixin)) {
  4963. context.mixins.push(mixin);
  4964. } else {
  4965. warn$2("Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : ""));
  4966. }
  4967. }
  4968. return app;
  4969. },
  4970. component(name, component) {
  4971. {
  4972. validateComponentName(name, context.config);
  4973. }
  4974. if (!component) {
  4975. return context.components[name];
  4976. }
  4977. if (context.components[name]) {
  4978. warn$2(`Component "${name}" has already been registered in target app.`);
  4979. }
  4980. context.components[name] = component;
  4981. return app;
  4982. },
  4983. directive(name, directive) {
  4984. {
  4985. validateDirectiveName(name);
  4986. }
  4987. if (!directive) {
  4988. return context.directives[name];
  4989. }
  4990. if (context.directives[name]) {
  4991. warn$2(`Directive "${name}" has already been registered in target app.`);
  4992. }
  4993. context.directives[name] = directive;
  4994. return app;
  4995. },
  4996. // fixed by xxxxxx
  4997. mount() {
  4998. },
  4999. // fixed by xxxxxx
  5000. unmount() {
  5001. },
  5002. provide(key, value) {
  5003. if (key in context.provides) {
  5004. warn$2(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
  5005. }
  5006. context.provides[key] = value;
  5007. return app;
  5008. }
  5009. };
  5010. return app;
  5011. };
  5012. }
  5013. let supported;
  5014. let perf;
  5015. function startMeasure(instance, type) {
  5016. if (instance.appContext.config.performance && isSupported()) {
  5017. perf.mark(`vue-${type}-${instance.uid}`);
  5018. }
  5019. {
  5020. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  5021. }
  5022. }
  5023. function endMeasure(instance, type) {
  5024. if (instance.appContext.config.performance && isSupported()) {
  5025. const startTag = `vue-${type}-${instance.uid}`;
  5026. const endTag = startTag + `:end`;
  5027. perf.mark(endTag);
  5028. perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);
  5029. perf.clearMarks(startTag);
  5030. perf.clearMarks(endTag);
  5031. }
  5032. {
  5033. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  5034. }
  5035. }
  5036. function isSupported() {
  5037. if (supported !== void 0) {
  5038. return supported;
  5039. }
  5040. if (typeof window !== "undefined" && window.performance) {
  5041. supported = true;
  5042. perf = window.performance;
  5043. } else {
  5044. supported = false;
  5045. }
  5046. return supported;
  5047. }
  5048. const queuePostRenderEffect$1 = queuePostFlushCb;
  5049. const Fragment = Symbol("Fragment");
  5050. const Text = Symbol("Text");
  5051. const Comment = Symbol("Comment");
  5052. const Static = Symbol("Static");
  5053. function isVNode(value) {
  5054. return value ? value.__v_isVNode === true : false;
  5055. }
  5056. const InternalObjectKey = `__vInternal`;
  5057. function guardReactiveProps(props) {
  5058. if (!props)
  5059. return null;
  5060. return isProxy(props) || InternalObjectKey in props ? extend$1({}, props) : props;
  5061. }
  5062. const emptyAppContext = createAppContext();
  5063. let uid = 0;
  5064. function createComponentInstance(vnode, parent, suspense) {
  5065. const type = vnode.type;
  5066. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  5067. const instance = {
  5068. uid: uid++,
  5069. vnode,
  5070. type,
  5071. parent,
  5072. appContext,
  5073. root: null,
  5074. next: null,
  5075. subTree: null,
  5076. effect: null,
  5077. update: null,
  5078. scope: new EffectScope(
  5079. true
  5080. /* detached */
  5081. ),
  5082. render: null,
  5083. proxy: null,
  5084. exposed: null,
  5085. exposeProxy: null,
  5086. withProxy: null,
  5087. provides: parent ? parent.provides : Object.create(appContext.provides),
  5088. accessCache: null,
  5089. renderCache: [],
  5090. // local resolved assets
  5091. components: null,
  5092. directives: null,
  5093. // resolved props and emits options
  5094. propsOptions: normalizePropsOptions(type, appContext),
  5095. emitsOptions: normalizeEmitsOptions(type, appContext),
  5096. // emit
  5097. emit: null,
  5098. emitted: null,
  5099. // props default value
  5100. propsDefaults: EMPTY_OBJ,
  5101. // inheritAttrs
  5102. inheritAttrs: type.inheritAttrs,
  5103. // state
  5104. ctx: EMPTY_OBJ,
  5105. data: EMPTY_OBJ,
  5106. props: EMPTY_OBJ,
  5107. attrs: EMPTY_OBJ,
  5108. slots: EMPTY_OBJ,
  5109. refs: EMPTY_OBJ,
  5110. setupState: EMPTY_OBJ,
  5111. setupContext: null,
  5112. // suspense related
  5113. suspense,
  5114. suspenseId: suspense ? suspense.pendingId : 0,
  5115. asyncDep: null,
  5116. asyncResolved: false,
  5117. // lifecycle hooks
  5118. // not using enums here because it results in computed properties
  5119. isMounted: false,
  5120. isUnmounted: false,
  5121. isDeactivated: false,
  5122. bc: null,
  5123. c: null,
  5124. bm: null,
  5125. m: null,
  5126. bu: null,
  5127. u: null,
  5128. um: null,
  5129. bum: null,
  5130. da: null,
  5131. a: null,
  5132. rtg: null,
  5133. rtc: null,
  5134. ec: null,
  5135. sp: null
  5136. };
  5137. {
  5138. instance.ctx = createDevRenderContext(instance);
  5139. }
  5140. instance.root = parent ? parent.root : instance;
  5141. instance.emit = emit.bind(null, instance);
  5142. if (vnode.ce) {
  5143. vnode.ce(instance);
  5144. }
  5145. return instance;
  5146. }
  5147. let currentInstance = null;
  5148. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  5149. const setCurrentInstance = (instance) => {
  5150. currentInstance = instance;
  5151. instance.scope.on();
  5152. };
  5153. const unsetCurrentInstance = () => {
  5154. currentInstance && currentInstance.scope.off();
  5155. currentInstance = null;
  5156. };
  5157. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  5158. function validateComponentName(name, config) {
  5159. const appIsNativeTag = config.isNativeTag || NO;
  5160. if (isBuiltInTag(name) || appIsNativeTag(name)) {
  5161. warn$2("Do not use built-in or reserved HTML elements as component id: " + name);
  5162. }
  5163. }
  5164. function isStatefulComponent(instance) {
  5165. return instance.vnode.shapeFlag & 4;
  5166. }
  5167. let isInSSRComponentSetup = false;
  5168. function setupComponent(instance, isSSR = false) {
  5169. isInSSRComponentSetup = isSSR;
  5170. const {
  5171. props
  5172. /*, children*/
  5173. } = instance.vnode;
  5174. const isStateful = isStatefulComponent(instance);
  5175. initProps$1(instance, props, isStateful, isSSR);
  5176. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  5177. isInSSRComponentSetup = false;
  5178. return setupResult;
  5179. }
  5180. function setupStatefulComponent(instance, isSSR) {
  5181. const Component2 = instance.type;
  5182. {
  5183. if (Component2.name) {
  5184. validateComponentName(Component2.name, instance.appContext.config);
  5185. }
  5186. if (Component2.components) {
  5187. const names = Object.keys(Component2.components);
  5188. for (let i2 = 0; i2 < names.length; i2++) {
  5189. validateComponentName(names[i2], instance.appContext.config);
  5190. }
  5191. }
  5192. if (Component2.directives) {
  5193. const names = Object.keys(Component2.directives);
  5194. for (let i2 = 0; i2 < names.length; i2++) {
  5195. validateDirectiveName(names[i2]);
  5196. }
  5197. }
  5198. if (Component2.compilerOptions && isRuntimeOnly()) {
  5199. warn$2(`"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`);
  5200. }
  5201. }
  5202. instance.accessCache = /* @__PURE__ */ Object.create(null);
  5203. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  5204. {
  5205. exposePropsOnRenderContext(instance);
  5206. }
  5207. const { setup } = Component2;
  5208. if (setup) {
  5209. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  5210. setCurrentInstance(instance);
  5211. pauseTracking();
  5212. const setupResult = callWithErrorHandling(setup, instance, 0, [shallowReadonly(instance.props), setupContext]);
  5213. resetTracking();
  5214. unsetCurrentInstance();
  5215. if (isPromise(setupResult)) {
  5216. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  5217. {
  5218. warn$2(`setup() returned a Promise, but the version of Vue you are using does not support it yet.`);
  5219. }
  5220. } else {
  5221. handleSetupResult(instance, setupResult, isSSR);
  5222. }
  5223. } else {
  5224. finishComponentSetup(instance, isSSR);
  5225. }
  5226. }
  5227. function handleSetupResult(instance, setupResult, isSSR) {
  5228. if (isFunction$1(setupResult)) {
  5229. {
  5230. instance.render = setupResult;
  5231. }
  5232. } else if (isObject$2(setupResult)) {
  5233. if (isVNode(setupResult)) {
  5234. warn$2(`setup() should not return VNodes directly - return a render function instead.`);
  5235. }
  5236. {
  5237. instance.devtoolsRawSetupState = setupResult;
  5238. }
  5239. instance.setupState = proxyRefs(setupResult);
  5240. {
  5241. exposeSetupStateOnRenderContext(instance);
  5242. }
  5243. } else if (setupResult !== void 0) {
  5244. warn$2(`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`);
  5245. }
  5246. finishComponentSetup(instance, isSSR);
  5247. }
  5248. let compile;
  5249. const isRuntimeOnly = () => !compile;
  5250. function finishComponentSetup(instance, isSSR, skipOptions) {
  5251. const Component2 = instance.type;
  5252. if (!instance.render) {
  5253. instance.render = Component2.render || NOOP;
  5254. }
  5255. {
  5256. setCurrentInstance(instance);
  5257. pauseTracking();
  5258. applyOptions$1(instance);
  5259. resetTracking();
  5260. unsetCurrentInstance();
  5261. }
  5262. if (!Component2.render && instance.render === NOOP && !isSSR) {
  5263. if (Component2.template) {
  5264. warn$2(
  5265. `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  5266. /* should not happen */
  5267. );
  5268. } else {
  5269. warn$2(`Component is missing template or render function.`);
  5270. }
  5271. }
  5272. }
  5273. function createAttrsProxy(instance) {
  5274. return new Proxy(
  5275. instance.attrs,
  5276. {
  5277. get(target, key) {
  5278. track(instance, "get", "$attrs");
  5279. return target[key];
  5280. },
  5281. set() {
  5282. warn$2(`setupContext.attrs is readonly.`);
  5283. return false;
  5284. },
  5285. deleteProperty() {
  5286. warn$2(`setupContext.attrs is readonly.`);
  5287. return false;
  5288. }
  5289. }
  5290. );
  5291. }
  5292. function createSetupContext(instance) {
  5293. const expose = (exposed) => {
  5294. {
  5295. if (instance.exposed) {
  5296. warn$2(`expose() should be called only once per setup().`);
  5297. }
  5298. if (exposed != null) {
  5299. let exposedType = typeof exposed;
  5300. if (exposedType === "object") {
  5301. if (isArray$1(exposed)) {
  5302. exposedType = "array";
  5303. } else if (isRef(exposed)) {
  5304. exposedType = "ref";
  5305. }
  5306. }
  5307. if (exposedType !== "object") {
  5308. warn$2(`expose() should be passed a plain object, received ${exposedType}.`);
  5309. }
  5310. }
  5311. }
  5312. instance.exposed = exposed || {};
  5313. };
  5314. let attrs;
  5315. {
  5316. return Object.freeze({
  5317. get attrs() {
  5318. return attrs || (attrs = createAttrsProxy(instance));
  5319. },
  5320. get slots() {
  5321. return shallowReadonly(instance.slots);
  5322. },
  5323. get emit() {
  5324. return (event, ...args) => instance.emit(event, ...args);
  5325. },
  5326. expose
  5327. });
  5328. }
  5329. }
  5330. function getExposeProxy(instance) {
  5331. if (instance.exposed) {
  5332. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  5333. get(target, key) {
  5334. if (key in target) {
  5335. return target[key];
  5336. }
  5337. return instance.proxy[key];
  5338. },
  5339. has(target, key) {
  5340. return key in target || key in publicPropertiesMap;
  5341. }
  5342. }));
  5343. }
  5344. }
  5345. const classifyRE = /(?:^|[-_])(\w)/g;
  5346. const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
  5347. function getComponentName(Component2, includeInferred = true) {
  5348. return isFunction$1(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  5349. }
  5350. function formatComponentName(instance, Component2, isRoot = false) {
  5351. let name = getComponentName(Component2);
  5352. if (!name && Component2.__file) {
  5353. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  5354. if (match) {
  5355. name = match[1];
  5356. }
  5357. }
  5358. if (!name && instance && instance.parent) {
  5359. const inferFromRegistry = (registry) => {
  5360. for (const key in registry) {
  5361. if (registry[key] === Component2) {
  5362. return key;
  5363. }
  5364. }
  5365. };
  5366. name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
  5367. }
  5368. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  5369. }
  5370. const computed = (getterOrOptions, debugOptions) => {
  5371. return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  5372. };
  5373. const version = "3.2.47";
  5374. function unwrapper(target) {
  5375. return unref(target);
  5376. }
  5377. const ARRAYTYPE = "[object Array]";
  5378. const OBJECTTYPE = "[object Object]";
  5379. function diff$1(current, pre) {
  5380. const result = {};
  5381. syncKeys(current, pre);
  5382. _diff(current, pre, "", result);
  5383. return result;
  5384. }
  5385. function syncKeys(current, pre) {
  5386. current = unwrapper(current);
  5387. if (current === pre)
  5388. return;
  5389. const rootCurrentType = toTypeString(current);
  5390. const rootPreType = toTypeString(pre);
  5391. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  5392. for (let key in pre) {
  5393. const currentValue = current[key];
  5394. if (currentValue === void 0) {
  5395. current[key] = null;
  5396. } else {
  5397. syncKeys(currentValue, pre[key]);
  5398. }
  5399. }
  5400. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  5401. if (current.length >= pre.length) {
  5402. pre.forEach((item, index2) => {
  5403. syncKeys(current[index2], item);
  5404. });
  5405. }
  5406. }
  5407. }
  5408. function _diff(current, pre, path, result) {
  5409. current = unwrapper(current);
  5410. if (current === pre)
  5411. return;
  5412. const rootCurrentType = toTypeString(current);
  5413. const rootPreType = toTypeString(pre);
  5414. if (rootCurrentType == OBJECTTYPE) {
  5415. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  5416. setResult(result, path, current);
  5417. } else {
  5418. for (let key in current) {
  5419. const currentValue = unwrapper(current[key]);
  5420. const preValue = pre[key];
  5421. const currentType = toTypeString(currentValue);
  5422. const preType = toTypeString(preValue);
  5423. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  5424. if (currentValue != preValue) {
  5425. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5426. }
  5427. } else if (currentType == ARRAYTYPE) {
  5428. if (preType != ARRAYTYPE) {
  5429. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5430. } else {
  5431. if (currentValue.length < preValue.length) {
  5432. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5433. } else {
  5434. currentValue.forEach((item, index2) => {
  5435. _diff(item, preValue[index2], (path == "" ? "" : path + ".") + key + "[" + index2 + "]", result);
  5436. });
  5437. }
  5438. }
  5439. } else if (currentType == OBJECTTYPE) {
  5440. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  5441. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  5442. } else {
  5443. for (let subKey in currentValue) {
  5444. _diff(currentValue[subKey], preValue[subKey], (path == "" ? "" : path + ".") + key + "." + subKey, result);
  5445. }
  5446. }
  5447. }
  5448. }
  5449. }
  5450. } else if (rootCurrentType == ARRAYTYPE) {
  5451. if (rootPreType != ARRAYTYPE) {
  5452. setResult(result, path, current);
  5453. } else {
  5454. if (current.length < pre.length) {
  5455. setResult(result, path, current);
  5456. } else {
  5457. current.forEach((item, index2) => {
  5458. _diff(item, pre[index2], path + "[" + index2 + "]", result);
  5459. });
  5460. }
  5461. }
  5462. } else {
  5463. setResult(result, path, current);
  5464. }
  5465. }
  5466. function setResult(result, k2, v2) {
  5467. result[k2] = v2;
  5468. }
  5469. function hasComponentEffect(instance) {
  5470. return queue.includes(instance.update);
  5471. }
  5472. function flushCallbacks(instance) {
  5473. const ctx = instance.ctx;
  5474. const callbacks = ctx.__next_tick_callbacks;
  5475. if (callbacks && callbacks.length) {
  5476. const copies = callbacks.slice(0);
  5477. callbacks.length = 0;
  5478. for (let i2 = 0; i2 < copies.length; i2++) {
  5479. copies[i2]();
  5480. }
  5481. }
  5482. }
  5483. function nextTick(instance, fn) {
  5484. const ctx = instance.ctx;
  5485. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  5486. return nextTick$1(fn && fn.bind(instance.proxy));
  5487. }
  5488. let _resolve;
  5489. if (!ctx.__next_tick_callbacks) {
  5490. ctx.__next_tick_callbacks = [];
  5491. }
  5492. ctx.__next_tick_callbacks.push(() => {
  5493. if (fn) {
  5494. callWithErrorHandling(
  5495. fn.bind(instance.proxy),
  5496. instance,
  5497. 14
  5498. /* ErrorCodes.SCHEDULER */
  5499. );
  5500. } else if (_resolve) {
  5501. _resolve(instance.proxy);
  5502. }
  5503. });
  5504. return new Promise((resolve2) => {
  5505. _resolve = resolve2;
  5506. });
  5507. }
  5508. function clone$2(src, seen) {
  5509. src = unwrapper(src);
  5510. const type = typeof src;
  5511. if (type === "object" && src !== null) {
  5512. let copy = seen.get(src);
  5513. if (typeof copy !== "undefined") {
  5514. return copy;
  5515. }
  5516. if (isArray$1(src)) {
  5517. const len = src.length;
  5518. copy = new Array(len);
  5519. seen.set(src, copy);
  5520. for (let i2 = 0; i2 < len; i2++) {
  5521. copy[i2] = clone$2(src[i2], seen);
  5522. }
  5523. } else {
  5524. copy = {};
  5525. seen.set(src, copy);
  5526. for (const name in src) {
  5527. if (hasOwn$1(src, name)) {
  5528. copy[name] = clone$2(src[name], seen);
  5529. }
  5530. }
  5531. }
  5532. return copy;
  5533. }
  5534. if (type !== "symbol") {
  5535. return src;
  5536. }
  5537. }
  5538. function deepCopy(src) {
  5539. return clone$2(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  5540. }
  5541. function getMPInstanceData(instance, keys2) {
  5542. const data = instance.data;
  5543. const ret = /* @__PURE__ */ Object.create(null);
  5544. keys2.forEach((key) => {
  5545. ret[key] = data[key];
  5546. });
  5547. return ret;
  5548. }
  5549. function patch(instance, data, oldData) {
  5550. if (!data) {
  5551. return;
  5552. }
  5553. data = deepCopy(data);
  5554. const ctx = instance.ctx;
  5555. const mpType = ctx.mpType;
  5556. if (mpType === "page" || mpType === "component") {
  5557. data.r0 = 1;
  5558. const mpInstance = ctx.$scope;
  5559. const keys2 = Object.keys(data);
  5560. const diffData = diff$1(data, oldData || getMPInstanceData(mpInstance, keys2));
  5561. if (Object.keys(diffData).length) {
  5562. ctx.__next_tick_pending = true;
  5563. mpInstance.setData(diffData, () => {
  5564. ctx.__next_tick_pending = false;
  5565. flushCallbacks(instance);
  5566. });
  5567. flushPreFlushCbs();
  5568. } else {
  5569. flushCallbacks(instance);
  5570. }
  5571. }
  5572. }
  5573. function initAppConfig(appConfig) {
  5574. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  5575. return nextTick(this.$, fn);
  5576. };
  5577. }
  5578. function onApplyOptions(options, instance, publicThis) {
  5579. instance.appContext.config.globalProperties.$applyOptions(options, instance, publicThis);
  5580. const computedOptions = options.computed;
  5581. if (computedOptions) {
  5582. const keys2 = Object.keys(computedOptions);
  5583. if (keys2.length) {
  5584. const ctx = instance.ctx;
  5585. if (!ctx.$computedKeys) {
  5586. ctx.$computedKeys = [];
  5587. }
  5588. ctx.$computedKeys.push(...keys2);
  5589. }
  5590. }
  5591. delete instance.ctx.$onApplyOptions;
  5592. }
  5593. function setRef$1(instance, isUnmount = false) {
  5594. const { setupState, $templateRefs, ctx: { $scope, $mpPlatform } } = instance;
  5595. if ($mpPlatform === "mp-alipay") {
  5596. return;
  5597. }
  5598. if (!$templateRefs || !$scope) {
  5599. return;
  5600. }
  5601. if (isUnmount) {
  5602. return $templateRefs.forEach((templateRef) => setTemplateRef(templateRef, null, setupState));
  5603. }
  5604. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  5605. const doSetByRefs = (refs) => {
  5606. const mpComponents = (
  5607. // 字节小程序 selectAllComponents 可能返回 null
  5608. // https://github.com/dcloudio/uni-app/issues/3954
  5609. ($scope.selectAllComponents(".r") || []).concat($scope.selectAllComponents(".r-i-f") || [])
  5610. );
  5611. return refs.filter((templateRef) => {
  5612. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  5613. if (check && refValue === null) {
  5614. return true;
  5615. }
  5616. setTemplateRef(templateRef, refValue, setupState);
  5617. return false;
  5618. });
  5619. };
  5620. const doSet = () => {
  5621. const refs = doSetByRefs($templateRefs);
  5622. if (refs.length && instance.proxy && instance.proxy.$scope) {
  5623. instance.proxy.$scope.setData({ r1: 1 }, () => {
  5624. doSetByRefs(refs);
  5625. });
  5626. }
  5627. };
  5628. if ($scope._$setRef) {
  5629. $scope._$setRef(doSet);
  5630. } else {
  5631. nextTick(instance, doSet);
  5632. }
  5633. }
  5634. function toSkip(value) {
  5635. if (isObject$2(value)) {
  5636. markRaw(value);
  5637. }
  5638. return value;
  5639. }
  5640. function findComponentPublicInstance(mpComponents, id) {
  5641. const mpInstance = mpComponents.find((com) => com && (com.properties || com.props).uI === id);
  5642. if (mpInstance) {
  5643. const vm = mpInstance.$vm;
  5644. if (vm) {
  5645. return getExposeProxy(vm.$) || vm;
  5646. }
  5647. return toSkip(mpInstance);
  5648. }
  5649. return null;
  5650. }
  5651. function setTemplateRef({ r: r2, f: f2 }, refValue, setupState) {
  5652. if (isFunction$1(r2)) {
  5653. r2(refValue, {});
  5654. } else {
  5655. const _isString = isString$1(r2);
  5656. const _isRef = isRef(r2);
  5657. if (_isString || _isRef) {
  5658. if (f2) {
  5659. if (!_isRef) {
  5660. return;
  5661. }
  5662. if (!isArray$1(r2.value)) {
  5663. r2.value = [];
  5664. }
  5665. const existing = r2.value;
  5666. if (existing.indexOf(refValue) === -1) {
  5667. existing.push(refValue);
  5668. if (!refValue) {
  5669. return;
  5670. }
  5671. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  5672. }
  5673. } else if (_isString) {
  5674. if (hasOwn$1(setupState, r2)) {
  5675. setupState[r2] = refValue;
  5676. }
  5677. } else if (isRef(r2)) {
  5678. r2.value = refValue;
  5679. } else {
  5680. warnRef(r2);
  5681. }
  5682. } else {
  5683. warnRef(r2);
  5684. }
  5685. }
  5686. }
  5687. function warnRef(ref2) {
  5688. warn$2("Invalid template ref type:", ref2, `(${typeof ref2})`);
  5689. }
  5690. var MPType;
  5691. (function(MPType2) {
  5692. MPType2["APP"] = "app";
  5693. MPType2["PAGE"] = "page";
  5694. MPType2["COMPONENT"] = "component";
  5695. })(MPType || (MPType = {}));
  5696. const queuePostRenderEffect = queuePostFlushCb;
  5697. function mountComponent(initialVNode, options) {
  5698. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  5699. {
  5700. instance.ctx.$onApplyOptions = onApplyOptions;
  5701. instance.ctx.$children = [];
  5702. }
  5703. if (options.mpType === "app") {
  5704. instance.render = NOOP;
  5705. }
  5706. if (options.onBeforeSetup) {
  5707. options.onBeforeSetup(instance, options);
  5708. }
  5709. {
  5710. pushWarningContext(initialVNode);
  5711. startMeasure(instance, `mount`);
  5712. }
  5713. {
  5714. startMeasure(instance, `init`);
  5715. }
  5716. setupComponent(instance);
  5717. {
  5718. endMeasure(instance, `init`);
  5719. }
  5720. {
  5721. if (options.parentComponent && instance.proxy) {
  5722. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  5723. }
  5724. }
  5725. setupRenderEffect(instance);
  5726. {
  5727. popWarningContext();
  5728. endMeasure(instance, `mount`);
  5729. }
  5730. return instance.proxy;
  5731. }
  5732. const getFunctionalFallthrough = (attrs) => {
  5733. let res;
  5734. for (const key in attrs) {
  5735. if (key === "class" || key === "style" || isOn(key)) {
  5736. (res || (res = {}))[key] = attrs[key];
  5737. }
  5738. }
  5739. return res;
  5740. };
  5741. function renderComponentRoot(instance) {
  5742. const { type: Component2, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit: emit2, render, renderCache, data, setupState, ctx, uid: uid2, appContext: { app: { config: { globalProperties: { pruneComponentPropsCache: pruneComponentPropsCache2 } } } }, inheritAttrs } = instance;
  5743. instance.$templateRefs = [];
  5744. instance.$ei = 0;
  5745. pruneComponentPropsCache2(uid2);
  5746. instance.__counter = instance.__counter === 0 ? 1 : 0;
  5747. let result;
  5748. const prev = setCurrentRenderingInstance(instance);
  5749. try {
  5750. if (vnode.shapeFlag & 4) {
  5751. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  5752. const proxyToUse = withProxy || proxy;
  5753. result = render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx);
  5754. } else {
  5755. fallthroughAttrs(inheritAttrs, props, propsOptions, Component2.props ? attrs : getFunctionalFallthrough(attrs));
  5756. const render2 = Component2;
  5757. result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
  5758. props,
  5759. null
  5760. /* we know it doesn't need it */
  5761. );
  5762. }
  5763. } catch (err) {
  5764. handleError(
  5765. err,
  5766. instance,
  5767. 1
  5768. /* ErrorCodes.RENDER_FUNCTION */
  5769. );
  5770. result = false;
  5771. }
  5772. setRef$1(instance);
  5773. setCurrentRenderingInstance(prev);
  5774. return result;
  5775. }
  5776. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  5777. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  5778. const keys2 = Object.keys(fallthroughAttrs2).filter((key) => key !== "class" && key !== "style");
  5779. if (!keys2.length) {
  5780. return;
  5781. }
  5782. if (propsOptions && keys2.some(isModelListener)) {
  5783. keys2.forEach((key) => {
  5784. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  5785. props[key] = fallthroughAttrs2[key];
  5786. }
  5787. });
  5788. } else {
  5789. keys2.forEach((key) => props[key] = fallthroughAttrs2[key]);
  5790. }
  5791. }
  5792. }
  5793. const updateComponentPreRender = (instance) => {
  5794. pauseTracking();
  5795. flushPreFlushCbs();
  5796. resetTracking();
  5797. };
  5798. function componentUpdateScopedSlotsFn() {
  5799. const scopedSlotsData = this.$scopedSlotsData;
  5800. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  5801. return;
  5802. }
  5803. const mpInstance = this.ctx.$scope;
  5804. const oldData = mpInstance.data;
  5805. const diffData = /* @__PURE__ */ Object.create(null);
  5806. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  5807. const oldScopedSlotData = getValueByDataPath(oldData, path);
  5808. const diffPath = isString$1(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  5809. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  5810. diffData[diffPath] = data;
  5811. } else {
  5812. const diffScopedSlotData = diff$1(data, oldScopedSlotData[index2]);
  5813. Object.keys(diffScopedSlotData).forEach((name) => {
  5814. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  5815. });
  5816. }
  5817. });
  5818. scopedSlotsData.length = 0;
  5819. if (Object.keys(diffData).length) {
  5820. mpInstance.setData(diffData);
  5821. }
  5822. }
  5823. function toggleRecurse({ effect, update }, allowed) {
  5824. effect.allowRecurse = update.allowRecurse = allowed;
  5825. }
  5826. function setupRenderEffect(instance) {
  5827. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(instance);
  5828. instance.$updateScopedSlots = () => nextTick$1(() => queueJob(updateScopedSlots));
  5829. const componentUpdateFn = () => {
  5830. if (!instance.isMounted) {
  5831. onBeforeUnmount(() => {
  5832. setRef$1(instance, true);
  5833. }, instance);
  5834. {
  5835. startMeasure(instance, `patch`);
  5836. }
  5837. patch(instance, renderComponentRoot(instance));
  5838. {
  5839. endMeasure(instance, `patch`);
  5840. }
  5841. {
  5842. devtoolsComponentAdded(instance);
  5843. }
  5844. } else {
  5845. const { next, bu, u: u2 } = instance;
  5846. {
  5847. pushWarningContext(next || instance.vnode);
  5848. }
  5849. toggleRecurse(instance, false);
  5850. updateComponentPreRender();
  5851. if (bu) {
  5852. invokeArrayFns$1(bu);
  5853. }
  5854. toggleRecurse(instance, true);
  5855. {
  5856. startMeasure(instance, `patch`);
  5857. }
  5858. patch(instance, renderComponentRoot(instance));
  5859. {
  5860. endMeasure(instance, `patch`);
  5861. }
  5862. if (u2) {
  5863. queuePostRenderEffect(u2);
  5864. }
  5865. {
  5866. devtoolsComponentUpdated(instance);
  5867. }
  5868. {
  5869. popWarningContext();
  5870. }
  5871. }
  5872. };
  5873. const effect = instance.effect = new ReactiveEffect(
  5874. componentUpdateFn,
  5875. () => queueJob(instance.update),
  5876. instance.scope
  5877. // track it in component's effect scope
  5878. );
  5879. const update = instance.update = effect.run.bind(effect);
  5880. update.id = instance.uid;
  5881. toggleRecurse(instance, true);
  5882. {
  5883. effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  5884. effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  5885. update.ownerInstance = instance;
  5886. }
  5887. update();
  5888. }
  5889. function unmountComponent(instance) {
  5890. const { bum, scope, update, um } = instance;
  5891. if (bum) {
  5892. invokeArrayFns$1(bum);
  5893. }
  5894. scope.stop();
  5895. if (update) {
  5896. update.active = false;
  5897. }
  5898. if (um) {
  5899. queuePostRenderEffect(um);
  5900. }
  5901. queuePostRenderEffect(() => {
  5902. instance.isUnmounted = true;
  5903. });
  5904. {
  5905. devtoolsComponentRemoved(instance);
  5906. }
  5907. }
  5908. const oldCreateApp = createAppAPI();
  5909. function getTarget() {
  5910. if (typeof window !== "undefined") {
  5911. return window;
  5912. }
  5913. if (typeof globalThis !== "undefined") {
  5914. return globalThis;
  5915. }
  5916. if (typeof global !== "undefined") {
  5917. return global;
  5918. }
  5919. if (typeof my !== "undefined") {
  5920. return my;
  5921. }
  5922. }
  5923. function createVueApp(rootComponent, rootProps = null) {
  5924. const target = getTarget();
  5925. target.__VUE__ = true;
  5926. {
  5927. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5928. }
  5929. const app = oldCreateApp(rootComponent, rootProps);
  5930. const appContext = app._context;
  5931. initAppConfig(appContext.config);
  5932. const createVNode = (initialVNode) => {
  5933. initialVNode.appContext = appContext;
  5934. initialVNode.shapeFlag = 6;
  5935. return initialVNode;
  5936. };
  5937. const createComponent2 = function createComponent3(initialVNode, options) {
  5938. return mountComponent(createVNode(initialVNode), options);
  5939. };
  5940. const destroyComponent = function destroyComponent2(component) {
  5941. return component && unmountComponent(component.$);
  5942. };
  5943. app.mount = function mount() {
  5944. rootComponent.render = NOOP;
  5945. const instance = mountComponent(createVNode({ type: rootComponent }), {
  5946. mpType: MPType.APP,
  5947. mpInstance: null,
  5948. parentComponent: null,
  5949. slots: [],
  5950. props: null
  5951. });
  5952. app._instance = instance.$;
  5953. {
  5954. devtoolsInitApp(app, version);
  5955. }
  5956. instance.$app = app;
  5957. instance.$createComponent = createComponent2;
  5958. instance.$destroyComponent = destroyComponent;
  5959. appContext.$appInstance = instance;
  5960. return instance;
  5961. };
  5962. app.unmount = function unmount() {
  5963. warn$2(`Cannot unmount an app.`);
  5964. };
  5965. return app;
  5966. }
  5967. function injectLifecycleHook(name, hook, publicThis, instance) {
  5968. if (isFunction$1(hook)) {
  5969. injectHook(name, hook.bind(publicThis), instance);
  5970. }
  5971. }
  5972. function initHooks$1(options, instance, publicThis) {
  5973. const mpType = options.mpType || publicThis.$mpType;
  5974. if (!mpType || mpType === "component") {
  5975. return;
  5976. }
  5977. Object.keys(options).forEach((name) => {
  5978. if (isUniLifecycleHook(name, options[name], false)) {
  5979. const hooks2 = options[name];
  5980. if (isArray$1(hooks2)) {
  5981. hooks2.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  5982. } else {
  5983. injectLifecycleHook(name, hooks2, publicThis, instance);
  5984. }
  5985. }
  5986. });
  5987. }
  5988. function applyOptions$2(options, instance, publicThis) {
  5989. initHooks$1(options, instance, publicThis);
  5990. }
  5991. function set$3(target, key, val) {
  5992. return target[key] = val;
  5993. }
  5994. function createErrorHandler(app) {
  5995. return function errorHandler(err, instance, _info) {
  5996. if (!instance) {
  5997. throw err;
  5998. }
  5999. const appInstance = app._instance;
  6000. if (!appInstance || !appInstance.proxy) {
  6001. throw err;
  6002. }
  6003. {
  6004. appInstance.proxy.$callHook(ON_ERROR, err);
  6005. }
  6006. };
  6007. }
  6008. function mergeAsArray(to2, from2) {
  6009. return to2 ? [...new Set([].concat(to2, from2))] : from2;
  6010. }
  6011. function initOptionMergeStrategies(optionMergeStrategies) {
  6012. UniLifecycleHooks.forEach((name) => {
  6013. optionMergeStrategies[name] = mergeAsArray;
  6014. });
  6015. }
  6016. let realAtob;
  6017. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  6018. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  6019. if (typeof atob !== "function") {
  6020. realAtob = function(str) {
  6021. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  6022. if (!b64re.test(str)) {
  6023. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  6024. }
  6025. str += "==".slice(2 - (str.length & 3));
  6026. var bitmap;
  6027. var result = "";
  6028. var r1;
  6029. var r2;
  6030. var i2 = 0;
  6031. for (; i2 < str.length; ) {
  6032. bitmap = b64.indexOf(str.charAt(i2++)) << 18 | b64.indexOf(str.charAt(i2++)) << 12 | (r1 = b64.indexOf(str.charAt(i2++))) << 6 | (r2 = b64.indexOf(str.charAt(i2++)));
  6033. 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);
  6034. }
  6035. return result;
  6036. };
  6037. } else {
  6038. realAtob = atob;
  6039. }
  6040. function b64DecodeUnicode(str) {
  6041. return decodeURIComponent(realAtob(str).split("").map(function(c2) {
  6042. return "%" + ("00" + c2.charCodeAt(0).toString(16)).slice(-2);
  6043. }).join(""));
  6044. }
  6045. function getCurrentUserInfo() {
  6046. const token2 = index.getStorageSync("uni_id_token") || "";
  6047. const tokenArr = token2.split(".");
  6048. if (!token2 || tokenArr.length !== 3) {
  6049. return {
  6050. uid: null,
  6051. role: [],
  6052. permission: [],
  6053. tokenExpired: 0
  6054. };
  6055. }
  6056. let userInfo;
  6057. try {
  6058. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  6059. } catch (error) {
  6060. throw new Error("获取当前用户信息出错,详细错误信息为:" + error.message);
  6061. }
  6062. userInfo.tokenExpired = userInfo.exp * 1e3;
  6063. delete userInfo.exp;
  6064. delete userInfo.iat;
  6065. return userInfo;
  6066. }
  6067. function uniIdMixin(globalProperties) {
  6068. globalProperties.uniIDHasRole = function(roleId) {
  6069. const { role } = getCurrentUserInfo();
  6070. return role.indexOf(roleId) > -1;
  6071. };
  6072. globalProperties.uniIDHasPermission = function(permissionId) {
  6073. const { permission } = getCurrentUserInfo();
  6074. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  6075. };
  6076. globalProperties.uniIDTokenValid = function() {
  6077. const { tokenExpired } = getCurrentUserInfo();
  6078. return tokenExpired > Date.now();
  6079. };
  6080. }
  6081. function initApp(app) {
  6082. const appConfig = app._context.config;
  6083. appConfig.errorHandler = invokeCreateErrorHandler(app, createErrorHandler);
  6084. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  6085. const globalProperties = appConfig.globalProperties;
  6086. {
  6087. uniIdMixin(globalProperties);
  6088. }
  6089. {
  6090. globalProperties.$set = set$3;
  6091. globalProperties.$applyOptions = applyOptions$2;
  6092. }
  6093. {
  6094. index.invokeCreateVueAppHook(app);
  6095. }
  6096. }
  6097. const propsCaches = /* @__PURE__ */ Object.create(null);
  6098. function renderProps(props) {
  6099. const { uid: uid2, __counter } = getCurrentInstance();
  6100. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  6101. return uid2 + "," + propsId + "," + __counter;
  6102. }
  6103. function pruneComponentPropsCache(uid2) {
  6104. delete propsCaches[uid2];
  6105. }
  6106. function findComponentPropsData(up) {
  6107. if (!up) {
  6108. return;
  6109. }
  6110. const [uid2, propsId] = up.split(",");
  6111. if (!propsCaches[uid2]) {
  6112. return;
  6113. }
  6114. return propsCaches[uid2][parseInt(propsId)];
  6115. }
  6116. var plugin = {
  6117. install(app) {
  6118. initApp(app);
  6119. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  6120. const oldMount = app.mount;
  6121. app.mount = function mount(rootContainer) {
  6122. const instance = oldMount.call(app, rootContainer);
  6123. const createApp2 = getCreateApp();
  6124. if (createApp2) {
  6125. createApp2(instance);
  6126. } else {
  6127. if (typeof createMiniProgramApp !== "undefined") {
  6128. createMiniProgramApp(instance);
  6129. }
  6130. }
  6131. return instance;
  6132. };
  6133. }
  6134. };
  6135. function getCreateApp() {
  6136. const method = "createApp";
  6137. if (typeof global !== "undefined") {
  6138. return global[method];
  6139. } else if (typeof my !== "undefined") {
  6140. return my[method];
  6141. }
  6142. }
  6143. function vOn(value, key) {
  6144. const instance = getCurrentInstance();
  6145. const ctx = instance.ctx;
  6146. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString$1(key) || typeof key === "number") ? "_" + key : "";
  6147. const name = "e" + instance.$ei++ + extraKey;
  6148. const mpInstance = ctx.$scope;
  6149. if (!value) {
  6150. delete mpInstance[name];
  6151. return name;
  6152. }
  6153. const existingInvoker = mpInstance[name];
  6154. if (existingInvoker) {
  6155. existingInvoker.value = value;
  6156. } else {
  6157. mpInstance[name] = createInvoker(value, instance);
  6158. }
  6159. return name;
  6160. }
  6161. function createInvoker(initialValue, instance) {
  6162. const invoker = (e2) => {
  6163. patchMPEvent(e2);
  6164. let args = [e2];
  6165. if (e2.detail && e2.detail.__args__) {
  6166. args = e2.detail.__args__;
  6167. }
  6168. const eventValue = invoker.value;
  6169. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  6170. const eventTarget = e2.target;
  6171. const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
  6172. if (bubbles.includes(e2.type) && !eventSync) {
  6173. setTimeout(invoke);
  6174. } else {
  6175. const res = invoke();
  6176. if (e2.type === "input" && (isArray$1(res) || isPromise(res))) {
  6177. return;
  6178. }
  6179. return res;
  6180. }
  6181. };
  6182. invoker.value = initialValue;
  6183. return invoker;
  6184. }
  6185. const bubbles = [
  6186. // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
  6187. // 'touchstart',
  6188. // 'touchmove',
  6189. // 'touchcancel',
  6190. // 'touchend',
  6191. "tap",
  6192. "longpress",
  6193. "longtap",
  6194. "transitionend",
  6195. "animationstart",
  6196. "animationiteration",
  6197. "animationend",
  6198. "touchforcechange"
  6199. ];
  6200. function patchMPEvent(event) {
  6201. if (event.type && event.target) {
  6202. event.preventDefault = NOOP;
  6203. event.stopPropagation = NOOP;
  6204. event.stopImmediatePropagation = NOOP;
  6205. if (!hasOwn$1(event, "detail")) {
  6206. event.detail = {};
  6207. }
  6208. if (hasOwn$1(event, "markerId")) {
  6209. event.detail = typeof event.detail === "object" ? event.detail : {};
  6210. event.detail.markerId = event.markerId;
  6211. }
  6212. if (isPlainObject(event.detail) && hasOwn$1(event.detail, "checked") && !hasOwn$1(event.detail, "value")) {
  6213. event.detail.value = event.detail.checked;
  6214. }
  6215. if (isPlainObject(event.detail)) {
  6216. event.target = extend$1({}, event.target, event.detail);
  6217. }
  6218. }
  6219. }
  6220. function patchStopImmediatePropagation(e2, value) {
  6221. if (isArray$1(value)) {
  6222. const originalStop = e2.stopImmediatePropagation;
  6223. e2.stopImmediatePropagation = () => {
  6224. originalStop && originalStop.call(e2);
  6225. e2._stopped = true;
  6226. };
  6227. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  6228. } else {
  6229. return value;
  6230. }
  6231. }
  6232. function vFor(source, renderItem) {
  6233. let ret;
  6234. if (isArray$1(source) || isString$1(source)) {
  6235. ret = new Array(source.length);
  6236. for (let i2 = 0, l2 = source.length; i2 < l2; i2++) {
  6237. ret[i2] = renderItem(source[i2], i2, i2);
  6238. }
  6239. } else if (typeof source === "number") {
  6240. if (!Number.isInteger(source)) {
  6241. warn$2(`The v-for range expect an integer value but got ${source}.`);
  6242. return [];
  6243. }
  6244. ret = new Array(source);
  6245. for (let i2 = 0; i2 < source; i2++) {
  6246. ret[i2] = renderItem(i2 + 1, i2, i2);
  6247. }
  6248. } else if (isObject$2(source)) {
  6249. if (source[Symbol.iterator]) {
  6250. ret = Array.from(source, (item, i2) => renderItem(item, i2, i2));
  6251. } else {
  6252. const keys2 = Object.keys(source);
  6253. ret = new Array(keys2.length);
  6254. for (let i2 = 0, l2 = keys2.length; i2 < l2; i2++) {
  6255. const key = keys2[i2];
  6256. ret[i2] = renderItem(source[key], key, i2);
  6257. }
  6258. }
  6259. } else {
  6260. ret = [];
  6261. }
  6262. return ret;
  6263. }
  6264. function stringifyStyle(value) {
  6265. if (isString$1(value)) {
  6266. return value;
  6267. }
  6268. return stringify(normalizeStyle(value));
  6269. }
  6270. function stringify(styles) {
  6271. let ret = "";
  6272. if (!styles || isString$1(styles)) {
  6273. return ret;
  6274. }
  6275. for (const key in styles) {
  6276. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  6277. }
  6278. return ret;
  6279. }
  6280. function setRef(ref2, id, opts = {}) {
  6281. const { $templateRefs } = getCurrentInstance();
  6282. $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
  6283. }
  6284. const o$1 = (value, key) => vOn(value, key);
  6285. const f$1 = (source, renderItem) => vFor(source, renderItem);
  6286. const s$1 = (value) => stringifyStyle(value);
  6287. const e = (target, ...sources) => extend$1(target, ...sources);
  6288. const n$1 = (value) => normalizeClass(value);
  6289. const t$1 = (val) => toDisplayString(val);
  6290. const p$1 = (props) => renderProps(props);
  6291. const sr = (ref2, id, opts) => setRef(ref2, id, opts);
  6292. function createApp$1(rootComponent, rootProps = null) {
  6293. rootComponent && (rootComponent.mpType = "app");
  6294. return createVueApp(rootComponent, rootProps).use(plugin);
  6295. }
  6296. const createSSRApp = createApp$1;
  6297. const MP_METHODS = [
  6298. "createSelectorQuery",
  6299. "createIntersectionObserver",
  6300. "selectAllComponents",
  6301. "selectComponent"
  6302. ];
  6303. function createEmitFn(oldEmit, ctx) {
  6304. return function emit2(event, ...args) {
  6305. const scope = ctx.$scope;
  6306. if (scope && event) {
  6307. const detail = { __args__: args };
  6308. {
  6309. scope.triggerEvent(event, detail);
  6310. }
  6311. }
  6312. return oldEmit.apply(this, [event, ...args]);
  6313. };
  6314. }
  6315. function initBaseInstance(instance, options) {
  6316. const ctx = instance.ctx;
  6317. ctx.mpType = options.mpType;
  6318. ctx.$mpType = options.mpType;
  6319. ctx.$mpPlatform = "mp-weixin";
  6320. ctx.$scope = options.mpInstance;
  6321. ctx.$mp = {};
  6322. {
  6323. ctx._self = {};
  6324. }
  6325. instance.slots = {};
  6326. if (isArray$1(options.slots) && options.slots.length) {
  6327. options.slots.forEach((name) => {
  6328. instance.slots[name] = true;
  6329. });
  6330. if (instance.slots[SLOT_DEFAULT_NAME]) {
  6331. instance.slots.default = true;
  6332. }
  6333. }
  6334. ctx.getOpenerEventChannel = function() {
  6335. {
  6336. return options.mpInstance.getOpenerEventChannel();
  6337. }
  6338. };
  6339. ctx.$hasHook = hasHook;
  6340. ctx.$callHook = callHook;
  6341. instance.emit = createEmitFn(instance.emit, ctx);
  6342. }
  6343. function initComponentInstance(instance, options) {
  6344. initBaseInstance(instance, options);
  6345. const ctx = instance.ctx;
  6346. MP_METHODS.forEach((method) => {
  6347. ctx[method] = function(...args) {
  6348. const mpInstance = ctx.$scope;
  6349. if (mpInstance && mpInstance[method]) {
  6350. return mpInstance[method].apply(mpInstance, args);
  6351. }
  6352. };
  6353. });
  6354. }
  6355. function initMocks(instance, mpInstance, mocks2) {
  6356. const ctx = instance.ctx;
  6357. mocks2.forEach((mock) => {
  6358. if (hasOwn$1(mpInstance, mock)) {
  6359. instance[mock] = ctx[mock] = mpInstance[mock];
  6360. }
  6361. });
  6362. }
  6363. function hasHook(name) {
  6364. const hooks2 = this.$[name];
  6365. if (hooks2 && hooks2.length) {
  6366. return true;
  6367. }
  6368. return false;
  6369. }
  6370. function callHook(name, args) {
  6371. if (name === "mounted") {
  6372. callHook.call(this, "bm");
  6373. this.$.isMounted = true;
  6374. name = "m";
  6375. }
  6376. const hooks2 = this.$[name];
  6377. return hooks2 && invokeArrayFns(hooks2, args);
  6378. }
  6379. const PAGE_INIT_HOOKS = [
  6380. ON_LOAD,
  6381. ON_SHOW,
  6382. ON_HIDE,
  6383. ON_UNLOAD,
  6384. ON_RESIZE,
  6385. ON_TAB_ITEM_TAP,
  6386. ON_REACH_BOTTOM,
  6387. ON_PULL_DOWN_REFRESH,
  6388. ON_ADD_TO_FAVORITES
  6389. // 'onReady', // lifetimes.ready
  6390. // 'onPageScroll', // 影响性能,开发者手动注册
  6391. // 'onShareTimeline', // 右上角菜单,开发者手动注册
  6392. // 'onShareAppMessage' // 右上角菜单,开发者手动注册
  6393. ];
  6394. function findHooks(vueOptions, hooks2 = /* @__PURE__ */ new Set()) {
  6395. if (vueOptions) {
  6396. Object.keys(vueOptions).forEach((name) => {
  6397. if (isUniLifecycleHook(name, vueOptions[name])) {
  6398. hooks2.add(name);
  6399. }
  6400. });
  6401. {
  6402. const { extends: extendsOptions, mixins } = vueOptions;
  6403. if (mixins) {
  6404. mixins.forEach((mixin) => findHooks(mixin, hooks2));
  6405. }
  6406. if (extendsOptions) {
  6407. findHooks(extendsOptions, hooks2);
  6408. }
  6409. }
  6410. }
  6411. return hooks2;
  6412. }
  6413. function initHook(mpOptions, hook, excludes) {
  6414. if (excludes.indexOf(hook) === -1 && !hasOwn$1(mpOptions, hook)) {
  6415. mpOptions[hook] = function(args) {
  6416. return this.$vm && this.$vm.$callHook(hook, args);
  6417. };
  6418. }
  6419. }
  6420. const EXCLUDE_HOOKS = [ON_READY];
  6421. function initHooks(mpOptions, hooks2, excludes = EXCLUDE_HOOKS) {
  6422. hooks2.forEach((hook) => initHook(mpOptions, hook, excludes));
  6423. }
  6424. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  6425. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  6426. }
  6427. function initRuntimeHooks(mpOptions, runtimeHooks) {
  6428. if (!runtimeHooks) {
  6429. return;
  6430. }
  6431. const hooks2 = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6432. hooks2.forEach((hook) => {
  6433. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  6434. initHook(mpOptions, hook, []);
  6435. }
  6436. });
  6437. }
  6438. const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  6439. const runtimeHooks = [];
  6440. const app = isFunction$1(getApp) && getApp({ allowDefault: true });
  6441. if (app && app.$vm && app.$vm.$) {
  6442. const mixins = app.$vm.$.appContext.mixins;
  6443. if (isArray$1(mixins)) {
  6444. const hooks2 = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  6445. mixins.forEach((mixin) => {
  6446. hooks2.forEach((hook) => {
  6447. if (hasOwn$1(mixin, hook) && !runtimeHooks.includes(hook)) {
  6448. runtimeHooks.push(hook);
  6449. }
  6450. });
  6451. });
  6452. }
  6453. }
  6454. return runtimeHooks;
  6455. });
  6456. function initMixinRuntimeHooks(mpOptions) {
  6457. initHooks(mpOptions, findMixinRuntimeHooks());
  6458. }
  6459. const HOOKS = [
  6460. ON_SHOW,
  6461. ON_HIDE,
  6462. ON_ERROR,
  6463. ON_THEME_CHANGE,
  6464. ON_PAGE_NOT_FOUND,
  6465. ON_UNHANDLE_REJECTION
  6466. ];
  6467. function parseApp(instance, parseAppOptions) {
  6468. const internalInstance = instance.$;
  6469. const appOptions = {
  6470. globalData: instance.$options && instance.$options.globalData || {},
  6471. $vm: instance,
  6472. onLaunch(options) {
  6473. this.$vm = instance;
  6474. const ctx = internalInstance.ctx;
  6475. if (this.$vm && ctx.$scope) {
  6476. return;
  6477. }
  6478. initBaseInstance(internalInstance, {
  6479. mpType: "app",
  6480. mpInstance: this,
  6481. slots: []
  6482. });
  6483. ctx.globalData = this.globalData;
  6484. instance.$callHook(ON_LAUNCH, options);
  6485. }
  6486. };
  6487. initLocale(instance);
  6488. const vueOptions = instance.$.type;
  6489. initHooks(appOptions, HOOKS);
  6490. initUnknownHooks(appOptions, vueOptions);
  6491. {
  6492. const methods = vueOptions.methods;
  6493. methods && extend$1(appOptions, methods);
  6494. }
  6495. if (parseAppOptions) {
  6496. parseAppOptions.parse(appOptions);
  6497. }
  6498. return appOptions;
  6499. }
  6500. function initCreateApp(parseAppOptions) {
  6501. return function createApp2(vm) {
  6502. return App(parseApp(vm, parseAppOptions));
  6503. };
  6504. }
  6505. function initCreateSubpackageApp(parseAppOptions) {
  6506. return function createApp2(vm) {
  6507. const appOptions = parseApp(vm, parseAppOptions);
  6508. const app = isFunction$1(getApp) && getApp({
  6509. allowDefault: true
  6510. });
  6511. if (!app)
  6512. return;
  6513. vm.$.ctx.$scope = app;
  6514. const globalData = app.globalData;
  6515. if (globalData) {
  6516. Object.keys(appOptions.globalData).forEach((name) => {
  6517. if (!hasOwn$1(globalData, name)) {
  6518. globalData[name] = appOptions.globalData[name];
  6519. }
  6520. });
  6521. }
  6522. Object.keys(appOptions).forEach((name) => {
  6523. if (!hasOwn$1(app, name)) {
  6524. app[name] = appOptions[name];
  6525. }
  6526. });
  6527. initAppLifecycle(appOptions, vm);
  6528. };
  6529. }
  6530. function initAppLifecycle(appOptions, vm) {
  6531. if (isFunction$1(appOptions.onLaunch)) {
  6532. const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  6533. appOptions.onLaunch(args);
  6534. }
  6535. if (isFunction$1(appOptions.onShow) && wx.onAppShow) {
  6536. wx.onAppShow((args) => {
  6537. vm.$callHook("onShow", args);
  6538. });
  6539. }
  6540. if (isFunction$1(appOptions.onHide) && wx.onAppHide) {
  6541. wx.onAppHide((args) => {
  6542. vm.$callHook("onHide", args);
  6543. });
  6544. }
  6545. }
  6546. function initLocale(appVm) {
  6547. const locale2 = ref(normalizeLocale$1(wx.getSystemInfoSync().language) || LOCALE_EN);
  6548. Object.defineProperty(appVm, "$locale", {
  6549. get() {
  6550. return locale2.value;
  6551. },
  6552. set(v2) {
  6553. locale2.value = v2;
  6554. }
  6555. });
  6556. }
  6557. function initVueIds(vueIds, mpInstance) {
  6558. if (!vueIds) {
  6559. return;
  6560. }
  6561. const ids = vueIds.split(",");
  6562. const len = ids.length;
  6563. if (len === 1) {
  6564. mpInstance._$vueId = ids[0];
  6565. } else if (len === 2) {
  6566. mpInstance._$vueId = ids[0];
  6567. mpInstance._$vuePid = ids[1];
  6568. }
  6569. }
  6570. const EXTRAS = ["externalClasses"];
  6571. function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  6572. EXTRAS.forEach((name) => {
  6573. if (hasOwn$1(vueOptions, name)) {
  6574. miniProgramComponentOptions[name] = vueOptions[name];
  6575. }
  6576. });
  6577. }
  6578. const WORKLET_RE = /_(.*)_worklet_factory_/;
  6579. function initWorkletMethods(mpMethods, vueMethods) {
  6580. if (vueMethods) {
  6581. Object.keys(vueMethods).forEach((name) => {
  6582. const matches = name.match(WORKLET_RE);
  6583. if (matches) {
  6584. const workletName = matches[1];
  6585. mpMethods[name] = vueMethods[name];
  6586. mpMethods[workletName] = vueMethods[workletName];
  6587. }
  6588. });
  6589. }
  6590. }
  6591. function initWxsCallMethods(methods, wxsCallMethods) {
  6592. if (!isArray$1(wxsCallMethods)) {
  6593. return;
  6594. }
  6595. wxsCallMethods.forEach((callMethod) => {
  6596. methods[callMethod] = function(args) {
  6597. return this.$vm[callMethod](args);
  6598. };
  6599. });
  6600. }
  6601. function selectAllComponents(mpInstance, selector, $refs) {
  6602. const components = mpInstance.selectAllComponents(selector);
  6603. components.forEach((component) => {
  6604. const ref2 = component.properties.uR;
  6605. $refs[ref2] = component.$vm || component;
  6606. });
  6607. }
  6608. function initRefs(instance, mpInstance) {
  6609. Object.defineProperty(instance, "refs", {
  6610. get() {
  6611. const $refs = {};
  6612. selectAllComponents(mpInstance, ".r", $refs);
  6613. const forComponents = mpInstance.selectAllComponents(".r-i-f");
  6614. forComponents.forEach((component) => {
  6615. const ref2 = component.properties.uR;
  6616. if (!ref2) {
  6617. return;
  6618. }
  6619. if (!$refs[ref2]) {
  6620. $refs[ref2] = [];
  6621. }
  6622. $refs[ref2].push(component.$vm || component);
  6623. });
  6624. return $refs;
  6625. }
  6626. });
  6627. }
  6628. function findVmByVueId(instance, vuePid) {
  6629. const $children = instance.$children;
  6630. for (let i2 = $children.length - 1; i2 >= 0; i2--) {
  6631. const childVm = $children[i2];
  6632. if (childVm.$scope._$vueId === vuePid) {
  6633. return childVm;
  6634. }
  6635. }
  6636. let parentVm;
  6637. for (let i2 = $children.length - 1; i2 >= 0; i2--) {
  6638. parentVm = findVmByVueId($children[i2], vuePid);
  6639. if (parentVm) {
  6640. return parentVm;
  6641. }
  6642. }
  6643. }
  6644. const builtInProps = [
  6645. // 百度小程序,快手小程序自定义组件不支持绑定动态事件,动态dataset,故通过props传递事件信息
  6646. // event-opts
  6647. "eO",
  6648. // 组件 ref
  6649. "uR",
  6650. // 组件 ref-in-for
  6651. "uRIF",
  6652. // 组件 id
  6653. "uI",
  6654. // 组件类型 m: 小程序组件
  6655. "uT",
  6656. // 组件 props
  6657. "uP",
  6658. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  6659. "uS"
  6660. ];
  6661. function initDefaultProps(options, isBehavior = false) {
  6662. const properties = {};
  6663. if (!isBehavior) {
  6664. builtInProps.forEach((name) => {
  6665. properties[name] = {
  6666. type: null,
  6667. value: ""
  6668. };
  6669. });
  6670. properties.uS = {
  6671. type: null,
  6672. value: [],
  6673. observer: function(newVal) {
  6674. const $slots = /* @__PURE__ */ Object.create(null);
  6675. newVal && newVal.forEach((slotName) => {
  6676. $slots[slotName] = true;
  6677. });
  6678. this.setData({
  6679. $slots
  6680. });
  6681. }
  6682. };
  6683. }
  6684. if (options.behaviors) {
  6685. if (options.behaviors.includes("wx://form-field")) {
  6686. if (!options.properties || !options.properties.name) {
  6687. properties.name = {
  6688. type: null,
  6689. value: ""
  6690. };
  6691. }
  6692. if (!options.properties || !options.properties.value) {
  6693. properties.value = {
  6694. type: null,
  6695. value: ""
  6696. };
  6697. }
  6698. }
  6699. }
  6700. return properties;
  6701. }
  6702. function initVirtualHostProps(options) {
  6703. const properties = {};
  6704. {
  6705. if (options && options.virtualHost) {
  6706. properties.virtualHostStyle = {
  6707. type: null,
  6708. value: ""
  6709. };
  6710. properties.virtualHostClass = {
  6711. type: null,
  6712. value: ""
  6713. };
  6714. }
  6715. }
  6716. return properties;
  6717. }
  6718. function initProps(mpComponentOptions) {
  6719. if (!mpComponentOptions.properties) {
  6720. mpComponentOptions.properties = {};
  6721. }
  6722. extend$1(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
  6723. }
  6724. const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  6725. function parsePropType(type, defaultValue) {
  6726. if (isArray$1(type) && type.length === 1) {
  6727. return type[0];
  6728. }
  6729. return type;
  6730. }
  6731. function normalizePropType(type, defaultValue) {
  6732. const res = parsePropType(type);
  6733. return PROP_TYPES.indexOf(res) !== -1 ? res : null;
  6734. }
  6735. function initPageProps({ properties }, rawProps) {
  6736. if (isArray$1(rawProps)) {
  6737. rawProps.forEach((key) => {
  6738. properties[key] = {
  6739. type: String,
  6740. value: ""
  6741. };
  6742. });
  6743. } else if (isPlainObject(rawProps)) {
  6744. Object.keys(rawProps).forEach((key) => {
  6745. const opts = rawProps[key];
  6746. if (isPlainObject(opts)) {
  6747. let value = opts.default;
  6748. if (isFunction$1(value)) {
  6749. value = value();
  6750. }
  6751. const type = opts.type;
  6752. opts.type = normalizePropType(type);
  6753. properties[key] = {
  6754. type: opts.type,
  6755. value
  6756. };
  6757. } else {
  6758. properties[key] = {
  6759. type: normalizePropType(opts)
  6760. };
  6761. }
  6762. });
  6763. }
  6764. }
  6765. function findPropsData(properties, isPage2) {
  6766. return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(properties.uP)) || {};
  6767. }
  6768. function findPagePropsData(properties) {
  6769. const propsData = {};
  6770. if (isPlainObject(properties)) {
  6771. Object.keys(properties).forEach((name) => {
  6772. if (builtInProps.indexOf(name) === -1) {
  6773. propsData[name] = properties[name];
  6774. }
  6775. });
  6776. }
  6777. return propsData;
  6778. }
  6779. function initFormField(vm) {
  6780. const vueOptions = vm.$options;
  6781. if (isArray$1(vueOptions.behaviors) && vueOptions.behaviors.includes("uni://form-field")) {
  6782. vm.$watch("modelValue", () => {
  6783. vm.$scope && vm.$scope.setData({
  6784. name: vm.name,
  6785. value: vm.modelValue
  6786. });
  6787. }, {
  6788. immediate: true
  6789. });
  6790. }
  6791. }
  6792. function initData(_2) {
  6793. return {};
  6794. }
  6795. function initPropsObserver(componentOptions) {
  6796. const observe = function observe2() {
  6797. const up = this.properties.uP;
  6798. if (!up) {
  6799. return;
  6800. }
  6801. if (this.$vm) {
  6802. updateComponentProps(up, this.$vm.$);
  6803. } else if (this.properties.uT === "m") {
  6804. updateMiniProgramComponentProperties(up, this);
  6805. }
  6806. };
  6807. {
  6808. if (!componentOptions.observers) {
  6809. componentOptions.observers = {};
  6810. }
  6811. componentOptions.observers.uP = observe;
  6812. }
  6813. }
  6814. function updateMiniProgramComponentProperties(up, mpInstance) {
  6815. const prevProps = mpInstance.properties;
  6816. const nextProps = findComponentPropsData(up) || {};
  6817. if (hasPropsChanged(prevProps, nextProps, false)) {
  6818. mpInstance.setData(nextProps);
  6819. }
  6820. }
  6821. function updateComponentProps(up, instance) {
  6822. const prevProps = toRaw(instance.props);
  6823. const nextProps = findComponentPropsData(up) || {};
  6824. if (hasPropsChanged(prevProps, nextProps)) {
  6825. updateProps(instance, nextProps, prevProps, false);
  6826. if (hasQueueJob(instance.update)) {
  6827. invalidateJob(instance.update);
  6828. }
  6829. {
  6830. instance.update();
  6831. }
  6832. }
  6833. }
  6834. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  6835. const nextKeys = Object.keys(nextProps);
  6836. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  6837. return true;
  6838. }
  6839. for (let i2 = 0; i2 < nextKeys.length; i2++) {
  6840. const key = nextKeys[i2];
  6841. if (nextProps[key] !== prevProps[key]) {
  6842. return true;
  6843. }
  6844. }
  6845. return false;
  6846. }
  6847. function initBehaviors(vueOptions) {
  6848. const vueBehaviors = vueOptions.behaviors;
  6849. let vueProps = vueOptions.props;
  6850. if (!vueProps) {
  6851. vueOptions.props = vueProps = [];
  6852. }
  6853. const behaviors = [];
  6854. if (isArray$1(vueBehaviors)) {
  6855. vueBehaviors.forEach((behavior) => {
  6856. behaviors.push(behavior.replace("uni://", "wx://"));
  6857. if (behavior === "uni://form-field") {
  6858. if (isArray$1(vueProps)) {
  6859. vueProps.push("name");
  6860. vueProps.push("modelValue");
  6861. } else {
  6862. vueProps.name = {
  6863. type: String,
  6864. default: ""
  6865. };
  6866. vueProps.modelValue = {
  6867. type: [String, Number, Boolean, Array, Object, Date],
  6868. default: ""
  6869. };
  6870. }
  6871. }
  6872. });
  6873. }
  6874. return behaviors;
  6875. }
  6876. function applyOptions(componentOptions, vueOptions) {
  6877. componentOptions.data = initData();
  6878. componentOptions.behaviors = initBehaviors(vueOptions);
  6879. }
  6880. function parseComponent(vueOptions, { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  6881. vueOptions = vueOptions.default || vueOptions;
  6882. const options = {
  6883. multipleSlots: true,
  6884. // styleIsolation: 'apply-shared',
  6885. addGlobalClass: true,
  6886. pureDataPattern: /^uP$/
  6887. };
  6888. if (isArray$1(vueOptions.mixins)) {
  6889. vueOptions.mixins.forEach((item) => {
  6890. if (isObject$2(item.options)) {
  6891. extend$1(options, item.options);
  6892. }
  6893. });
  6894. }
  6895. if (vueOptions.options) {
  6896. extend$1(options, vueOptions.options);
  6897. }
  6898. const mpComponentOptions = {
  6899. options,
  6900. lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
  6901. pageLifetimes: {
  6902. show() {
  6903. this.$vm && this.$vm.$callHook("onPageShow");
  6904. },
  6905. hide() {
  6906. this.$vm && this.$vm.$callHook("onPageHide");
  6907. },
  6908. resize(size2) {
  6909. this.$vm && this.$vm.$callHook("onPageResize", size2);
  6910. }
  6911. },
  6912. methods: {
  6913. __l: handleLink2
  6914. }
  6915. };
  6916. {
  6917. applyOptions(mpComponentOptions, vueOptions);
  6918. }
  6919. initProps(mpComponentOptions);
  6920. initPropsObserver(mpComponentOptions);
  6921. initExtraOptions(mpComponentOptions, vueOptions);
  6922. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  6923. {
  6924. initWorkletMethods(mpComponentOptions.methods, vueOptions.methods);
  6925. }
  6926. if (parse2) {
  6927. parse2(mpComponentOptions, { handleLink: handleLink2 });
  6928. }
  6929. return mpComponentOptions;
  6930. }
  6931. function initCreateComponent(parseOptions2) {
  6932. return function createComponent2(vueComponentOptions) {
  6933. return Component(parseComponent(vueComponentOptions, parseOptions2));
  6934. };
  6935. }
  6936. let $createComponentFn;
  6937. let $destroyComponentFn;
  6938. function getAppVm() {
  6939. return getApp().$vm;
  6940. }
  6941. function $createComponent(initialVNode, options) {
  6942. if (!$createComponentFn) {
  6943. $createComponentFn = getAppVm().$createComponent;
  6944. }
  6945. const proxy = $createComponentFn(initialVNode, options);
  6946. return getExposeProxy(proxy.$) || proxy;
  6947. }
  6948. function $destroyComponent(instance) {
  6949. if (!$destroyComponentFn) {
  6950. $destroyComponentFn = getAppVm().$destroyComponent;
  6951. }
  6952. return $destroyComponentFn(instance);
  6953. }
  6954. function parsePage(vueOptions, parseOptions2) {
  6955. const { parse: parse2, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  6956. const miniProgramPageOptions = parseComponent(vueOptions, {
  6957. mocks: mocks2,
  6958. isPage: isPage2,
  6959. initRelation: initRelation2,
  6960. handleLink: handleLink2,
  6961. initLifetimes: initLifetimes2
  6962. });
  6963. initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  6964. const methods = miniProgramPageOptions.methods;
  6965. methods.onLoad = function(query) {
  6966. this.options = query;
  6967. this.$page = {
  6968. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  6969. };
  6970. return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  6971. };
  6972. initHooks(methods, PAGE_INIT_HOOKS);
  6973. {
  6974. initUnknownHooks(methods, vueOptions);
  6975. }
  6976. initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  6977. initMixinRuntimeHooks(methods);
  6978. parse2 && parse2(miniProgramPageOptions, { handleLink: handleLink2 });
  6979. return miniProgramPageOptions;
  6980. }
  6981. function initCreatePage(parseOptions2) {
  6982. return function createPage2(vuePageOptions) {
  6983. return Component(parsePage(vuePageOptions, parseOptions2));
  6984. };
  6985. }
  6986. function initCreatePluginApp(parseAppOptions) {
  6987. return function createApp2(vm) {
  6988. initAppLifecycle(parseApp(vm, parseAppOptions), vm);
  6989. };
  6990. }
  6991. const MPPage = Page;
  6992. const MPComponent = Component;
  6993. function initTriggerEvent(mpInstance) {
  6994. const oldTriggerEvent = mpInstance.triggerEvent;
  6995. const newTriggerEvent = function(event, ...args) {
  6996. return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
  6997. };
  6998. try {
  6999. mpInstance.triggerEvent = newTriggerEvent;
  7000. } catch (error) {
  7001. mpInstance._triggerEvent = newTriggerEvent;
  7002. }
  7003. }
  7004. function initMiniProgramHook(name, options, isComponent) {
  7005. const oldHook = options[name];
  7006. if (!oldHook) {
  7007. options[name] = function() {
  7008. initTriggerEvent(this);
  7009. };
  7010. } else {
  7011. options[name] = function(...args) {
  7012. initTriggerEvent(this);
  7013. return oldHook.apply(this, args);
  7014. };
  7015. }
  7016. }
  7017. Page = function(options) {
  7018. initMiniProgramHook(ON_LOAD, options);
  7019. return MPPage(options);
  7020. };
  7021. Component = function(options) {
  7022. initMiniProgramHook("created", options);
  7023. const isVueComponent = options.properties && options.properties.uP;
  7024. if (!isVueComponent) {
  7025. initProps(options);
  7026. initPropsObserver(options);
  7027. }
  7028. return MPComponent(options);
  7029. };
  7030. function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  7031. return {
  7032. attached() {
  7033. let properties = this.properties;
  7034. initVueIds(properties.uI, this);
  7035. const relationOptions = {
  7036. vuePid: this._$vuePid
  7037. };
  7038. initRelation2(this, relationOptions);
  7039. const mpInstance = this;
  7040. const isMiniProgramPage = isPage2(mpInstance);
  7041. let propsData = properties;
  7042. this.$vm = $createComponent({
  7043. type: vueOptions,
  7044. props: findPropsData(propsData, isMiniProgramPage)
  7045. }, {
  7046. mpType: isMiniProgramPage ? "page" : "component",
  7047. mpInstance,
  7048. slots: properties.uS || {},
  7049. parentComponent: relationOptions.parent && relationOptions.parent.$,
  7050. onBeforeSetup(instance, options) {
  7051. initRefs(instance, mpInstance);
  7052. initMocks(instance, mpInstance, mocks2);
  7053. initComponentInstance(instance, options);
  7054. }
  7055. });
  7056. if (!isMiniProgramPage) {
  7057. initFormField(this.$vm);
  7058. }
  7059. },
  7060. ready() {
  7061. if (this.$vm) {
  7062. {
  7063. this.$vm.$callHook("mounted");
  7064. this.$vm.$callHook(ON_READY);
  7065. }
  7066. }
  7067. },
  7068. detached() {
  7069. if (this.$vm) {
  7070. pruneComponentPropsCache(this.$vm.$.uid);
  7071. $destroyComponent(this.$vm);
  7072. }
  7073. }
  7074. };
  7075. }
  7076. const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  7077. function isPage(mpInstance) {
  7078. return !!mpInstance.route;
  7079. }
  7080. function initRelation(mpInstance, detail) {
  7081. mpInstance.triggerEvent("__l", detail);
  7082. }
  7083. function handleLink(event) {
  7084. const detail = event.detail || event.value;
  7085. const vuePid = detail.vuePid;
  7086. let parentVm;
  7087. if (vuePid) {
  7088. parentVm = findVmByVueId(this.$vm, vuePid);
  7089. }
  7090. if (!parentVm) {
  7091. parentVm = this.$vm;
  7092. }
  7093. detail.parent = parentVm;
  7094. }
  7095. var parseOptions = /* @__PURE__ */ Object.freeze({
  7096. __proto__: null,
  7097. handleLink,
  7098. initLifetimes,
  7099. initRelation,
  7100. isPage,
  7101. mocks
  7102. });
  7103. const createApp = initCreateApp();
  7104. const createPage = initCreatePage(parseOptions);
  7105. const createComponent = initCreateComponent(parseOptions);
  7106. const createPluginApp = initCreatePluginApp();
  7107. const createSubpackageApp = initCreateSubpackageApp();
  7108. {
  7109. wx.createApp = global.createApp = createApp;
  7110. wx.createPage = createPage;
  7111. wx.createComponent = createComponent;
  7112. wx.createPluginApp = global.createPluginApp = createPluginApp;
  7113. wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
  7114. }
  7115. const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
  7116. !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
  7117. };
  7118. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  7119. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  7120. const onPullDownRefresh = /* @__PURE__ */ createHook(ON_PULL_DOWN_REFRESH);
  7121. //! moment.js
  7122. //! version : 2.29.4
  7123. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  7124. //! license : MIT
  7125. //! momentjs.com
  7126. var hookCallback;
  7127. function hooks() {
  7128. return hookCallback.apply(null, arguments);
  7129. }
  7130. function setHookCallback(callback) {
  7131. hookCallback = callback;
  7132. }
  7133. function isArray(input) {
  7134. return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]";
  7135. }
  7136. function isObject(input) {
  7137. return input != null && Object.prototype.toString.call(input) === "[object Object]";
  7138. }
  7139. function hasOwnProp(a2, b2) {
  7140. return Object.prototype.hasOwnProperty.call(a2, b2);
  7141. }
  7142. function isObjectEmpty(obj) {
  7143. if (Object.getOwnPropertyNames) {
  7144. return Object.getOwnPropertyNames(obj).length === 0;
  7145. } else {
  7146. var k2;
  7147. for (k2 in obj) {
  7148. if (hasOwnProp(obj, k2)) {
  7149. return false;
  7150. }
  7151. }
  7152. return true;
  7153. }
  7154. }
  7155. function isUndefined(input) {
  7156. return input === void 0;
  7157. }
  7158. function isNumber(input) {
  7159. return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]";
  7160. }
  7161. function isDate(input) {
  7162. return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
  7163. }
  7164. function map(arr, fn) {
  7165. var res = [], i2, arrLen = arr.length;
  7166. for (i2 = 0; i2 < arrLen; ++i2) {
  7167. res.push(fn(arr[i2], i2));
  7168. }
  7169. return res;
  7170. }
  7171. function extend(a2, b2) {
  7172. for (var i2 in b2) {
  7173. if (hasOwnProp(b2, i2)) {
  7174. a2[i2] = b2[i2];
  7175. }
  7176. }
  7177. if (hasOwnProp(b2, "toString")) {
  7178. a2.toString = b2.toString;
  7179. }
  7180. if (hasOwnProp(b2, "valueOf")) {
  7181. a2.valueOf = b2.valueOf;
  7182. }
  7183. return a2;
  7184. }
  7185. function createUTC(input, format2, locale2, strict) {
  7186. return createLocalOrUTC(input, format2, locale2, strict, true).utc();
  7187. }
  7188. function defaultParsingFlags() {
  7189. return {
  7190. empty: false,
  7191. unusedTokens: [],
  7192. unusedInput: [],
  7193. overflow: -2,
  7194. charsLeftOver: 0,
  7195. nullInput: false,
  7196. invalidEra: null,
  7197. invalidMonth: null,
  7198. invalidFormat: false,
  7199. userInvalidated: false,
  7200. iso: false,
  7201. parsedDateParts: [],
  7202. era: null,
  7203. meridiem: null,
  7204. rfc2822: false,
  7205. weekdayMismatch: false
  7206. };
  7207. }
  7208. function getParsingFlags(m2) {
  7209. if (m2._pf == null) {
  7210. m2._pf = defaultParsingFlags();
  7211. }
  7212. return m2._pf;
  7213. }
  7214. var some;
  7215. if (Array.prototype.some) {
  7216. some = Array.prototype.some;
  7217. } else {
  7218. some = function(fun) {
  7219. var t2 = Object(this), len = t2.length >>> 0, i2;
  7220. for (i2 = 0; i2 < len; i2++) {
  7221. if (i2 in t2 && fun.call(this, t2[i2], i2, t2)) {
  7222. return true;
  7223. }
  7224. }
  7225. return false;
  7226. };
  7227. }
  7228. function isValid(m2) {
  7229. if (m2._isValid == null) {
  7230. var flags = getParsingFlags(m2), parsedParts = some.call(flags.parsedDateParts, function(i2) {
  7231. return i2 != null;
  7232. }), isNowValid = !isNaN(m2._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
  7233. if (m2._strict) {
  7234. isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
  7235. }
  7236. if (Object.isFrozen == null || !Object.isFrozen(m2)) {
  7237. m2._isValid = isNowValid;
  7238. } else {
  7239. return isNowValid;
  7240. }
  7241. }
  7242. return m2._isValid;
  7243. }
  7244. function createInvalid(flags) {
  7245. var m2 = createUTC(NaN);
  7246. if (flags != null) {
  7247. extend(getParsingFlags(m2), flags);
  7248. } else {
  7249. getParsingFlags(m2).userInvalidated = true;
  7250. }
  7251. return m2;
  7252. }
  7253. var momentProperties = hooks.momentProperties = [], updateInProgress = false;
  7254. function copyConfig(to2, from2) {
  7255. var i2, prop, val, momentPropertiesLen = momentProperties.length;
  7256. if (!isUndefined(from2._isAMomentObject)) {
  7257. to2._isAMomentObject = from2._isAMomentObject;
  7258. }
  7259. if (!isUndefined(from2._i)) {
  7260. to2._i = from2._i;
  7261. }
  7262. if (!isUndefined(from2._f)) {
  7263. to2._f = from2._f;
  7264. }
  7265. if (!isUndefined(from2._l)) {
  7266. to2._l = from2._l;
  7267. }
  7268. if (!isUndefined(from2._strict)) {
  7269. to2._strict = from2._strict;
  7270. }
  7271. if (!isUndefined(from2._tzm)) {
  7272. to2._tzm = from2._tzm;
  7273. }
  7274. if (!isUndefined(from2._isUTC)) {
  7275. to2._isUTC = from2._isUTC;
  7276. }
  7277. if (!isUndefined(from2._offset)) {
  7278. to2._offset = from2._offset;
  7279. }
  7280. if (!isUndefined(from2._pf)) {
  7281. to2._pf = getParsingFlags(from2);
  7282. }
  7283. if (!isUndefined(from2._locale)) {
  7284. to2._locale = from2._locale;
  7285. }
  7286. if (momentPropertiesLen > 0) {
  7287. for (i2 = 0; i2 < momentPropertiesLen; i2++) {
  7288. prop = momentProperties[i2];
  7289. val = from2[prop];
  7290. if (!isUndefined(val)) {
  7291. to2[prop] = val;
  7292. }
  7293. }
  7294. }
  7295. return to2;
  7296. }
  7297. function Moment(config) {
  7298. copyConfig(this, config);
  7299. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  7300. if (!this.isValid()) {
  7301. this._d = /* @__PURE__ */ new Date(NaN);
  7302. }
  7303. if (updateInProgress === false) {
  7304. updateInProgress = true;
  7305. hooks.updateOffset(this);
  7306. updateInProgress = false;
  7307. }
  7308. }
  7309. function isMoment(obj) {
  7310. return obj instanceof Moment || obj != null && obj._isAMomentObject != null;
  7311. }
  7312. function warn(msg) {
  7313. if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
  7314. console.warn("Deprecation warning: " + msg);
  7315. }
  7316. }
  7317. function deprecate(msg, fn) {
  7318. var firstTime = true;
  7319. return extend(function() {
  7320. if (hooks.deprecationHandler != null) {
  7321. hooks.deprecationHandler(null, msg);
  7322. }
  7323. if (firstTime) {
  7324. var args = [], arg, i2, key, argLen = arguments.length;
  7325. for (i2 = 0; i2 < argLen; i2++) {
  7326. arg = "";
  7327. if (typeof arguments[i2] === "object") {
  7328. arg += "\n[" + i2 + "] ";
  7329. for (key in arguments[0]) {
  7330. if (hasOwnProp(arguments[0], key)) {
  7331. arg += key + ": " + arguments[0][key] + ", ";
  7332. }
  7333. }
  7334. arg = arg.slice(0, -2);
  7335. } else {
  7336. arg = arguments[i2];
  7337. }
  7338. args.push(arg);
  7339. }
  7340. warn(
  7341. msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack
  7342. );
  7343. firstTime = false;
  7344. }
  7345. return fn.apply(this, arguments);
  7346. }, fn);
  7347. }
  7348. var deprecations = {};
  7349. function deprecateSimple(name, msg) {
  7350. if (hooks.deprecationHandler != null) {
  7351. hooks.deprecationHandler(name, msg);
  7352. }
  7353. if (!deprecations[name]) {
  7354. warn(msg);
  7355. deprecations[name] = true;
  7356. }
  7357. }
  7358. hooks.suppressDeprecationWarnings = false;
  7359. hooks.deprecationHandler = null;
  7360. function isFunction(input) {
  7361. return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
  7362. }
  7363. function set(config) {
  7364. var prop, i2;
  7365. for (i2 in config) {
  7366. if (hasOwnProp(config, i2)) {
  7367. prop = config[i2];
  7368. if (isFunction(prop)) {
  7369. this[i2] = prop;
  7370. } else {
  7371. this["_" + i2] = prop;
  7372. }
  7373. }
  7374. }
  7375. this._config = config;
  7376. this._dayOfMonthOrdinalParseLenient = new RegExp(
  7377. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
  7378. );
  7379. }
  7380. function mergeConfigs(parentConfig, childConfig) {
  7381. var res = extend({}, parentConfig), prop;
  7382. for (prop in childConfig) {
  7383. if (hasOwnProp(childConfig, prop)) {
  7384. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  7385. res[prop] = {};
  7386. extend(res[prop], parentConfig[prop]);
  7387. extend(res[prop], childConfig[prop]);
  7388. } else if (childConfig[prop] != null) {
  7389. res[prop] = childConfig[prop];
  7390. } else {
  7391. delete res[prop];
  7392. }
  7393. }
  7394. }
  7395. for (prop in parentConfig) {
  7396. if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
  7397. res[prop] = extend({}, res[prop]);
  7398. }
  7399. }
  7400. return res;
  7401. }
  7402. function Locale(config) {
  7403. if (config != null) {
  7404. this.set(config);
  7405. }
  7406. }
  7407. var keys;
  7408. if (Object.keys) {
  7409. keys = Object.keys;
  7410. } else {
  7411. keys = function(obj) {
  7412. var i2, res = [];
  7413. for (i2 in obj) {
  7414. if (hasOwnProp(obj, i2)) {
  7415. res.push(i2);
  7416. }
  7417. }
  7418. return res;
  7419. };
  7420. }
  7421. var defaultCalendar = {
  7422. sameDay: "[Today at] LT",
  7423. nextDay: "[Tomorrow at] LT",
  7424. nextWeek: "dddd [at] LT",
  7425. lastDay: "[Yesterday at] LT",
  7426. lastWeek: "[Last] dddd [at] LT",
  7427. sameElse: "L"
  7428. };
  7429. function calendar(key, mom, now2) {
  7430. var output = this._calendar[key] || this._calendar["sameElse"];
  7431. return isFunction(output) ? output.call(mom, now2) : output;
  7432. }
  7433. function zeroFill(number, targetLength, forceSign) {
  7434. var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
  7435. return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  7436. }
  7437. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
  7438. function addFormatToken(token2, padded, ordinal2, callback) {
  7439. var func = callback;
  7440. if (typeof callback === "string") {
  7441. func = function() {
  7442. return this[callback]();
  7443. };
  7444. }
  7445. if (token2) {
  7446. formatTokenFunctions[token2] = func;
  7447. }
  7448. if (padded) {
  7449. formatTokenFunctions[padded[0]] = function() {
  7450. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  7451. };
  7452. }
  7453. if (ordinal2) {
  7454. formatTokenFunctions[ordinal2] = function() {
  7455. return this.localeData().ordinal(
  7456. func.apply(this, arguments),
  7457. token2
  7458. );
  7459. };
  7460. }
  7461. }
  7462. function removeFormattingTokens(input) {
  7463. if (input.match(/\[[\s\S]/)) {
  7464. return input.replace(/^\[|\]$/g, "");
  7465. }
  7466. return input.replace(/\\/g, "");
  7467. }
  7468. function makeFormatFunction(format2) {
  7469. var array = format2.match(formattingTokens), i2, length;
  7470. for (i2 = 0, length = array.length; i2 < length; i2++) {
  7471. if (formatTokenFunctions[array[i2]]) {
  7472. array[i2] = formatTokenFunctions[array[i2]];
  7473. } else {
  7474. array[i2] = removeFormattingTokens(array[i2]);
  7475. }
  7476. }
  7477. return function(mom) {
  7478. var output = "", i3;
  7479. for (i3 = 0; i3 < length; i3++) {
  7480. output += isFunction(array[i3]) ? array[i3].call(mom, format2) : array[i3];
  7481. }
  7482. return output;
  7483. };
  7484. }
  7485. function formatMoment(m2, format2) {
  7486. if (!m2.isValid()) {
  7487. return m2.localeData().invalidDate();
  7488. }
  7489. format2 = expandFormat(format2, m2.localeData());
  7490. formatFunctions[format2] = formatFunctions[format2] || makeFormatFunction(format2);
  7491. return formatFunctions[format2](m2);
  7492. }
  7493. function expandFormat(format2, locale2) {
  7494. var i2 = 5;
  7495. function replaceLongDateFormatTokens(input) {
  7496. return locale2.longDateFormat(input) || input;
  7497. }
  7498. localFormattingTokens.lastIndex = 0;
  7499. while (i2 >= 0 && localFormattingTokens.test(format2)) {
  7500. format2 = format2.replace(
  7501. localFormattingTokens,
  7502. replaceLongDateFormatTokens
  7503. );
  7504. localFormattingTokens.lastIndex = 0;
  7505. i2 -= 1;
  7506. }
  7507. return format2;
  7508. }
  7509. var defaultLongDateFormat = {
  7510. LTS: "h:mm:ss A",
  7511. LT: "h:mm A",
  7512. L: "MM/DD/YYYY",
  7513. LL: "MMMM D, YYYY",
  7514. LLL: "MMMM D, YYYY h:mm A",
  7515. LLLL: "dddd, MMMM D, YYYY h:mm A"
  7516. };
  7517. function longDateFormat(key) {
  7518. var format2 = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()];
  7519. if (format2 || !formatUpper) {
  7520. return format2;
  7521. }
  7522. this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function(tok) {
  7523. if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
  7524. return tok.slice(1);
  7525. }
  7526. return tok;
  7527. }).join("");
  7528. return this._longDateFormat[key];
  7529. }
  7530. var defaultInvalidDate = "Invalid date";
  7531. function invalidDate() {
  7532. return this._invalidDate;
  7533. }
  7534. var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  7535. function ordinal(number) {
  7536. return this._ordinal.replace("%d", number);
  7537. }
  7538. var defaultRelativeTime = {
  7539. future: "in %s",
  7540. past: "%s ago",
  7541. s: "a few seconds",
  7542. ss: "%d seconds",
  7543. m: "a minute",
  7544. mm: "%d minutes",
  7545. h: "an hour",
  7546. hh: "%d hours",
  7547. d: "a day",
  7548. dd: "%d days",
  7549. w: "a week",
  7550. ww: "%d weeks",
  7551. M: "a month",
  7552. MM: "%d months",
  7553. y: "a year",
  7554. yy: "%d years"
  7555. };
  7556. function relativeTime(number, withoutSuffix, string, isFuture) {
  7557. var output = this._relativeTime[string];
  7558. return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
  7559. }
  7560. function pastFuture(diff2, output) {
  7561. var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
  7562. return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
  7563. }
  7564. var aliases = {};
  7565. function addUnitAlias(unit, shorthand) {
  7566. var lowerCase = unit.toLowerCase();
  7567. aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit;
  7568. }
  7569. function normalizeUnits(units) {
  7570. return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
  7571. }
  7572. function normalizeObjectUnits(inputObject) {
  7573. var normalizedInput = {}, normalizedProp, prop;
  7574. for (prop in inputObject) {
  7575. if (hasOwnProp(inputObject, prop)) {
  7576. normalizedProp = normalizeUnits(prop);
  7577. if (normalizedProp) {
  7578. normalizedInput[normalizedProp] = inputObject[prop];
  7579. }
  7580. }
  7581. }
  7582. return normalizedInput;
  7583. }
  7584. var priorities = {};
  7585. function addUnitPriority(unit, priority) {
  7586. priorities[unit] = priority;
  7587. }
  7588. function getPrioritizedUnits(unitsObj) {
  7589. var units = [], u2;
  7590. for (u2 in unitsObj) {
  7591. if (hasOwnProp(unitsObj, u2)) {
  7592. units.push({ unit: u2, priority: priorities[u2] });
  7593. }
  7594. }
  7595. units.sort(function(a2, b2) {
  7596. return a2.priority - b2.priority;
  7597. });
  7598. return units;
  7599. }
  7600. function isLeapYear(year) {
  7601. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  7602. }
  7603. function absFloor(number) {
  7604. if (number < 0) {
  7605. return Math.ceil(number) || 0;
  7606. } else {
  7607. return Math.floor(number);
  7608. }
  7609. }
  7610. function toInt(argumentForCoercion) {
  7611. var coercedNumber = +argumentForCoercion, value = 0;
  7612. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  7613. value = absFloor(coercedNumber);
  7614. }
  7615. return value;
  7616. }
  7617. function makeGetSet(unit, keepTime) {
  7618. return function(value) {
  7619. if (value != null) {
  7620. set$1(this, unit, value);
  7621. hooks.updateOffset(this, keepTime);
  7622. return this;
  7623. } else {
  7624. return get(this, unit);
  7625. }
  7626. };
  7627. }
  7628. function get(mom, unit) {
  7629. return mom.isValid() ? mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]() : NaN;
  7630. }
  7631. function set$1(mom, unit, value) {
  7632. if (mom.isValid() && !isNaN(value)) {
  7633. if (unit === "FullYear" && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
  7634. value = toInt(value);
  7635. mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](
  7636. value,
  7637. mom.month(),
  7638. daysInMonth(value, mom.month())
  7639. );
  7640. } else {
  7641. mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value);
  7642. }
  7643. }
  7644. }
  7645. function stringGet(units) {
  7646. units = normalizeUnits(units);
  7647. if (isFunction(this[units])) {
  7648. return this[units]();
  7649. }
  7650. return this;
  7651. }
  7652. function stringSet(units, value) {
  7653. if (typeof units === "object") {
  7654. units = normalizeObjectUnits(units);
  7655. var prioritized = getPrioritizedUnits(units), i2, prioritizedLen = prioritized.length;
  7656. for (i2 = 0; i2 < prioritizedLen; i2++) {
  7657. this[prioritized[i2].unit](units[prioritized[i2].unit]);
  7658. }
  7659. } else {
  7660. units = normalizeUnits(units);
  7661. if (isFunction(this[units])) {
  7662. return this[units](value);
  7663. }
  7664. }
  7665. return this;
  7666. }
  7667. var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes;
  7668. regexes = {};
  7669. function addRegexToken(token2, regex, strictRegex) {
  7670. regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
  7671. return isStrict && strictRegex ? strictRegex : regex;
  7672. };
  7673. }
  7674. function getParseRegexForToken(token2, config) {
  7675. if (!hasOwnProp(regexes, token2)) {
  7676. return new RegExp(unescapeFormat(token2));
  7677. }
  7678. return regexes[token2](config._strict, config._locale);
  7679. }
  7680. function unescapeFormat(s2) {
  7681. return regexEscape(
  7682. s2.replace("\\", "").replace(
  7683. /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
  7684. function(matched, p1, p2, p3, p4) {
  7685. return p1 || p2 || p3 || p4;
  7686. }
  7687. )
  7688. );
  7689. }
  7690. function regexEscape(s2) {
  7691. return s2.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
  7692. }
  7693. var tokens = {};
  7694. function addParseToken(token2, callback) {
  7695. var i2, func = callback, tokenLen;
  7696. if (typeof token2 === "string") {
  7697. token2 = [token2];
  7698. }
  7699. if (isNumber(callback)) {
  7700. func = function(input, array) {
  7701. array[callback] = toInt(input);
  7702. };
  7703. }
  7704. tokenLen = token2.length;
  7705. for (i2 = 0; i2 < tokenLen; i2++) {
  7706. tokens[token2[i2]] = func;
  7707. }
  7708. }
  7709. function addWeekParseToken(token2, callback) {
  7710. addParseToken(token2, function(input, array, config, token3) {
  7711. config._w = config._w || {};
  7712. callback(input, config._w, config, token3);
  7713. });
  7714. }
  7715. function addTimeToArrayFromToken(token2, input, config) {
  7716. if (input != null && hasOwnProp(tokens, token2)) {
  7717. tokens[token2](input, config._a, config, token2);
  7718. }
  7719. }
  7720. var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
  7721. function mod(n2, x2) {
  7722. return (n2 % x2 + x2) % x2;
  7723. }
  7724. var indexOf;
  7725. if (Array.prototype.indexOf) {
  7726. indexOf = Array.prototype.indexOf;
  7727. } else {
  7728. indexOf = function(o2) {
  7729. var i2;
  7730. for (i2 = 0; i2 < this.length; ++i2) {
  7731. if (this[i2] === o2) {
  7732. return i2;
  7733. }
  7734. }
  7735. return -1;
  7736. };
  7737. }
  7738. function daysInMonth(year, month) {
  7739. if (isNaN(year) || isNaN(month)) {
  7740. return NaN;
  7741. }
  7742. var modMonth = mod(month, 12);
  7743. year += (month - modMonth) / 12;
  7744. return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
  7745. }
  7746. addFormatToken("M", ["MM", 2], "Mo", function() {
  7747. return this.month() + 1;
  7748. });
  7749. addFormatToken("MMM", 0, 0, function(format2) {
  7750. return this.localeData().monthsShort(this, format2);
  7751. });
  7752. addFormatToken("MMMM", 0, 0, function(format2) {
  7753. return this.localeData().months(this, format2);
  7754. });
  7755. addUnitAlias("month", "M");
  7756. addUnitPriority("month", 8);
  7757. addRegexToken("M", match1to2);
  7758. addRegexToken("MM", match1to2, match2);
  7759. addRegexToken("MMM", function(isStrict, locale2) {
  7760. return locale2.monthsShortRegex(isStrict);
  7761. });
  7762. addRegexToken("MMMM", function(isStrict, locale2) {
  7763. return locale2.monthsRegex(isStrict);
  7764. });
  7765. addParseToken(["M", "MM"], function(input, array) {
  7766. array[MONTH] = toInt(input) - 1;
  7767. });
  7768. addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
  7769. var month = config._locale.monthsParse(input, token2, config._strict);
  7770. if (month != null) {
  7771. array[MONTH] = month;
  7772. } else {
  7773. getParsingFlags(config).invalidMonth = input;
  7774. }
  7775. });
  7776. var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
  7777. "_"
  7778. ), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord;
  7779. function localeMonths(m2, format2) {
  7780. if (!m2) {
  7781. return isArray(this._months) ? this._months : this._months["standalone"];
  7782. }
  7783. return isArray(this._months) ? this._months[m2.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format2) ? "format" : "standalone"][m2.month()];
  7784. }
  7785. function localeMonthsShort(m2, format2) {
  7786. if (!m2) {
  7787. return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"];
  7788. }
  7789. return isArray(this._monthsShort) ? this._monthsShort[m2.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m2.month()];
  7790. }
  7791. function handleStrictParse(monthName, format2, strict) {
  7792. var i2, ii, mom, llc = monthName.toLocaleLowerCase();
  7793. if (!this._monthsParse) {
  7794. this._monthsParse = [];
  7795. this._longMonthsParse = [];
  7796. this._shortMonthsParse = [];
  7797. for (i2 = 0; i2 < 12; ++i2) {
  7798. mom = createUTC([2e3, i2]);
  7799. this._shortMonthsParse[i2] = this.monthsShort(
  7800. mom,
  7801. ""
  7802. ).toLocaleLowerCase();
  7803. this._longMonthsParse[i2] = this.months(mom, "").toLocaleLowerCase();
  7804. }
  7805. }
  7806. if (strict) {
  7807. if (format2 === "MMM") {
  7808. ii = indexOf.call(this._shortMonthsParse, llc);
  7809. return ii !== -1 ? ii : null;
  7810. } else {
  7811. ii = indexOf.call(this._longMonthsParse, llc);
  7812. return ii !== -1 ? ii : null;
  7813. }
  7814. } else {
  7815. if (format2 === "MMM") {
  7816. ii = indexOf.call(this._shortMonthsParse, llc);
  7817. if (ii !== -1) {
  7818. return ii;
  7819. }
  7820. ii = indexOf.call(this._longMonthsParse, llc);
  7821. return ii !== -1 ? ii : null;
  7822. } else {
  7823. ii = indexOf.call(this._longMonthsParse, llc);
  7824. if (ii !== -1) {
  7825. return ii;
  7826. }
  7827. ii = indexOf.call(this._shortMonthsParse, llc);
  7828. return ii !== -1 ? ii : null;
  7829. }
  7830. }
  7831. }
  7832. function localeMonthsParse(monthName, format2, strict) {
  7833. var i2, mom, regex;
  7834. if (this._monthsParseExact) {
  7835. return handleStrictParse.call(this, monthName, format2, strict);
  7836. }
  7837. if (!this._monthsParse) {
  7838. this._monthsParse = [];
  7839. this._longMonthsParse = [];
  7840. this._shortMonthsParse = [];
  7841. }
  7842. for (i2 = 0; i2 < 12; i2++) {
  7843. mom = createUTC([2e3, i2]);
  7844. if (strict && !this._longMonthsParse[i2]) {
  7845. this._longMonthsParse[i2] = new RegExp(
  7846. "^" + this.months(mom, "").replace(".", "") + "$",
  7847. "i"
  7848. );
  7849. this._shortMonthsParse[i2] = new RegExp(
  7850. "^" + this.monthsShort(mom, "").replace(".", "") + "$",
  7851. "i"
  7852. );
  7853. }
  7854. if (!strict && !this._monthsParse[i2]) {
  7855. regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
  7856. this._monthsParse[i2] = new RegExp(regex.replace(".", ""), "i");
  7857. }
  7858. if (strict && format2 === "MMMM" && this._longMonthsParse[i2].test(monthName)) {
  7859. return i2;
  7860. } else if (strict && format2 === "MMM" && this._shortMonthsParse[i2].test(monthName)) {
  7861. return i2;
  7862. } else if (!strict && this._monthsParse[i2].test(monthName)) {
  7863. return i2;
  7864. }
  7865. }
  7866. }
  7867. function setMonth(mom, value) {
  7868. var dayOfMonth;
  7869. if (!mom.isValid()) {
  7870. return mom;
  7871. }
  7872. if (typeof value === "string") {
  7873. if (/^\d+$/.test(value)) {
  7874. value = toInt(value);
  7875. } else {
  7876. value = mom.localeData().monthsParse(value);
  7877. if (!isNumber(value)) {
  7878. return mom;
  7879. }
  7880. }
  7881. }
  7882. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  7883. mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth);
  7884. return mom;
  7885. }
  7886. function getSetMonth(value) {
  7887. if (value != null) {
  7888. setMonth(this, value);
  7889. hooks.updateOffset(this, true);
  7890. return this;
  7891. } else {
  7892. return get(this, "Month");
  7893. }
  7894. }
  7895. function getDaysInMonth() {
  7896. return daysInMonth(this.year(), this.month());
  7897. }
  7898. function monthsShortRegex(isStrict) {
  7899. if (this._monthsParseExact) {
  7900. if (!hasOwnProp(this, "_monthsRegex")) {
  7901. computeMonthsParse.call(this);
  7902. }
  7903. if (isStrict) {
  7904. return this._monthsShortStrictRegex;
  7905. } else {
  7906. return this._monthsShortRegex;
  7907. }
  7908. } else {
  7909. if (!hasOwnProp(this, "_monthsShortRegex")) {
  7910. this._monthsShortRegex = defaultMonthsShortRegex;
  7911. }
  7912. return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex;
  7913. }
  7914. }
  7915. function monthsRegex(isStrict) {
  7916. if (this._monthsParseExact) {
  7917. if (!hasOwnProp(this, "_monthsRegex")) {
  7918. computeMonthsParse.call(this);
  7919. }
  7920. if (isStrict) {
  7921. return this._monthsStrictRegex;
  7922. } else {
  7923. return this._monthsRegex;
  7924. }
  7925. } else {
  7926. if (!hasOwnProp(this, "_monthsRegex")) {
  7927. this._monthsRegex = defaultMonthsRegex;
  7928. }
  7929. return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex;
  7930. }
  7931. }
  7932. function computeMonthsParse() {
  7933. function cmpLenRev(a2, b2) {
  7934. return b2.length - a2.length;
  7935. }
  7936. var shortPieces = [], longPieces = [], mixedPieces = [], i2, mom;
  7937. for (i2 = 0; i2 < 12; i2++) {
  7938. mom = createUTC([2e3, i2]);
  7939. shortPieces.push(this.monthsShort(mom, ""));
  7940. longPieces.push(this.months(mom, ""));
  7941. mixedPieces.push(this.months(mom, ""));
  7942. mixedPieces.push(this.monthsShort(mom, ""));
  7943. }
  7944. shortPieces.sort(cmpLenRev);
  7945. longPieces.sort(cmpLenRev);
  7946. mixedPieces.sort(cmpLenRev);
  7947. for (i2 = 0; i2 < 12; i2++) {
  7948. shortPieces[i2] = regexEscape(shortPieces[i2]);
  7949. longPieces[i2] = regexEscape(longPieces[i2]);
  7950. }
  7951. for (i2 = 0; i2 < 24; i2++) {
  7952. mixedPieces[i2] = regexEscape(mixedPieces[i2]);
  7953. }
  7954. this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  7955. this._monthsShortRegex = this._monthsRegex;
  7956. this._monthsStrictRegex = new RegExp(
  7957. "^(" + longPieces.join("|") + ")",
  7958. "i"
  7959. );
  7960. this._monthsShortStrictRegex = new RegExp(
  7961. "^(" + shortPieces.join("|") + ")",
  7962. "i"
  7963. );
  7964. }
  7965. addFormatToken("Y", 0, 0, function() {
  7966. var y2 = this.year();
  7967. return y2 <= 9999 ? zeroFill(y2, 4) : "+" + y2;
  7968. });
  7969. addFormatToken(0, ["YY", 2], 0, function() {
  7970. return this.year() % 100;
  7971. });
  7972. addFormatToken(0, ["YYYY", 4], 0, "year");
  7973. addFormatToken(0, ["YYYYY", 5], 0, "year");
  7974. addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
  7975. addUnitAlias("year", "y");
  7976. addUnitPriority("year", 1);
  7977. addRegexToken("Y", matchSigned);
  7978. addRegexToken("YY", match1to2, match2);
  7979. addRegexToken("YYYY", match1to4, match4);
  7980. addRegexToken("YYYYY", match1to6, match6);
  7981. addRegexToken("YYYYYY", match1to6, match6);
  7982. addParseToken(["YYYYY", "YYYYYY"], YEAR);
  7983. addParseToken("YYYY", function(input, array) {
  7984. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  7985. });
  7986. addParseToken("YY", function(input, array) {
  7987. array[YEAR] = hooks.parseTwoDigitYear(input);
  7988. });
  7989. addParseToken("Y", function(input, array) {
  7990. array[YEAR] = parseInt(input, 10);
  7991. });
  7992. function daysInYear(year) {
  7993. return isLeapYear(year) ? 366 : 365;
  7994. }
  7995. hooks.parseTwoDigitYear = function(input) {
  7996. return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
  7997. };
  7998. var getSetYear = makeGetSet("FullYear", true);
  7999. function getIsLeapYear() {
  8000. return isLeapYear(this.year());
  8001. }
  8002. function createDate(y2, m2, d2, h2, M2, s2, ms2) {
  8003. var date;
  8004. if (y2 < 100 && y2 >= 0) {
  8005. date = new Date(y2 + 400, m2, d2, h2, M2, s2, ms2);
  8006. if (isFinite(date.getFullYear())) {
  8007. date.setFullYear(y2);
  8008. }
  8009. } else {
  8010. date = new Date(y2, m2, d2, h2, M2, s2, ms2);
  8011. }
  8012. return date;
  8013. }
  8014. function createUTCDate(y2) {
  8015. var date, args;
  8016. if (y2 < 100 && y2 >= 0) {
  8017. args = Array.prototype.slice.call(arguments);
  8018. args[0] = y2 + 400;
  8019. date = new Date(Date.UTC.apply(null, args));
  8020. if (isFinite(date.getUTCFullYear())) {
  8021. date.setUTCFullYear(y2);
  8022. }
  8023. } else {
  8024. date = new Date(Date.UTC.apply(null, arguments));
  8025. }
  8026. return date;
  8027. }
  8028. function firstWeekOffset(year, dow, doy) {
  8029. var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  8030. return -fwdlw + fwd - 1;
  8031. }
  8032. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  8033. var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
  8034. if (dayOfYear <= 0) {
  8035. resYear = year - 1;
  8036. resDayOfYear = daysInYear(resYear) + dayOfYear;
  8037. } else if (dayOfYear > daysInYear(year)) {
  8038. resYear = year + 1;
  8039. resDayOfYear = dayOfYear - daysInYear(year);
  8040. } else {
  8041. resYear = year;
  8042. resDayOfYear = dayOfYear;
  8043. }
  8044. return {
  8045. year: resYear,
  8046. dayOfYear: resDayOfYear
  8047. };
  8048. }
  8049. function weekOfYear(mom, dow, doy) {
  8050. var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
  8051. if (week < 1) {
  8052. resYear = mom.year() - 1;
  8053. resWeek = week + weeksInYear(resYear, dow, doy);
  8054. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  8055. resWeek = week - weeksInYear(mom.year(), dow, doy);
  8056. resYear = mom.year() + 1;
  8057. } else {
  8058. resYear = mom.year();
  8059. resWeek = week;
  8060. }
  8061. return {
  8062. week: resWeek,
  8063. year: resYear
  8064. };
  8065. }
  8066. function weeksInYear(year, dow, doy) {
  8067. var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  8068. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  8069. }
  8070. addFormatToken("w", ["ww", 2], "wo", "week");
  8071. addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
  8072. addUnitAlias("week", "w");
  8073. addUnitAlias("isoWeek", "W");
  8074. addUnitPriority("week", 5);
  8075. addUnitPriority("isoWeek", 5);
  8076. addRegexToken("w", match1to2);
  8077. addRegexToken("ww", match1to2, match2);
  8078. addRegexToken("W", match1to2);
  8079. addRegexToken("WW", match1to2, match2);
  8080. addWeekParseToken(
  8081. ["w", "ww", "W", "WW"],
  8082. function(input, week, config, token2) {
  8083. week[token2.substr(0, 1)] = toInt(input);
  8084. }
  8085. );
  8086. function localeWeek(mom) {
  8087. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  8088. }
  8089. var defaultLocaleWeek = {
  8090. dow: 0,
  8091. // Sunday is the first day of the week.
  8092. doy: 6
  8093. // The week that contains Jan 6th is the first week of the year.
  8094. };
  8095. function localeFirstDayOfWeek() {
  8096. return this._week.dow;
  8097. }
  8098. function localeFirstDayOfYear() {
  8099. return this._week.doy;
  8100. }
  8101. function getSetWeek(input) {
  8102. var week = this.localeData().week(this);
  8103. return input == null ? week : this.add((input - week) * 7, "d");
  8104. }
  8105. function getSetISOWeek(input) {
  8106. var week = weekOfYear(this, 1, 4).week;
  8107. return input == null ? week : this.add((input - week) * 7, "d");
  8108. }
  8109. addFormatToken("d", 0, "do", "day");
  8110. addFormatToken("dd", 0, 0, function(format2) {
  8111. return this.localeData().weekdaysMin(this, format2);
  8112. });
  8113. addFormatToken("ddd", 0, 0, function(format2) {
  8114. return this.localeData().weekdaysShort(this, format2);
  8115. });
  8116. addFormatToken("dddd", 0, 0, function(format2) {
  8117. return this.localeData().weekdays(this, format2);
  8118. });
  8119. addFormatToken("e", 0, 0, "weekday");
  8120. addFormatToken("E", 0, 0, "isoWeekday");
  8121. addUnitAlias("day", "d");
  8122. addUnitAlias("weekday", "e");
  8123. addUnitAlias("isoWeekday", "E");
  8124. addUnitPriority("day", 11);
  8125. addUnitPriority("weekday", 11);
  8126. addUnitPriority("isoWeekday", 11);
  8127. addRegexToken("d", match1to2);
  8128. addRegexToken("e", match1to2);
  8129. addRegexToken("E", match1to2);
  8130. addRegexToken("dd", function(isStrict, locale2) {
  8131. return locale2.weekdaysMinRegex(isStrict);
  8132. });
  8133. addRegexToken("ddd", function(isStrict, locale2) {
  8134. return locale2.weekdaysShortRegex(isStrict);
  8135. });
  8136. addRegexToken("dddd", function(isStrict, locale2) {
  8137. return locale2.weekdaysRegex(isStrict);
  8138. });
  8139. addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) {
  8140. var weekday = config._locale.weekdaysParse(input, token2, config._strict);
  8141. if (weekday != null) {
  8142. week.d = weekday;
  8143. } else {
  8144. getParsingFlags(config).invalidWeekday = input;
  8145. }
  8146. });
  8147. addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
  8148. week[token2] = toInt(input);
  8149. });
  8150. function parseWeekday(input, locale2) {
  8151. if (typeof input !== "string") {
  8152. return input;
  8153. }
  8154. if (!isNaN(input)) {
  8155. return parseInt(input, 10);
  8156. }
  8157. input = locale2.weekdaysParse(input);
  8158. if (typeof input === "number") {
  8159. return input;
  8160. }
  8161. return null;
  8162. }
  8163. function parseIsoWeekday(input, locale2) {
  8164. if (typeof input === "string") {
  8165. return locale2.weekdaysParse(input) % 7 || 7;
  8166. }
  8167. return isNaN(input) ? null : input;
  8168. }
  8169. function shiftWeekdays(ws2, n2) {
  8170. return ws2.slice(n2, 7).concat(ws2.slice(0, n2));
  8171. }
  8172. var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord;
  8173. function localeWeekdays(m2, format2) {
  8174. var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m2 && m2 !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
  8175. return m2 === true ? shiftWeekdays(weekdays, this._week.dow) : m2 ? weekdays[m2.day()] : weekdays;
  8176. }
  8177. function localeWeekdaysShort(m2) {
  8178. return m2 === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m2 ? this._weekdaysShort[m2.day()] : this._weekdaysShort;
  8179. }
  8180. function localeWeekdaysMin(m2) {
  8181. return m2 === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m2 ? this._weekdaysMin[m2.day()] : this._weekdaysMin;
  8182. }
  8183. function handleStrictParse$1(weekdayName, format2, strict) {
  8184. var i2, ii, mom, llc = weekdayName.toLocaleLowerCase();
  8185. if (!this._weekdaysParse) {
  8186. this._weekdaysParse = [];
  8187. this._shortWeekdaysParse = [];
  8188. this._minWeekdaysParse = [];
  8189. for (i2 = 0; i2 < 7; ++i2) {
  8190. mom = createUTC([2e3, 1]).day(i2);
  8191. this._minWeekdaysParse[i2] = this.weekdaysMin(
  8192. mom,
  8193. ""
  8194. ).toLocaleLowerCase();
  8195. this._shortWeekdaysParse[i2] = this.weekdaysShort(
  8196. mom,
  8197. ""
  8198. ).toLocaleLowerCase();
  8199. this._weekdaysParse[i2] = this.weekdays(mom, "").toLocaleLowerCase();
  8200. }
  8201. }
  8202. if (strict) {
  8203. if (format2 === "dddd") {
  8204. ii = indexOf.call(this._weekdaysParse, llc);
  8205. return ii !== -1 ? ii : null;
  8206. } else if (format2 === "ddd") {
  8207. ii = indexOf.call(this._shortWeekdaysParse, llc);
  8208. return ii !== -1 ? ii : null;
  8209. } else {
  8210. ii = indexOf.call(this._minWeekdaysParse, llc);
  8211. return ii !== -1 ? ii : null;
  8212. }
  8213. } else {
  8214. if (format2 === "dddd") {
  8215. ii = indexOf.call(this._weekdaysParse, llc);
  8216. if (ii !== -1) {
  8217. return ii;
  8218. }
  8219. ii = indexOf.call(this._shortWeekdaysParse, llc);
  8220. if (ii !== -1) {
  8221. return ii;
  8222. }
  8223. ii = indexOf.call(this._minWeekdaysParse, llc);
  8224. return ii !== -1 ? ii : null;
  8225. } else if (format2 === "ddd") {
  8226. ii = indexOf.call(this._shortWeekdaysParse, llc);
  8227. if (ii !== -1) {
  8228. return ii;
  8229. }
  8230. ii = indexOf.call(this._weekdaysParse, llc);
  8231. if (ii !== -1) {
  8232. return ii;
  8233. }
  8234. ii = indexOf.call(this._minWeekdaysParse, llc);
  8235. return ii !== -1 ? ii : null;
  8236. } else {
  8237. ii = indexOf.call(this._minWeekdaysParse, llc);
  8238. if (ii !== -1) {
  8239. return ii;
  8240. }
  8241. ii = indexOf.call(this._weekdaysParse, llc);
  8242. if (ii !== -1) {
  8243. return ii;
  8244. }
  8245. ii = indexOf.call(this._shortWeekdaysParse, llc);
  8246. return ii !== -1 ? ii : null;
  8247. }
  8248. }
  8249. }
  8250. function localeWeekdaysParse(weekdayName, format2, strict) {
  8251. var i2, mom, regex;
  8252. if (this._weekdaysParseExact) {
  8253. return handleStrictParse$1.call(this, weekdayName, format2, strict);
  8254. }
  8255. if (!this._weekdaysParse) {
  8256. this._weekdaysParse = [];
  8257. this._minWeekdaysParse = [];
  8258. this._shortWeekdaysParse = [];
  8259. this._fullWeekdaysParse = [];
  8260. }
  8261. for (i2 = 0; i2 < 7; i2++) {
  8262. mom = createUTC([2e3, 1]).day(i2);
  8263. if (strict && !this._fullWeekdaysParse[i2]) {
  8264. this._fullWeekdaysParse[i2] = new RegExp(
  8265. "^" + this.weekdays(mom, "").replace(".", "\\.?") + "$",
  8266. "i"
  8267. );
  8268. this._shortWeekdaysParse[i2] = new RegExp(
  8269. "^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$",
  8270. "i"
  8271. );
  8272. this._minWeekdaysParse[i2] = new RegExp(
  8273. "^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$",
  8274. "i"
  8275. );
  8276. }
  8277. if (!this._weekdaysParse[i2]) {
  8278. regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
  8279. this._weekdaysParse[i2] = new RegExp(regex.replace(".", ""), "i");
  8280. }
  8281. if (strict && format2 === "dddd" && this._fullWeekdaysParse[i2].test(weekdayName)) {
  8282. return i2;
  8283. } else if (strict && format2 === "ddd" && this._shortWeekdaysParse[i2].test(weekdayName)) {
  8284. return i2;
  8285. } else if (strict && format2 === "dd" && this._minWeekdaysParse[i2].test(weekdayName)) {
  8286. return i2;
  8287. } else if (!strict && this._weekdaysParse[i2].test(weekdayName)) {
  8288. return i2;
  8289. }
  8290. }
  8291. }
  8292. function getSetDayOfWeek(input) {
  8293. if (!this.isValid()) {
  8294. return input != null ? this : NaN;
  8295. }
  8296. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  8297. if (input != null) {
  8298. input = parseWeekday(input, this.localeData());
  8299. return this.add(input - day, "d");
  8300. } else {
  8301. return day;
  8302. }
  8303. }
  8304. function getSetLocaleDayOfWeek(input) {
  8305. if (!this.isValid()) {
  8306. return input != null ? this : NaN;
  8307. }
  8308. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  8309. return input == null ? weekday : this.add(input - weekday, "d");
  8310. }
  8311. function getSetISODayOfWeek(input) {
  8312. if (!this.isValid()) {
  8313. return input != null ? this : NaN;
  8314. }
  8315. if (input != null) {
  8316. var weekday = parseIsoWeekday(input, this.localeData());
  8317. return this.day(this.day() % 7 ? weekday : weekday - 7);
  8318. } else {
  8319. return this.day() || 7;
  8320. }
  8321. }
  8322. function weekdaysRegex(isStrict) {
  8323. if (this._weekdaysParseExact) {
  8324. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8325. computeWeekdaysParse.call(this);
  8326. }
  8327. if (isStrict) {
  8328. return this._weekdaysStrictRegex;
  8329. } else {
  8330. return this._weekdaysRegex;
  8331. }
  8332. } else {
  8333. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8334. this._weekdaysRegex = defaultWeekdaysRegex;
  8335. }
  8336. return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex;
  8337. }
  8338. }
  8339. function weekdaysShortRegex(isStrict) {
  8340. if (this._weekdaysParseExact) {
  8341. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8342. computeWeekdaysParse.call(this);
  8343. }
  8344. if (isStrict) {
  8345. return this._weekdaysShortStrictRegex;
  8346. } else {
  8347. return this._weekdaysShortRegex;
  8348. }
  8349. } else {
  8350. if (!hasOwnProp(this, "_weekdaysShortRegex")) {
  8351. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  8352. }
  8353. return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  8354. }
  8355. }
  8356. function weekdaysMinRegex(isStrict) {
  8357. if (this._weekdaysParseExact) {
  8358. if (!hasOwnProp(this, "_weekdaysRegex")) {
  8359. computeWeekdaysParse.call(this);
  8360. }
  8361. if (isStrict) {
  8362. return this._weekdaysMinStrictRegex;
  8363. } else {
  8364. return this._weekdaysMinRegex;
  8365. }
  8366. } else {
  8367. if (!hasOwnProp(this, "_weekdaysMinRegex")) {
  8368. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  8369. }
  8370. return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  8371. }
  8372. }
  8373. function computeWeekdaysParse() {
  8374. function cmpLenRev(a2, b2) {
  8375. return b2.length - a2.length;
  8376. }
  8377. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i2, mom, minp, shortp, longp;
  8378. for (i2 = 0; i2 < 7; i2++) {
  8379. mom = createUTC([2e3, 1]).day(i2);
  8380. minp = regexEscape(this.weekdaysMin(mom, ""));
  8381. shortp = regexEscape(this.weekdaysShort(mom, ""));
  8382. longp = regexEscape(this.weekdays(mom, ""));
  8383. minPieces.push(minp);
  8384. shortPieces.push(shortp);
  8385. longPieces.push(longp);
  8386. mixedPieces.push(minp);
  8387. mixedPieces.push(shortp);
  8388. mixedPieces.push(longp);
  8389. }
  8390. minPieces.sort(cmpLenRev);
  8391. shortPieces.sort(cmpLenRev);
  8392. longPieces.sort(cmpLenRev);
  8393. mixedPieces.sort(cmpLenRev);
  8394. this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  8395. this._weekdaysShortRegex = this._weekdaysRegex;
  8396. this._weekdaysMinRegex = this._weekdaysRegex;
  8397. this._weekdaysStrictRegex = new RegExp(
  8398. "^(" + longPieces.join("|") + ")",
  8399. "i"
  8400. );
  8401. this._weekdaysShortStrictRegex = new RegExp(
  8402. "^(" + shortPieces.join("|") + ")",
  8403. "i"
  8404. );
  8405. this._weekdaysMinStrictRegex = new RegExp(
  8406. "^(" + minPieces.join("|") + ")",
  8407. "i"
  8408. );
  8409. }
  8410. function hFormat() {
  8411. return this.hours() % 12 || 12;
  8412. }
  8413. function kFormat() {
  8414. return this.hours() || 24;
  8415. }
  8416. addFormatToken("H", ["HH", 2], 0, "hour");
  8417. addFormatToken("h", ["hh", 2], 0, hFormat);
  8418. addFormatToken("k", ["kk", 2], 0, kFormat);
  8419. addFormatToken("hmm", 0, 0, function() {
  8420. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  8421. });
  8422. addFormatToken("hmmss", 0, 0, function() {
  8423. return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  8424. });
  8425. addFormatToken("Hmm", 0, 0, function() {
  8426. return "" + this.hours() + zeroFill(this.minutes(), 2);
  8427. });
  8428. addFormatToken("Hmmss", 0, 0, function() {
  8429. return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2);
  8430. });
  8431. function meridiem(token2, lowercase) {
  8432. addFormatToken(token2, 0, 0, function() {
  8433. return this.localeData().meridiem(
  8434. this.hours(),
  8435. this.minutes(),
  8436. lowercase
  8437. );
  8438. });
  8439. }
  8440. meridiem("a", true);
  8441. meridiem("A", false);
  8442. addUnitAlias("hour", "h");
  8443. addUnitPriority("hour", 13);
  8444. function matchMeridiem(isStrict, locale2) {
  8445. return locale2._meridiemParse;
  8446. }
  8447. addRegexToken("a", matchMeridiem);
  8448. addRegexToken("A", matchMeridiem);
  8449. addRegexToken("H", match1to2);
  8450. addRegexToken("h", match1to2);
  8451. addRegexToken("k", match1to2);
  8452. addRegexToken("HH", match1to2, match2);
  8453. addRegexToken("hh", match1to2, match2);
  8454. addRegexToken("kk", match1to2, match2);
  8455. addRegexToken("hmm", match3to4);
  8456. addRegexToken("hmmss", match5to6);
  8457. addRegexToken("Hmm", match3to4);
  8458. addRegexToken("Hmmss", match5to6);
  8459. addParseToken(["H", "HH"], HOUR);
  8460. addParseToken(["k", "kk"], function(input, array, config) {
  8461. var kInput = toInt(input);
  8462. array[HOUR] = kInput === 24 ? 0 : kInput;
  8463. });
  8464. addParseToken(["a", "A"], function(input, array, config) {
  8465. config._isPm = config._locale.isPM(input);
  8466. config._meridiem = input;
  8467. });
  8468. addParseToken(["h", "hh"], function(input, array, config) {
  8469. array[HOUR] = toInt(input);
  8470. getParsingFlags(config).bigHour = true;
  8471. });
  8472. addParseToken("hmm", function(input, array, config) {
  8473. var pos = input.length - 2;
  8474. array[HOUR] = toInt(input.substr(0, pos));
  8475. array[MINUTE] = toInt(input.substr(pos));
  8476. getParsingFlags(config).bigHour = true;
  8477. });
  8478. addParseToken("hmmss", function(input, array, config) {
  8479. var pos1 = input.length - 4, pos2 = input.length - 2;
  8480. array[HOUR] = toInt(input.substr(0, pos1));
  8481. array[MINUTE] = toInt(input.substr(pos1, 2));
  8482. array[SECOND] = toInt(input.substr(pos2));
  8483. getParsingFlags(config).bigHour = true;
  8484. });
  8485. addParseToken("Hmm", function(input, array, config) {
  8486. var pos = input.length - 2;
  8487. array[HOUR] = toInt(input.substr(0, pos));
  8488. array[MINUTE] = toInt(input.substr(pos));
  8489. });
  8490. addParseToken("Hmmss", function(input, array, config) {
  8491. var pos1 = input.length - 4, pos2 = input.length - 2;
  8492. array[HOUR] = toInt(input.substr(0, pos1));
  8493. array[MINUTE] = toInt(input.substr(pos1, 2));
  8494. array[SECOND] = toInt(input.substr(pos2));
  8495. });
  8496. function localeIsPM(input) {
  8497. return (input + "").toLowerCase().charAt(0) === "p";
  8498. }
  8499. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true);
  8500. function localeMeridiem(hours2, minutes2, isLower) {
  8501. if (hours2 > 11) {
  8502. return isLower ? "pm" : "PM";
  8503. } else {
  8504. return isLower ? "am" : "AM";
  8505. }
  8506. }
  8507. var baseConfig = {
  8508. calendar: defaultCalendar,
  8509. longDateFormat: defaultLongDateFormat,
  8510. invalidDate: defaultInvalidDate,
  8511. ordinal: defaultOrdinal,
  8512. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  8513. relativeTime: defaultRelativeTime,
  8514. months: defaultLocaleMonths,
  8515. monthsShort: defaultLocaleMonthsShort,
  8516. week: defaultLocaleWeek,
  8517. weekdays: defaultLocaleWeekdays,
  8518. weekdaysMin: defaultLocaleWeekdaysMin,
  8519. weekdaysShort: defaultLocaleWeekdaysShort,
  8520. meridiemParse: defaultLocaleMeridiemParse
  8521. };
  8522. var locales = {}, localeFamilies = {}, globalLocale;
  8523. function commonPrefix(arr1, arr2) {
  8524. var i2, minl = Math.min(arr1.length, arr2.length);
  8525. for (i2 = 0; i2 < minl; i2 += 1) {
  8526. if (arr1[i2] !== arr2[i2]) {
  8527. return i2;
  8528. }
  8529. }
  8530. return minl;
  8531. }
  8532. function normalizeLocale(key) {
  8533. return key ? key.toLowerCase().replace("_", "-") : key;
  8534. }
  8535. function chooseLocale(names) {
  8536. var i2 = 0, j2, next, locale2, split;
  8537. while (i2 < names.length) {
  8538. split = normalizeLocale(names[i2]).split("-");
  8539. j2 = split.length;
  8540. next = normalizeLocale(names[i2 + 1]);
  8541. next = next ? next.split("-") : null;
  8542. while (j2 > 0) {
  8543. locale2 = loadLocale(split.slice(0, j2).join("-"));
  8544. if (locale2) {
  8545. return locale2;
  8546. }
  8547. if (next && next.length >= j2 && commonPrefix(split, next) >= j2 - 1) {
  8548. break;
  8549. }
  8550. j2--;
  8551. }
  8552. i2++;
  8553. }
  8554. return globalLocale;
  8555. }
  8556. function isLocaleNameSane(name) {
  8557. return name.match("^[^/\\\\]*$") != null;
  8558. }
  8559. function loadLocale(name) {
  8560. var oldLocale = null, aliasedRequire;
  8561. if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports && isLocaleNameSane(name)) {
  8562. try {
  8563. oldLocale = globalLocale._abbr;
  8564. aliasedRequire = require;
  8565. aliasedRequire("./locale/" + name);
  8566. getSetGlobalLocale(oldLocale);
  8567. } catch (e2) {
  8568. locales[name] = null;
  8569. }
  8570. }
  8571. return locales[name];
  8572. }
  8573. function getSetGlobalLocale(key, values) {
  8574. var data;
  8575. if (key) {
  8576. if (isUndefined(values)) {
  8577. data = getLocale(key);
  8578. } else {
  8579. data = defineLocale(key, values);
  8580. }
  8581. if (data) {
  8582. globalLocale = data;
  8583. } else {
  8584. if (typeof console !== "undefined" && console.warn) {
  8585. console.warn(
  8586. "Locale " + key + " not found. Did you forget to load it?"
  8587. );
  8588. }
  8589. }
  8590. }
  8591. return globalLocale._abbr;
  8592. }
  8593. function defineLocale(name, config) {
  8594. if (config !== null) {
  8595. var locale2, parentConfig = baseConfig;
  8596. config.abbr = name;
  8597. if (locales[name] != null) {
  8598. deprecateSimple(
  8599. "defineLocaleOverride",
  8600. "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
  8601. );
  8602. parentConfig = locales[name]._config;
  8603. } else if (config.parentLocale != null) {
  8604. if (locales[config.parentLocale] != null) {
  8605. parentConfig = locales[config.parentLocale]._config;
  8606. } else {
  8607. locale2 = loadLocale(config.parentLocale);
  8608. if (locale2 != null) {
  8609. parentConfig = locale2._config;
  8610. } else {
  8611. if (!localeFamilies[config.parentLocale]) {
  8612. localeFamilies[config.parentLocale] = [];
  8613. }
  8614. localeFamilies[config.parentLocale].push({
  8615. name,
  8616. config
  8617. });
  8618. return null;
  8619. }
  8620. }
  8621. }
  8622. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  8623. if (localeFamilies[name]) {
  8624. localeFamilies[name].forEach(function(x2) {
  8625. defineLocale(x2.name, x2.config);
  8626. });
  8627. }
  8628. getSetGlobalLocale(name);
  8629. return locales[name];
  8630. } else {
  8631. delete locales[name];
  8632. return null;
  8633. }
  8634. }
  8635. function updateLocale(name, config) {
  8636. if (config != null) {
  8637. var locale2, tmpLocale, parentConfig = baseConfig;
  8638. if (locales[name] != null && locales[name].parentLocale != null) {
  8639. locales[name].set(mergeConfigs(locales[name]._config, config));
  8640. } else {
  8641. tmpLocale = loadLocale(name);
  8642. if (tmpLocale != null) {
  8643. parentConfig = tmpLocale._config;
  8644. }
  8645. config = mergeConfigs(parentConfig, config);
  8646. if (tmpLocale == null) {
  8647. config.abbr = name;
  8648. }
  8649. locale2 = new Locale(config);
  8650. locale2.parentLocale = locales[name];
  8651. locales[name] = locale2;
  8652. }
  8653. getSetGlobalLocale(name);
  8654. } else {
  8655. if (locales[name] != null) {
  8656. if (locales[name].parentLocale != null) {
  8657. locales[name] = locales[name].parentLocale;
  8658. if (name === getSetGlobalLocale()) {
  8659. getSetGlobalLocale(name);
  8660. }
  8661. } else if (locales[name] != null) {
  8662. delete locales[name];
  8663. }
  8664. }
  8665. }
  8666. return locales[name];
  8667. }
  8668. function getLocale(key) {
  8669. var locale2;
  8670. if (key && key._locale && key._locale._abbr) {
  8671. key = key._locale._abbr;
  8672. }
  8673. if (!key) {
  8674. return globalLocale;
  8675. }
  8676. if (!isArray(key)) {
  8677. locale2 = loadLocale(key);
  8678. if (locale2) {
  8679. return locale2;
  8680. }
  8681. key = [key];
  8682. }
  8683. return chooseLocale(key);
  8684. }
  8685. function listLocales() {
  8686. return keys(locales);
  8687. }
  8688. function checkOverflow(m2) {
  8689. var overflow, a2 = m2._a;
  8690. if (a2 && getParsingFlags(m2).overflow === -2) {
  8691. overflow = a2[MONTH] < 0 || a2[MONTH] > 11 ? MONTH : a2[DATE] < 1 || a2[DATE] > daysInMonth(a2[YEAR], a2[MONTH]) ? DATE : a2[HOUR] < 0 || a2[HOUR] > 24 || a2[HOUR] === 24 && (a2[MINUTE] !== 0 || a2[SECOND] !== 0 || a2[MILLISECOND] !== 0) ? HOUR : a2[MINUTE] < 0 || a2[MINUTE] > 59 ? MINUTE : a2[SECOND] < 0 || a2[SECOND] > 59 ? SECOND : a2[MILLISECOND] < 0 || a2[MILLISECOND] > 999 ? MILLISECOND : -1;
  8692. if (getParsingFlags(m2)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  8693. overflow = DATE;
  8694. }
  8695. if (getParsingFlags(m2)._overflowWeeks && overflow === -1) {
  8696. overflow = WEEK;
  8697. }
  8698. if (getParsingFlags(m2)._overflowWeekday && overflow === -1) {
  8699. overflow = WEEKDAY;
  8700. }
  8701. getParsingFlags(m2).overflow = overflow;
  8702. }
  8703. return m2;
  8704. }
  8705. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [
  8706. ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
  8707. ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
  8708. ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
  8709. ["GGGG-[W]WW", /\d{4}-W\d\d/, false],
  8710. ["YYYY-DDD", /\d{4}-\d{3}/],
  8711. ["YYYY-MM", /\d{4}-\d\d/, false],
  8712. ["YYYYYYMMDD", /[+-]\d{10}/],
  8713. ["YYYYMMDD", /\d{8}/],
  8714. ["GGGG[W]WWE", /\d{4}W\d{3}/],
  8715. ["GGGG[W]WW", /\d{4}W\d{2}/, false],
  8716. ["YYYYDDD", /\d{7}/],
  8717. ["YYYYMM", /\d{6}/, false],
  8718. ["YYYY", /\d{4}/, false]
  8719. ], isoTimes = [
  8720. ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
  8721. ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
  8722. ["HH:mm:ss", /\d\d:\d\d:\d\d/],
  8723. ["HH:mm", /\d\d:\d\d/],
  8724. ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
  8725. ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
  8726. ["HHmmss", /\d\d\d\d\d\d/],
  8727. ["HHmm", /\d\d\d\d/],
  8728. ["HH", /\d\d/]
  8729. ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = {
  8730. UT: 0,
  8731. GMT: 0,
  8732. EDT: -4 * 60,
  8733. EST: -5 * 60,
  8734. CDT: -5 * 60,
  8735. CST: -6 * 60,
  8736. MDT: -6 * 60,
  8737. MST: -7 * 60,
  8738. PDT: -7 * 60,
  8739. PST: -8 * 60
  8740. };
  8741. function configFromISO(config) {
  8742. var i2, l2, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length;
  8743. if (match) {
  8744. getParsingFlags(config).iso = true;
  8745. for (i2 = 0, l2 = isoDatesLen; i2 < l2; i2++) {
  8746. if (isoDates[i2][1].exec(match[1])) {
  8747. dateFormat = isoDates[i2][0];
  8748. allowTime = isoDates[i2][2] !== false;
  8749. break;
  8750. }
  8751. }
  8752. if (dateFormat == null) {
  8753. config._isValid = false;
  8754. return;
  8755. }
  8756. if (match[3]) {
  8757. for (i2 = 0, l2 = isoTimesLen; i2 < l2; i2++) {
  8758. if (isoTimes[i2][1].exec(match[3])) {
  8759. timeFormat = (match[2] || " ") + isoTimes[i2][0];
  8760. break;
  8761. }
  8762. }
  8763. if (timeFormat == null) {
  8764. config._isValid = false;
  8765. return;
  8766. }
  8767. }
  8768. if (!allowTime && timeFormat != null) {
  8769. config._isValid = false;
  8770. return;
  8771. }
  8772. if (match[4]) {
  8773. if (tzRegex.exec(match[4])) {
  8774. tzFormat = "Z";
  8775. } else {
  8776. config._isValid = false;
  8777. return;
  8778. }
  8779. }
  8780. config._f = dateFormat + (timeFormat || "") + (tzFormat || "");
  8781. configFromStringAndFormat(config);
  8782. } else {
  8783. config._isValid = false;
  8784. }
  8785. }
  8786. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  8787. var result = [
  8788. untruncateYear(yearStr),
  8789. defaultLocaleMonthsShort.indexOf(monthStr),
  8790. parseInt(dayStr, 10),
  8791. parseInt(hourStr, 10),
  8792. parseInt(minuteStr, 10)
  8793. ];
  8794. if (secondStr) {
  8795. result.push(parseInt(secondStr, 10));
  8796. }
  8797. return result;
  8798. }
  8799. function untruncateYear(yearStr) {
  8800. var year = parseInt(yearStr, 10);
  8801. if (year <= 49) {
  8802. return 2e3 + year;
  8803. } else if (year <= 999) {
  8804. return 1900 + year;
  8805. }
  8806. return year;
  8807. }
  8808. function preprocessRFC2822(s2) {
  8809. return s2.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
  8810. }
  8811. function checkWeekday(weekdayStr, parsedInput, config) {
  8812. if (weekdayStr) {
  8813. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(
  8814. parsedInput[0],
  8815. parsedInput[1],
  8816. parsedInput[2]
  8817. ).getDay();
  8818. if (weekdayProvided !== weekdayActual) {
  8819. getParsingFlags(config).weekdayMismatch = true;
  8820. config._isValid = false;
  8821. return false;
  8822. }
  8823. }
  8824. return true;
  8825. }
  8826. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  8827. if (obsOffset) {
  8828. return obsOffsets[obsOffset];
  8829. } else if (militaryOffset) {
  8830. return 0;
  8831. } else {
  8832. var hm = parseInt(numOffset, 10), m2 = hm % 100, h2 = (hm - m2) / 100;
  8833. return h2 * 60 + m2;
  8834. }
  8835. }
  8836. function configFromRFC2822(config) {
  8837. var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray;
  8838. if (match) {
  8839. parsedArray = extractFromRFC2822Strings(
  8840. match[4],
  8841. match[3],
  8842. match[2],
  8843. match[5],
  8844. match[6],
  8845. match[7]
  8846. );
  8847. if (!checkWeekday(match[1], parsedArray, config)) {
  8848. return;
  8849. }
  8850. config._a = parsedArray;
  8851. config._tzm = calculateOffset(match[8], match[9], match[10]);
  8852. config._d = createUTCDate.apply(null, config._a);
  8853. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  8854. getParsingFlags(config).rfc2822 = true;
  8855. } else {
  8856. config._isValid = false;
  8857. }
  8858. }
  8859. function configFromString(config) {
  8860. var matched = aspNetJsonRegex.exec(config._i);
  8861. if (matched !== null) {
  8862. config._d = /* @__PURE__ */ new Date(+matched[1]);
  8863. return;
  8864. }
  8865. configFromISO(config);
  8866. if (config._isValid === false) {
  8867. delete config._isValid;
  8868. } else {
  8869. return;
  8870. }
  8871. configFromRFC2822(config);
  8872. if (config._isValid === false) {
  8873. delete config._isValid;
  8874. } else {
  8875. return;
  8876. }
  8877. if (config._strict) {
  8878. config._isValid = false;
  8879. } else {
  8880. hooks.createFromInputFallback(config);
  8881. }
  8882. }
  8883. hooks.createFromInputFallback = deprecate(
  8884. "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
  8885. function(config) {
  8886. config._d = /* @__PURE__ */ new Date(config._i + (config._useUTC ? " UTC" : ""));
  8887. }
  8888. );
  8889. function defaults(a2, b2, c2) {
  8890. if (a2 != null) {
  8891. return a2;
  8892. }
  8893. if (b2 != null) {
  8894. return b2;
  8895. }
  8896. return c2;
  8897. }
  8898. function currentDateArray(config) {
  8899. var nowValue = new Date(hooks.now());
  8900. if (config._useUTC) {
  8901. return [
  8902. nowValue.getUTCFullYear(),
  8903. nowValue.getUTCMonth(),
  8904. nowValue.getUTCDate()
  8905. ];
  8906. }
  8907. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  8908. }
  8909. function configFromArray(config) {
  8910. var i2, date, input = [], currentDate, expectedWeekday, yearToUse;
  8911. if (config._d) {
  8912. return;
  8913. }
  8914. currentDate = currentDateArray(config);
  8915. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  8916. dayOfYearFromWeekInfo(config);
  8917. }
  8918. if (config._dayOfYear != null) {
  8919. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  8920. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  8921. getParsingFlags(config)._overflowDayOfYear = true;
  8922. }
  8923. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  8924. config._a[MONTH] = date.getUTCMonth();
  8925. config._a[DATE] = date.getUTCDate();
  8926. }
  8927. for (i2 = 0; i2 < 3 && config._a[i2] == null; ++i2) {
  8928. config._a[i2] = input[i2] = currentDate[i2];
  8929. }
  8930. for (; i2 < 7; i2++) {
  8931. config._a[i2] = input[i2] = config._a[i2] == null ? i2 === 2 ? 1 : 0 : config._a[i2];
  8932. }
  8933. if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
  8934. config._nextDay = true;
  8935. config._a[HOUR] = 0;
  8936. }
  8937. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  8938. null,
  8939. input
  8940. );
  8941. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  8942. if (config._tzm != null) {
  8943. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  8944. }
  8945. if (config._nextDay) {
  8946. config._a[HOUR] = 24;
  8947. }
  8948. if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
  8949. getParsingFlags(config).weekdayMismatch = true;
  8950. }
  8951. }
  8952. function dayOfYearFromWeekInfo(config) {
  8953. var w2, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  8954. w2 = config._w;
  8955. if (w2.GG != null || w2.W != null || w2.E != null) {
  8956. dow = 1;
  8957. doy = 4;
  8958. weekYear = defaults(
  8959. w2.GG,
  8960. config._a[YEAR],
  8961. weekOfYear(createLocal(), 1, 4).year
  8962. );
  8963. week = defaults(w2.W, 1);
  8964. weekday = defaults(w2.E, 1);
  8965. if (weekday < 1 || weekday > 7) {
  8966. weekdayOverflow = true;
  8967. }
  8968. } else {
  8969. dow = config._locale._week.dow;
  8970. doy = config._locale._week.doy;
  8971. curWeek = weekOfYear(createLocal(), dow, doy);
  8972. weekYear = defaults(w2.gg, config._a[YEAR], curWeek.year);
  8973. week = defaults(w2.w, curWeek.week);
  8974. if (w2.d != null) {
  8975. weekday = w2.d;
  8976. if (weekday < 0 || weekday > 6) {
  8977. weekdayOverflow = true;
  8978. }
  8979. } else if (w2.e != null) {
  8980. weekday = w2.e + dow;
  8981. if (w2.e < 0 || w2.e > 6) {
  8982. weekdayOverflow = true;
  8983. }
  8984. } else {
  8985. weekday = dow;
  8986. }
  8987. }
  8988. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  8989. getParsingFlags(config)._overflowWeeks = true;
  8990. } else if (weekdayOverflow != null) {
  8991. getParsingFlags(config)._overflowWeekday = true;
  8992. } else {
  8993. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  8994. config._a[YEAR] = temp.year;
  8995. config._dayOfYear = temp.dayOfYear;
  8996. }
  8997. }
  8998. hooks.ISO_8601 = function() {
  8999. };
  9000. hooks.RFC_2822 = function() {
  9001. };
  9002. function configFromStringAndFormat(config) {
  9003. if (config._f === hooks.ISO_8601) {
  9004. configFromISO(config);
  9005. return;
  9006. }
  9007. if (config._f === hooks.RFC_2822) {
  9008. configFromRFC2822(config);
  9009. return;
  9010. }
  9011. config._a = [];
  9012. getParsingFlags(config).empty = true;
  9013. var string = "" + config._i, i2, parsedInput, tokens2, token2, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen;
  9014. tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  9015. tokenLen = tokens2.length;
  9016. for (i2 = 0; i2 < tokenLen; i2++) {
  9017. token2 = tokens2[i2];
  9018. parsedInput = (string.match(getParseRegexForToken(token2, config)) || [])[0];
  9019. if (parsedInput) {
  9020. skipped = string.substr(0, string.indexOf(parsedInput));
  9021. if (skipped.length > 0) {
  9022. getParsingFlags(config).unusedInput.push(skipped);
  9023. }
  9024. string = string.slice(
  9025. string.indexOf(parsedInput) + parsedInput.length
  9026. );
  9027. totalParsedInputLength += parsedInput.length;
  9028. }
  9029. if (formatTokenFunctions[token2]) {
  9030. if (parsedInput) {
  9031. getParsingFlags(config).empty = false;
  9032. } else {
  9033. getParsingFlags(config).unusedTokens.push(token2);
  9034. }
  9035. addTimeToArrayFromToken(token2, parsedInput, config);
  9036. } else if (config._strict && !parsedInput) {
  9037. getParsingFlags(config).unusedTokens.push(token2);
  9038. }
  9039. }
  9040. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  9041. if (string.length > 0) {
  9042. getParsingFlags(config).unusedInput.push(string);
  9043. }
  9044. if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) {
  9045. getParsingFlags(config).bigHour = void 0;
  9046. }
  9047. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  9048. getParsingFlags(config).meridiem = config._meridiem;
  9049. config._a[HOUR] = meridiemFixWrap(
  9050. config._locale,
  9051. config._a[HOUR],
  9052. config._meridiem
  9053. );
  9054. era = getParsingFlags(config).era;
  9055. if (era !== null) {
  9056. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  9057. }
  9058. configFromArray(config);
  9059. checkOverflow(config);
  9060. }
  9061. function meridiemFixWrap(locale2, hour, meridiem2) {
  9062. var isPm;
  9063. if (meridiem2 == null) {
  9064. return hour;
  9065. }
  9066. if (locale2.meridiemHour != null) {
  9067. return locale2.meridiemHour(hour, meridiem2);
  9068. } else if (locale2.isPM != null) {
  9069. isPm = locale2.isPM(meridiem2);
  9070. if (isPm && hour < 12) {
  9071. hour += 12;
  9072. }
  9073. if (!isPm && hour === 12) {
  9074. hour = 0;
  9075. }
  9076. return hour;
  9077. } else {
  9078. return hour;
  9079. }
  9080. }
  9081. function configFromStringAndArray(config) {
  9082. var tempConfig, bestMoment, scoreToBeat, i2, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
  9083. if (configfLen === 0) {
  9084. getParsingFlags(config).invalidFormat = true;
  9085. config._d = /* @__PURE__ */ new Date(NaN);
  9086. return;
  9087. }
  9088. for (i2 = 0; i2 < configfLen; i2++) {
  9089. currentScore = 0;
  9090. validFormatFound = false;
  9091. tempConfig = copyConfig({}, config);
  9092. if (config._useUTC != null) {
  9093. tempConfig._useUTC = config._useUTC;
  9094. }
  9095. tempConfig._f = config._f[i2];
  9096. configFromStringAndFormat(tempConfig);
  9097. if (isValid(tempConfig)) {
  9098. validFormatFound = true;
  9099. }
  9100. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  9101. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  9102. getParsingFlags(tempConfig).score = currentScore;
  9103. if (!bestFormatIsValid) {
  9104. if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) {
  9105. scoreToBeat = currentScore;
  9106. bestMoment = tempConfig;
  9107. if (validFormatFound) {
  9108. bestFormatIsValid = true;
  9109. }
  9110. }
  9111. } else {
  9112. if (currentScore < scoreToBeat) {
  9113. scoreToBeat = currentScore;
  9114. bestMoment = tempConfig;
  9115. }
  9116. }
  9117. }
  9118. extend(config, bestMoment || tempConfig);
  9119. }
  9120. function configFromObject(config) {
  9121. if (config._d) {
  9122. return;
  9123. }
  9124. var i2 = normalizeObjectUnits(config._i), dayOrDate = i2.day === void 0 ? i2.date : i2.day;
  9125. config._a = map(
  9126. [i2.year, i2.month, dayOrDate, i2.hour, i2.minute, i2.second, i2.millisecond],
  9127. function(obj) {
  9128. return obj && parseInt(obj, 10);
  9129. }
  9130. );
  9131. configFromArray(config);
  9132. }
  9133. function createFromConfig(config) {
  9134. var res = new Moment(checkOverflow(prepareConfig(config)));
  9135. if (res._nextDay) {
  9136. res.add(1, "d");
  9137. res._nextDay = void 0;
  9138. }
  9139. return res;
  9140. }
  9141. function prepareConfig(config) {
  9142. var input = config._i, format2 = config._f;
  9143. config._locale = config._locale || getLocale(config._l);
  9144. if (input === null || format2 === void 0 && input === "") {
  9145. return createInvalid({ nullInput: true });
  9146. }
  9147. if (typeof input === "string") {
  9148. config._i = input = config._locale.preparse(input);
  9149. }
  9150. if (isMoment(input)) {
  9151. return new Moment(checkOverflow(input));
  9152. } else if (isDate(input)) {
  9153. config._d = input;
  9154. } else if (isArray(format2)) {
  9155. configFromStringAndArray(config);
  9156. } else if (format2) {
  9157. configFromStringAndFormat(config);
  9158. } else {
  9159. configFromInput(config);
  9160. }
  9161. if (!isValid(config)) {
  9162. config._d = null;
  9163. }
  9164. return config;
  9165. }
  9166. function configFromInput(config) {
  9167. var input = config._i;
  9168. if (isUndefined(input)) {
  9169. config._d = new Date(hooks.now());
  9170. } else if (isDate(input)) {
  9171. config._d = new Date(input.valueOf());
  9172. } else if (typeof input === "string") {
  9173. configFromString(config);
  9174. } else if (isArray(input)) {
  9175. config._a = map(input.slice(0), function(obj) {
  9176. return parseInt(obj, 10);
  9177. });
  9178. configFromArray(config);
  9179. } else if (isObject(input)) {
  9180. configFromObject(config);
  9181. } else if (isNumber(input)) {
  9182. config._d = new Date(input);
  9183. } else {
  9184. hooks.createFromInputFallback(config);
  9185. }
  9186. }
  9187. function createLocalOrUTC(input, format2, locale2, strict, isUTC) {
  9188. var c2 = {};
  9189. if (format2 === true || format2 === false) {
  9190. strict = format2;
  9191. format2 = void 0;
  9192. }
  9193. if (locale2 === true || locale2 === false) {
  9194. strict = locale2;
  9195. locale2 = void 0;
  9196. }
  9197. if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) {
  9198. input = void 0;
  9199. }
  9200. c2._isAMomentObject = true;
  9201. c2._useUTC = c2._isUTC = isUTC;
  9202. c2._l = locale2;
  9203. c2._i = input;
  9204. c2._f = format2;
  9205. c2._strict = strict;
  9206. return createFromConfig(c2);
  9207. }
  9208. function createLocal(input, format2, locale2, strict) {
  9209. return createLocalOrUTC(input, format2, locale2, strict, false);
  9210. }
  9211. var prototypeMin = deprecate(
  9212. "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
  9213. function() {
  9214. var other = createLocal.apply(null, arguments);
  9215. if (this.isValid() && other.isValid()) {
  9216. return other < this ? this : other;
  9217. } else {
  9218. return createInvalid();
  9219. }
  9220. }
  9221. ), prototypeMax = deprecate(
  9222. "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
  9223. function() {
  9224. var other = createLocal.apply(null, arguments);
  9225. if (this.isValid() && other.isValid()) {
  9226. return other > this ? this : other;
  9227. } else {
  9228. return createInvalid();
  9229. }
  9230. }
  9231. );
  9232. function pickBy(fn, moments) {
  9233. var res, i2;
  9234. if (moments.length === 1 && isArray(moments[0])) {
  9235. moments = moments[0];
  9236. }
  9237. if (!moments.length) {
  9238. return createLocal();
  9239. }
  9240. res = moments[0];
  9241. for (i2 = 1; i2 < moments.length; ++i2) {
  9242. if (!moments[i2].isValid() || moments[i2][fn](res)) {
  9243. res = moments[i2];
  9244. }
  9245. }
  9246. return res;
  9247. }
  9248. function min() {
  9249. var args = [].slice.call(arguments, 0);
  9250. return pickBy("isBefore", args);
  9251. }
  9252. function max() {
  9253. var args = [].slice.call(arguments, 0);
  9254. return pickBy("isAfter", args);
  9255. }
  9256. var now = function() {
  9257. return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
  9258. };
  9259. var ordering = [
  9260. "year",
  9261. "quarter",
  9262. "month",
  9263. "week",
  9264. "day",
  9265. "hour",
  9266. "minute",
  9267. "second",
  9268. "millisecond"
  9269. ];
  9270. function isDurationValid(m2) {
  9271. var key, unitHasDecimal = false, i2, orderLen = ordering.length;
  9272. for (key in m2) {
  9273. if (hasOwnProp(m2, key) && !(indexOf.call(ordering, key) !== -1 && (m2[key] == null || !isNaN(m2[key])))) {
  9274. return false;
  9275. }
  9276. }
  9277. for (i2 = 0; i2 < orderLen; ++i2) {
  9278. if (m2[ordering[i2]]) {
  9279. if (unitHasDecimal) {
  9280. return false;
  9281. }
  9282. if (parseFloat(m2[ordering[i2]]) !== toInt(m2[ordering[i2]])) {
  9283. unitHasDecimal = true;
  9284. }
  9285. }
  9286. }
  9287. return true;
  9288. }
  9289. function isValid$1() {
  9290. return this._isValid;
  9291. }
  9292. function createInvalid$1() {
  9293. return createDuration(NaN);
  9294. }
  9295. function Duration(duration) {
  9296. var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0;
  9297. this._isValid = isDurationValid(normalizedInput);
  9298. this._milliseconds = +milliseconds2 + seconds2 * 1e3 + // 1000
  9299. minutes2 * 6e4 + // 1000 * 60
  9300. hours2 * 1e3 * 60 * 60;
  9301. this._days = +days2 + weeks2 * 7;
  9302. this._months = +months2 + quarters * 3 + years2 * 12;
  9303. this._data = {};
  9304. this._locale = getLocale();
  9305. this._bubble();
  9306. }
  9307. function isDuration(obj) {
  9308. return obj instanceof Duration;
  9309. }
  9310. function absRound(number) {
  9311. if (number < 0) {
  9312. return Math.round(-1 * number) * -1;
  9313. } else {
  9314. return Math.round(number);
  9315. }
  9316. }
  9317. function compareArrays(array1, array2, dontConvert) {
  9318. var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i2;
  9319. for (i2 = 0; i2 < len; i2++) {
  9320. if (dontConvert && array1[i2] !== array2[i2] || !dontConvert && toInt(array1[i2]) !== toInt(array2[i2])) {
  9321. diffs++;
  9322. }
  9323. }
  9324. return diffs + lengthDiff;
  9325. }
  9326. function offset(token2, separator) {
  9327. addFormatToken(token2, 0, 0, function() {
  9328. var offset2 = this.utcOffset(), sign2 = "+";
  9329. if (offset2 < 0) {
  9330. offset2 = -offset2;
  9331. sign2 = "-";
  9332. }
  9333. return sign2 + zeroFill(~~(offset2 / 60), 2) + separator + zeroFill(~~offset2 % 60, 2);
  9334. });
  9335. }
  9336. offset("Z", ":");
  9337. offset("ZZ", "");
  9338. addRegexToken("Z", matchShortOffset);
  9339. addRegexToken("ZZ", matchShortOffset);
  9340. addParseToken(["Z", "ZZ"], function(input, array, config) {
  9341. config._useUTC = true;
  9342. config._tzm = offsetFromString(matchShortOffset, input);
  9343. });
  9344. var chunkOffset = /([\+\-]|\d\d)/gi;
  9345. function offsetFromString(matcher, string) {
  9346. var matches = (string || "").match(matcher), chunk, parts, minutes2;
  9347. if (matches === null) {
  9348. return null;
  9349. }
  9350. chunk = matches[matches.length - 1] || [];
  9351. parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
  9352. minutes2 = +(parts[1] * 60) + toInt(parts[2]);
  9353. return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
  9354. }
  9355. function cloneWithOffset(input, model) {
  9356. var res, diff2;
  9357. if (model._isUTC) {
  9358. res = model.clone();
  9359. diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  9360. res._d.setTime(res._d.valueOf() + diff2);
  9361. hooks.updateOffset(res, false);
  9362. return res;
  9363. } else {
  9364. return createLocal(input).local();
  9365. }
  9366. }
  9367. function getDateOffset(m2) {
  9368. return -Math.round(m2._d.getTimezoneOffset());
  9369. }
  9370. hooks.updateOffset = function() {
  9371. };
  9372. function getSetOffset(input, keepLocalTime, keepMinutes) {
  9373. var offset2 = this._offset || 0, localAdjust;
  9374. if (!this.isValid()) {
  9375. return input != null ? this : NaN;
  9376. }
  9377. if (input != null) {
  9378. if (typeof input === "string") {
  9379. input = offsetFromString(matchShortOffset, input);
  9380. if (input === null) {
  9381. return this;
  9382. }
  9383. } else if (Math.abs(input) < 16 && !keepMinutes) {
  9384. input = input * 60;
  9385. }
  9386. if (!this._isUTC && keepLocalTime) {
  9387. localAdjust = getDateOffset(this);
  9388. }
  9389. this._offset = input;
  9390. this._isUTC = true;
  9391. if (localAdjust != null) {
  9392. this.add(localAdjust, "m");
  9393. }
  9394. if (offset2 !== input) {
  9395. if (!keepLocalTime || this._changeInProgress) {
  9396. addSubtract(
  9397. this,
  9398. createDuration(input - offset2, "m"),
  9399. 1,
  9400. false
  9401. );
  9402. } else if (!this._changeInProgress) {
  9403. this._changeInProgress = true;
  9404. hooks.updateOffset(this, true);
  9405. this._changeInProgress = null;
  9406. }
  9407. }
  9408. return this;
  9409. } else {
  9410. return this._isUTC ? offset2 : getDateOffset(this);
  9411. }
  9412. }
  9413. function getSetZone(input, keepLocalTime) {
  9414. if (input != null) {
  9415. if (typeof input !== "string") {
  9416. input = -input;
  9417. }
  9418. this.utcOffset(input, keepLocalTime);
  9419. return this;
  9420. } else {
  9421. return -this.utcOffset();
  9422. }
  9423. }
  9424. function setOffsetToUTC(keepLocalTime) {
  9425. return this.utcOffset(0, keepLocalTime);
  9426. }
  9427. function setOffsetToLocal(keepLocalTime) {
  9428. if (this._isUTC) {
  9429. this.utcOffset(0, keepLocalTime);
  9430. this._isUTC = false;
  9431. if (keepLocalTime) {
  9432. this.subtract(getDateOffset(this), "m");
  9433. }
  9434. }
  9435. return this;
  9436. }
  9437. function setOffsetToParsedOffset() {
  9438. if (this._tzm != null) {
  9439. this.utcOffset(this._tzm, false, true);
  9440. } else if (typeof this._i === "string") {
  9441. var tZone = offsetFromString(matchOffset, this._i);
  9442. if (tZone != null) {
  9443. this.utcOffset(tZone);
  9444. } else {
  9445. this.utcOffset(0, true);
  9446. }
  9447. }
  9448. return this;
  9449. }
  9450. function hasAlignedHourOffset(input) {
  9451. if (!this.isValid()) {
  9452. return false;
  9453. }
  9454. input = input ? createLocal(input).utcOffset() : 0;
  9455. return (this.utcOffset() - input) % 60 === 0;
  9456. }
  9457. function isDaylightSavingTime() {
  9458. return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
  9459. }
  9460. function isDaylightSavingTimeShifted() {
  9461. if (!isUndefined(this._isDSTShifted)) {
  9462. return this._isDSTShifted;
  9463. }
  9464. var c2 = {}, other;
  9465. copyConfig(c2, this);
  9466. c2 = prepareConfig(c2);
  9467. if (c2._a) {
  9468. other = c2._isUTC ? createUTC(c2._a) : createLocal(c2._a);
  9469. this._isDSTShifted = this.isValid() && compareArrays(c2._a, other.toArray()) > 0;
  9470. } else {
  9471. this._isDSTShifted = false;
  9472. }
  9473. return this._isDSTShifted;
  9474. }
  9475. function isLocal() {
  9476. return this.isValid() ? !this._isUTC : false;
  9477. }
  9478. function isUtcOffset() {
  9479. return this.isValid() ? this._isUTC : false;
  9480. }
  9481. function isUtc() {
  9482. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  9483. }
  9484. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  9485. function createDuration(input, key) {
  9486. var duration = input, match = null, sign2, ret, diffRes;
  9487. if (isDuration(input)) {
  9488. duration = {
  9489. ms: input._milliseconds,
  9490. d: input._days,
  9491. M: input._months
  9492. };
  9493. } else if (isNumber(input) || !isNaN(+input)) {
  9494. duration = {};
  9495. if (key) {
  9496. duration[key] = +input;
  9497. } else {
  9498. duration.milliseconds = +input;
  9499. }
  9500. } else if (match = aspNetRegex.exec(input)) {
  9501. sign2 = match[1] === "-" ? -1 : 1;
  9502. duration = {
  9503. y: 0,
  9504. d: toInt(match[DATE]) * sign2,
  9505. h: toInt(match[HOUR]) * sign2,
  9506. m: toInt(match[MINUTE]) * sign2,
  9507. s: toInt(match[SECOND]) * sign2,
  9508. ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2
  9509. // the millisecond decimal point is included in the match
  9510. };
  9511. } else if (match = isoRegex.exec(input)) {
  9512. sign2 = match[1] === "-" ? -1 : 1;
  9513. duration = {
  9514. y: parseIso(match[2], sign2),
  9515. M: parseIso(match[3], sign2),
  9516. w: parseIso(match[4], sign2),
  9517. d: parseIso(match[5], sign2),
  9518. h: parseIso(match[6], sign2),
  9519. m: parseIso(match[7], sign2),
  9520. s: parseIso(match[8], sign2)
  9521. };
  9522. } else if (duration == null) {
  9523. duration = {};
  9524. } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
  9525. diffRes = momentsDifference(
  9526. createLocal(duration.from),
  9527. createLocal(duration.to)
  9528. );
  9529. duration = {};
  9530. duration.ms = diffRes.milliseconds;
  9531. duration.M = diffRes.months;
  9532. }
  9533. ret = new Duration(duration);
  9534. if (isDuration(input) && hasOwnProp(input, "_locale")) {
  9535. ret._locale = input._locale;
  9536. }
  9537. if (isDuration(input) && hasOwnProp(input, "_isValid")) {
  9538. ret._isValid = input._isValid;
  9539. }
  9540. return ret;
  9541. }
  9542. createDuration.fn = Duration.prototype;
  9543. createDuration.invalid = createInvalid$1;
  9544. function parseIso(inp, sign2) {
  9545. var res = inp && parseFloat(inp.replace(",", "."));
  9546. return (isNaN(res) ? 0 : res) * sign2;
  9547. }
  9548. function positiveMomentsDifference(base, other) {
  9549. var res = {};
  9550. res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
  9551. if (base.clone().add(res.months, "M").isAfter(other)) {
  9552. --res.months;
  9553. }
  9554. res.milliseconds = +other - +base.clone().add(res.months, "M");
  9555. return res;
  9556. }
  9557. function momentsDifference(base, other) {
  9558. var res;
  9559. if (!(base.isValid() && other.isValid())) {
  9560. return { milliseconds: 0, months: 0 };
  9561. }
  9562. other = cloneWithOffset(other, base);
  9563. if (base.isBefore(other)) {
  9564. res = positiveMomentsDifference(base, other);
  9565. } else {
  9566. res = positiveMomentsDifference(other, base);
  9567. res.milliseconds = -res.milliseconds;
  9568. res.months = -res.months;
  9569. }
  9570. return res;
  9571. }
  9572. function createAdder(direction, name) {
  9573. return function(val, period) {
  9574. var dur, tmp;
  9575. if (period !== null && !isNaN(+period)) {
  9576. deprecateSimple(
  9577. name,
  9578. "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
  9579. );
  9580. tmp = val;
  9581. val = period;
  9582. period = tmp;
  9583. }
  9584. dur = createDuration(val, period);
  9585. addSubtract(this, dur, direction);
  9586. return this;
  9587. };
  9588. }
  9589. function addSubtract(mom, duration, isAdding, updateOffset) {
  9590. var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
  9591. if (!mom.isValid()) {
  9592. return;
  9593. }
  9594. updateOffset = updateOffset == null ? true : updateOffset;
  9595. if (months2) {
  9596. setMonth(mom, get(mom, "Month") + months2 * isAdding);
  9597. }
  9598. if (days2) {
  9599. set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
  9600. }
  9601. if (milliseconds2) {
  9602. mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
  9603. }
  9604. if (updateOffset) {
  9605. hooks.updateOffset(mom, days2 || months2);
  9606. }
  9607. }
  9608. var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
  9609. function isString(input) {
  9610. return typeof input === "string" || input instanceof String;
  9611. }
  9612. function isMomentInput(input) {
  9613. return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0;
  9614. }
  9615. function isMomentInputObject(input) {
  9616. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  9617. "years",
  9618. "year",
  9619. "y",
  9620. "months",
  9621. "month",
  9622. "M",
  9623. "days",
  9624. "day",
  9625. "d",
  9626. "dates",
  9627. "date",
  9628. "D",
  9629. "hours",
  9630. "hour",
  9631. "h",
  9632. "minutes",
  9633. "minute",
  9634. "m",
  9635. "seconds",
  9636. "second",
  9637. "s",
  9638. "milliseconds",
  9639. "millisecond",
  9640. "ms"
  9641. ], i2, property, propertyLen = properties.length;
  9642. for (i2 = 0; i2 < propertyLen; i2 += 1) {
  9643. property = properties[i2];
  9644. propertyTest = propertyTest || hasOwnProp(input, property);
  9645. }
  9646. return objectTest && propertyTest;
  9647. }
  9648. function isNumberOrStringArray(input) {
  9649. var arrayTest = isArray(input), dataTypeTest = false;
  9650. if (arrayTest) {
  9651. dataTypeTest = input.filter(function(item) {
  9652. return !isNumber(item) && isString(input);
  9653. }).length === 0;
  9654. }
  9655. return arrayTest && dataTypeTest;
  9656. }
  9657. function isCalendarSpec(input) {
  9658. var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [
  9659. "sameDay",
  9660. "nextDay",
  9661. "lastDay",
  9662. "nextWeek",
  9663. "lastWeek",
  9664. "sameElse"
  9665. ], i2, property;
  9666. for (i2 = 0; i2 < properties.length; i2 += 1) {
  9667. property = properties[i2];
  9668. propertyTest = propertyTest || hasOwnProp(input, property);
  9669. }
  9670. return objectTest && propertyTest;
  9671. }
  9672. function getCalendarFormat(myMoment, now2) {
  9673. var diff2 = myMoment.diff(now2, "days", true);
  9674. return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
  9675. }
  9676. function calendar$1(time, formats) {
  9677. if (arguments.length === 1) {
  9678. if (!arguments[0]) {
  9679. time = void 0;
  9680. formats = void 0;
  9681. } else if (isMomentInput(arguments[0])) {
  9682. time = arguments[0];
  9683. formats = void 0;
  9684. } else if (isCalendarSpec(arguments[0])) {
  9685. formats = arguments[0];
  9686. time = void 0;
  9687. }
  9688. }
  9689. var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
  9690. return this.format(
  9691. output || this.localeData().calendar(format2, this, createLocal(now2))
  9692. );
  9693. }
  9694. function clone() {
  9695. return new Moment(this);
  9696. }
  9697. function isAfter(input, units) {
  9698. var localInput = isMoment(input) ? input : createLocal(input);
  9699. if (!(this.isValid() && localInput.isValid())) {
  9700. return false;
  9701. }
  9702. units = normalizeUnits(units) || "millisecond";
  9703. if (units === "millisecond") {
  9704. return this.valueOf() > localInput.valueOf();
  9705. } else {
  9706. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  9707. }
  9708. }
  9709. function isBefore(input, units) {
  9710. var localInput = isMoment(input) ? input : createLocal(input);
  9711. if (!(this.isValid() && localInput.isValid())) {
  9712. return false;
  9713. }
  9714. units = normalizeUnits(units) || "millisecond";
  9715. if (units === "millisecond") {
  9716. return this.valueOf() < localInput.valueOf();
  9717. } else {
  9718. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  9719. }
  9720. }
  9721. function isBetween(from2, to2, units, inclusivity) {
  9722. var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2);
  9723. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  9724. return false;
  9725. }
  9726. inclusivity = inclusivity || "()";
  9727. return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
  9728. }
  9729. function isSame(input, units) {
  9730. var localInput = isMoment(input) ? input : createLocal(input), inputMs;
  9731. if (!(this.isValid() && localInput.isValid())) {
  9732. return false;
  9733. }
  9734. units = normalizeUnits(units) || "millisecond";
  9735. if (units === "millisecond") {
  9736. return this.valueOf() === localInput.valueOf();
  9737. } else {
  9738. inputMs = localInput.valueOf();
  9739. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  9740. }
  9741. }
  9742. function isSameOrAfter(input, units) {
  9743. return this.isSame(input, units) || this.isAfter(input, units);
  9744. }
  9745. function isSameOrBefore(input, units) {
  9746. return this.isSame(input, units) || this.isBefore(input, units);
  9747. }
  9748. function diff(input, units, asFloat) {
  9749. var that, zoneDelta, output;
  9750. if (!this.isValid()) {
  9751. return NaN;
  9752. }
  9753. that = cloneWithOffset(input, this);
  9754. if (!that.isValid()) {
  9755. return NaN;
  9756. }
  9757. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  9758. units = normalizeUnits(units);
  9759. switch (units) {
  9760. case "year":
  9761. output = monthDiff(this, that) / 12;
  9762. break;
  9763. case "month":
  9764. output = monthDiff(this, that);
  9765. break;
  9766. case "quarter":
  9767. output = monthDiff(this, that) / 3;
  9768. break;
  9769. case "second":
  9770. output = (this - that) / 1e3;
  9771. break;
  9772. case "minute":
  9773. output = (this - that) / 6e4;
  9774. break;
  9775. case "hour":
  9776. output = (this - that) / 36e5;
  9777. break;
  9778. case "day":
  9779. output = (this - that - zoneDelta) / 864e5;
  9780. break;
  9781. case "week":
  9782. output = (this - that - zoneDelta) / 6048e5;
  9783. break;
  9784. default:
  9785. output = this - that;
  9786. }
  9787. return asFloat ? output : absFloor(output);
  9788. }
  9789. function monthDiff(a2, b2) {
  9790. if (a2.date() < b2.date()) {
  9791. return -monthDiff(b2, a2);
  9792. }
  9793. var wholeMonthDiff = (b2.year() - a2.year()) * 12 + (b2.month() - a2.month()), anchor = a2.clone().add(wholeMonthDiff, "months"), anchor2, adjust;
  9794. if (b2 - anchor < 0) {
  9795. anchor2 = a2.clone().add(wholeMonthDiff - 1, "months");
  9796. adjust = (b2 - anchor) / (anchor - anchor2);
  9797. } else {
  9798. anchor2 = a2.clone().add(wholeMonthDiff + 1, "months");
  9799. adjust = (b2 - anchor) / (anchor2 - anchor);
  9800. }
  9801. return -(wholeMonthDiff + adjust) || 0;
  9802. }
  9803. hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
  9804. hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
  9805. function toString() {
  9806. return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
  9807. }
  9808. function toISOString(keepOffset) {
  9809. if (!this.isValid()) {
  9810. return null;
  9811. }
  9812. var utc = keepOffset !== true, m2 = utc ? this.clone().utc() : this;
  9813. if (m2.year() < 0 || m2.year() > 9999) {
  9814. return formatMoment(
  9815. m2,
  9816. utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
  9817. );
  9818. }
  9819. if (isFunction(Date.prototype.toISOString)) {
  9820. if (utc) {
  9821. return this.toDate().toISOString();
  9822. } else {
  9823. return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m2, "Z"));
  9824. }
  9825. }
  9826. return formatMoment(
  9827. m2,
  9828. utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
  9829. );
  9830. }
  9831. function inspect() {
  9832. if (!this.isValid()) {
  9833. return "moment.invalid(/* " + this._i + " */)";
  9834. }
  9835. var func = "moment", zone = "", prefix, year, datetime, suffix;
  9836. if (!this.isLocal()) {
  9837. func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
  9838. zone = "Z";
  9839. }
  9840. prefix = "[" + func + '("]';
  9841. year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
  9842. datetime = "-MM-DD[T]HH:mm:ss.SSS";
  9843. suffix = zone + '[")]';
  9844. return this.format(prefix + year + datetime + suffix);
  9845. }
  9846. function format(inputString) {
  9847. if (!inputString) {
  9848. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  9849. }
  9850. var output = formatMoment(this, inputString);
  9851. return this.localeData().postformat(output);
  9852. }
  9853. function from(time, withoutSuffix) {
  9854. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  9855. return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
  9856. } else {
  9857. return this.localeData().invalidDate();
  9858. }
  9859. }
  9860. function fromNow(withoutSuffix) {
  9861. return this.from(createLocal(), withoutSuffix);
  9862. }
  9863. function to(time, withoutSuffix) {
  9864. if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) {
  9865. return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix);
  9866. } else {
  9867. return this.localeData().invalidDate();
  9868. }
  9869. }
  9870. function toNow(withoutSuffix) {
  9871. return this.to(createLocal(), withoutSuffix);
  9872. }
  9873. function locale(key) {
  9874. var newLocaleData;
  9875. if (key === void 0) {
  9876. return this._locale._abbr;
  9877. } else {
  9878. newLocaleData = getLocale(key);
  9879. if (newLocaleData != null) {
  9880. this._locale = newLocaleData;
  9881. }
  9882. return this;
  9883. }
  9884. }
  9885. var lang = deprecate(
  9886. "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
  9887. function(key) {
  9888. if (key === void 0) {
  9889. return this.localeData();
  9890. } else {
  9891. return this.locale(key);
  9892. }
  9893. }
  9894. );
  9895. function localeData() {
  9896. return this._locale;
  9897. }
  9898. var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  9899. function mod$1(dividend, divisor) {
  9900. return (dividend % divisor + divisor) % divisor;
  9901. }
  9902. function localStartOfDate(y2, m2, d2) {
  9903. if (y2 < 100 && y2 >= 0) {
  9904. return new Date(y2 + 400, m2, d2) - MS_PER_400_YEARS;
  9905. } else {
  9906. return new Date(y2, m2, d2).valueOf();
  9907. }
  9908. }
  9909. function utcStartOfDate(y2, m2, d2) {
  9910. if (y2 < 100 && y2 >= 0) {
  9911. return Date.UTC(y2 + 400, m2, d2) - MS_PER_400_YEARS;
  9912. } else {
  9913. return Date.UTC(y2, m2, d2);
  9914. }
  9915. }
  9916. function startOf(units) {
  9917. var time, startOfDate;
  9918. units = normalizeUnits(units);
  9919. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  9920. return this;
  9921. }
  9922. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  9923. switch (units) {
  9924. case "year":
  9925. time = startOfDate(this.year(), 0, 1);
  9926. break;
  9927. case "quarter":
  9928. time = startOfDate(
  9929. this.year(),
  9930. this.month() - this.month() % 3,
  9931. 1
  9932. );
  9933. break;
  9934. case "month":
  9935. time = startOfDate(this.year(), this.month(), 1);
  9936. break;
  9937. case "week":
  9938. time = startOfDate(
  9939. this.year(),
  9940. this.month(),
  9941. this.date() - this.weekday()
  9942. );
  9943. break;
  9944. case "isoWeek":
  9945. time = startOfDate(
  9946. this.year(),
  9947. this.month(),
  9948. this.date() - (this.isoWeekday() - 1)
  9949. );
  9950. break;
  9951. case "day":
  9952. case "date":
  9953. time = startOfDate(this.year(), this.month(), this.date());
  9954. break;
  9955. case "hour":
  9956. time = this._d.valueOf();
  9957. time -= mod$1(
  9958. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  9959. MS_PER_HOUR
  9960. );
  9961. break;
  9962. case "minute":
  9963. time = this._d.valueOf();
  9964. time -= mod$1(time, MS_PER_MINUTE);
  9965. break;
  9966. case "second":
  9967. time = this._d.valueOf();
  9968. time -= mod$1(time, MS_PER_SECOND);
  9969. break;
  9970. }
  9971. this._d.setTime(time);
  9972. hooks.updateOffset(this, true);
  9973. return this;
  9974. }
  9975. function endOf(units) {
  9976. var time, startOfDate;
  9977. units = normalizeUnits(units);
  9978. if (units === void 0 || units === "millisecond" || !this.isValid()) {
  9979. return this;
  9980. }
  9981. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  9982. switch (units) {
  9983. case "year":
  9984. time = startOfDate(this.year() + 1, 0, 1) - 1;
  9985. break;
  9986. case "quarter":
  9987. time = startOfDate(
  9988. this.year(),
  9989. this.month() - this.month() % 3 + 3,
  9990. 1
  9991. ) - 1;
  9992. break;
  9993. case "month":
  9994. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  9995. break;
  9996. case "week":
  9997. time = startOfDate(
  9998. this.year(),
  9999. this.month(),
  10000. this.date() - this.weekday() + 7
  10001. ) - 1;
  10002. break;
  10003. case "isoWeek":
  10004. time = startOfDate(
  10005. this.year(),
  10006. this.month(),
  10007. this.date() - (this.isoWeekday() - 1) + 7
  10008. ) - 1;
  10009. break;
  10010. case "day":
  10011. case "date":
  10012. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  10013. break;
  10014. case "hour":
  10015. time = this._d.valueOf();
  10016. time += MS_PER_HOUR - mod$1(
  10017. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  10018. MS_PER_HOUR
  10019. ) - 1;
  10020. break;
  10021. case "minute":
  10022. time = this._d.valueOf();
  10023. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  10024. break;
  10025. case "second":
  10026. time = this._d.valueOf();
  10027. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  10028. break;
  10029. }
  10030. this._d.setTime(time);
  10031. hooks.updateOffset(this, true);
  10032. return this;
  10033. }
  10034. function valueOf() {
  10035. return this._d.valueOf() - (this._offset || 0) * 6e4;
  10036. }
  10037. function unix() {
  10038. return Math.floor(this.valueOf() / 1e3);
  10039. }
  10040. function toDate() {
  10041. return new Date(this.valueOf());
  10042. }
  10043. function toArray() {
  10044. var m2 = this;
  10045. return [
  10046. m2.year(),
  10047. m2.month(),
  10048. m2.date(),
  10049. m2.hour(),
  10050. m2.minute(),
  10051. m2.second(),
  10052. m2.millisecond()
  10053. ];
  10054. }
  10055. function toObject() {
  10056. var m2 = this;
  10057. return {
  10058. years: m2.year(),
  10059. months: m2.month(),
  10060. date: m2.date(),
  10061. hours: m2.hours(),
  10062. minutes: m2.minutes(),
  10063. seconds: m2.seconds(),
  10064. milliseconds: m2.milliseconds()
  10065. };
  10066. }
  10067. function toJSON() {
  10068. return this.isValid() ? this.toISOString() : null;
  10069. }
  10070. function isValid$2() {
  10071. return isValid(this);
  10072. }
  10073. function parsingFlags() {
  10074. return extend({}, getParsingFlags(this));
  10075. }
  10076. function invalidAt() {
  10077. return getParsingFlags(this).overflow;
  10078. }
  10079. function creationData() {
  10080. return {
  10081. input: this._i,
  10082. format: this._f,
  10083. locale: this._locale,
  10084. isUTC: this._isUTC,
  10085. strict: this._strict
  10086. };
  10087. }
  10088. addFormatToken("N", 0, 0, "eraAbbr");
  10089. addFormatToken("NN", 0, 0, "eraAbbr");
  10090. addFormatToken("NNN", 0, 0, "eraAbbr");
  10091. addFormatToken("NNNN", 0, 0, "eraName");
  10092. addFormatToken("NNNNN", 0, 0, "eraNarrow");
  10093. addFormatToken("y", ["y", 1], "yo", "eraYear");
  10094. addFormatToken("y", ["yy", 2], 0, "eraYear");
  10095. addFormatToken("y", ["yyy", 3], 0, "eraYear");
  10096. addFormatToken("y", ["yyyy", 4], 0, "eraYear");
  10097. addRegexToken("N", matchEraAbbr);
  10098. addRegexToken("NN", matchEraAbbr);
  10099. addRegexToken("NNN", matchEraAbbr);
  10100. addRegexToken("NNNN", matchEraName);
  10101. addRegexToken("NNNNN", matchEraNarrow);
  10102. addParseToken(
  10103. ["N", "NN", "NNN", "NNNN", "NNNNN"],
  10104. function(input, array, config, token2) {
  10105. var era = config._locale.erasParse(input, token2, config._strict);
  10106. if (era) {
  10107. getParsingFlags(config).era = era;
  10108. } else {
  10109. getParsingFlags(config).invalidEra = input;
  10110. }
  10111. }
  10112. );
  10113. addRegexToken("y", matchUnsigned);
  10114. addRegexToken("yy", matchUnsigned);
  10115. addRegexToken("yyy", matchUnsigned);
  10116. addRegexToken("yyyy", matchUnsigned);
  10117. addRegexToken("yo", matchEraYearOrdinal);
  10118. addParseToken(["y", "yy", "yyy", "yyyy"], YEAR);
  10119. addParseToken(["yo"], function(input, array, config, token2) {
  10120. var match;
  10121. if (config._locale._eraYearOrdinalRegex) {
  10122. match = input.match(config._locale._eraYearOrdinalRegex);
  10123. }
  10124. if (config._locale.eraYearOrdinalParse) {
  10125. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  10126. } else {
  10127. array[YEAR] = parseInt(input, 10);
  10128. }
  10129. });
  10130. function localeEras(m2, format2) {
  10131. var i2, l2, date, eras = this._eras || getLocale("en")._eras;
  10132. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10133. switch (typeof eras[i2].since) {
  10134. case "string":
  10135. date = hooks(eras[i2].since).startOf("day");
  10136. eras[i2].since = date.valueOf();
  10137. break;
  10138. }
  10139. switch (typeof eras[i2].until) {
  10140. case "undefined":
  10141. eras[i2].until = Infinity;
  10142. break;
  10143. case "string":
  10144. date = hooks(eras[i2].until).startOf("day").valueOf();
  10145. eras[i2].until = date.valueOf();
  10146. break;
  10147. }
  10148. }
  10149. return eras;
  10150. }
  10151. function localeErasParse(eraName, format2, strict) {
  10152. var i2, l2, eras = this.eras(), name, abbr, narrow;
  10153. eraName = eraName.toUpperCase();
  10154. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10155. name = eras[i2].name.toUpperCase();
  10156. abbr = eras[i2].abbr.toUpperCase();
  10157. narrow = eras[i2].narrow.toUpperCase();
  10158. if (strict) {
  10159. switch (format2) {
  10160. case "N":
  10161. case "NN":
  10162. case "NNN":
  10163. if (abbr === eraName) {
  10164. return eras[i2];
  10165. }
  10166. break;
  10167. case "NNNN":
  10168. if (name === eraName) {
  10169. return eras[i2];
  10170. }
  10171. break;
  10172. case "NNNNN":
  10173. if (narrow === eraName) {
  10174. return eras[i2];
  10175. }
  10176. break;
  10177. }
  10178. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  10179. return eras[i2];
  10180. }
  10181. }
  10182. }
  10183. function localeErasConvertYear(era, year) {
  10184. var dir = era.since <= era.until ? 1 : -1;
  10185. if (year === void 0) {
  10186. return hooks(era.since).year();
  10187. } else {
  10188. return hooks(era.since).year() + (year - era.offset) * dir;
  10189. }
  10190. }
  10191. function getEraName() {
  10192. var i2, l2, val, eras = this.localeData().eras();
  10193. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10194. val = this.clone().startOf("day").valueOf();
  10195. if (eras[i2].since <= val && val <= eras[i2].until) {
  10196. return eras[i2].name;
  10197. }
  10198. if (eras[i2].until <= val && val <= eras[i2].since) {
  10199. return eras[i2].name;
  10200. }
  10201. }
  10202. return "";
  10203. }
  10204. function getEraNarrow() {
  10205. var i2, l2, val, eras = this.localeData().eras();
  10206. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10207. val = this.clone().startOf("day").valueOf();
  10208. if (eras[i2].since <= val && val <= eras[i2].until) {
  10209. return eras[i2].narrow;
  10210. }
  10211. if (eras[i2].until <= val && val <= eras[i2].since) {
  10212. return eras[i2].narrow;
  10213. }
  10214. }
  10215. return "";
  10216. }
  10217. function getEraAbbr() {
  10218. var i2, l2, val, eras = this.localeData().eras();
  10219. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10220. val = this.clone().startOf("day").valueOf();
  10221. if (eras[i2].since <= val && val <= eras[i2].until) {
  10222. return eras[i2].abbr;
  10223. }
  10224. if (eras[i2].until <= val && val <= eras[i2].since) {
  10225. return eras[i2].abbr;
  10226. }
  10227. }
  10228. return "";
  10229. }
  10230. function getEraYear() {
  10231. var i2, l2, dir, val, eras = this.localeData().eras();
  10232. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10233. dir = eras[i2].since <= eras[i2].until ? 1 : -1;
  10234. val = this.clone().startOf("day").valueOf();
  10235. if (eras[i2].since <= val && val <= eras[i2].until || eras[i2].until <= val && val <= eras[i2].since) {
  10236. return (this.year() - hooks(eras[i2].since).year()) * dir + eras[i2].offset;
  10237. }
  10238. }
  10239. return this.year();
  10240. }
  10241. function erasNameRegex(isStrict) {
  10242. if (!hasOwnProp(this, "_erasNameRegex")) {
  10243. computeErasParse.call(this);
  10244. }
  10245. return isStrict ? this._erasNameRegex : this._erasRegex;
  10246. }
  10247. function erasAbbrRegex(isStrict) {
  10248. if (!hasOwnProp(this, "_erasAbbrRegex")) {
  10249. computeErasParse.call(this);
  10250. }
  10251. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  10252. }
  10253. function erasNarrowRegex(isStrict) {
  10254. if (!hasOwnProp(this, "_erasNarrowRegex")) {
  10255. computeErasParse.call(this);
  10256. }
  10257. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  10258. }
  10259. function matchEraAbbr(isStrict, locale2) {
  10260. return locale2.erasAbbrRegex(isStrict);
  10261. }
  10262. function matchEraName(isStrict, locale2) {
  10263. return locale2.erasNameRegex(isStrict);
  10264. }
  10265. function matchEraNarrow(isStrict, locale2) {
  10266. return locale2.erasNarrowRegex(isStrict);
  10267. }
  10268. function matchEraYearOrdinal(isStrict, locale2) {
  10269. return locale2._eraYearOrdinalRegex || matchUnsigned;
  10270. }
  10271. function computeErasParse() {
  10272. var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i2, l2, eras = this.eras();
  10273. for (i2 = 0, l2 = eras.length; i2 < l2; ++i2) {
  10274. namePieces.push(regexEscape(eras[i2].name));
  10275. abbrPieces.push(regexEscape(eras[i2].abbr));
  10276. narrowPieces.push(regexEscape(eras[i2].narrow));
  10277. mixedPieces.push(regexEscape(eras[i2].name));
  10278. mixedPieces.push(regexEscape(eras[i2].abbr));
  10279. mixedPieces.push(regexEscape(eras[i2].narrow));
  10280. }
  10281. this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
  10282. this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
  10283. this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i");
  10284. this._erasNarrowRegex = new RegExp(
  10285. "^(" + narrowPieces.join("|") + ")",
  10286. "i"
  10287. );
  10288. }
  10289. addFormatToken(0, ["gg", 2], 0, function() {
  10290. return this.weekYear() % 100;
  10291. });
  10292. addFormatToken(0, ["GG", 2], 0, function() {
  10293. return this.isoWeekYear() % 100;
  10294. });
  10295. function addWeekYearFormatToken(token2, getter) {
  10296. addFormatToken(0, [token2, token2.length], 0, getter);
  10297. }
  10298. addWeekYearFormatToken("gggg", "weekYear");
  10299. addWeekYearFormatToken("ggggg", "weekYear");
  10300. addWeekYearFormatToken("GGGG", "isoWeekYear");
  10301. addWeekYearFormatToken("GGGGG", "isoWeekYear");
  10302. addUnitAlias("weekYear", "gg");
  10303. addUnitAlias("isoWeekYear", "GG");
  10304. addUnitPriority("weekYear", 1);
  10305. addUnitPriority("isoWeekYear", 1);
  10306. addRegexToken("G", matchSigned);
  10307. addRegexToken("g", matchSigned);
  10308. addRegexToken("GG", match1to2, match2);
  10309. addRegexToken("gg", match1to2, match2);
  10310. addRegexToken("GGGG", match1to4, match4);
  10311. addRegexToken("gggg", match1to4, match4);
  10312. addRegexToken("GGGGG", match1to6, match6);
  10313. addRegexToken("ggggg", match1to6, match6);
  10314. addWeekParseToken(
  10315. ["gggg", "ggggg", "GGGG", "GGGGG"],
  10316. function(input, week, config, token2) {
  10317. week[token2.substr(0, 2)] = toInt(input);
  10318. }
  10319. );
  10320. addWeekParseToken(["gg", "GG"], function(input, week, config, token2) {
  10321. week[token2] = hooks.parseTwoDigitYear(input);
  10322. });
  10323. function getSetWeekYear(input) {
  10324. return getSetWeekYearHelper.call(
  10325. this,
  10326. input,
  10327. this.week(),
  10328. this.weekday(),
  10329. this.localeData()._week.dow,
  10330. this.localeData()._week.doy
  10331. );
  10332. }
  10333. function getSetISOWeekYear(input) {
  10334. return getSetWeekYearHelper.call(
  10335. this,
  10336. input,
  10337. this.isoWeek(),
  10338. this.isoWeekday(),
  10339. 1,
  10340. 4
  10341. );
  10342. }
  10343. function getISOWeeksInYear() {
  10344. return weeksInYear(this.year(), 1, 4);
  10345. }
  10346. function getISOWeeksInISOWeekYear() {
  10347. return weeksInYear(this.isoWeekYear(), 1, 4);
  10348. }
  10349. function getWeeksInYear() {
  10350. var weekInfo = this.localeData()._week;
  10351. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  10352. }
  10353. function getWeeksInWeekYear() {
  10354. var weekInfo = this.localeData()._week;
  10355. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  10356. }
  10357. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  10358. var weeksTarget;
  10359. if (input == null) {
  10360. return weekOfYear(this, dow, doy).year;
  10361. } else {
  10362. weeksTarget = weeksInYear(input, dow, doy);
  10363. if (week > weeksTarget) {
  10364. week = weeksTarget;
  10365. }
  10366. return setWeekAll.call(this, input, week, weekday, dow, doy);
  10367. }
  10368. }
  10369. function setWeekAll(weekYear, week, weekday, dow, doy) {
  10370. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  10371. this.year(date.getUTCFullYear());
  10372. this.month(date.getUTCMonth());
  10373. this.date(date.getUTCDate());
  10374. return this;
  10375. }
  10376. addFormatToken("Q", 0, "Qo", "quarter");
  10377. addUnitAlias("quarter", "Q");
  10378. addUnitPriority("quarter", 7);
  10379. addRegexToken("Q", match1);
  10380. addParseToken("Q", function(input, array) {
  10381. array[MONTH] = (toInt(input) - 1) * 3;
  10382. });
  10383. function getSetQuarter(input) {
  10384. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  10385. }
  10386. addFormatToken("D", ["DD", 2], "Do", "date");
  10387. addUnitAlias("date", "D");
  10388. addUnitPriority("date", 9);
  10389. addRegexToken("D", match1to2);
  10390. addRegexToken("DD", match1to2, match2);
  10391. addRegexToken("Do", function(isStrict, locale2) {
  10392. return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
  10393. });
  10394. addParseToken(["D", "DD"], DATE);
  10395. addParseToken("Do", function(input, array) {
  10396. array[DATE] = toInt(input.match(match1to2)[0]);
  10397. });
  10398. var getSetDayOfMonth = makeGetSet("Date", true);
  10399. addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
  10400. addUnitAlias("dayOfYear", "DDD");
  10401. addUnitPriority("dayOfYear", 4);
  10402. addRegexToken("DDD", match1to3);
  10403. addRegexToken("DDDD", match3);
  10404. addParseToken(["DDD", "DDDD"], function(input, array, config) {
  10405. config._dayOfYear = toInt(input);
  10406. });
  10407. function getSetDayOfYear(input) {
  10408. var dayOfYear = Math.round(
  10409. (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
  10410. ) + 1;
  10411. return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
  10412. }
  10413. addFormatToken("m", ["mm", 2], 0, "minute");
  10414. addUnitAlias("minute", "m");
  10415. addUnitPriority("minute", 14);
  10416. addRegexToken("m", match1to2);
  10417. addRegexToken("mm", match1to2, match2);
  10418. addParseToken(["m", "mm"], MINUTE);
  10419. var getSetMinute = makeGetSet("Minutes", false);
  10420. addFormatToken("s", ["ss", 2], 0, "second");
  10421. addUnitAlias("second", "s");
  10422. addUnitPriority("second", 15);
  10423. addRegexToken("s", match1to2);
  10424. addRegexToken("ss", match1to2, match2);
  10425. addParseToken(["s", "ss"], SECOND);
  10426. var getSetSecond = makeGetSet("Seconds", false);
  10427. addFormatToken("S", 0, 0, function() {
  10428. return ~~(this.millisecond() / 100);
  10429. });
  10430. addFormatToken(0, ["SS", 2], 0, function() {
  10431. return ~~(this.millisecond() / 10);
  10432. });
  10433. addFormatToken(0, ["SSS", 3], 0, "millisecond");
  10434. addFormatToken(0, ["SSSS", 4], 0, function() {
  10435. return this.millisecond() * 10;
  10436. });
  10437. addFormatToken(0, ["SSSSS", 5], 0, function() {
  10438. return this.millisecond() * 100;
  10439. });
  10440. addFormatToken(0, ["SSSSSS", 6], 0, function() {
  10441. return this.millisecond() * 1e3;
  10442. });
  10443. addFormatToken(0, ["SSSSSSS", 7], 0, function() {
  10444. return this.millisecond() * 1e4;
  10445. });
  10446. addFormatToken(0, ["SSSSSSSS", 8], 0, function() {
  10447. return this.millisecond() * 1e5;
  10448. });
  10449. addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
  10450. return this.millisecond() * 1e6;
  10451. });
  10452. addUnitAlias("millisecond", "ms");
  10453. addUnitPriority("millisecond", 16);
  10454. addRegexToken("S", match1to3, match1);
  10455. addRegexToken("SS", match1to3, match2);
  10456. addRegexToken("SSS", match1to3, match3);
  10457. var token, getSetMillisecond;
  10458. for (token = "SSSS"; token.length <= 9; token += "S") {
  10459. addRegexToken(token, matchUnsigned);
  10460. }
  10461. function parseMs(input, array) {
  10462. array[MILLISECOND] = toInt(("0." + input) * 1e3);
  10463. }
  10464. for (token = "S"; token.length <= 9; token += "S") {
  10465. addParseToken(token, parseMs);
  10466. }
  10467. getSetMillisecond = makeGetSet("Milliseconds", false);
  10468. addFormatToken("z", 0, 0, "zoneAbbr");
  10469. addFormatToken("zz", 0, 0, "zoneName");
  10470. function getZoneAbbr() {
  10471. return this._isUTC ? "UTC" : "";
  10472. }
  10473. function getZoneName() {
  10474. return this._isUTC ? "Coordinated Universal Time" : "";
  10475. }
  10476. var proto = Moment.prototype;
  10477. proto.add = add;
  10478. proto.calendar = calendar$1;
  10479. proto.clone = clone;
  10480. proto.diff = diff;
  10481. proto.endOf = endOf;
  10482. proto.format = format;
  10483. proto.from = from;
  10484. proto.fromNow = fromNow;
  10485. proto.to = to;
  10486. proto.toNow = toNow;
  10487. proto.get = stringGet;
  10488. proto.invalidAt = invalidAt;
  10489. proto.isAfter = isAfter;
  10490. proto.isBefore = isBefore;
  10491. proto.isBetween = isBetween;
  10492. proto.isSame = isSame;
  10493. proto.isSameOrAfter = isSameOrAfter;
  10494. proto.isSameOrBefore = isSameOrBefore;
  10495. proto.isValid = isValid$2;
  10496. proto.lang = lang;
  10497. proto.locale = locale;
  10498. proto.localeData = localeData;
  10499. proto.max = prototypeMax;
  10500. proto.min = prototypeMin;
  10501. proto.parsingFlags = parsingFlags;
  10502. proto.set = stringSet;
  10503. proto.startOf = startOf;
  10504. proto.subtract = subtract;
  10505. proto.toArray = toArray;
  10506. proto.toObject = toObject;
  10507. proto.toDate = toDate;
  10508. proto.toISOString = toISOString;
  10509. proto.inspect = inspect;
  10510. if (typeof Symbol !== "undefined" && Symbol.for != null) {
  10511. proto[Symbol.for("nodejs.util.inspect.custom")] = function() {
  10512. return "Moment<" + this.format() + ">";
  10513. };
  10514. }
  10515. proto.toJSON = toJSON;
  10516. proto.toString = toString;
  10517. proto.unix = unix;
  10518. proto.valueOf = valueOf;
  10519. proto.creationData = creationData;
  10520. proto.eraName = getEraName;
  10521. proto.eraNarrow = getEraNarrow;
  10522. proto.eraAbbr = getEraAbbr;
  10523. proto.eraYear = getEraYear;
  10524. proto.year = getSetYear;
  10525. proto.isLeapYear = getIsLeapYear;
  10526. proto.weekYear = getSetWeekYear;
  10527. proto.isoWeekYear = getSetISOWeekYear;
  10528. proto.quarter = proto.quarters = getSetQuarter;
  10529. proto.month = getSetMonth;
  10530. proto.daysInMonth = getDaysInMonth;
  10531. proto.week = proto.weeks = getSetWeek;
  10532. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  10533. proto.weeksInYear = getWeeksInYear;
  10534. proto.weeksInWeekYear = getWeeksInWeekYear;
  10535. proto.isoWeeksInYear = getISOWeeksInYear;
  10536. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  10537. proto.date = getSetDayOfMonth;
  10538. proto.day = proto.days = getSetDayOfWeek;
  10539. proto.weekday = getSetLocaleDayOfWeek;
  10540. proto.isoWeekday = getSetISODayOfWeek;
  10541. proto.dayOfYear = getSetDayOfYear;
  10542. proto.hour = proto.hours = getSetHour;
  10543. proto.minute = proto.minutes = getSetMinute;
  10544. proto.second = proto.seconds = getSetSecond;
  10545. proto.millisecond = proto.milliseconds = getSetMillisecond;
  10546. proto.utcOffset = getSetOffset;
  10547. proto.utc = setOffsetToUTC;
  10548. proto.local = setOffsetToLocal;
  10549. proto.parseZone = setOffsetToParsedOffset;
  10550. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  10551. proto.isDST = isDaylightSavingTime;
  10552. proto.isLocal = isLocal;
  10553. proto.isUtcOffset = isUtcOffset;
  10554. proto.isUtc = isUtc;
  10555. proto.isUTC = isUtc;
  10556. proto.zoneAbbr = getZoneAbbr;
  10557. proto.zoneName = getZoneName;
  10558. proto.dates = deprecate(
  10559. "dates accessor is deprecated. Use date instead.",
  10560. getSetDayOfMonth
  10561. );
  10562. proto.months = deprecate(
  10563. "months accessor is deprecated. Use month instead",
  10564. getSetMonth
  10565. );
  10566. proto.years = deprecate(
  10567. "years accessor is deprecated. Use year instead",
  10568. getSetYear
  10569. );
  10570. proto.zone = deprecate(
  10571. "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
  10572. getSetZone
  10573. );
  10574. proto.isDSTShifted = deprecate(
  10575. "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
  10576. isDaylightSavingTimeShifted
  10577. );
  10578. function createUnix(input) {
  10579. return createLocal(input * 1e3);
  10580. }
  10581. function createInZone() {
  10582. return createLocal.apply(null, arguments).parseZone();
  10583. }
  10584. function preParsePostFormat(string) {
  10585. return string;
  10586. }
  10587. var proto$1 = Locale.prototype;
  10588. proto$1.calendar = calendar;
  10589. proto$1.longDateFormat = longDateFormat;
  10590. proto$1.invalidDate = invalidDate;
  10591. proto$1.ordinal = ordinal;
  10592. proto$1.preparse = preParsePostFormat;
  10593. proto$1.postformat = preParsePostFormat;
  10594. proto$1.relativeTime = relativeTime;
  10595. proto$1.pastFuture = pastFuture;
  10596. proto$1.set = set;
  10597. proto$1.eras = localeEras;
  10598. proto$1.erasParse = localeErasParse;
  10599. proto$1.erasConvertYear = localeErasConvertYear;
  10600. proto$1.erasAbbrRegex = erasAbbrRegex;
  10601. proto$1.erasNameRegex = erasNameRegex;
  10602. proto$1.erasNarrowRegex = erasNarrowRegex;
  10603. proto$1.months = localeMonths;
  10604. proto$1.monthsShort = localeMonthsShort;
  10605. proto$1.monthsParse = localeMonthsParse;
  10606. proto$1.monthsRegex = monthsRegex;
  10607. proto$1.monthsShortRegex = monthsShortRegex;
  10608. proto$1.week = localeWeek;
  10609. proto$1.firstDayOfYear = localeFirstDayOfYear;
  10610. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  10611. proto$1.weekdays = localeWeekdays;
  10612. proto$1.weekdaysMin = localeWeekdaysMin;
  10613. proto$1.weekdaysShort = localeWeekdaysShort;
  10614. proto$1.weekdaysParse = localeWeekdaysParse;
  10615. proto$1.weekdaysRegex = weekdaysRegex;
  10616. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  10617. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  10618. proto$1.isPM = localeIsPM;
  10619. proto$1.meridiem = localeMeridiem;
  10620. function get$1(format2, index2, field, setter) {
  10621. var locale2 = getLocale(), utc = createUTC().set(setter, index2);
  10622. return locale2[field](utc, format2);
  10623. }
  10624. function listMonthsImpl(format2, index2, field) {
  10625. if (isNumber(format2)) {
  10626. index2 = format2;
  10627. format2 = void 0;
  10628. }
  10629. format2 = format2 || "";
  10630. if (index2 != null) {
  10631. return get$1(format2, index2, field, "month");
  10632. }
  10633. var i2, out = [];
  10634. for (i2 = 0; i2 < 12; i2++) {
  10635. out[i2] = get$1(format2, i2, field, "month");
  10636. }
  10637. return out;
  10638. }
  10639. function listWeekdaysImpl(localeSorted, format2, index2, field) {
  10640. if (typeof localeSorted === "boolean") {
  10641. if (isNumber(format2)) {
  10642. index2 = format2;
  10643. format2 = void 0;
  10644. }
  10645. format2 = format2 || "";
  10646. } else {
  10647. format2 = localeSorted;
  10648. index2 = format2;
  10649. localeSorted = false;
  10650. if (isNumber(format2)) {
  10651. index2 = format2;
  10652. format2 = void 0;
  10653. }
  10654. format2 = format2 || "";
  10655. }
  10656. var locale2 = getLocale(), shift = localeSorted ? locale2._week.dow : 0, i2, out = [];
  10657. if (index2 != null) {
  10658. return get$1(format2, (index2 + shift) % 7, field, "day");
  10659. }
  10660. for (i2 = 0; i2 < 7; i2++) {
  10661. out[i2] = get$1(format2, (i2 + shift) % 7, field, "day");
  10662. }
  10663. return out;
  10664. }
  10665. function listMonths(format2, index2) {
  10666. return listMonthsImpl(format2, index2, "months");
  10667. }
  10668. function listMonthsShort(format2, index2) {
  10669. return listMonthsImpl(format2, index2, "monthsShort");
  10670. }
  10671. function listWeekdays(localeSorted, format2, index2) {
  10672. return listWeekdaysImpl(localeSorted, format2, index2, "weekdays");
  10673. }
  10674. function listWeekdaysShort(localeSorted, format2, index2) {
  10675. return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysShort");
  10676. }
  10677. function listWeekdaysMin(localeSorted, format2, index2) {
  10678. return listWeekdaysImpl(localeSorted, format2, index2, "weekdaysMin");
  10679. }
  10680. getSetGlobalLocale("en", {
  10681. eras: [
  10682. {
  10683. since: "0001-01-01",
  10684. until: Infinity,
  10685. offset: 1,
  10686. name: "Anno Domini",
  10687. narrow: "AD",
  10688. abbr: "AD"
  10689. },
  10690. {
  10691. since: "0000-12-31",
  10692. until: -Infinity,
  10693. offset: 1,
  10694. name: "Before Christ",
  10695. narrow: "BC",
  10696. abbr: "BC"
  10697. }
  10698. ],
  10699. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  10700. ordinal: function(number) {
  10701. var b2 = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b2 === 1 ? "st" : b2 === 2 ? "nd" : b2 === 3 ? "rd" : "th";
  10702. return number + output;
  10703. }
  10704. });
  10705. hooks.lang = deprecate(
  10706. "moment.lang is deprecated. Use moment.locale instead.",
  10707. getSetGlobalLocale
  10708. );
  10709. hooks.langData = deprecate(
  10710. "moment.langData is deprecated. Use moment.localeData instead.",
  10711. getLocale
  10712. );
  10713. var mathAbs = Math.abs;
  10714. function abs() {
  10715. var data = this._data;
  10716. this._milliseconds = mathAbs(this._milliseconds);
  10717. this._days = mathAbs(this._days);
  10718. this._months = mathAbs(this._months);
  10719. data.milliseconds = mathAbs(data.milliseconds);
  10720. data.seconds = mathAbs(data.seconds);
  10721. data.minutes = mathAbs(data.minutes);
  10722. data.hours = mathAbs(data.hours);
  10723. data.months = mathAbs(data.months);
  10724. data.years = mathAbs(data.years);
  10725. return this;
  10726. }
  10727. function addSubtract$1(duration, input, value, direction) {
  10728. var other = createDuration(input, value);
  10729. duration._milliseconds += direction * other._milliseconds;
  10730. duration._days += direction * other._days;
  10731. duration._months += direction * other._months;
  10732. return duration._bubble();
  10733. }
  10734. function add$1(input, value) {
  10735. return addSubtract$1(this, input, value, 1);
  10736. }
  10737. function subtract$1(input, value) {
  10738. return addSubtract$1(this, input, value, -1);
  10739. }
  10740. function absCeil(number) {
  10741. if (number < 0) {
  10742. return Math.floor(number);
  10743. } else {
  10744. return Math.ceil(number);
  10745. }
  10746. }
  10747. function bubble() {
  10748. var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays;
  10749. if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) {
  10750. milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5;
  10751. days2 = 0;
  10752. months2 = 0;
  10753. }
  10754. data.milliseconds = milliseconds2 % 1e3;
  10755. seconds2 = absFloor(milliseconds2 / 1e3);
  10756. data.seconds = seconds2 % 60;
  10757. minutes2 = absFloor(seconds2 / 60);
  10758. data.minutes = minutes2 % 60;
  10759. hours2 = absFloor(minutes2 / 60);
  10760. data.hours = hours2 % 24;
  10761. days2 += absFloor(hours2 / 24);
  10762. monthsFromDays = absFloor(daysToMonths(days2));
  10763. months2 += monthsFromDays;
  10764. days2 -= absCeil(monthsToDays(monthsFromDays));
  10765. years2 = absFloor(months2 / 12);
  10766. months2 %= 12;
  10767. data.days = days2;
  10768. data.months = months2;
  10769. data.years = years2;
  10770. return this;
  10771. }
  10772. function daysToMonths(days2) {
  10773. return days2 * 4800 / 146097;
  10774. }
  10775. function monthsToDays(months2) {
  10776. return months2 * 146097 / 4800;
  10777. }
  10778. function as$1(units) {
  10779. if (!this.isValid()) {
  10780. return NaN;
  10781. }
  10782. var days2, months2, milliseconds2 = this._milliseconds;
  10783. units = normalizeUnits(units);
  10784. if (units === "month" || units === "quarter" || units === "year") {
  10785. days2 = this._days + milliseconds2 / 864e5;
  10786. months2 = this._months + daysToMonths(days2);
  10787. switch (units) {
  10788. case "month":
  10789. return months2;
  10790. case "quarter":
  10791. return months2 / 3;
  10792. case "year":
  10793. return months2 / 12;
  10794. }
  10795. } else {
  10796. days2 = this._days + Math.round(monthsToDays(this._months));
  10797. switch (units) {
  10798. case "week":
  10799. return days2 / 7 + milliseconds2 / 6048e5;
  10800. case "day":
  10801. return days2 + milliseconds2 / 864e5;
  10802. case "hour":
  10803. return days2 * 24 + milliseconds2 / 36e5;
  10804. case "minute":
  10805. return days2 * 1440 + milliseconds2 / 6e4;
  10806. case "second":
  10807. return days2 * 86400 + milliseconds2 / 1e3;
  10808. case "millisecond":
  10809. return Math.floor(days2 * 864e5) + milliseconds2;
  10810. default:
  10811. throw new Error("Unknown unit " + units);
  10812. }
  10813. }
  10814. }
  10815. function valueOf$1() {
  10816. if (!this.isValid()) {
  10817. return NaN;
  10818. }
  10819. return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
  10820. }
  10821. function makeAs(alias) {
  10822. return function() {
  10823. return this.as(alias);
  10824. };
  10825. }
  10826. var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y");
  10827. function clone$1() {
  10828. return createDuration(this);
  10829. }
  10830. function get$2(units) {
  10831. units = normalizeUnits(units);
  10832. return this.isValid() ? this[units + "s"]() : NaN;
  10833. }
  10834. function makeGetter(name) {
  10835. return function() {
  10836. return this.isValid() ? this._data[name] : NaN;
  10837. };
  10838. }
  10839. var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years");
  10840. function weeks() {
  10841. return absFloor(this.days() / 7);
  10842. }
  10843. var round = Math.round, thresholds = {
  10844. ss: 44,
  10845. // a few seconds to seconds
  10846. s: 45,
  10847. // seconds to minute
  10848. m: 45,
  10849. // minutes to hour
  10850. h: 22,
  10851. // hours to day
  10852. d: 26,
  10853. // days to month/week
  10854. w: null,
  10855. // weeks to month
  10856. M: 11
  10857. // months to year
  10858. };
  10859. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
  10860. return locale2.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  10861. }
  10862. function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale2) {
  10863. var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a2 = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
  10864. if (thresholds2.w != null) {
  10865. a2 = a2 || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
  10866. }
  10867. a2 = a2 || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2];
  10868. a2[2] = withoutSuffix;
  10869. a2[3] = +posNegDuration > 0;
  10870. a2[4] = locale2;
  10871. return substituteTimeAgo.apply(null, a2);
  10872. }
  10873. function getSetRelativeTimeRounding(roundingFunction) {
  10874. if (roundingFunction === void 0) {
  10875. return round;
  10876. }
  10877. if (typeof roundingFunction === "function") {
  10878. round = roundingFunction;
  10879. return true;
  10880. }
  10881. return false;
  10882. }
  10883. function getSetRelativeTimeThreshold(threshold, limit) {
  10884. if (thresholds[threshold] === void 0) {
  10885. return false;
  10886. }
  10887. if (limit === void 0) {
  10888. return thresholds[threshold];
  10889. }
  10890. thresholds[threshold] = limit;
  10891. if (threshold === "s") {
  10892. thresholds.ss = limit - 1;
  10893. }
  10894. return true;
  10895. }
  10896. function humanize(argWithSuffix, argThresholds) {
  10897. if (!this.isValid()) {
  10898. return this.localeData().invalidDate();
  10899. }
  10900. var withSuffix = false, th = thresholds, locale2, output;
  10901. if (typeof argWithSuffix === "object") {
  10902. argThresholds = argWithSuffix;
  10903. argWithSuffix = false;
  10904. }
  10905. if (typeof argWithSuffix === "boolean") {
  10906. withSuffix = argWithSuffix;
  10907. }
  10908. if (typeof argThresholds === "object") {
  10909. th = Object.assign({}, thresholds, argThresholds);
  10910. if (argThresholds.s != null && argThresholds.ss == null) {
  10911. th.ss = argThresholds.s - 1;
  10912. }
  10913. }
  10914. locale2 = this.localeData();
  10915. output = relativeTime$1(this, !withSuffix, th, locale2);
  10916. if (withSuffix) {
  10917. output = locale2.pastFuture(+this, output);
  10918. }
  10919. return locale2.postformat(output);
  10920. }
  10921. var abs$1 = Math.abs;
  10922. function sign(x2) {
  10923. return (x2 > 0) - (x2 < 0) || +x2;
  10924. }
  10925. function toISOString$1() {
  10926. if (!this.isValid()) {
  10927. return this.localeData().invalidDate();
  10928. }
  10929. var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s2, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
  10930. if (!total) {
  10931. return "P0D";
  10932. }
  10933. minutes2 = absFloor(seconds2 / 60);
  10934. hours2 = absFloor(minutes2 / 60);
  10935. seconds2 %= 60;
  10936. minutes2 %= 60;
  10937. years2 = absFloor(months2 / 12);
  10938. months2 %= 12;
  10939. s2 = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : "";
  10940. totalSign = total < 0 ? "-" : "";
  10941. ymSign = sign(this._months) !== sign(total) ? "-" : "";
  10942. daysSign = sign(this._days) !== sign(total) ? "-" : "";
  10943. hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
  10944. return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s2 + "S" : "");
  10945. }
  10946. var proto$2 = Duration.prototype;
  10947. proto$2.isValid = isValid$1;
  10948. proto$2.abs = abs;
  10949. proto$2.add = add$1;
  10950. proto$2.subtract = subtract$1;
  10951. proto$2.as = as$1;
  10952. proto$2.asMilliseconds = asMilliseconds;
  10953. proto$2.asSeconds = asSeconds;
  10954. proto$2.asMinutes = asMinutes;
  10955. proto$2.asHours = asHours;
  10956. proto$2.asDays = asDays;
  10957. proto$2.asWeeks = asWeeks;
  10958. proto$2.asMonths = asMonths;
  10959. proto$2.asQuarters = asQuarters;
  10960. proto$2.asYears = asYears;
  10961. proto$2.valueOf = valueOf$1;
  10962. proto$2._bubble = bubble;
  10963. proto$2.clone = clone$1;
  10964. proto$2.get = get$2;
  10965. proto$2.milliseconds = milliseconds;
  10966. proto$2.seconds = seconds;
  10967. proto$2.minutes = minutes;
  10968. proto$2.hours = hours;
  10969. proto$2.days = days;
  10970. proto$2.weeks = weeks;
  10971. proto$2.months = months;
  10972. proto$2.years = years;
  10973. proto$2.humanize = humanize;
  10974. proto$2.toISOString = toISOString$1;
  10975. proto$2.toString = toISOString$1;
  10976. proto$2.toJSON = toISOString$1;
  10977. proto$2.locale = locale;
  10978. proto$2.localeData = localeData;
  10979. proto$2.toIsoString = deprecate(
  10980. "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
  10981. toISOString$1
  10982. );
  10983. proto$2.lang = lang;
  10984. addFormatToken("X", 0, 0, "unix");
  10985. addFormatToken("x", 0, 0, "valueOf");
  10986. addRegexToken("x", matchSigned);
  10987. addRegexToken("X", matchTimestamp);
  10988. addParseToken("X", function(input, array, config) {
  10989. config._d = new Date(parseFloat(input) * 1e3);
  10990. });
  10991. addParseToken("x", function(input, array, config) {
  10992. config._d = new Date(toInt(input));
  10993. });
  10994. //! moment.js
  10995. hooks.version = "2.29.4";
  10996. setHookCallback(createLocal);
  10997. hooks.fn = proto;
  10998. hooks.min = min;
  10999. hooks.max = max;
  11000. hooks.now = now;
  11001. hooks.utc = createUTC;
  11002. hooks.unix = createUnix;
  11003. hooks.months = listMonths;
  11004. hooks.isDate = isDate;
  11005. hooks.locale = getSetGlobalLocale;
  11006. hooks.invalid = createInvalid;
  11007. hooks.duration = createDuration;
  11008. hooks.isMoment = isMoment;
  11009. hooks.weekdays = listWeekdays;
  11010. hooks.parseZone = createInZone;
  11011. hooks.localeData = getLocale;
  11012. hooks.isDuration = isDuration;
  11013. hooks.monthsShort = listMonthsShort;
  11014. hooks.weekdaysMin = listWeekdaysMin;
  11015. hooks.defineLocale = defineLocale;
  11016. hooks.updateLocale = updateLocale;
  11017. hooks.locales = listLocales;
  11018. hooks.weekdaysShort = listWeekdaysShort;
  11019. hooks.normalizeUnits = normalizeUnits;
  11020. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  11021. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  11022. hooks.calendarFormat = getCalendarFormat;
  11023. hooks.prototype = proto;
  11024. hooks.HTML5_FMT = {
  11025. DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
  11026. // <input type="datetime-local" />
  11027. DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
  11028. // <input type="datetime-local" step="1" />
  11029. DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
  11030. // <input type="datetime-local" step="0.001" />
  11031. DATE: "YYYY-MM-DD",
  11032. // <input type="date" />
  11033. TIME: "HH:mm",
  11034. // <input type="time" />
  11035. TIME_SECONDS: "HH:mm:ss",
  11036. // <input type="time" step="1" />
  11037. TIME_MS: "HH:mm:ss.SSS",
  11038. // <input type="time" step="0.001" />
  11039. WEEK: "GGGG-[W]WW",
  11040. // <input type="week" />
  11041. MONTH: "YYYY-MM"
  11042. // <input type="month" />
  11043. };
  11044. const pages = [
  11045. {
  11046. path: "pages/index/index",
  11047. style: {
  11048. navigationBarTitleText: "系统页",
  11049. navigationStyle: "custom",
  11050. "app-plus": {
  11051. titleNView: false
  11052. }
  11053. }
  11054. },
  11055. {
  11056. path: "pages/home/index",
  11057. style: {
  11058. navigationBarTitleText: "首页",
  11059. enablePullDownRefresh: true
  11060. }
  11061. },
  11062. {
  11063. path: "pages/login/index",
  11064. style: {
  11065. navigationBarTitleText: "登录",
  11066. navigationBarTextStyle: "black",
  11067. navigationBarBackgroundColor: "#F8F8F8",
  11068. backgroundColor: "#F8F8F8",
  11069. backgroundColorTop: "#F4F5F6",
  11070. backgroundColorBottom: "#F4F5F6"
  11071. }
  11072. }
  11073. ];
  11074. const subPackages = [
  11075. {
  11076. root: "pagesHome",
  11077. pages: [
  11078. {
  11079. path: "agree/index",
  11080. style: {
  11081. navigationBarTitleText: "用户协议",
  11082. enablePullDownRefresh: false,
  11083. navigationBarTextStyle: "black",
  11084. navigationBarBackgroundColor: "#F8F8F8",
  11085. backgroundColor: "#F8F8F8",
  11086. backgroundColorTop: "#F4F5F6",
  11087. backgroundColorBottom: "#F4F5F6"
  11088. }
  11089. },
  11090. {
  11091. path: "city/index",
  11092. style: {
  11093. navigationBarTitleText: "城市选择",
  11094. enablePullDownRefresh: false,
  11095. navigationBarTextStyle: "black",
  11096. navigationBarBackgroundColor: "#F8F8F8",
  11097. backgroundColor: "#F8F8F8",
  11098. backgroundColorTop: "#F4F5F6",
  11099. backgroundColorBottom: "#F4F5F6"
  11100. }
  11101. },
  11102. {
  11103. path: "team/index",
  11104. style: {
  11105. navigationBarTitleText: "创建球队"
  11106. }
  11107. },
  11108. {
  11109. path: "team/info",
  11110. style: {
  11111. navigationBarTitleText: "球队详情"
  11112. }
  11113. },
  11114. {
  11115. path: "team/person",
  11116. style: {
  11117. navigationBarTitleText: "球队阵容"
  11118. }
  11119. },
  11120. {
  11121. path: "team/album",
  11122. style: {
  11123. navigationBarTitleText: "球队相册"
  11124. }
  11125. },
  11126. {
  11127. path: "team/book",
  11128. style: {
  11129. navigationBarTitleText: "球队账本"
  11130. }
  11131. },
  11132. {
  11133. path: "team/board",
  11134. style: {
  11135. navigationBarTitleText: "球队战术板"
  11136. }
  11137. },
  11138. {
  11139. path: "match/index",
  11140. style: {
  11141. navigationBarTitleText: "创建赛事"
  11142. }
  11143. },
  11144. {
  11145. path: "match/info",
  11146. style: {
  11147. navigationBarTitleText: "赛事详情"
  11148. }
  11149. },
  11150. {
  11151. path: "activity/index",
  11152. style: {
  11153. navigationBarTitleText: "活动列表",
  11154. enablePullDownRefresh: true
  11155. }
  11156. },
  11157. {
  11158. path: "activity/info",
  11159. style: {
  11160. navigationBarTitleText: "活动详情"
  11161. }
  11162. },
  11163. {
  11164. path: "person/index",
  11165. style: {
  11166. navigationBarTitleText: "Ta的球队名片"
  11167. }
  11168. },
  11169. {
  11170. path: "create/index",
  11171. style: {
  11172. navigationBarTitleText: "创建"
  11173. }
  11174. },
  11175. {
  11176. path: "create/person",
  11177. style: {
  11178. navigationBarTitleText: "添加对手"
  11179. }
  11180. }
  11181. ]
  11182. },
  11183. {
  11184. root: "pagesMy",
  11185. pages: [
  11186. {
  11187. path: "basic/index",
  11188. style: {
  11189. navigationBarTitleText: "个人信息"
  11190. }
  11191. }
  11192. ]
  11193. }
  11194. ];
  11195. const globalStyle = {
  11196. navigationBarTextStyle: "white",
  11197. navigationBarTitleText: "系统页",
  11198. navigationBarBackgroundColor: "#121212",
  11199. backgroundColor: "#121212",
  11200. "app-plus": {
  11201. background: "#121212"
  11202. }
  11203. };
  11204. const t = {
  11205. pages,
  11206. subPackages,
  11207. globalStyle
  11208. };
  11209. function n(e2) {
  11210. return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
  11211. }
  11212. function s(e2, t2, n2) {
  11213. return e2(n2 = { path: t2, exports: {}, require: function(e3, t3) {
  11214. return function() {
  11215. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  11216. }(null == t3 && n2.path);
  11217. } }, n2.exports), n2.exports;
  11218. }
  11219. var r = s(function(e2, t2) {
  11220. var n2;
  11221. e2.exports = (n2 = n2 || function(e3, t3) {
  11222. var n3 = Object.create || function() {
  11223. function e4() {
  11224. }
  11225. return function(t4) {
  11226. var n4;
  11227. return e4.prototype = t4, n4 = new e4(), e4.prototype = null, n4;
  11228. };
  11229. }(), s2 = {}, r2 = s2.lib = {}, i2 = r2.Base = { extend: function(e4) {
  11230. var t4 = n3(this);
  11231. return e4 && t4.mixIn(e4), t4.hasOwnProperty("init") && this.init !== t4.init || (t4.init = function() {
  11232. t4.$super.init.apply(this, arguments);
  11233. }), t4.init.prototype = t4, t4.$super = this, t4;
  11234. }, create: function() {
  11235. var e4 = this.extend();
  11236. return e4.init.apply(e4, arguments), e4;
  11237. }, init: function() {
  11238. }, mixIn: function(e4) {
  11239. for (var t4 in e4)
  11240. e4.hasOwnProperty(t4) && (this[t4] = e4[t4]);
  11241. e4.hasOwnProperty("toString") && (this.toString = e4.toString);
  11242. }, clone: function() {
  11243. return this.init.prototype.extend(this);
  11244. } }, o2 = r2.WordArray = i2.extend({ init: function(e4, n4) {
  11245. e4 = this.words = e4 || [], this.sigBytes = n4 != t3 ? n4 : 4 * e4.length;
  11246. }, toString: function(e4) {
  11247. return (e4 || c2).stringify(this);
  11248. }, concat: function(e4) {
  11249. var t4 = this.words, n4 = e4.words, s3 = this.sigBytes, r3 = e4.sigBytes;
  11250. if (this.clamp(), s3 % 4)
  11251. for (var i3 = 0; i3 < r3; i3++) {
  11252. var o3 = n4[i3 >>> 2] >>> 24 - i3 % 4 * 8 & 255;
  11253. t4[s3 + i3 >>> 2] |= o3 << 24 - (s3 + i3) % 4 * 8;
  11254. }
  11255. else
  11256. for (i3 = 0; i3 < r3; i3 += 4)
  11257. t4[s3 + i3 >>> 2] = n4[i3 >>> 2];
  11258. return this.sigBytes += r3, this;
  11259. }, clamp: function() {
  11260. var t4 = this.words, n4 = this.sigBytes;
  11261. t4[n4 >>> 2] &= 4294967295 << 32 - n4 % 4 * 8, t4.length = e3.ceil(n4 / 4);
  11262. }, clone: function() {
  11263. var e4 = i2.clone.call(this);
  11264. return e4.words = this.words.slice(0), e4;
  11265. }, random: function(t4) {
  11266. for (var n4, s3 = [], r3 = function(t5) {
  11267. t5 = t5;
  11268. var n5 = 987654321, s4 = 4294967295;
  11269. return function() {
  11270. var r4 = ((n5 = 36969 * (65535 & n5) + (n5 >> 16) & s4) << 16) + (t5 = 18e3 * (65535 & t5) + (t5 >> 16) & s4) & s4;
  11271. return r4 /= 4294967296, (r4 += 0.5) * (e3.random() > 0.5 ? 1 : -1);
  11272. };
  11273. }, i3 = 0; i3 < t4; i3 += 4) {
  11274. var a3 = r3(4294967296 * (n4 || e3.random()));
  11275. n4 = 987654071 * a3(), s3.push(4294967296 * a3() | 0);
  11276. }
  11277. return new o2.init(s3, t4);
  11278. } }), a2 = s2.enc = {}, c2 = a2.Hex = { stringify: function(e4) {
  11279. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  11280. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  11281. s3.push((i3 >>> 4).toString(16)), s3.push((15 & i3).toString(16));
  11282. }
  11283. return s3.join("");
  11284. }, parse: function(e4) {
  11285. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3 += 2)
  11286. n4[s3 >>> 3] |= parseInt(e4.substr(s3, 2), 16) << 24 - s3 % 8 * 4;
  11287. return new o2.init(n4, t4 / 2);
  11288. } }, u2 = a2.Latin1 = { stringify: function(e4) {
  11289. for (var t4 = e4.words, n4 = e4.sigBytes, s3 = [], r3 = 0; r3 < n4; r3++) {
  11290. var i3 = t4[r3 >>> 2] >>> 24 - r3 % 4 * 8 & 255;
  11291. s3.push(String.fromCharCode(i3));
  11292. }
  11293. return s3.join("");
  11294. }, parse: function(e4) {
  11295. for (var t4 = e4.length, n4 = [], s3 = 0; s3 < t4; s3++)
  11296. n4[s3 >>> 2] |= (255 & e4.charCodeAt(s3)) << 24 - s3 % 4 * 8;
  11297. return new o2.init(n4, t4);
  11298. } }, h2 = a2.Utf8 = { stringify: function(e4) {
  11299. try {
  11300. return decodeURIComponent(escape(u2.stringify(e4)));
  11301. } catch (e5) {
  11302. throw new Error("Malformed UTF-8 data");
  11303. }
  11304. }, parse: function(e4) {
  11305. return u2.parse(unescape(encodeURIComponent(e4)));
  11306. } }, l2 = r2.BufferedBlockAlgorithm = i2.extend({ reset: function() {
  11307. this._data = new o2.init(), this._nDataBytes = 0;
  11308. }, _append: function(e4) {
  11309. "string" == typeof e4 && (e4 = h2.parse(e4)), this._data.concat(e4), this._nDataBytes += e4.sigBytes;
  11310. }, _process: function(t4) {
  11311. var n4 = this._data, s3 = n4.words, r3 = n4.sigBytes, i3 = this.blockSize, a3 = r3 / (4 * i3), c3 = (a3 = t4 ? e3.ceil(a3) : e3.max((0 | a3) - this._minBufferSize, 0)) * i3, u3 = e3.min(4 * c3, r3);
  11312. if (c3) {
  11313. for (var h3 = 0; h3 < c3; h3 += i3)
  11314. this._doProcessBlock(s3, h3);
  11315. var l3 = s3.splice(0, c3);
  11316. n4.sigBytes -= u3;
  11317. }
  11318. return new o2.init(l3, u3);
  11319. }, clone: function() {
  11320. var e4 = i2.clone.call(this);
  11321. return e4._data = this._data.clone(), e4;
  11322. }, _minBufferSize: 0 });
  11323. r2.Hasher = l2.extend({ cfg: i2.extend(), init: function(e4) {
  11324. this.cfg = this.cfg.extend(e4), this.reset();
  11325. }, reset: function() {
  11326. l2.reset.call(this), this._doReset();
  11327. }, update: function(e4) {
  11328. return this._append(e4), this._process(), this;
  11329. }, finalize: function(e4) {
  11330. return e4 && this._append(e4), this._doFinalize();
  11331. }, blockSize: 16, _createHelper: function(e4) {
  11332. return function(t4, n4) {
  11333. return new e4.init(n4).finalize(t4);
  11334. };
  11335. }, _createHmacHelper: function(e4) {
  11336. return function(t4, n4) {
  11337. return new d2.HMAC.init(e4, n4).finalize(t4);
  11338. };
  11339. } });
  11340. var d2 = s2.algo = {};
  11341. return s2;
  11342. }(Math), n2);
  11343. }), i = r, o = (s(function(e2, t2) {
  11344. var n2;
  11345. e2.exports = (n2 = i, function(e3) {
  11346. var t3 = n2, s2 = t3.lib, r2 = s2.WordArray, i2 = s2.Hasher, o2 = t3.algo, a2 = [];
  11347. !function() {
  11348. for (var t4 = 0; t4 < 64; t4++)
  11349. a2[t4] = 4294967296 * e3.abs(e3.sin(t4 + 1)) | 0;
  11350. }();
  11351. var c2 = o2.MD5 = i2.extend({ _doReset: function() {
  11352. this._hash = new r2.init([1732584193, 4023233417, 2562383102, 271733878]);
  11353. }, _doProcessBlock: function(e4, t4) {
  11354. for (var n3 = 0; n3 < 16; n3++) {
  11355. var s3 = t4 + n3, r3 = e4[s3];
  11356. e4[s3] = 16711935 & (r3 << 8 | r3 >>> 24) | 4278255360 & (r3 << 24 | r3 >>> 8);
  11357. }
  11358. var i3 = this._hash.words, o3 = e4[t4 + 0], c3 = e4[t4 + 1], p2 = e4[t4 + 2], f2 = e4[t4 + 3], g2 = e4[t4 + 4], m2 = e4[t4 + 5], y2 = e4[t4 + 6], _2 = e4[t4 + 7], w2 = e4[t4 + 8], v2 = e4[t4 + 9], I2 = e4[t4 + 10], S2 = e4[t4 + 11], b2 = e4[t4 + 12], k2 = e4[t4 + 13], C = e4[t4 + 14], T2 = e4[t4 + 15], P2 = i3[0], A2 = i3[1], E2 = i3[2], O = i3[3];
  11359. P2 = u2(P2, A2, E2, O, o3, 7, a2[0]), O = u2(O, P2, A2, E2, c3, 12, a2[1]), E2 = u2(E2, O, P2, A2, p2, 17, a2[2]), A2 = u2(A2, E2, O, P2, f2, 22, a2[3]), P2 = u2(P2, A2, E2, O, g2, 7, a2[4]), O = u2(O, P2, A2, E2, m2, 12, a2[5]), E2 = u2(E2, O, P2, A2, y2, 17, a2[6]), A2 = u2(A2, E2, O, P2, _2, 22, a2[7]), P2 = u2(P2, A2, E2, O, w2, 7, a2[8]), O = u2(O, P2, A2, E2, v2, 12, a2[9]), E2 = u2(E2, O, P2, A2, I2, 17, a2[10]), A2 = u2(A2, E2, O, P2, S2, 22, a2[11]), P2 = u2(P2, A2, E2, O, b2, 7, a2[12]), O = u2(O, P2, A2, E2, k2, 12, a2[13]), E2 = u2(E2, O, P2, A2, C, 17, a2[14]), P2 = h2(P2, A2 = u2(A2, E2, O, P2, T2, 22, a2[15]), E2, O, c3, 5, a2[16]), O = h2(O, P2, A2, E2, y2, 9, a2[17]), E2 = h2(E2, O, P2, A2, S2, 14, a2[18]), A2 = h2(A2, E2, O, P2, o3, 20, a2[19]), P2 = h2(P2, A2, E2, O, m2, 5, a2[20]), O = h2(O, P2, A2, E2, I2, 9, a2[21]), E2 = h2(E2, O, P2, A2, T2, 14, a2[22]), A2 = h2(A2, E2, O, P2, g2, 20, a2[23]), P2 = h2(P2, A2, E2, O, v2, 5, a2[24]), O = h2(O, P2, A2, E2, C, 9, a2[25]), E2 = h2(E2, O, P2, A2, f2, 14, a2[26]), A2 = h2(A2, E2, O, P2, w2, 20, a2[27]), P2 = h2(P2, A2, E2, O, k2, 5, a2[28]), O = h2(O, P2, A2, E2, p2, 9, a2[29]), E2 = h2(E2, O, P2, A2, _2, 14, a2[30]), P2 = l2(P2, A2 = h2(A2, E2, O, P2, b2, 20, a2[31]), E2, O, m2, 4, a2[32]), O = l2(O, P2, A2, E2, w2, 11, a2[33]), E2 = l2(E2, O, P2, A2, S2, 16, a2[34]), A2 = l2(A2, E2, O, P2, C, 23, a2[35]), P2 = l2(P2, A2, E2, O, c3, 4, a2[36]), O = l2(O, P2, A2, E2, g2, 11, a2[37]), E2 = l2(E2, O, P2, A2, _2, 16, a2[38]), A2 = l2(A2, E2, O, P2, I2, 23, a2[39]), P2 = l2(P2, A2, E2, O, k2, 4, a2[40]), O = l2(O, P2, A2, E2, o3, 11, a2[41]), E2 = l2(E2, O, P2, A2, f2, 16, a2[42]), A2 = l2(A2, E2, O, P2, y2, 23, a2[43]), P2 = l2(P2, A2, E2, O, v2, 4, a2[44]), O = l2(O, P2, A2, E2, b2, 11, a2[45]), E2 = l2(E2, O, P2, A2, T2, 16, a2[46]), P2 = d2(P2, A2 = l2(A2, E2, O, P2, p2, 23, a2[47]), E2, O, o3, 6, a2[48]), O = d2(O, P2, A2, E2, _2, 10, a2[49]), E2 = d2(E2, O, P2, A2, C, 15, a2[50]), A2 = d2(A2, E2, O, P2, m2, 21, a2[51]), P2 = d2(P2, A2, E2, O, b2, 6, a2[52]), O = d2(O, P2, A2, E2, f2, 10, a2[53]), E2 = d2(E2, O, P2, A2, I2, 15, a2[54]), A2 = d2(A2, E2, O, P2, c3, 21, a2[55]), P2 = d2(P2, A2, E2, O, w2, 6, a2[56]), O = d2(O, P2, A2, E2, T2, 10, a2[57]), E2 = d2(E2, O, P2, A2, y2, 15, a2[58]), A2 = d2(A2, E2, O, P2, k2, 21, a2[59]), P2 = d2(P2, A2, E2, O, g2, 6, a2[60]), O = d2(O, P2, A2, E2, S2, 10, a2[61]), E2 = d2(E2, O, P2, A2, p2, 15, a2[62]), A2 = d2(A2, E2, O, P2, v2, 21, a2[63]), i3[0] = i3[0] + P2 | 0, i3[1] = i3[1] + A2 | 0, i3[2] = i3[2] + E2 | 0, i3[3] = i3[3] + O | 0;
  11360. }, _doFinalize: function() {
  11361. var t4 = this._data, n3 = t4.words, s3 = 8 * this._nDataBytes, r3 = 8 * t4.sigBytes;
  11362. n3[r3 >>> 5] |= 128 << 24 - r3 % 32;
  11363. var i3 = e3.floor(s3 / 4294967296), o3 = s3;
  11364. n3[15 + (r3 + 64 >>> 9 << 4)] = 16711935 & (i3 << 8 | i3 >>> 24) | 4278255360 & (i3 << 24 | i3 >>> 8), n3[14 + (r3 + 64 >>> 9 << 4)] = 16711935 & (o3 << 8 | o3 >>> 24) | 4278255360 & (o3 << 24 | o3 >>> 8), t4.sigBytes = 4 * (n3.length + 1), this._process();
  11365. for (var a3 = this._hash, c3 = a3.words, u3 = 0; u3 < 4; u3++) {
  11366. var h3 = c3[u3];
  11367. c3[u3] = 16711935 & (h3 << 8 | h3 >>> 24) | 4278255360 & (h3 << 24 | h3 >>> 8);
  11368. }
  11369. return a3;
  11370. }, clone: function() {
  11371. var e4 = i2.clone.call(this);
  11372. return e4._hash = this._hash.clone(), e4;
  11373. } });
  11374. function u2(e4, t4, n3, s3, r3, i3, o3) {
  11375. var a3 = e4 + (t4 & n3 | ~t4 & s3) + r3 + o3;
  11376. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  11377. }
  11378. function h2(e4, t4, n3, s3, r3, i3, o3) {
  11379. var a3 = e4 + (t4 & s3 | n3 & ~s3) + r3 + o3;
  11380. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  11381. }
  11382. function l2(e4, t4, n3, s3, r3, i3, o3) {
  11383. var a3 = e4 + (t4 ^ n3 ^ s3) + r3 + o3;
  11384. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  11385. }
  11386. function d2(e4, t4, n3, s3, r3, i3, o3) {
  11387. var a3 = e4 + (n3 ^ (t4 | ~s3)) + r3 + o3;
  11388. return (a3 << i3 | a3 >>> 32 - i3) + t4;
  11389. }
  11390. t3.MD5 = i2._createHelper(c2), t3.HmacMD5 = i2._createHmacHelper(c2);
  11391. }(Math), n2.MD5);
  11392. }), s(function(e2, t2) {
  11393. var n2;
  11394. e2.exports = (n2 = i, void function() {
  11395. var e3 = n2, t3 = e3.lib.Base, s2 = e3.enc.Utf8;
  11396. e3.algo.HMAC = t3.extend({ init: function(e4, t4) {
  11397. e4 = this._hasher = new e4.init(), "string" == typeof t4 && (t4 = s2.parse(t4));
  11398. var n3 = e4.blockSize, r2 = 4 * n3;
  11399. t4.sigBytes > r2 && (t4 = e4.finalize(t4)), t4.clamp();
  11400. for (var i2 = this._oKey = t4.clone(), o2 = this._iKey = t4.clone(), a2 = i2.words, c2 = o2.words, u2 = 0; u2 < n3; u2++)
  11401. a2[u2] ^= 1549556828, c2[u2] ^= 909522486;
  11402. i2.sigBytes = o2.sigBytes = r2, this.reset();
  11403. }, reset: function() {
  11404. var e4 = this._hasher;
  11405. e4.reset(), e4.update(this._iKey);
  11406. }, update: function(e4) {
  11407. return this._hasher.update(e4), this;
  11408. }, finalize: function(e4) {
  11409. var t4 = this._hasher, n3 = t4.finalize(e4);
  11410. return t4.reset(), t4.finalize(this._oKey.clone().concat(n3));
  11411. } });
  11412. }());
  11413. }), s(function(e2, t2) {
  11414. e2.exports = i.HmacMD5;
  11415. })), a = s(function(e2, t2) {
  11416. e2.exports = i.enc.Utf8;
  11417. }), c = s(function(e2, t2) {
  11418. var n2;
  11419. e2.exports = (n2 = i, function() {
  11420. var e3 = n2, t3 = e3.lib.WordArray;
  11421. function s2(e4, n3, s3) {
  11422. for (var r2 = [], i2 = 0, o2 = 0; o2 < n3; o2++)
  11423. if (o2 % 4) {
  11424. var a2 = s3[e4.charCodeAt(o2 - 1)] << o2 % 4 * 2, c2 = s3[e4.charCodeAt(o2)] >>> 6 - o2 % 4 * 2;
  11425. r2[i2 >>> 2] |= (a2 | c2) << 24 - i2 % 4 * 8, i2++;
  11426. }
  11427. return t3.create(r2, i2);
  11428. }
  11429. e3.enc.Base64 = { stringify: function(e4) {
  11430. var t4 = e4.words, n3 = e4.sigBytes, s3 = this._map;
  11431. e4.clamp();
  11432. for (var r2 = [], i2 = 0; i2 < n3; i2 += 3)
  11433. for (var o2 = (t4[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255) << 16 | (t4[i2 + 1 >>> 2] >>> 24 - (i2 + 1) % 4 * 8 & 255) << 8 | t4[i2 + 2 >>> 2] >>> 24 - (i2 + 2) % 4 * 8 & 255, a2 = 0; a2 < 4 && i2 + 0.75 * a2 < n3; a2++)
  11434. r2.push(s3.charAt(o2 >>> 6 * (3 - a2) & 63));
  11435. var c2 = s3.charAt(64);
  11436. if (c2)
  11437. for (; r2.length % 4; )
  11438. r2.push(c2);
  11439. return r2.join("");
  11440. }, parse: function(e4) {
  11441. var t4 = e4.length, n3 = this._map, r2 = this._reverseMap;
  11442. if (!r2) {
  11443. r2 = this._reverseMap = [];
  11444. for (var i2 = 0; i2 < n3.length; i2++)
  11445. r2[n3.charCodeAt(i2)] = i2;
  11446. }
  11447. var o2 = n3.charAt(64);
  11448. if (o2) {
  11449. var a2 = e4.indexOf(o2);
  11450. -1 !== a2 && (t4 = a2);
  11451. }
  11452. return s2(e4, t4, r2);
  11453. }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
  11454. }(), n2.enc.Base64);
  11455. });
  11456. const u = "FUNCTION", h = "OBJECT", l = "CLIENT_DB", d = "pending", p = "fullfilled", f = "rejected";
  11457. function g(e2) {
  11458. return Object.prototype.toString.call(e2).slice(8, -1).toLowerCase();
  11459. }
  11460. function m(e2) {
  11461. return "object" === g(e2);
  11462. }
  11463. function y(e2) {
  11464. return "function" == typeof e2;
  11465. }
  11466. function _(e2) {
  11467. return function() {
  11468. try {
  11469. return e2.apply(e2, arguments);
  11470. } catch (e3) {
  11471. console.error(e3);
  11472. }
  11473. };
  11474. }
  11475. const w = "REJECTED", v = "NOT_PENDING";
  11476. class I {
  11477. constructor({ createPromise: e2, retryRule: t2 = w } = {}) {
  11478. this.createPromise = e2, this.status = null, this.promise = null, this.retryRule = t2;
  11479. }
  11480. get needRetry() {
  11481. if (!this.status)
  11482. return true;
  11483. switch (this.retryRule) {
  11484. case w:
  11485. return this.status === f;
  11486. case v:
  11487. return this.status !== d;
  11488. }
  11489. }
  11490. exec() {
  11491. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then((e2) => (this.status = p, Promise.resolve(e2)), (e2) => (this.status = f, Promise.reject(e2))), this.promise) : this.promise;
  11492. }
  11493. }
  11494. function S(e2) {
  11495. return e2 && "string" == typeof e2 ? JSON.parse(e2) : e2;
  11496. }
  11497. const b = true, k = "mp-weixin", T = S([]), P = k, A = S(""), E = S("[]") || [];
  11498. let x = "";
  11499. try {
  11500. x = "__UNI__818FE07";
  11501. } catch (e2) {
  11502. }
  11503. let R = {};
  11504. function U(e2, t2 = {}) {
  11505. var n2, s2;
  11506. return n2 = R, s2 = e2, Object.prototype.hasOwnProperty.call(n2, s2) || (R[e2] = t2), R[e2];
  11507. }
  11508. const L = ["invoke", "success", "fail", "complete"], N = U("_globalUniCloudInterceptor");
  11509. function D(e2, t2) {
  11510. N[e2] || (N[e2] = {}), m(t2) && Object.keys(t2).forEach((n2) => {
  11511. L.indexOf(n2) > -1 && function(e3, t3, n3) {
  11512. let s2 = N[e3][t3];
  11513. s2 || (s2 = N[e3][t3] = []), -1 === s2.indexOf(n3) && y(n3) && s2.push(n3);
  11514. }(e2, n2, t2[n2]);
  11515. });
  11516. }
  11517. function F(e2, t2) {
  11518. N[e2] || (N[e2] = {}), m(t2) ? Object.keys(t2).forEach((n2) => {
  11519. L.indexOf(n2) > -1 && function(e3, t3, n3) {
  11520. const s2 = N[e3][t3];
  11521. if (!s2)
  11522. return;
  11523. const r2 = s2.indexOf(n3);
  11524. r2 > -1 && s2.splice(r2, 1);
  11525. }(e2, n2, t2[n2]);
  11526. }) : delete N[e2];
  11527. }
  11528. function M(e2, t2) {
  11529. return e2 && 0 !== e2.length ? e2.reduce((e3, n2) => e3.then(() => n2(t2)), Promise.resolve()) : Promise.resolve();
  11530. }
  11531. function q(e2, t2) {
  11532. return N[e2] && N[e2][t2] || [];
  11533. }
  11534. function K(e2) {
  11535. D("callObject", e2);
  11536. }
  11537. const j = U("_globalUniCloudListener"), B = "response", $ = "needLogin", W = "refreshToken", z = "clientdb", J = "cloudfunction", H = "cloudobject";
  11538. function G(e2) {
  11539. return j[e2] || (j[e2] = []), j[e2];
  11540. }
  11541. function V(e2, t2) {
  11542. const n2 = G(e2);
  11543. n2.includes(t2) || n2.push(t2);
  11544. }
  11545. function Y(e2, t2) {
  11546. const n2 = G(e2), s2 = n2.indexOf(t2);
  11547. -1 !== s2 && n2.splice(s2, 1);
  11548. }
  11549. function Q(e2, t2) {
  11550. const n2 = G(e2);
  11551. for (let e3 = 0; e3 < n2.length; e3++) {
  11552. (0, n2[e3])(t2);
  11553. }
  11554. }
  11555. let X, Z = false;
  11556. function ee() {
  11557. return X || (X = new Promise((e2) => {
  11558. Z && e2(), function t2() {
  11559. if ("function" == typeof getCurrentPages) {
  11560. const t3 = getCurrentPages();
  11561. t3 && t3[0] && (Z = true, e2());
  11562. }
  11563. Z || setTimeout(() => {
  11564. t2();
  11565. }, 30);
  11566. }();
  11567. }), X);
  11568. }
  11569. function te(e2) {
  11570. const t2 = {};
  11571. for (const n2 in e2) {
  11572. const s2 = e2[n2];
  11573. y(s2) && (t2[n2] = _(s2));
  11574. }
  11575. return t2;
  11576. }
  11577. class ne extends Error {
  11578. constructor(e2) {
  11579. super(e2.message), this.errMsg = e2.message || e2.errMsg || "unknown system error", this.code = this.errCode = e2.code || e2.errCode || "SYSTEM_ERROR", this.errSubject = this.subject = e2.subject || e2.errSubject, this.cause = e2.cause, this.requestId = e2.requestId;
  11580. }
  11581. toJson(e2 = 0) {
  11582. if (!(e2 >= 10))
  11583. return e2++, { errCode: this.errCode, errMsg: this.errMsg, errSubject: this.errSubject, cause: this.cause && this.cause.toJson ? this.cause.toJson(e2) : this.cause };
  11584. }
  11585. }
  11586. var se = { request: (e2) => index.request(e2), uploadFile: (e2) => index.uploadFile(e2), setStorageSync: (e2, t2) => index.setStorageSync(e2, t2), getStorageSync: (e2) => index.getStorageSync(e2), removeStorageSync: (e2) => index.removeStorageSync(e2), clearStorageSync: () => index.clearStorageSync() };
  11587. function re(e2) {
  11588. return e2 && re(e2.__v_raw) || e2;
  11589. }
  11590. function ie() {
  11591. return { token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"), tokenExpired: se.getStorageSync("uni_id_token_expired") };
  11592. }
  11593. function oe({ token: e2, tokenExpired: t2 } = {}) {
  11594. e2 && se.setStorageSync("uni_id_token", e2), t2 && se.setStorageSync("uni_id_token_expired", t2);
  11595. }
  11596. let ae, ce;
  11597. function ue() {
  11598. return ae || (ae = index.getSystemInfoSync()), ae;
  11599. }
  11600. function he() {
  11601. let e2, t2;
  11602. try {
  11603. if (index.getLaunchOptionsSync) {
  11604. if (index.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1)
  11605. return;
  11606. const { scene: n2, channel: s2 } = index.getLaunchOptionsSync();
  11607. e2 = s2, t2 = n2;
  11608. }
  11609. } catch (e3) {
  11610. }
  11611. return { channel: e2, scene: t2 };
  11612. }
  11613. function le() {
  11614. const e2 = index.getLocale && index.getLocale() || "en";
  11615. if (ce)
  11616. return { ...ce, locale: e2, LOCALE: e2 };
  11617. const t2 = ue(), { deviceId: n2, osName: s2, uniPlatform: r2, appId: i2 } = t2, o2 = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  11618. for (let e3 = 0; e3 < o2.length; e3++) {
  11619. delete t2[o2[e3]];
  11620. }
  11621. return ce = { PLATFORM: r2, OS: s2, APPID: i2, DEVICEID: n2, ...he(), ...t2 }, { ...ce, locale: e2, LOCALE: e2 };
  11622. }
  11623. var de = { sign: function(e2, t2) {
  11624. let n2 = "";
  11625. return Object.keys(e2).sort().forEach(function(t3) {
  11626. e2[t3] && (n2 = n2 + "&" + t3 + "=" + e2[t3]);
  11627. }), n2 = n2.slice(1), o(n2, t2).toString();
  11628. }, wrappedRequest: function(e2, t2) {
  11629. return new Promise((n2, s2) => {
  11630. t2(Object.assign(e2, { complete(e3) {
  11631. e3 || (e3 = {});
  11632. const t3 = e3.data && e3.data.header && e3.data.header["x-serverless-request-id"] || e3.header && e3.header["request-id"];
  11633. if (!e3.statusCode || e3.statusCode >= 400)
  11634. return s2(new ne({ code: "SYS_ERR", message: e3.errMsg || "request:fail", requestId: t3 }));
  11635. const r2 = e3.data;
  11636. if (r2.error)
  11637. return s2(new ne({ code: r2.error.code, message: r2.error.message, requestId: t3 }));
  11638. r2.result = r2.data, r2.requestId = t3, delete r2.data, n2(r2);
  11639. } }));
  11640. });
  11641. }, toBase64: function(e2) {
  11642. return c.stringify(a.parse(e2));
  11643. } }, pe = { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" };
  11644. const { t: fe } = initVueI18n({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: pe, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, ja: pe }, "zh-Hans");
  11645. var ge = class {
  11646. constructor(e2) {
  11647. ["spaceId", "clientSecret"].forEach((t2) => {
  11648. if (!Object.prototype.hasOwnProperty.call(e2, t2))
  11649. throw new Error(fe("uniCloud.init.paramRequired", { param: t2 }));
  11650. }), this.config = Object.assign({}, { endpoint: 0 === e2.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com" }, e2), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = se, this._getAccessTokenPromiseHub = new I({ createPromise: () => this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then((e3) => {
  11651. if (!e3.result || !e3.result.accessToken)
  11652. throw new ne({ code: "AUTH_FAILED", message: "获取accessToken失败" });
  11653. this.setAccessToken(e3.result.accessToken);
  11654. }), retryRule: v });
  11655. }
  11656. get hasAccessToken() {
  11657. return !!this.accessToken;
  11658. }
  11659. setAccessToken(e2) {
  11660. this.accessToken = e2;
  11661. }
  11662. requestWrapped(e2) {
  11663. return de.wrappedRequest(e2, this.adapter.request);
  11664. }
  11665. requestAuth(e2) {
  11666. return this.requestWrapped(e2);
  11667. }
  11668. request(e2, t2) {
  11669. return Promise.resolve().then(() => this.hasAccessToken ? t2 ? this.requestWrapped(e2) : this.requestWrapped(e2).catch((t3) => new Promise((e3, n2) => {
  11670. !t3 || "GATEWAY_INVALID_TOKEN" !== t3.code && "InvalidParameter.InvalidToken" !== t3.code ? n2(t3) : e3();
  11671. }).then(() => this.getAccessToken()).then(() => {
  11672. const t4 = this.rebuildRequest(e2);
  11673. return this.request(t4, true);
  11674. })) : this.getAccessToken().then(() => {
  11675. const t3 = this.rebuildRequest(e2);
  11676. return this.request(t3, true);
  11677. }));
  11678. }
  11679. rebuildRequest(e2) {
  11680. const t2 = Object.assign({}, e2);
  11681. return t2.data.token = this.accessToken, t2.header["x-basement-token"] = this.accessToken, t2.header["x-serverless-sign"] = de.sign(t2.data, this.config.clientSecret), t2;
  11682. }
  11683. setupRequest(e2, t2) {
  11684. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  11685. return "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: s2 };
  11686. }
  11687. getAccessToken() {
  11688. return this._getAccessTokenPromiseHub.exec();
  11689. }
  11690. async authorize() {
  11691. await this.getAccessToken();
  11692. }
  11693. callFunction(e2) {
  11694. const t2 = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e2.name, functionArgs: e2.data || {} }) };
  11695. return this.request(this.setupRequest(t2));
  11696. }
  11697. getOSSUploadOptionsFromPath(e2) {
  11698. const t2 = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e2) };
  11699. return this.request(this.setupRequest(t2));
  11700. }
  11701. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  11702. return new Promise((o2, a2) => {
  11703. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, header: { "X-OSS-server-side-encrpytion": "AES256" }, success(e3) {
  11704. e3 && e3.statusCode < 400 ? o2(e3) : a2(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  11705. }, fail(e3) {
  11706. a2(new ne({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  11707. } });
  11708. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  11709. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  11710. });
  11711. });
  11712. }
  11713. reportOSSUpload(e2) {
  11714. const t2 = { method: "serverless.file.resource.report", params: JSON.stringify(e2) };
  11715. return this.request(this.setupRequest(t2));
  11716. }
  11717. async uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", cloudPathAsRealPath: s2 = false, onUploadProgress: r2, config: i2 }) {
  11718. if ("string" !== g(t2))
  11719. throw new ne({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });
  11720. if (!(t2 = t2.trim()))
  11721. throw new ne({ code: "INVALID_PARAM", message: "cloudPath不可为空" });
  11722. if (/:\/\//.test(t2))
  11723. throw new ne({ code: "INVALID_PARAM", message: "cloudPath不合法" });
  11724. const o2 = i2 && i2.envType || this.config.envType;
  11725. if (s2 && ("/" !== t2[0] && (t2 = "/" + t2), t2.indexOf("\\") > -1))
  11726. throw new ne({ code: "INVALID_PARAM", message: "使用cloudPath作为路径时,cloudPath不可包含“\\”" });
  11727. const a2 = (await this.getOSSUploadOptionsFromPath({ env: o2, filename: s2 ? t2.split("/").pop() : t2, fileId: s2 ? t2 : void 0 })).result, c2 = "https://" + a2.cdnDomain + "/" + a2.ossPath, { securityToken: u2, accessKeyId: h2, signature: l2, host: d2, ossPath: p2, id: f2, policy: m2, ossCallbackUrl: y2 } = a2, _2 = { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: h2, Signature: l2, host: d2, id: f2, key: p2, policy: m2, success_action_status: 200 };
  11728. if (u2 && (_2["x-oss-security-token"] = u2), y2) {
  11729. const e3 = JSON.stringify({ callbackUrl: y2, callbackBody: JSON.stringify({ fileId: f2, spaceId: this.config.spaceId }), callbackBodyType: "application/json" });
  11730. _2.callback = de.toBase64(e3);
  11731. }
  11732. const w2 = { url: "https://" + a2.host, formData: _2, fileName: "file", name: "file", filePath: e2, fileType: n2 };
  11733. if (await this.uploadFileToOSS(Object.assign({}, w2, { onUploadProgress: r2 })), y2)
  11734. return { success: true, filePath: e2, fileID: c2 };
  11735. if ((await this.reportOSSUpload({ id: f2 })).success)
  11736. return { success: true, filePath: e2, fileID: c2 };
  11737. throw new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" });
  11738. }
  11739. getTempFileURL({ fileList: e2 } = {}) {
  11740. return new Promise((t2, n2) => {
  11741. Array.isArray(e2) && 0 !== e2.length || n2(new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t2({ fileList: e2.map((e3) => ({ fileID: e3, tempFileURL: e3 })) });
  11742. });
  11743. }
  11744. async getFileInfo({ fileList: e2 } = {}) {
  11745. if (!Array.isArray(e2) || 0 === e2.length)
  11746. throw new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  11747. const t2 = { method: "serverless.file.resource.info", params: JSON.stringify({ id: e2.map((e3) => e3.split("?")[0]).join(",") }) };
  11748. return { fileList: (await this.request(this.setupRequest(t2))).result };
  11749. }
  11750. };
  11751. var me = { init(e2) {
  11752. const t2 = new ge(e2), n2 = { signInAnonymously: function() {
  11753. return t2.authorize();
  11754. }, getLoginState: function() {
  11755. return Promise.resolve(false);
  11756. } };
  11757. return t2.auth = function() {
  11758. return n2;
  11759. }, t2.customAuth = t2.auth, t2;
  11760. } };
  11761. const ye = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  11762. var _e;
  11763. !function(e2) {
  11764. e2.local = "local", e2.none = "none", e2.session = "session";
  11765. }(_e || (_e = {}));
  11766. var we = function() {
  11767. };
  11768. const ve = () => {
  11769. let e2;
  11770. if (!Promise) {
  11771. e2 = () => {
  11772. }, e2.promise = {};
  11773. const t3 = () => {
  11774. throw new ne({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });
  11775. };
  11776. return Object.defineProperty(e2.promise, "then", { get: t3 }), Object.defineProperty(e2.promise, "catch", { get: t3 }), e2;
  11777. }
  11778. const t2 = new Promise((t3, n2) => {
  11779. e2 = (e3, s2) => e3 ? n2(e3) : t3(s2);
  11780. });
  11781. return e2.promise = t2, e2;
  11782. };
  11783. function Ie(e2) {
  11784. return void 0 === e2;
  11785. }
  11786. function Se(e2) {
  11787. return "[object Null]" === Object.prototype.toString.call(e2);
  11788. }
  11789. var be;
  11790. function ke(e2) {
  11791. const t2 = (n2 = e2, "[object Array]" === Object.prototype.toString.call(n2) ? e2 : [e2]);
  11792. var n2;
  11793. for (const e3 of t2) {
  11794. const { isMatch: t3, genAdapter: n3, runtime: s2 } = e3;
  11795. if (t3())
  11796. return { adapter: n3(), runtime: s2 };
  11797. }
  11798. }
  11799. !function(e2) {
  11800. e2.WEB = "web", e2.WX_MP = "wx_mp";
  11801. }(be || (be = {}));
  11802. const Ce = { adapter: null, runtime: void 0 }, Te = ["anonymousUuidKey"];
  11803. class Pe extends we {
  11804. constructor() {
  11805. super(), Ce.adapter.root.tcbObject || (Ce.adapter.root.tcbObject = {});
  11806. }
  11807. setItem(e2, t2) {
  11808. Ce.adapter.root.tcbObject[e2] = t2;
  11809. }
  11810. getItem(e2) {
  11811. return Ce.adapter.root.tcbObject[e2];
  11812. }
  11813. removeItem(e2) {
  11814. delete Ce.adapter.root.tcbObject[e2];
  11815. }
  11816. clear() {
  11817. delete Ce.adapter.root.tcbObject;
  11818. }
  11819. }
  11820. function Ae(e2, t2) {
  11821. switch (e2) {
  11822. case "local":
  11823. return t2.localStorage || new Pe();
  11824. case "none":
  11825. return new Pe();
  11826. default:
  11827. return t2.sessionStorage || new Pe();
  11828. }
  11829. }
  11830. class Ee {
  11831. constructor(e2) {
  11832. if (!this._storage) {
  11833. this._persistence = Ce.adapter.primaryStorage || e2.persistence, this._storage = Ae(this._persistence, Ce.adapter);
  11834. const t2 = `access_token_${e2.env}`, n2 = `access_token_expire_${e2.env}`, s2 = `refresh_token_${e2.env}`, r2 = `anonymous_uuid_${e2.env}`, i2 = `login_type_${e2.env}`, o2 = `user_info_${e2.env}`;
  11835. this.keys = { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2, anonymousUuidKey: r2, loginTypeKey: i2, userInfoKey: o2 };
  11836. }
  11837. }
  11838. updatePersistence(e2) {
  11839. if (e2 === this._persistence)
  11840. return;
  11841. const t2 = "local" === this._persistence;
  11842. this._persistence = e2;
  11843. const n2 = Ae(e2, Ce.adapter);
  11844. for (const e3 in this.keys) {
  11845. const s2 = this.keys[e3];
  11846. if (t2 && Te.includes(e3))
  11847. continue;
  11848. const r2 = this._storage.getItem(s2);
  11849. Ie(r2) || Se(r2) || (n2.setItem(s2, r2), this._storage.removeItem(s2));
  11850. }
  11851. this._storage = n2;
  11852. }
  11853. setStore(e2, t2, n2) {
  11854. if (!this._storage)
  11855. return;
  11856. const s2 = { version: n2 || "localCachev1", content: t2 }, r2 = JSON.stringify(s2);
  11857. try {
  11858. this._storage.setItem(e2, r2);
  11859. } catch (e3) {
  11860. throw e3;
  11861. }
  11862. }
  11863. getStore(e2, t2) {
  11864. try {
  11865. if (!this._storage)
  11866. return;
  11867. } catch (e3) {
  11868. return "";
  11869. }
  11870. t2 = t2 || "localCachev1";
  11871. const n2 = this._storage.getItem(e2);
  11872. if (!n2)
  11873. return "";
  11874. if (n2.indexOf(t2) >= 0) {
  11875. return JSON.parse(n2).content;
  11876. }
  11877. return "";
  11878. }
  11879. removeStore(e2) {
  11880. this._storage.removeItem(e2);
  11881. }
  11882. }
  11883. const Oe = {}, xe = {};
  11884. function Re(e2) {
  11885. return Oe[e2];
  11886. }
  11887. class Ue {
  11888. constructor(e2, t2) {
  11889. this.data = t2 || null, this.name = e2;
  11890. }
  11891. }
  11892. class Le extends Ue {
  11893. constructor(e2, t2) {
  11894. super("error", { error: e2, data: t2 }), this.error = e2;
  11895. }
  11896. }
  11897. const Ne = new class {
  11898. constructor() {
  11899. this._listeners = {};
  11900. }
  11901. on(e2, t2) {
  11902. return function(e3, t3, n2) {
  11903. n2[e3] = n2[e3] || [], n2[e3].push(t3);
  11904. }(e2, t2, this._listeners), this;
  11905. }
  11906. off(e2, t2) {
  11907. return function(e3, t3, n2) {
  11908. if (n2 && n2[e3]) {
  11909. const s2 = n2[e3].indexOf(t3);
  11910. -1 !== s2 && n2[e3].splice(s2, 1);
  11911. }
  11912. }(e2, t2, this._listeners), this;
  11913. }
  11914. fire(e2, t2) {
  11915. if (e2 instanceof Le)
  11916. return console.error(e2.error), this;
  11917. const n2 = "string" == typeof e2 ? new Ue(e2, t2 || {}) : e2;
  11918. const s2 = n2.name;
  11919. if (this._listens(s2)) {
  11920. n2.target = this;
  11921. const e3 = this._listeners[s2] ? [...this._listeners[s2]] : [];
  11922. for (const t3 of e3)
  11923. t3.call(this, n2);
  11924. }
  11925. return this;
  11926. }
  11927. _listens(e2) {
  11928. return this._listeners[e2] && this._listeners[e2].length > 0;
  11929. }
  11930. }();
  11931. function De(e2, t2) {
  11932. Ne.on(e2, t2);
  11933. }
  11934. function Fe(e2, t2 = {}) {
  11935. Ne.fire(e2, t2);
  11936. }
  11937. function Me(e2, t2) {
  11938. Ne.off(e2, t2);
  11939. }
  11940. const qe = "loginStateChanged", Ke = "loginStateExpire", je = "loginTypeChanged", Be = "anonymousConverted", $e = "refreshAccessToken";
  11941. var We;
  11942. !function(e2) {
  11943. e2.ANONYMOUS = "ANONYMOUS", e2.WECHAT = "WECHAT", e2.WECHAT_PUBLIC = "WECHAT-PUBLIC", e2.WECHAT_OPEN = "WECHAT-OPEN", e2.CUSTOM = "CUSTOM", e2.EMAIL = "EMAIL", e2.USERNAME = "USERNAME", e2.NULL = "NULL";
  11944. }(We || (We = {}));
  11945. const ze = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"], Je = { "X-SDK-Version": "1.3.5" };
  11946. function He(e2, t2, n2) {
  11947. const s2 = e2[t2];
  11948. e2[t2] = function(t3) {
  11949. const r2 = {}, i2 = {};
  11950. n2.forEach((n3) => {
  11951. const { data: s3, headers: o3 } = n3.call(e2, t3);
  11952. Object.assign(r2, s3), Object.assign(i2, o3);
  11953. });
  11954. const o2 = t3.data;
  11955. return o2 && (() => {
  11956. var e3;
  11957. if (e3 = o2, "[object FormData]" !== Object.prototype.toString.call(e3))
  11958. t3.data = { ...o2, ...r2 };
  11959. else
  11960. for (const e4 in r2)
  11961. o2.append(e4, r2[e4]);
  11962. })(), t3.headers = { ...t3.headers || {}, ...i2 }, s2.call(e2, t3);
  11963. };
  11964. }
  11965. function Ge() {
  11966. const e2 = Math.random().toString(16).slice(2);
  11967. return { data: { seqId: e2 }, headers: { ...Je, "x-seqid": e2 } };
  11968. }
  11969. class Ve {
  11970. constructor(e2 = {}) {
  11971. var t2;
  11972. this.config = e2, this._reqClass = new Ce.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: `请求在${this.config.timeout / 1e3}s内未完成,已中断`, restrictedMethods: ["post"] }), this._cache = Re(this.config.env), this._localCache = (t2 = this.config.env, xe[t2]), He(this._reqClass, "post", [Ge]), He(this._reqClass, "upload", [Ge]), He(this._reqClass, "download", [Ge]);
  11973. }
  11974. async post(e2) {
  11975. return await this._reqClass.post(e2);
  11976. }
  11977. async upload(e2) {
  11978. return await this._reqClass.upload(e2);
  11979. }
  11980. async download(e2) {
  11981. return await this._reqClass.download(e2);
  11982. }
  11983. async refreshAccessToken() {
  11984. let e2, t2;
  11985. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  11986. try {
  11987. e2 = await this._refreshAccessTokenPromise;
  11988. } catch (e3) {
  11989. t2 = e3;
  11990. }
  11991. if (this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t2)
  11992. throw t2;
  11993. return e2;
  11994. }
  11995. async _refreshAccessToken() {
  11996. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2, loginTypeKey: s2, anonymousUuidKey: r2 } = this._cache.keys;
  11997. this._cache.removeStore(e2), this._cache.removeStore(t2);
  11998. let i2 = this._cache.getStore(n2);
  11999. if (!i2)
  12000. throw new ne({ message: "未登录CloudBase" });
  12001. const o2 = { refresh_token: i2 }, a2 = await this.request("auth.fetchAccessTokenWithRefreshToken", o2);
  12002. if (a2.data.code) {
  12003. const { code: e3 } = a2.data;
  12004. if ("SIGN_PARAM_INVALID" === e3 || "REFRESH_TOKEN_EXPIRED" === e3 || "INVALID_REFRESH_TOKEN" === e3) {
  12005. if (this._cache.getStore(s2) === We.ANONYMOUS && "INVALID_REFRESH_TOKEN" === e3) {
  12006. const e4 = this._cache.getStore(r2), t3 = this._cache.getStore(n2), s3 = await this.send("auth.signInAnonymously", { anonymous_uuid: e4, refresh_token: t3 });
  12007. return this.setRefreshToken(s3.refresh_token), this._refreshAccessToken();
  12008. }
  12009. Fe(Ke), this._cache.removeStore(n2);
  12010. }
  12011. throw new ne({ code: a2.data.code, message: `刷新access token失败:${a2.data.code}` });
  12012. }
  12013. if (a2.data.access_token)
  12014. return Fe($e), this._cache.setStore(e2, a2.data.access_token), this._cache.setStore(t2, a2.data.access_token_expire + Date.now()), { accessToken: a2.data.access_token, accessTokenExpire: a2.data.access_token_expire };
  12015. a2.data.refresh_token && (this._cache.removeStore(n2), this._cache.setStore(n2, a2.data.refresh_token), this._refreshAccessToken());
  12016. }
  12017. async getAccessToken() {
  12018. const { accessTokenKey: e2, accessTokenExpireKey: t2, refreshTokenKey: n2 } = this._cache.keys;
  12019. if (!this._cache.getStore(n2))
  12020. throw new ne({ message: "refresh token不存在,登录状态异常" });
  12021. let s2 = this._cache.getStore(e2), r2 = this._cache.getStore(t2), i2 = true;
  12022. return this._shouldRefreshAccessTokenHook && !await this._shouldRefreshAccessTokenHook(s2, r2) && (i2 = false), (!s2 || !r2 || r2 < Date.now()) && i2 ? this.refreshAccessToken() : { accessToken: s2, accessTokenExpire: r2 };
  12023. }
  12024. async request(e2, t2, n2) {
  12025. const s2 = `x-tcb-trace_${this.config.env}`;
  12026. let r2 = "application/x-www-form-urlencoded";
  12027. const i2 = { action: e2, env: this.config.env, dataVersion: "2019-08-16", ...t2 };
  12028. if (-1 === ze.indexOf(e2)) {
  12029. const { refreshTokenKey: e3 } = this._cache.keys;
  12030. this._cache.getStore(e3) && (i2.access_token = (await this.getAccessToken()).accessToken);
  12031. }
  12032. let o2;
  12033. if ("storage.uploadFile" === e2) {
  12034. o2 = new FormData();
  12035. for (let e3 in o2)
  12036. o2.hasOwnProperty(e3) && void 0 !== o2[e3] && o2.append(e3, i2[e3]);
  12037. r2 = "multipart/form-data";
  12038. } else {
  12039. r2 = "application/json", o2 = {};
  12040. for (let e3 in i2)
  12041. void 0 !== i2[e3] && (o2[e3] = i2[e3]);
  12042. }
  12043. let a2 = { headers: { "content-type": r2 } };
  12044. n2 && n2.onUploadProgress && (a2.onUploadProgress = n2.onUploadProgress);
  12045. const c2 = this._localCache.getStore(s2);
  12046. c2 && (a2.headers["X-TCB-Trace"] = c2);
  12047. const { parse: u2, inQuery: h2, search: l2 } = t2;
  12048. let d2 = { env: this.config.env };
  12049. u2 && (d2.parse = true), h2 && (d2 = { ...h2, ...d2 });
  12050. let p2 = function(e3, t3, n3 = {}) {
  12051. const s3 = /\?/.test(t3);
  12052. let r3 = "";
  12053. for (let e4 in n3)
  12054. "" === r3 ? !s3 && (t3 += "?") : r3 += "&", r3 += `${e4}=${encodeURIComponent(n3[e4])}`;
  12055. return /^http(s)?\:\/\//.test(t3 += r3) ? t3 : `${e3}${t3}`;
  12056. }(ye, "//tcb-api.tencentcloudapi.com/web", d2);
  12057. l2 && (p2 += l2);
  12058. const f2 = await this.post({ url: p2, data: o2, ...a2 }), g2 = f2.header && f2.header["x-tcb-trace"];
  12059. if (g2 && this._localCache.setStore(s2, g2), 200 !== Number(f2.status) && 200 !== Number(f2.statusCode) || !f2.data)
  12060. throw new ne({ code: "NETWORK_ERROR", message: "network request error" });
  12061. return f2;
  12062. }
  12063. async send(e2, t2 = {}) {
  12064. const n2 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  12065. if ("ACCESS_TOKEN_EXPIRED" === n2.data.code && -1 === ze.indexOf(e2)) {
  12066. await this.refreshAccessToken();
  12067. const n3 = await this.request(e2, t2, { onUploadProgress: t2.onUploadProgress });
  12068. if (n3.data.code)
  12069. throw new ne({ code: n3.data.code, message: n3.data.message });
  12070. return n3.data;
  12071. }
  12072. if (n2.data.code)
  12073. throw new ne({ code: n2.data.code, message: n2.data.message });
  12074. return n2.data;
  12075. }
  12076. setRefreshToken(e2) {
  12077. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  12078. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  12079. }
  12080. }
  12081. const Ye = {};
  12082. function Qe(e2) {
  12083. return Ye[e2];
  12084. }
  12085. class Xe {
  12086. constructor(e2) {
  12087. this.config = e2, this._cache = Re(e2.env), this._request = Qe(e2.env);
  12088. }
  12089. setRefreshToken(e2) {
  12090. const { accessTokenKey: t2, accessTokenExpireKey: n2, refreshTokenKey: s2 } = this._cache.keys;
  12091. this._cache.removeStore(t2), this._cache.removeStore(n2), this._cache.setStore(s2, e2);
  12092. }
  12093. setAccessToken(e2, t2) {
  12094. const { accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys;
  12095. this._cache.setStore(n2, e2), this._cache.setStore(s2, t2);
  12096. }
  12097. async refreshUserInfo() {
  12098. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  12099. return this.setLocalUserInfo(e2), e2;
  12100. }
  12101. setLocalUserInfo(e2) {
  12102. const { userInfoKey: t2 } = this._cache.keys;
  12103. this._cache.setStore(t2, e2);
  12104. }
  12105. }
  12106. class Ze {
  12107. constructor(e2) {
  12108. if (!e2)
  12109. throw new ne({ code: "PARAM_ERROR", message: "envId is not defined" });
  12110. this._envId = e2, this._cache = Re(this._envId), this._request = Qe(this._envId), this.setUserInfo();
  12111. }
  12112. linkWithTicket(e2) {
  12113. if ("string" != typeof e2)
  12114. throw new ne({ code: "PARAM_ERROR", message: "ticket must be string" });
  12115. return this._request.send("auth.linkWithTicket", { ticket: e2 });
  12116. }
  12117. linkWithRedirect(e2) {
  12118. e2.signInWithRedirect();
  12119. }
  12120. updatePassword(e2, t2) {
  12121. return this._request.send("auth.updatePassword", { oldPassword: t2, newPassword: e2 });
  12122. }
  12123. updateEmail(e2) {
  12124. return this._request.send("auth.updateEmail", { newEmail: e2 });
  12125. }
  12126. updateUsername(e2) {
  12127. if ("string" != typeof e2)
  12128. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  12129. return this._request.send("auth.updateUsername", { username: e2 });
  12130. }
  12131. async getLinkedUidList() {
  12132. const { data: e2 } = await this._request.send("auth.getLinkedUidList", {});
  12133. let t2 = false;
  12134. const { users: n2 } = e2;
  12135. return n2.forEach((e3) => {
  12136. e3.wxOpenId && e3.wxPublicId && (t2 = true);
  12137. }), { users: n2, hasPrimaryUid: t2 };
  12138. }
  12139. setPrimaryUid(e2) {
  12140. return this._request.send("auth.setPrimaryUid", { uid: e2 });
  12141. }
  12142. unlink(e2) {
  12143. return this._request.send("auth.unlink", { platform: e2 });
  12144. }
  12145. async update(e2) {
  12146. const { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 } = e2, { data: a2 } = await this._request.send("auth.updateUserInfo", { nickName: t2, gender: n2, avatarUrl: s2, province: r2, country: i2, city: o2 });
  12147. this.setLocalUserInfo(a2);
  12148. }
  12149. async refresh() {
  12150. const { data: e2 } = await this._request.send("auth.getUserInfo", {});
  12151. return this.setLocalUserInfo(e2), e2;
  12152. }
  12153. setUserInfo() {
  12154. const { userInfoKey: e2 } = this._cache.keys, t2 = this._cache.getStore(e2);
  12155. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach((e3) => {
  12156. this[e3] = t2[e3];
  12157. }), this.location = { country: t2.country, province: t2.province, city: t2.city };
  12158. }
  12159. setLocalUserInfo(e2) {
  12160. const { userInfoKey: t2 } = this._cache.keys;
  12161. this._cache.setStore(t2, e2), this.setUserInfo();
  12162. }
  12163. }
  12164. class et {
  12165. constructor(e2) {
  12166. if (!e2)
  12167. throw new ne({ code: "PARAM_ERROR", message: "envId is not defined" });
  12168. this._cache = Re(e2);
  12169. const { refreshTokenKey: t2, accessTokenKey: n2, accessTokenExpireKey: s2 } = this._cache.keys, r2 = this._cache.getStore(t2), i2 = this._cache.getStore(n2), o2 = this._cache.getStore(s2);
  12170. this.credential = { refreshToken: r2, accessToken: i2, accessTokenExpire: o2 }, this.user = new Ze(e2);
  12171. }
  12172. get isAnonymousAuth() {
  12173. return this.loginType === We.ANONYMOUS;
  12174. }
  12175. get isCustomAuth() {
  12176. return this.loginType === We.CUSTOM;
  12177. }
  12178. get isWeixinAuth() {
  12179. return this.loginType === We.WECHAT || this.loginType === We.WECHAT_OPEN || this.loginType === We.WECHAT_PUBLIC;
  12180. }
  12181. get loginType() {
  12182. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12183. }
  12184. }
  12185. class tt extends Xe {
  12186. async signIn() {
  12187. this._cache.updatePersistence("local");
  12188. const { anonymousUuidKey: e2, refreshTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2) || void 0, s2 = this._cache.getStore(t2) || void 0, r2 = await this._request.send("auth.signInAnonymously", { anonymous_uuid: n2, refresh_token: s2 });
  12189. if (r2.uuid && r2.refresh_token) {
  12190. this._setAnonymousUUID(r2.uuid), this.setRefreshToken(r2.refresh_token), await this._request.refreshAccessToken(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.ANONYMOUS, persistence: "local" });
  12191. const e3 = new et(this.config.env);
  12192. return await e3.user.refresh(), e3;
  12193. }
  12194. throw new ne({ message: "匿名登录失败" });
  12195. }
  12196. async linkAndRetrieveDataWithTicket(e2) {
  12197. const { anonymousUuidKey: t2, refreshTokenKey: n2 } = this._cache.keys, s2 = this._cache.getStore(t2), r2 = this._cache.getStore(n2), i2 = await this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s2, refresh_token: r2, ticket: e2 });
  12198. if (i2.refresh_token)
  12199. return this._clearAnonymousUUID(), this.setRefreshToken(i2.refresh_token), await this._request.refreshAccessToken(), Fe(Be, { env: this.config.env }), Fe(je, { loginType: We.CUSTOM, persistence: "local" }), { credential: { refreshToken: i2.refresh_token } };
  12200. throw new ne({ message: "匿名转化失败" });
  12201. }
  12202. _setAnonymousUUID(e2) {
  12203. const { anonymousUuidKey: t2, loginTypeKey: n2 } = this._cache.keys;
  12204. this._cache.removeStore(t2), this._cache.setStore(t2, e2), this._cache.setStore(n2, We.ANONYMOUS);
  12205. }
  12206. _clearAnonymousUUID() {
  12207. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  12208. }
  12209. }
  12210. class nt extends Xe {
  12211. async signIn(e2) {
  12212. if ("string" != typeof e2)
  12213. throw new ne({ code: "PARAM_ERROR", message: "ticket must be a string" });
  12214. const { refreshTokenKey: t2 } = this._cache.keys, n2 = await this._request.send("auth.signInWithTicket", { ticket: e2, refresh_token: this._cache.getStore(t2) || "" });
  12215. if (n2.refresh_token)
  12216. return this.setRefreshToken(n2.refresh_token), await this._request.refreshAccessToken(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.CUSTOM, persistence: this.config.persistence }), await this.refreshUserInfo(), new et(this.config.env);
  12217. throw new ne({ message: "自定义登录失败" });
  12218. }
  12219. }
  12220. class st extends Xe {
  12221. async signIn(e2, t2) {
  12222. if ("string" != typeof e2)
  12223. throw new ne({ code: "PARAM_ERROR", message: "email must be a string" });
  12224. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: "EMAIL", email: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token: i2, access_token_expire: o2 } = s2;
  12225. if (r2)
  12226. return this.setRefreshToken(r2), i2 && o2 ? this.setAccessToken(i2, o2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.EMAIL, persistence: this.config.persistence }), new et(this.config.env);
  12227. throw s2.code ? new ne({ code: s2.code, message: `邮箱登录失败: ${s2.message}` }) : new ne({ message: "邮箱登录失败" });
  12228. }
  12229. async activate(e2) {
  12230. return this._request.send("auth.activateEndUserMail", { token: e2 });
  12231. }
  12232. async resetPasswordWithToken(e2, t2) {
  12233. return this._request.send("auth.resetPasswordWithToken", { token: e2, newPassword: t2 });
  12234. }
  12235. }
  12236. class rt extends Xe {
  12237. async signIn(e2, t2) {
  12238. if ("string" != typeof e2)
  12239. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  12240. "string" != typeof t2 && (t2 = "", console.warn("password is empty"));
  12241. const { refreshTokenKey: n2 } = this._cache.keys, s2 = await this._request.send("auth.signIn", { loginType: We.USERNAME, username: e2, password: t2, refresh_token: this._cache.getStore(n2) || "" }), { refresh_token: r2, access_token_expire: i2, access_token: o2 } = s2;
  12242. if (r2)
  12243. return this.setRefreshToken(r2), o2 && i2 ? this.setAccessToken(o2, i2) : await this._request.refreshAccessToken(), await this.refreshUserInfo(), Fe(qe), Fe(je, { env: this.config.env, loginType: We.USERNAME, persistence: this.config.persistence }), new et(this.config.env);
  12244. throw s2.code ? new ne({ code: s2.code, message: `用户名密码登录失败: ${s2.message}` }) : new ne({ message: "用户名密码登录失败" });
  12245. }
  12246. }
  12247. class it {
  12248. constructor(e2) {
  12249. this.config = e2, this._cache = Re(e2.env), this._request = Qe(e2.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), De(je, this._onLoginTypeChanged);
  12250. }
  12251. get currentUser() {
  12252. const e2 = this.hasLoginState();
  12253. return e2 && e2.user || null;
  12254. }
  12255. get loginType() {
  12256. return this._cache.getStore(this._cache.keys.loginTypeKey);
  12257. }
  12258. anonymousAuthProvider() {
  12259. return new tt(this.config);
  12260. }
  12261. customAuthProvider() {
  12262. return new nt(this.config);
  12263. }
  12264. emailAuthProvider() {
  12265. return new st(this.config);
  12266. }
  12267. usernameAuthProvider() {
  12268. return new rt(this.config);
  12269. }
  12270. async signInAnonymously() {
  12271. return new tt(this.config).signIn();
  12272. }
  12273. async signInWithEmailAndPassword(e2, t2) {
  12274. return new st(this.config).signIn(e2, t2);
  12275. }
  12276. signInWithUsernameAndPassword(e2, t2) {
  12277. return new rt(this.config).signIn(e2, t2);
  12278. }
  12279. async linkAndRetrieveDataWithTicket(e2) {
  12280. this._anonymousAuthProvider || (this._anonymousAuthProvider = new tt(this.config)), De(Be, this._onAnonymousConverted);
  12281. return await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e2);
  12282. }
  12283. async signOut() {
  12284. if (this.loginType === We.ANONYMOUS)
  12285. throw new ne({ message: "匿名用户不支持登出操作" });
  12286. const { refreshTokenKey: e2, accessTokenKey: t2, accessTokenExpireKey: n2 } = this._cache.keys, s2 = this._cache.getStore(e2);
  12287. if (!s2)
  12288. return;
  12289. const r2 = await this._request.send("auth.logout", { refresh_token: s2 });
  12290. return this._cache.removeStore(e2), this._cache.removeStore(t2), this._cache.removeStore(n2), Fe(qe), Fe(je, { env: this.config.env, loginType: We.NULL, persistence: this.config.persistence }), r2;
  12291. }
  12292. async signUpWithEmailAndPassword(e2, t2) {
  12293. return this._request.send("auth.signUpWithEmailAndPassword", { email: e2, password: t2 });
  12294. }
  12295. async sendPasswordResetEmail(e2) {
  12296. return this._request.send("auth.sendPasswordResetEmail", { email: e2 });
  12297. }
  12298. onLoginStateChanged(e2) {
  12299. De(qe, () => {
  12300. const t3 = this.hasLoginState();
  12301. e2.call(this, t3);
  12302. });
  12303. const t2 = this.hasLoginState();
  12304. e2.call(this, t2);
  12305. }
  12306. onLoginStateExpired(e2) {
  12307. De(Ke, e2.bind(this));
  12308. }
  12309. onAccessTokenRefreshed(e2) {
  12310. De($e, e2.bind(this));
  12311. }
  12312. onAnonymousConverted(e2) {
  12313. De(Be, e2.bind(this));
  12314. }
  12315. onLoginTypeChanged(e2) {
  12316. De(je, () => {
  12317. const t2 = this.hasLoginState();
  12318. e2.call(this, t2);
  12319. });
  12320. }
  12321. async getAccessToken() {
  12322. return { accessToken: (await this._request.getAccessToken()).accessToken, env: this.config.env };
  12323. }
  12324. hasLoginState() {
  12325. const { refreshTokenKey: e2 } = this._cache.keys;
  12326. return this._cache.getStore(e2) ? new et(this.config.env) : null;
  12327. }
  12328. async isUsernameRegistered(e2) {
  12329. if ("string" != typeof e2)
  12330. throw new ne({ code: "PARAM_ERROR", message: "username must be a string" });
  12331. const { data: t2 } = await this._request.send("auth.isUsernameRegistered", { username: e2 });
  12332. return t2 && t2.isRegistered;
  12333. }
  12334. getLoginState() {
  12335. return Promise.resolve(this.hasLoginState());
  12336. }
  12337. async signInWithTicket(e2) {
  12338. return new nt(this.config).signIn(e2);
  12339. }
  12340. shouldRefreshAccessToken(e2) {
  12341. this._request._shouldRefreshAccessTokenHook = e2.bind(this);
  12342. }
  12343. getUserInfo() {
  12344. return this._request.send("auth.getUserInfo", {}).then((e2) => e2.code ? e2 : { ...e2.data, requestId: e2.seqId });
  12345. }
  12346. getAuthHeader() {
  12347. const { refreshTokenKey: e2, accessTokenKey: t2 } = this._cache.keys, n2 = this._cache.getStore(e2);
  12348. return { "x-cloudbase-credentials": this._cache.getStore(t2) + "/@@/" + n2 };
  12349. }
  12350. _onAnonymousConverted(e2) {
  12351. const { env: t2 } = e2.data;
  12352. t2 === this.config.env && this._cache.updatePersistence(this.config.persistence);
  12353. }
  12354. _onLoginTypeChanged(e2) {
  12355. const { loginType: t2, persistence: n2, env: s2 } = e2.data;
  12356. s2 === this.config.env && (this._cache.updatePersistence(n2), this._cache.setStore(this._cache.keys.loginTypeKey, t2));
  12357. }
  12358. }
  12359. const ot = function(e2, t2) {
  12360. t2 = t2 || ve();
  12361. const n2 = Qe(this.config.env), { cloudPath: s2, filePath: r2, onUploadProgress: i2, fileType: o2 = "image" } = e2;
  12362. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  12363. const { data: { url: a2, authorization: c2, token: u2, fileId: h2, cosFileId: l2 }, requestId: d2 } = e3, p2 = { key: s2, signature: c2, "x-cos-meta-fileid": l2, success_action_status: "201", "x-cos-security-token": u2 };
  12364. n2.upload({ url: a2, data: p2, file: r2, name: s2, fileType: o2, onUploadProgress: i2 }).then((e4) => {
  12365. 201 === e4.statusCode ? t2(null, { fileID: h2, requestId: d2 }) : t2(new ne({ code: "STORAGE_REQUEST_FAIL", message: `STORAGE_REQUEST_FAIL: ${e4.data}` }));
  12366. }).catch((e4) => {
  12367. t2(e4);
  12368. });
  12369. }).catch((e3) => {
  12370. t2(e3);
  12371. }), t2.promise;
  12372. }, at = function(e2, t2) {
  12373. t2 = t2 || ve();
  12374. const n2 = Qe(this.config.env), { cloudPath: s2 } = e2;
  12375. return n2.send("storage.getUploadMetadata", { path: s2 }).then((e3) => {
  12376. t2(null, e3);
  12377. }).catch((e3) => {
  12378. t2(e3);
  12379. }), t2.promise;
  12380. }, ct = function({ fileList: e2 }, t2) {
  12381. if (t2 = t2 || ve(), !e2 || !Array.isArray(e2))
  12382. return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };
  12383. for (let t3 of e2)
  12384. if (!t3 || "string" != typeof t3)
  12385. return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };
  12386. const n2 = { fileid_list: e2 };
  12387. return Qe(this.config.env).send("storage.batchDeleteFile", n2).then((e3) => {
  12388. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.delete_list, requestId: e3.requestId });
  12389. }).catch((e3) => {
  12390. t2(e3);
  12391. }), t2.promise;
  12392. }, ut = function({ fileList: e2 }, t2) {
  12393. t2 = t2 || ve(), e2 && Array.isArray(e2) || t2(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });
  12394. let n2 = [];
  12395. for (let s3 of e2)
  12396. "object" == typeof s3 ? (s3.hasOwnProperty("fileID") && s3.hasOwnProperty("maxAge") || t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n2.push({ fileid: s3.fileID, max_age: s3.maxAge })) : "string" == typeof s3 ? n2.push({ fileid: s3 }) : t2(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });
  12397. const s2 = { file_list: n2 };
  12398. return Qe(this.config.env).send("storage.batchGetDownloadUrl", s2).then((e3) => {
  12399. e3.code ? t2(null, e3) : t2(null, { fileList: e3.data.download_list, requestId: e3.requestId });
  12400. }).catch((e3) => {
  12401. t2(e3);
  12402. }), t2.promise;
  12403. }, ht = async function({ fileID: e2 }, t2) {
  12404. const n2 = (await ut.call(this, { fileList: [{ fileID: e2, maxAge: 600 }] })).fileList[0];
  12405. if ("SUCCESS" !== n2.code)
  12406. return t2 ? t2(n2) : new Promise((e3) => {
  12407. e3(n2);
  12408. });
  12409. const s2 = Qe(this.config.env);
  12410. let r2 = n2.download_url;
  12411. if (r2 = encodeURI(r2), !t2)
  12412. return s2.download({ url: r2 });
  12413. t2(await s2.download({ url: r2 }));
  12414. }, lt = function({ name: e2, data: t2, query: n2, parse: s2, search: r2 }, i2) {
  12415. const o2 = i2 || ve();
  12416. let a2;
  12417. try {
  12418. a2 = t2 ? JSON.stringify(t2) : "";
  12419. } catch (e3) {
  12420. return Promise.reject(e3);
  12421. }
  12422. if (!e2)
  12423. return Promise.reject(new ne({ code: "PARAM_ERROR", message: "函数名不能为空" }));
  12424. const c2 = { inQuery: n2, parse: s2, search: r2, function_name: e2, request_data: a2 };
  12425. return Qe(this.config.env).send("functions.invokeFunction", c2).then((e3) => {
  12426. if (e3.code)
  12427. o2(null, e3);
  12428. else {
  12429. let t3 = e3.data.response_data;
  12430. if (s2)
  12431. o2(null, { result: t3, requestId: e3.requestId });
  12432. else
  12433. try {
  12434. t3 = JSON.parse(e3.data.response_data), o2(null, { result: t3, requestId: e3.requestId });
  12435. } catch (e4) {
  12436. o2(new ne({ message: "response data must be json" }));
  12437. }
  12438. }
  12439. return o2.promise;
  12440. }).catch((e3) => {
  12441. o2(e3);
  12442. }), o2.promise;
  12443. }, dt = { timeout: 15e3, persistence: "session" }, pt = {};
  12444. class ft {
  12445. constructor(e2) {
  12446. this.config = e2 || this.config, this.authObj = void 0;
  12447. }
  12448. init(e2) {
  12449. switch (Ce.adapter || (this.requestClient = new Ce.adapter.reqClass({ timeout: e2.timeout || 5e3, timeoutMsg: `请求在${(e2.timeout || 5e3) / 1e3}s内未完成,已中断` })), this.config = { ...dt, ...e2 }, true) {
  12450. case this.config.timeout > 6e5:
  12451. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  12452. break;
  12453. case this.config.timeout < 100:
  12454. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  12455. }
  12456. return new ft(this.config);
  12457. }
  12458. auth({ persistence: e2 } = {}) {
  12459. if (this.authObj)
  12460. return this.authObj;
  12461. const t2 = e2 || Ce.adapter.primaryStorage || dt.persistence;
  12462. var n2;
  12463. return t2 !== this.config.persistence && (this.config.persistence = t2), function(e3) {
  12464. const { env: t3 } = e3;
  12465. Oe[t3] = new Ee(e3), xe[t3] = new Ee({ ...e3, persistence: "local" });
  12466. }(this.config), n2 = this.config, Ye[n2.env] = new Ve(n2), this.authObj = new it(this.config), this.authObj;
  12467. }
  12468. on(e2, t2) {
  12469. return De.apply(this, [e2, t2]);
  12470. }
  12471. off(e2, t2) {
  12472. return Me.apply(this, [e2, t2]);
  12473. }
  12474. callFunction(e2, t2) {
  12475. return lt.apply(this, [e2, t2]);
  12476. }
  12477. deleteFile(e2, t2) {
  12478. return ct.apply(this, [e2, t2]);
  12479. }
  12480. getTempFileURL(e2, t2) {
  12481. return ut.apply(this, [e2, t2]);
  12482. }
  12483. downloadFile(e2, t2) {
  12484. return ht.apply(this, [e2, t2]);
  12485. }
  12486. uploadFile(e2, t2) {
  12487. return ot.apply(this, [e2, t2]);
  12488. }
  12489. getUploadMetadata(e2, t2) {
  12490. return at.apply(this, [e2, t2]);
  12491. }
  12492. registerExtension(e2) {
  12493. pt[e2.name] = e2;
  12494. }
  12495. async invokeExtension(e2, t2) {
  12496. const n2 = pt[e2];
  12497. if (!n2)
  12498. throw new ne({ message: `扩展${e2} 必须先注册` });
  12499. return await n2.invoke(t2, this);
  12500. }
  12501. useAdapters(e2) {
  12502. const { adapter: t2, runtime: n2 } = ke(e2) || {};
  12503. t2 && (Ce.adapter = t2), n2 && (Ce.runtime = n2);
  12504. }
  12505. }
  12506. var gt = new ft();
  12507. function mt(e2, t2, n2) {
  12508. void 0 === n2 && (n2 = {});
  12509. var s2 = /\?/.test(t2), r2 = "";
  12510. for (var i2 in n2)
  12511. "" === r2 ? !s2 && (t2 += "?") : r2 += "&", r2 += i2 + "=" + encodeURIComponent(n2[i2]);
  12512. return /^http(s)?:\/\//.test(t2 += r2) ? t2 : "" + e2 + t2;
  12513. }
  12514. class yt {
  12515. post(e2) {
  12516. const { url: t2, data: n2, headers: s2 } = e2;
  12517. return new Promise((e3, r2) => {
  12518. se.request({ url: mt("https:", t2), data: n2, method: "POST", header: s2, success(t3) {
  12519. e3(t3);
  12520. }, fail(e4) {
  12521. r2(e4);
  12522. } });
  12523. });
  12524. }
  12525. upload(e2) {
  12526. return new Promise((t2, n2) => {
  12527. const { url: s2, file: r2, data: i2, headers: o2, fileType: a2 } = e2, c2 = se.uploadFile({ url: mt("https:", s2), name: "file", formData: Object.assign({}, i2), filePath: r2, fileType: a2, header: o2, success(e3) {
  12528. const n3 = { statusCode: e3.statusCode, data: e3.data || {} };
  12529. 200 === e3.statusCode && i2.success_action_status && (n3.statusCode = parseInt(i2.success_action_status, 10)), t2(n3);
  12530. }, fail(e3) {
  12531. n2(new Error(e3.errMsg || "uploadFile:fail"));
  12532. } });
  12533. "function" == typeof e2.onUploadProgress && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((t3) => {
  12534. e2.onUploadProgress({ loaded: t3.totalBytesSent, total: t3.totalBytesExpectedToSend });
  12535. });
  12536. });
  12537. }
  12538. }
  12539. const _t = { setItem(e2, t2) {
  12540. se.setStorageSync(e2, t2);
  12541. }, getItem: (e2) => se.getStorageSync(e2), removeItem(e2) {
  12542. se.removeStorageSync(e2);
  12543. }, clear() {
  12544. se.clearStorageSync();
  12545. } };
  12546. var wt = { genAdapter: function() {
  12547. return { root: {}, reqClass: yt, localStorage: _t, primaryStorage: "local" };
  12548. }, isMatch: function() {
  12549. return true;
  12550. }, runtime: "uni_app" };
  12551. gt.useAdapters(wt);
  12552. const vt = gt, It = vt.init;
  12553. vt.init = function(e2) {
  12554. e2.env = e2.spaceId;
  12555. const t2 = It.call(this, e2);
  12556. t2.config.provider = "tencent", t2.config.spaceId = e2.spaceId;
  12557. const n2 = t2.auth;
  12558. return t2.auth = function(e3) {
  12559. const t3 = n2.call(this, e3);
  12560. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach((e4) => {
  12561. var n3;
  12562. t3[e4] = (n3 = t3[e4], function(e5) {
  12563. e5 = e5 || {};
  12564. const { success: t4, fail: s2, complete: r2 } = te(e5);
  12565. if (!(t4 || s2 || r2))
  12566. return n3.call(this, e5);
  12567. n3.call(this, e5).then((e6) => {
  12568. t4 && t4(e6), r2 && r2(e6);
  12569. }, (e6) => {
  12570. s2 && s2(e6), r2 && r2(e6);
  12571. });
  12572. }).bind(t3);
  12573. }), t3;
  12574. }, t2.customAuth = t2.auth, t2;
  12575. };
  12576. var St = vt;
  12577. var bt = class extends ge {
  12578. getAccessToken() {
  12579. return new Promise((e2, t2) => {
  12580. const n2 = "Anonymous_Access_token";
  12581. this.setAccessToken(n2), e2(n2);
  12582. });
  12583. }
  12584. setupRequest(e2, t2) {
  12585. const n2 = Object.assign({}, e2, { spaceId: this.config.spaceId, timestamp: Date.now() }), s2 = { "Content-Type": "application/json" };
  12586. "auth" !== t2 && (n2.token = this.accessToken, s2["x-basement-token"] = this.accessToken), s2["x-serverless-sign"] = de.sign(n2, this.config.clientSecret);
  12587. const r2 = le();
  12588. s2["x-client-info"] = encodeURIComponent(JSON.stringify(r2));
  12589. const { token: i2 } = ie();
  12590. return s2["x-client-token"] = i2, { url: this.config.requestUrl, method: "POST", data: n2, dataType: "json", header: JSON.parse(JSON.stringify(s2)) };
  12591. }
  12592. uploadFileToOSS({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, onUploadProgress: i2 }) {
  12593. return new Promise((o2, a2) => {
  12594. const c2 = this.adapter.uploadFile({ url: e2, formData: t2, name: n2, filePath: s2, fileType: r2, success(e3) {
  12595. e3 && e3.statusCode < 400 ? o2(e3) : a2(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  12596. }, fail(e3) {
  12597. a2(new ne({ code: e3.code || "UPLOAD_FAILED", message: e3.message || e3.errMsg || "文件上传失败" }));
  12598. } });
  12599. "function" == typeof i2 && c2 && "function" == typeof c2.onProgressUpdate && c2.onProgressUpdate((e3) => {
  12600. i2({ loaded: e3.totalBytesSent, total: e3.totalBytesExpectedToSend });
  12601. });
  12602. });
  12603. }
  12604. uploadFile({ filePath: e2, cloudPath: t2, fileType: n2 = "image", onUploadProgress: s2 }) {
  12605. if (!t2)
  12606. throw new ne({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });
  12607. let r2;
  12608. return this.getOSSUploadOptionsFromPath({ cloudPath: t2 }).then((t3) => {
  12609. const { url: i2, formData: o2, name: a2 } = t3.result;
  12610. r2 = t3.result.fileUrl;
  12611. const c2 = { url: i2, formData: o2, name: a2, filePath: e2, fileType: n2 };
  12612. return this.uploadFileToOSS(Object.assign({}, c2, { onUploadProgress: s2 }));
  12613. }).then(() => this.reportOSSUpload({ cloudPath: t2 })).then((t3) => new Promise((n3, s3) => {
  12614. t3.success ? n3({ success: true, filePath: e2, fileID: r2 }) : s3(new ne({ code: "UPLOAD_FAILED", message: "文件上传失败" }));
  12615. }));
  12616. }
  12617. deleteFile({ fileList: e2 }) {
  12618. const t2 = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e2 }) };
  12619. return this.request(this.setupRequest(t2)).then((e3) => {
  12620. if (e3.success)
  12621. return e3.result;
  12622. throw new ne({ code: "DELETE_FILE_FAILED", message: "删除文件失败" });
  12623. });
  12624. }
  12625. getTempFileURL({ fileList: e2 } = {}) {
  12626. if (!Array.isArray(e2) || 0 === e2.length)
  12627. throw new ne({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" });
  12628. const t2 = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e2 }) };
  12629. return this.request(this.setupRequest(t2)).then((e3) => {
  12630. if (e3.success)
  12631. return { fileList: e3.result.fileList.map((e4) => ({ fileID: e4.fileID, tempFileURL: e4.tempFileURL })) };
  12632. throw new ne({ code: "GET_TEMP_FILE_URL_FAILED", message: "获取临时文件链接失败" });
  12633. });
  12634. }
  12635. };
  12636. var kt = { init(e2) {
  12637. const t2 = new bt(e2), n2 = { signInAnonymously: function() {
  12638. return t2.authorize();
  12639. }, getLoginState: function() {
  12640. return Promise.resolve(false);
  12641. } };
  12642. return t2.auth = function() {
  12643. return n2;
  12644. }, t2.customAuth = t2.auth, t2;
  12645. } };
  12646. function Ct({ data: e2 }) {
  12647. let t2;
  12648. t2 = le();
  12649. const n2 = JSON.parse(JSON.stringify(e2 || {}));
  12650. if (Object.assign(n2, { clientInfo: t2 }), !n2.uniIdToken) {
  12651. const { token: e3 } = ie();
  12652. e3 && (n2.uniIdToken = e3);
  12653. }
  12654. return n2;
  12655. }
  12656. async function Tt({ name: e2, data: t2 } = {}) {
  12657. await this.__dev__.initLocalNetwork();
  12658. const { localAddress: n2, localPort: s2 } = this.__dev__, r2 = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider], i2 = this.config.spaceId, o2 = `http://${n2}:${s2}/system/check-function`, a2 = `http://${n2}:${s2}/cloudfunctions/${e2}`;
  12659. return new Promise((t3, n3) => {
  12660. se.request({ method: "POST", url: o2, data: { name: e2, platform: P, provider: r2, spaceId: i2 }, timeout: 3e3, success(e3) {
  12661. t3(e3);
  12662. }, fail() {
  12663. t3({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });
  12664. } });
  12665. }).then(({ data: e3 } = {}) => {
  12666. const { code: t3, message: n3 } = e3 || {};
  12667. return { code: 0 === t3 ? 0 : t3 || "SYS_ERR", message: n3 || "SYS_ERR" };
  12668. }).then(({ code: n3, message: s3 }) => {
  12669. if (0 !== n3) {
  12670. switch (n3) {
  12671. case "MODULE_ENCRYPTED":
  12672. console.error(`此云函数(${e2})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);
  12673. break;
  12674. case "FUNCTION_ENCRYPTED":
  12675. console.error(`此云函数(${e2})已加密不可本地调试,自动切换为云端已部署的云函数`);
  12676. break;
  12677. case "ACTION_ENCRYPTED":
  12678. console.error(s3 || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  12679. break;
  12680. case "NETWORK_ERROR": {
  12681. const e3 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  12682. throw console.error(e3), new Error(e3);
  12683. }
  12684. case "SWITCH_TO_CLOUD":
  12685. break;
  12686. default: {
  12687. const e3 = `检测本地调试服务出现错误:${s3},请检查网络环境或重启客户端再试`;
  12688. throw console.error(e3), new Error(e3);
  12689. }
  12690. }
  12691. return this._callCloudFunction({ name: e2, data: t2 });
  12692. }
  12693. return new Promise((e3, n4) => {
  12694. const s4 = Ct.call(this, { data: t2 });
  12695. se.request({ method: "POST", url: a2, data: { provider: r2, platform: P, param: s4 }, success: ({ statusCode: t3, data: s5 } = {}) => !t3 || t3 >= 400 ? n4(new ne({ code: s5.code || "SYS_ERR", message: s5.message || "request:fail" })) : e3({ result: s5 }), fail(e4) {
  12696. n4(new ne({ code: e4.code || e4.errCode || "SYS_ERR", message: e4.message || e4.errMsg || "request:fail" }));
  12697. } });
  12698. });
  12699. });
  12700. }
  12701. const Pt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];
  12702. var At = /[\\^$.*+?()[\]{}|]/g, Et = RegExp(At.source);
  12703. function Ot(e2, t2, n2) {
  12704. return e2.replace(new RegExp((s2 = t2) && Et.test(s2) ? s2.replace(At, "\\$&") : s2, "g"), n2);
  12705. var s2;
  12706. }
  12707. const Rt = "request", Ut = "response", Lt = "both";
  12708. const yn = { code: 2e4, message: "System error" }, _n = { code: 20101, message: "Invalid client" };
  12709. function In(e2) {
  12710. const { errSubject: t2, subject: n2, errCode: s2, errMsg: r2, code: i2, message: o2, cause: a2 } = e2 || {};
  12711. return new ne({ subject: t2 || n2 || "uni-secure-network", code: s2 || i2 || yn.code, message: r2 || o2, cause: a2 });
  12712. }
  12713. let bn;
  12714. function An({ secretType: e2 } = {}) {
  12715. return e2 === Rt || e2 === Ut || e2 === Lt;
  12716. }
  12717. function En({ name: e2, data: t2 = {} } = {}) {
  12718. return "app" === P;
  12719. }
  12720. function On({ provider: e2, spaceId: t2, functionName: n2 } = {}) {
  12721. const { appId: s2, uniPlatform: r2, osName: i2 } = ue();
  12722. let o2 = r2;
  12723. "app" === r2 && (o2 = i2);
  12724. const a2 = function({ provider: e3, spaceId: t3 } = {}) {
  12725. const n3 = T;
  12726. if (!n3)
  12727. return {};
  12728. e3 = function(e4) {
  12729. return "tencent" === e4 ? "tcb" : e4;
  12730. }(e3);
  12731. const s3 = n3.find((n4) => n4.provider === e3 && n4.spaceId === t3);
  12732. return s3 && s3.config;
  12733. }({ provider: e2, spaceId: t2 });
  12734. if (!a2 || !a2.accessControl || !a2.accessControl.enable)
  12735. return false;
  12736. const c2 = a2.accessControl.function || {}, u2 = Object.keys(c2);
  12737. if (0 === u2.length)
  12738. return true;
  12739. const h2 = function(e3, t3) {
  12740. let n3, s3, r3;
  12741. for (let i3 = 0; i3 < e3.length; i3++) {
  12742. const o3 = e3[i3];
  12743. o3 !== t3 ? "*" !== o3 ? o3.split(",").map((e4) => e4.trim()).indexOf(t3) > -1 && (s3 = o3) : r3 = o3 : n3 = o3;
  12744. }
  12745. return n3 || s3 || r3;
  12746. }(u2, n2);
  12747. if (!h2)
  12748. return false;
  12749. if ((c2[h2] || []).find((e3 = {}) => e3.appId === s2 && (e3.platform || "").toLowerCase() === o2.toLowerCase()))
  12750. return true;
  12751. throw console.error(`此应用[appId: ${s2}, platform: ${o2}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`), In(_n);
  12752. }
  12753. function xn({ functionName: e2, result: t2, logPvd: n2 }) {
  12754. if (this.__dev__.debugLog && t2 && t2.requestId) {
  12755. const s2 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e2, requestId: t2.requestId });
  12756. console.log(`[${n2}-request]${s2}[/${n2}-request]`);
  12757. }
  12758. }
  12759. function Rn(e2) {
  12760. const t2 = e2.callFunction, n2 = function(n3) {
  12761. const s2 = n3.name;
  12762. n3.data = Ct.call(e2, { data: n3.data });
  12763. const r2 = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb" }[this.config.provider], i2 = An(n3), o2 = En(n3), a2 = i2 || o2;
  12764. return t2.call(this, n3).then((e3) => (e3.errCode = 0, !a2 && xn.call(this, { functionName: s2, result: e3, logPvd: r2 }), Promise.resolve(e3)), (e3) => (!a2 && xn.call(this, { functionName: s2, result: e3, logPvd: r2 }), e3 && e3.message && (e3.message = function({ message: e4 = "", extraInfo: t3 = {}, formatter: n4 = [] } = {}) {
  12765. for (let s3 = 0; s3 < n4.length; s3++) {
  12766. const { rule: r3, content: i3, mode: o3 } = n4[s3], a3 = e4.match(r3);
  12767. if (!a3)
  12768. continue;
  12769. let c2 = i3;
  12770. for (let e5 = 1; e5 < a3.length; e5++)
  12771. c2 = Ot(c2, `{$${e5}}`, a3[e5]);
  12772. for (const e5 in t3)
  12773. c2 = Ot(c2, `{${e5}}`, t3[e5]);
  12774. return "replace" === o3 ? c2 : e4 + c2;
  12775. }
  12776. return e4;
  12777. }({ message: `[${n3.name}]: ${e3.message}`, formatter: Pt, extraInfo: { functionName: s2 } })), Promise.reject(e3)));
  12778. };
  12779. e2.callFunction = function(t3) {
  12780. const { provider: s2, spaceId: r2 } = e2.config, i2 = t3.name;
  12781. let o2, a2;
  12782. if (t3.data = t3.data || {}, e2.__dev__.debugInfo && !e2.__dev__.debugInfo.forceRemote && E ? (e2._callCloudFunction || (e2._callCloudFunction = n2, e2._callLocalFunction = Tt), o2 = Tt) : o2 = n2, o2 = o2.bind(e2), En(t3))
  12783. ;
  12784. else if (function({ name: e3, data: t4 = {} }) {
  12785. return "uni-id-co" === e3 && "secureNetworkHandshakeByWeixin" === t4.method;
  12786. }(t3))
  12787. a2 = o2.call(e2, t3);
  12788. else if (An(t3)) {
  12789. a2 = new bn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapEncryptDataCallFunction(n2.bind(e2))(t3);
  12790. } else if (On({ provider: s2, spaceId: r2, functionName: i2 })) {
  12791. a2 = new bn({ secretType: t3.secretType, uniCloudIns: e2 }).wrapVerifyClientCallFunction(n2.bind(e2))(t3);
  12792. } else
  12793. a2 = o2(t3);
  12794. return Object.defineProperty(a2, "result", { get: () => (console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {}) }), a2;
  12795. };
  12796. }
  12797. bn = class {
  12798. constructor() {
  12799. throw In({ message: `Platform ${P} is not enabled, please check whether secure network module is enabled in your manifest.json` });
  12800. }
  12801. };
  12802. const Un = Symbol("CLIENT_DB_INTERNAL");
  12803. function Ln(e2, t2) {
  12804. return e2.then = "DoNotReturnProxyWithAFunctionNamedThen", e2._internalType = Un, e2.inspect = null, e2.__v_raw = void 0, new Proxy(e2, { get(e3, n2, s2) {
  12805. if ("_uniClient" === n2)
  12806. return null;
  12807. if ("symbol" == typeof n2)
  12808. return e3[n2];
  12809. if (n2 in e3 || "string" != typeof n2) {
  12810. const t3 = e3[n2];
  12811. return "function" == typeof t3 ? t3.bind(e3) : t3;
  12812. }
  12813. return t2.get(e3, n2, s2);
  12814. } });
  12815. }
  12816. function Nn(e2) {
  12817. return { on: (t2, n2) => {
  12818. e2[t2] = e2[t2] || [], e2[t2].indexOf(n2) > -1 || e2[t2].push(n2);
  12819. }, off: (t2, n2) => {
  12820. e2[t2] = e2[t2] || [];
  12821. const s2 = e2[t2].indexOf(n2);
  12822. -1 !== s2 && e2[t2].splice(s2, 1);
  12823. } };
  12824. }
  12825. const Dn = ["db.Geo", "db.command", "command.aggregate"];
  12826. function Fn(e2, t2) {
  12827. return Dn.indexOf(`${e2}.${t2}`) > -1;
  12828. }
  12829. function Mn(e2) {
  12830. switch (g(e2 = re(e2))) {
  12831. case "array":
  12832. return e2.map((e3) => Mn(e3));
  12833. case "object":
  12834. return e2._internalType === Un || Object.keys(e2).forEach((t2) => {
  12835. e2[t2] = Mn(e2[t2]);
  12836. }), e2;
  12837. case "regexp":
  12838. return { $regexp: { source: e2.source, flags: e2.flags } };
  12839. case "date":
  12840. return { $date: e2.toISOString() };
  12841. default:
  12842. return e2;
  12843. }
  12844. }
  12845. function qn(e2) {
  12846. return e2 && e2.content && e2.content.$method;
  12847. }
  12848. class Kn {
  12849. constructor(e2, t2, n2) {
  12850. this.content = e2, this.prevStage = t2 || null, this.udb = null, this._database = n2;
  12851. }
  12852. toJSON() {
  12853. let e2 = this;
  12854. const t2 = [e2.content];
  12855. for (; e2.prevStage; )
  12856. e2 = e2.prevStage, t2.push(e2.content);
  12857. return { $db: t2.reverse().map((e3) => ({ $method: e3.$method, $param: Mn(e3.$param) })) };
  12858. }
  12859. toString() {
  12860. return JSON.stringify(this.toJSON());
  12861. }
  12862. getAction() {
  12863. const e2 = this.toJSON().$db.find((e3) => "action" === e3.$method);
  12864. return e2 && e2.$param && e2.$param[0];
  12865. }
  12866. getCommand() {
  12867. return { $db: this.toJSON().$db.filter((e2) => "action" !== e2.$method) };
  12868. }
  12869. get isAggregate() {
  12870. let e2 = this;
  12871. for (; e2; ) {
  12872. const t2 = qn(e2), n2 = qn(e2.prevStage);
  12873. if ("aggregate" === t2 && "collection" === n2 || "pipeline" === t2)
  12874. return true;
  12875. e2 = e2.prevStage;
  12876. }
  12877. return false;
  12878. }
  12879. get isCommand() {
  12880. let e2 = this;
  12881. for (; e2; ) {
  12882. if ("command" === qn(e2))
  12883. return true;
  12884. e2 = e2.prevStage;
  12885. }
  12886. return false;
  12887. }
  12888. get isAggregateCommand() {
  12889. let e2 = this;
  12890. for (; e2; ) {
  12891. const t2 = qn(e2), n2 = qn(e2.prevStage);
  12892. if ("aggregate" === t2 && "command" === n2)
  12893. return true;
  12894. e2 = e2.prevStage;
  12895. }
  12896. return false;
  12897. }
  12898. getNextStageFn(e2) {
  12899. const t2 = this;
  12900. return function() {
  12901. return jn({ $method: e2, $param: Mn(Array.from(arguments)) }, t2, t2._database);
  12902. };
  12903. }
  12904. get count() {
  12905. return this.isAggregate ? this.getNextStageFn("count") : function() {
  12906. return this._send("count", Array.from(arguments));
  12907. };
  12908. }
  12909. get remove() {
  12910. return this.isCommand ? this.getNextStageFn("remove") : function() {
  12911. return this._send("remove", Array.from(arguments));
  12912. };
  12913. }
  12914. get() {
  12915. return this._send("get", Array.from(arguments));
  12916. }
  12917. get add() {
  12918. return this.isCommand ? this.getNextStageFn("add") : function() {
  12919. return this._send("add", Array.from(arguments));
  12920. };
  12921. }
  12922. update() {
  12923. return this._send("update", Array.from(arguments));
  12924. }
  12925. end() {
  12926. return this._send("end", Array.from(arguments));
  12927. }
  12928. get set() {
  12929. return this.isCommand ? this.getNextStageFn("set") : function() {
  12930. throw new Error("JQL禁止使用set方法");
  12931. };
  12932. }
  12933. _send(e2, t2) {
  12934. const n2 = this.getAction(), s2 = this.getCommand();
  12935. if (s2.$db.push({ $method: e2, $param: Mn(t2) }), b) {
  12936. const e3 = s2.$db.find((e4) => "collection" === e4.$method), t3 = e3 && e3.$param;
  12937. t3 && 1 === t3.length && "string" == typeof e3.$param[0] && e3.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  12938. }
  12939. return this._database._callCloudFunction({ action: n2, command: s2 });
  12940. }
  12941. }
  12942. function jn(e2, t2, n2) {
  12943. return Ln(new Kn(e2, t2, n2), { get(e3, t3) {
  12944. let s2 = "db";
  12945. return e3 && e3.content && (s2 = e3.content.$method), Fn(s2, t3) ? jn({ $method: t3 }, e3, n2) : function() {
  12946. return jn({ $method: t3, $param: Mn(Array.from(arguments)) }, e3, n2);
  12947. };
  12948. } });
  12949. }
  12950. function Bn({ path: e2, method: t2 }) {
  12951. return class {
  12952. constructor() {
  12953. this.param = Array.from(arguments);
  12954. }
  12955. toJSON() {
  12956. return { $newDb: [...e2.map((e3) => ({ $method: e3 })), { $method: t2, $param: this.param }] };
  12957. }
  12958. toString() {
  12959. return JSON.stringify(this.toJSON());
  12960. }
  12961. };
  12962. }
  12963. function $n(e2, t2 = {}) {
  12964. return Ln(new e2(t2), { get: (e3, t3) => Fn("db", t3) ? jn({ $method: t3 }, null, e3) : function() {
  12965. return jn({ $method: t3, $param: Mn(Array.from(arguments)) }, null, e3);
  12966. } });
  12967. }
  12968. class Wn extends class {
  12969. constructor({ uniClient: e2 = {}, isJQL: t2 = false } = {}) {
  12970. this._uniClient = e2, this._authCallBacks = {}, this._dbCallBacks = {}, e2._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t2 || (this.auth = Nn(this._authCallBacks)), this._isJQL = t2, Object.assign(this, Nn(this._dbCallBacks)), this.env = Ln({}, { get: (e3, t3) => ({ $env: t3 }) }), this.Geo = Ln({}, { get: (e3, t3) => Bn({ path: ["Geo"], method: t3 }) }), this.serverDate = Bn({ path: [], method: "serverDate" }), this.RegExp = Bn({ path: [], method: "RegExp" });
  12971. }
  12972. getCloudEnv(e2) {
  12973. if ("string" != typeof e2 || !e2.trim())
  12974. throw new Error("getCloudEnv参数错误");
  12975. return { $env: e2.replace("$cloudEnv_", "") };
  12976. }
  12977. _callback(e2, t2) {
  12978. const n2 = this._dbCallBacks;
  12979. n2[e2] && n2[e2].forEach((e3) => {
  12980. e3(...t2);
  12981. });
  12982. }
  12983. _callbackAuth(e2, t2) {
  12984. const n2 = this._authCallBacks;
  12985. n2[e2] && n2[e2].forEach((e3) => {
  12986. e3(...t2);
  12987. });
  12988. }
  12989. multiSend() {
  12990. const e2 = Array.from(arguments), t2 = e2.map((e3) => {
  12991. const t3 = e3.getAction(), n2 = e3.getCommand();
  12992. if ("getTemp" !== n2.$db[n2.$db.length - 1].$method)
  12993. throw new Error("multiSend只支持子命令内使用getTemp");
  12994. return { action: t3, command: n2 };
  12995. });
  12996. return this._callCloudFunction({ multiCommand: t2, queryList: e2 });
  12997. }
  12998. } {
  12999. _parseResult(e2) {
  13000. return this._isJQL ? e2.result : e2;
  13001. }
  13002. _callCloudFunction({ action: e2, command: t2, multiCommand: n2, queryList: s2 }) {
  13003. function r2(e3, t3) {
  13004. if (n2 && s2)
  13005. for (let n3 = 0; n3 < s2.length; n3++) {
  13006. const r3 = s2[n3];
  13007. r3.udb && "function" == typeof r3.udb.setResult && (t3 ? r3.udb.setResult(t3) : r3.udb.setResult(e3.result.dataList[n3]));
  13008. }
  13009. }
  13010. const i2 = this, o2 = this._isJQL ? "databaseForJQL" : "database";
  13011. function a2(e3) {
  13012. return i2._callback("error", [e3]), M(q(o2, "fail"), e3).then(() => M(q(o2, "complete"), e3)).then(() => (r2(null, e3), Q(B, { type: z, content: e3 }), Promise.reject(e3)));
  13013. }
  13014. const c2 = M(q(o2, "invoke")), u2 = this._uniClient;
  13015. return c2.then(() => u2.callFunction({ name: "DCloud-clientDB", type: l, data: { action: e2, command: t2, multiCommand: n2 } })).then((e3) => {
  13016. const { code: t3, message: n3, token: s3, tokenExpired: c3, systemInfo: u3 = [] } = e3.result;
  13017. if (u3)
  13018. for (let e4 = 0; e4 < u3.length; e4++) {
  13019. const { level: t4, message: n4, detail: s4 } = u3[e4], r3 = console[t4] || console.log;
  13020. let i3 = "[System Info]" + n4;
  13021. s4 && (i3 = `${i3}
  13022. 详细信息:${s4}`), r3(i3);
  13023. }
  13024. if (t3) {
  13025. return a2(new ne({ code: t3, message: n3, requestId: e3.requestId }));
  13026. }
  13027. e3.result.errCode = e3.result.errCode || e3.result.code, e3.result.errMsg = e3.result.errMsg || e3.result.message, s3 && c3 && (oe({ token: s3, tokenExpired: c3 }), this._callbackAuth("refreshToken", [{ token: s3, tokenExpired: c3 }]), this._callback("refreshToken", [{ token: s3, tokenExpired: c3 }]), Q(W, { token: s3, tokenExpired: c3 }));
  13028. const h2 = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];
  13029. for (let t4 = 0; t4 < h2.length; t4++) {
  13030. const { prop: n4, tips: s4 } = h2[t4];
  13031. if (n4 in e3.result) {
  13032. const t5 = e3.result[n4];
  13033. Object.defineProperty(e3.result, n4, { get: () => (console.warn(s4), t5) });
  13034. }
  13035. }
  13036. return function(e4) {
  13037. return M(q(o2, "success"), e4).then(() => M(q(o2, "complete"), e4)).then(() => {
  13038. r2(e4, null);
  13039. const t4 = i2._parseResult(e4);
  13040. return Q(B, { type: z, content: t4 }), Promise.resolve(t4);
  13041. });
  13042. }(e3);
  13043. }, (e3) => {
  13044. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e3.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  13045. return a2(new ne({ code: e3.code || "SYSTEM_ERROR", message: e3.message, requestId: e3.requestId }));
  13046. });
  13047. }
  13048. }
  13049. const zn = "token无效,跳转登录页面", Jn = "token过期,跳转登录页面", Hn = { TOKEN_INVALID_TOKEN_EXPIRED: Jn, TOKEN_INVALID_INVALID_CLIENTID: zn, TOKEN_INVALID: zn, TOKEN_INVALID_WRONG_TOKEN: zn, TOKEN_INVALID_ANONYMOUS_USER: zn }, Gn = { "uni-id-token-expired": Jn, "uni-id-check-token-failed": zn, "uni-id-token-not-exist": zn, "uni-id-check-device-feature-failed": zn };
  13050. function Vn(e2, t2) {
  13051. let n2 = "";
  13052. return n2 = e2 ? `${e2}/${t2}` : t2, n2.replace(/^\//, "");
  13053. }
  13054. function Yn(e2 = [], t2 = "") {
  13055. const n2 = [], s2 = [];
  13056. return e2.forEach((e3) => {
  13057. true === e3.needLogin ? n2.push(Vn(t2, e3.path)) : false === e3.needLogin && s2.push(Vn(t2, e3.path));
  13058. }), { needLoginPage: n2, notNeedLoginPage: s2 };
  13059. }
  13060. function Qn(e2) {
  13061. return e2.split("?")[0].replace(/^\//, "");
  13062. }
  13063. function Xn() {
  13064. return function(e2) {
  13065. let t2 = e2 && e2.$page && e2.$page.fullPath || "";
  13066. return t2 ? ("/" !== t2.charAt(0) && (t2 = "/" + t2), t2) : t2;
  13067. }(function() {
  13068. const e2 = getCurrentPages();
  13069. return e2[e2.length - 1];
  13070. }());
  13071. }
  13072. function Zn() {
  13073. return Qn(Xn());
  13074. }
  13075. function es(e2 = "", t2 = {}) {
  13076. if (!e2)
  13077. return false;
  13078. if (!(t2 && t2.list && t2.list.length))
  13079. return false;
  13080. const n2 = t2.list, s2 = Qn(e2);
  13081. return n2.some((e3) => e3.pagePath === s2);
  13082. }
  13083. const ts = !!t.uniIdRouter;
  13084. const { loginPage: ns, routerNeedLogin: ss, resToLogin: rs, needLoginPage: is, notNeedLoginPage: os, loginPageInTabBar: as } = function({ pages: e2 = [], subPackages: n2 = [], uniIdRouter: s2 = {}, tabBar: r2 = {} } = t) {
  13085. const { loginPage: i2, needLogin: o2 = [], resToLogin: a2 = true } = s2, { needLoginPage: c2, notNeedLoginPage: u2 } = Yn(e2), { needLoginPage: h2, notNeedLoginPage: l2 } = function(e3 = []) {
  13086. const t2 = [], n3 = [];
  13087. return e3.forEach((e4) => {
  13088. const { root: s3, pages: r3 = [] } = e4, { needLoginPage: i3, notNeedLoginPage: o3 } = Yn(r3, s3);
  13089. t2.push(...i3), n3.push(...o3);
  13090. }), { needLoginPage: t2, notNeedLoginPage: n3 };
  13091. }(n2);
  13092. return { loginPage: i2, routerNeedLogin: o2, resToLogin: a2, needLoginPage: [...c2, ...h2], notNeedLoginPage: [...u2, ...l2], loginPageInTabBar: es(i2, r2) };
  13093. }();
  13094. if (is.indexOf(ns) > -1)
  13095. throw new Error(`Login page [${ns}] should not be "needLogin", please check your pages.json`);
  13096. function cs(e2) {
  13097. const t2 = Zn();
  13098. if ("/" === e2.charAt(0))
  13099. return e2;
  13100. const [n2, s2] = e2.split("?"), r2 = n2.replace(/^\//, "").split("/"), i2 = t2.split("/");
  13101. i2.pop();
  13102. for (let e3 = 0; e3 < r2.length; e3++) {
  13103. const t3 = r2[e3];
  13104. ".." === t3 ? i2.pop() : "." !== t3 && i2.push(t3);
  13105. }
  13106. return "" === i2[0] && i2.shift(), "/" + i2.join("/") + (s2 ? "?" + s2 : "");
  13107. }
  13108. function us(e2) {
  13109. const t2 = Qn(cs(e2));
  13110. return !(os.indexOf(t2) > -1) && (is.indexOf(t2) > -1 || ss.some((t3) => function(e3, t4) {
  13111. return new RegExp(t4).test(e3);
  13112. }(e2, t3)));
  13113. }
  13114. function hs({ redirect: e2 }) {
  13115. const t2 = Qn(e2), n2 = Qn(ns);
  13116. return Zn() !== n2 && t2 !== n2;
  13117. }
  13118. function ls({ api: e2, redirect: t2 } = {}) {
  13119. if (!t2 || !hs({ redirect: t2 }))
  13120. return;
  13121. const n2 = function(e3, t3) {
  13122. return "/" !== e3.charAt(0) && (e3 = "/" + e3), t3 ? e3.indexOf("?") > -1 ? e3 + `&uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3 + `?uniIdRedirectUrl=${encodeURIComponent(t3)}` : e3;
  13123. }(ns, t2);
  13124. as ? "navigateTo" !== e2 && "redirectTo" !== e2 || (e2 = "switchTab") : "switchTab" === e2 && (e2 = "navigateTo");
  13125. const s2 = { navigateTo: index.navigateTo, redirectTo: index.redirectTo, switchTab: index.switchTab, reLaunch: index.reLaunch };
  13126. setTimeout(() => {
  13127. s2[e2]({ url: n2 });
  13128. });
  13129. }
  13130. function ds({ url: e2 } = {}) {
  13131. const t2 = { abortLoginPageJump: false, autoToLoginPage: false }, n2 = function() {
  13132. const { token: e3, tokenExpired: t3 } = ie();
  13133. let n3;
  13134. if (e3) {
  13135. if (t3 < Date.now()) {
  13136. const e4 = "uni-id-token-expired";
  13137. n3 = { errCode: e4, errMsg: Gn[e4] };
  13138. }
  13139. } else {
  13140. const e4 = "uni-id-check-token-failed";
  13141. n3 = { errCode: e4, errMsg: Gn[e4] };
  13142. }
  13143. return n3;
  13144. }();
  13145. if (us(e2) && n2) {
  13146. n2.uniIdRedirectUrl = e2;
  13147. if (G($).length > 0)
  13148. return setTimeout(() => {
  13149. Q($, n2);
  13150. }, 0), t2.abortLoginPageJump = true, t2;
  13151. t2.autoToLoginPage = true;
  13152. }
  13153. return t2;
  13154. }
  13155. function ps() {
  13156. !function() {
  13157. const e3 = Xn(), { abortLoginPageJump: t2, autoToLoginPage: n2 } = ds({ url: e3 });
  13158. t2 || n2 && ls({ api: "redirectTo", redirect: e3 });
  13159. }();
  13160. const e2 = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  13161. for (let t2 = 0; t2 < e2.length; t2++) {
  13162. const n2 = e2[t2];
  13163. index.addInterceptor(n2, { invoke(e3) {
  13164. const { abortLoginPageJump: t3, autoToLoginPage: s2 } = ds({ url: e3.url });
  13165. return t3 ? e3 : s2 ? (ls({ api: n2, redirect: cs(e3.url) }), false) : e3;
  13166. } });
  13167. }
  13168. }
  13169. function fs() {
  13170. this.onResponse((e2) => {
  13171. const { type: t2, content: n2 } = e2;
  13172. let s2 = false;
  13173. switch (t2) {
  13174. case "cloudobject":
  13175. s2 = function(e3) {
  13176. if ("object" != typeof e3)
  13177. return false;
  13178. const { errCode: t3 } = e3 || {};
  13179. return t3 in Gn;
  13180. }(n2);
  13181. break;
  13182. case "clientdb":
  13183. s2 = function(e3) {
  13184. if ("object" != typeof e3)
  13185. return false;
  13186. const { errCode: t3 } = e3 || {};
  13187. return t3 in Hn;
  13188. }(n2);
  13189. }
  13190. s2 && function(e3 = {}) {
  13191. const t3 = G($);
  13192. ee().then(() => {
  13193. const n3 = Xn();
  13194. if (n3 && hs({ redirect: n3 }))
  13195. return t3.length > 0 ? Q($, Object.assign({ uniIdRedirectUrl: n3 }, e3)) : void (ns && ls({ api: "navigateTo", redirect: n3 }));
  13196. });
  13197. }(n2);
  13198. });
  13199. }
  13200. function gs(e2) {
  13201. !function(e3) {
  13202. e3.onResponse = function(e4) {
  13203. V(B, e4);
  13204. }, e3.offResponse = function(e4) {
  13205. Y(B, e4);
  13206. };
  13207. }(e2), function(e3) {
  13208. e3.onNeedLogin = function(e4) {
  13209. V($, e4);
  13210. }, e3.offNeedLogin = function(e4) {
  13211. Y($, e4);
  13212. }, ts && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = true, ee().then(() => {
  13213. ps.call(e3);
  13214. }), rs && fs.call(e3)));
  13215. }(e2), function(e3) {
  13216. e3.onRefreshToken = function(e4) {
  13217. V(W, e4);
  13218. }, e3.offRefreshToken = function(e4) {
  13219. Y(W, e4);
  13220. };
  13221. }(e2);
  13222. }
  13223. let ms;
  13224. const ys = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", _s = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  13225. function ws() {
  13226. const e2 = ie().token || "", t2 = e2.split(".");
  13227. if (!e2 || 3 !== t2.length)
  13228. return { uid: null, role: [], permission: [], tokenExpired: 0 };
  13229. let n2;
  13230. try {
  13231. n2 = JSON.parse((s2 = t2[1], decodeURIComponent(ms(s2).split("").map(function(e3) {
  13232. return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
  13233. }).join(""))));
  13234. } catch (e3) {
  13235. throw new Error("获取当前用户信息出错,详细错误信息为:" + e3.message);
  13236. }
  13237. var s2;
  13238. return n2.tokenExpired = 1e3 * n2.exp, delete n2.exp, delete n2.iat, n2;
  13239. }
  13240. ms = "function" != typeof atob ? function(e2) {
  13241. if (e2 = String(e2).replace(/[\t\n\f\r ]+/g, ""), !_s.test(e2))
  13242. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  13243. var t2;
  13244. e2 += "==".slice(2 - (3 & e2.length));
  13245. for (var n2, s2, r2 = "", i2 = 0; i2 < e2.length; )
  13246. t2 = ys.indexOf(e2.charAt(i2++)) << 18 | ys.indexOf(e2.charAt(i2++)) << 12 | (n2 = ys.indexOf(e2.charAt(i2++))) << 6 | (s2 = ys.indexOf(e2.charAt(i2++))), r2 += 64 === n2 ? String.fromCharCode(t2 >> 16 & 255) : 64 === s2 ? String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255) : String.fromCharCode(t2 >> 16 & 255, t2 >> 8 & 255, 255 & t2);
  13247. return r2;
  13248. } : atob;
  13249. var vs = s(function(e2, t2) {
  13250. Object.defineProperty(t2, "__esModule", { value: true });
  13251. const n2 = "chooseAndUploadFile:ok", s2 = "chooseAndUploadFile:fail";
  13252. function r2(e3, t3) {
  13253. return e3.tempFiles.forEach((e4, n3) => {
  13254. e4.name || (e4.name = e4.path.substring(e4.path.lastIndexOf("/") + 1)), t3 && (e4.fileType = t3), e4.cloudPath = Date.now() + "_" + n3 + e4.name.substring(e4.name.lastIndexOf("."));
  13255. }), e3.tempFilePaths || (e3.tempFilePaths = e3.tempFiles.map((e4) => e4.path)), e3;
  13256. }
  13257. function i2(e3, t3, { onChooseFile: s3, onUploadProgress: r3 }) {
  13258. return t3.then((e4) => {
  13259. if (s3) {
  13260. const t4 = s3(e4);
  13261. if (void 0 !== t4)
  13262. return Promise.resolve(t4).then((t5) => void 0 === t5 ? e4 : t5);
  13263. }
  13264. return e4;
  13265. }).then((t4) => false === t4 ? { errMsg: n2, tempFilePaths: [], tempFiles: [] } : function(e4, t5, s4 = 5, r4) {
  13266. (t5 = Object.assign({}, t5)).errMsg = n2;
  13267. const i3 = t5.tempFiles, o2 = i3.length;
  13268. let a2 = 0;
  13269. return new Promise((n3) => {
  13270. for (; a2 < s4; )
  13271. c2();
  13272. function c2() {
  13273. const s5 = a2++;
  13274. if (s5 >= o2)
  13275. return void (!i3.find((e5) => !e5.url && !e5.errMsg) && n3(t5));
  13276. const u2 = i3[s5];
  13277. e4.uploadFile({ filePath: u2.path, cloudPath: u2.cloudPath, fileType: u2.fileType, onUploadProgress(e5) {
  13278. e5.index = s5, e5.tempFile = u2, e5.tempFilePath = u2.path, r4 && r4(e5);
  13279. } }).then((e5) => {
  13280. u2.url = e5.fileID, s5 < o2 && c2();
  13281. }).catch((e5) => {
  13282. u2.errMsg = e5.errMsg || e5.message, s5 < o2 && c2();
  13283. });
  13284. }
  13285. });
  13286. }(e3, t4, 5, r3));
  13287. }
  13288. t2.initChooseAndUploadFile = function(e3) {
  13289. return function(t3 = { type: "all" }) {
  13290. return "image" === t3.type ? i2(e3, function(e4) {
  13291. const { count: t4, sizeType: n3, sourceType: i3 = ["album", "camera"], extension: o2 } = e4;
  13292. return new Promise((e5, a2) => {
  13293. index.chooseImage({ count: t4, sizeType: n3, sourceType: i3, extension: o2, success(t5) {
  13294. e5(r2(t5, "image"));
  13295. }, fail(e6) {
  13296. a2({ errMsg: e6.errMsg.replace("chooseImage:fail", s2) });
  13297. } });
  13298. });
  13299. }(t3), t3) : "video" === t3.type ? i2(e3, function(e4) {
  13300. const { camera: t4, compressed: n3, maxDuration: i3, sourceType: o2 = ["album", "camera"], extension: a2 } = e4;
  13301. return new Promise((e5, c2) => {
  13302. index.chooseVideo({ camera: t4, compressed: n3, maxDuration: i3, sourceType: o2, extension: a2, success(t5) {
  13303. const { tempFilePath: n4, duration: s3, size: i4, height: o3, width: a3 } = t5;
  13304. e5(r2({ errMsg: "chooseVideo:ok", tempFilePaths: [n4], tempFiles: [{ name: t5.tempFile && t5.tempFile.name || "", path: n4, size: i4, type: t5.tempFile && t5.tempFile.type || "", width: a3, height: o3, duration: s3, fileType: "video", cloudPath: "" }] }, "video"));
  13305. }, fail(e6) {
  13306. c2({ errMsg: e6.errMsg.replace("chooseVideo:fail", s2) });
  13307. } });
  13308. });
  13309. }(t3), t3) : i2(e3, function(e4) {
  13310. const { count: t4, extension: n3 } = e4;
  13311. return new Promise((e5, i3) => {
  13312. let o2 = index.chooseFile;
  13313. if ("undefined" != typeof wx$1 && "function" == typeof wx$1.chooseMessageFile && (o2 = wx$1.chooseMessageFile), "function" != typeof o2)
  13314. return i3({ errMsg: s2 + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });
  13315. o2({ type: "all", count: t4, extension: n3, success(t5) {
  13316. e5(r2(t5));
  13317. }, fail(e6) {
  13318. i3({ errMsg: e6.errMsg.replace("chooseFile:fail", s2) });
  13319. } });
  13320. });
  13321. }(t3), t3);
  13322. };
  13323. };
  13324. }), Is = n(vs);
  13325. const Ss = "manual";
  13326. function bs(e2) {
  13327. return { props: { localdata: { type: Array, default: () => [] }, options: { type: [Object, Array], default: () => ({}) }, spaceInfo: { type: Object, default: () => ({}) }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: false }, gettree: { type: [Boolean, String], default: false }, gettreepath: { type: [Boolean, String], default: false }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: false }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: false } }, data: () => ({ mixinDatacomLoading: false, mixinDatacomHasMore: false, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {} }), created() {
  13328. this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(() => {
  13329. var e3 = [];
  13330. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach((t2) => {
  13331. e3.push(this[t2]);
  13332. }), e3;
  13333. }, (e3, t2) => {
  13334. if (this.loadtime === Ss)
  13335. return;
  13336. let n2 = false;
  13337. const s2 = [];
  13338. for (let r2 = 2; r2 < e3.length; r2++)
  13339. e3[r2] !== t2[r2] && (s2.push(e3[r2]), n2 = true);
  13340. e3[0] !== t2[0] && (this.mixinDatacomPage.current = this.pageCurrent), this.mixinDatacomPage.size = this.pageSize, this.onMixinDatacomPropsChange(n2, s2);
  13341. });
  13342. }, methods: { onMixinDatacomPropsChange(e3, t2) {
  13343. }, mixinDatacomEasyGet({ getone: e3 = false, success: t2, fail: n2 } = {}) {
  13344. this.mixinDatacomLoading || (this.mixinDatacomLoading = true, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then((n3) => {
  13345. this.mixinDatacomLoading = false;
  13346. const { data: s2, count: r2 } = n3.result;
  13347. this.getcount && (this.mixinDatacomPage.count = r2), this.mixinDatacomHasMore = s2.length < this.pageSize;
  13348. const i2 = e3 ? s2.length ? s2[0] : void 0 : s2;
  13349. this.mixinDatacomResData = i2, t2 && t2(i2);
  13350. }).catch((e4) => {
  13351. this.mixinDatacomLoading = false, this.mixinDatacomErrorMessage = e4, n2 && n2(e4);
  13352. }));
  13353. }, mixinDatacomGet(t2 = {}) {
  13354. let n2 = e2.database(this.spaceInfo);
  13355. const s2 = t2.action || this.action;
  13356. s2 && (n2 = n2.action(s2));
  13357. const r2 = t2.collection || this.collection;
  13358. n2 = Array.isArray(r2) ? n2.collection(...r2) : n2.collection(r2);
  13359. const i2 = t2.where || this.where;
  13360. i2 && Object.keys(i2).length && (n2 = n2.where(i2));
  13361. const o2 = t2.field || this.field;
  13362. o2 && (n2 = n2.field(o2));
  13363. const a2 = t2.foreignKey || this.foreignKey;
  13364. a2 && (n2 = n2.foreignKey(a2));
  13365. const c2 = t2.groupby || this.groupby;
  13366. c2 && (n2 = n2.groupBy(c2));
  13367. const u2 = t2.groupField || this.groupField;
  13368. u2 && (n2 = n2.groupField(u2));
  13369. true === (void 0 !== t2.distinct ? t2.distinct : this.distinct) && (n2 = n2.distinct());
  13370. const h2 = t2.orderby || this.orderby;
  13371. h2 && (n2 = n2.orderBy(h2));
  13372. const l2 = void 0 !== t2.pageCurrent ? t2.pageCurrent : this.mixinDatacomPage.current, d2 = void 0 !== t2.pageSize ? t2.pageSize : this.mixinDatacomPage.size, p2 = void 0 !== t2.getcount ? t2.getcount : this.getcount, f2 = void 0 !== t2.gettree ? t2.gettree : this.gettree, g2 = void 0 !== t2.gettreepath ? t2.gettreepath : this.gettreepath, m2 = { getCount: p2 }, y2 = { limitLevel: void 0 !== t2.limitlevel ? t2.limitlevel : this.limitlevel, startWith: void 0 !== t2.startwith ? t2.startwith : this.startwith };
  13373. return f2 && (m2.getTree = y2), g2 && (m2.getTreePath = y2), n2 = n2.skip(d2 * (l2 - 1)).limit(d2).get(m2), n2;
  13374. } } };
  13375. }
  13376. function ks(e2) {
  13377. return function(t2, n2 = {}) {
  13378. n2 = function(e3, t3 = {}) {
  13379. return e3.customUI = t3.customUI || e3.customUI, e3.parseSystemError = t3.parseSystemError || e3.parseSystemError, Object.assign(e3.loadingOptions, t3.loadingOptions), Object.assign(e3.errorOptions, t3.errorOptions), "object" == typeof t3.secretMethods && (e3.secretMethods = t3.secretMethods), e3;
  13380. }({ customUI: false, loadingOptions: { title: "加载中...", mask: true }, errorOptions: { type: "modal", retry: false } }, n2);
  13381. const { customUI: s2, loadingOptions: r2, errorOptions: i2, parseSystemError: o2 } = n2, a2 = !s2;
  13382. return new Proxy({}, { get: (s3, c2) => function({ fn: e3, interceptorName: t3, getCallbackArgs: n3 } = {}) {
  13383. return async function(...s4) {
  13384. const r3 = n3 ? n3({ params: s4 }) : {};
  13385. let i3, o3;
  13386. try {
  13387. return await M(q(t3, "invoke"), { ...r3 }), i3 = await e3(...s4), await M(q(t3, "success"), { ...r3, result: i3 }), i3;
  13388. } catch (e4) {
  13389. throw o3 = e4, await M(q(t3, "fail"), { ...r3, error: o3 }), o3;
  13390. } finally {
  13391. await M(q(t3, "complete"), o3 ? { ...r3, error: o3 } : { ...r3, result: i3 });
  13392. }
  13393. };
  13394. }({ fn: async function s4(...u2) {
  13395. let l2;
  13396. a2 && index.showLoading({ title: r2.title, mask: r2.mask });
  13397. const d2 = { name: t2, type: h, data: { method: c2, params: u2 } };
  13398. "object" == typeof n2.secretMethods && function(e3, t3) {
  13399. const n3 = t3.data.method, s5 = e3.secretMethods || {}, r3 = s5[n3] || s5["*"];
  13400. r3 && (t3.secretType = r3);
  13401. }(n2, d2);
  13402. let p2 = false;
  13403. try {
  13404. l2 = await e2.callFunction(d2);
  13405. } catch (e3) {
  13406. p2 = true, l2 = { result: new ne(e3) };
  13407. }
  13408. const { errSubject: f2, errCode: g2, errMsg: m2, newToken: y2 } = l2.result || {};
  13409. if (a2 && index.hideLoading(), y2 && y2.token && y2.tokenExpired && (oe(y2), Q(W, { ...y2 })), g2) {
  13410. let e3 = m2;
  13411. if (p2 && o2) {
  13412. e3 = (await o2({ objectName: t2, methodName: c2, params: u2, errSubject: f2, errCode: g2, errMsg: m2 })).errMsg || m2;
  13413. }
  13414. if (a2)
  13415. if ("toast" === i2.type)
  13416. index.showToast({ title: e3, icon: "none" });
  13417. else {
  13418. if ("modal" !== i2.type)
  13419. throw new Error(`Invalid errorOptions.type: ${i2.type}`);
  13420. {
  13421. const { confirm: t3 } = await async function({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3 } = {}) {
  13422. return new Promise((i3, o3) => {
  13423. index.showModal({ title: e4, content: t4, showCancel: n4, cancelText: s5, confirmText: r3, success(e5) {
  13424. i3(e5);
  13425. }, fail() {
  13426. i3({ confirm: false, cancel: true });
  13427. } });
  13428. });
  13429. }({ title: "提示", content: e3, showCancel: i2.retry, cancelText: "取消", confirmText: i2.retry ? "重试" : "确定" });
  13430. if (i2.retry && t3)
  13431. return s4(...u2);
  13432. }
  13433. }
  13434. const n3 = new ne({ subject: f2, code: g2, message: m2, requestId: l2.requestId });
  13435. throw n3.detail = l2.result, Q(B, { type: H, content: n3 }), n3;
  13436. }
  13437. return Q(B, { type: H, content: l2.result }), l2.result;
  13438. }, interceptorName: "callObject", getCallbackArgs: function({ params: e3 } = {}) {
  13439. return { objectName: t2, methodName: c2, params: e3 };
  13440. } }) });
  13441. };
  13442. }
  13443. function Cs(e2) {
  13444. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e2.config.spaceId));
  13445. }
  13446. async function Ts({ openid: e2, callLoginByWeixin: t2 = false } = {}) {
  13447. const n2 = Cs(this);
  13448. if (e2 && t2)
  13449. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  13450. if (e2)
  13451. return n2.mpWeixinOpenid = e2, {};
  13452. const s2 = await new Promise((e3, t3) => {
  13453. index.login({ success(t4) {
  13454. e3(t4.code);
  13455. }, fail(e4) {
  13456. t3(new Error(e4.errMsg));
  13457. } });
  13458. }), r2 = this.importObject("uni-id-co", { customUI: true });
  13459. return await r2.secureNetworkHandshakeByWeixin({ code: s2, callLoginByWeixin: t2 }), n2.mpWeixinCode = s2, { code: s2 };
  13460. }
  13461. async function Ps(e2) {
  13462. const t2 = Cs(this);
  13463. return t2.initPromise || (t2.initPromise = Ts.call(this, e2)), t2.initPromise;
  13464. }
  13465. function As(e2) {
  13466. return function({ openid: t2, callLoginByWeixin: n2 = false } = {}) {
  13467. return Ps.call(e2, { openid: t2, callLoginByWeixin: n2 });
  13468. };
  13469. }
  13470. function Es(e2) {
  13471. const t2 = { getSystemInfo: index.getSystemInfo, getPushClientId: index.getPushClientId };
  13472. return function(n2) {
  13473. return new Promise((s2, r2) => {
  13474. t2[e2]({ ...n2, success(e3) {
  13475. s2(e3);
  13476. }, fail(e3) {
  13477. r2(e3);
  13478. } });
  13479. });
  13480. };
  13481. }
  13482. class Os extends class {
  13483. constructor() {
  13484. this._callback = {};
  13485. }
  13486. addListener(e2, t2) {
  13487. this._callback[e2] || (this._callback[e2] = []), this._callback[e2].push(t2);
  13488. }
  13489. on(e2, t2) {
  13490. return this.addListener(e2, t2);
  13491. }
  13492. removeListener(e2, t2) {
  13493. if (!t2)
  13494. throw new Error('The "listener" argument must be of type function. Received undefined');
  13495. const n2 = this._callback[e2];
  13496. if (!n2)
  13497. return;
  13498. const s2 = function(e3, t3) {
  13499. for (let n3 = e3.length - 1; n3 >= 0; n3--)
  13500. if (e3[n3] === t3)
  13501. return n3;
  13502. return -1;
  13503. }(n2, t2);
  13504. n2.splice(s2, 1);
  13505. }
  13506. off(e2, t2) {
  13507. return this.removeListener(e2, t2);
  13508. }
  13509. removeAllListener(e2) {
  13510. delete this._callback[e2];
  13511. }
  13512. emit(e2, ...t2) {
  13513. const n2 = this._callback[e2];
  13514. if (n2)
  13515. for (let e3 = 0; e3 < n2.length; e3++)
  13516. n2[e3](...t2);
  13517. }
  13518. } {
  13519. constructor() {
  13520. super(), this._uniPushMessageCallback = this._receivePushMessage.bind(this), this._currentMessageId = -1, this._payloadQueue = [];
  13521. }
  13522. init() {
  13523. return Promise.all([Es("getSystemInfo")(), Es("getPushClientId")()]).then(([{ appId: e2 } = {}, { cid: t2 } = {}] = []) => {
  13524. if (!e2)
  13525. throw new Error("Invalid appId, please check the manifest.json file");
  13526. if (!t2)
  13527. throw new Error("Invalid push client id");
  13528. this._appId = e2, this._pushClientId = t2, this._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), this.emit("open"), this._initMessageListener();
  13529. }, (e2) => {
  13530. throw this.emit("error", e2), this.close(), e2;
  13531. });
  13532. }
  13533. async open() {
  13534. return this.init();
  13535. }
  13536. _isUniCloudSSE(e2) {
  13537. if ("receive" !== e2.type)
  13538. return false;
  13539. const t2 = e2 && e2.data && e2.data.payload;
  13540. return !(!t2 || "UNI_CLOUD_SSE" !== t2.channel || t2.seqId !== this._seqId);
  13541. }
  13542. _receivePushMessage(e2) {
  13543. if (!this._isUniCloudSSE(e2))
  13544. return;
  13545. const t2 = e2 && e2.data && e2.data.payload, { action: n2, messageId: s2, message: r2 } = t2;
  13546. this._payloadQueue.push({ action: n2, messageId: s2, message: r2 }), this._consumMessage();
  13547. }
  13548. _consumMessage() {
  13549. for (; ; ) {
  13550. const e2 = this._payloadQueue.find((e3) => e3.messageId === this._currentMessageId + 1);
  13551. if (!e2)
  13552. break;
  13553. this._currentMessageId++, this._parseMessagePayload(e2);
  13554. }
  13555. }
  13556. _parseMessagePayload(e2) {
  13557. const { action: t2, messageId: n2, message: s2 } = e2;
  13558. "end" === t2 ? this._end({ messageId: n2, message: s2 }) : "message" === t2 && this._appendMessage({ messageId: n2, message: s2 });
  13559. }
  13560. _appendMessage({ messageId: e2, message: t2 } = {}) {
  13561. this.emit("message", t2);
  13562. }
  13563. _end({ messageId: e2, message: t2 } = {}) {
  13564. this.emit("end", t2), this.close();
  13565. }
  13566. _initMessageListener() {
  13567. index.onPushMessage(this._uniPushMessageCallback);
  13568. }
  13569. _destroy() {
  13570. index.offPushMessage(this._uniPushMessageCallback);
  13571. }
  13572. toJSON() {
  13573. return { appId: this._appId, pushClientId: this._pushClientId, seqId: this._seqId };
  13574. }
  13575. close() {
  13576. this._destroy(), this.emit("close");
  13577. }
  13578. }
  13579. async function xs(e2, t2) {
  13580. const n2 = `http://${e2}:${t2}/system/ping`;
  13581. try {
  13582. const e3 = await (s2 = { url: n2, timeout: 500 }, new Promise((e4, t3) => {
  13583. se.request({ ...s2, success(t4) {
  13584. e4(t4);
  13585. }, fail(e5) {
  13586. t3(e5);
  13587. } });
  13588. }));
  13589. return !(!e3.data || 0 !== e3.data.code);
  13590. } catch (e3) {
  13591. return false;
  13592. }
  13593. var s2;
  13594. }
  13595. async function Rs(e2) {
  13596. const t2 = e2.__dev__;
  13597. if (!t2.debugInfo)
  13598. return;
  13599. const { address: n2, servePort: s2 } = t2.debugInfo, { address: r2 } = await async function(e3, t3) {
  13600. let n3;
  13601. for (let s3 = 0; s3 < e3.length; s3++) {
  13602. const r3 = e3[s3];
  13603. if (await xs(r3, t3)) {
  13604. n3 = r3;
  13605. break;
  13606. }
  13607. }
  13608. return { address: n3, port: t3 };
  13609. }(n2, s2);
  13610. if (r2)
  13611. return t2.localAddress = r2, void (t2.localPort = s2);
  13612. const i2 = console["warn"];
  13613. let o2 = "";
  13614. if ("remote" === t2.debugInfo.initialLaunchType ? (t2.debugInfo.forceRemote = true, o2 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o2 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o2 += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", 0 === P.indexOf("mp-") && (o2 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t2.debugInfo.forceRemote)
  13615. throw new Error(o2);
  13616. i2(o2);
  13617. }
  13618. function Us(e2) {
  13619. e2._initPromiseHub || (e2._initPromiseHub = new I({ createPromise: function() {
  13620. let t2 = Promise.resolve();
  13621. var n2;
  13622. n2 = 1, t2 = new Promise((e3) => {
  13623. setTimeout(() => {
  13624. e3();
  13625. }, n2);
  13626. });
  13627. const s2 = e2.auth();
  13628. return t2.then(() => s2.getLoginState()).then((e3) => e3 ? Promise.resolve() : s2.signInAnonymously());
  13629. } }));
  13630. }
  13631. const Ls = { tcb: St, tencent: St, aliyun: me, private: kt };
  13632. let Ns = new class {
  13633. init(e2) {
  13634. let t2 = {};
  13635. const n2 = Ls[e2.provider];
  13636. if (!n2)
  13637. throw new Error("未提供正确的provider参数");
  13638. t2 = n2.init(e2), function(e3) {
  13639. const t3 = {};
  13640. e3.__dev__ = t3, t3.debugLog = "app" === P;
  13641. const n3 = A;
  13642. n3 && !n3.code && (t3.debugInfo = n3);
  13643. const s2 = new I({ createPromise: function() {
  13644. return Rs(e3);
  13645. } });
  13646. t3.initLocalNetwork = function() {
  13647. return s2.exec();
  13648. };
  13649. }(t2), Us(t2), Rn(t2), function(e3) {
  13650. const t3 = e3.uploadFile;
  13651. e3.uploadFile = function(e4) {
  13652. return t3.call(this, e4);
  13653. };
  13654. }(t2), function(e3) {
  13655. e3.database = function(t3) {
  13656. if (t3 && Object.keys(t3).length > 0)
  13657. return e3.init(t3).database();
  13658. if (this._database)
  13659. return this._database;
  13660. const n3 = $n(Wn, { uniClient: e3 });
  13661. return this._database = n3, n3;
  13662. }, e3.databaseForJQL = function(t3) {
  13663. if (t3 && Object.keys(t3).length > 0)
  13664. return e3.init(t3).databaseForJQL();
  13665. if (this._databaseForJQL)
  13666. return this._databaseForJQL;
  13667. const n3 = $n(Wn, { uniClient: e3, isJQL: true });
  13668. return this._databaseForJQL = n3, n3;
  13669. };
  13670. }(t2), function(e3) {
  13671. e3.getCurrentUserInfo = ws, e3.chooseAndUploadFile = Is.initChooseAndUploadFile(e3), Object.assign(e3, { get mixinDatacom() {
  13672. return bs(e3);
  13673. } }), e3.SSEChannel = Os, e3.initSecureNetworkByWeixin = As(e3), e3.importObject = ks(e3);
  13674. }(t2);
  13675. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach((e3) => {
  13676. if (!t2[e3])
  13677. return;
  13678. const n3 = t2[e3];
  13679. t2[e3] = function() {
  13680. return n3.apply(t2, Array.from(arguments));
  13681. }, t2[e3] = function(e4, t3) {
  13682. return function(n4) {
  13683. let s2 = false;
  13684. if ("callFunction" === t3) {
  13685. const e5 = n4 && n4.type || u;
  13686. s2 = e5 !== u;
  13687. }
  13688. const r2 = "callFunction" === t3 && !s2, i2 = this._initPromiseHub.exec();
  13689. n4 = n4 || {};
  13690. const { success: o2, fail: a2, complete: c2 } = te(n4), h2 = i2.then(() => s2 ? Promise.resolve() : M(q(t3, "invoke"), n4)).then(() => e4.call(this, n4)).then((e5) => s2 ? Promise.resolve(e5) : M(q(t3, "success"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (r2 && Q(B, { type: J, content: e5 }), Promise.resolve(e5))), (e5) => s2 ? Promise.reject(e5) : M(q(t3, "fail"), e5).then(() => M(q(t3, "complete"), e5)).then(() => (Q(B, { type: J, content: e5 }), Promise.reject(e5))));
  13691. if (!(o2 || a2 || c2))
  13692. return h2;
  13693. h2.then((e5) => {
  13694. o2 && o2(e5), c2 && c2(e5), r2 && Q(B, { type: J, content: e5 });
  13695. }, (e5) => {
  13696. a2 && a2(e5), c2 && c2(e5), r2 && Q(B, { type: J, content: e5 });
  13697. });
  13698. };
  13699. }(t2[e3], e3).bind(t2);
  13700. }), t2.init = this.init, t2;
  13701. }
  13702. }();
  13703. (() => {
  13704. const e2 = E;
  13705. let t2 = {};
  13706. if (e2 && 1 === e2.length)
  13707. t2 = e2[0], Ns = Ns.init(t2), Ns._isDefault = true;
  13708. else {
  13709. const t3 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  13710. let n2;
  13711. n2 = e2 && e2.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : "应用未关联服务空间,请在uniCloud目录右键关联服务空间", t3.forEach((e3) => {
  13712. Ns[e3] = function() {
  13713. return console.error(n2), Promise.reject(new ne({ code: "SYS_ERR", message: n2 }));
  13714. };
  13715. });
  13716. }
  13717. Object.assign(Ns, { get mixinDatacom() {
  13718. return bs(Ns);
  13719. } }), gs(Ns), Ns.addInterceptor = D, Ns.removeInterceptor = F, Ns.interceptObject = K;
  13720. })();
  13721. var Ds = Ns;
  13722. exports.Ds = Ds;
  13723. exports._export_sfc = _export_sfc;
  13724. exports.computed = computed;
  13725. exports.createSSRApp = createSSRApp;
  13726. exports.defineComponent = defineComponent;
  13727. exports.e = e;
  13728. exports.f = f$1;
  13729. exports.getCurrentInstance = getCurrentInstance;
  13730. exports.hooks = hooks;
  13731. exports.index = index;
  13732. exports.initVueI18n = initVueI18n;
  13733. exports.n = n$1;
  13734. exports.o = o$1;
  13735. exports.onLoad = onLoad;
  13736. exports.onPullDownRefresh = onPullDownRefresh;
  13737. exports.onShow = onShow;
  13738. exports.p = p$1;
  13739. exports.ref = ref;
  13740. exports.resolveComponent = resolveComponent;
  13741. exports.s = s$1;
  13742. exports.sr = sr;
  13743. exports.t = t$1;
  13744. exports.toRefs = toRefs;
  13745. exports.unref = unref;
  13746. exports.wx$1 = wx$1;