vendor.js 221 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213
  1. "use strict";
  2. var _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 map = /* @__PURE__ */ Object.create(null);
  11. const list = str.split(",");
  12. for (let i = 0; i < list.length; i++) {
  13. map[list[i]] = true;
  14. }
  15. return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
  16. }
  17. function normalizeStyle(value) {
  18. if (isArray(value)) {
  19. const res = {};
  20. for (let i = 0; i < value.length; i++) {
  21. const item = value[i];
  22. const normalized = isString(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(value)) {
  31. return value;
  32. } else if (isObject$1(value)) {
  33. return value;
  34. }
  35. }
  36. const listDelimiterRE = /;(?![^(]*\))/g;
  37. const propertyDelimiterRE = /:(.+)/;
  38. function parseStringStyle(cssText) {
  39. const ret = {};
  40. cssText.split(listDelimiterRE).forEach((item) => {
  41. if (item) {
  42. const tmp = item.split(propertyDelimiterRE);
  43. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  44. }
  45. });
  46. return ret;
  47. }
  48. function normalizeClass(value) {
  49. let res = "";
  50. if (isString(value)) {
  51. res = value;
  52. } else if (isArray(value)) {
  53. for (let i = 0; i < value.length; i++) {
  54. const normalized = normalizeClass(value[i]);
  55. if (normalized) {
  56. res += normalized + " ";
  57. }
  58. }
  59. } else if (isObject$1(value)) {
  60. for (const name in value) {
  61. if (value[name]) {
  62. res += name + " ";
  63. }
  64. }
  65. }
  66. return res.trim();
  67. }
  68. const toDisplayString = (val) => {
  69. return isString(val) ? val : val == null ? "" : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  70. };
  71. const replacer = (_key, val) => {
  72. if (val && val.__v_isRef) {
  73. return replacer(_key, val.value);
  74. } else if (isMap(val)) {
  75. return {
  76. [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
  77. entries[`${key} =>`] = val2;
  78. return entries;
  79. }, {})
  80. };
  81. } else if (isSet(val)) {
  82. return {
  83. [`Set(${val.size})`]: [...val.values()]
  84. };
  85. } else if (isObject$1(val) && !isArray(val) && !isPlainObject(val)) {
  86. return String(val);
  87. }
  88. return val;
  89. };
  90. const EMPTY_OBJ = Object.freeze({});
  91. const EMPTY_ARR = Object.freeze([]);
  92. const NOOP = () => {
  93. };
  94. const NO = () => false;
  95. const onRE = /^on[^a-z]/;
  96. const isOn = (key) => onRE.test(key);
  97. const isModelListener = (key) => key.startsWith("onUpdate:");
  98. const extend = Object.assign;
  99. const remove = (arr, el) => {
  100. const i = arr.indexOf(el);
  101. if (i > -1) {
  102. arr.splice(i, 1);
  103. }
  104. };
  105. const hasOwnProperty = Object.prototype.hasOwnProperty;
  106. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  107. const isArray = Array.isArray;
  108. const isMap = (val) => toTypeString(val) === "[object Map]";
  109. const isSet = (val) => toTypeString(val) === "[object Set]";
  110. const isFunction = (val) => typeof val === "function";
  111. const isString = (val) => typeof val === "string";
  112. const isSymbol = (val) => typeof val === "symbol";
  113. const isObject$1 = (val) => val !== null && typeof val === "object";
  114. const isPromise$1 = (val) => {
  115. return isObject$1(val) && isFunction(val.then) && isFunction(val.catch);
  116. };
  117. const objectToString = Object.prototype.toString;
  118. const toTypeString = (value) => objectToString.call(value);
  119. const toRawType = (value) => {
  120. return toTypeString(value).slice(8, -1);
  121. };
  122. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  123. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  124. const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
  125. const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
  126. const cacheStringFunction = (fn) => {
  127. const cache = /* @__PURE__ */ Object.create(null);
  128. return (str) => {
  129. const hit = cache[str];
  130. return hit || (cache[str] = fn(str));
  131. };
  132. };
  133. const camelizeRE = /-(\w)/g;
  134. const camelize = cacheStringFunction((str) => {
  135. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  136. });
  137. const hyphenateRE = /\B([A-Z])/g;
  138. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  139. const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
  140. const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);
  141. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  142. const invokeArrayFns$1 = (fns, arg) => {
  143. for (let i = 0; i < fns.length; i++) {
  144. fns[i](arg);
  145. }
  146. };
  147. const def = (obj, key, value) => {
  148. Object.defineProperty(obj, key, {
  149. configurable: true,
  150. enumerable: false,
  151. value
  152. });
  153. };
  154. const toNumber = (val) => {
  155. const n2 = parseFloat(val);
  156. return isNaN(n2) ? val : n2;
  157. };
  158. const LINEFEED = "\n";
  159. const SLOT_DEFAULT_NAME = "d";
  160. const ON_SHOW = "onShow";
  161. const ON_HIDE = "onHide";
  162. const ON_LAUNCH = "onLaunch";
  163. const ON_ERROR = "onError";
  164. const ON_THEME_CHANGE = "onThemeChange";
  165. const ON_PAGE_NOT_FOUND = "onPageNotFound";
  166. const ON_UNHANDLE_REJECTION = "onUnhandledRejection";
  167. const ON_LOAD = "onLoad";
  168. const ON_READY = "onReady";
  169. const ON_UNLOAD = "onUnload";
  170. const ON_INIT = "onInit";
  171. const ON_SAVE_EXIT_STATE = "onSaveExitState";
  172. const ON_RESIZE = "onResize";
  173. const ON_BACK_PRESS = "onBackPress";
  174. const ON_PAGE_SCROLL = "onPageScroll";
  175. const ON_TAB_ITEM_TAP = "onTabItemTap";
  176. const ON_REACH_BOTTOM = "onReachBottom";
  177. const ON_PULL_DOWN_REFRESH = "onPullDownRefresh";
  178. const ON_SHARE_TIMELINE = "onShareTimeline";
  179. const ON_ADD_TO_FAVORITES = "onAddToFavorites";
  180. const ON_SHARE_APP_MESSAGE = "onShareAppMessage";
  181. const ON_NAVIGATION_BAR_BUTTON_TAP = "onNavigationBarButtonTap";
  182. const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = "onNavigationBarSearchInputClicked";
  183. const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = "onNavigationBarSearchInputChanged";
  184. const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = "onNavigationBarSearchInputConfirmed";
  185. const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = "onNavigationBarSearchInputFocusChanged";
  186. const customizeRE = /:/g;
  187. function customizeEvent(str) {
  188. return camelize(str.replace(customizeRE, "-"));
  189. }
  190. function hasLeadingSlash(str) {
  191. return str.indexOf("/") === 0;
  192. }
  193. function addLeadingSlash(str) {
  194. return hasLeadingSlash(str) ? str : "/" + str;
  195. }
  196. const invokeArrayFns = (fns, arg) => {
  197. let ret;
  198. for (let i = 0; i < fns.length; i++) {
  199. ret = fns[i](arg);
  200. }
  201. return ret;
  202. };
  203. function once(fn, ctx = null) {
  204. let res;
  205. return (...args) => {
  206. if (fn) {
  207. res = fn.apply(ctx, args);
  208. fn = null;
  209. }
  210. return res;
  211. };
  212. }
  213. function getValueByDataPath(obj, path) {
  214. if (!isString(path)) {
  215. return;
  216. }
  217. path = path.replace(/\[(\d+)\]/g, ".$1");
  218. const parts = path.split(".");
  219. let key = parts[0];
  220. if (!obj) {
  221. obj = {};
  222. }
  223. if (parts.length === 1) {
  224. return obj[key];
  225. }
  226. return getValueByDataPath(obj[key], parts.slice(1).join("."));
  227. }
  228. function sortObject(obj) {
  229. let sortObj = {};
  230. if (isPlainObject(obj)) {
  231. Object.keys(obj).sort().forEach((key) => {
  232. const _key = key;
  233. sortObj[_key] = obj[_key];
  234. });
  235. }
  236. return !Object.keys(sortObj) ? obj : sortObj;
  237. }
  238. const encode = encodeURIComponent;
  239. function stringifyQuery(obj, encodeStr = encode) {
  240. const res = obj ? Object.keys(obj).map((key) => {
  241. let val = obj[key];
  242. if (typeof val === void 0 || val === null) {
  243. val = "";
  244. } else if (isPlainObject(val)) {
  245. val = JSON.stringify(val);
  246. }
  247. return encodeStr(key) + "=" + encodeStr(val);
  248. }).filter((x) => x.length > 0).join("&") : null;
  249. return res ? `?${res}` : "";
  250. }
  251. const PAGE_HOOKS = [
  252. ON_INIT,
  253. ON_LOAD,
  254. ON_SHOW,
  255. ON_HIDE,
  256. ON_UNLOAD,
  257. ON_BACK_PRESS,
  258. ON_PAGE_SCROLL,
  259. ON_TAB_ITEM_TAP,
  260. ON_REACH_BOTTOM,
  261. ON_PULL_DOWN_REFRESH,
  262. ON_SHARE_TIMELINE,
  263. ON_SHARE_APP_MESSAGE,
  264. ON_ADD_TO_FAVORITES,
  265. ON_SAVE_EXIT_STATE,
  266. ON_NAVIGATION_BAR_BUTTON_TAP,
  267. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  268. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  269. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  270. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  271. ];
  272. function isRootHook(name) {
  273. return PAGE_HOOKS.indexOf(name) > -1;
  274. }
  275. const UniLifecycleHooks = [
  276. ON_SHOW,
  277. ON_HIDE,
  278. ON_LAUNCH,
  279. ON_ERROR,
  280. ON_THEME_CHANGE,
  281. ON_PAGE_NOT_FOUND,
  282. ON_UNHANDLE_REJECTION,
  283. ON_INIT,
  284. ON_LOAD,
  285. ON_READY,
  286. ON_UNLOAD,
  287. ON_RESIZE,
  288. ON_BACK_PRESS,
  289. ON_PAGE_SCROLL,
  290. ON_TAB_ITEM_TAP,
  291. ON_REACH_BOTTOM,
  292. ON_PULL_DOWN_REFRESH,
  293. ON_SHARE_TIMELINE,
  294. ON_ADD_TO_FAVORITES,
  295. ON_SHARE_APP_MESSAGE,
  296. ON_SAVE_EXIT_STATE,
  297. ON_NAVIGATION_BAR_BUTTON_TAP,
  298. ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
  299. ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
  300. ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
  301. ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
  302. ];
  303. const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /* @__PURE__ */ (() => {
  304. return {
  305. onPageScroll: 1,
  306. onShareAppMessage: 1 << 1,
  307. onShareTimeline: 1 << 2
  308. };
  309. })();
  310. let vueApp;
  311. const createVueAppHooks = [];
  312. function onCreateVueApp(hook) {
  313. if (vueApp) {
  314. return hook(vueApp);
  315. }
  316. createVueAppHooks.push(hook);
  317. }
  318. function invokeCreateVueAppHook(app) {
  319. vueApp = app;
  320. createVueAppHooks.forEach((hook) => hook(app));
  321. }
  322. const E = function() {
  323. };
  324. E.prototype = {
  325. on: function(name, callback, ctx) {
  326. var e2 = this.e || (this.e = {});
  327. (e2[name] || (e2[name] = [])).push({
  328. fn: callback,
  329. ctx
  330. });
  331. return this;
  332. },
  333. once: function(name, callback, ctx) {
  334. var self2 = this;
  335. function listener() {
  336. self2.off(name, listener);
  337. callback.apply(ctx, arguments);
  338. }
  339. listener._ = callback;
  340. return this.on(name, listener, ctx);
  341. },
  342. emit: function(name) {
  343. var data = [].slice.call(arguments, 1);
  344. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  345. var i = 0;
  346. var len = evtArr.length;
  347. for (i; i < len; i++) {
  348. evtArr[i].fn.apply(evtArr[i].ctx, data);
  349. }
  350. return this;
  351. },
  352. off: function(name, callback) {
  353. var e2 = this.e || (this.e = {});
  354. var evts = e2[name];
  355. var liveEvents = [];
  356. if (evts && callback) {
  357. for (var i = 0, len = evts.length; i < len; i++) {
  358. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  359. liveEvents.push(evts[i]);
  360. }
  361. }
  362. liveEvents.length ? e2[name] = liveEvents : delete e2[name];
  363. return this;
  364. }
  365. };
  366. var E$1 = E;
  367. const LOCALE_ZH_HANS = "zh-Hans";
  368. const LOCALE_ZH_HANT = "zh-Hant";
  369. const LOCALE_EN = "en";
  370. const LOCALE_FR = "fr";
  371. const LOCALE_ES = "es";
  372. function include(str, parts) {
  373. return !!parts.find((part) => str.indexOf(part) !== -1);
  374. }
  375. function startsWith(str, parts) {
  376. return parts.find((part) => str.indexOf(part) === 0);
  377. }
  378. function normalizeLocale(locale, messages) {
  379. if (!locale) {
  380. return;
  381. }
  382. locale = locale.trim().replace(/_/g, "-");
  383. if (messages && messages[locale]) {
  384. return locale;
  385. }
  386. locale = locale.toLowerCase();
  387. if (locale === "chinese") {
  388. return LOCALE_ZH_HANS;
  389. }
  390. if (locale.indexOf("zh") === 0) {
  391. if (locale.indexOf("-hans") > -1) {
  392. return LOCALE_ZH_HANS;
  393. }
  394. if (locale.indexOf("-hant") > -1) {
  395. return LOCALE_ZH_HANT;
  396. }
  397. if (include(locale, ["-tw", "-hk", "-mo", "-cht"])) {
  398. return LOCALE_ZH_HANT;
  399. }
  400. return LOCALE_ZH_HANS;
  401. }
  402. const lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  403. if (lang) {
  404. return lang;
  405. }
  406. }
  407. function getBaseSystemInfo() {
  408. return wx.getSystemInfoSync();
  409. }
  410. function validateProtocolFail(name, msg) {
  411. console.warn(`${name}: ${msg}`);
  412. }
  413. function validateProtocol(name, data, protocol, onFail) {
  414. if (!onFail) {
  415. onFail = validateProtocolFail;
  416. }
  417. for (const key in protocol) {
  418. const errMsg = validateProp$1(key, data[key], protocol[key], !hasOwn(data, key));
  419. if (isString(errMsg)) {
  420. onFail(name, errMsg);
  421. }
  422. }
  423. }
  424. function validateProtocols(name, args, protocol, onFail) {
  425. if (!protocol) {
  426. return;
  427. }
  428. if (!isArray(protocol)) {
  429. return validateProtocol(name, args[0] || /* @__PURE__ */ Object.create(null), protocol, onFail);
  430. }
  431. const len = protocol.length;
  432. const argsLen = args.length;
  433. for (let i = 0; i < len; i++) {
  434. const opts = protocol[i];
  435. const data = /* @__PURE__ */ Object.create(null);
  436. if (argsLen > i) {
  437. data[opts.name] = args[i];
  438. }
  439. validateProtocol(name, data, { [opts.name]: opts }, onFail);
  440. }
  441. }
  442. function validateProp$1(name, value, prop, isAbsent) {
  443. if (!isPlainObject(prop)) {
  444. prop = { type: prop };
  445. }
  446. const { type, required, validator } = prop;
  447. if (required && isAbsent) {
  448. return 'Missing required args: "' + name + '"';
  449. }
  450. if (value == null && !required) {
  451. return;
  452. }
  453. if (type != null) {
  454. let isValid = false;
  455. const types = isArray(type) ? type : [type];
  456. const expectedTypes = [];
  457. for (let i = 0; i < types.length && !isValid; i++) {
  458. const { valid, expectedType } = assertType$1(value, types[i]);
  459. expectedTypes.push(expectedType || "");
  460. isValid = valid;
  461. }
  462. if (!isValid) {
  463. return getInvalidTypeMessage$1(name, value, expectedTypes);
  464. }
  465. }
  466. if (validator) {
  467. return validator(value);
  468. }
  469. }
  470. const isSimpleType$1 = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol");
  471. function assertType$1(value, type) {
  472. let valid;
  473. const expectedType = getType$1(type);
  474. if (isSimpleType$1(expectedType)) {
  475. const t2 = typeof value;
  476. valid = t2 === expectedType.toLowerCase();
  477. if (!valid && t2 === "object") {
  478. valid = value instanceof type;
  479. }
  480. } else if (expectedType === "Object") {
  481. valid = isObject$1(value);
  482. } else if (expectedType === "Array") {
  483. valid = isArray(value);
  484. } else {
  485. {
  486. valid = value instanceof type;
  487. }
  488. }
  489. return {
  490. valid,
  491. expectedType
  492. };
  493. }
  494. function getInvalidTypeMessage$1(name, value, expectedTypes) {
  495. let message = `Invalid args: type check failed for args "${name}". Expected ${expectedTypes.map(capitalize).join(", ")}`;
  496. const expectedType = expectedTypes[0];
  497. const receivedType = toRawType(value);
  498. const expectedValue = styleValue$1(value, expectedType);
  499. const receivedValue = styleValue$1(value, receivedType);
  500. if (expectedTypes.length === 1 && isExplicable$1(expectedType) && !isBoolean$1(expectedType, receivedType)) {
  501. message += ` with value ${expectedValue}`;
  502. }
  503. message += `, got ${receivedType} `;
  504. if (isExplicable$1(receivedType)) {
  505. message += `with value ${receivedValue}.`;
  506. }
  507. return message;
  508. }
  509. function getType$1(ctor) {
  510. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  511. return match ? match[1] : "";
  512. }
  513. function styleValue$1(value, type) {
  514. if (type === "String") {
  515. return `"${value}"`;
  516. } else if (type === "Number") {
  517. return `${Number(value)}`;
  518. } else {
  519. return `${value}`;
  520. }
  521. }
  522. function isExplicable$1(type) {
  523. const explicitTypes = ["string", "number", "boolean"];
  524. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  525. }
  526. function isBoolean$1(...args) {
  527. return args.some((elem) => elem.toLowerCase() === "boolean");
  528. }
  529. function tryCatch(fn) {
  530. return function() {
  531. try {
  532. return fn.apply(fn, arguments);
  533. } catch (e2) {
  534. console.error(e2);
  535. }
  536. };
  537. }
  538. let invokeCallbackId = 1;
  539. const invokeCallbacks = {};
  540. function addInvokeCallback(id, name, callback, keepAlive = false) {
  541. invokeCallbacks[id] = {
  542. name,
  543. keepAlive,
  544. callback
  545. };
  546. return id;
  547. }
  548. function invokeCallback(id, res, extras) {
  549. if (typeof id === "number") {
  550. const opts = invokeCallbacks[id];
  551. if (opts) {
  552. if (!opts.keepAlive) {
  553. delete invokeCallbacks[id];
  554. }
  555. return opts.callback(res, extras);
  556. }
  557. }
  558. return res;
  559. }
  560. const API_SUCCESS = "success";
  561. const API_FAIL = "fail";
  562. const API_COMPLETE = "complete";
  563. function getApiCallbacks(args) {
  564. const apiCallbacks = {};
  565. for (const name in args) {
  566. const fn = args[name];
  567. if (isFunction(fn)) {
  568. apiCallbacks[name] = tryCatch(fn);
  569. delete args[name];
  570. }
  571. }
  572. return apiCallbacks;
  573. }
  574. function normalizeErrMsg$1(errMsg, name) {
  575. if (!errMsg || errMsg.indexOf(":fail") === -1) {
  576. return name + ":ok";
  577. }
  578. return name + errMsg.substring(errMsg.indexOf(":fail"));
  579. }
  580. function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } = {}) {
  581. if (!isPlainObject(args)) {
  582. args = {};
  583. }
  584. const { success, fail, complete } = getApiCallbacks(args);
  585. const hasSuccess = isFunction(success);
  586. const hasFail = isFunction(fail);
  587. const hasComplete = isFunction(complete);
  588. const callbackId = invokeCallbackId++;
  589. addInvokeCallback(callbackId, name, (res) => {
  590. res = res || {};
  591. res.errMsg = normalizeErrMsg$1(res.errMsg, name);
  592. isFunction(beforeAll) && beforeAll(res);
  593. if (res.errMsg === name + ":ok") {
  594. isFunction(beforeSuccess) && beforeSuccess(res, args);
  595. hasSuccess && success(res);
  596. } else {
  597. hasFail && fail(res);
  598. }
  599. hasComplete && complete(res);
  600. });
  601. return callbackId;
  602. }
  603. const HOOK_SUCCESS = "success";
  604. const HOOK_FAIL = "fail";
  605. const HOOK_COMPLETE = "complete";
  606. const globalInterceptors = {};
  607. const scopedInterceptors = {};
  608. function wrapperHook(hook) {
  609. return function(data) {
  610. return hook(data) || data;
  611. };
  612. }
  613. function queue$1(hooks, data) {
  614. let promise = false;
  615. for (let i = 0; i < hooks.length; i++) {
  616. const hook = hooks[i];
  617. if (promise) {
  618. promise = Promise.resolve(wrapperHook(hook));
  619. } else {
  620. const res = hook(data);
  621. if (isPromise$1(res)) {
  622. promise = Promise.resolve(res);
  623. }
  624. if (res === false) {
  625. return {
  626. then() {
  627. },
  628. catch() {
  629. }
  630. };
  631. }
  632. }
  633. }
  634. return promise || {
  635. then(callback) {
  636. return callback(data);
  637. },
  638. catch() {
  639. }
  640. };
  641. }
  642. function wrapperOptions(interceptors2, options = {}) {
  643. [HOOK_SUCCESS, HOOK_FAIL, HOOK_COMPLETE].forEach((name) => {
  644. const hooks = interceptors2[name];
  645. if (!isArray(hooks)) {
  646. return;
  647. }
  648. const oldCallback = options[name];
  649. options[name] = function callbackInterceptor(res) {
  650. queue$1(hooks, res).then((res2) => {
  651. return isFunction(oldCallback) && oldCallback(res2) || res2;
  652. });
  653. };
  654. });
  655. return options;
  656. }
  657. function wrapperReturnValue(method, returnValue) {
  658. const returnValueHooks = [];
  659. if (isArray(globalInterceptors.returnValue)) {
  660. returnValueHooks.push(...globalInterceptors.returnValue);
  661. }
  662. const interceptor = scopedInterceptors[method];
  663. if (interceptor && isArray(interceptor.returnValue)) {
  664. returnValueHooks.push(...interceptor.returnValue);
  665. }
  666. returnValueHooks.forEach((hook) => {
  667. returnValue = hook(returnValue) || returnValue;
  668. });
  669. return returnValue;
  670. }
  671. function getApiInterceptorHooks(method) {
  672. const interceptor = /* @__PURE__ */ Object.create(null);
  673. Object.keys(globalInterceptors).forEach((hook) => {
  674. if (hook !== "returnValue") {
  675. interceptor[hook] = globalInterceptors[hook].slice();
  676. }
  677. });
  678. const scopedInterceptor = scopedInterceptors[method];
  679. if (scopedInterceptor) {
  680. Object.keys(scopedInterceptor).forEach((hook) => {
  681. if (hook !== "returnValue") {
  682. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  683. }
  684. });
  685. }
  686. return interceptor;
  687. }
  688. function invokeApi(method, api, options, params) {
  689. const interceptor = getApiInterceptorHooks(method);
  690. if (interceptor && Object.keys(interceptor).length) {
  691. if (isArray(interceptor.invoke)) {
  692. const res = queue$1(interceptor.invoke, options);
  693. return res.then((options2) => {
  694. return api(wrapperOptions(interceptor, options2), ...params);
  695. });
  696. } else {
  697. return api(wrapperOptions(interceptor, options), ...params);
  698. }
  699. }
  700. return api(options, ...params);
  701. }
  702. function hasCallback(args) {
  703. if (isPlainObject(args) && [API_SUCCESS, API_FAIL, API_COMPLETE].find((cb) => isFunction(args[cb]))) {
  704. return true;
  705. }
  706. return false;
  707. }
  708. function handlePromise(promise) {
  709. return promise;
  710. }
  711. function promisify$1(name, fn) {
  712. return (args = {}, ...rest) => {
  713. if (hasCallback(args)) {
  714. return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
  715. }
  716. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  717. invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
  718. })));
  719. };
  720. }
  721. function formatApiArgs(args, options) {
  722. const params = args[0];
  723. if (!options || !isPlainObject(options.formatArgs) && isPlainObject(params)) {
  724. return;
  725. }
  726. const formatArgs = options.formatArgs;
  727. const keys = Object.keys(formatArgs);
  728. for (let i = 0; i < keys.length; i++) {
  729. const name = keys[i];
  730. const formatterOrDefaultValue = formatArgs[name];
  731. if (isFunction(formatterOrDefaultValue)) {
  732. const errMsg = formatterOrDefaultValue(args[0][name], params);
  733. if (isString(errMsg)) {
  734. return errMsg;
  735. }
  736. } else {
  737. if (!hasOwn(params, name)) {
  738. params[name] = formatterOrDefaultValue;
  739. }
  740. }
  741. }
  742. }
  743. function invokeSuccess(id, name, res) {
  744. return invokeCallback(id, extend(res || {}, { errMsg: name + ":ok" }));
  745. }
  746. function invokeFail(id, name, errMsg, errRes) {
  747. return invokeCallback(id, extend({ errMsg: name + ":fail" + (errMsg ? " " + errMsg : "") }, errRes));
  748. }
  749. function beforeInvokeApi(name, args, protocol, options) {
  750. {
  751. validateProtocols(name, args, protocol);
  752. }
  753. if (options && options.beforeInvoke) {
  754. const errMsg2 = options.beforeInvoke(args);
  755. if (isString(errMsg2)) {
  756. return errMsg2;
  757. }
  758. }
  759. const errMsg = formatApiArgs(args, options);
  760. if (errMsg) {
  761. return errMsg;
  762. }
  763. }
  764. function normalizeErrMsg(errMsg) {
  765. if (!errMsg || isString(errMsg)) {
  766. return errMsg;
  767. }
  768. if (errMsg.stack) {
  769. console.error(errMsg.message + LINEFEED + errMsg.stack);
  770. return errMsg.message;
  771. }
  772. return errMsg;
  773. }
  774. function wrapperTaskApi(name, fn, protocol, options) {
  775. return (args) => {
  776. const id = createAsyncApiCallback(name, args, options);
  777. const errMsg = beforeInvokeApi(name, [args], protocol, options);
  778. if (errMsg) {
  779. return invokeFail(id, name, errMsg);
  780. }
  781. return fn(args, {
  782. resolve: (res) => invokeSuccess(id, name, res),
  783. reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
  784. });
  785. };
  786. }
  787. function wrapperSyncApi(name, fn, protocol, options) {
  788. return (...args) => {
  789. const errMsg = beforeInvokeApi(name, args, protocol, options);
  790. if (errMsg) {
  791. throw new Error(errMsg);
  792. }
  793. return fn.apply(null, args);
  794. };
  795. }
  796. function wrapperAsyncApi(name, fn, protocol, options) {
  797. return wrapperTaskApi(name, fn, protocol, options);
  798. }
  799. function defineSyncApi(name, fn, protocol, options) {
  800. return wrapperSyncApi(name, fn, protocol, options);
  801. }
  802. function defineAsyncApi(name, fn, protocol, options) {
  803. return promisify$1(name, wrapperAsyncApi(name, fn, protocol, options));
  804. }
  805. const API_UPX2PX = "upx2px";
  806. const Upx2pxProtocol = [
  807. {
  808. name: "upx",
  809. type: [Number, String],
  810. required: true
  811. }
  812. ];
  813. const EPS = 1e-4;
  814. const BASE_DEVICE_WIDTH = 750;
  815. let isIOS = false;
  816. let deviceWidth = 0;
  817. let deviceDPR = 0;
  818. function checkDeviceWidth() {
  819. const { platform, pixelRatio, windowWidth } = getBaseSystemInfo();
  820. deviceWidth = windowWidth;
  821. deviceDPR = pixelRatio;
  822. isIOS = platform === "ios";
  823. }
  824. const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
  825. if (deviceWidth === 0) {
  826. checkDeviceWidth();
  827. }
  828. number = Number(number);
  829. if (number === 0) {
  830. return 0;
  831. }
  832. let width = newDeviceWidth || deviceWidth;
  833. let result = number / BASE_DEVICE_WIDTH * width;
  834. if (result < 0) {
  835. result = -result;
  836. }
  837. result = Math.floor(result + EPS);
  838. if (result === 0) {
  839. if (deviceDPR === 1 || !isIOS) {
  840. result = 1;
  841. } else {
  842. result = 0.5;
  843. }
  844. }
  845. return number < 0 ? -result : result;
  846. }, Upx2pxProtocol);
  847. const API_ADD_INTERCEPTOR = "addInterceptor";
  848. const API_REMOVE_INTERCEPTOR = "removeInterceptor";
  849. const AddInterceptorProtocol = [
  850. {
  851. name: "method",
  852. type: [String, Object],
  853. required: true
  854. }
  855. ];
  856. const RemoveInterceptorProtocol = AddInterceptorProtocol;
  857. function mergeInterceptorHook(interceptors2, interceptor) {
  858. Object.keys(interceptor).forEach((hook) => {
  859. if (isFunction(interceptor[hook])) {
  860. interceptors2[hook] = mergeHook(interceptors2[hook], interceptor[hook]);
  861. }
  862. });
  863. }
  864. function removeInterceptorHook(interceptors2, interceptor) {
  865. if (!interceptors2 || !interceptor) {
  866. return;
  867. }
  868. Object.keys(interceptor).forEach((name) => {
  869. const hooks = interceptors2[name];
  870. const hook = interceptor[name];
  871. if (isArray(hooks) && isFunction(hook)) {
  872. remove(hooks, hook);
  873. }
  874. });
  875. }
  876. function mergeHook(parentVal, childVal) {
  877. const res = childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
  878. return res ? dedupeHooks(res) : res;
  879. }
  880. function dedupeHooks(hooks) {
  881. const res = [];
  882. for (let i = 0; i < hooks.length; i++) {
  883. if (res.indexOf(hooks[i]) === -1) {
  884. res.push(hooks[i]);
  885. }
  886. }
  887. return res;
  888. }
  889. const addInterceptor = defineSyncApi(API_ADD_INTERCEPTOR, (method, interceptor) => {
  890. if (isString(method) && isPlainObject(interceptor)) {
  891. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), interceptor);
  892. } else if (isPlainObject(method)) {
  893. mergeInterceptorHook(globalInterceptors, method);
  894. }
  895. }, AddInterceptorProtocol);
  896. const removeInterceptor = defineSyncApi(API_REMOVE_INTERCEPTOR, (method, interceptor) => {
  897. if (isString(method)) {
  898. if (isPlainObject(interceptor)) {
  899. removeInterceptorHook(scopedInterceptors[method], interceptor);
  900. } else {
  901. delete scopedInterceptors[method];
  902. }
  903. } else if (isPlainObject(method)) {
  904. removeInterceptorHook(globalInterceptors, method);
  905. }
  906. }, RemoveInterceptorProtocol);
  907. const interceptors = {};
  908. const API_ON = "$on";
  909. const OnProtocol = [
  910. {
  911. name: "event",
  912. type: String,
  913. required: true
  914. },
  915. {
  916. name: "callback",
  917. type: Function,
  918. required: true
  919. }
  920. ];
  921. const API_ONCE = "$once";
  922. const OnceProtocol = OnProtocol;
  923. const API_OFF = "$off";
  924. const OffProtocol = [
  925. {
  926. name: "event",
  927. type: [String, Array]
  928. },
  929. {
  930. name: "callback",
  931. type: Function
  932. }
  933. ];
  934. const API_EMIT = "$emit";
  935. const EmitProtocol = [
  936. {
  937. name: "event",
  938. type: String,
  939. required: true
  940. }
  941. ];
  942. const emitter = new E$1();
  943. const $on = defineSyncApi(API_ON, (name, callback) => {
  944. emitter.on(name, callback);
  945. return () => emitter.off(name, callback);
  946. }, OnProtocol);
  947. const $once = defineSyncApi(API_ONCE, (name, callback) => {
  948. emitter.once(name, callback);
  949. return () => emitter.off(name, callback);
  950. }, OnceProtocol);
  951. const $off = defineSyncApi(API_OFF, (name, callback) => {
  952. if (!name) {
  953. emitter.e = {};
  954. return;
  955. }
  956. if (!isArray(name))
  957. name = [name];
  958. name.forEach((n2) => emitter.off(n2, callback));
  959. }, OffProtocol);
  960. const $emit = defineSyncApi(API_EMIT, (name, ...args) => {
  961. emitter.emit(name, ...args);
  962. }, EmitProtocol);
  963. let cid;
  964. let cidErrMsg;
  965. let enabled;
  966. function normalizePushMessage(message) {
  967. try {
  968. return JSON.parse(message);
  969. } catch (e2) {
  970. }
  971. return message;
  972. }
  973. function invokePushCallback(args) {
  974. if (args.type === "enabled") {
  975. enabled = true;
  976. } else if (args.type === "clientId") {
  977. cid = args.cid;
  978. cidErrMsg = args.errMsg;
  979. invokeGetPushCidCallbacks(cid, args.errMsg);
  980. } else if (args.type === "pushMsg") {
  981. const message = {
  982. type: "receive",
  983. data: normalizePushMessage(args.message)
  984. };
  985. for (let i = 0; i < onPushMessageCallbacks.length; i++) {
  986. const callback = onPushMessageCallbacks[i];
  987. callback(message);
  988. if (message.stopped) {
  989. break;
  990. }
  991. }
  992. } else if (args.type === "click") {
  993. onPushMessageCallbacks.forEach((callback) => {
  994. callback({
  995. type: "click",
  996. data: normalizePushMessage(args.message)
  997. });
  998. });
  999. }
  1000. }
  1001. const getPushCidCallbacks = [];
  1002. function invokeGetPushCidCallbacks(cid2, errMsg) {
  1003. getPushCidCallbacks.forEach((callback) => {
  1004. callback(cid2, errMsg);
  1005. });
  1006. getPushCidCallbacks.length = 0;
  1007. }
  1008. const API_GET_PUSH_CLIENT_ID = "getPushClientId";
  1009. const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
  1010. Promise.resolve().then(() => {
  1011. if (typeof enabled === "undefined") {
  1012. enabled = false;
  1013. cid = "";
  1014. cidErrMsg = "uniPush is not enabled";
  1015. }
  1016. getPushCidCallbacks.push((cid2, errMsg) => {
  1017. if (cid2) {
  1018. resolve2({ cid: cid2 });
  1019. } else {
  1020. reject(errMsg);
  1021. }
  1022. });
  1023. if (typeof cid !== "undefined") {
  1024. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1025. }
  1026. });
  1027. });
  1028. const onPushMessageCallbacks = [];
  1029. const onPushMessage = (fn) => {
  1030. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1031. onPushMessageCallbacks.push(fn);
  1032. }
  1033. };
  1034. const offPushMessage = (fn) => {
  1035. if (!fn) {
  1036. onPushMessageCallbacks.length = 0;
  1037. } else {
  1038. const index2 = onPushMessageCallbacks.indexOf(fn);
  1039. if (index2 > -1) {
  1040. onPushMessageCallbacks.splice(index2, 1);
  1041. }
  1042. }
  1043. };
  1044. 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/;
  1045. const CONTEXT_API_RE = /^create|Manager$/;
  1046. const CONTEXT_API_RE_EXC = ["createBLEConnection"];
  1047. const ASYNC_API = ["createBLEConnection"];
  1048. const CALLBACK_API_RE = /^on|^off/;
  1049. function isContextApi(name) {
  1050. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1051. }
  1052. function isSyncApi(name) {
  1053. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1054. }
  1055. function isCallbackApi(name) {
  1056. return CALLBACK_API_RE.test(name) && name !== "onPush";
  1057. }
  1058. function shouldPromise(name) {
  1059. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1060. return false;
  1061. }
  1062. return true;
  1063. }
  1064. if (!Promise.prototype.finally) {
  1065. Promise.prototype.finally = function(onfinally) {
  1066. const promise = this.constructor;
  1067. return this.then((value) => promise.resolve(onfinally && onfinally()).then(() => value), (reason) => promise.resolve(onfinally && onfinally()).then(() => {
  1068. throw reason;
  1069. }));
  1070. };
  1071. }
  1072. function promisify(name, api) {
  1073. if (!shouldPromise(name)) {
  1074. return api;
  1075. }
  1076. if (!isFunction(api)) {
  1077. return api;
  1078. }
  1079. return function promiseApi(options = {}, ...rest) {
  1080. if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
  1081. return wrapperReturnValue(name, invokeApi(name, api, options, rest));
  1082. }
  1083. return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
  1084. invokeApi(name, api, extend({}, options, {
  1085. success: resolve2,
  1086. fail: reject
  1087. }), rest);
  1088. })));
  1089. };
  1090. }
  1091. const CALLBACKS = ["success", "fail", "cancel", "complete"];
  1092. function initWrapper(protocols2) {
  1093. function processCallback(methodName, method, returnValue) {
  1094. return function(res) {
  1095. return method(processReturnValue(methodName, res, returnValue));
  1096. };
  1097. }
  1098. function processArgs(methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {
  1099. if (isPlainObject(fromArgs)) {
  1100. const toArgs = keepFromArgs === true ? fromArgs : {};
  1101. if (isFunction(argsOption)) {
  1102. argsOption = argsOption(fromArgs, toArgs) || {};
  1103. }
  1104. for (const key in fromArgs) {
  1105. if (hasOwn(argsOption, key)) {
  1106. let keyOption = argsOption[key];
  1107. if (isFunction(keyOption)) {
  1108. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  1109. }
  1110. if (!keyOption) {
  1111. console.warn(`\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ${methodName} \u6682\u4E0D\u652F\u6301 ${key}`);
  1112. } else if (isString(keyOption)) {
  1113. toArgs[keyOption] = fromArgs[key];
  1114. } else if (isPlainObject(keyOption)) {
  1115. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  1116. }
  1117. } else if (CALLBACKS.indexOf(key) !== -1) {
  1118. const callback = fromArgs[key];
  1119. if (isFunction(callback)) {
  1120. toArgs[key] = processCallback(methodName, callback, returnValue);
  1121. }
  1122. } else {
  1123. if (!keepFromArgs && !hasOwn(toArgs, key)) {
  1124. toArgs[key] = fromArgs[key];
  1125. }
  1126. }
  1127. }
  1128. return toArgs;
  1129. } else if (isFunction(fromArgs)) {
  1130. fromArgs = processCallback(methodName, fromArgs, returnValue);
  1131. }
  1132. return fromArgs;
  1133. }
  1134. function processReturnValue(methodName, res, returnValue, keepReturnValue = false) {
  1135. if (isFunction(protocols2.returnValue)) {
  1136. res = protocols2.returnValue(methodName, res);
  1137. }
  1138. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  1139. }
  1140. return function wrapper(methodName, method) {
  1141. if (!hasOwn(protocols2, methodName)) {
  1142. return method;
  1143. }
  1144. const protocol = protocols2[methodName];
  1145. if (!protocol) {
  1146. return function() {
  1147. console.error(`\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301${methodName}`);
  1148. };
  1149. }
  1150. return function(arg1, arg2) {
  1151. let options = protocol;
  1152. if (isFunction(protocol)) {
  1153. options = protocol(arg1);
  1154. }
  1155. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  1156. const args = [arg1];
  1157. if (typeof arg2 !== "undefined") {
  1158. args.push(arg2);
  1159. }
  1160. const returnValue = wx[options.name || methodName].apply(wx, args);
  1161. if (isSyncApi(methodName)) {
  1162. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  1163. }
  1164. return returnValue;
  1165. };
  1166. };
  1167. }
  1168. const getLocale = () => {
  1169. const app = getApp({ allowDefault: true });
  1170. if (app && app.$vm) {
  1171. return app.$vm.$locale;
  1172. }
  1173. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1174. };
  1175. const setLocale = (locale) => {
  1176. const app = getApp();
  1177. if (!app) {
  1178. return false;
  1179. }
  1180. const oldLocale = app.$vm.$locale;
  1181. if (oldLocale !== locale) {
  1182. app.$vm.$locale = locale;
  1183. onLocaleChangeCallbacks.forEach((fn) => fn({ locale }));
  1184. return true;
  1185. }
  1186. return false;
  1187. };
  1188. const onLocaleChangeCallbacks = [];
  1189. const onLocaleChange = (fn) => {
  1190. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1191. onLocaleChangeCallbacks.push(fn);
  1192. }
  1193. };
  1194. if (typeof global !== "undefined") {
  1195. global.getLocale = getLocale;
  1196. }
  1197. const baseApis = {
  1198. $on,
  1199. $off,
  1200. $once,
  1201. $emit,
  1202. upx2px,
  1203. interceptors,
  1204. addInterceptor,
  1205. removeInterceptor,
  1206. onCreateVueApp,
  1207. invokeCreateVueAppHook,
  1208. getLocale,
  1209. setLocale,
  1210. onLocaleChange,
  1211. getPushClientId,
  1212. onPushMessage,
  1213. offPushMessage,
  1214. invokePushCallback
  1215. };
  1216. function initUni(api, protocols2) {
  1217. const wrapper = initWrapper(protocols2);
  1218. const UniProxyHandlers = {
  1219. get(target, key) {
  1220. if (hasOwn(target, key)) {
  1221. return target[key];
  1222. }
  1223. if (hasOwn(api, key)) {
  1224. return promisify(key, api[key]);
  1225. }
  1226. if (hasOwn(baseApis, key)) {
  1227. return promisify(key, baseApis[key]);
  1228. }
  1229. return promisify(key, wrapper(key, wx[key]));
  1230. }
  1231. };
  1232. return new Proxy({}, UniProxyHandlers);
  1233. }
  1234. function initGetProvider(providers) {
  1235. return function getProvider2({ service, success, fail, complete }) {
  1236. let res;
  1237. if (providers[service]) {
  1238. res = {
  1239. errMsg: "getProvider:ok",
  1240. service,
  1241. provider: providers[service]
  1242. };
  1243. isFunction(success) && success(res);
  1244. } else {
  1245. res = {
  1246. errMsg: "getProvider:fail:\u670D\u52A1[" + service + "]\u4E0D\u5B58\u5728"
  1247. };
  1248. isFunction(fail) && fail(res);
  1249. }
  1250. isFunction(complete) && complete(res);
  1251. };
  1252. }
  1253. const UUID_KEY = "__DC_STAT_UUID";
  1254. let deviceId;
  1255. function useDeviceId(global2 = wx) {
  1256. return function addDeviceId(_, toRes) {
  1257. deviceId = deviceId || global2.getStorageSync(UUID_KEY);
  1258. if (!deviceId) {
  1259. deviceId = Date.now() + "" + Math.floor(Math.random() * 1e7);
  1260. wx.setStorage({
  1261. key: UUID_KEY,
  1262. data: deviceId
  1263. });
  1264. }
  1265. toRes.deviceId = deviceId;
  1266. };
  1267. }
  1268. function addSafeAreaInsets(fromRes, toRes) {
  1269. if (fromRes.safeArea) {
  1270. const safeArea = fromRes.safeArea;
  1271. toRes.safeAreaInsets = {
  1272. top: safeArea.top,
  1273. left: safeArea.left,
  1274. right: fromRes.windowWidth - safeArea.right,
  1275. bottom: fromRes.screenHeight - safeArea.bottom
  1276. };
  1277. }
  1278. }
  1279. function populateParameters(fromRes, toRes) {
  1280. const { brand = "", model = "", system = "", language = "", theme, version: version2, platform, fontSizeSetting, SDKVersion, pixelRatio, deviceOrientation } = fromRes;
  1281. let osName = "";
  1282. let osVersion = "";
  1283. {
  1284. osName = system.split(" ")[0] || "";
  1285. osVersion = system.split(" ")[1] || "";
  1286. }
  1287. let hostVersion = version2;
  1288. let deviceType = getGetDeviceType(fromRes, model);
  1289. let deviceBrand = getDeviceBrand(brand);
  1290. let _hostName = getHostName(fromRes);
  1291. let _deviceOrientation = deviceOrientation;
  1292. let _devicePixelRatio = pixelRatio;
  1293. let _SDKVersion = SDKVersion;
  1294. const hostLanguage = language.replace(/_/g, "-");
  1295. const parameters = {
  1296. appId: "__UNI__61DDDA4",
  1297. appName: "his_user_app",
  1298. appVersion: "1.0.0",
  1299. appVersionCode: "100",
  1300. appLanguage: getAppLanguage(hostLanguage),
  1301. uniCompileVersion: "3.6.4",
  1302. uniRuntimeVersion: "3.6.4",
  1303. uniPlatform: "mp-weixin",
  1304. deviceBrand,
  1305. deviceModel: model,
  1306. deviceType,
  1307. devicePixelRatio: _devicePixelRatio,
  1308. deviceOrientation: _deviceOrientation,
  1309. osName: osName.toLocaleLowerCase(),
  1310. osVersion,
  1311. hostTheme: theme,
  1312. hostVersion,
  1313. hostLanguage,
  1314. hostName: _hostName,
  1315. hostSDKVersion: _SDKVersion,
  1316. hostFontSizeSetting: fontSizeSetting,
  1317. windowTop: 0,
  1318. windowBottom: 0,
  1319. osLanguage: void 0,
  1320. osTheme: void 0,
  1321. ua: void 0,
  1322. hostPackageName: void 0,
  1323. browserName: void 0,
  1324. browserVersion: void 0
  1325. };
  1326. extend(toRes, parameters);
  1327. }
  1328. function getGetDeviceType(fromRes, model) {
  1329. let deviceType = fromRes.deviceType || "phone";
  1330. {
  1331. const deviceTypeMaps = {
  1332. ipad: "pad",
  1333. windows: "pc",
  1334. mac: "pc"
  1335. };
  1336. const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1337. const _model = model.toLocaleLowerCase();
  1338. for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
  1339. const _m = deviceTypeMapsKeys[index2];
  1340. if (_model.indexOf(_m) !== -1) {
  1341. deviceType = deviceTypeMaps[_m];
  1342. break;
  1343. }
  1344. }
  1345. }
  1346. return deviceType;
  1347. }
  1348. function getDeviceBrand(brand) {
  1349. let deviceBrand = brand;
  1350. if (deviceBrand) {
  1351. deviceBrand = deviceBrand.toLocaleLowerCase();
  1352. }
  1353. return deviceBrand;
  1354. }
  1355. function getAppLanguage(defaultLanguage) {
  1356. return getLocale ? getLocale() : defaultLanguage;
  1357. }
  1358. function getHostName(fromRes) {
  1359. const _platform = "WeChat";
  1360. let _hostName = fromRes.hostName || _platform;
  1361. {
  1362. if (fromRes.environment) {
  1363. _hostName = fromRes.environment;
  1364. } else if (fromRes.host && fromRes.host.env) {
  1365. _hostName = fromRes.host.env;
  1366. }
  1367. }
  1368. return _hostName;
  1369. }
  1370. const getSystemInfo = {
  1371. returnValue: (fromRes, toRes) => {
  1372. addSafeAreaInsets(fromRes, toRes);
  1373. useDeviceId()(fromRes, toRes);
  1374. populateParameters(fromRes, toRes);
  1375. }
  1376. };
  1377. const getSystemInfoSync = getSystemInfo;
  1378. const redirectTo = {};
  1379. const previewImage = {
  1380. args(fromArgs, toArgs) {
  1381. let currentIndex = parseInt(fromArgs.current);
  1382. if (isNaN(currentIndex)) {
  1383. return;
  1384. }
  1385. const urls = fromArgs.urls;
  1386. if (!isArray(urls)) {
  1387. return;
  1388. }
  1389. const len = urls.length;
  1390. if (!len) {
  1391. return;
  1392. }
  1393. if (currentIndex < 0) {
  1394. currentIndex = 0;
  1395. } else if (currentIndex >= len) {
  1396. currentIndex = len - 1;
  1397. }
  1398. if (currentIndex > 0) {
  1399. toArgs.current = urls[currentIndex];
  1400. toArgs.urls = urls.filter((item, index2) => index2 < currentIndex ? item !== urls[currentIndex] : true);
  1401. } else {
  1402. toArgs.current = urls[0];
  1403. }
  1404. return {
  1405. indicator: false,
  1406. loop: false
  1407. };
  1408. }
  1409. };
  1410. const showActionSheet = {
  1411. args(fromArgs, toArgs) {
  1412. toArgs.alertText = fromArgs.title;
  1413. }
  1414. };
  1415. const getDeviceInfo = {
  1416. returnValue: (fromRes, toRes) => {
  1417. const { brand, model } = fromRes;
  1418. let deviceType = getGetDeviceType(fromRes, model);
  1419. let deviceBrand = getDeviceBrand(brand);
  1420. useDeviceId()(fromRes, toRes);
  1421. toRes = sortObject(extend(toRes, {
  1422. deviceType,
  1423. deviceBrand,
  1424. deviceModel: model
  1425. }));
  1426. }
  1427. };
  1428. const getAppBaseInfo = {
  1429. returnValue: (fromRes, toRes) => {
  1430. const { version: version2, language, SDKVersion, theme } = fromRes;
  1431. let _hostName = getHostName(fromRes);
  1432. let hostLanguage = language.replace(/_/g, "-");
  1433. toRes = sortObject(extend(toRes, {
  1434. hostVersion: version2,
  1435. hostLanguage,
  1436. hostName: _hostName,
  1437. hostSDKVersion: SDKVersion,
  1438. hostTheme: theme,
  1439. appId: "__UNI__61DDDA4",
  1440. appName: "his_user_app",
  1441. appVersion: "1.0.0",
  1442. appVersionCode: "100",
  1443. appLanguage: getAppLanguage(hostLanguage)
  1444. }));
  1445. }
  1446. };
  1447. const getWindowInfo = {
  1448. returnValue: (fromRes, toRes) => {
  1449. addSafeAreaInsets(fromRes, toRes);
  1450. toRes = sortObject(extend(toRes, {
  1451. windowTop: 0,
  1452. windowBottom: 0
  1453. }));
  1454. }
  1455. };
  1456. const getAppAuthorizeSetting = {
  1457. returnValue: function(fromRes, toRes) {
  1458. const { locationReducedAccuracy } = fromRes;
  1459. toRes.locationAccuracy = "unsupported";
  1460. if (locationReducedAccuracy === true) {
  1461. toRes.locationAccuracy = "reduced";
  1462. } else if (locationReducedAccuracy === false) {
  1463. toRes.locationAccuracy = "full";
  1464. }
  1465. }
  1466. };
  1467. const mocks$1 = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  1468. const getProvider = initGetProvider({
  1469. oauth: ["weixin"],
  1470. share: ["weixin"],
  1471. payment: ["wxpay"],
  1472. push: ["weixin"]
  1473. });
  1474. function initComponentMocks(component) {
  1475. const res = /* @__PURE__ */ Object.create(null);
  1476. mocks$1.forEach((name) => {
  1477. res[name] = component[name];
  1478. });
  1479. return res;
  1480. }
  1481. function createSelectorQuery() {
  1482. const query = wx.createSelectorQuery();
  1483. const oldIn = query.in;
  1484. query.in = function newIn(component) {
  1485. return oldIn.call(this, initComponentMocks(component));
  1486. };
  1487. return query;
  1488. }
  1489. var shims = /* @__PURE__ */ Object.freeze({
  1490. __proto__: null,
  1491. getProvider,
  1492. createSelectorQuery
  1493. });
  1494. var protocols = /* @__PURE__ */ Object.freeze({
  1495. __proto__: null,
  1496. redirectTo,
  1497. previewImage,
  1498. getSystemInfo,
  1499. getSystemInfoSync,
  1500. showActionSheet,
  1501. getDeviceInfo,
  1502. getAppBaseInfo,
  1503. getWindowInfo,
  1504. getAppAuthorizeSetting
  1505. });
  1506. var index = initUni(shims, protocols);
  1507. function warn(msg, ...args) {
  1508. console.warn(`[Vue warn] ${msg}`, ...args);
  1509. }
  1510. let activeEffectScope;
  1511. class EffectScope {
  1512. constructor(detached = false) {
  1513. this.active = true;
  1514. this.effects = [];
  1515. this.cleanups = [];
  1516. if (!detached && activeEffectScope) {
  1517. this.parent = activeEffectScope;
  1518. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1519. }
  1520. }
  1521. run(fn) {
  1522. if (this.active) {
  1523. const currentEffectScope = activeEffectScope;
  1524. try {
  1525. activeEffectScope = this;
  1526. return fn();
  1527. } finally {
  1528. activeEffectScope = currentEffectScope;
  1529. }
  1530. } else {
  1531. warn(`cannot run an inactive effect scope.`);
  1532. }
  1533. }
  1534. on() {
  1535. activeEffectScope = this;
  1536. }
  1537. off() {
  1538. activeEffectScope = this.parent;
  1539. }
  1540. stop(fromParent) {
  1541. if (this.active) {
  1542. let i, l;
  1543. for (i = 0, l = this.effects.length; i < l; i++) {
  1544. this.effects[i].stop();
  1545. }
  1546. for (i = 0, l = this.cleanups.length; i < l; i++) {
  1547. this.cleanups[i]();
  1548. }
  1549. if (this.scopes) {
  1550. for (i = 0, l = this.scopes.length; i < l; i++) {
  1551. this.scopes[i].stop(true);
  1552. }
  1553. }
  1554. if (this.parent && !fromParent) {
  1555. const last = this.parent.scopes.pop();
  1556. if (last && last !== this) {
  1557. this.parent.scopes[this.index] = last;
  1558. last.index = this.index;
  1559. }
  1560. }
  1561. this.active = false;
  1562. }
  1563. }
  1564. }
  1565. function recordEffectScope(effect, scope = activeEffectScope) {
  1566. if (scope && scope.active) {
  1567. scope.effects.push(effect);
  1568. }
  1569. }
  1570. const createDep = (effects) => {
  1571. const dep = new Set(effects);
  1572. dep.w = 0;
  1573. dep.n = 0;
  1574. return dep;
  1575. };
  1576. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  1577. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  1578. const initDepMarkers = ({ deps }) => {
  1579. if (deps.length) {
  1580. for (let i = 0; i < deps.length; i++) {
  1581. deps[i].w |= trackOpBit;
  1582. }
  1583. }
  1584. };
  1585. const finalizeDepMarkers = (effect) => {
  1586. const { deps } = effect;
  1587. if (deps.length) {
  1588. let ptr = 0;
  1589. for (let i = 0; i < deps.length; i++) {
  1590. const dep = deps[i];
  1591. if (wasTracked(dep) && !newTracked(dep)) {
  1592. dep.delete(effect);
  1593. } else {
  1594. deps[ptr++] = dep;
  1595. }
  1596. dep.w &= ~trackOpBit;
  1597. dep.n &= ~trackOpBit;
  1598. }
  1599. deps.length = ptr;
  1600. }
  1601. };
  1602. const targetMap = /* @__PURE__ */ new WeakMap();
  1603. let effectTrackDepth = 0;
  1604. let trackOpBit = 1;
  1605. const maxMarkerBits = 30;
  1606. let activeEffect;
  1607. const ITERATE_KEY = Symbol("iterate");
  1608. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate");
  1609. class ReactiveEffect {
  1610. constructor(fn, scheduler = null, scope) {
  1611. this.fn = fn;
  1612. this.scheduler = scheduler;
  1613. this.active = true;
  1614. this.deps = [];
  1615. this.parent = void 0;
  1616. recordEffectScope(this, scope);
  1617. }
  1618. run() {
  1619. if (!this.active) {
  1620. return this.fn();
  1621. }
  1622. let parent = activeEffect;
  1623. let lastShouldTrack = shouldTrack;
  1624. while (parent) {
  1625. if (parent === this) {
  1626. return;
  1627. }
  1628. parent = parent.parent;
  1629. }
  1630. try {
  1631. this.parent = activeEffect;
  1632. activeEffect = this;
  1633. shouldTrack = true;
  1634. trackOpBit = 1 << ++effectTrackDepth;
  1635. if (effectTrackDepth <= maxMarkerBits) {
  1636. initDepMarkers(this);
  1637. } else {
  1638. cleanupEffect(this);
  1639. }
  1640. return this.fn();
  1641. } finally {
  1642. if (effectTrackDepth <= maxMarkerBits) {
  1643. finalizeDepMarkers(this);
  1644. }
  1645. trackOpBit = 1 << --effectTrackDepth;
  1646. activeEffect = this.parent;
  1647. shouldTrack = lastShouldTrack;
  1648. this.parent = void 0;
  1649. if (this.deferStop) {
  1650. this.stop();
  1651. }
  1652. }
  1653. }
  1654. stop() {
  1655. if (activeEffect === this) {
  1656. this.deferStop = true;
  1657. } else if (this.active) {
  1658. cleanupEffect(this);
  1659. if (this.onStop) {
  1660. this.onStop();
  1661. }
  1662. this.active = false;
  1663. }
  1664. }
  1665. }
  1666. function cleanupEffect(effect) {
  1667. const { deps } = effect;
  1668. if (deps.length) {
  1669. for (let i = 0; i < deps.length; i++) {
  1670. deps[i].delete(effect);
  1671. }
  1672. deps.length = 0;
  1673. }
  1674. }
  1675. let shouldTrack = true;
  1676. const trackStack = [];
  1677. function pauseTracking() {
  1678. trackStack.push(shouldTrack);
  1679. shouldTrack = false;
  1680. }
  1681. function resetTracking() {
  1682. const last = trackStack.pop();
  1683. shouldTrack = last === void 0 ? true : last;
  1684. }
  1685. function track(target, type, key) {
  1686. if (shouldTrack && activeEffect) {
  1687. let depsMap = targetMap.get(target);
  1688. if (!depsMap) {
  1689. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  1690. }
  1691. let dep = depsMap.get(key);
  1692. if (!dep) {
  1693. depsMap.set(key, dep = createDep());
  1694. }
  1695. const eventInfo = { effect: activeEffect, target, type, key };
  1696. trackEffects(dep, eventInfo);
  1697. }
  1698. }
  1699. function trackEffects(dep, debuggerEventExtraInfo) {
  1700. let shouldTrack2 = false;
  1701. if (effectTrackDepth <= maxMarkerBits) {
  1702. if (!newTracked(dep)) {
  1703. dep.n |= trackOpBit;
  1704. shouldTrack2 = !wasTracked(dep);
  1705. }
  1706. } else {
  1707. shouldTrack2 = !dep.has(activeEffect);
  1708. }
  1709. if (shouldTrack2) {
  1710. dep.add(activeEffect);
  1711. activeEffect.deps.push(dep);
  1712. if (activeEffect.onTrack) {
  1713. activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
  1714. }
  1715. }
  1716. }
  1717. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  1718. const depsMap = targetMap.get(target);
  1719. if (!depsMap) {
  1720. return;
  1721. }
  1722. let deps = [];
  1723. if (type === "clear") {
  1724. deps = [...depsMap.values()];
  1725. } else if (key === "length" && isArray(target)) {
  1726. depsMap.forEach((dep, key2) => {
  1727. if (key2 === "length" || key2 >= newValue) {
  1728. deps.push(dep);
  1729. }
  1730. });
  1731. } else {
  1732. if (key !== void 0) {
  1733. deps.push(depsMap.get(key));
  1734. }
  1735. switch (type) {
  1736. case "add":
  1737. if (!isArray(target)) {
  1738. deps.push(depsMap.get(ITERATE_KEY));
  1739. if (isMap(target)) {
  1740. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1741. }
  1742. } else if (isIntegerKey(key)) {
  1743. deps.push(depsMap.get("length"));
  1744. }
  1745. break;
  1746. case "delete":
  1747. if (!isArray(target)) {
  1748. deps.push(depsMap.get(ITERATE_KEY));
  1749. if (isMap(target)) {
  1750. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  1751. }
  1752. }
  1753. break;
  1754. case "set":
  1755. if (isMap(target)) {
  1756. deps.push(depsMap.get(ITERATE_KEY));
  1757. }
  1758. break;
  1759. }
  1760. }
  1761. const eventInfo = { target, type, key, newValue, oldValue, oldTarget };
  1762. if (deps.length === 1) {
  1763. if (deps[0]) {
  1764. {
  1765. triggerEffects(deps[0], eventInfo);
  1766. }
  1767. }
  1768. } else {
  1769. const effects = [];
  1770. for (const dep of deps) {
  1771. if (dep) {
  1772. effects.push(...dep);
  1773. }
  1774. }
  1775. {
  1776. triggerEffects(createDep(effects), eventInfo);
  1777. }
  1778. }
  1779. }
  1780. function triggerEffects(dep, debuggerEventExtraInfo) {
  1781. const effects = isArray(dep) ? dep : [...dep];
  1782. for (const effect of effects) {
  1783. if (effect.computed) {
  1784. triggerEffect(effect, debuggerEventExtraInfo);
  1785. }
  1786. }
  1787. for (const effect of effects) {
  1788. if (!effect.computed) {
  1789. triggerEffect(effect, debuggerEventExtraInfo);
  1790. }
  1791. }
  1792. }
  1793. function triggerEffect(effect, debuggerEventExtraInfo) {
  1794. if (effect !== activeEffect || effect.allowRecurse) {
  1795. if (effect.onTrigger) {
  1796. effect.onTrigger(extend({ effect }, debuggerEventExtraInfo));
  1797. }
  1798. if (effect.scheduler) {
  1799. effect.scheduler();
  1800. } else {
  1801. effect.run();
  1802. }
  1803. }
  1804. }
  1805. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1806. const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
  1807. const get = /* @__PURE__ */ createGetter();
  1808. const shallowGet = /* @__PURE__ */ createGetter(false, true);
  1809. const readonlyGet = /* @__PURE__ */ createGetter(true);
  1810. const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
  1811. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  1812. function createArrayInstrumentations() {
  1813. const instrumentations = {};
  1814. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  1815. instrumentations[key] = function(...args) {
  1816. const arr = toRaw(this);
  1817. for (let i = 0, l = this.length; i < l; i++) {
  1818. track(arr, "get", i + "");
  1819. }
  1820. const res = arr[key](...args);
  1821. if (res === -1 || res === false) {
  1822. return arr[key](...args.map(toRaw));
  1823. } else {
  1824. return res;
  1825. }
  1826. };
  1827. });
  1828. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  1829. instrumentations[key] = function(...args) {
  1830. pauseTracking();
  1831. const res = toRaw(this)[key].apply(this, args);
  1832. resetTracking();
  1833. return res;
  1834. };
  1835. });
  1836. return instrumentations;
  1837. }
  1838. function createGetter(isReadonly2 = false, shallow = false) {
  1839. return function get3(target, key, receiver) {
  1840. if (key === "__v_isReactive") {
  1841. return !isReadonly2;
  1842. } else if (key === "__v_isReadonly") {
  1843. return isReadonly2;
  1844. } else if (key === "__v_isShallow") {
  1845. return shallow;
  1846. } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
  1847. return target;
  1848. }
  1849. const targetIsArray = isArray(target);
  1850. if (!isReadonly2 && targetIsArray && hasOwn(arrayInstrumentations, key)) {
  1851. return Reflect.get(arrayInstrumentations, key, receiver);
  1852. }
  1853. const res = Reflect.get(target, key, receiver);
  1854. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1855. return res;
  1856. }
  1857. if (!isReadonly2) {
  1858. track(target, "get", key);
  1859. }
  1860. if (shallow) {
  1861. return res;
  1862. }
  1863. if (isRef(res)) {
  1864. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1865. }
  1866. if (isObject$1(res)) {
  1867. return isReadonly2 ? readonly(res) : reactive(res);
  1868. }
  1869. return res;
  1870. };
  1871. }
  1872. const set$1 = /* @__PURE__ */ createSetter();
  1873. const shallowSet = /* @__PURE__ */ createSetter(true);
  1874. function createSetter(shallow = false) {
  1875. return function set2(target, key, value, receiver) {
  1876. let oldValue = target[key];
  1877. if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
  1878. return false;
  1879. }
  1880. if (!shallow && !isReadonly(value)) {
  1881. if (!isShallow(value)) {
  1882. value = toRaw(value);
  1883. oldValue = toRaw(oldValue);
  1884. }
  1885. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1886. oldValue.value = value;
  1887. return true;
  1888. }
  1889. }
  1890. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  1891. const result = Reflect.set(target, key, value, receiver);
  1892. if (target === toRaw(receiver)) {
  1893. if (!hadKey) {
  1894. trigger(target, "add", key, value);
  1895. } else if (hasChanged(value, oldValue)) {
  1896. trigger(target, "set", key, value, oldValue);
  1897. }
  1898. }
  1899. return result;
  1900. };
  1901. }
  1902. function deleteProperty(target, key) {
  1903. const hadKey = hasOwn(target, key);
  1904. const oldValue = target[key];
  1905. const result = Reflect.deleteProperty(target, key);
  1906. if (result && hadKey) {
  1907. trigger(target, "delete", key, void 0, oldValue);
  1908. }
  1909. return result;
  1910. }
  1911. function has(target, key) {
  1912. const result = Reflect.has(target, key);
  1913. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1914. track(target, "has", key);
  1915. }
  1916. return result;
  1917. }
  1918. function ownKeys(target) {
  1919. track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
  1920. return Reflect.ownKeys(target);
  1921. }
  1922. const mutableHandlers = {
  1923. get,
  1924. set: set$1,
  1925. deleteProperty,
  1926. has,
  1927. ownKeys
  1928. };
  1929. const readonlyHandlers = {
  1930. get: readonlyGet,
  1931. set(target, key) {
  1932. {
  1933. warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
  1934. }
  1935. return true;
  1936. },
  1937. deleteProperty(target, key) {
  1938. {
  1939. warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
  1940. }
  1941. return true;
  1942. }
  1943. };
  1944. const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, {
  1945. get: shallowGet,
  1946. set: shallowSet
  1947. });
  1948. const shallowReadonlyHandlers = /* @__PURE__ */ extend({}, readonlyHandlers, {
  1949. get: shallowReadonlyGet
  1950. });
  1951. const toShallow = (value) => value;
  1952. const getProto = (v) => Reflect.getPrototypeOf(v);
  1953. function get$1(target, key, isReadonly2 = false, isShallow2 = false) {
  1954. target = target["__v_raw"];
  1955. const rawTarget = toRaw(target);
  1956. const rawKey = toRaw(key);
  1957. if (!isReadonly2) {
  1958. if (key !== rawKey) {
  1959. track(rawTarget, "get", key);
  1960. }
  1961. track(rawTarget, "get", rawKey);
  1962. }
  1963. const { has: has2 } = getProto(rawTarget);
  1964. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1965. if (has2.call(rawTarget, key)) {
  1966. return wrap(target.get(key));
  1967. } else if (has2.call(rawTarget, rawKey)) {
  1968. return wrap(target.get(rawKey));
  1969. } else if (target !== rawTarget) {
  1970. target.get(key);
  1971. }
  1972. }
  1973. function has$1(key, isReadonly2 = false) {
  1974. const target = this["__v_raw"];
  1975. const rawTarget = toRaw(target);
  1976. const rawKey = toRaw(key);
  1977. if (!isReadonly2) {
  1978. if (key !== rawKey) {
  1979. track(rawTarget, "has", key);
  1980. }
  1981. track(rawTarget, "has", rawKey);
  1982. }
  1983. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1984. }
  1985. function size(target, isReadonly2 = false) {
  1986. target = target["__v_raw"];
  1987. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  1988. return Reflect.get(target, "size", target);
  1989. }
  1990. function add(value) {
  1991. value = toRaw(value);
  1992. const target = toRaw(this);
  1993. const proto = getProto(target);
  1994. const hadKey = proto.has.call(target, value);
  1995. if (!hadKey) {
  1996. target.add(value);
  1997. trigger(target, "add", value, value);
  1998. }
  1999. return this;
  2000. }
  2001. function set$1$1(key, value) {
  2002. value = toRaw(value);
  2003. const target = toRaw(this);
  2004. const { has: has2, get: get3 } = getProto(target);
  2005. let hadKey = has2.call(target, key);
  2006. if (!hadKey) {
  2007. key = toRaw(key);
  2008. hadKey = has2.call(target, key);
  2009. } else {
  2010. checkIdentityKeys(target, has2, key);
  2011. }
  2012. const oldValue = get3.call(target, key);
  2013. target.set(key, value);
  2014. if (!hadKey) {
  2015. trigger(target, "add", key, value);
  2016. } else if (hasChanged(value, oldValue)) {
  2017. trigger(target, "set", key, value, oldValue);
  2018. }
  2019. return this;
  2020. }
  2021. function deleteEntry(key) {
  2022. const target = toRaw(this);
  2023. const { has: has2, get: get3 } = getProto(target);
  2024. let hadKey = has2.call(target, key);
  2025. if (!hadKey) {
  2026. key = toRaw(key);
  2027. hadKey = has2.call(target, key);
  2028. } else {
  2029. checkIdentityKeys(target, has2, key);
  2030. }
  2031. const oldValue = get3 ? get3.call(target, key) : void 0;
  2032. const result = target.delete(key);
  2033. if (hadKey) {
  2034. trigger(target, "delete", key, void 0, oldValue);
  2035. }
  2036. return result;
  2037. }
  2038. function clear() {
  2039. const target = toRaw(this);
  2040. const hadItems = target.size !== 0;
  2041. const oldTarget = isMap(target) ? new Map(target) : new Set(target);
  2042. const result = target.clear();
  2043. if (hadItems) {
  2044. trigger(target, "clear", void 0, void 0, oldTarget);
  2045. }
  2046. return result;
  2047. }
  2048. function createForEach(isReadonly2, isShallow2) {
  2049. return function forEach(callback, thisArg) {
  2050. const observed = this;
  2051. const target = observed["__v_raw"];
  2052. const rawTarget = toRaw(target);
  2053. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2054. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  2055. return target.forEach((value, key) => {
  2056. return callback.call(thisArg, wrap(value), wrap(key), observed);
  2057. });
  2058. };
  2059. }
  2060. function createIterableMethod(method, isReadonly2, isShallow2) {
  2061. return function(...args) {
  2062. const target = this["__v_raw"];
  2063. const rawTarget = toRaw(target);
  2064. const targetIsMap = isMap(rawTarget);
  2065. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  2066. const isKeyOnly = method === "keys" && targetIsMap;
  2067. const innerIterator = target[method](...args);
  2068. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  2069. !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
  2070. return {
  2071. next() {
  2072. const { value, done } = innerIterator.next();
  2073. return done ? { value, done } : {
  2074. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  2075. done
  2076. };
  2077. },
  2078. [Symbol.iterator]() {
  2079. return this;
  2080. }
  2081. };
  2082. };
  2083. }
  2084. function createReadonlyMethod(type) {
  2085. return function(...args) {
  2086. {
  2087. const key = args[0] ? `on key "${args[0]}" ` : ``;
  2088. console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
  2089. }
  2090. return type === "delete" ? false : this;
  2091. };
  2092. }
  2093. function createInstrumentations() {
  2094. const mutableInstrumentations2 = {
  2095. get(key) {
  2096. return get$1(this, key);
  2097. },
  2098. get size() {
  2099. return size(this);
  2100. },
  2101. has: has$1,
  2102. add,
  2103. set: set$1$1,
  2104. delete: deleteEntry,
  2105. clear,
  2106. forEach: createForEach(false, false)
  2107. };
  2108. const shallowInstrumentations2 = {
  2109. get(key) {
  2110. return get$1(this, key, false, true);
  2111. },
  2112. get size() {
  2113. return size(this);
  2114. },
  2115. has: has$1,
  2116. add,
  2117. set: set$1$1,
  2118. delete: deleteEntry,
  2119. clear,
  2120. forEach: createForEach(false, true)
  2121. };
  2122. const readonlyInstrumentations2 = {
  2123. get(key) {
  2124. return get$1(this, key, true);
  2125. },
  2126. get size() {
  2127. return size(this, true);
  2128. },
  2129. has(key) {
  2130. return has$1.call(this, key, true);
  2131. },
  2132. add: createReadonlyMethod("add"),
  2133. set: createReadonlyMethod("set"),
  2134. delete: createReadonlyMethod("delete"),
  2135. clear: createReadonlyMethod("clear"),
  2136. forEach: createForEach(true, false)
  2137. };
  2138. const shallowReadonlyInstrumentations2 = {
  2139. get(key) {
  2140. return get$1(this, key, true, true);
  2141. },
  2142. get size() {
  2143. return size(this, true);
  2144. },
  2145. has(key) {
  2146. return has$1.call(this, key, true);
  2147. },
  2148. add: createReadonlyMethod("add"),
  2149. set: createReadonlyMethod("set"),
  2150. delete: createReadonlyMethod("delete"),
  2151. clear: createReadonlyMethod("clear"),
  2152. forEach: createForEach(true, true)
  2153. };
  2154. const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
  2155. iteratorMethods.forEach((method) => {
  2156. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  2157. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  2158. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  2159. shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);
  2160. });
  2161. return [
  2162. mutableInstrumentations2,
  2163. readonlyInstrumentations2,
  2164. shallowInstrumentations2,
  2165. shallowReadonlyInstrumentations2
  2166. ];
  2167. }
  2168. const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();
  2169. function createInstrumentationGetter(isReadonly2, shallow) {
  2170. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  2171. return (target, key, receiver) => {
  2172. if (key === "__v_isReactive") {
  2173. return !isReadonly2;
  2174. } else if (key === "__v_isReadonly") {
  2175. return isReadonly2;
  2176. } else if (key === "__v_raw") {
  2177. return target;
  2178. }
  2179. return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
  2180. };
  2181. }
  2182. const mutableCollectionHandlers = {
  2183. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  2184. };
  2185. const shallowCollectionHandlers = {
  2186. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  2187. };
  2188. const readonlyCollectionHandlers = {
  2189. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  2190. };
  2191. const shallowReadonlyCollectionHandlers = {
  2192. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  2193. };
  2194. function checkIdentityKeys(target, has2, key) {
  2195. const rawKey = toRaw(key);
  2196. if (rawKey !== key && has2.call(target, rawKey)) {
  2197. const type = toRawType(target);
  2198. 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.`);
  2199. }
  2200. }
  2201. const reactiveMap = /* @__PURE__ */ new WeakMap();
  2202. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  2203. const readonlyMap = /* @__PURE__ */ new WeakMap();
  2204. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  2205. function targetTypeMap(rawType) {
  2206. switch (rawType) {
  2207. case "Object":
  2208. case "Array":
  2209. return 1;
  2210. case "Map":
  2211. case "Set":
  2212. case "WeakMap":
  2213. case "WeakSet":
  2214. return 2;
  2215. default:
  2216. return 0;
  2217. }
  2218. }
  2219. function getTargetType(value) {
  2220. return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  2221. }
  2222. function reactive(target) {
  2223. if (isReadonly(target)) {
  2224. return target;
  2225. }
  2226. return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
  2227. }
  2228. function shallowReactive(target) {
  2229. return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
  2230. }
  2231. function readonly(target) {
  2232. return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
  2233. }
  2234. function shallowReadonly(target) {
  2235. return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
  2236. }
  2237. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  2238. if (!isObject$1(target)) {
  2239. {
  2240. console.warn(`value cannot be made reactive: ${String(target)}`);
  2241. }
  2242. return target;
  2243. }
  2244. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  2245. return target;
  2246. }
  2247. const existingProxy = proxyMap.get(target);
  2248. if (existingProxy) {
  2249. return existingProxy;
  2250. }
  2251. const targetType = getTargetType(target);
  2252. if (targetType === 0) {
  2253. return target;
  2254. }
  2255. const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
  2256. proxyMap.set(target, proxy);
  2257. return proxy;
  2258. }
  2259. function isReactive(value) {
  2260. if (isReadonly(value)) {
  2261. return isReactive(value["__v_raw"]);
  2262. }
  2263. return !!(value && value["__v_isReactive"]);
  2264. }
  2265. function isReadonly(value) {
  2266. return !!(value && value["__v_isReadonly"]);
  2267. }
  2268. function isShallow(value) {
  2269. return !!(value && value["__v_isShallow"]);
  2270. }
  2271. function isProxy(value) {
  2272. return isReactive(value) || isReadonly(value);
  2273. }
  2274. function toRaw(observed) {
  2275. const raw = observed && observed["__v_raw"];
  2276. return raw ? toRaw(raw) : observed;
  2277. }
  2278. function markRaw(value) {
  2279. def(value, "__v_skip", true);
  2280. return value;
  2281. }
  2282. const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
  2283. const toReadonly = (value) => isObject$1(value) ? readonly(value) : value;
  2284. function trackRefValue(ref2) {
  2285. if (shouldTrack && activeEffect) {
  2286. ref2 = toRaw(ref2);
  2287. {
  2288. trackEffects(ref2.dep || (ref2.dep = createDep()), {
  2289. target: ref2,
  2290. type: "get",
  2291. key: "value"
  2292. });
  2293. }
  2294. }
  2295. }
  2296. function triggerRefValue(ref2, newVal) {
  2297. ref2 = toRaw(ref2);
  2298. if (ref2.dep) {
  2299. {
  2300. triggerEffects(ref2.dep, {
  2301. target: ref2,
  2302. type: "set",
  2303. key: "value",
  2304. newValue: newVal
  2305. });
  2306. }
  2307. }
  2308. }
  2309. function isRef(r) {
  2310. return !!(r && r.__v_isRef === true);
  2311. }
  2312. function ref(value) {
  2313. return createRef(value, false);
  2314. }
  2315. function shallowRef(value) {
  2316. return createRef(value, true);
  2317. }
  2318. function createRef(rawValue, shallow) {
  2319. if (isRef(rawValue)) {
  2320. return rawValue;
  2321. }
  2322. return new RefImpl(rawValue, shallow);
  2323. }
  2324. class RefImpl {
  2325. constructor(value, __v_isShallow) {
  2326. this.__v_isShallow = __v_isShallow;
  2327. this.dep = void 0;
  2328. this.__v_isRef = true;
  2329. this._rawValue = __v_isShallow ? value : toRaw(value);
  2330. this._value = __v_isShallow ? value : toReactive(value);
  2331. }
  2332. get value() {
  2333. trackRefValue(this);
  2334. return this._value;
  2335. }
  2336. set value(newVal) {
  2337. newVal = this.__v_isShallow ? newVal : toRaw(newVal);
  2338. if (hasChanged(newVal, this._rawValue)) {
  2339. this._rawValue = newVal;
  2340. this._value = this.__v_isShallow ? newVal : toReactive(newVal);
  2341. triggerRefValue(this, newVal);
  2342. }
  2343. }
  2344. }
  2345. function unref(ref2) {
  2346. return isRef(ref2) ? ref2.value : ref2;
  2347. }
  2348. const shallowUnwrapHandlers = {
  2349. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  2350. set: (target, key, value, receiver) => {
  2351. const oldValue = target[key];
  2352. if (isRef(oldValue) && !isRef(value)) {
  2353. oldValue.value = value;
  2354. return true;
  2355. } else {
  2356. return Reflect.set(target, key, value, receiver);
  2357. }
  2358. }
  2359. };
  2360. function proxyRefs(objectWithRefs) {
  2361. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  2362. }
  2363. function toRefs(object) {
  2364. if (!isProxy(object)) {
  2365. console.warn(`toRefs() expects a reactive object but received a plain one.`);
  2366. }
  2367. const ret = isArray(object) ? new Array(object.length) : {};
  2368. for (const key in object) {
  2369. ret[key] = toRef(object, key);
  2370. }
  2371. return ret;
  2372. }
  2373. class ObjectRefImpl {
  2374. constructor(_object, _key, _defaultValue) {
  2375. this._object = _object;
  2376. this._key = _key;
  2377. this._defaultValue = _defaultValue;
  2378. this.__v_isRef = true;
  2379. }
  2380. get value() {
  2381. const val = this._object[this._key];
  2382. return val === void 0 ? this._defaultValue : val;
  2383. }
  2384. set value(newVal) {
  2385. this._object[this._key] = newVal;
  2386. }
  2387. }
  2388. function toRef(object, key, defaultValue) {
  2389. const val = object[key];
  2390. return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue);
  2391. }
  2392. class ComputedRefImpl {
  2393. constructor(getter, _setter, isReadonly2, isSSR) {
  2394. this._setter = _setter;
  2395. this.dep = void 0;
  2396. this.__v_isRef = true;
  2397. this._dirty = true;
  2398. this.effect = new ReactiveEffect(getter, () => {
  2399. if (!this._dirty) {
  2400. this._dirty = true;
  2401. triggerRefValue(this);
  2402. }
  2403. });
  2404. this.effect.computed = this;
  2405. this.effect.active = this._cacheable = !isSSR;
  2406. this["__v_isReadonly"] = isReadonly2;
  2407. }
  2408. get value() {
  2409. const self2 = toRaw(this);
  2410. trackRefValue(self2);
  2411. if (self2._dirty || !self2._cacheable) {
  2412. self2._dirty = false;
  2413. self2._value = self2.effect.run();
  2414. }
  2415. return self2._value;
  2416. }
  2417. set value(newValue) {
  2418. this._setter(newValue);
  2419. }
  2420. }
  2421. function computed(getterOrOptions, debugOptions, isSSR = false) {
  2422. let getter;
  2423. let setter;
  2424. const onlyGetter = isFunction(getterOrOptions);
  2425. if (onlyGetter) {
  2426. getter = getterOrOptions;
  2427. setter = () => {
  2428. console.warn("Write operation failed: computed value is readonly");
  2429. };
  2430. } else {
  2431. getter = getterOrOptions.get;
  2432. setter = getterOrOptions.set;
  2433. }
  2434. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  2435. if (debugOptions && !isSSR) {
  2436. cRef.effect.onTrack = debugOptions.onTrack;
  2437. cRef.effect.onTrigger = debugOptions.onTrigger;
  2438. }
  2439. return cRef;
  2440. }
  2441. const stack = [];
  2442. function pushWarningContext(vnode) {
  2443. stack.push(vnode);
  2444. }
  2445. function popWarningContext() {
  2446. stack.pop();
  2447. }
  2448. function warn$1(msg, ...args) {
  2449. pauseTracking();
  2450. const instance = stack.length ? stack[stack.length - 1].component : null;
  2451. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2452. const trace = getComponentTrace();
  2453. if (appWarnHandler) {
  2454. callWithErrorHandling(appWarnHandler, instance, 11, [
  2455. msg + args.join(""),
  2456. instance && instance.proxy,
  2457. trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
  2458. trace
  2459. ]);
  2460. } else {
  2461. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2462. if (trace.length && true) {
  2463. warnArgs.push(`
  2464. `, ...formatTrace(trace));
  2465. }
  2466. console.warn(...warnArgs);
  2467. }
  2468. resetTracking();
  2469. }
  2470. function getComponentTrace() {
  2471. let currentVNode = stack[stack.length - 1];
  2472. if (!currentVNode) {
  2473. return [];
  2474. }
  2475. const normalizedStack = [];
  2476. while (currentVNode) {
  2477. const last = normalizedStack[0];
  2478. if (last && last.vnode === currentVNode) {
  2479. last.recurseCount++;
  2480. } else {
  2481. normalizedStack.push({
  2482. vnode: currentVNode,
  2483. recurseCount: 0
  2484. });
  2485. }
  2486. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2487. currentVNode = parentInstance && parentInstance.vnode;
  2488. }
  2489. return normalizedStack;
  2490. }
  2491. function formatTrace(trace) {
  2492. const logs = [];
  2493. trace.forEach((entry, i) => {
  2494. logs.push(...i === 0 ? [] : [`
  2495. `], ...formatTraceEntry(entry));
  2496. });
  2497. return logs;
  2498. }
  2499. function formatTraceEntry({ vnode, recurseCount }) {
  2500. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2501. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2502. const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
  2503. const close = `>` + postfix;
  2504. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2505. }
  2506. function formatProps(props) {
  2507. const res = [];
  2508. const keys = Object.keys(props);
  2509. keys.slice(0, 3).forEach((key) => {
  2510. res.push(...formatProp(key, props[key]));
  2511. });
  2512. if (keys.length > 3) {
  2513. res.push(` ...`);
  2514. }
  2515. return res;
  2516. }
  2517. function formatProp(key, value, raw) {
  2518. if (isString(value)) {
  2519. value = JSON.stringify(value);
  2520. return raw ? value : [`${key}=${value}`];
  2521. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2522. return raw ? value : [`${key}=${value}`];
  2523. } else if (isRef(value)) {
  2524. value = formatProp(key, toRaw(value.value), true);
  2525. return raw ? value : [`${key}=Ref<`, value, `>`];
  2526. } else if (isFunction(value)) {
  2527. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2528. } else {
  2529. value = toRaw(value);
  2530. return raw ? value : [`${key}=`, value];
  2531. }
  2532. }
  2533. const ErrorTypeStrings = {
  2534. ["sp"]: "serverPrefetch hook",
  2535. ["bc"]: "beforeCreate hook",
  2536. ["c"]: "created hook",
  2537. ["bm"]: "beforeMount hook",
  2538. ["m"]: "mounted hook",
  2539. ["bu"]: "beforeUpdate hook",
  2540. ["u"]: "updated",
  2541. ["bum"]: "beforeUnmount hook",
  2542. ["um"]: "unmounted hook",
  2543. ["a"]: "activated hook",
  2544. ["da"]: "deactivated hook",
  2545. ["ec"]: "errorCaptured hook",
  2546. ["rtc"]: "renderTracked hook",
  2547. ["rtg"]: "renderTriggered hook",
  2548. [0]: "setup function",
  2549. [1]: "render function",
  2550. [2]: "watcher getter",
  2551. [3]: "watcher callback",
  2552. [4]: "watcher cleanup function",
  2553. [5]: "native event handler",
  2554. [6]: "component event handler",
  2555. [7]: "vnode hook",
  2556. [8]: "directive hook",
  2557. [9]: "transition hook",
  2558. [10]: "app errorHandler",
  2559. [11]: "app warnHandler",
  2560. [12]: "ref function",
  2561. [13]: "async component loader",
  2562. [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
  2563. };
  2564. function callWithErrorHandling(fn, instance, type, args) {
  2565. let res;
  2566. try {
  2567. res = args ? fn(...args) : fn();
  2568. } catch (err) {
  2569. handleError(err, instance, type);
  2570. }
  2571. return res;
  2572. }
  2573. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2574. if (isFunction(fn)) {
  2575. const res = callWithErrorHandling(fn, instance, type, args);
  2576. if (res && isPromise$1(res)) {
  2577. res.catch((err) => {
  2578. handleError(err, instance, type);
  2579. });
  2580. }
  2581. return res;
  2582. }
  2583. const values = [];
  2584. for (let i = 0; i < fn.length; i++) {
  2585. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2586. }
  2587. return values;
  2588. }
  2589. function handleError(err, instance, type, throwInDev = true) {
  2590. const contextVNode = instance ? instance.vnode : null;
  2591. if (instance) {
  2592. let cur = instance.parent;
  2593. const exposedInstance = instance.proxy;
  2594. const errorInfo = ErrorTypeStrings[type] || type;
  2595. while (cur) {
  2596. const errorCapturedHooks = cur.ec;
  2597. if (errorCapturedHooks) {
  2598. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2599. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2600. return;
  2601. }
  2602. }
  2603. }
  2604. cur = cur.parent;
  2605. }
  2606. const appErrorHandler = instance.appContext.config.errorHandler;
  2607. if (appErrorHandler) {
  2608. callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
  2609. return;
  2610. }
  2611. }
  2612. logError(err, type, contextVNode, throwInDev);
  2613. }
  2614. function logError(err, type, contextVNode, throwInDev = true) {
  2615. {
  2616. const info = ErrorTypeStrings[type] || type;
  2617. if (contextVNode) {
  2618. pushWarningContext(contextVNode);
  2619. }
  2620. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2621. if (contextVNode) {
  2622. popWarningContext();
  2623. }
  2624. if (throwInDev) {
  2625. console.error(err);
  2626. } else {
  2627. console.error(err);
  2628. }
  2629. }
  2630. }
  2631. let isFlushing = false;
  2632. let isFlushPending = false;
  2633. const queue = [];
  2634. let flushIndex = 0;
  2635. const pendingPreFlushCbs = [];
  2636. let activePreFlushCbs = null;
  2637. let preFlushIndex = 0;
  2638. const pendingPostFlushCbs = [];
  2639. let activePostFlushCbs = null;
  2640. let postFlushIndex = 0;
  2641. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2642. let currentFlushPromise = null;
  2643. let currentPreFlushParentJob = null;
  2644. const RECURSION_LIMIT = 100;
  2645. function nextTick(fn) {
  2646. const p2 = currentFlushPromise || resolvedPromise;
  2647. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  2648. }
  2649. function findInsertionIndex(id) {
  2650. let start = flushIndex + 1;
  2651. let end = queue.length;
  2652. while (start < end) {
  2653. const middle = start + end >>> 1;
  2654. const middleJobId = getId(queue[middle]);
  2655. middleJobId < id ? start = middle + 1 : end = middle;
  2656. }
  2657. return start;
  2658. }
  2659. function queueJob(job) {
  2660. if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
  2661. if (job.id == null) {
  2662. queue.push(job);
  2663. } else {
  2664. queue.splice(findInsertionIndex(job.id), 0, job);
  2665. }
  2666. queueFlush();
  2667. }
  2668. }
  2669. function queueFlush() {
  2670. if (!isFlushing && !isFlushPending) {
  2671. isFlushPending = true;
  2672. currentFlushPromise = resolvedPromise.then(flushJobs);
  2673. }
  2674. }
  2675. function hasQueueJob(job) {
  2676. return queue.indexOf(job) > -1;
  2677. }
  2678. function invalidateJob(job) {
  2679. const i = queue.indexOf(job);
  2680. if (i > flushIndex) {
  2681. queue.splice(i, 1);
  2682. }
  2683. }
  2684. function queueCb(cb, activeQueue, pendingQueue, index2) {
  2685. if (!isArray(cb)) {
  2686. if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index2 + 1 : index2)) {
  2687. pendingQueue.push(cb);
  2688. }
  2689. } else {
  2690. pendingQueue.push(...cb);
  2691. }
  2692. queueFlush();
  2693. }
  2694. function queuePreFlushCb(cb) {
  2695. queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
  2696. }
  2697. function queuePostFlushCb(cb) {
  2698. queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
  2699. }
  2700. function flushPreFlushCbs(seen, parentJob = null) {
  2701. if (pendingPreFlushCbs.length) {
  2702. currentPreFlushParentJob = parentJob;
  2703. activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
  2704. pendingPreFlushCbs.length = 0;
  2705. {
  2706. seen = seen || /* @__PURE__ */ new Map();
  2707. }
  2708. for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
  2709. if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
  2710. continue;
  2711. }
  2712. activePreFlushCbs[preFlushIndex]();
  2713. }
  2714. activePreFlushCbs = null;
  2715. preFlushIndex = 0;
  2716. currentPreFlushParentJob = null;
  2717. flushPreFlushCbs(seen, parentJob);
  2718. }
  2719. }
  2720. function flushPostFlushCbs(seen) {
  2721. flushPreFlushCbs();
  2722. if (pendingPostFlushCbs.length) {
  2723. const deduped = [...new Set(pendingPostFlushCbs)];
  2724. pendingPostFlushCbs.length = 0;
  2725. if (activePostFlushCbs) {
  2726. activePostFlushCbs.push(...deduped);
  2727. return;
  2728. }
  2729. activePostFlushCbs = deduped;
  2730. {
  2731. seen = seen || /* @__PURE__ */ new Map();
  2732. }
  2733. activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
  2734. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2735. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  2736. continue;
  2737. }
  2738. activePostFlushCbs[postFlushIndex]();
  2739. }
  2740. activePostFlushCbs = null;
  2741. postFlushIndex = 0;
  2742. }
  2743. }
  2744. const getId = (job) => job.id == null ? Infinity : job.id;
  2745. function flushJobs(seen) {
  2746. isFlushPending = false;
  2747. isFlushing = true;
  2748. {
  2749. seen = seen || /* @__PURE__ */ new Map();
  2750. }
  2751. flushPreFlushCbs(seen);
  2752. queue.sort((a, b) => getId(a) - getId(b));
  2753. const check = (job) => checkRecursiveUpdates(seen, job);
  2754. try {
  2755. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2756. const job = queue[flushIndex];
  2757. if (job && job.active !== false) {
  2758. if (check(job)) {
  2759. continue;
  2760. }
  2761. callWithErrorHandling(job, null, 14);
  2762. }
  2763. }
  2764. } finally {
  2765. flushIndex = 0;
  2766. queue.length = 0;
  2767. flushPostFlushCbs(seen);
  2768. isFlushing = false;
  2769. currentFlushPromise = null;
  2770. if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
  2771. flushJobs(seen);
  2772. }
  2773. }
  2774. }
  2775. function checkRecursiveUpdates(seen, fn) {
  2776. if (!seen.has(fn)) {
  2777. seen.set(fn, 1);
  2778. } else {
  2779. const count = seen.get(fn);
  2780. if (count > RECURSION_LIMIT) {
  2781. const instance = fn.ownerInstance;
  2782. const componentName = instance && getComponentName(instance.type);
  2783. warn$1(`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.`);
  2784. return true;
  2785. } else {
  2786. seen.set(fn, count + 1);
  2787. }
  2788. }
  2789. }
  2790. function emit(event, ...args) {
  2791. }
  2792. function devtoolsComponentEmit(component, event, params) {
  2793. emit("component:emit", component.appContext.app, component, event, params);
  2794. }
  2795. function emit$1(instance, event, ...rawArgs) {
  2796. if (instance.isUnmounted)
  2797. return;
  2798. const props = instance.vnode.props || EMPTY_OBJ;
  2799. {
  2800. const { emitsOptions, propsOptions: [propsOptions] } = instance;
  2801. if (emitsOptions) {
  2802. if (!(event in emitsOptions) && true) {
  2803. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  2804. warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`);
  2805. }
  2806. } else {
  2807. const validator = emitsOptions[event];
  2808. if (isFunction(validator)) {
  2809. const isValid = validator(...rawArgs);
  2810. if (!isValid) {
  2811. warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
  2812. }
  2813. }
  2814. }
  2815. }
  2816. }
  2817. let args = rawArgs;
  2818. const isModelListener2 = event.startsWith("update:");
  2819. const modelArg = isModelListener2 && event.slice(7);
  2820. if (modelArg && modelArg in props) {
  2821. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  2822. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  2823. if (trim) {
  2824. args = rawArgs.map((a) => a.trim());
  2825. }
  2826. if (number) {
  2827. args = rawArgs.map(toNumber);
  2828. }
  2829. }
  2830. {
  2831. devtoolsComponentEmit(instance, event, args);
  2832. }
  2833. {
  2834. const lowerCaseEvent = event.toLowerCase();
  2835. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  2836. warn$1(`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}".`);
  2837. }
  2838. }
  2839. let handlerName;
  2840. let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize(event))];
  2841. if (!handler && isModelListener2) {
  2842. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  2843. }
  2844. if (handler) {
  2845. callWithAsyncErrorHandling(handler, instance, 6, args);
  2846. }
  2847. const onceHandler = props[handlerName + `Once`];
  2848. if (onceHandler) {
  2849. if (!instance.emitted) {
  2850. instance.emitted = {};
  2851. } else if (instance.emitted[handlerName]) {
  2852. return;
  2853. }
  2854. instance.emitted[handlerName] = true;
  2855. callWithAsyncErrorHandling(onceHandler, instance, 6, args);
  2856. }
  2857. }
  2858. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  2859. const cache = appContext.emitsCache;
  2860. const cached = cache.get(comp);
  2861. if (cached !== void 0) {
  2862. return cached;
  2863. }
  2864. const raw = comp.emits;
  2865. let normalized = {};
  2866. let hasExtends = false;
  2867. if (!isFunction(comp)) {
  2868. const extendEmits = (raw2) => {
  2869. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  2870. if (normalizedFromExtend) {
  2871. hasExtends = true;
  2872. extend(normalized, normalizedFromExtend);
  2873. }
  2874. };
  2875. if (!asMixin && appContext.mixins.length) {
  2876. appContext.mixins.forEach(extendEmits);
  2877. }
  2878. if (comp.extends) {
  2879. extendEmits(comp.extends);
  2880. }
  2881. if (comp.mixins) {
  2882. comp.mixins.forEach(extendEmits);
  2883. }
  2884. }
  2885. if (!raw && !hasExtends) {
  2886. cache.set(comp, null);
  2887. return null;
  2888. }
  2889. if (isArray(raw)) {
  2890. raw.forEach((key) => normalized[key] = null);
  2891. } else {
  2892. extend(normalized, raw);
  2893. }
  2894. cache.set(comp, normalized);
  2895. return normalized;
  2896. }
  2897. function isEmitListener(options, key) {
  2898. if (!options || !isOn(key)) {
  2899. return false;
  2900. }
  2901. key = key.slice(2).replace(/Once$/, "");
  2902. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  2903. }
  2904. let currentRenderingInstance = null;
  2905. function setCurrentRenderingInstance(instance) {
  2906. const prev = currentRenderingInstance;
  2907. currentRenderingInstance = instance;
  2908. instance && instance.type.__scopeId || null;
  2909. return prev;
  2910. }
  2911. function provide(key, value) {
  2912. if (!currentInstance) {
  2913. {
  2914. warn$1(`provide() can only be used inside setup().`);
  2915. }
  2916. } else {
  2917. let provides = currentInstance.provides;
  2918. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2919. if (parentProvides === provides) {
  2920. provides = currentInstance.provides = Object.create(parentProvides);
  2921. }
  2922. provides[key] = value;
  2923. if (currentInstance.type.mpType === "app") {
  2924. currentInstance.appContext.app.provide(key, value);
  2925. }
  2926. }
  2927. }
  2928. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2929. const instance = currentInstance || currentRenderingInstance;
  2930. if (instance) {
  2931. const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides;
  2932. if (provides && key in provides) {
  2933. return provides[key];
  2934. } else if (arguments.length > 1) {
  2935. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue;
  2936. } else {
  2937. warn$1(`injection "${String(key)}" not found.`);
  2938. }
  2939. } else {
  2940. warn$1(`inject() can only be used inside setup() or functional components.`);
  2941. }
  2942. }
  2943. function watchEffect(effect, options) {
  2944. return doWatch(effect, null, options);
  2945. }
  2946. const INITIAL_WATCHER_VALUE = {};
  2947. function watch(source, cb, options) {
  2948. if (!isFunction(cb)) {
  2949. warn$1(`\`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.`);
  2950. }
  2951. return doWatch(source, cb, options);
  2952. }
  2953. function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
  2954. if (!cb) {
  2955. if (immediate !== void 0) {
  2956. warn$1(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`);
  2957. }
  2958. if (deep !== void 0) {
  2959. warn$1(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`);
  2960. }
  2961. }
  2962. const warnInvalidSource = (s2) => {
  2963. warn$1(`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.`);
  2964. };
  2965. const instance = currentInstance;
  2966. let getter;
  2967. let forceTrigger = false;
  2968. let isMultiSource = false;
  2969. if (isRef(source)) {
  2970. getter = () => source.value;
  2971. forceTrigger = isShallow(source);
  2972. } else if (isReactive(source)) {
  2973. getter = () => source;
  2974. deep = true;
  2975. } else if (isArray(source)) {
  2976. isMultiSource = true;
  2977. forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
  2978. getter = () => source.map((s2) => {
  2979. if (isRef(s2)) {
  2980. return s2.value;
  2981. } else if (isReactive(s2)) {
  2982. return traverse(s2);
  2983. } else if (isFunction(s2)) {
  2984. return callWithErrorHandling(s2, instance, 2);
  2985. } else {
  2986. warnInvalidSource(s2);
  2987. }
  2988. });
  2989. } else if (isFunction(source)) {
  2990. if (cb) {
  2991. getter = () => callWithErrorHandling(source, instance, 2);
  2992. } else {
  2993. getter = () => {
  2994. if (instance && instance.isUnmounted) {
  2995. return;
  2996. }
  2997. if (cleanup) {
  2998. cleanup();
  2999. }
  3000. return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
  3001. };
  3002. }
  3003. } else {
  3004. getter = NOOP;
  3005. warnInvalidSource(source);
  3006. }
  3007. if (cb && deep) {
  3008. const baseGetter = getter;
  3009. getter = () => traverse(baseGetter());
  3010. }
  3011. let cleanup;
  3012. let onCleanup = (fn) => {
  3013. cleanup = effect.onStop = () => {
  3014. callWithErrorHandling(fn, instance, 4);
  3015. };
  3016. };
  3017. let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
  3018. const job = () => {
  3019. if (!effect.active) {
  3020. return;
  3021. }
  3022. if (cb) {
  3023. const newValue = effect.run();
  3024. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  3025. if (cleanup) {
  3026. cleanup();
  3027. }
  3028. callWithAsyncErrorHandling(cb, instance, 3, [
  3029. newValue,
  3030. oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
  3031. onCleanup
  3032. ]);
  3033. oldValue = newValue;
  3034. }
  3035. } else {
  3036. effect.run();
  3037. }
  3038. };
  3039. job.allowRecurse = !!cb;
  3040. let scheduler;
  3041. if (flush === "sync") {
  3042. scheduler = job;
  3043. } else if (flush === "post") {
  3044. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  3045. } else {
  3046. scheduler = () => {
  3047. if (!instance || instance.isMounted) {
  3048. queuePreFlushCb(job);
  3049. } else {
  3050. job();
  3051. }
  3052. };
  3053. }
  3054. const effect = new ReactiveEffect(getter, scheduler);
  3055. {
  3056. effect.onTrack = onTrack;
  3057. effect.onTrigger = onTrigger;
  3058. }
  3059. if (cb) {
  3060. if (immediate) {
  3061. job();
  3062. } else {
  3063. oldValue = effect.run();
  3064. }
  3065. } else if (flush === "post") {
  3066. queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);
  3067. } else {
  3068. effect.run();
  3069. }
  3070. return () => {
  3071. effect.stop();
  3072. if (instance && instance.scope) {
  3073. remove(instance.scope.effects, effect);
  3074. }
  3075. };
  3076. }
  3077. function instanceWatch(source, value, options) {
  3078. const publicThis = this.proxy;
  3079. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3080. let cb;
  3081. if (isFunction(value)) {
  3082. cb = value;
  3083. } else {
  3084. cb = value.handler;
  3085. options = value;
  3086. }
  3087. const cur = currentInstance;
  3088. setCurrentInstance(this);
  3089. const res = doWatch(getter, cb.bind(publicThis), options);
  3090. if (cur) {
  3091. setCurrentInstance(cur);
  3092. } else {
  3093. unsetCurrentInstance();
  3094. }
  3095. return res;
  3096. }
  3097. function createPathGetter(ctx, path) {
  3098. const segments = path.split(".");
  3099. return () => {
  3100. let cur = ctx;
  3101. for (let i = 0; i < segments.length && cur; i++) {
  3102. cur = cur[segments[i]];
  3103. }
  3104. return cur;
  3105. };
  3106. }
  3107. function traverse(value, seen) {
  3108. if (!isObject$1(value) || value["__v_skip"]) {
  3109. return value;
  3110. }
  3111. seen = seen || /* @__PURE__ */ new Set();
  3112. if (seen.has(value)) {
  3113. return value;
  3114. }
  3115. seen.add(value);
  3116. if (isRef(value)) {
  3117. traverse(value.value, seen);
  3118. } else if (isArray(value)) {
  3119. for (let i = 0; i < value.length; i++) {
  3120. traverse(value[i], seen);
  3121. }
  3122. } else if (isSet(value) || isMap(value)) {
  3123. value.forEach((v) => {
  3124. traverse(v, seen);
  3125. });
  3126. } else if (isPlainObject(value)) {
  3127. for (const key in value) {
  3128. traverse(value[key], seen);
  3129. }
  3130. }
  3131. return value;
  3132. }
  3133. function defineComponent(options) {
  3134. return isFunction(options) ? { setup: options, name: options.name } : options;
  3135. }
  3136. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3137. function onActivated(hook, target) {
  3138. registerKeepAliveHook(hook, "a", target);
  3139. }
  3140. function onDeactivated(hook, target) {
  3141. registerKeepAliveHook(hook, "da", target);
  3142. }
  3143. function registerKeepAliveHook(hook, type, target = currentInstance) {
  3144. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  3145. let current = target;
  3146. while (current) {
  3147. if (current.isDeactivated) {
  3148. return;
  3149. }
  3150. current = current.parent;
  3151. }
  3152. return hook();
  3153. });
  3154. injectHook(type, wrappedHook, target);
  3155. if (target) {
  3156. let current = target.parent;
  3157. while (current && current.parent) {
  3158. if (isKeepAlive(current.parent.vnode)) {
  3159. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3160. }
  3161. current = current.parent;
  3162. }
  3163. }
  3164. }
  3165. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3166. const injected = injectHook(type, hook, keepAliveRoot, true);
  3167. onUnmounted(() => {
  3168. remove(keepAliveRoot[type], injected);
  3169. }, target);
  3170. }
  3171. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3172. if (target) {
  3173. if (isRootHook(type)) {
  3174. target = target.root;
  3175. }
  3176. const hooks = target[type] || (target[type] = []);
  3177. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3178. if (target.isUnmounted) {
  3179. return;
  3180. }
  3181. pauseTracking();
  3182. setCurrentInstance(target);
  3183. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3184. unsetCurrentInstance();
  3185. resetTracking();
  3186. return res;
  3187. });
  3188. if (prepend) {
  3189. hooks.unshift(wrappedHook);
  3190. } else {
  3191. hooks.push(wrappedHook);
  3192. }
  3193. return wrappedHook;
  3194. } else {
  3195. const apiName = toHandlerKey((ErrorTypeStrings[type] || type.replace(/^on/, "")).replace(/ hook$/, ""));
  3196. warn$1(`${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().`);
  3197. }
  3198. }
  3199. const createHook$1 = (lifecycle) => (hook, target = currentInstance) => (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, hook, target);
  3200. const onBeforeMount = createHook$1("bm");
  3201. const onMounted = createHook$1("m");
  3202. const onBeforeUpdate = createHook$1("bu");
  3203. const onUpdated = createHook$1("u");
  3204. const onBeforeUnmount = createHook$1("bum");
  3205. const onUnmounted = createHook$1("um");
  3206. const onServerPrefetch = createHook$1("sp");
  3207. const onRenderTriggered = createHook$1("rtg");
  3208. const onRenderTracked = createHook$1("rtc");
  3209. function onErrorCaptured(hook, target = currentInstance) {
  3210. injectHook("ec", hook, target);
  3211. }
  3212. function validateDirectiveName(name) {
  3213. if (isBuiltInDirective(name)) {
  3214. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  3215. }
  3216. }
  3217. const COMPONENTS = "components";
  3218. function resolveComponent(name, maybeSelfReference) {
  3219. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3220. }
  3221. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3222. const instance = currentRenderingInstance || currentInstance;
  3223. if (instance) {
  3224. const Component2 = instance.type;
  3225. if (type === COMPONENTS) {
  3226. const selfName = getComponentName(Component2, false);
  3227. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3228. return Component2;
  3229. }
  3230. }
  3231. const res = resolve(instance[type] || Component2[type], name) || resolve(instance.appContext[type], name);
  3232. if (!res && maybeSelfReference) {
  3233. return Component2;
  3234. }
  3235. if (warnMissing && !res) {
  3236. const extra = type === COMPONENTS ? `
  3237. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3238. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3239. }
  3240. return res;
  3241. } else {
  3242. warn$1(`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`);
  3243. }
  3244. }
  3245. function resolve(registry, name) {
  3246. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3247. }
  3248. const getPublicInstance = (i) => {
  3249. if (!i)
  3250. return null;
  3251. if (isStatefulComponent(i))
  3252. return getExposeProxy(i) || i.proxy;
  3253. return getPublicInstance(i.parent);
  3254. };
  3255. const publicPropertiesMap = /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3256. $: (i) => i,
  3257. $el: (i) => i.__$el || (i.__$el = {}),
  3258. $data: (i) => i.data,
  3259. $props: (i) => shallowReadonly(i.props),
  3260. $attrs: (i) => shallowReadonly(i.attrs),
  3261. $slots: (i) => shallowReadonly(i.slots),
  3262. $refs: (i) => shallowReadonly(i.refs),
  3263. $parent: (i) => getPublicInstance(i.parent),
  3264. $root: (i) => getPublicInstance(i.root),
  3265. $emit: (i) => i.emit,
  3266. $options: (i) => resolveMergedOptions(i),
  3267. $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
  3268. $watch: (i) => instanceWatch.bind(i)
  3269. });
  3270. const isReservedPrefix = (key) => key === "_" || key === "$";
  3271. const PublicInstanceProxyHandlers = {
  3272. get({ _: instance }, key) {
  3273. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3274. if (key === "__isVue") {
  3275. return true;
  3276. }
  3277. if (setupState !== EMPTY_OBJ && setupState.__isScriptSetup && hasOwn(setupState, key)) {
  3278. return setupState[key];
  3279. }
  3280. let normalizedProps;
  3281. if (key[0] !== "$") {
  3282. const n2 = accessCache[key];
  3283. if (n2 !== void 0) {
  3284. switch (n2) {
  3285. case 1:
  3286. return setupState[key];
  3287. case 2:
  3288. return data[key];
  3289. case 4:
  3290. return ctx[key];
  3291. case 3:
  3292. return props[key];
  3293. }
  3294. } else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
  3295. accessCache[key] = 1;
  3296. return setupState[key];
  3297. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3298. accessCache[key] = 2;
  3299. return data[key];
  3300. } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) {
  3301. accessCache[key] = 3;
  3302. return props[key];
  3303. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3304. accessCache[key] = 4;
  3305. return ctx[key];
  3306. } else if (shouldCacheAccess) {
  3307. accessCache[key] = 0;
  3308. }
  3309. }
  3310. const publicGetter = publicPropertiesMap[key];
  3311. let cssModule, globalProperties;
  3312. if (publicGetter) {
  3313. if (key === "$attrs") {
  3314. track(instance, "get", key);
  3315. }
  3316. return publicGetter(instance);
  3317. } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) {
  3318. return cssModule;
  3319. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3320. accessCache[key] = 4;
  3321. return ctx[key];
  3322. } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) {
  3323. {
  3324. return globalProperties[key];
  3325. }
  3326. } else if (currentRenderingInstance && (!isString(key) || key.indexOf("__v") !== 0)) {
  3327. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  3328. warn$1(`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.`);
  3329. } else if (instance === currentRenderingInstance) {
  3330. warn$1(`Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`);
  3331. }
  3332. }
  3333. },
  3334. set({ _: instance }, key, value) {
  3335. const { data, setupState, ctx } = instance;
  3336. if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
  3337. setupState[key] = value;
  3338. return true;
  3339. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3340. data[key] = value;
  3341. return true;
  3342. } else if (hasOwn(instance.props, key)) {
  3343. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
  3344. return false;
  3345. }
  3346. if (key[0] === "$" && key.slice(1) in instance) {
  3347. warn$1(`Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`, instance);
  3348. return false;
  3349. } else {
  3350. if (key in instance.appContext.config.globalProperties) {
  3351. Object.defineProperty(ctx, key, {
  3352. enumerable: true,
  3353. configurable: true,
  3354. value
  3355. });
  3356. } else {
  3357. ctx[key] = value;
  3358. }
  3359. }
  3360. return true;
  3361. },
  3362. has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
  3363. let normalizedProps;
  3364. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
  3365. },
  3366. defineProperty(target, key, descriptor) {
  3367. if (descriptor.get != null) {
  3368. target._.accessCache[key] = 0;
  3369. } else if (hasOwn(descriptor, "value")) {
  3370. this.set(target, key, descriptor.value, null);
  3371. }
  3372. return Reflect.defineProperty(target, key, descriptor);
  3373. }
  3374. };
  3375. {
  3376. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3377. warn$1(`Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`);
  3378. return Reflect.ownKeys(target);
  3379. };
  3380. }
  3381. function createDevRenderContext(instance) {
  3382. const target = {};
  3383. Object.defineProperty(target, `_`, {
  3384. configurable: true,
  3385. enumerable: false,
  3386. get: () => instance
  3387. });
  3388. Object.keys(publicPropertiesMap).forEach((key) => {
  3389. Object.defineProperty(target, key, {
  3390. configurable: true,
  3391. enumerable: false,
  3392. get: () => publicPropertiesMap[key](instance),
  3393. set: NOOP
  3394. });
  3395. });
  3396. return target;
  3397. }
  3398. function exposePropsOnRenderContext(instance) {
  3399. const { ctx, propsOptions: [propsOptions] } = instance;
  3400. if (propsOptions) {
  3401. Object.keys(propsOptions).forEach((key) => {
  3402. Object.defineProperty(ctx, key, {
  3403. enumerable: true,
  3404. configurable: true,
  3405. get: () => instance.props[key],
  3406. set: NOOP
  3407. });
  3408. });
  3409. }
  3410. }
  3411. function exposeSetupStateOnRenderContext(instance) {
  3412. const { ctx, setupState } = instance;
  3413. Object.keys(toRaw(setupState)).forEach((key) => {
  3414. if (!setupState.__isScriptSetup) {
  3415. if (isReservedPrefix(key[0])) {
  3416. warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);
  3417. return;
  3418. }
  3419. Object.defineProperty(ctx, key, {
  3420. enumerable: true,
  3421. configurable: true,
  3422. get: () => setupState[key],
  3423. set: NOOP
  3424. });
  3425. }
  3426. });
  3427. }
  3428. function createDuplicateChecker() {
  3429. const cache = /* @__PURE__ */ Object.create(null);
  3430. return (type, key) => {
  3431. if (cache[key]) {
  3432. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3433. } else {
  3434. cache[key] = type;
  3435. }
  3436. };
  3437. }
  3438. let shouldCacheAccess = true;
  3439. function applyOptions$1(instance) {
  3440. const options = resolveMergedOptions(instance);
  3441. const publicThis = instance.proxy;
  3442. const ctx = instance.ctx;
  3443. shouldCacheAccess = false;
  3444. if (options.beforeCreate) {
  3445. callHook$1(options.beforeCreate, instance, "bc");
  3446. }
  3447. const {
  3448. data: dataOptions,
  3449. computed: computedOptions,
  3450. methods,
  3451. watch: watchOptions,
  3452. provide: provideOptions,
  3453. inject: injectOptions,
  3454. created,
  3455. beforeMount,
  3456. mounted,
  3457. beforeUpdate,
  3458. updated,
  3459. activated,
  3460. deactivated,
  3461. beforeDestroy,
  3462. beforeUnmount,
  3463. destroyed,
  3464. unmounted,
  3465. render,
  3466. renderTracked,
  3467. renderTriggered,
  3468. errorCaptured,
  3469. serverPrefetch,
  3470. expose,
  3471. inheritAttrs,
  3472. components,
  3473. directives,
  3474. filters
  3475. } = options;
  3476. const checkDuplicateProperties = createDuplicateChecker();
  3477. {
  3478. const [propsOptions] = instance.propsOptions;
  3479. if (propsOptions) {
  3480. for (const key in propsOptions) {
  3481. checkDuplicateProperties("Props", key);
  3482. }
  3483. }
  3484. }
  3485. if (injectOptions) {
  3486. resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);
  3487. }
  3488. if (methods) {
  3489. for (const key in methods) {
  3490. const methodHandler = methods[key];
  3491. if (isFunction(methodHandler)) {
  3492. {
  3493. Object.defineProperty(ctx, key, {
  3494. value: methodHandler.bind(publicThis),
  3495. configurable: true,
  3496. enumerable: true,
  3497. writable: true
  3498. });
  3499. }
  3500. {
  3501. checkDuplicateProperties("Methods", key);
  3502. }
  3503. } else {
  3504. warn$1(`Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`);
  3505. }
  3506. }
  3507. }
  3508. if (dataOptions) {
  3509. if (!isFunction(dataOptions)) {
  3510. warn$1(`The data option must be a function. Plain object usage is no longer supported.`);
  3511. }
  3512. const data = dataOptions.call(publicThis, publicThis);
  3513. if (isPromise$1(data)) {
  3514. warn$1(`data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`);
  3515. }
  3516. if (!isObject$1(data)) {
  3517. warn$1(`data() should return an object.`);
  3518. } else {
  3519. instance.data = reactive(data);
  3520. {
  3521. for (const key in data) {
  3522. checkDuplicateProperties("Data", key);
  3523. if (!isReservedPrefix(key[0])) {
  3524. Object.defineProperty(ctx, key, {
  3525. configurable: true,
  3526. enumerable: true,
  3527. get: () => data[key],
  3528. set: NOOP
  3529. });
  3530. }
  3531. }
  3532. }
  3533. }
  3534. }
  3535. shouldCacheAccess = true;
  3536. if (computedOptions) {
  3537. for (const key in computedOptions) {
  3538. const opt = computedOptions[key];
  3539. const get3 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3540. if (get3 === NOOP) {
  3541. warn$1(`Computed property "${key}" has no getter.`);
  3542. }
  3543. const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3544. warn$1(`Write operation failed: computed property "${key}" is readonly.`);
  3545. };
  3546. const c = computed$1({
  3547. get: get3,
  3548. set: set2
  3549. });
  3550. Object.defineProperty(ctx, key, {
  3551. enumerable: true,
  3552. configurable: true,
  3553. get: () => c.value,
  3554. set: (v) => c.value = v
  3555. });
  3556. {
  3557. checkDuplicateProperties("Computed", key);
  3558. }
  3559. }
  3560. }
  3561. if (watchOptions) {
  3562. for (const key in watchOptions) {
  3563. createWatcher(watchOptions[key], ctx, publicThis, key);
  3564. }
  3565. }
  3566. {
  3567. if (provideOptions) {
  3568. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3569. Reflect.ownKeys(provides).forEach((key) => {
  3570. provide(key, provides[key]);
  3571. });
  3572. }
  3573. }
  3574. {
  3575. if (created) {
  3576. callHook$1(created, instance, "c");
  3577. }
  3578. }
  3579. function registerLifecycleHook(register2, hook) {
  3580. if (isArray(hook)) {
  3581. hook.forEach((_hook) => register2(_hook.bind(publicThis)));
  3582. } else if (hook) {
  3583. register2(hook.bind(publicThis));
  3584. }
  3585. }
  3586. registerLifecycleHook(onBeforeMount, beforeMount);
  3587. registerLifecycleHook(onMounted, mounted);
  3588. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3589. registerLifecycleHook(onUpdated, updated);
  3590. registerLifecycleHook(onActivated, activated);
  3591. registerLifecycleHook(onDeactivated, deactivated);
  3592. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3593. registerLifecycleHook(onRenderTracked, renderTracked);
  3594. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3595. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3596. registerLifecycleHook(onUnmounted, unmounted);
  3597. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3598. if (isArray(expose)) {
  3599. if (expose.length) {
  3600. const exposed = instance.exposed || (instance.exposed = {});
  3601. expose.forEach((key) => {
  3602. Object.defineProperty(exposed, key, {
  3603. get: () => publicThis[key],
  3604. set: (val) => publicThis[key] = val
  3605. });
  3606. });
  3607. } else if (!instance.exposed) {
  3608. instance.exposed = {};
  3609. }
  3610. }
  3611. if (render && instance.render === NOOP) {
  3612. instance.render = render;
  3613. }
  3614. if (inheritAttrs != null) {
  3615. instance.inheritAttrs = inheritAttrs;
  3616. }
  3617. if (components)
  3618. instance.components = components;
  3619. if (directives)
  3620. instance.directives = directives;
  3621. if (instance.ctx.$onApplyOptions) {
  3622. instance.ctx.$onApplyOptions(options, instance, publicThis);
  3623. }
  3624. }
  3625. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) {
  3626. if (isArray(injectOptions)) {
  3627. injectOptions = normalizeInject(injectOptions);
  3628. }
  3629. for (const key in injectOptions) {
  3630. const opt = injectOptions[key];
  3631. let injected;
  3632. if (isObject$1(opt)) {
  3633. if ("default" in opt) {
  3634. injected = inject(opt.from || key, opt.default, true);
  3635. } else {
  3636. injected = inject(opt.from || key);
  3637. }
  3638. } else {
  3639. injected = inject(opt);
  3640. }
  3641. if (isRef(injected)) {
  3642. if (unwrapRef) {
  3643. Object.defineProperty(ctx, key, {
  3644. enumerable: true,
  3645. configurable: true,
  3646. get: () => injected.value,
  3647. set: (v) => injected.value = v
  3648. });
  3649. } else {
  3650. {
  3651. warn$1(`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.)`);
  3652. }
  3653. ctx[key] = injected;
  3654. }
  3655. } else {
  3656. ctx[key] = injected;
  3657. }
  3658. {
  3659. checkDuplicateProperties("Inject", key);
  3660. }
  3661. }
  3662. }
  3663. function callHook$1(hook, instance, type) {
  3664. callWithAsyncErrorHandling(isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type);
  3665. }
  3666. function createWatcher(raw, ctx, publicThis, key) {
  3667. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3668. if (isString(raw)) {
  3669. const handler = ctx[raw];
  3670. if (isFunction(handler)) {
  3671. watch(getter, handler);
  3672. } else {
  3673. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3674. }
  3675. } else if (isFunction(raw)) {
  3676. watch(getter, raw.bind(publicThis));
  3677. } else if (isObject$1(raw)) {
  3678. if (isArray(raw)) {
  3679. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3680. } else {
  3681. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3682. if (isFunction(handler)) {
  3683. watch(getter, handler, raw);
  3684. } else {
  3685. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3686. }
  3687. }
  3688. } else {
  3689. warn$1(`Invalid watch option: "${key}"`, raw);
  3690. }
  3691. }
  3692. function resolveMergedOptions(instance) {
  3693. const base = instance.type;
  3694. const { mixins, extends: extendsOptions } = base;
  3695. const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
  3696. const cached = cache.get(base);
  3697. let resolved;
  3698. if (cached) {
  3699. resolved = cached;
  3700. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3701. {
  3702. resolved = base;
  3703. }
  3704. } else {
  3705. resolved = {};
  3706. if (globalMixins.length) {
  3707. globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
  3708. }
  3709. mergeOptions(resolved, base, optionMergeStrategies);
  3710. }
  3711. cache.set(base, resolved);
  3712. return resolved;
  3713. }
  3714. function mergeOptions(to, from, strats, asMixin = false) {
  3715. const { mixins, extends: extendsOptions } = from;
  3716. if (extendsOptions) {
  3717. mergeOptions(to, extendsOptions, strats, true);
  3718. }
  3719. if (mixins) {
  3720. mixins.forEach((m) => mergeOptions(to, m, strats, true));
  3721. }
  3722. for (const key in from) {
  3723. if (asMixin && key === "expose") {
  3724. warn$1(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);
  3725. } else {
  3726. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3727. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3728. }
  3729. }
  3730. return to;
  3731. }
  3732. const internalOptionMergeStrats = {
  3733. data: mergeDataFn,
  3734. props: mergeObjectOptions,
  3735. emits: mergeObjectOptions,
  3736. methods: mergeObjectOptions,
  3737. computed: mergeObjectOptions,
  3738. beforeCreate: mergeAsArray$1,
  3739. created: mergeAsArray$1,
  3740. beforeMount: mergeAsArray$1,
  3741. mounted: mergeAsArray$1,
  3742. beforeUpdate: mergeAsArray$1,
  3743. updated: mergeAsArray$1,
  3744. beforeDestroy: mergeAsArray$1,
  3745. beforeUnmount: mergeAsArray$1,
  3746. destroyed: mergeAsArray$1,
  3747. unmounted: mergeAsArray$1,
  3748. activated: mergeAsArray$1,
  3749. deactivated: mergeAsArray$1,
  3750. errorCaptured: mergeAsArray$1,
  3751. serverPrefetch: mergeAsArray$1,
  3752. components: mergeObjectOptions,
  3753. directives: mergeObjectOptions,
  3754. watch: mergeWatchOptions,
  3755. provide: mergeDataFn,
  3756. inject: mergeInject
  3757. };
  3758. function mergeDataFn(to, from) {
  3759. if (!from) {
  3760. return to;
  3761. }
  3762. if (!to) {
  3763. return from;
  3764. }
  3765. return function mergedDataFn() {
  3766. return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
  3767. };
  3768. }
  3769. function mergeInject(to, from) {
  3770. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3771. }
  3772. function normalizeInject(raw) {
  3773. if (isArray(raw)) {
  3774. const res = {};
  3775. for (let i = 0; i < raw.length; i++) {
  3776. res[raw[i]] = raw[i];
  3777. }
  3778. return res;
  3779. }
  3780. return raw;
  3781. }
  3782. function mergeAsArray$1(to, from) {
  3783. return to ? [...new Set([].concat(to, from))] : from;
  3784. }
  3785. function mergeObjectOptions(to, from) {
  3786. return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from;
  3787. }
  3788. function mergeWatchOptions(to, from) {
  3789. if (!to)
  3790. return from;
  3791. if (!from)
  3792. return to;
  3793. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3794. for (const key in from) {
  3795. merged[key] = mergeAsArray$1(to[key], from[key]);
  3796. }
  3797. return merged;
  3798. }
  3799. function initProps$1(instance, rawProps, isStateful, isSSR = false) {
  3800. const props = {};
  3801. const attrs = {};
  3802. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3803. setFullProps(instance, rawProps, props, attrs);
  3804. for (const key in instance.propsOptions[0]) {
  3805. if (!(key in props)) {
  3806. props[key] = void 0;
  3807. }
  3808. }
  3809. {
  3810. validateProps(rawProps || {}, props, instance);
  3811. }
  3812. if (isStateful) {
  3813. instance.props = isSSR ? props : shallowReactive(props);
  3814. } else {
  3815. if (!instance.type.props) {
  3816. instance.props = attrs;
  3817. } else {
  3818. instance.props = props;
  3819. }
  3820. }
  3821. instance.attrs = attrs;
  3822. }
  3823. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3824. const { props, attrs, vnode: { patchFlag } } = instance;
  3825. const rawCurrentProps = toRaw(props);
  3826. const [options] = instance.propsOptions;
  3827. let hasAttrsChanged = false;
  3828. if (!(instance.type.__hmrId || instance.parent && instance.parent.type.__hmrId) && (optimized || patchFlag > 0) && !(patchFlag & 16)) {
  3829. if (patchFlag & 8) {
  3830. const propsToUpdate = instance.vnode.dynamicProps;
  3831. for (let i = 0; i < propsToUpdate.length; i++) {
  3832. let key = propsToUpdate[i];
  3833. if (isEmitListener(instance.emitsOptions, key)) {
  3834. continue;
  3835. }
  3836. const value = rawProps[key];
  3837. if (options) {
  3838. if (hasOwn(attrs, key)) {
  3839. if (value !== attrs[key]) {
  3840. attrs[key] = value;
  3841. hasAttrsChanged = true;
  3842. }
  3843. } else {
  3844. const camelizedKey = camelize(key);
  3845. props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false);
  3846. }
  3847. } else {
  3848. if (value !== attrs[key]) {
  3849. attrs[key] = value;
  3850. hasAttrsChanged = true;
  3851. }
  3852. }
  3853. }
  3854. }
  3855. } else {
  3856. if (setFullProps(instance, rawProps, props, attrs)) {
  3857. hasAttrsChanged = true;
  3858. }
  3859. let kebabKey;
  3860. for (const key in rawCurrentProps) {
  3861. if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  3862. if (options) {
  3863. if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) {
  3864. props[key] = resolvePropValue(options, rawCurrentProps, key, void 0, instance, true);
  3865. }
  3866. } else {
  3867. delete props[key];
  3868. }
  3869. }
  3870. }
  3871. if (attrs !== rawCurrentProps) {
  3872. for (const key in attrs) {
  3873. if (!rawProps || !hasOwn(rawProps, key) && true) {
  3874. delete attrs[key];
  3875. hasAttrsChanged = true;
  3876. }
  3877. }
  3878. }
  3879. }
  3880. if (hasAttrsChanged) {
  3881. trigger(instance, "set", "$attrs");
  3882. }
  3883. {
  3884. validateProps(rawProps || {}, props, instance);
  3885. }
  3886. }
  3887. function setFullProps(instance, rawProps, props, attrs) {
  3888. const [options, needCastKeys] = instance.propsOptions;
  3889. let hasAttrsChanged = false;
  3890. let rawCastValues;
  3891. if (rawProps) {
  3892. for (let key in rawProps) {
  3893. if (isReservedProp(key)) {
  3894. continue;
  3895. }
  3896. const value = rawProps[key];
  3897. let camelKey;
  3898. if (options && hasOwn(options, camelKey = camelize(key))) {
  3899. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3900. props[camelKey] = value;
  3901. } else {
  3902. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3903. }
  3904. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3905. if (!(key in attrs) || value !== attrs[key]) {
  3906. attrs[key] = value;
  3907. hasAttrsChanged = true;
  3908. }
  3909. }
  3910. }
  3911. }
  3912. if (needCastKeys) {
  3913. const rawCurrentProps = toRaw(props);
  3914. const castValues = rawCastValues || EMPTY_OBJ;
  3915. for (let i = 0; i < needCastKeys.length; i++) {
  3916. const key = needCastKeys[i];
  3917. props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !hasOwn(castValues, key));
  3918. }
  3919. }
  3920. return hasAttrsChanged;
  3921. }
  3922. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3923. const opt = options[key];
  3924. if (opt != null) {
  3925. const hasDefault = hasOwn(opt, "default");
  3926. if (hasDefault && value === void 0) {
  3927. const defaultValue = opt.default;
  3928. if (opt.type !== Function && isFunction(defaultValue)) {
  3929. const { propsDefaults } = instance;
  3930. if (key in propsDefaults) {
  3931. value = propsDefaults[key];
  3932. } else {
  3933. setCurrentInstance(instance);
  3934. value = propsDefaults[key] = defaultValue.call(null, props);
  3935. unsetCurrentInstance();
  3936. }
  3937. } else {
  3938. value = defaultValue;
  3939. }
  3940. }
  3941. if (opt[0]) {
  3942. if (isAbsent && !hasDefault) {
  3943. value = false;
  3944. } else if (opt[1] && (value === "" || value === hyphenate(key))) {
  3945. value = true;
  3946. }
  3947. }
  3948. }
  3949. return value;
  3950. }
  3951. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3952. const cache = appContext.propsCache;
  3953. const cached = cache.get(comp);
  3954. if (cached) {
  3955. return cached;
  3956. }
  3957. const raw = comp.props;
  3958. const normalized = {};
  3959. const needCastKeys = [];
  3960. let hasExtends = false;
  3961. if (!isFunction(comp)) {
  3962. const extendProps = (raw2) => {
  3963. hasExtends = true;
  3964. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3965. extend(normalized, props);
  3966. if (keys)
  3967. needCastKeys.push(...keys);
  3968. };
  3969. if (!asMixin && appContext.mixins.length) {
  3970. appContext.mixins.forEach(extendProps);
  3971. }
  3972. if (comp.extends) {
  3973. extendProps(comp.extends);
  3974. }
  3975. if (comp.mixins) {
  3976. comp.mixins.forEach(extendProps);
  3977. }
  3978. }
  3979. if (!raw && !hasExtends) {
  3980. cache.set(comp, EMPTY_ARR);
  3981. return EMPTY_ARR;
  3982. }
  3983. if (isArray(raw)) {
  3984. for (let i = 0; i < raw.length; i++) {
  3985. if (!isString(raw[i])) {
  3986. warn$1(`props must be strings when using array syntax.`, raw[i]);
  3987. }
  3988. const normalizedKey = camelize(raw[i]);
  3989. if (validatePropName(normalizedKey)) {
  3990. normalized[normalizedKey] = EMPTY_OBJ;
  3991. }
  3992. }
  3993. } else if (raw) {
  3994. if (!isObject$1(raw)) {
  3995. warn$1(`invalid props options`, raw);
  3996. }
  3997. for (const key in raw) {
  3998. const normalizedKey = camelize(key);
  3999. if (validatePropName(normalizedKey)) {
  4000. const opt = raw[key];
  4001. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : opt;
  4002. if (prop) {
  4003. const booleanIndex = getTypeIndex(Boolean, prop.type);
  4004. const stringIndex = getTypeIndex(String, prop.type);
  4005. prop[0] = booleanIndex > -1;
  4006. prop[1] = stringIndex < 0 || booleanIndex < stringIndex;
  4007. if (booleanIndex > -1 || hasOwn(prop, "default")) {
  4008. needCastKeys.push(normalizedKey);
  4009. }
  4010. }
  4011. }
  4012. }
  4013. }
  4014. const res = [normalized, needCastKeys];
  4015. cache.set(comp, res);
  4016. return res;
  4017. }
  4018. function validatePropName(key) {
  4019. if (key[0] !== "$") {
  4020. return true;
  4021. } else {
  4022. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  4023. }
  4024. return false;
  4025. }
  4026. function getType(ctor) {
  4027. const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
  4028. return match ? match[1] : ctor === null ? "null" : "";
  4029. }
  4030. function isSameType(a, b) {
  4031. return getType(a) === getType(b);
  4032. }
  4033. function getTypeIndex(type, expectedTypes) {
  4034. if (isArray(expectedTypes)) {
  4035. return expectedTypes.findIndex((t2) => isSameType(t2, type));
  4036. } else if (isFunction(expectedTypes)) {
  4037. return isSameType(expectedTypes, type) ? 0 : -1;
  4038. }
  4039. return -1;
  4040. }
  4041. function validateProps(rawProps, props, instance) {
  4042. const resolvedValues = toRaw(props);
  4043. const options = instance.propsOptions[0];
  4044. for (const key in options) {
  4045. let opt = options[key];
  4046. if (opt == null)
  4047. continue;
  4048. validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));
  4049. }
  4050. }
  4051. function validateProp(name, value, prop, isAbsent) {
  4052. const { type, required, validator } = prop;
  4053. if (required && isAbsent) {
  4054. warn$1('Missing required prop: "' + name + '"');
  4055. return;
  4056. }
  4057. if (value == null && !prop.required) {
  4058. return;
  4059. }
  4060. if (type != null && type !== true) {
  4061. let isValid = false;
  4062. const types = isArray(type) ? type : [type];
  4063. const expectedTypes = [];
  4064. for (let i = 0; i < types.length && !isValid; i++) {
  4065. const { valid, expectedType } = assertType(value, types[i]);
  4066. expectedTypes.push(expectedType || "");
  4067. isValid = valid;
  4068. }
  4069. if (!isValid) {
  4070. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  4071. return;
  4072. }
  4073. }
  4074. if (validator && !validator(value)) {
  4075. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  4076. }
  4077. }
  4078. const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
  4079. function assertType(value, type) {
  4080. let valid;
  4081. const expectedType = getType(type);
  4082. if (isSimpleType(expectedType)) {
  4083. const t2 = typeof value;
  4084. valid = t2 === expectedType.toLowerCase();
  4085. if (!valid && t2 === "object") {
  4086. valid = value instanceof type;
  4087. }
  4088. } else if (expectedType === "Object") {
  4089. valid = isObject$1(value);
  4090. } else if (expectedType === "Array") {
  4091. valid = isArray(value);
  4092. } else if (expectedType === "null") {
  4093. valid = value === null;
  4094. } else {
  4095. valid = value instanceof type;
  4096. }
  4097. return {
  4098. valid,
  4099. expectedType
  4100. };
  4101. }
  4102. function getInvalidTypeMessage(name, value, expectedTypes) {
  4103. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4104. const expectedType = expectedTypes[0];
  4105. const receivedType = toRawType(value);
  4106. const expectedValue = styleValue(value, expectedType);
  4107. const receivedValue = styleValue(value, receivedType);
  4108. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4109. message += ` with value ${expectedValue}`;
  4110. }
  4111. message += `, got ${receivedType} `;
  4112. if (isExplicable(receivedType)) {
  4113. message += `with value ${receivedValue}.`;
  4114. }
  4115. return message;
  4116. }
  4117. function styleValue(value, type) {
  4118. if (type === "String") {
  4119. return `"${value}"`;
  4120. } else if (type === "Number") {
  4121. return `${Number(value)}`;
  4122. } else {
  4123. return `${value}`;
  4124. }
  4125. }
  4126. function isExplicable(type) {
  4127. const explicitTypes = ["string", "number", "boolean"];
  4128. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4129. }
  4130. function isBoolean(...args) {
  4131. return args.some((elem) => elem.toLowerCase() === "boolean");
  4132. }
  4133. function createAppContext() {
  4134. return {
  4135. app: null,
  4136. config: {
  4137. isNativeTag: NO,
  4138. performance: false,
  4139. globalProperties: {},
  4140. optionMergeStrategies: {},
  4141. errorHandler: void 0,
  4142. warnHandler: void 0,
  4143. compilerOptions: {}
  4144. },
  4145. mixins: [],
  4146. components: {},
  4147. directives: {},
  4148. provides: /* @__PURE__ */ Object.create(null),
  4149. optionsCache: /* @__PURE__ */ new WeakMap(),
  4150. propsCache: /* @__PURE__ */ new WeakMap(),
  4151. emitsCache: /* @__PURE__ */ new WeakMap()
  4152. };
  4153. }
  4154. let uid = 0;
  4155. function createAppAPI(render, hydrate) {
  4156. return function createApp2(rootComponent, rootProps = null) {
  4157. if (!isFunction(rootComponent)) {
  4158. rootComponent = Object.assign({}, rootComponent);
  4159. }
  4160. if (rootProps != null && !isObject$1(rootProps)) {
  4161. warn$1(`root props passed to app.mount() must be an object.`);
  4162. rootProps = null;
  4163. }
  4164. const context = createAppContext();
  4165. const installedPlugins = /* @__PURE__ */ new Set();
  4166. const app = context.app = {
  4167. _uid: uid++,
  4168. _component: rootComponent,
  4169. _props: rootProps,
  4170. _container: null,
  4171. _context: context,
  4172. _instance: null,
  4173. version,
  4174. get config() {
  4175. return context.config;
  4176. },
  4177. set config(v) {
  4178. {
  4179. warn$1(`app.config cannot be replaced. Modify individual options instead.`);
  4180. }
  4181. },
  4182. use(plugin2, ...options) {
  4183. if (installedPlugins.has(plugin2)) {
  4184. warn$1(`Plugin has already been applied to target app.`);
  4185. } else if (plugin2 && isFunction(plugin2.install)) {
  4186. installedPlugins.add(plugin2);
  4187. plugin2.install(app, ...options);
  4188. } else if (isFunction(plugin2)) {
  4189. installedPlugins.add(plugin2);
  4190. plugin2(app, ...options);
  4191. } else {
  4192. warn$1(`A plugin must either be a function or an object with an "install" function.`);
  4193. }
  4194. return app;
  4195. },
  4196. mixin(mixin) {
  4197. {
  4198. if (!context.mixins.includes(mixin)) {
  4199. context.mixins.push(mixin);
  4200. } else {
  4201. warn$1("Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : ""));
  4202. }
  4203. }
  4204. return app;
  4205. },
  4206. component(name, component) {
  4207. {
  4208. validateComponentName(name, context.config);
  4209. }
  4210. if (!component) {
  4211. return context.components[name];
  4212. }
  4213. if (context.components[name]) {
  4214. warn$1(`Component "${name}" has already been registered in target app.`);
  4215. }
  4216. context.components[name] = component;
  4217. return app;
  4218. },
  4219. directive(name, directive) {
  4220. {
  4221. validateDirectiveName(name);
  4222. }
  4223. if (!directive) {
  4224. return context.directives[name];
  4225. }
  4226. if (context.directives[name]) {
  4227. warn$1(`Directive "${name}" has already been registered in target app.`);
  4228. }
  4229. context.directives[name] = directive;
  4230. return app;
  4231. },
  4232. mount() {
  4233. },
  4234. unmount() {
  4235. },
  4236. provide(key, value) {
  4237. if (key in context.provides) {
  4238. warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
  4239. }
  4240. context.provides[key] = value;
  4241. return app;
  4242. }
  4243. };
  4244. return app;
  4245. };
  4246. }
  4247. const queuePostRenderEffect = queuePostFlushCb;
  4248. function isVNode(value) {
  4249. return value ? value.__v_isVNode === true : false;
  4250. }
  4251. const InternalObjectKey = `__vInternal`;
  4252. function guardReactiveProps(props) {
  4253. if (!props)
  4254. return null;
  4255. return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
  4256. }
  4257. const emptyAppContext = createAppContext();
  4258. let uid$1 = 0;
  4259. function createComponentInstance(vnode, parent, suspense) {
  4260. const type = vnode.type;
  4261. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  4262. const instance = {
  4263. uid: uid$1++,
  4264. vnode,
  4265. type,
  4266. parent,
  4267. appContext,
  4268. root: null,
  4269. next: null,
  4270. subTree: null,
  4271. effect: null,
  4272. update: null,
  4273. scope: new EffectScope(true),
  4274. render: null,
  4275. proxy: null,
  4276. exposed: null,
  4277. exposeProxy: null,
  4278. withProxy: null,
  4279. provides: parent ? parent.provides : Object.create(appContext.provides),
  4280. accessCache: null,
  4281. renderCache: [],
  4282. components: null,
  4283. directives: null,
  4284. propsOptions: normalizePropsOptions(type, appContext),
  4285. emitsOptions: normalizeEmitsOptions(type, appContext),
  4286. emit: null,
  4287. emitted: null,
  4288. propsDefaults: EMPTY_OBJ,
  4289. inheritAttrs: type.inheritAttrs,
  4290. ctx: EMPTY_OBJ,
  4291. data: EMPTY_OBJ,
  4292. props: EMPTY_OBJ,
  4293. attrs: EMPTY_OBJ,
  4294. slots: EMPTY_OBJ,
  4295. refs: EMPTY_OBJ,
  4296. setupState: EMPTY_OBJ,
  4297. setupContext: null,
  4298. suspense,
  4299. suspenseId: suspense ? suspense.pendingId : 0,
  4300. asyncDep: null,
  4301. asyncResolved: false,
  4302. isMounted: false,
  4303. isUnmounted: false,
  4304. isDeactivated: false,
  4305. bc: null,
  4306. c: null,
  4307. bm: null,
  4308. m: null,
  4309. bu: null,
  4310. u: null,
  4311. um: null,
  4312. bum: null,
  4313. da: null,
  4314. a: null,
  4315. rtg: null,
  4316. rtc: null,
  4317. ec: null,
  4318. sp: null
  4319. };
  4320. {
  4321. instance.ctx = createDevRenderContext(instance);
  4322. }
  4323. instance.root = parent ? parent.root : instance;
  4324. instance.emit = emit$1.bind(null, instance);
  4325. if (vnode.ce) {
  4326. vnode.ce(instance);
  4327. }
  4328. return instance;
  4329. }
  4330. let currentInstance = null;
  4331. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  4332. const setCurrentInstance = (instance) => {
  4333. currentInstance = instance;
  4334. instance.scope.on();
  4335. };
  4336. const unsetCurrentInstance = () => {
  4337. currentInstance && currentInstance.scope.off();
  4338. currentInstance = null;
  4339. };
  4340. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  4341. function validateComponentName(name, config) {
  4342. const appIsNativeTag = config.isNativeTag || NO;
  4343. if (isBuiltInTag(name) || appIsNativeTag(name)) {
  4344. warn$1("Do not use built-in or reserved HTML elements as component id: " + name);
  4345. }
  4346. }
  4347. function isStatefulComponent(instance) {
  4348. return instance.vnode.shapeFlag & 4;
  4349. }
  4350. let isInSSRComponentSetup = false;
  4351. function setupComponent(instance, isSSR = false) {
  4352. isInSSRComponentSetup = isSSR;
  4353. const { props } = instance.vnode;
  4354. const isStateful = isStatefulComponent(instance);
  4355. initProps$1(instance, props, isStateful, isSSR);
  4356. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  4357. isInSSRComponentSetup = false;
  4358. return setupResult;
  4359. }
  4360. function setupStatefulComponent(instance, isSSR) {
  4361. const Component2 = instance.type;
  4362. {
  4363. if (Component2.name) {
  4364. validateComponentName(Component2.name, instance.appContext.config);
  4365. }
  4366. if (Component2.components) {
  4367. const names = Object.keys(Component2.components);
  4368. for (let i = 0; i < names.length; i++) {
  4369. validateComponentName(names[i], instance.appContext.config);
  4370. }
  4371. }
  4372. if (Component2.directives) {
  4373. const names = Object.keys(Component2.directives);
  4374. for (let i = 0; i < names.length; i++) {
  4375. validateDirectiveName(names[i]);
  4376. }
  4377. }
  4378. if (Component2.compilerOptions && isRuntimeOnly()) {
  4379. warn$1(`"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.`);
  4380. }
  4381. }
  4382. instance.accessCache = /* @__PURE__ */ Object.create(null);
  4383. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  4384. {
  4385. exposePropsOnRenderContext(instance);
  4386. }
  4387. const { setup } = Component2;
  4388. if (setup) {
  4389. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  4390. setCurrentInstance(instance);
  4391. pauseTracking();
  4392. const setupResult = callWithErrorHandling(setup, instance, 0, [shallowReadonly(instance.props), setupContext]);
  4393. resetTracking();
  4394. unsetCurrentInstance();
  4395. if (isPromise$1(setupResult)) {
  4396. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  4397. {
  4398. warn$1(`setup() returned a Promise, but the version of Vue you are using does not support it yet.`);
  4399. }
  4400. } else {
  4401. handleSetupResult(instance, setupResult, isSSR);
  4402. }
  4403. } else {
  4404. finishComponentSetup(instance, isSSR);
  4405. }
  4406. }
  4407. function handleSetupResult(instance, setupResult, isSSR) {
  4408. if (isFunction(setupResult)) {
  4409. {
  4410. instance.render = setupResult;
  4411. }
  4412. } else if (isObject$1(setupResult)) {
  4413. if (isVNode(setupResult)) {
  4414. warn$1(`setup() should not return VNodes directly - return a render function instead.`);
  4415. }
  4416. {
  4417. instance.devtoolsRawSetupState = setupResult;
  4418. }
  4419. instance.setupState = proxyRefs(setupResult);
  4420. {
  4421. exposeSetupStateOnRenderContext(instance);
  4422. }
  4423. } else if (setupResult !== void 0) {
  4424. warn$1(`setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`);
  4425. }
  4426. finishComponentSetup(instance, isSSR);
  4427. }
  4428. let compile;
  4429. const isRuntimeOnly = () => !compile;
  4430. function finishComponentSetup(instance, isSSR, skipOptions) {
  4431. const Component2 = instance.type;
  4432. if (!instance.render) {
  4433. instance.render = Component2.render || NOOP;
  4434. }
  4435. {
  4436. setCurrentInstance(instance);
  4437. pauseTracking();
  4438. applyOptions$1(instance);
  4439. resetTracking();
  4440. unsetCurrentInstance();
  4441. }
  4442. if (!Component2.render && instance.render === NOOP && !isSSR) {
  4443. if (Component2.template) {
  4444. warn$1(`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".`);
  4445. } else {
  4446. warn$1(`Component is missing template or render function.`);
  4447. }
  4448. }
  4449. }
  4450. function createAttrsProxy(instance) {
  4451. return new Proxy(instance.attrs, {
  4452. get(target, key) {
  4453. track(instance, "get", "$attrs");
  4454. return target[key];
  4455. },
  4456. set() {
  4457. warn$1(`setupContext.attrs is readonly.`);
  4458. return false;
  4459. },
  4460. deleteProperty() {
  4461. warn$1(`setupContext.attrs is readonly.`);
  4462. return false;
  4463. }
  4464. });
  4465. }
  4466. function createSetupContext(instance) {
  4467. const expose = (exposed) => {
  4468. if (instance.exposed) {
  4469. warn$1(`expose() should be called only once per setup().`);
  4470. }
  4471. instance.exposed = exposed || {};
  4472. };
  4473. let attrs;
  4474. {
  4475. return Object.freeze({
  4476. get attrs() {
  4477. return attrs || (attrs = createAttrsProxy(instance));
  4478. },
  4479. get slots() {
  4480. return shallowReadonly(instance.slots);
  4481. },
  4482. get emit() {
  4483. return (event, ...args) => instance.emit(event, ...args);
  4484. },
  4485. expose
  4486. });
  4487. }
  4488. }
  4489. function getExposeProxy(instance) {
  4490. if (instance.exposed) {
  4491. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  4492. get(target, key) {
  4493. if (key in target) {
  4494. return target[key];
  4495. }
  4496. return instance.proxy[key];
  4497. }
  4498. }));
  4499. }
  4500. }
  4501. const classifyRE = /(?:^|[-_])(\w)/g;
  4502. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  4503. function getComponentName(Component2, includeInferred = true) {
  4504. return isFunction(Component2) ? Component2.displayName || Component2.name : Component2.name || includeInferred && Component2.__name;
  4505. }
  4506. function formatComponentName(instance, Component2, isRoot = false) {
  4507. let name = getComponentName(Component2);
  4508. if (!name && Component2.__file) {
  4509. const match = Component2.__file.match(/([^/\\]+)\.\w+$/);
  4510. if (match) {
  4511. name = match[1];
  4512. }
  4513. }
  4514. if (!name && instance && instance.parent) {
  4515. const inferFromRegistry = (registry) => {
  4516. for (const key in registry) {
  4517. if (registry[key] === Component2) {
  4518. return key;
  4519. }
  4520. }
  4521. };
  4522. name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
  4523. }
  4524. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  4525. }
  4526. const computed$1 = (getterOrOptions, debugOptions) => {
  4527. return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
  4528. };
  4529. const version = "3.2.37";
  4530. function unwrapper(target) {
  4531. return unref(target);
  4532. }
  4533. const ARRAYTYPE = "[object Array]";
  4534. const OBJECTTYPE = "[object Object]";
  4535. function diff(current, pre) {
  4536. const result = {};
  4537. syncKeys(current, pre);
  4538. _diff(current, pre, "", result);
  4539. return result;
  4540. }
  4541. function syncKeys(current, pre) {
  4542. current = unwrapper(current);
  4543. if (current === pre)
  4544. return;
  4545. const rootCurrentType = toTypeString(current);
  4546. const rootPreType = toTypeString(pre);
  4547. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  4548. for (let key in pre) {
  4549. const currentValue = current[key];
  4550. if (currentValue === void 0) {
  4551. current[key] = null;
  4552. } else {
  4553. syncKeys(currentValue, pre[key]);
  4554. }
  4555. }
  4556. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  4557. if (current.length >= pre.length) {
  4558. pre.forEach((item, index2) => {
  4559. syncKeys(current[index2], item);
  4560. });
  4561. }
  4562. }
  4563. }
  4564. function _diff(current, pre, path, result) {
  4565. current = unwrapper(current);
  4566. if (current === pre)
  4567. return;
  4568. const rootCurrentType = toTypeString(current);
  4569. const rootPreType = toTypeString(pre);
  4570. if (rootCurrentType == OBJECTTYPE) {
  4571. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  4572. setResult(result, path, current);
  4573. } else {
  4574. for (let key in current) {
  4575. const currentValue = unwrapper(current[key]);
  4576. const preValue = pre[key];
  4577. const currentType = toTypeString(currentValue);
  4578. const preType = toTypeString(preValue);
  4579. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  4580. if (currentValue != preValue) {
  4581. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  4582. }
  4583. } else if (currentType == ARRAYTYPE) {
  4584. if (preType != ARRAYTYPE) {
  4585. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  4586. } else {
  4587. if (currentValue.length < preValue.length) {
  4588. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  4589. } else {
  4590. currentValue.forEach((item, index2) => {
  4591. _diff(item, preValue[index2], (path == "" ? "" : path + ".") + key + "[" + index2 + "]", result);
  4592. });
  4593. }
  4594. }
  4595. } else if (currentType == OBJECTTYPE) {
  4596. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  4597. setResult(result, (path == "" ? "" : path + ".") + key, currentValue);
  4598. } else {
  4599. for (let subKey in currentValue) {
  4600. _diff(currentValue[subKey], preValue[subKey], (path == "" ? "" : path + ".") + key + "." + subKey, result);
  4601. }
  4602. }
  4603. }
  4604. }
  4605. }
  4606. } else if (rootCurrentType == ARRAYTYPE) {
  4607. if (rootPreType != ARRAYTYPE) {
  4608. setResult(result, path, current);
  4609. } else {
  4610. if (current.length < pre.length) {
  4611. setResult(result, path, current);
  4612. } else {
  4613. current.forEach((item, index2) => {
  4614. _diff(item, pre[index2], path + "[" + index2 + "]", result);
  4615. });
  4616. }
  4617. }
  4618. } else {
  4619. setResult(result, path, current);
  4620. }
  4621. }
  4622. function setResult(result, k, v) {
  4623. result[k] = v;
  4624. }
  4625. function hasComponentEffect(instance) {
  4626. return queue.includes(instance.update);
  4627. }
  4628. function flushCallbacks(instance) {
  4629. const ctx = instance.ctx;
  4630. const callbacks = ctx.__next_tick_callbacks;
  4631. if (callbacks && callbacks.length) {
  4632. const copies = callbacks.slice(0);
  4633. callbacks.length = 0;
  4634. for (let i = 0; i < copies.length; i++) {
  4635. copies[i]();
  4636. }
  4637. }
  4638. }
  4639. function nextTick$1(instance, fn) {
  4640. const ctx = instance.ctx;
  4641. if (!ctx.__next_tick_pending && !hasComponentEffect(instance)) {
  4642. return nextTick(fn && fn.bind(instance.proxy));
  4643. }
  4644. let _resolve;
  4645. if (!ctx.__next_tick_callbacks) {
  4646. ctx.__next_tick_callbacks = [];
  4647. }
  4648. ctx.__next_tick_callbacks.push(() => {
  4649. if (fn) {
  4650. callWithErrorHandling(fn.bind(instance.proxy), instance, 14);
  4651. } else if (_resolve) {
  4652. _resolve(instance.proxy);
  4653. }
  4654. });
  4655. return new Promise((resolve2) => {
  4656. _resolve = resolve2;
  4657. });
  4658. }
  4659. function clone(src, seen) {
  4660. src = unwrapper(src);
  4661. const type = typeof src;
  4662. if (type === "object" && src !== null) {
  4663. let copy = seen.get(src);
  4664. if (typeof copy !== "undefined") {
  4665. return copy;
  4666. }
  4667. if (isArray(src)) {
  4668. const len = src.length;
  4669. copy = new Array(len);
  4670. seen.set(src, copy);
  4671. for (let i = 0; i < len; i++) {
  4672. copy[i] = clone(src[i], seen);
  4673. }
  4674. } else {
  4675. copy = {};
  4676. seen.set(src, copy);
  4677. for (const name in src) {
  4678. if (hasOwn(src, name)) {
  4679. copy[name] = clone(src[name], seen);
  4680. }
  4681. }
  4682. }
  4683. return copy;
  4684. }
  4685. if (type !== "symbol") {
  4686. return src;
  4687. }
  4688. }
  4689. function deepCopy(src) {
  4690. return clone(src, typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map());
  4691. }
  4692. function getMPInstanceData(instance, keys) {
  4693. const data = instance.data;
  4694. const ret = /* @__PURE__ */ Object.create(null);
  4695. keys.forEach((key) => {
  4696. ret[key] = data[key];
  4697. });
  4698. return ret;
  4699. }
  4700. function patch(instance, data, oldData) {
  4701. if (!data) {
  4702. return;
  4703. }
  4704. data = deepCopy(data);
  4705. const ctx = instance.ctx;
  4706. const mpType = ctx.mpType;
  4707. if (mpType === "page" || mpType === "component") {
  4708. data.r0 = 1;
  4709. const mpInstance = ctx.$scope;
  4710. const keys = Object.keys(data);
  4711. const diffData = diff(data, oldData || getMPInstanceData(mpInstance, keys));
  4712. if (Object.keys(diffData).length) {
  4713. ctx.__next_tick_pending = true;
  4714. mpInstance.setData(diffData, () => {
  4715. ctx.__next_tick_pending = false;
  4716. flushCallbacks(instance);
  4717. });
  4718. flushPreFlushCbs(void 0, instance.update);
  4719. } else {
  4720. flushCallbacks(instance);
  4721. }
  4722. }
  4723. }
  4724. function initAppConfig(appConfig) {
  4725. appConfig.globalProperties.$nextTick = function $nextTick(fn) {
  4726. return nextTick$1(this.$, fn);
  4727. };
  4728. }
  4729. function onApplyOptions(options, instance, publicThis) {
  4730. instance.appContext.config.globalProperties.$applyOptions(options, instance, publicThis);
  4731. const computedOptions = options.computed;
  4732. if (computedOptions) {
  4733. const keys = Object.keys(computedOptions);
  4734. if (keys.length) {
  4735. const ctx = instance.ctx;
  4736. if (!ctx.$computedKeys) {
  4737. ctx.$computedKeys = [];
  4738. }
  4739. ctx.$computedKeys.push(...keys);
  4740. }
  4741. }
  4742. delete instance.ctx.$onApplyOptions;
  4743. }
  4744. function setRef$1(instance, isUnmount = false) {
  4745. const { setupState, $templateRefs, ctx: { $scope, $mpPlatform } } = instance;
  4746. if ($mpPlatform === "mp-alipay") {
  4747. return;
  4748. }
  4749. if (!$templateRefs || !$scope) {
  4750. return;
  4751. }
  4752. if (isUnmount) {
  4753. return $templateRefs.forEach((templateRef) => setTemplateRef(templateRef, null, setupState));
  4754. }
  4755. const check = $mpPlatform === "mp-baidu" || $mpPlatform === "mp-toutiao";
  4756. const doSetByRefs = (refs) => {
  4757. const mpComponents = $scope.selectAllComponents(".r").concat($scope.selectAllComponents(".r-i-f"));
  4758. return refs.filter((templateRef) => {
  4759. const refValue = findComponentPublicInstance(mpComponents, templateRef.i);
  4760. if (check && refValue === null) {
  4761. return true;
  4762. }
  4763. setTemplateRef(templateRef, refValue, setupState);
  4764. return false;
  4765. });
  4766. };
  4767. const doSet = () => {
  4768. const refs = doSetByRefs($templateRefs);
  4769. if (refs.length && instance.proxy && instance.proxy.$scope) {
  4770. instance.proxy.$scope.setData({ r1: 1 }, () => {
  4771. doSetByRefs(refs);
  4772. });
  4773. }
  4774. };
  4775. if ($scope._$setRef) {
  4776. $scope._$setRef(doSet);
  4777. } else {
  4778. nextTick$1(instance, doSet);
  4779. }
  4780. }
  4781. function findComponentPublicInstance(mpComponents, id) {
  4782. const mpInstance = mpComponents.find((com) => com && (com.properties || com.props).uI === id);
  4783. if (mpInstance) {
  4784. const vm = mpInstance.$vm;
  4785. if (vm) {
  4786. return getExposeProxy(vm.$) || vm;
  4787. }
  4788. return mpInstance;
  4789. }
  4790. return null;
  4791. }
  4792. function setTemplateRef({ r, f: f2 }, refValue, setupState) {
  4793. if (isFunction(r)) {
  4794. r(refValue, {});
  4795. } else {
  4796. const _isString = isString(r);
  4797. const _isRef = isRef(r);
  4798. if (_isString || _isRef) {
  4799. if (f2) {
  4800. if (!_isRef) {
  4801. return;
  4802. }
  4803. if (!isArray(r.value)) {
  4804. r.value = [];
  4805. }
  4806. const existing = r.value;
  4807. if (existing.indexOf(refValue) === -1) {
  4808. existing.push(refValue);
  4809. if (!refValue) {
  4810. return;
  4811. }
  4812. onBeforeUnmount(() => remove(existing, refValue), refValue.$);
  4813. }
  4814. } else if (_isString) {
  4815. if (hasOwn(setupState, r)) {
  4816. setupState[r] = refValue;
  4817. }
  4818. } else if (isRef(r)) {
  4819. r.value = refValue;
  4820. } else {
  4821. warnRef(r);
  4822. }
  4823. } else {
  4824. warnRef(r);
  4825. }
  4826. }
  4827. }
  4828. function warnRef(ref2) {
  4829. warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`);
  4830. }
  4831. var MPType;
  4832. (function(MPType2) {
  4833. MPType2["APP"] = "app";
  4834. MPType2["PAGE"] = "page";
  4835. MPType2["COMPONENT"] = "component";
  4836. })(MPType || (MPType = {}));
  4837. const queuePostRenderEffect$1 = queuePostFlushCb;
  4838. function mountComponent(initialVNode, options) {
  4839. const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
  4840. {
  4841. instance.ctx.$onApplyOptions = onApplyOptions;
  4842. instance.ctx.$children = [];
  4843. }
  4844. if (options.mpType === "app") {
  4845. instance.render = NOOP;
  4846. }
  4847. if (options.onBeforeSetup) {
  4848. options.onBeforeSetup(instance, options);
  4849. }
  4850. {
  4851. pushWarningContext(initialVNode);
  4852. }
  4853. setupComponent(instance);
  4854. {
  4855. if (options.parentComponent && instance.proxy) {
  4856. options.parentComponent.ctx.$children.push(getExposeProxy(instance) || instance.proxy);
  4857. }
  4858. }
  4859. setupRenderEffect(instance);
  4860. {
  4861. popWarningContext();
  4862. }
  4863. return instance.proxy;
  4864. }
  4865. const getFunctionalFallthrough = (attrs) => {
  4866. let res;
  4867. for (const key in attrs) {
  4868. if (key === "class" || key === "style" || isOn(key)) {
  4869. (res || (res = {}))[key] = attrs[key];
  4870. }
  4871. }
  4872. return res;
  4873. };
  4874. function renderComponentRoot(instance) {
  4875. 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;
  4876. instance.$templateRefs = [];
  4877. instance.$ei = 0;
  4878. pruneComponentPropsCache2(uid2);
  4879. instance.__counter = instance.__counter === 0 ? 1 : 0;
  4880. let result;
  4881. const prev = setCurrentRenderingInstance(instance);
  4882. try {
  4883. if (vnode.shapeFlag & 4) {
  4884. fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
  4885. const proxyToUse = withProxy || proxy;
  4886. result = render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx);
  4887. } else {
  4888. fallthroughAttrs(inheritAttrs, props, propsOptions, Component2.props ? attrs : getFunctionalFallthrough(attrs));
  4889. const render2 = Component2;
  4890. result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(props, null);
  4891. }
  4892. } catch (err) {
  4893. handleError(err, instance, 1);
  4894. result = false;
  4895. }
  4896. setRef$1(instance);
  4897. setCurrentRenderingInstance(prev);
  4898. return result;
  4899. }
  4900. function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
  4901. if (props && fallthroughAttrs2 && inheritAttrs !== false) {
  4902. const keys = Object.keys(fallthroughAttrs2).filter((key) => key !== "class" && key !== "style");
  4903. if (!keys.length) {
  4904. return;
  4905. }
  4906. if (propsOptions && keys.some(isModelListener)) {
  4907. keys.forEach((key) => {
  4908. if (!isModelListener(key) || !(key.slice(9) in propsOptions)) {
  4909. props[key] = fallthroughAttrs2[key];
  4910. }
  4911. });
  4912. } else {
  4913. keys.forEach((key) => props[key] = fallthroughAttrs2[key]);
  4914. }
  4915. }
  4916. }
  4917. const updateComponentPreRender = (instance) => {
  4918. pauseTracking();
  4919. flushPreFlushCbs(void 0, instance.update);
  4920. resetTracking();
  4921. };
  4922. function componentUpdateScopedSlotsFn() {
  4923. const scopedSlotsData = this.$scopedSlotsData;
  4924. if (!scopedSlotsData || scopedSlotsData.length === 0) {
  4925. return;
  4926. }
  4927. const mpInstance = this.ctx.$scope;
  4928. const oldData = mpInstance.data;
  4929. const diffData = /* @__PURE__ */ Object.create(null);
  4930. scopedSlotsData.forEach(({ path, index: index2, data }) => {
  4931. const oldScopedSlotData = getValueByDataPath(oldData, path);
  4932. const diffPath = isString(index2) ? `${path}.${index2}` : `${path}[${index2}]`;
  4933. if (typeof oldScopedSlotData === "undefined" || typeof oldScopedSlotData[index2] === "undefined") {
  4934. diffData[diffPath] = data;
  4935. } else {
  4936. const diffScopedSlotData = diff(data, oldScopedSlotData[index2]);
  4937. Object.keys(diffScopedSlotData).forEach((name) => {
  4938. diffData[diffPath + "." + name] = diffScopedSlotData[name];
  4939. });
  4940. }
  4941. });
  4942. scopedSlotsData.length = 0;
  4943. if (Object.keys(diffData).length) {
  4944. mpInstance.setData(diffData);
  4945. }
  4946. }
  4947. function toggleRecurse({ effect, update: update3 }, allowed) {
  4948. effect.allowRecurse = update3.allowRecurse = allowed;
  4949. }
  4950. function setupRenderEffect(instance) {
  4951. const updateScopedSlots = componentUpdateScopedSlotsFn.bind(instance);
  4952. instance.$updateScopedSlots = () => nextTick(() => queueJob(updateScopedSlots));
  4953. const componentUpdateFn = () => {
  4954. if (!instance.isMounted) {
  4955. onBeforeUnmount(() => {
  4956. setRef$1(instance, true);
  4957. }, instance);
  4958. patch(instance, renderComponentRoot(instance));
  4959. } else {
  4960. const { bu, u } = instance;
  4961. toggleRecurse(instance, false);
  4962. updateComponentPreRender(instance);
  4963. if (bu) {
  4964. invokeArrayFns$1(bu);
  4965. }
  4966. toggleRecurse(instance, true);
  4967. patch(instance, renderComponentRoot(instance));
  4968. if (u) {
  4969. queuePostRenderEffect$1(u);
  4970. }
  4971. }
  4972. };
  4973. const effect = instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope);
  4974. const update3 = instance.update = effect.run.bind(effect);
  4975. update3.id = instance.uid;
  4976. toggleRecurse(instance, true);
  4977. {
  4978. effect.onTrack = instance.rtc ? (e2) => invokeArrayFns$1(instance.rtc, e2) : void 0;
  4979. effect.onTrigger = instance.rtg ? (e2) => invokeArrayFns$1(instance.rtg, e2) : void 0;
  4980. update3.ownerInstance = instance;
  4981. }
  4982. update3();
  4983. }
  4984. function unmountComponent(instance) {
  4985. const { bum, scope, update: update3, um } = instance;
  4986. if (bum) {
  4987. invokeArrayFns$1(bum);
  4988. }
  4989. scope.stop();
  4990. if (update3) {
  4991. update3.active = false;
  4992. }
  4993. if (um) {
  4994. queuePostRenderEffect$1(um);
  4995. }
  4996. queuePostRenderEffect$1(() => {
  4997. instance.isUnmounted = true;
  4998. });
  4999. }
  5000. const oldCreateApp = createAppAPI();
  5001. function createVueApp(rootComponent, rootProps = null) {
  5002. const app = oldCreateApp(rootComponent, rootProps);
  5003. const appContext = app._context;
  5004. initAppConfig(appContext.config);
  5005. const createVNode = (initialVNode) => {
  5006. initialVNode.appContext = appContext;
  5007. initialVNode.shapeFlag = 6;
  5008. return initialVNode;
  5009. };
  5010. const createComponent2 = function createComponent3(initialVNode, options) {
  5011. return mountComponent(createVNode(initialVNode), options);
  5012. };
  5013. const destroyComponent = function destroyComponent2(component) {
  5014. return component && unmountComponent(component.$);
  5015. };
  5016. app.mount = function mount() {
  5017. rootComponent.render = NOOP;
  5018. const instance = mountComponent(createVNode({ type: rootComponent }), {
  5019. mpType: MPType.APP,
  5020. mpInstance: null,
  5021. parentComponent: null,
  5022. slots: [],
  5023. props: null
  5024. });
  5025. app._instance = instance.$;
  5026. instance.$app = app;
  5027. instance.$createComponent = createComponent2;
  5028. instance.$destroyComponent = destroyComponent;
  5029. appContext.$appInstance = instance;
  5030. return instance;
  5031. };
  5032. app.unmount = function unmount() {
  5033. warn$1(`Cannot unmount an app.`);
  5034. };
  5035. return app;
  5036. }
  5037. function injectLifecycleHook(name, hook, publicThis, instance) {
  5038. if (isFunction(hook)) {
  5039. injectHook(name, hook.bind(publicThis), instance);
  5040. }
  5041. }
  5042. function initHooks$1(options, instance, publicThis) {
  5043. const mpType = options.mpType || publicThis.$mpType;
  5044. if (!mpType) {
  5045. return;
  5046. }
  5047. Object.keys(options).forEach((name) => {
  5048. if (name.indexOf("on") === 0) {
  5049. const hooks = options[name];
  5050. if (isArray(hooks)) {
  5051. hooks.forEach((hook) => injectLifecycleHook(name, hook, publicThis, instance));
  5052. } else {
  5053. injectLifecycleHook(name, hooks, publicThis, instance);
  5054. }
  5055. }
  5056. });
  5057. }
  5058. function applyOptions$2(options, instance, publicThis) {
  5059. initHooks$1(options, instance, publicThis);
  5060. }
  5061. function set(target, key, val) {
  5062. return target[key] = val;
  5063. }
  5064. function createErrorHandler(app) {
  5065. return function errorHandler(err, instance, _info) {
  5066. if (!instance) {
  5067. throw err;
  5068. }
  5069. const appInstance = app._instance;
  5070. if (!appInstance || !appInstance.proxy) {
  5071. throw err;
  5072. }
  5073. {
  5074. appInstance.proxy.$callHook(ON_ERROR, err);
  5075. }
  5076. };
  5077. }
  5078. function mergeAsArray(to, from) {
  5079. return to ? [...new Set([].concat(to, from))] : from;
  5080. }
  5081. function initOptionMergeStrategies(optionMergeStrategies) {
  5082. UniLifecycleHooks.forEach((name) => {
  5083. optionMergeStrategies[name] = mergeAsArray;
  5084. });
  5085. }
  5086. let realAtob;
  5087. const b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  5088. const b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  5089. if (typeof atob !== "function") {
  5090. realAtob = function(str) {
  5091. str = String(str).replace(/[\t\n\f\r ]+/g, "");
  5092. if (!b64re.test(str)) {
  5093. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  5094. }
  5095. str += "==".slice(2 - (str.length & 3));
  5096. var bitmap;
  5097. var result = "";
  5098. var r1;
  5099. var r2;
  5100. var i = 0;
  5101. for (; i < str.length; ) {
  5102. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  5103. 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);
  5104. }
  5105. return result;
  5106. };
  5107. } else {
  5108. realAtob = atob;
  5109. }
  5110. function b64DecodeUnicode(str) {
  5111. return decodeURIComponent(realAtob(str).split("").map(function(c) {
  5112. return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
  5113. }).join(""));
  5114. }
  5115. function getCurrentUserInfo() {
  5116. const token = index.getStorageSync("uni_id_token") || "";
  5117. const tokenArr = token.split(".");
  5118. if (!token || tokenArr.length !== 3) {
  5119. return {
  5120. uid: null,
  5121. role: [],
  5122. permission: [],
  5123. tokenExpired: 0
  5124. };
  5125. }
  5126. let userInfo;
  5127. try {
  5128. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  5129. } catch (error) {
  5130. throw new Error("\u83B7\u53D6\u5F53\u524D\u7528\u6237\u4FE1\u606F\u51FA\u9519\uFF0C\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F\u4E3A\uFF1A" + error.message);
  5131. }
  5132. userInfo.tokenExpired = userInfo.exp * 1e3;
  5133. delete userInfo.exp;
  5134. delete userInfo.iat;
  5135. return userInfo;
  5136. }
  5137. function uniIdMixin(globalProperties) {
  5138. globalProperties.uniIDHasRole = function(roleId) {
  5139. const { role } = getCurrentUserInfo();
  5140. return role.indexOf(roleId) > -1;
  5141. };
  5142. globalProperties.uniIDHasPermission = function(permissionId) {
  5143. const { permission } = getCurrentUserInfo();
  5144. return this.uniIDHasRole("admin") || permission.indexOf(permissionId) > -1;
  5145. };
  5146. globalProperties.uniIDTokenValid = function() {
  5147. const { tokenExpired } = getCurrentUserInfo();
  5148. return tokenExpired > Date.now();
  5149. };
  5150. }
  5151. function initApp(app) {
  5152. const appConfig = app._context.config;
  5153. if (isFunction(app._component.onError)) {
  5154. appConfig.errorHandler = createErrorHandler(app);
  5155. }
  5156. initOptionMergeStrategies(appConfig.optionMergeStrategies);
  5157. const globalProperties = appConfig.globalProperties;
  5158. {
  5159. uniIdMixin(globalProperties);
  5160. }
  5161. {
  5162. globalProperties.$set = set;
  5163. globalProperties.$applyOptions = applyOptions$2;
  5164. }
  5165. {
  5166. index.invokeCreateVueAppHook(app);
  5167. }
  5168. }
  5169. const propsCaches = /* @__PURE__ */ Object.create(null);
  5170. function renderProps(props) {
  5171. const { uid: uid2, __counter } = getCurrentInstance();
  5172. const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
  5173. return uid2 + "," + propsId + "," + __counter;
  5174. }
  5175. function pruneComponentPropsCache(uid2) {
  5176. delete propsCaches[uid2];
  5177. }
  5178. function findComponentPropsData(up) {
  5179. if (!up) {
  5180. return;
  5181. }
  5182. const [uid2, propsId] = up.split(",");
  5183. if (!propsCaches[uid2]) {
  5184. return;
  5185. }
  5186. return propsCaches[uid2][parseInt(propsId)];
  5187. }
  5188. var plugin = {
  5189. install(app) {
  5190. initApp(app);
  5191. app.config.globalProperties.pruneComponentPropsCache = pruneComponentPropsCache;
  5192. const oldMount = app.mount;
  5193. app.mount = function mount(rootContainer) {
  5194. const instance = oldMount.call(app, rootContainer);
  5195. const createApp2 = getCreateApp();
  5196. if (createApp2) {
  5197. createApp2(instance);
  5198. } else {
  5199. if (typeof createMiniProgramApp !== "undefined") {
  5200. createMiniProgramApp(instance);
  5201. }
  5202. }
  5203. return instance;
  5204. };
  5205. }
  5206. };
  5207. function getCreateApp() {
  5208. const method = "createApp";
  5209. if (typeof global !== "undefined") {
  5210. return global[method];
  5211. } else if (typeof my !== "undefined") {
  5212. return my[method];
  5213. }
  5214. }
  5215. function vOn(value, key) {
  5216. const instance = getCurrentInstance();
  5217. const ctx = instance.ctx;
  5218. const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq") && (isString(key) || typeof key === "number") ? "_" + key : "";
  5219. const name = "e" + instance.$ei++ + extraKey;
  5220. const mpInstance = ctx.$scope;
  5221. if (!value) {
  5222. delete mpInstance[name];
  5223. return name;
  5224. }
  5225. const existingInvoker = mpInstance[name];
  5226. if (existingInvoker) {
  5227. existingInvoker.value = value;
  5228. } else {
  5229. mpInstance[name] = createInvoker(value, instance);
  5230. }
  5231. return name;
  5232. }
  5233. function createInvoker(initialValue, instance) {
  5234. const invoker = (e2) => {
  5235. patchMPEvent(e2);
  5236. let args = [e2];
  5237. if (e2.detail && e2.detail.__args__) {
  5238. args = e2.detail.__args__;
  5239. }
  5240. const eventValue = invoker.value;
  5241. const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
  5242. const eventTarget = e2.target;
  5243. const eventSync = eventTarget ? eventTarget.dataset ? eventTarget.dataset.eventsync === "true" : false : false;
  5244. if (bubbles.includes(e2.type) && !eventSync) {
  5245. setTimeout(invoke);
  5246. } else {
  5247. const res = invoke();
  5248. if (e2.type === "input" && (isArray(res) || isPromise$1(res))) {
  5249. return;
  5250. }
  5251. return res;
  5252. }
  5253. };
  5254. invoker.value = initialValue;
  5255. return invoker;
  5256. }
  5257. const bubbles = [
  5258. "tap",
  5259. "longpress",
  5260. "longtap",
  5261. "transitionend",
  5262. "animationstart",
  5263. "animationiteration",
  5264. "animationend",
  5265. "touchforcechange"
  5266. ];
  5267. function patchMPEvent(event) {
  5268. if (event.type && event.target) {
  5269. event.preventDefault = NOOP;
  5270. event.stopPropagation = NOOP;
  5271. event.stopImmediatePropagation = NOOP;
  5272. if (!hasOwn(event, "detail")) {
  5273. event.detail = {};
  5274. }
  5275. if (hasOwn(event, "markerId")) {
  5276. event.detail = typeof event.detail === "object" ? event.detail : {};
  5277. event.detail.markerId = event.markerId;
  5278. }
  5279. if (isPlainObject(event.detail) && hasOwn(event.detail, "checked") && !hasOwn(event.detail, "value")) {
  5280. event.detail.value = event.detail.checked;
  5281. }
  5282. if (isPlainObject(event.detail)) {
  5283. event.target = extend({}, event.target, event.detail);
  5284. }
  5285. }
  5286. }
  5287. function patchStopImmediatePropagation(e2, value) {
  5288. if (isArray(value)) {
  5289. const originalStop = e2.stopImmediatePropagation;
  5290. e2.stopImmediatePropagation = () => {
  5291. originalStop && originalStop.call(e2);
  5292. e2._stopped = true;
  5293. };
  5294. return value.map((fn) => (e3) => !e3._stopped && fn(e3));
  5295. } else {
  5296. return value;
  5297. }
  5298. }
  5299. function vFor(source, renderItem) {
  5300. let ret;
  5301. if (isArray(source) || isString(source)) {
  5302. ret = new Array(source.length);
  5303. for (let i = 0, l = source.length; i < l; i++) {
  5304. ret[i] = renderItem(source[i], i, i);
  5305. }
  5306. } else if (typeof source === "number") {
  5307. if (!Number.isInteger(source)) {
  5308. warn$1(`The v-for range expect an integer value but got ${source}.`);
  5309. return [];
  5310. }
  5311. ret = new Array(source);
  5312. for (let i = 0; i < source; i++) {
  5313. ret[i] = renderItem(i + 1, i, i);
  5314. }
  5315. } else if (isObject$1(source)) {
  5316. if (source[Symbol.iterator]) {
  5317. ret = Array.from(source, (item, i) => renderItem(item, i, i));
  5318. } else {
  5319. const keys = Object.keys(source);
  5320. ret = new Array(keys.length);
  5321. for (let i = 0, l = keys.length; i < l; i++) {
  5322. const key = keys[i];
  5323. ret[i] = renderItem(source[key], key, i);
  5324. }
  5325. }
  5326. } else {
  5327. ret = [];
  5328. }
  5329. return ret;
  5330. }
  5331. function stringifyStyle(value) {
  5332. if (isString(value)) {
  5333. return value;
  5334. }
  5335. return stringify(normalizeStyle(value));
  5336. }
  5337. function stringify(styles) {
  5338. let ret = "";
  5339. if (!styles || isString(styles)) {
  5340. return ret;
  5341. }
  5342. for (const key in styles) {
  5343. ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`;
  5344. }
  5345. return ret;
  5346. }
  5347. function setRef(ref2, id, opts = {}) {
  5348. const { $templateRefs } = getCurrentInstance();
  5349. $templateRefs.push({ i: id, r: ref2, k: opts.k, f: opts.f });
  5350. }
  5351. const o = (value, key) => vOn(value, key);
  5352. const f = (source, renderItem) => vFor(source, renderItem);
  5353. const s = (value) => stringifyStyle(value);
  5354. const e = (target, ...sources) => extend(target, ...sources);
  5355. const n = (value) => normalizeClass(value);
  5356. const t = (val) => toDisplayString(val);
  5357. const p = (props) => renderProps(props);
  5358. const sr = (ref2, id, opts) => setRef(ref2, id, opts);
  5359. function createApp$1(rootComponent, rootProps = null) {
  5360. rootComponent && (rootComponent.mpType = "app");
  5361. return createVueApp(rootComponent, rootProps).use(plugin);
  5362. }
  5363. const createSSRApp = createApp$1;
  5364. const eventChannels = {};
  5365. const eventChannelStack = [];
  5366. function getEventChannel(id) {
  5367. if (id) {
  5368. const eventChannel = eventChannels[id];
  5369. delete eventChannels[id];
  5370. return eventChannel;
  5371. }
  5372. return eventChannelStack.shift();
  5373. }
  5374. const MP_METHODS = [
  5375. "createSelectorQuery",
  5376. "createIntersectionObserver",
  5377. "selectAllComponents",
  5378. "selectComponent"
  5379. ];
  5380. function createEmitFn(oldEmit, ctx) {
  5381. return function emit2(event, ...args) {
  5382. const scope = ctx.$scope;
  5383. if (scope && event) {
  5384. const detail = { __args__: args };
  5385. {
  5386. scope.triggerEvent(event, detail);
  5387. }
  5388. }
  5389. return oldEmit.apply(this, [event, ...args]);
  5390. };
  5391. }
  5392. function initBaseInstance(instance, options) {
  5393. const ctx = instance.ctx;
  5394. ctx.mpType = options.mpType;
  5395. ctx.$mpType = options.mpType;
  5396. ctx.$mpPlatform = "mp-weixin";
  5397. ctx.$scope = options.mpInstance;
  5398. ctx.$mp = {};
  5399. {
  5400. ctx._self = {};
  5401. }
  5402. instance.slots = {};
  5403. if (isArray(options.slots) && options.slots.length) {
  5404. options.slots.forEach((name) => {
  5405. instance.slots[name] = true;
  5406. });
  5407. if (instance.slots[SLOT_DEFAULT_NAME]) {
  5408. instance.slots.default = true;
  5409. }
  5410. }
  5411. ctx.getOpenerEventChannel = function() {
  5412. {
  5413. return options.mpInstance.getOpenerEventChannel();
  5414. }
  5415. };
  5416. ctx.$hasHook = hasHook;
  5417. ctx.$callHook = callHook;
  5418. instance.emit = createEmitFn(instance.emit, ctx);
  5419. }
  5420. function initComponentInstance(instance, options) {
  5421. initBaseInstance(instance, options);
  5422. const ctx = instance.ctx;
  5423. MP_METHODS.forEach((method) => {
  5424. ctx[method] = function(...args) {
  5425. const mpInstance = ctx.$scope;
  5426. if (mpInstance && mpInstance[method]) {
  5427. return mpInstance[method].apply(mpInstance, args);
  5428. }
  5429. };
  5430. });
  5431. }
  5432. function initMocks(instance, mpInstance, mocks2) {
  5433. const ctx = instance.ctx;
  5434. mocks2.forEach((mock) => {
  5435. if (hasOwn(mpInstance, mock)) {
  5436. instance[mock] = ctx[mock] = mpInstance[mock];
  5437. }
  5438. });
  5439. }
  5440. function hasHook(name) {
  5441. const hooks = this.$[name];
  5442. if (hooks && hooks.length) {
  5443. return true;
  5444. }
  5445. return false;
  5446. }
  5447. function callHook(name, args) {
  5448. if (name === "mounted") {
  5449. callHook.call(this, "bm");
  5450. this.$.isMounted = true;
  5451. name = "m";
  5452. } else if (name === "onLoad" && args && args.__id__) {
  5453. this.__eventChannel__ = getEventChannel(args.__id__);
  5454. delete args.__id__;
  5455. }
  5456. const hooks = this.$[name];
  5457. return hooks && invokeArrayFns(hooks, args);
  5458. }
  5459. const PAGE_INIT_HOOKS = [
  5460. ON_LOAD,
  5461. ON_SHOW,
  5462. ON_HIDE,
  5463. ON_UNLOAD,
  5464. ON_RESIZE,
  5465. ON_TAB_ITEM_TAP,
  5466. ON_REACH_BOTTOM,
  5467. ON_PULL_DOWN_REFRESH,
  5468. ON_ADD_TO_FAVORITES
  5469. ];
  5470. function findHooks(vueOptions, hooks = /* @__PURE__ */ new Set()) {
  5471. if (vueOptions) {
  5472. Object.keys(vueOptions).forEach((name) => {
  5473. if (name.indexOf("on") === 0 && isFunction(vueOptions[name])) {
  5474. hooks.add(name);
  5475. }
  5476. });
  5477. {
  5478. const { extends: extendsOptions, mixins } = vueOptions;
  5479. if (mixins) {
  5480. mixins.forEach((mixin) => findHooks(mixin, hooks));
  5481. }
  5482. if (extendsOptions) {
  5483. findHooks(extendsOptions, hooks);
  5484. }
  5485. }
  5486. }
  5487. return hooks;
  5488. }
  5489. function initHook(mpOptions, hook, excludes) {
  5490. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  5491. mpOptions[hook] = function(args) {
  5492. return this.$vm && this.$vm.$callHook(hook, args);
  5493. };
  5494. }
  5495. }
  5496. const EXCLUDE_HOOKS = [ON_READY];
  5497. function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
  5498. hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
  5499. }
  5500. function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
  5501. findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
  5502. }
  5503. function initRuntimeHooks(mpOptions, runtimeHooks) {
  5504. if (!runtimeHooks) {
  5505. return;
  5506. }
  5507. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  5508. hooks.forEach((hook) => {
  5509. if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
  5510. initHook(mpOptions, hook, []);
  5511. }
  5512. });
  5513. }
  5514. const findMixinRuntimeHooks = /* @__PURE__ */ once(() => {
  5515. const runtimeHooks = [];
  5516. const app = getApp({ allowDefault: true });
  5517. if (app && app.$vm && app.$vm.$) {
  5518. const mixins = app.$vm.$.appContext.mixins;
  5519. if (isArray(mixins)) {
  5520. const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
  5521. mixins.forEach((mixin) => {
  5522. hooks.forEach((hook) => {
  5523. if (hasOwn(mixin, hook) && !runtimeHooks.includes(hook)) {
  5524. runtimeHooks.push(hook);
  5525. }
  5526. });
  5527. });
  5528. }
  5529. }
  5530. return runtimeHooks;
  5531. });
  5532. function initMixinRuntimeHooks(mpOptions) {
  5533. initHooks(mpOptions, findMixinRuntimeHooks());
  5534. }
  5535. const HOOKS = [
  5536. ON_SHOW,
  5537. ON_HIDE,
  5538. ON_ERROR,
  5539. ON_THEME_CHANGE,
  5540. ON_PAGE_NOT_FOUND,
  5541. ON_UNHANDLE_REJECTION
  5542. ];
  5543. function parseApp(instance, parseAppOptions) {
  5544. const internalInstance = instance.$;
  5545. const appOptions = {
  5546. globalData: instance.$options && instance.$options.globalData || {},
  5547. $vm: instance,
  5548. onLaunch(options) {
  5549. this.$vm = instance;
  5550. const ctx = internalInstance.ctx;
  5551. if (this.$vm && ctx.$scope) {
  5552. return;
  5553. }
  5554. initBaseInstance(internalInstance, {
  5555. mpType: "app",
  5556. mpInstance: this,
  5557. slots: []
  5558. });
  5559. ctx.globalData = this.globalData;
  5560. instance.$callHook(ON_LAUNCH, options);
  5561. }
  5562. };
  5563. initLocale(instance);
  5564. const vueOptions = instance.$.type;
  5565. initHooks(appOptions, HOOKS);
  5566. initUnknownHooks(appOptions, vueOptions);
  5567. {
  5568. const methods = vueOptions.methods;
  5569. methods && extend(appOptions, methods);
  5570. }
  5571. if (parseAppOptions) {
  5572. parseAppOptions.parse(appOptions);
  5573. }
  5574. return appOptions;
  5575. }
  5576. function initCreateApp(parseAppOptions) {
  5577. return function createApp2(vm) {
  5578. return App(parseApp(vm, parseAppOptions));
  5579. };
  5580. }
  5581. function initCreateSubpackageApp(parseAppOptions) {
  5582. return function createApp2(vm) {
  5583. const appOptions = parseApp(vm, parseAppOptions);
  5584. const app = getApp({
  5585. allowDefault: true
  5586. });
  5587. vm.$.ctx.$scope = app;
  5588. const globalData = app.globalData;
  5589. if (globalData) {
  5590. Object.keys(appOptions.globalData).forEach((name) => {
  5591. if (!hasOwn(globalData, name)) {
  5592. globalData[name] = appOptions.globalData[name];
  5593. }
  5594. });
  5595. }
  5596. Object.keys(appOptions).forEach((name) => {
  5597. if (!hasOwn(app, name)) {
  5598. app[name] = appOptions[name];
  5599. }
  5600. });
  5601. initAppLifecycle(appOptions, vm);
  5602. };
  5603. }
  5604. function initAppLifecycle(appOptions, vm) {
  5605. if (isFunction(appOptions.onLaunch)) {
  5606. const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  5607. appOptions.onLaunch(args);
  5608. }
  5609. if (isFunction(appOptions.onShow) && wx.onAppShow) {
  5610. wx.onAppShow((args) => {
  5611. vm.$callHook("onShow", args);
  5612. });
  5613. }
  5614. if (isFunction(appOptions.onHide) && wx.onAppHide) {
  5615. wx.onAppHide((args) => {
  5616. vm.$callHook("onHide", args);
  5617. });
  5618. }
  5619. }
  5620. function initLocale(appVm) {
  5621. const locale = ref(normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  5622. Object.defineProperty(appVm, "$locale", {
  5623. get() {
  5624. return locale.value;
  5625. },
  5626. set(v) {
  5627. locale.value = v;
  5628. }
  5629. });
  5630. }
  5631. function initVueIds(vueIds, mpInstance) {
  5632. if (!vueIds) {
  5633. return;
  5634. }
  5635. const ids = vueIds.split(",");
  5636. const len = ids.length;
  5637. if (len === 1) {
  5638. mpInstance._$vueId = ids[0];
  5639. } else if (len === 2) {
  5640. mpInstance._$vueId = ids[0];
  5641. mpInstance._$vuePid = ids[1];
  5642. }
  5643. }
  5644. const EXTRAS = ["externalClasses"];
  5645. function initExtraOptions(miniProgramComponentOptions, vueOptions) {
  5646. EXTRAS.forEach((name) => {
  5647. if (hasOwn(vueOptions, name)) {
  5648. miniProgramComponentOptions[name] = vueOptions[name];
  5649. }
  5650. });
  5651. }
  5652. function initWxsCallMethods(methods, wxsCallMethods) {
  5653. if (!isArray(wxsCallMethods)) {
  5654. return;
  5655. }
  5656. wxsCallMethods.forEach((callMethod) => {
  5657. methods[callMethod] = function(args) {
  5658. return this.$vm[callMethod](args);
  5659. };
  5660. });
  5661. }
  5662. function selectAllComponents(mpInstance, selector, $refs) {
  5663. const components = mpInstance.selectAllComponents(selector);
  5664. components.forEach((component) => {
  5665. const ref2 = component.properties.uR;
  5666. $refs[ref2] = component.$vm || component;
  5667. });
  5668. }
  5669. function initRefs(instance, mpInstance) {
  5670. Object.defineProperty(instance, "refs", {
  5671. get() {
  5672. const $refs = {};
  5673. selectAllComponents(mpInstance, ".r", $refs);
  5674. const forComponents = mpInstance.selectAllComponents(".r-i-f");
  5675. forComponents.forEach((component) => {
  5676. const ref2 = component.properties.uR;
  5677. if (!ref2) {
  5678. return;
  5679. }
  5680. if (!$refs[ref2]) {
  5681. $refs[ref2] = [];
  5682. }
  5683. $refs[ref2].push(component.$vm || component);
  5684. });
  5685. return $refs;
  5686. }
  5687. });
  5688. }
  5689. function findVmByVueId(instance, vuePid) {
  5690. const $children = instance.$children;
  5691. for (let i = $children.length - 1; i >= 0; i--) {
  5692. const childVm = $children[i];
  5693. if (childVm.$scope._$vueId === vuePid) {
  5694. return childVm;
  5695. }
  5696. }
  5697. let parentVm;
  5698. for (let i = $children.length - 1; i >= 0; i--) {
  5699. parentVm = findVmByVueId($children[i], vuePid);
  5700. if (parentVm) {
  5701. return parentVm;
  5702. }
  5703. }
  5704. }
  5705. const builtInProps = [
  5706. "eO",
  5707. "uR",
  5708. "uRIF",
  5709. "uI",
  5710. "uT",
  5711. "uP",
  5712. "uS"
  5713. ];
  5714. function initDefaultProps(isBehavior = false) {
  5715. const properties = {};
  5716. if (!isBehavior) {
  5717. builtInProps.forEach((name) => {
  5718. properties[name] = {
  5719. type: null,
  5720. value: ""
  5721. };
  5722. });
  5723. properties.uS = {
  5724. type: null,
  5725. value: [],
  5726. observer: function(newVal) {
  5727. const $slots = /* @__PURE__ */ Object.create(null);
  5728. newVal && newVal.forEach((slotName) => {
  5729. $slots[slotName] = true;
  5730. });
  5731. this.setData({
  5732. $slots
  5733. });
  5734. }
  5735. };
  5736. }
  5737. return properties;
  5738. }
  5739. function initVirtualHostProps(options) {
  5740. const properties = {};
  5741. {
  5742. if (options && options.virtualHost) {
  5743. properties.virtualHostStyle = {
  5744. type: null,
  5745. value: ""
  5746. };
  5747. properties.virtualHostClass = {
  5748. type: null,
  5749. value: ""
  5750. };
  5751. }
  5752. }
  5753. return properties;
  5754. }
  5755. function initProps(mpComponentOptions) {
  5756. if (!mpComponentOptions.properties) {
  5757. mpComponentOptions.properties = {};
  5758. }
  5759. extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
  5760. }
  5761. const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  5762. function parsePropType(type, defaultValue) {
  5763. if (isArray(type) && type.length === 1) {
  5764. return type[0];
  5765. }
  5766. return type;
  5767. }
  5768. function normalizePropType(type, defaultValue) {
  5769. const res = parsePropType(type);
  5770. return PROP_TYPES.indexOf(res) !== -1 ? res : null;
  5771. }
  5772. function initPageProps({ properties }, rawProps) {
  5773. if (isArray(rawProps)) {
  5774. rawProps.forEach((key) => {
  5775. properties[key] = {
  5776. type: String,
  5777. value: ""
  5778. };
  5779. });
  5780. } else if (isPlainObject(rawProps)) {
  5781. Object.keys(rawProps).forEach((key) => {
  5782. const opts = rawProps[key];
  5783. if (isPlainObject(opts)) {
  5784. let value = opts.default;
  5785. if (isFunction(value)) {
  5786. value = value();
  5787. }
  5788. const type = opts.type;
  5789. opts.type = normalizePropType(type);
  5790. properties[key] = {
  5791. type: opts.type,
  5792. value
  5793. };
  5794. } else {
  5795. properties[key] = {
  5796. type: normalizePropType(opts)
  5797. };
  5798. }
  5799. });
  5800. }
  5801. }
  5802. function findPropsData(properties, isPage2) {
  5803. return (isPage2 ? findPagePropsData(properties) : findComponentPropsData(properties.uP)) || {};
  5804. }
  5805. function findPagePropsData(properties) {
  5806. const propsData = {};
  5807. if (isPlainObject(properties)) {
  5808. Object.keys(properties).forEach((name) => {
  5809. if (builtInProps.indexOf(name) === -1) {
  5810. propsData[name] = properties[name];
  5811. }
  5812. });
  5813. }
  5814. return propsData;
  5815. }
  5816. function initData(_) {
  5817. return {};
  5818. }
  5819. function initPropsObserver(componentOptions) {
  5820. const observe = function observe2() {
  5821. const up = this.properties.uP;
  5822. if (!up) {
  5823. return;
  5824. }
  5825. if (this.$vm) {
  5826. updateComponentProps(up, this.$vm.$);
  5827. } else if (this.properties.uT === "m") {
  5828. updateMiniProgramComponentProperties(up, this);
  5829. }
  5830. };
  5831. {
  5832. if (!componentOptions.observers) {
  5833. componentOptions.observers = {};
  5834. }
  5835. componentOptions.observers.uP = observe;
  5836. }
  5837. }
  5838. function updateMiniProgramComponentProperties(up, mpInstance) {
  5839. const prevProps = mpInstance.properties;
  5840. const nextProps = findComponentPropsData(up) || {};
  5841. if (hasPropsChanged(prevProps, nextProps, false)) {
  5842. mpInstance.setData(nextProps);
  5843. }
  5844. }
  5845. function updateComponentProps(up, instance) {
  5846. const prevProps = toRaw(instance.props);
  5847. const nextProps = findComponentPropsData(up) || {};
  5848. if (hasPropsChanged(prevProps, nextProps)) {
  5849. updateProps(instance, nextProps, prevProps, false);
  5850. if (hasQueueJob(instance.update)) {
  5851. invalidateJob(instance.update);
  5852. }
  5853. {
  5854. instance.update();
  5855. }
  5856. }
  5857. }
  5858. function hasPropsChanged(prevProps, nextProps, checkLen = true) {
  5859. const nextKeys = Object.keys(nextProps);
  5860. if (checkLen && nextKeys.length !== Object.keys(prevProps).length) {
  5861. return true;
  5862. }
  5863. for (let i = 0; i < nextKeys.length; i++) {
  5864. const key = nextKeys[i];
  5865. if (nextProps[key] !== prevProps[key]) {
  5866. return true;
  5867. }
  5868. }
  5869. return false;
  5870. }
  5871. function initBehaviors(vueOptions) {
  5872. const vueBehaviors = vueOptions.behaviors;
  5873. let vueProps = vueOptions.props;
  5874. if (!vueProps) {
  5875. vueOptions.props = vueProps = [];
  5876. }
  5877. const behaviors = [];
  5878. if (isArray(vueBehaviors)) {
  5879. vueBehaviors.forEach((behavior) => {
  5880. behaviors.push(behavior.replace("uni://", "wx://"));
  5881. if (behavior === "uni://form-field") {
  5882. if (isArray(vueProps)) {
  5883. vueProps.push("name");
  5884. vueProps.push("value");
  5885. } else {
  5886. vueProps.name = {
  5887. type: String,
  5888. default: ""
  5889. };
  5890. vueProps.value = {
  5891. type: [String, Number, Boolean, Array, Object, Date],
  5892. default: ""
  5893. };
  5894. }
  5895. }
  5896. });
  5897. }
  5898. return behaviors;
  5899. }
  5900. function applyOptions(componentOptions, vueOptions) {
  5901. componentOptions.data = initData();
  5902. componentOptions.behaviors = initBehaviors(vueOptions);
  5903. }
  5904. function parseComponent(vueOptions, { parse, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 }) {
  5905. vueOptions = vueOptions.default || vueOptions;
  5906. const options = {
  5907. multipleSlots: true,
  5908. addGlobalClass: true,
  5909. pureDataPattern: /^uP$/
  5910. };
  5911. if (vueOptions.options) {
  5912. extend(options, vueOptions.options);
  5913. }
  5914. const mpComponentOptions = {
  5915. options,
  5916. lifetimes: initLifetimes2({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }),
  5917. pageLifetimes: {
  5918. show() {
  5919. this.$vm && this.$vm.$callHook("onPageShow");
  5920. },
  5921. hide() {
  5922. this.$vm && this.$vm.$callHook("onPageHide");
  5923. },
  5924. resize(size2) {
  5925. this.$vm && this.$vm.$callHook("onPageResize", size2);
  5926. }
  5927. },
  5928. methods: {
  5929. __l: handleLink2
  5930. }
  5931. };
  5932. {
  5933. applyOptions(mpComponentOptions, vueOptions);
  5934. }
  5935. initProps(mpComponentOptions);
  5936. initPropsObserver(mpComponentOptions);
  5937. initExtraOptions(mpComponentOptions, vueOptions);
  5938. initWxsCallMethods(mpComponentOptions.methods, vueOptions.wxsCallMethods);
  5939. if (parse) {
  5940. parse(mpComponentOptions, { handleLink: handleLink2 });
  5941. }
  5942. return mpComponentOptions;
  5943. }
  5944. function initCreateComponent(parseOptions2) {
  5945. return function createComponent2(vueComponentOptions) {
  5946. return Component(parseComponent(vueComponentOptions, parseOptions2));
  5947. };
  5948. }
  5949. let $createComponentFn;
  5950. let $destroyComponentFn;
  5951. function getAppVm() {
  5952. return getApp().$vm;
  5953. }
  5954. function $createComponent(initialVNode, options) {
  5955. if (!$createComponentFn) {
  5956. $createComponentFn = getAppVm().$createComponent;
  5957. }
  5958. const proxy = $createComponentFn(initialVNode, options);
  5959. return getExposeProxy(proxy.$) || proxy;
  5960. }
  5961. function $destroyComponent(instance) {
  5962. if (!$destroyComponentFn) {
  5963. $destroyComponentFn = getApp().$vm.$destroyComponent;
  5964. }
  5965. return $destroyComponentFn(instance);
  5966. }
  5967. function parsePage(vueOptions, parseOptions2) {
  5968. const { parse, mocks: mocks2, isPage: isPage2, initRelation: initRelation2, handleLink: handleLink2, initLifetimes: initLifetimes2 } = parseOptions2;
  5969. const miniProgramPageOptions = parseComponent(vueOptions, {
  5970. mocks: mocks2,
  5971. isPage: isPage2,
  5972. initRelation: initRelation2,
  5973. handleLink: handleLink2,
  5974. initLifetimes: initLifetimes2
  5975. });
  5976. initPageProps(miniProgramPageOptions, (vueOptions.default || vueOptions).props);
  5977. const methods = miniProgramPageOptions.methods;
  5978. methods.onLoad = function(query) {
  5979. this.options = query;
  5980. this.$page = {
  5981. fullPath: addLeadingSlash(this.route + stringifyQuery(query))
  5982. };
  5983. return this.$vm && this.$vm.$callHook(ON_LOAD, query);
  5984. };
  5985. initHooks(methods, PAGE_INIT_HOOKS);
  5986. {
  5987. initUnknownHooks(methods, vueOptions);
  5988. }
  5989. initRuntimeHooks(methods, vueOptions.__runtimeHooks);
  5990. initMixinRuntimeHooks(methods);
  5991. parse && parse(miniProgramPageOptions, { handleLink: handleLink2 });
  5992. return miniProgramPageOptions;
  5993. }
  5994. function initCreatePage(parseOptions2) {
  5995. return function createPage2(vuePageOptions) {
  5996. return Component(parsePage(vuePageOptions, parseOptions2));
  5997. };
  5998. }
  5999. function initCreatePluginApp(parseAppOptions) {
  6000. return function createApp2(vm) {
  6001. initAppLifecycle(parseApp(vm, parseAppOptions), vm);
  6002. };
  6003. }
  6004. const MPPage = Page;
  6005. const MPComponent = Component;
  6006. function initTriggerEvent(mpInstance) {
  6007. const oldTriggerEvent = mpInstance.triggerEvent;
  6008. mpInstance.triggerEvent = function(event, ...args) {
  6009. return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
  6010. };
  6011. }
  6012. function initMiniProgramHook(name, options, isComponent) {
  6013. const oldHook = options[name];
  6014. if (!oldHook) {
  6015. options[name] = function() {
  6016. initTriggerEvent(this);
  6017. };
  6018. } else {
  6019. options[name] = function(...args) {
  6020. initTriggerEvent(this);
  6021. return oldHook.apply(this, args);
  6022. };
  6023. }
  6024. }
  6025. Page = function(options) {
  6026. initMiniProgramHook(ON_LOAD, options);
  6027. return MPPage(options);
  6028. };
  6029. Component = function(options) {
  6030. initMiniProgramHook("created", options);
  6031. const isVueComponent = options.properties && options.properties.uP;
  6032. if (!isVueComponent) {
  6033. initProps(options);
  6034. initPropsObserver(options);
  6035. }
  6036. return MPComponent(options);
  6037. };
  6038. function initLifetimes({ mocks: mocks2, isPage: isPage2, initRelation: initRelation2, vueOptions }) {
  6039. return {
  6040. attached() {
  6041. let properties = this.properties;
  6042. initVueIds(properties.uI, this);
  6043. const relationOptions = {
  6044. vuePid: this._$vuePid
  6045. };
  6046. initRelation2(this, relationOptions);
  6047. const mpInstance = this;
  6048. const isMiniProgramPage = isPage2(mpInstance);
  6049. let propsData = properties;
  6050. this.$vm = $createComponent({
  6051. type: vueOptions,
  6052. props: findPropsData(propsData, isMiniProgramPage)
  6053. }, {
  6054. mpType: isMiniProgramPage ? "page" : "component",
  6055. mpInstance,
  6056. slots: properties.uS || {},
  6057. parentComponent: relationOptions.parent && relationOptions.parent.$,
  6058. onBeforeSetup(instance, options) {
  6059. initRefs(instance, mpInstance);
  6060. initMocks(instance, mpInstance, mocks2);
  6061. initComponentInstance(instance, options);
  6062. }
  6063. });
  6064. },
  6065. ready() {
  6066. if (this.$vm) {
  6067. {
  6068. this.$vm.$callHook("mounted");
  6069. this.$vm.$callHook(ON_READY);
  6070. }
  6071. }
  6072. },
  6073. detached() {
  6074. if (this.$vm) {
  6075. pruneComponentPropsCache(this.$vm.$.uid);
  6076. $destroyComponent(this.$vm);
  6077. }
  6078. }
  6079. };
  6080. }
  6081. const mocks = ["__route__", "__wxExparserNodeId__", "__wxWebviewId__"];
  6082. function isPage(mpInstance) {
  6083. return !!mpInstance.route;
  6084. }
  6085. function initRelation(mpInstance, detail) {
  6086. mpInstance.triggerEvent("__l", detail);
  6087. }
  6088. function handleLink(event) {
  6089. const detail = event.detail || event.value;
  6090. const vuePid = detail.vuePid;
  6091. let parentVm;
  6092. if (vuePid) {
  6093. parentVm = findVmByVueId(this.$vm, vuePid);
  6094. }
  6095. if (!parentVm) {
  6096. parentVm = this.$vm;
  6097. }
  6098. detail.parent = parentVm;
  6099. }
  6100. var parseOptions = /* @__PURE__ */ Object.freeze({
  6101. __proto__: null,
  6102. mocks,
  6103. isPage,
  6104. initRelation,
  6105. handleLink,
  6106. initLifetimes
  6107. });
  6108. const createApp = initCreateApp();
  6109. const createPage = initCreatePage(parseOptions);
  6110. const createComponent = initCreateComponent(parseOptions);
  6111. const createPluginApp = initCreatePluginApp();
  6112. const createSubpackageApp = initCreateSubpackageApp();
  6113. {
  6114. wx.createApp = global.createApp = createApp;
  6115. wx.createPage = createPage;
  6116. wx.createComponent = createComponent;
  6117. wx.createPluginApp = global.createPluginApp = createPluginApp;
  6118. wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
  6119. }
  6120. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  6121. var timUploadPlugin = { exports: {} };
  6122. (function(module, exports2) {
  6123. var factory;
  6124. factory = function() {
  6125. function e2(e3, t3) {
  6126. var n3 = Object.keys(e3);
  6127. if (Object.getOwnPropertySymbols) {
  6128. var o3 = Object.getOwnPropertySymbols(e3);
  6129. t3 && (o3 = o3.filter(function(t4) {
  6130. return Object.getOwnPropertyDescriptor(e3, t4).enumerable;
  6131. })), n3.push.apply(n3, o3);
  6132. }
  6133. return n3;
  6134. }
  6135. function t2(t3) {
  6136. for (var n3 = 1; n3 < arguments.length; n3++) {
  6137. var o3 = arguments[n3] != null ? arguments[n3] : {};
  6138. n3 % 2 ? e2(Object(o3), true).forEach(function(e3) {
  6139. s2(t3, e3, o3[e3]);
  6140. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t3, Object.getOwnPropertyDescriptors(o3)) : e2(Object(o3)).forEach(function(e3) {
  6141. Object.defineProperty(t3, e3, Object.getOwnPropertyDescriptor(o3, e3));
  6142. });
  6143. }
  6144. return t3;
  6145. }
  6146. function n2(e3) {
  6147. return (n2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
  6148. return typeof e4;
  6149. } : function(e4) {
  6150. return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
  6151. })(e3);
  6152. }
  6153. function o2(e3, t3) {
  6154. if (!(e3 instanceof t3))
  6155. throw new TypeError("Cannot call a class as a function");
  6156. }
  6157. function r(e3, t3) {
  6158. for (var n3 = 0; n3 < t3.length; n3++) {
  6159. var o3 = t3[n3];
  6160. o3.enumerable = o3.enumerable || false, o3.configurable = true, "value" in o3 && (o3.writable = true), Object.defineProperty(e3, o3.key, o3);
  6161. }
  6162. }
  6163. function a(e3, t3, n3) {
  6164. return t3 && r(e3.prototype, t3), n3 && r(e3, n3), Object.defineProperty(e3, "prototype", { writable: false }), e3;
  6165. }
  6166. function s2(e3, t3, n3) {
  6167. return t3 in e3 ? Object.defineProperty(e3, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e3[t3] = n3, e3;
  6168. }
  6169. function i(e3, t3) {
  6170. if (e3 == null)
  6171. return {};
  6172. var n3, o3, r2 = function(e4, t4) {
  6173. if (e4 == null)
  6174. return {};
  6175. var n4, o4, r3 = {}, a3 = Object.keys(e4);
  6176. for (o4 = 0; o4 < a3.length; o4++)
  6177. n4 = a3[o4], t4.indexOf(n4) >= 0 || (r3[n4] = e4[n4]);
  6178. return r3;
  6179. }(e3, t3);
  6180. if (Object.getOwnPropertySymbols) {
  6181. var a2 = Object.getOwnPropertySymbols(e3);
  6182. for (o3 = 0; o3 < a2.length; o3++)
  6183. n3 = a2[o3], t3.indexOf(n3) >= 0 || Object.prototype.propertyIsEnumerable.call(e3, n3) && (r2[n3] = e3[n3]);
  6184. }
  6185. return r2;
  6186. }
  6187. var f2 = typeof wx != "undefined" && typeof wx.getSystemInfoSync == "function" && Boolean(wx.getSystemInfoSync().fontSizeSetting), u = typeof qq != "undefined" && typeof qq.getSystemInfoSync == "function" && Boolean(qq.getSystemInfoSync().fontSizeSetting), l = typeof tt != "undefined" && typeof tt.getSystemInfoSync == "function" && Boolean(tt.getSystemInfoSync().fontSizeSetting), c = typeof swan != "undefined" && typeof swan.getSystemInfoSync == "function" && Boolean(swan.getSystemInfoSync().fontSizeSetting), y = typeof my != "undefined" && typeof my.getSystemInfoSync == "function" && Boolean(my.getSystemInfoSync().fontSizeSetting), d = typeof index != "undefined" && typeof window == "undefined" && typeof index.requireNativePlugin == "function", p2 = d && index.getDeviceInfo().platform.toLocaleLowerCase() === "ios", g = (d && index.getDeviceInfo().platform.toLocaleLowerCase(), f2 || u || l || c || y || d), m = u ? qq : l ? tt : c ? swan : y ? my : f2 ? wx : d ? index : {}, h = function(e3) {
  6188. if (n2(e3) !== "object" || e3 === null)
  6189. return false;
  6190. var t3 = Object.getPrototypeOf(e3);
  6191. if (t3 === null)
  6192. return true;
  6193. for (var o3 = t3; Object.getPrototypeOf(o3) !== null; )
  6194. o3 = Object.getPrototypeOf(o3);
  6195. return t3 === o3;
  6196. };
  6197. function v(e3) {
  6198. if (e3 == null)
  6199. return true;
  6200. if (typeof e3 == "boolean")
  6201. return false;
  6202. if (typeof e3 == "number")
  6203. return e3 === 0;
  6204. if (typeof e3 == "string")
  6205. return e3.length === 0;
  6206. if (typeof e3 == "function")
  6207. return e3.length === 0;
  6208. if (Array.isArray(e3))
  6209. return e3.length === 0;
  6210. if (e3 instanceof Error)
  6211. return e3.message === "";
  6212. if (h(e3)) {
  6213. for (var t3 in e3)
  6214. if (Object.prototype.hasOwnProperty.call(e3, t3))
  6215. return false;
  6216. return true;
  6217. }
  6218. return false;
  6219. }
  6220. var b = function() {
  6221. function e3() {
  6222. o2(this, e3);
  6223. }
  6224. return a(e3, [{ key: "request", value: function(e4, t3) {
  6225. var n3 = this, o3 = e4.downloadUrl || "", r2 = (e4.method || "PUT").toUpperCase(), a2 = e4.url;
  6226. if (e4.qs) {
  6227. var s3 = function(e5) {
  6228. var t4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "&", n4 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "=";
  6229. return v(e5) ? "" : h(e5) ? Object.keys(e5).map(function(o4) {
  6230. var r3 = encodeURIComponent(o4) + n4;
  6231. return Array.isArray(e5[o4]) ? e5[o4].map(function(e6) {
  6232. return r3 + encodeURIComponent(e6);
  6233. }).join(t4) : r3 + encodeURIComponent(e5[o4]);
  6234. }).filter(Boolean).join(t4) : void 0;
  6235. }(e4.qs);
  6236. s3 && (a2 += "".concat(a2.indexOf("?") === -1 ? "?" : "&").concat(s3));
  6237. }
  6238. var i2 = new XMLHttpRequest();
  6239. i2.open(r2, a2, true), i2.responseType = e4.dataType || "text";
  6240. var f3 = e4.headers || {};
  6241. if (!v(f3))
  6242. for (var u2 in f3)
  6243. f3.hasOwnProperty(u2) && u2.toLowerCase() !== "content-length" && u2.toLowerCase() !== "user-agent" && u2.toLowerCase() !== "origin" && u2.toLowerCase() !== "host" && i2.setRequestHeader(u2, f3[u2]);
  6244. return i2.onload = function() {
  6245. if (i2.status === 200)
  6246. t3(null, n3._xhrRes(i2, n3._xhrBody(i2, o3)));
  6247. else {
  6248. var e5 = { code: i2.status, message: JSON.stringify(i2.responseText) };
  6249. t3(e5, n3._xhrRes(i2, n3._xhrBody(i2)));
  6250. }
  6251. }, i2.onerror = function(e5) {
  6252. var o4 = n3._xhrBody(i2), r3 = { code: i2.status, message: JSON.stringify(i2.responseText) };
  6253. o4 || i2.statusText || i2.status !== 0 || (e5.message = "CORS blocked or network error"), t3(r3, n3._xhrRes(i2, o4)), r3 = null;
  6254. }, e4.onProgress && i2.upload && (i2.upload.onprogress = function(t4) {
  6255. var n4 = t4.total, o4 = t4.loaded, r3 = Math.floor(100 * o4 / n4);
  6256. e4.onProgress({ total: n4, loaded: o4, percent: (r3 >= 100 ? 100 : r3) / 100 });
  6257. }), i2.send(e4.resources), i2;
  6258. } }, { key: "_xhrRes", value: function(e4, t3) {
  6259. var n3 = {};
  6260. return e4.getAllResponseHeaders().trim().split("\n").forEach(function(e5) {
  6261. if (e5) {
  6262. var t4 = e5.indexOf(":"), o3 = e5.substr(0, t4).trim().toLowerCase(), r2 = e5.substr(t4 + 1).trim();
  6263. n3[o3] = r2;
  6264. }
  6265. }), { statusCode: e4.status, statusMessage: e4.statusText, headers: n3, data: t3 };
  6266. } }, { key: "_xhrBody", value: function(e4, t3) {
  6267. return e4.status === 200 && t3 ? { location: t3 } : { response: e4.responseText };
  6268. } }]), e3;
  6269. }(), O = ["unknown", "image", "video", "audio", "log"], w = ["name"], S = function() {
  6270. function e3() {
  6271. o2(this, e3);
  6272. }
  6273. return a(e3, [{ key: "request", value: function(e4, n3) {
  6274. var o3 = this, r2 = e4.resources, a2 = r2 === void 0 ? "" : r2, s3 = e4.headers, f3 = s3 === void 0 ? {} : s3, u2 = e4.url, l2 = e4.downloadUrl, c2 = l2 === void 0 ? "" : l2, d2 = u2, g2 = null, h2 = c2.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/), v2 = decodeURIComponent(h2[3]), b2 = { key: v2.indexOf("?") > -1 ? v2.split("?")[0] : v2, success_action_status: 200, "Content-Type": "" }, S2 = {};
  6275. if (p2) {
  6276. var C = u2.split("?sign=");
  6277. if (C.length > 1) {
  6278. var P = C[1];
  6279. d2 = "".concat(C[0], "?sign=").concat(encodeURIComponent("".concat(P))), S2.sign = decodeURIComponent(P), S2.signature = decodeURIComponent(P);
  6280. }
  6281. }
  6282. var j = { url: d2, header: f3, name: "file", filePath: a2, formData: t2(t2({}, b2), S2), timeout: e4.timeout || 3e5 };
  6283. if (y) {
  6284. var x = j;
  6285. x.name, j = t2(t2({}, i(x, w)), {}, { fileName: "file", fileType: O[e4.fileType] });
  6286. }
  6287. return (g2 = m.uploadFile(t2(t2({}, j), {}, { success: function(e5) {
  6288. o3._handleResponse({ response: e5, downloadUrl: c2, callback: n3 });
  6289. }, fail: function(e5) {
  6290. o3._handleResponse({ response: e5, downloadUrl: c2, callback: n3 });
  6291. } }))).onProgressUpdate && g2.onProgressUpdate(function(t3) {
  6292. e4.onProgress && e4.onProgress({ total: t3.totalBytesExpectedToSend, loaded: t3.totalBytesSent, percent: Math.floor(t3.progress) / 100 });
  6293. }), g2;
  6294. } }, { key: "_handleResponse", value: function(e4) {
  6295. var n3 = e4.downloadUrl, o3 = e4.response, r2 = e4.callback, a2 = o3.header, s3 = {};
  6296. if (a2)
  6297. for (var i2 in a2)
  6298. a2.hasOwnProperty(i2) && (s3[i2.toLowerCase()] = a2[i2]);
  6299. var f3 = +o3.statusCode;
  6300. f3 === 200 ? r2(null, { statusCode: f3, headers: s3, data: t2(t2({}, o3.data), {}, { location: n3 }) }) : r2({ code: f3, message: JSON.stringify(o3.data) }, { statusCode: f3, headers: s3, data: void 0 });
  6301. } }]), e3;
  6302. }();
  6303. return function() {
  6304. function e3() {
  6305. o2(this, e3), console.log("TIMUploadPlugin.VERSION: ".concat("1.2.0")), this.retry = 1, this.tryCount = 0, this.systemClockOffset = 0, this.httpRequest = g ? new S() : new b();
  6306. }
  6307. return a(e3, [{ key: "uploadFile", value: function(e4, t3) {
  6308. var n3 = this;
  6309. return this.httpRequest.request(e4, function(o3, r2) {
  6310. o3 && n3.tryCount < n3.retry && n3.allowRetry(o3) ? (n3.tryCount++, n3.uploadFile(e4, t3)) : (n3.tryCount = 0, t3(o3, r2));
  6311. });
  6312. } }, { key: "allowRetry", value: function(e4) {
  6313. var t3 = false, n3 = false;
  6314. if (e4) {
  6315. var o3 = e4.headers && (e4.headers.date || e4.headers.Date) || e4.error && e4.error.ServerTime;
  6316. try {
  6317. var r2 = e4.error && e4.error.Code, a2 = e4.error && e4.error.Message;
  6318. (r2 === "RequestTimeTooSkewed" || r2 === "AccessDenied" && a2 === "Request has expired") && (n3 = true);
  6319. } catch (f3) {
  6320. }
  6321. if (n3 && o3) {
  6322. var s3 = Date.now(), i2 = Date.parse(o3);
  6323. Math.abs(s3 + this.systemClockOffset - i2) >= 3e4 && (this.systemClockOffset = i2 - s3, t3 = true);
  6324. } else
  6325. Math.floor(e4.statusCode / 100) === 5 && (t3 = true);
  6326. }
  6327. return t3;
  6328. } }]), e3;
  6329. }();
  6330. }, module.exports = factory();
  6331. })(timUploadPlugin);
  6332. var TIMUploadPlugin = timUploadPlugin.exports;
  6333. /*!
  6334. * vuex v4.0.2
  6335. * (c) 2021 Evan You
  6336. * @license MIT
  6337. */
  6338. var storeKey = "store";
  6339. function forEachValue(obj, fn) {
  6340. Object.keys(obj).forEach(function(key) {
  6341. return fn(obj[key], key);
  6342. });
  6343. }
  6344. function isObject(obj) {
  6345. return obj !== null && typeof obj === "object";
  6346. }
  6347. function isPromise(val) {
  6348. return val && typeof val.then === "function";
  6349. }
  6350. function assert(condition, msg) {
  6351. if (!condition) {
  6352. throw new Error("[vuex] " + msg);
  6353. }
  6354. }
  6355. function partial(fn, arg) {
  6356. return function() {
  6357. return fn(arg);
  6358. };
  6359. }
  6360. function genericSubscribe(fn, subs, options) {
  6361. if (subs.indexOf(fn) < 0) {
  6362. options && options.prepend ? subs.unshift(fn) : subs.push(fn);
  6363. }
  6364. return function() {
  6365. var i = subs.indexOf(fn);
  6366. if (i > -1) {
  6367. subs.splice(i, 1);
  6368. }
  6369. };
  6370. }
  6371. function resetStore(store, hot) {
  6372. store._actions = /* @__PURE__ */ Object.create(null);
  6373. store._mutations = /* @__PURE__ */ Object.create(null);
  6374. store._wrappedGetters = /* @__PURE__ */ Object.create(null);
  6375. store._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
  6376. var state = store.state;
  6377. installModule(store, state, [], store._modules.root, true);
  6378. resetStoreState(store, state, hot);
  6379. }
  6380. function resetStoreState(store, state, hot) {
  6381. var oldState = store._state;
  6382. store.getters = {};
  6383. store._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
  6384. var wrappedGetters = store._wrappedGetters;
  6385. var computedObj = {};
  6386. forEachValue(wrappedGetters, function(fn, key) {
  6387. computedObj[key] = partial(fn, store);
  6388. Object.defineProperty(store.getters, key, {
  6389. get: function() {
  6390. return computedObj[key]();
  6391. },
  6392. enumerable: true
  6393. });
  6394. });
  6395. store._state = reactive({
  6396. data: state
  6397. });
  6398. if (store.strict) {
  6399. enableStrictMode(store);
  6400. }
  6401. if (oldState) {
  6402. if (hot) {
  6403. store._withCommit(function() {
  6404. oldState.data = null;
  6405. });
  6406. }
  6407. }
  6408. }
  6409. function installModule(store, rootState, path, module, hot) {
  6410. var isRoot = !path.length;
  6411. var namespace = store._modules.getNamespace(path);
  6412. if (module.namespaced) {
  6413. if (store._modulesNamespaceMap[namespace] && true) {
  6414. console.error("[vuex] duplicate namespace " + namespace + " for the namespaced module " + path.join("/"));
  6415. }
  6416. store._modulesNamespaceMap[namespace] = module;
  6417. }
  6418. if (!isRoot && !hot) {
  6419. var parentState = getNestedState(rootState, path.slice(0, -1));
  6420. var moduleName = path[path.length - 1];
  6421. store._withCommit(function() {
  6422. {
  6423. if (moduleName in parentState) {
  6424. console.warn('[vuex] state field "' + moduleName + '" was overridden by a module with the same name at "' + path.join(".") + '"');
  6425. }
  6426. }
  6427. parentState[moduleName] = module.state;
  6428. });
  6429. }
  6430. var local = module.context = makeLocalContext(store, namespace, path);
  6431. module.forEachMutation(function(mutation, key) {
  6432. var namespacedType = namespace + key;
  6433. registerMutation(store, namespacedType, mutation, local);
  6434. });
  6435. module.forEachAction(function(action, key) {
  6436. var type = action.root ? key : namespace + key;
  6437. var handler = action.handler || action;
  6438. registerAction(store, type, handler, local);
  6439. });
  6440. module.forEachGetter(function(getter, key) {
  6441. var namespacedType = namespace + key;
  6442. registerGetter(store, namespacedType, getter, local);
  6443. });
  6444. module.forEachChild(function(child, key) {
  6445. installModule(store, rootState, path.concat(key), child, hot);
  6446. });
  6447. }
  6448. function makeLocalContext(store, namespace, path) {
  6449. var noNamespace = namespace === "";
  6450. var local = {
  6451. dispatch: noNamespace ? store.dispatch : function(_type, _payload, _options) {
  6452. var args = unifyObjectStyle(_type, _payload, _options);
  6453. var payload = args.payload;
  6454. var options = args.options;
  6455. var type = args.type;
  6456. if (!options || !options.root) {
  6457. type = namespace + type;
  6458. if (!store._actions[type]) {
  6459. console.error("[vuex] unknown local action type: " + args.type + ", global type: " + type);
  6460. return;
  6461. }
  6462. }
  6463. return store.dispatch(type, payload);
  6464. },
  6465. commit: noNamespace ? store.commit : function(_type, _payload, _options) {
  6466. var args = unifyObjectStyle(_type, _payload, _options);
  6467. var payload = args.payload;
  6468. var options = args.options;
  6469. var type = args.type;
  6470. if (!options || !options.root) {
  6471. type = namespace + type;
  6472. if (!store._mutations[type]) {
  6473. console.error("[vuex] unknown local mutation type: " + args.type + ", global type: " + type);
  6474. return;
  6475. }
  6476. }
  6477. store.commit(type, payload, options);
  6478. }
  6479. };
  6480. Object.defineProperties(local, {
  6481. getters: {
  6482. get: noNamespace ? function() {
  6483. return store.getters;
  6484. } : function() {
  6485. return makeLocalGetters(store, namespace);
  6486. }
  6487. },
  6488. state: {
  6489. get: function() {
  6490. return getNestedState(store.state, path);
  6491. }
  6492. }
  6493. });
  6494. return local;
  6495. }
  6496. function makeLocalGetters(store, namespace) {
  6497. if (!store._makeLocalGettersCache[namespace]) {
  6498. var gettersProxy = {};
  6499. var splitPos = namespace.length;
  6500. Object.keys(store.getters).forEach(function(type) {
  6501. if (type.slice(0, splitPos) !== namespace) {
  6502. return;
  6503. }
  6504. var localType = type.slice(splitPos);
  6505. Object.defineProperty(gettersProxy, localType, {
  6506. get: function() {
  6507. return store.getters[type];
  6508. },
  6509. enumerable: true
  6510. });
  6511. });
  6512. store._makeLocalGettersCache[namespace] = gettersProxy;
  6513. }
  6514. return store._makeLocalGettersCache[namespace];
  6515. }
  6516. function registerMutation(store, type, handler, local) {
  6517. var entry = store._mutations[type] || (store._mutations[type] = []);
  6518. entry.push(function wrappedMutationHandler(payload) {
  6519. handler.call(store, local.state, payload);
  6520. });
  6521. }
  6522. function registerAction(store, type, handler, local) {
  6523. var entry = store._actions[type] || (store._actions[type] = []);
  6524. entry.push(function wrappedActionHandler(payload) {
  6525. var res = handler.call(store, {
  6526. dispatch: local.dispatch,
  6527. commit: local.commit,
  6528. getters: local.getters,
  6529. state: local.state,
  6530. rootGetters: store.getters,
  6531. rootState: store.state
  6532. }, payload);
  6533. if (!isPromise(res)) {
  6534. res = Promise.resolve(res);
  6535. }
  6536. if (store._devtoolHook) {
  6537. return res.catch(function(err) {
  6538. store._devtoolHook.emit("vuex:error", err);
  6539. throw err;
  6540. });
  6541. } else {
  6542. return res;
  6543. }
  6544. });
  6545. }
  6546. function registerGetter(store, type, rawGetter, local) {
  6547. if (store._wrappedGetters[type]) {
  6548. {
  6549. console.error("[vuex] duplicate getter key: " + type);
  6550. }
  6551. return;
  6552. }
  6553. store._wrappedGetters[type] = function wrappedGetter(store2) {
  6554. return rawGetter(local.state, local.getters, store2.state, store2.getters);
  6555. };
  6556. }
  6557. function enableStrictMode(store) {
  6558. watch(function() {
  6559. return store._state.data;
  6560. }, function() {
  6561. {
  6562. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  6563. }
  6564. }, { deep: true, flush: "sync" });
  6565. }
  6566. function getNestedState(state, path) {
  6567. return path.reduce(function(state2, key) {
  6568. return state2[key];
  6569. }, state);
  6570. }
  6571. function unifyObjectStyle(type, payload, options) {
  6572. if (isObject(type) && type.type) {
  6573. options = payload;
  6574. payload = type;
  6575. type = type.type;
  6576. }
  6577. {
  6578. assert(typeof type === "string", "expects string as the type, but found " + typeof type + ".");
  6579. }
  6580. return { type, payload, options };
  6581. }
  6582. var Module = function Module2(rawModule, runtime) {
  6583. this.runtime = runtime;
  6584. this._children = /* @__PURE__ */ Object.create(null);
  6585. this._rawModule = rawModule;
  6586. var rawState = rawModule.state;
  6587. this.state = (typeof rawState === "function" ? rawState() : rawState) || {};
  6588. };
  6589. var prototypeAccessors$1 = { namespaced: { configurable: true } };
  6590. prototypeAccessors$1.namespaced.get = function() {
  6591. return !!this._rawModule.namespaced;
  6592. };
  6593. Module.prototype.addChild = function addChild(key, module) {
  6594. this._children[key] = module;
  6595. };
  6596. Module.prototype.removeChild = function removeChild(key) {
  6597. delete this._children[key];
  6598. };
  6599. Module.prototype.getChild = function getChild(key) {
  6600. return this._children[key];
  6601. };
  6602. Module.prototype.hasChild = function hasChild(key) {
  6603. return key in this._children;
  6604. };
  6605. Module.prototype.update = function update2(rawModule) {
  6606. this._rawModule.namespaced = rawModule.namespaced;
  6607. if (rawModule.actions) {
  6608. this._rawModule.actions = rawModule.actions;
  6609. }
  6610. if (rawModule.mutations) {
  6611. this._rawModule.mutations = rawModule.mutations;
  6612. }
  6613. if (rawModule.getters) {
  6614. this._rawModule.getters = rawModule.getters;
  6615. }
  6616. };
  6617. Module.prototype.forEachChild = function forEachChild(fn) {
  6618. forEachValue(this._children, fn);
  6619. };
  6620. Module.prototype.forEachGetter = function forEachGetter(fn) {
  6621. if (this._rawModule.getters) {
  6622. forEachValue(this._rawModule.getters, fn);
  6623. }
  6624. };
  6625. Module.prototype.forEachAction = function forEachAction(fn) {
  6626. if (this._rawModule.actions) {
  6627. forEachValue(this._rawModule.actions, fn);
  6628. }
  6629. };
  6630. Module.prototype.forEachMutation = function forEachMutation(fn) {
  6631. if (this._rawModule.mutations) {
  6632. forEachValue(this._rawModule.mutations, fn);
  6633. }
  6634. };
  6635. Object.defineProperties(Module.prototype, prototypeAccessors$1);
  6636. var ModuleCollection = function ModuleCollection2(rawRootModule) {
  6637. this.register([], rawRootModule, false);
  6638. };
  6639. ModuleCollection.prototype.get = function get2(path) {
  6640. return path.reduce(function(module, key) {
  6641. return module.getChild(key);
  6642. }, this.root);
  6643. };
  6644. ModuleCollection.prototype.getNamespace = function getNamespace(path) {
  6645. var module = this.root;
  6646. return path.reduce(function(namespace, key) {
  6647. module = module.getChild(key);
  6648. return namespace + (module.namespaced ? key + "/" : "");
  6649. }, "");
  6650. };
  6651. ModuleCollection.prototype.update = function update$1(rawRootModule) {
  6652. update([], this.root, rawRootModule);
  6653. };
  6654. ModuleCollection.prototype.register = function register(path, rawModule, runtime) {
  6655. var this$1$1 = this;
  6656. if (runtime === void 0)
  6657. runtime = true;
  6658. {
  6659. assertRawModule(path, rawModule);
  6660. }
  6661. var newModule = new Module(rawModule, runtime);
  6662. if (path.length === 0) {
  6663. this.root = newModule;
  6664. } else {
  6665. var parent = this.get(path.slice(0, -1));
  6666. parent.addChild(path[path.length - 1], newModule);
  6667. }
  6668. if (rawModule.modules) {
  6669. forEachValue(rawModule.modules, function(rawChildModule, key) {
  6670. this$1$1.register(path.concat(key), rawChildModule, runtime);
  6671. });
  6672. }
  6673. };
  6674. ModuleCollection.prototype.unregister = function unregister(path) {
  6675. var parent = this.get(path.slice(0, -1));
  6676. var key = path[path.length - 1];
  6677. var child = parent.getChild(key);
  6678. if (!child) {
  6679. {
  6680. console.warn("[vuex] trying to unregister module '" + key + "', which is not registered");
  6681. }
  6682. return;
  6683. }
  6684. if (!child.runtime) {
  6685. return;
  6686. }
  6687. parent.removeChild(key);
  6688. };
  6689. ModuleCollection.prototype.isRegistered = function isRegistered(path) {
  6690. var parent = this.get(path.slice(0, -1));
  6691. var key = path[path.length - 1];
  6692. if (parent) {
  6693. return parent.hasChild(key);
  6694. }
  6695. return false;
  6696. };
  6697. function update(path, targetModule, newModule) {
  6698. {
  6699. assertRawModule(path, newModule);
  6700. }
  6701. targetModule.update(newModule);
  6702. if (newModule.modules) {
  6703. for (var key in newModule.modules) {
  6704. if (!targetModule.getChild(key)) {
  6705. {
  6706. console.warn("[vuex] trying to add a new module '" + key + "' on hot reloading, manual reload is needed");
  6707. }
  6708. return;
  6709. }
  6710. update(path.concat(key), targetModule.getChild(key), newModule.modules[key]);
  6711. }
  6712. }
  6713. }
  6714. var functionAssert = {
  6715. assert: function(value) {
  6716. return typeof value === "function";
  6717. },
  6718. expected: "function"
  6719. };
  6720. var objectAssert = {
  6721. assert: function(value) {
  6722. return typeof value === "function" || typeof value === "object" && typeof value.handler === "function";
  6723. },
  6724. expected: 'function or object with "handler" function'
  6725. };
  6726. var assertTypes = {
  6727. getters: functionAssert,
  6728. mutations: functionAssert,
  6729. actions: objectAssert
  6730. };
  6731. function assertRawModule(path, rawModule) {
  6732. Object.keys(assertTypes).forEach(function(key) {
  6733. if (!rawModule[key]) {
  6734. return;
  6735. }
  6736. var assertOptions = assertTypes[key];
  6737. forEachValue(rawModule[key], function(value, type) {
  6738. assert(assertOptions.assert(value), makeAssertionMessage(path, key, type, value, assertOptions.expected));
  6739. });
  6740. });
  6741. }
  6742. function makeAssertionMessage(path, key, type, value, expected) {
  6743. var buf = key + " should be " + expected + ' but "' + key + "." + type + '"';
  6744. if (path.length > 0) {
  6745. buf += ' in module "' + path.join(".") + '"';
  6746. }
  6747. buf += " is " + JSON.stringify(value) + ".";
  6748. return buf;
  6749. }
  6750. function createStore(options) {
  6751. return new Store(options);
  6752. }
  6753. var Store = function Store2(options) {
  6754. var this$1$1 = this;
  6755. if (options === void 0)
  6756. options = {};
  6757. {
  6758. assert(typeof Promise !== "undefined", "vuex requires a Promise polyfill in this browser.");
  6759. assert(this instanceof Store2, "store must be called with the new operator.");
  6760. }
  6761. var plugins = options.plugins;
  6762. if (plugins === void 0)
  6763. plugins = [];
  6764. var strict = options.strict;
  6765. if (strict === void 0)
  6766. strict = false;
  6767. var devtools = options.devtools;
  6768. this._committing = false;
  6769. this._actions = /* @__PURE__ */ Object.create(null);
  6770. this._actionSubscribers = [];
  6771. this._mutations = /* @__PURE__ */ Object.create(null);
  6772. this._wrappedGetters = /* @__PURE__ */ Object.create(null);
  6773. this._modules = new ModuleCollection(options);
  6774. this._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
  6775. this._subscribers = [];
  6776. this._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
  6777. this._devtools = devtools;
  6778. var store = this;
  6779. var ref2 = this;
  6780. var dispatch2 = ref2.dispatch;
  6781. var commit2 = ref2.commit;
  6782. this.dispatch = function boundDispatch(type, payload) {
  6783. return dispatch2.call(store, type, payload);
  6784. };
  6785. this.commit = function boundCommit(type, payload, options2) {
  6786. return commit2.call(store, type, payload, options2);
  6787. };
  6788. this.strict = strict;
  6789. var state = this._modules.root.state;
  6790. installModule(this, state, [], this._modules.root);
  6791. resetStoreState(this, state);
  6792. plugins.forEach(function(plugin2) {
  6793. return plugin2(this$1$1);
  6794. });
  6795. };
  6796. var prototypeAccessors = { state: { configurable: true } };
  6797. Store.prototype.install = function install(app, injectKey) {
  6798. app.provide(injectKey || storeKey, this);
  6799. app.config.globalProperties.$store = this;
  6800. this._devtools !== void 0 ? this._devtools : true;
  6801. };
  6802. prototypeAccessors.state.get = function() {
  6803. return this._state.data;
  6804. };
  6805. prototypeAccessors.state.set = function(v) {
  6806. {
  6807. assert(false, "use store.replaceState() to explicit replace store state.");
  6808. }
  6809. };
  6810. Store.prototype.commit = function commit(_type, _payload, _options) {
  6811. var this$1$1 = this;
  6812. var ref2 = unifyObjectStyle(_type, _payload, _options);
  6813. var type = ref2.type;
  6814. var payload = ref2.payload;
  6815. var options = ref2.options;
  6816. var mutation = { type, payload };
  6817. var entry = this._mutations[type];
  6818. if (!entry) {
  6819. {
  6820. console.error("[vuex] unknown mutation type: " + type);
  6821. }
  6822. return;
  6823. }
  6824. this._withCommit(function() {
  6825. entry.forEach(function commitIterator(handler) {
  6826. handler(payload);
  6827. });
  6828. });
  6829. this._subscribers.slice().forEach(function(sub) {
  6830. return sub(mutation, this$1$1.state);
  6831. });
  6832. if (options && options.silent) {
  6833. console.warn("[vuex] mutation type: " + type + ". Silent option has been removed. Use the filter functionality in the vue-devtools");
  6834. }
  6835. };
  6836. Store.prototype.dispatch = function dispatch(_type, _payload) {
  6837. var this$1$1 = this;
  6838. var ref2 = unifyObjectStyle(_type, _payload);
  6839. var type = ref2.type;
  6840. var payload = ref2.payload;
  6841. var action = { type, payload };
  6842. var entry = this._actions[type];
  6843. if (!entry) {
  6844. {
  6845. console.error("[vuex] unknown action type: " + type);
  6846. }
  6847. return;
  6848. }
  6849. try {
  6850. this._actionSubscribers.slice().filter(function(sub) {
  6851. return sub.before;
  6852. }).forEach(function(sub) {
  6853. return sub.before(action, this$1$1.state);
  6854. });
  6855. } catch (e2) {
  6856. {
  6857. console.warn("[vuex] error in before action subscribers: ");
  6858. console.error(e2);
  6859. }
  6860. }
  6861. var result = entry.length > 1 ? Promise.all(entry.map(function(handler) {
  6862. return handler(payload);
  6863. })) : entry[0](payload);
  6864. return new Promise(function(resolve2, reject) {
  6865. result.then(function(res) {
  6866. try {
  6867. this$1$1._actionSubscribers.filter(function(sub) {
  6868. return sub.after;
  6869. }).forEach(function(sub) {
  6870. return sub.after(action, this$1$1.state);
  6871. });
  6872. } catch (e2) {
  6873. {
  6874. console.warn("[vuex] error in after action subscribers: ");
  6875. console.error(e2);
  6876. }
  6877. }
  6878. resolve2(res);
  6879. }, function(error) {
  6880. try {
  6881. this$1$1._actionSubscribers.filter(function(sub) {
  6882. return sub.error;
  6883. }).forEach(function(sub) {
  6884. return sub.error(action, this$1$1.state, error);
  6885. });
  6886. } catch (e2) {
  6887. {
  6888. console.warn("[vuex] error in error action subscribers: ");
  6889. console.error(e2);
  6890. }
  6891. }
  6892. reject(error);
  6893. });
  6894. });
  6895. };
  6896. Store.prototype.subscribe = function subscribe(fn, options) {
  6897. return genericSubscribe(fn, this._subscribers, options);
  6898. };
  6899. Store.prototype.subscribeAction = function subscribeAction(fn, options) {
  6900. var subs = typeof fn === "function" ? { before: fn } : fn;
  6901. return genericSubscribe(subs, this._actionSubscribers, options);
  6902. };
  6903. Store.prototype.watch = function watch$1(getter, cb, options) {
  6904. var this$1$1 = this;
  6905. {
  6906. assert(typeof getter === "function", "store.watch only accepts a function.");
  6907. }
  6908. return watch(function() {
  6909. return getter(this$1$1.state, this$1$1.getters);
  6910. }, cb, Object.assign({}, options));
  6911. };
  6912. Store.prototype.replaceState = function replaceState(state) {
  6913. var this$1$1 = this;
  6914. this._withCommit(function() {
  6915. this$1$1._state.data = state;
  6916. });
  6917. };
  6918. Store.prototype.registerModule = function registerModule(path, rawModule, options) {
  6919. if (options === void 0)
  6920. options = {};
  6921. if (typeof path === "string") {
  6922. path = [path];
  6923. }
  6924. {
  6925. assert(Array.isArray(path), "module path must be a string or an Array.");
  6926. assert(path.length > 0, "cannot register the root module by using registerModule.");
  6927. }
  6928. this._modules.register(path, rawModule);
  6929. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  6930. resetStoreState(this, this.state);
  6931. };
  6932. Store.prototype.unregisterModule = function unregisterModule(path) {
  6933. var this$1$1 = this;
  6934. if (typeof path === "string") {
  6935. path = [path];
  6936. }
  6937. {
  6938. assert(Array.isArray(path), "module path must be a string or an Array.");
  6939. }
  6940. this._modules.unregister(path);
  6941. this._withCommit(function() {
  6942. var parentState = getNestedState(this$1$1.state, path.slice(0, -1));
  6943. delete parentState[path[path.length - 1]];
  6944. });
  6945. resetStore(this);
  6946. };
  6947. Store.prototype.hasModule = function hasModule(path) {
  6948. if (typeof path === "string") {
  6949. path = [path];
  6950. }
  6951. {
  6952. assert(Array.isArray(path), "module path must be a string or an Array.");
  6953. }
  6954. return this._modules.isRegistered(path);
  6955. };
  6956. Store.prototype.hotUpdate = function hotUpdate(newOptions) {
  6957. this._modules.update(newOptions);
  6958. resetStore(this, true);
  6959. };
  6960. Store.prototype._withCommit = function _withCommit(fn) {
  6961. var committing = this._committing;
  6962. this._committing = true;
  6963. fn();
  6964. this._committing = committing;
  6965. };
  6966. Object.defineProperties(Store.prototype, prototypeAccessors);
  6967. const createHook = (lifecycle) => (hook, target = getCurrentInstance()) => {
  6968. !isInSSRComponentSetup && injectHook(lifecycle, hook, target);
  6969. };
  6970. const onShow = /* @__PURE__ */ createHook(ON_SHOW);
  6971. const onLoad = /* @__PURE__ */ createHook(ON_LOAD);
  6972. const onReady = /* @__PURE__ */ createHook(ON_READY);
  6973. const onUnload = /* @__PURE__ */ createHook(ON_UNLOAD);
  6974. const onNavigationBarButtonTap = /* @__PURE__ */ createHook(ON_NAVIGATION_BAR_BUTTON_TAP);
  6975. var dayjs_min = { exports: {} };
  6976. (function(module, exports2) {
  6977. !function(t2, e2) {
  6978. module.exports = e2();
  6979. }(commonjsGlobal, function() {
  6980. var t2 = 1e3, e2 = 6e4, n2 = 36e5, r = "millisecond", i = "second", s2 = "minute", u = "hour", a = "day", o2 = "week", f2 = "month", h = "quarter", c = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
  6981. var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100;
  6982. return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]";
  6983. } }, m = function(t3, e3, n3) {
  6984. var r2 = String(t3);
  6985. return !r2 || r2.length >= e3 ? t3 : "" + Array(e3 + 1 - r2.length).join(n3) + t3;
  6986. }, v = { s: m, z: function(t3) {
  6987. var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r2 = Math.floor(n3 / 60), i2 = n3 % 60;
  6988. return (e3 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
  6989. }, m: function t3(e3, n3) {
  6990. if (e3.date() < n3.date())
  6991. return -t3(n3, e3);
  6992. var r2 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i2 = e3.clone().add(r2, f2), s3 = n3 - i2 < 0, u2 = e3.clone().add(r2 + (s3 ? -1 : 1), f2);
  6993. return +(-(r2 + (n3 - i2) / (s3 ? i2 - u2 : u2 - i2)) || 0);
  6994. }, a: function(t3) {
  6995. return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
  6996. }, p: function(t3) {
  6997. return { M: f2, y: c, w: o2, d: a, D: d, h: u, m: s2, s: i, ms: r, Q: h }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
  6998. }, u: function(t3) {
  6999. return t3 === void 0;
  7000. } }, g = "en", D = {};
  7001. D[g] = M;
  7002. var p2 = function(t3) {
  7003. return t3 instanceof _;
  7004. }, S = function t3(e3, n3, r2) {
  7005. var i2;
  7006. if (!e3)
  7007. return g;
  7008. if (typeof e3 == "string") {
  7009. var s3 = e3.toLowerCase();
  7010. D[s3] && (i2 = s3), n3 && (D[s3] = n3, i2 = s3);
  7011. var u2 = e3.split("-");
  7012. if (!i2 && u2.length > 1)
  7013. return t3(u2[0]);
  7014. } else {
  7015. var a2 = e3.name;
  7016. D[a2] = e3, i2 = a2;
  7017. }
  7018. return !r2 && i2 && (g = i2), i2 || !r2 && g;
  7019. }, w = function(t3, e3) {
  7020. if (p2(t3))
  7021. return t3.clone();
  7022. var n3 = typeof e3 == "object" ? e3 : {};
  7023. return n3.date = t3, n3.args = arguments, new _(n3);
  7024. }, O = v;
  7025. O.l = S, O.i = p2, O.w = function(t3, e3) {
  7026. return w(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
  7027. };
  7028. var _ = function() {
  7029. function M2(t3) {
  7030. this.$L = S(t3.locale, null, true), this.parse(t3);
  7031. }
  7032. var m2 = M2.prototype;
  7033. return m2.parse = function(t3) {
  7034. this.$d = function(t4) {
  7035. var e3 = t4.date, n3 = t4.utc;
  7036. if (e3 === null)
  7037. return new Date(NaN);
  7038. if (O.u(e3))
  7039. return new Date();
  7040. if (e3 instanceof Date)
  7041. return new Date(e3);
  7042. if (typeof e3 == "string" && !/Z$/i.test(e3)) {
  7043. var r2 = e3.match($);
  7044. if (r2) {
  7045. var i2 = r2[2] - 1 || 0, s3 = (r2[7] || "0").substring(0, 3);
  7046. return n3 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s3)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s3);
  7047. }
  7048. }
  7049. return new Date(e3);
  7050. }(t3), this.$x = t3.x || {}, this.init();
  7051. }, m2.init = function() {
  7052. var t3 = this.$d;
  7053. this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
  7054. }, m2.$utils = function() {
  7055. return O;
  7056. }, m2.isValid = function() {
  7057. return !(this.$d.toString() === l);
  7058. }, m2.isSame = function(t3, e3) {
  7059. var n3 = w(t3);
  7060. return this.startOf(e3) <= n3 && n3 <= this.endOf(e3);
  7061. }, m2.isAfter = function(t3, e3) {
  7062. return w(t3) < this.startOf(e3);
  7063. }, m2.isBefore = function(t3, e3) {
  7064. return this.endOf(e3) < w(t3);
  7065. }, m2.$g = function(t3, e3, n3) {
  7066. return O.u(t3) ? this[e3] : this.set(n3, t3);
  7067. }, m2.unix = function() {
  7068. return Math.floor(this.valueOf() / 1e3);
  7069. }, m2.valueOf = function() {
  7070. return this.$d.getTime();
  7071. }, m2.startOf = function(t3, e3) {
  7072. var n3 = this, r2 = !!O.u(e3) || e3, h2 = O.p(t3), l2 = function(t4, e4) {
  7073. var i2 = O.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3);
  7074. return r2 ? i2 : i2.endOf(a);
  7075. }, $2 = function(t4, e4) {
  7076. return O.w(n3.toDate()[t4].apply(n3.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3);
  7077. }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
  7078. switch (h2) {
  7079. case c:
  7080. return r2 ? l2(1, 0) : l2(31, 11);
  7081. case f2:
  7082. return r2 ? l2(1, M3) : l2(0, M3 + 1);
  7083. case o2:
  7084. var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
  7085. return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
  7086. case a:
  7087. case d:
  7088. return $2(v2 + "Hours", 0);
  7089. case u:
  7090. return $2(v2 + "Minutes", 1);
  7091. case s2:
  7092. return $2(v2 + "Seconds", 2);
  7093. case i:
  7094. return $2(v2 + "Milliseconds", 3);
  7095. default:
  7096. return this.clone();
  7097. }
  7098. }, m2.endOf = function(t3) {
  7099. return this.startOf(t3, false);
  7100. }, m2.$set = function(t3, e3) {
  7101. var n3, o3 = O.p(t3), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n3 = {}, n3[a] = h2 + "Date", n3[d] = h2 + "Date", n3[f2] = h2 + "Month", n3[c] = h2 + "FullYear", n3[u] = h2 + "Hours", n3[s2] = h2 + "Minutes", n3[i] = h2 + "Seconds", n3[r] = h2 + "Milliseconds", n3)[o3], $2 = o3 === a ? this.$D + (e3 - this.$W) : e3;
  7102. if (o3 === f2 || o3 === c) {
  7103. var y2 = this.clone().set(d, 1);
  7104. y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
  7105. } else
  7106. l2 && this.$d[l2]($2);
  7107. return this.init(), this;
  7108. }, m2.set = function(t3, e3) {
  7109. return this.clone().$set(t3, e3);
  7110. }, m2.get = function(t3) {
  7111. return this[O.p(t3)]();
  7112. }, m2.add = function(r2, h2) {
  7113. var d2, l2 = this;
  7114. r2 = Number(r2);
  7115. var $2 = O.p(h2), y2 = function(t3) {
  7116. var e3 = w(l2);
  7117. return O.w(e3.date(e3.date() + Math.round(t3 * r2)), l2);
  7118. };
  7119. if ($2 === f2)
  7120. return this.set(f2, this.$M + r2);
  7121. if ($2 === c)
  7122. return this.set(c, this.$y + r2);
  7123. if ($2 === a)
  7124. return y2(1);
  7125. if ($2 === o2)
  7126. return y2(7);
  7127. var M3 = (d2 = {}, d2[s2] = e2, d2[u] = n2, d2[i] = t2, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
  7128. return O.w(m3, this);
  7129. }, m2.subtract = function(t3, e3) {
  7130. return this.add(-1 * t3, e3);
  7131. }, m2.format = function(t3) {
  7132. var e3 = this, n3 = this.$locale();
  7133. if (!this.isValid())
  7134. return n3.invalidDate || l;
  7135. var r2 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s3 = this.$H, u2 = this.$m, a2 = this.$M, o3 = n3.weekdays, f3 = n3.months, h2 = function(t4, n4, i3, s4) {
  7136. return t4 && (t4[n4] || t4(e3, r2)) || i3[n4].slice(0, s4);
  7137. }, c2 = function(t4) {
  7138. return O.s(s3 % 12 || 12, t4, "0");
  7139. }, d2 = n3.meridiem || function(t4, e4, n4) {
  7140. var r3 = t4 < 12 ? "AM" : "PM";
  7141. return n4 ? r3.toLowerCase() : r3;
  7142. }, $2 = { YY: String(this.$y).slice(-2), YYYY: O.s(this.$y, 4, "0"), M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n3.monthsShort, a2, f3, 3), MMMM: h2(f3, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n3.weekdaysMin, this.$W, o3, 2), ddd: h2(n3.weekdaysShort, this.$W, o3, 3), dddd: o3[this.$W], H: String(s3), HH: O.s(s3, 2, "0"), h: c2(1), hh: c2(2), a: d2(s3, u2, true), A: d2(s3, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
  7143. return r2.replace(y, function(t4, e4) {
  7144. return e4 || $2[t4] || i2.replace(":", "");
  7145. });
  7146. }, m2.utcOffset = function() {
  7147. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  7148. }, m2.diff = function(r2, d2, l2) {
  7149. var $2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e2, v2 = this - M3, g2 = O.m(this, M3);
  7150. return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f2] = g2, $2[h] = g2 / 3, $2[o2] = (v2 - m3) / 6048e5, $2[a] = (v2 - m3) / 864e5, $2[u] = v2 / n2, $2[s2] = v2 / e2, $2[i] = v2 / t2, $2)[y2] || v2, l2 ? g2 : O.a(g2);
  7151. }, m2.daysInMonth = function() {
  7152. return this.endOf(f2).$D;
  7153. }, m2.$locale = function() {
  7154. return D[this.$L];
  7155. }, m2.locale = function(t3, e3) {
  7156. if (!t3)
  7157. return this.$L;
  7158. var n3 = this.clone(), r2 = S(t3, e3, true);
  7159. return r2 && (n3.$L = r2), n3;
  7160. }, m2.clone = function() {
  7161. return O.w(this.$d, this);
  7162. }, m2.toDate = function() {
  7163. return new Date(this.valueOf());
  7164. }, m2.toJSON = function() {
  7165. return this.isValid() ? this.toISOString() : null;
  7166. }, m2.toISOString = function() {
  7167. return this.$d.toISOString();
  7168. }, m2.toString = function() {
  7169. return this.$d.toUTCString();
  7170. }, M2;
  7171. }(), T = _.prototype;
  7172. return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s2], ["$H", u], ["$W", a], ["$M", f2], ["$y", c], ["$D", d]].forEach(function(t3) {
  7173. T[t3[1]] = function(e3) {
  7174. return this.$g(e3, t3[0], t3[1]);
  7175. };
  7176. }), w.extend = function(t3, e3) {
  7177. return t3.$i || (t3(e3, _, w), t3.$i = true), w;
  7178. }, w.locale = S, w.isDayjs = p2, w.unix = function(t3) {
  7179. return w(1e3 * t3);
  7180. }, w.en = D[g], w.Ls = D, w.p = {}, w;
  7181. });
  7182. })(dayjs_min);
  7183. var dayjs = dayjs_min.exports;
  7184. exports.TIMUploadPlugin = TIMUploadPlugin;
  7185. exports._export_sfc = _export_sfc;
  7186. exports.computed$1 = computed$1;
  7187. exports.createSSRApp = createSSRApp;
  7188. exports.createStore = createStore;
  7189. exports.dayjs = dayjs;
  7190. exports.defineComponent = defineComponent;
  7191. exports.e = e;
  7192. exports.f = f;
  7193. exports.index = index;
  7194. exports.n = n;
  7195. exports.nextTick = nextTick;
  7196. exports.o = o;
  7197. exports.onLoad = onLoad;
  7198. exports.onMounted = onMounted;
  7199. exports.onNavigationBarButtonTap = onNavigationBarButtonTap;
  7200. exports.onReady = onReady;
  7201. exports.onShow = onShow;
  7202. exports.onUnload = onUnload;
  7203. exports.p = p;
  7204. exports.reactive = reactive;
  7205. exports.ref = ref;
  7206. exports.resolveComponent = resolveComponent;
  7207. exports.s = s;
  7208. exports.shallowRef = shallowRef;
  7209. exports.sr = sr;
  7210. exports.t = t;
  7211. exports.toRefs = toRefs;
  7212. exports.watch = watch;
  7213. exports.watchEffect = watchEffect;