index.full.mjs 1.9 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720
  1. /*! Element Plus v2.13.5 */
  2. import { Comment, Fragment, Teleport, Text, Transition, TransitionGroup, cloneVNode, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, getCurrentScope, guardReactiveProps, h, inject, isRef, isVNode, markRaw, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, provide, reactive, readonly, ref, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowReactive, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, triggerRef, unref, useAttrs as useAttrs$1, useSlots, vModelCheckbox, vModelRadio, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
  3. //#region \0rolldown/runtime.js
  4. var __create = Object.create;
  5. var __defProp = Object.defineProperty;
  6. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7. var __getOwnPropNames = Object.getOwnPropertyNames;
  8. var __getProtoOf = Object.getPrototypeOf;
  9. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10. var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
  11. var __copyProps = (to, from, except, desc) => {
  12. if (from && typeof from === "object" || typeof from === "function") {
  13. for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
  14. key = keys[i];
  15. if (!__hasOwnProp.call(to, key) && key !== except) {
  16. __defProp(to, key, {
  17. get: ((k) => from[k]).bind(null, key),
  18. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  19. });
  20. }
  21. }
  22. }
  23. return to;
  24. };
  25. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  26. value: mod,
  27. enumerable: true
  28. }) : target, mod));
  29. //#endregion
  30. //#region ../../packages/utils/dom/aria.ts
  31. const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
  32. const isShadowRoot$1 = (e) => {
  33. if (typeof ShadowRoot === "undefined") return false;
  34. return e instanceof ShadowRoot;
  35. };
  36. const isHTMLElement$1 = (e) => {
  37. if (typeof Element === "undefined") return false;
  38. return e instanceof Element;
  39. };
  40. /**
  41. * Determine if the testing element is visible on screen no matter if its on the viewport or not
  42. */
  43. const isVisible = (element) => {
  44. return getComputedStyle(element).position === "fixed" ? false : element.offsetParent !== null;
  45. };
  46. const obtainAllFocusableElements$1 = (element) => {
  47. return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
  48. };
  49. /**
  50. * @desc Determine if target element is focusable
  51. * @param element {HTMLElement}
  52. * @returns {Boolean} true if it is focusable
  53. */
  54. const isFocusable = (element) => {
  55. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) return true;
  56. if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") return false;
  57. switch (element.nodeName) {
  58. case "A": return !!element.href && element.rel !== "ignore";
  59. case "INPUT": return !(element.type === "hidden" || element.type === "file");
  60. case "BUTTON":
  61. case "SELECT":
  62. case "TEXTAREA": return true;
  63. default: return false;
  64. }
  65. };
  66. /**
  67. * Trigger an event
  68. * mouseenter, mouseleave, mouseover, keyup, change, click, etc.
  69. * @param {HTMLElement} elm
  70. * @param {String} name
  71. * @param {*} opts
  72. */
  73. const triggerEvent = function(elm, name, ...opts) {
  74. let eventName;
  75. if (name.includes("mouse") || name.includes("click")) eventName = "MouseEvents";
  76. else if (name.includes("key")) eventName = "KeyboardEvent";
  77. else eventName = "HTMLEvents";
  78. const evt = document.createEvent(eventName);
  79. evt.initEvent(name, ...opts);
  80. elm.dispatchEvent(evt);
  81. return elm;
  82. };
  83. const isLeaf = (el) => !el.getAttribute("aria-owns");
  84. const getSibling = (el, distance, elClass) => {
  85. const { parentNode } = el;
  86. if (!parentNode) return null;
  87. const siblings = parentNode.querySelectorAll(elClass);
  88. return siblings[Array.prototype.indexOf.call(siblings, el) + distance] || null;
  89. };
  90. const focusElement = (el, options) => {
  91. if (!el || !el.focus) return;
  92. let cleanup = false;
  93. if (isHTMLElement$1(el) && !isFocusable(el) && !el.getAttribute("tabindex")) {
  94. el.setAttribute("tabindex", "-1");
  95. cleanup = true;
  96. }
  97. el.focus(options);
  98. if (isHTMLElement$1(el) && cleanup) el.removeAttribute("tabindex");
  99. };
  100. const focusNode = (el) => {
  101. if (!el) return;
  102. focusElement(el);
  103. !isLeaf(el) && el.click();
  104. };
  105. //#endregion
  106. //#region ../../packages/constants/aria.ts
  107. const EVENT_CODE = {
  108. tab: "Tab",
  109. enter: "Enter",
  110. space: "Space",
  111. left: "ArrowLeft",
  112. up: "ArrowUp",
  113. right: "ArrowRight",
  114. down: "ArrowDown",
  115. esc: "Escape",
  116. delete: "Delete",
  117. backspace: "Backspace",
  118. numpadEnter: "NumpadEnter",
  119. pageUp: "PageUp",
  120. pageDown: "PageDown",
  121. home: "Home",
  122. end: "End"
  123. };
  124. //#endregion
  125. //#region ../../packages/constants/date.ts
  126. const datePickTypes = [
  127. "year",
  128. "years",
  129. "month",
  130. "months",
  131. "date",
  132. "dates",
  133. "week",
  134. "datetime",
  135. "datetimerange",
  136. "daterange",
  137. "monthrange",
  138. "yearrange"
  139. ];
  140. const WEEK_DAYS = [
  141. "sun",
  142. "mon",
  143. "tue",
  144. "wed",
  145. "thu",
  146. "fri",
  147. "sat"
  148. ];
  149. //#endregion
  150. //#region ../../packages/constants/event.ts
  151. const UPDATE_MODEL_EVENT = "update:modelValue";
  152. const CHANGE_EVENT = "change";
  153. const INPUT_EVENT = "input";
  154. //#endregion
  155. //#region ../../packages/constants/key.ts
  156. const INSTALLED_KEY = Symbol("INSTALLED_KEY");
  157. //#endregion
  158. //#region ../../packages/constants/size.ts
  159. const componentSizes = [
  160. "",
  161. "default",
  162. "small",
  163. "large"
  164. ];
  165. const componentSizeMap = {
  166. large: 40,
  167. default: 32,
  168. small: 24
  169. };
  170. //#endregion
  171. //#region ../../packages/constants/column-alignment.ts
  172. const columnAlignment = [
  173. "left",
  174. "center",
  175. "right"
  176. ];
  177. //#endregion
  178. //#region ../../packages/constants/form.ts
  179. const MINIMUM_INPUT_WIDTH = 11;
  180. const BORDER_HORIZONTAL_WIDTH = 2;
  181. //#endregion
  182. //#region ../../node_modules/.pnpm/@vueuse+shared@12.0.0_typescript@5.5.4/node_modules/@vueuse/shared/index.mjs
  183. function computedEager(fn, options) {
  184. var _a;
  185. const result = shallowRef();
  186. watchEffect(() => {
  187. result.value = fn();
  188. }, {
  189. ...options,
  190. flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
  191. });
  192. return readonly(result);
  193. }
  194. function tryOnScopeDispose(fn) {
  195. if (getCurrentScope()) {
  196. onScopeDispose(fn);
  197. return true;
  198. }
  199. return false;
  200. }
  201. function toValue$1(r) {
  202. return typeof r === "function" ? r() : unref(r);
  203. }
  204. function toReactive(objectRef) {
  205. if (!isRef(objectRef)) return reactive(objectRef);
  206. return reactive(new Proxy({}, {
  207. get(_, p, receiver) {
  208. return unref(Reflect.get(objectRef.value, p, receiver));
  209. },
  210. set(_, p, value) {
  211. if (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;
  212. else objectRef.value[p] = value;
  213. return true;
  214. },
  215. deleteProperty(_, p) {
  216. return Reflect.deleteProperty(objectRef.value, p);
  217. },
  218. has(_, p) {
  219. return Reflect.has(objectRef.value, p);
  220. },
  221. ownKeys() {
  222. return Object.keys(objectRef.value);
  223. },
  224. getOwnPropertyDescriptor() {
  225. return {
  226. enumerable: true,
  227. configurable: true
  228. };
  229. }
  230. }));
  231. }
  232. function reactiveComputed(fn) {
  233. return toReactive(computed(fn));
  234. }
  235. const isClient = typeof window !== "undefined" && typeof document !== "undefined";
  236. const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
  237. const isDef = (val) => typeof val !== "undefined";
  238. const notNullish = (val) => val != null;
  239. const toString$1 = Object.prototype.toString;
  240. const isObject$2 = (val) => toString$1.call(val) === "[object Object]";
  241. const clamp$2 = (n, min, max) => Math.min(max, Math.max(min, n));
  242. const noop$1 = () => {};
  243. const isIOS = /* @__PURE__ */ getIsIOS();
  244. function getIsIOS() {
  245. var _a, _b;
  246. return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
  247. }
  248. function createFilterWrapper(filter, fn) {
  249. function wrapper(...args) {
  250. return new Promise((resolve, reject) => {
  251. Promise.resolve(filter(() => fn.apply(this, args), {
  252. fn,
  253. thisArg: this,
  254. args
  255. })).then(resolve).catch(reject);
  256. });
  257. }
  258. return wrapper;
  259. }
  260. function debounceFilter(ms, options = {}) {
  261. let timer;
  262. let maxTimer;
  263. let lastRejector = noop$1;
  264. const _clearTimeout = (timer2) => {
  265. clearTimeout(timer2);
  266. lastRejector();
  267. lastRejector = noop$1;
  268. };
  269. const filter = (invoke) => {
  270. const duration = toValue$1(ms);
  271. const maxDuration = toValue$1(options.maxWait);
  272. if (timer) _clearTimeout(timer);
  273. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  274. if (maxTimer) {
  275. _clearTimeout(maxTimer);
  276. maxTimer = null;
  277. }
  278. return Promise.resolve(invoke());
  279. }
  280. return new Promise((resolve, reject) => {
  281. lastRejector = options.rejectOnCancel ? reject : resolve;
  282. if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
  283. if (timer) _clearTimeout(timer);
  284. maxTimer = null;
  285. resolve(invoke());
  286. }, maxDuration);
  287. timer = setTimeout(() => {
  288. if (maxTimer) _clearTimeout(maxTimer);
  289. maxTimer = null;
  290. resolve(invoke());
  291. }, duration);
  292. });
  293. };
  294. return filter;
  295. }
  296. function throttleFilter(...args) {
  297. let lastExec = 0;
  298. let timer;
  299. let isLeading = true;
  300. let lastRejector = noop$1;
  301. let lastValue;
  302. let ms;
  303. let trailing;
  304. let leading;
  305. let rejectOnCancel;
  306. if (!isRef(args[0]) && typeof args[0] === "object") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);
  307. else [ms, trailing = true, leading = true, rejectOnCancel = false] = args;
  308. const clear = () => {
  309. if (timer) {
  310. clearTimeout(timer);
  311. timer = void 0;
  312. lastRejector();
  313. lastRejector = noop$1;
  314. }
  315. };
  316. const filter = (_invoke) => {
  317. const duration = toValue$1(ms);
  318. const elapsed = Date.now() - lastExec;
  319. const invoke = () => {
  320. return lastValue = _invoke();
  321. };
  322. clear();
  323. if (duration <= 0) {
  324. lastExec = Date.now();
  325. return invoke();
  326. }
  327. if (elapsed > duration && (leading || !isLeading)) {
  328. lastExec = Date.now();
  329. invoke();
  330. } else if (trailing) lastValue = new Promise((resolve, reject) => {
  331. lastRejector = rejectOnCancel ? reject : resolve;
  332. timer = setTimeout(() => {
  333. lastExec = Date.now();
  334. isLeading = true;
  335. resolve(invoke());
  336. clear();
  337. }, Math.max(0, duration - elapsed));
  338. });
  339. if (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);
  340. isLeading = false;
  341. return lastValue;
  342. };
  343. return filter;
  344. }
  345. function cacheStringFunction$1(fn) {
  346. const cache = /* @__PURE__ */ Object.create(null);
  347. return (str) => {
  348. return cache[str] || (cache[str] = fn(str));
  349. };
  350. }
  351. const hyphenateRE$1 = /\B([A-Z])/g;
  352. const hyphenate$1 = cacheStringFunction$1((str) => str.replace(hyphenateRE$1, "-$1").toLowerCase());
  353. const camelizeRE$1 = /-(\w)/g;
  354. const camelize$1 = cacheStringFunction$1((str) => {
  355. return str.replace(camelizeRE$1, (_, c) => c ? c.toUpperCase() : "");
  356. });
  357. function getLifeCycleTarget(target) {
  358. return target || getCurrentInstance();
  359. }
  360. function useDebounceFn(fn, ms = 200, options = {}) {
  361. return createFilterWrapper(debounceFilter(ms, options), fn);
  362. }
  363. function refDebounced(value, ms = 200, options = {}) {
  364. const debounced = ref(value.value);
  365. const updater = useDebounceFn(() => {
  366. debounced.value = value.value;
  367. }, ms, options);
  368. watch(value, () => updater());
  369. return debounced;
  370. }
  371. function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
  372. return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
  373. }
  374. function tryOnMounted(fn, sync = true, target) {
  375. if (getLifeCycleTarget()) onMounted(fn, target);
  376. else if (sync) fn();
  377. else nextTick(fn);
  378. }
  379. function useTimeoutFn(cb, interval, options = {}) {
  380. const { immediate = true } = options;
  381. const isPending = ref(false);
  382. let timer = null;
  383. function clear() {
  384. if (timer) {
  385. clearTimeout(timer);
  386. timer = null;
  387. }
  388. }
  389. function stop() {
  390. isPending.value = false;
  391. clear();
  392. }
  393. function start(...args) {
  394. clear();
  395. isPending.value = true;
  396. timer = setTimeout(() => {
  397. isPending.value = false;
  398. timer = null;
  399. cb(...args);
  400. }, toValue$1(interval));
  401. }
  402. if (immediate) {
  403. isPending.value = true;
  404. if (isClient) start();
  405. }
  406. tryOnScopeDispose(stop);
  407. return {
  408. isPending: readonly(isPending),
  409. start,
  410. stop
  411. };
  412. }
  413. //#endregion
  414. //#region ../../node_modules/.pnpm/@vueuse+core@12.0.0_typescript@5.5.4/node_modules/@vueuse/core/index.mjs
  415. const defaultWindow = isClient ? window : void 0;
  416. const defaultDocument = isClient ? window.document : void 0;
  417. const defaultNavigator = isClient ? window.navigator : void 0;
  418. const defaultLocation = isClient ? window.location : void 0;
  419. function unrefElement(elRef) {
  420. var _a;
  421. const plain = toValue$1(elRef);
  422. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  423. }
  424. function useEventListener(...args) {
  425. let target;
  426. let events;
  427. let listeners;
  428. let options;
  429. if (typeof args[0] === "string" || Array.isArray(args[0])) {
  430. [events, listeners, options] = args;
  431. target = defaultWindow;
  432. } else [target, events, listeners, options] = args;
  433. if (!target) return noop$1;
  434. if (!Array.isArray(events)) events = [events];
  435. if (!Array.isArray(listeners)) listeners = [listeners];
  436. const cleanups = [];
  437. const cleanup = () => {
  438. cleanups.forEach((fn) => fn());
  439. cleanups.length = 0;
  440. };
  441. const register = (el, event, listener, options2) => {
  442. el.addEventListener(event, listener, options2);
  443. return () => el.removeEventListener(event, listener, options2);
  444. };
  445. const stopWatch = watch(() => [unrefElement(target), toValue$1(options)], ([el, options2]) => {
  446. cleanup();
  447. if (!el) return;
  448. const optionsClone = isObject$2(options2) ? { ...options2 } : options2;
  449. cleanups.push(...events.flatMap((event) => {
  450. return listeners.map((listener) => register(el, event, listener, optionsClone));
  451. }));
  452. }, {
  453. immediate: true,
  454. flush: "post"
  455. });
  456. const stop = () => {
  457. stopWatch();
  458. cleanup();
  459. };
  460. tryOnScopeDispose(stop);
  461. return stop;
  462. }
  463. let _iOSWorkaround = false;
  464. function onClickOutside(target, handler, options = {}) {
  465. const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
  466. if (!window) return noop$1;
  467. if (isIOS && !_iOSWorkaround) {
  468. _iOSWorkaround = true;
  469. Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop$1));
  470. window.document.documentElement.addEventListener("click", noop$1);
  471. }
  472. let shouldListen = true;
  473. const shouldIgnore = (event) => {
  474. return toValue$1(ignore).some((target2) => {
  475. if (typeof target2 === "string") return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
  476. else {
  477. const el = unrefElement(target2);
  478. return el && (event.target === el || event.composedPath().includes(el));
  479. }
  480. });
  481. };
  482. function hasMultipleRoots(target2) {
  483. const vm = toValue$1(target2);
  484. return vm && vm.$.subTree.shapeFlag === 16;
  485. }
  486. function checkMultipleRoots(target2, event) {
  487. const vm = toValue$1(target2);
  488. const children = vm.$.subTree && vm.$.subTree.children;
  489. if (children == null || !Array.isArray(children)) return false;
  490. return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
  491. }
  492. const listener = (event) => {
  493. const el = unrefElement(target);
  494. if (event.target == null) return;
  495. if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
  496. if (!el || el === event.target || event.composedPath().includes(el)) return;
  497. if (event.detail === 0) shouldListen = !shouldIgnore(event);
  498. if (!shouldListen) {
  499. shouldListen = true;
  500. return;
  501. }
  502. handler(event);
  503. };
  504. let isProcessingClick = false;
  505. const cleanup = [
  506. useEventListener(window, "click", (event) => {
  507. if (!isProcessingClick) {
  508. isProcessingClick = true;
  509. setTimeout(() => {
  510. isProcessingClick = false;
  511. }, 0);
  512. listener(event);
  513. }
  514. }, {
  515. passive: true,
  516. capture
  517. }),
  518. useEventListener(window, "pointerdown", (e) => {
  519. const el = unrefElement(target);
  520. shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
  521. }, { passive: true }),
  522. detectIframe && useEventListener(window, "blur", (event) => {
  523. setTimeout(() => {
  524. var _a;
  525. const el = unrefElement(target);
  526. if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window.document.activeElement))) handler(event);
  527. }, 0);
  528. })
  529. ].filter(Boolean);
  530. const stop = () => cleanup.forEach((fn) => fn());
  531. return stop;
  532. }
  533. function useMounted() {
  534. const isMounted = ref(false);
  535. const instance = getCurrentInstance();
  536. if (instance) onMounted(() => {
  537. isMounted.value = true;
  538. }, instance);
  539. return isMounted;
  540. }
  541. function useSupported(callback) {
  542. const isMounted = useMounted();
  543. return computed(() => {
  544. isMounted.value;
  545. return Boolean(callback());
  546. });
  547. }
  548. function useMutationObserver(target, callback, options = {}) {
  549. const { window = defaultWindow, ...mutationOptions } = options;
  550. let observer;
  551. const isSupported = useSupported(() => window && "MutationObserver" in window);
  552. const cleanup = () => {
  553. if (observer) {
  554. observer.disconnect();
  555. observer = void 0;
  556. }
  557. };
  558. const targets = computed(() => {
  559. const value = toValue$1(target);
  560. const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);
  561. return new Set(items);
  562. });
  563. const stopWatch = watch(() => targets.value, (targets2) => {
  564. cleanup();
  565. if (isSupported.value && targets2.size) {
  566. observer = new MutationObserver(callback);
  567. targets2.forEach((el) => observer.observe(el, mutationOptions));
  568. }
  569. }, {
  570. immediate: true,
  571. flush: "post"
  572. });
  573. const takeRecords = () => {
  574. return observer == null ? void 0 : observer.takeRecords();
  575. };
  576. const stop = () => {
  577. stopWatch();
  578. cleanup();
  579. };
  580. tryOnScopeDispose(stop);
  581. return {
  582. isSupported,
  583. stop,
  584. takeRecords
  585. };
  586. }
  587. function useActiveElement(options = {}) {
  588. var _a;
  589. const { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;
  590. const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;
  591. const getDeepActiveElement = () => {
  592. var _a2;
  593. let element = document == null ? void 0 : document.activeElement;
  594. if (deep) while (element == null ? void 0 : element.shadowRoot) element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;
  595. return element;
  596. };
  597. const activeElement = ref();
  598. const trigger = () => {
  599. activeElement.value = getDeepActiveElement();
  600. };
  601. if (window) {
  602. useEventListener(window, "blur", (event) => {
  603. if (event.relatedTarget !== null) return;
  604. trigger();
  605. }, true);
  606. useEventListener(window, "focus", trigger, true);
  607. }
  608. if (triggerOnRemoval) useMutationObserver(document, (mutations) => {
  609. mutations.filter((m) => m.removedNodes.length).map((n) => Array.from(n.removedNodes)).flat().forEach((node) => {
  610. if (node === activeElement.value) trigger();
  611. });
  612. }, {
  613. childList: true,
  614. subtree: true
  615. });
  616. trigger();
  617. return activeElement;
  618. }
  619. function useMediaQuery(query, options = {}) {
  620. const { window = defaultWindow } = options;
  621. const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
  622. let mediaQuery;
  623. const matches = ref(false);
  624. const handler = (event) => {
  625. matches.value = event.matches;
  626. };
  627. const cleanup = () => {
  628. if (!mediaQuery) return;
  629. if ("removeEventListener" in mediaQuery) mediaQuery.removeEventListener("change", handler);
  630. else mediaQuery.removeListener(handler);
  631. };
  632. const stopWatch = watchEffect(() => {
  633. if (!isSupported.value) return;
  634. cleanup();
  635. mediaQuery = window.matchMedia(toValue$1(query));
  636. if ("addEventListener" in mediaQuery) mediaQuery.addEventListener("change", handler);
  637. else mediaQuery.addListener(handler);
  638. matches.value = mediaQuery.matches;
  639. });
  640. tryOnScopeDispose(() => {
  641. stopWatch();
  642. cleanup();
  643. mediaQuery = void 0;
  644. });
  645. return matches;
  646. }
  647. function cloneFnJSON(source) {
  648. return JSON.parse(JSON.stringify(source));
  649. }
  650. function useCssVar(prop, target, options = {}) {
  651. const { window = defaultWindow, initialValue, observe = false } = options;
  652. const variable = ref(initialValue);
  653. const elRef = computed(() => {
  654. var _a;
  655. return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
  656. });
  657. function updateCssVar() {
  658. var _a;
  659. const key = toValue$1(prop);
  660. const el = toValue$1(elRef);
  661. if (el && window && key) variable.value = ((_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim()) || initialValue;
  662. }
  663. if (observe) useMutationObserver(elRef, updateCssVar, {
  664. attributeFilter: ["style", "class"],
  665. window
  666. });
  667. watch([elRef, () => toValue$1(prop)], (_, old) => {
  668. if (old[0] && old[1]) old[0].style.removeProperty(old[1]);
  669. updateCssVar();
  670. }, { immediate: true });
  671. watch(variable, (val) => {
  672. var _a;
  673. const raw_prop = toValue$1(prop);
  674. if (((_a = elRef.value) == null ? void 0 : _a.style) && raw_prop) if (val == null) elRef.value.style.removeProperty(raw_prop);
  675. else elRef.value.style.setProperty(raw_prop, val);
  676. });
  677. return variable;
  678. }
  679. function useDocumentVisibility(options = {}) {
  680. const { document = defaultDocument } = options;
  681. if (!document) return ref("visible");
  682. const visibility = ref(document.visibilityState);
  683. useEventListener(document, "visibilitychange", () => {
  684. visibility.value = document.visibilityState;
  685. });
  686. return visibility;
  687. }
  688. function useResizeObserver(target, callback, options = {}) {
  689. const { window = defaultWindow, ...observerOptions } = options;
  690. let observer;
  691. const isSupported = useSupported(() => window && "ResizeObserver" in window);
  692. const cleanup = () => {
  693. if (observer) {
  694. observer.disconnect();
  695. observer = void 0;
  696. }
  697. };
  698. const stopWatch = watch(computed(() => {
  699. const _targets = toValue$1(target);
  700. return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
  701. }), (els) => {
  702. cleanup();
  703. if (isSupported.value && window) {
  704. observer = new ResizeObserver(callback);
  705. for (const _el of els) if (_el) observer.observe(_el, observerOptions);
  706. }
  707. }, {
  708. immediate: true,
  709. flush: "post"
  710. });
  711. const stop = () => {
  712. cleanup();
  713. stopWatch();
  714. };
  715. tryOnScopeDispose(stop);
  716. return {
  717. isSupported,
  718. stop
  719. };
  720. }
  721. function useElementBounding(target, options = {}) {
  722. const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
  723. const height = ref(0);
  724. const bottom = ref(0);
  725. const left = ref(0);
  726. const right = ref(0);
  727. const top = ref(0);
  728. const width = ref(0);
  729. const x = ref(0);
  730. const y = ref(0);
  731. function recalculate() {
  732. const el = unrefElement(target);
  733. if (!el) {
  734. if (reset) {
  735. height.value = 0;
  736. bottom.value = 0;
  737. left.value = 0;
  738. right.value = 0;
  739. top.value = 0;
  740. width.value = 0;
  741. x.value = 0;
  742. y.value = 0;
  743. }
  744. return;
  745. }
  746. const rect = el.getBoundingClientRect();
  747. height.value = rect.height;
  748. bottom.value = rect.bottom;
  749. left.value = rect.left;
  750. right.value = rect.right;
  751. top.value = rect.top;
  752. width.value = rect.width;
  753. x.value = rect.x;
  754. y.value = rect.y;
  755. }
  756. function update() {
  757. if (updateTiming === "sync") recalculate();
  758. else if (updateTiming === "next-frame") requestAnimationFrame(() => recalculate());
  759. }
  760. useResizeObserver(target, update);
  761. watch(() => unrefElement(target), (ele) => !ele && update());
  762. useMutationObserver(target, update, { attributeFilter: ["style", "class"] });
  763. if (windowScroll) useEventListener("scroll", update, {
  764. capture: true,
  765. passive: true
  766. });
  767. if (windowResize) useEventListener("resize", update, { passive: true });
  768. tryOnMounted(() => {
  769. if (immediate) update();
  770. });
  771. return {
  772. height,
  773. bottom,
  774. left,
  775. right,
  776. top,
  777. width,
  778. x,
  779. y,
  780. update
  781. };
  782. }
  783. function useElementSize(target, initialSize = {
  784. width: 0,
  785. height: 0
  786. }, options = {}) {
  787. const { window = defaultWindow, box = "content-box" } = options;
  788. const isSVG = computed(() => {
  789. var _a, _b;
  790. return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
  791. });
  792. const width = ref(initialSize.width);
  793. const height = ref(initialSize.height);
  794. const { stop: stop1 } = useResizeObserver(target, ([entry]) => {
  795. const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
  796. if (window && isSVG.value) {
  797. const $elem = unrefElement(target);
  798. if ($elem) {
  799. const rect = $elem.getBoundingClientRect();
  800. width.value = rect.width;
  801. height.value = rect.height;
  802. }
  803. } else if (boxSize) {
  804. const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
  805. width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
  806. height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
  807. } else {
  808. width.value = entry.contentRect.width;
  809. height.value = entry.contentRect.height;
  810. }
  811. }, options);
  812. tryOnMounted(() => {
  813. const ele = unrefElement(target);
  814. if (ele) {
  815. width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
  816. height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
  817. }
  818. });
  819. const stop2 = watch(() => unrefElement(target), (ele) => {
  820. width.value = ele ? initialSize.width : 0;
  821. height.value = ele ? initialSize.height : 0;
  822. });
  823. function stop() {
  824. stop1();
  825. stop2();
  826. }
  827. return {
  828. width,
  829. height,
  830. stop
  831. };
  832. }
  833. function useIntersectionObserver(target, callback, options = {}) {
  834. const { root, rootMargin = "0px", threshold = 0, window = defaultWindow, immediate = true } = options;
  835. const isSupported = useSupported(() => window && "IntersectionObserver" in window);
  836. const targets = computed(() => {
  837. const _target = toValue$1(target);
  838. return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);
  839. });
  840. let cleanup = noop$1;
  841. const isActive = ref(immediate);
  842. const stopWatch = isSupported.value ? watch(() => [
  843. targets.value,
  844. unrefElement(root),
  845. isActive.value
  846. ], ([targets2, root2]) => {
  847. cleanup();
  848. if (!isActive.value) return;
  849. if (!targets2.length) return;
  850. const observer = new IntersectionObserver(callback, {
  851. root: unrefElement(root2),
  852. rootMargin,
  853. threshold
  854. });
  855. targets2.forEach((el) => el && observer.observe(el));
  856. cleanup = () => {
  857. observer.disconnect();
  858. cleanup = noop$1;
  859. };
  860. }, {
  861. immediate,
  862. flush: "post"
  863. }) : noop$1;
  864. const stop = () => {
  865. cleanup();
  866. stopWatch();
  867. isActive.value = false;
  868. };
  869. tryOnScopeDispose(stop);
  870. return {
  871. isSupported,
  872. isActive,
  873. pause() {
  874. cleanup();
  875. isActive.value = false;
  876. },
  877. resume() {
  878. isActive.value = true;
  879. },
  880. stop
  881. };
  882. }
  883. const DEFAULT_UNITS = [
  884. {
  885. max: 6e4,
  886. value: 1e3,
  887. name: "second"
  888. },
  889. {
  890. max: 276e4,
  891. value: 6e4,
  892. name: "minute"
  893. },
  894. {
  895. max: 72e6,
  896. value: 36e5,
  897. name: "hour"
  898. },
  899. {
  900. max: 5184e5,
  901. value: 864e5,
  902. name: "day"
  903. },
  904. {
  905. max: 24192e5,
  906. value: 6048e5,
  907. name: "week"
  908. },
  909. {
  910. max: 28512e6,
  911. value: 2592e6,
  912. name: "month"
  913. },
  914. {
  915. max: Number.POSITIVE_INFINITY,
  916. value: 31536e6,
  917. name: "year"
  918. }
  919. ];
  920. function useVModel(props, key, emit, options = {}) {
  921. var _a, _b, _c;
  922. const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
  923. const vm = getCurrentInstance();
  924. const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
  925. let event = eventName;
  926. if (!key) key = "modelValue";
  927. event = event || `update:${key.toString()}`;
  928. const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
  929. const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
  930. const triggerEmit = (value) => {
  931. if (shouldEmit) {
  932. if (shouldEmit(value)) _emit(event, value);
  933. } else _emit(event, value);
  934. };
  935. if (passive) {
  936. const proxy = ref(getValue());
  937. let isUpdating = false;
  938. watch(() => props[key], (v) => {
  939. if (!isUpdating) {
  940. isUpdating = true;
  941. proxy.value = cloneFn(v);
  942. nextTick(() => isUpdating = false);
  943. }
  944. });
  945. watch(proxy, (v) => {
  946. if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);
  947. }, { deep });
  948. return proxy;
  949. } else return computed({
  950. get() {
  951. return getValue();
  952. },
  953. set(value) {
  954. triggerEmit(value);
  955. }
  956. });
  957. }
  958. function useWindowFocus(options = {}) {
  959. const { window = defaultWindow } = options;
  960. if (!window) return ref(false);
  961. const focused = ref(window.document.hasFocus());
  962. useEventListener(window, "blur", () => {
  963. focused.value = false;
  964. });
  965. useEventListener(window, "focus", () => {
  966. focused.value = true;
  967. });
  968. return focused;
  969. }
  970. function useWindowSize(options = {}) {
  971. const { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
  972. const width = ref(initialWidth);
  973. const height = ref(initialHeight);
  974. const update = () => {
  975. if (window) if (type === "outer") {
  976. width.value = window.outerWidth;
  977. height.value = window.outerHeight;
  978. } else if (includeScrollbar) {
  979. width.value = window.innerWidth;
  980. height.value = window.innerHeight;
  981. } else {
  982. width.value = window.document.documentElement.clientWidth;
  983. height.value = window.document.documentElement.clientHeight;
  984. }
  985. };
  986. update();
  987. tryOnMounted(update);
  988. useEventListener("resize", update, { passive: true });
  989. if (listenOrientation) watch(useMediaQuery("(orientation: portrait)"), () => update());
  990. return {
  991. width,
  992. height
  993. };
  994. }
  995. //#endregion
  996. //#region ../../packages/utils/browser.ts
  997. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  998. const isAndroid = () => isClient && /android/i.test(window.navigator.userAgent);
  999. //#endregion
  1000. //#region ../../packages/utils/dom/event.ts
  1001. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  1002. const handleEvent = (event) => {
  1003. const shouldPrevent = theirsHandler?.(event);
  1004. if (checkForDefaultPrevented === false || !shouldPrevent) return oursHandler?.(event);
  1005. };
  1006. return handleEvent;
  1007. };
  1008. const whenMouse = (handler) => {
  1009. return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
  1010. };
  1011. const getEventCode = (event) => {
  1012. if (event.code && event.code !== "Unidentified") return event.code;
  1013. const key = getEventKey(event);
  1014. if (key) {
  1015. if (Object.values(EVENT_CODE).includes(key)) return key;
  1016. switch (key) {
  1017. case " ": return EVENT_CODE.space;
  1018. default: return "";
  1019. }
  1020. }
  1021. return "";
  1022. };
  1023. const getEventKey = (event) => {
  1024. let key = event.key && event.key !== "Unidentified" ? event.key : "";
  1025. if (!key && event.type === "keyup" && isAndroid()) {
  1026. const target = event.target;
  1027. key = target.value.charAt(target.selectionStart - 1);
  1028. }
  1029. return key;
  1030. };
  1031. //#endregion
  1032. //#region ../../packages/utils/dom/position.ts
  1033. const getOffsetTop = (el) => {
  1034. let offset = 0;
  1035. let parent = el;
  1036. while (parent) {
  1037. offset += parent.offsetTop;
  1038. parent = parent.offsetParent;
  1039. }
  1040. return offset;
  1041. };
  1042. const getOffsetTopDistance = (el, containerEl) => {
  1043. return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
  1044. };
  1045. const getClientXY = (event) => {
  1046. let clientX;
  1047. let clientY;
  1048. if (event.type === "touchend") {
  1049. clientY = event.changedTouches[0].clientY;
  1050. clientX = event.changedTouches[0].clientX;
  1051. } else if (event.type.startsWith("touch")) {
  1052. clientY = event.touches[0].clientY;
  1053. clientX = event.touches[0].clientX;
  1054. } else {
  1055. clientY = event.clientY;
  1056. clientX = event.clientX;
  1057. }
  1058. return {
  1059. clientX,
  1060. clientY
  1061. };
  1062. };
  1063. //#endregion
  1064. //#region ../../packages/utils/easings.ts
  1065. function easeInOutCubic(t, b, c, d) {
  1066. const cc = c - b;
  1067. t /= d / 2;
  1068. if (t < 1) return cc / 2 * t * t * t + b;
  1069. return cc / 2 * ((t -= 2) * t * t + 2) + b;
  1070. }
  1071. //#endregion
  1072. //#region ../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js
  1073. /**
  1074. * @vue/shared v3.5.25
  1075. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  1076. * @license MIT
  1077. **/
  1078. /* @__NO_SIDE_EFFECTS__ */
  1079. function makeMap(str) {
  1080. const map = /* @__PURE__ */ Object.create(null);
  1081. for (const key of str.split(",")) map[key] = 1;
  1082. return (val) => val in map;
  1083. }
  1084. const NOOP = () => {};
  1085. const hasOwnProperty$14 = Object.prototype.hasOwnProperty;
  1086. const hasOwn = (val, key) => hasOwnProperty$14.call(val, key);
  1087. const isArray$1 = Array.isArray;
  1088. const isDate = (val) => toTypeString(val) === "[object Date]";
  1089. const isFunction$1 = (val) => typeof val === "function";
  1090. const isString = (val) => typeof val === "string";
  1091. const isObject$1 = (val) => val !== null && typeof val === "object";
  1092. const isPromise = (val) => {
  1093. return (isObject$1(val) || isFunction$1(val)) && isFunction$1(val.then) && isFunction$1(val.catch);
  1094. };
  1095. const objectToString$1 = Object.prototype.toString;
  1096. const toTypeString = (value) => objectToString$1.call(value);
  1097. const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
  1098. const cacheStringFunction = (fn) => {
  1099. const cache = /* @__PURE__ */ Object.create(null);
  1100. return ((str) => {
  1101. return cache[str] || (cache[str] = fn(str));
  1102. });
  1103. };
  1104. const camelizeRE = /-\w/g;
  1105. const camelize = cacheStringFunction((str) => {
  1106. return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
  1107. });
  1108. const hyphenateRE = /\B([A-Z])/g;
  1109. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  1110. const capitalize$1 = cacheStringFunction((str) => {
  1111. return str.charAt(0).toUpperCase() + str.slice(1);
  1112. });
  1113. const toHandlerKey$1 = cacheStringFunction((str) => {
  1114. return str ? `on${capitalize$1(str)}` : ``;
  1115. });
  1116. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  1117. const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
  1118. //#endregion
  1119. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js
  1120. /** Detect free variable `global` from Node.js. */
  1121. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  1122. //#endregion
  1123. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_root.js
  1124. /** Detect free variable `self`. */
  1125. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  1126. /** Used as a reference to the global object. */
  1127. var root = freeGlobal || freeSelf || Function("return this")();
  1128. //#endregion
  1129. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js
  1130. /** Built-in value references. */
  1131. var Symbol$1 = root.Symbol;
  1132. //#endregion
  1133. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js
  1134. /** Used for built-in method references. */
  1135. var objectProto$4 = Object.prototype;
  1136. /** Used to check objects for own properties. */
  1137. var hasOwnProperty$13 = objectProto$4.hasOwnProperty;
  1138. /**
  1139. * Used to resolve the
  1140. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1141. * of values.
  1142. */
  1143. var nativeObjectToString$1 = objectProto$4.toString;
  1144. /** Built-in value references. */
  1145. var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
  1146. /**
  1147. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  1148. *
  1149. * @private
  1150. * @param {*} value The value to query.
  1151. * @returns {string} Returns the raw `toStringTag`.
  1152. */
  1153. function getRawTag(value) {
  1154. var isOwn = hasOwnProperty$13.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  1155. try {
  1156. value[symToStringTag$1] = void 0;
  1157. var unmasked = true;
  1158. } catch (e) {}
  1159. var result = nativeObjectToString$1.call(value);
  1160. if (unmasked) if (isOwn) value[symToStringTag$1] = tag;
  1161. else delete value[symToStringTag$1];
  1162. return result;
  1163. }
  1164. //#endregion
  1165. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js
  1166. /**
  1167. * Used to resolve the
  1168. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1169. * of values.
  1170. */
  1171. var nativeObjectToString = Object.prototype.toString;
  1172. /**
  1173. * Converts `value` to a string using `Object.prototype.toString`.
  1174. *
  1175. * @private
  1176. * @param {*} value The value to convert.
  1177. * @returns {string} Returns the converted string.
  1178. */
  1179. function objectToString(value) {
  1180. return nativeObjectToString.call(value);
  1181. }
  1182. //#endregion
  1183. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js
  1184. /** `Object#toString` result references. */
  1185. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  1186. /** Built-in value references. */
  1187. var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
  1188. /**
  1189. * The base implementation of `getTag` without fallbacks for buggy environments.
  1190. *
  1191. * @private
  1192. * @param {*} value The value to query.
  1193. * @returns {string} Returns the `toStringTag`.
  1194. */
  1195. function baseGetTag(value) {
  1196. if (value == null) return value === void 0 ? undefinedTag : nullTag;
  1197. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  1198. }
  1199. //#endregion
  1200. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js
  1201. /**
  1202. * Checks if `value` is object-like. A value is object-like if it's not `null`
  1203. * and has a `typeof` result of "object".
  1204. *
  1205. * @static
  1206. * @memberOf _
  1207. * @since 4.0.0
  1208. * @category Lang
  1209. * @param {*} value The value to check.
  1210. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  1211. * @example
  1212. *
  1213. * _.isObjectLike({});
  1214. * // => true
  1215. *
  1216. * _.isObjectLike([1, 2, 3]);
  1217. * // => true
  1218. *
  1219. * _.isObjectLike(_.noop);
  1220. * // => false
  1221. *
  1222. * _.isObjectLike(null);
  1223. * // => false
  1224. */
  1225. function isObjectLike(value) {
  1226. return value != null && typeof value == "object";
  1227. }
  1228. //#endregion
  1229. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js
  1230. /** `Object#toString` result references. */
  1231. var symbolTag$3 = "[object Symbol]";
  1232. /**
  1233. * Checks if `value` is classified as a `Symbol` primitive or object.
  1234. *
  1235. * @static
  1236. * @memberOf _
  1237. * @since 4.0.0
  1238. * @category Lang
  1239. * @param {*} value The value to check.
  1240. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  1241. * @example
  1242. *
  1243. * _.isSymbol(Symbol.iterator);
  1244. * // => true
  1245. *
  1246. * _.isSymbol('abc');
  1247. * // => false
  1248. */
  1249. function isSymbol(value) {
  1250. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
  1251. }
  1252. //#endregion
  1253. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js
  1254. /**
  1255. * A specialized version of `_.map` for arrays without support for iteratee
  1256. * shorthands.
  1257. *
  1258. * @private
  1259. * @param {Array} [array] The array to iterate over.
  1260. * @param {Function} iteratee The function invoked per iteration.
  1261. * @returns {Array} Returns the new mapped array.
  1262. */
  1263. function arrayMap(array, iteratee) {
  1264. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  1265. while (++index < length) result[index] = iteratee(array[index], index, array);
  1266. return result;
  1267. }
  1268. //#endregion
  1269. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArray.js
  1270. /**
  1271. * Checks if `value` is classified as an `Array` object.
  1272. *
  1273. * @static
  1274. * @memberOf _
  1275. * @since 0.1.0
  1276. * @category Lang
  1277. * @param {*} value The value to check.
  1278. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  1279. * @example
  1280. *
  1281. * _.isArray([1, 2, 3]);
  1282. * // => true
  1283. *
  1284. * _.isArray(document.body.children);
  1285. * // => false
  1286. *
  1287. * _.isArray('abc');
  1288. * // => false
  1289. *
  1290. * _.isArray(_.noop);
  1291. * // => false
  1292. */
  1293. var isArray = Array.isArray;
  1294. //#endregion
  1295. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js
  1296. /** Used as references for various `Number` constants. */
  1297. var INFINITY$3 = Infinity;
  1298. /** Used to convert symbols to primitives and strings. */
  1299. var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
  1300. /**
  1301. * The base implementation of `_.toString` which doesn't convert nullish
  1302. * values to empty strings.
  1303. *
  1304. * @private
  1305. * @param {*} value The value to process.
  1306. * @returns {string} Returns the string.
  1307. */
  1308. function baseToString(value) {
  1309. if (typeof value == "string") return value;
  1310. if (isArray(value)) return arrayMap(value, baseToString) + "";
  1311. if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
  1312. var result = value + "";
  1313. return result == "0" && 1 / value == -INFINITY$3 ? "-0" : result;
  1314. }
  1315. //#endregion
  1316. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js
  1317. /** Used to match a single whitespace character. */
  1318. var reWhitespace = /\s/;
  1319. /**
  1320. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  1321. * character of `string`.
  1322. *
  1323. * @private
  1324. * @param {string} string The string to inspect.
  1325. * @returns {number} Returns the index of the last non-whitespace character.
  1326. */
  1327. function trimmedEndIndex(string) {
  1328. var index = string.length;
  1329. while (index-- && reWhitespace.test(string.charAt(index)));
  1330. return index;
  1331. }
  1332. //#endregion
  1333. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js
  1334. /** Used to match leading whitespace. */
  1335. var reTrimStart = /^\s+/;
  1336. /**
  1337. * The base implementation of `_.trim`.
  1338. *
  1339. * @private
  1340. * @param {string} string The string to trim.
  1341. * @returns {string} Returns the trimmed string.
  1342. */
  1343. function baseTrim(string) {
  1344. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  1345. }
  1346. //#endregion
  1347. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObject.js
  1348. /**
  1349. * Checks if `value` is the
  1350. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1351. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1352. *
  1353. * @static
  1354. * @memberOf _
  1355. * @since 0.1.0
  1356. * @category Lang
  1357. * @param {*} value The value to check.
  1358. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1359. * @example
  1360. *
  1361. * _.isObject({});
  1362. * // => true
  1363. *
  1364. * _.isObject([1, 2, 3]);
  1365. * // => true
  1366. *
  1367. * _.isObject(_.noop);
  1368. * // => true
  1369. *
  1370. * _.isObject(null);
  1371. * // => false
  1372. */
  1373. function isObject(value) {
  1374. var type = typeof value;
  1375. return value != null && (type == "object" || type == "function");
  1376. }
  1377. //#endregion
  1378. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js
  1379. /** Used as references for various `Number` constants. */
  1380. var NAN = NaN;
  1381. /** Used to detect bad signed hexadecimal string values. */
  1382. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1383. /** Used to detect binary string values. */
  1384. var reIsBinary = /^0b[01]+$/i;
  1385. /** Used to detect octal string values. */
  1386. var reIsOctal = /^0o[0-7]+$/i;
  1387. /** Built-in method references without a dependency on `root`. */
  1388. var freeParseInt = parseInt;
  1389. /**
  1390. * Converts `value` to a number.
  1391. *
  1392. * @static
  1393. * @memberOf _
  1394. * @since 4.0.0
  1395. * @category Lang
  1396. * @param {*} value The value to process.
  1397. * @returns {number} Returns the number.
  1398. * @example
  1399. *
  1400. * _.toNumber(3.2);
  1401. * // => 3.2
  1402. *
  1403. * _.toNumber(Number.MIN_VALUE);
  1404. * // => 5e-324
  1405. *
  1406. * _.toNumber(Infinity);
  1407. * // => Infinity
  1408. *
  1409. * _.toNumber('3.2');
  1410. * // => 3.2
  1411. */
  1412. function toNumber(value) {
  1413. if (typeof value == "number") return value;
  1414. if (isSymbol(value)) return NAN;
  1415. if (isObject(value)) {
  1416. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  1417. value = isObject(other) ? other + "" : other;
  1418. }
  1419. if (typeof value != "string") return value === 0 ? value : +value;
  1420. value = baseTrim(value);
  1421. var isBinary = reIsBinary.test(value);
  1422. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  1423. }
  1424. //#endregion
  1425. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toFinite.js
  1426. /** Used as references for various `Number` constants. */
  1427. var INFINITY$2 = Infinity, MAX_INTEGER = 17976931348623157e292;
  1428. /**
  1429. * Converts `value` to a finite number.
  1430. *
  1431. * @static
  1432. * @memberOf _
  1433. * @since 4.12.0
  1434. * @category Lang
  1435. * @param {*} value The value to convert.
  1436. * @returns {number} Returns the converted number.
  1437. * @example
  1438. *
  1439. * _.toFinite(3.2);
  1440. * // => 3.2
  1441. *
  1442. * _.toFinite(Number.MIN_VALUE);
  1443. * // => 5e-324
  1444. *
  1445. * _.toFinite(Infinity);
  1446. * // => 1.7976931348623157e+308
  1447. *
  1448. * _.toFinite('3.2');
  1449. * // => 3.2
  1450. */
  1451. function toFinite(value) {
  1452. if (!value) return value === 0 ? value : 0;
  1453. value = toNumber(value);
  1454. if (value === INFINITY$2 || value === -INFINITY$2) return (value < 0 ? -1 : 1) * MAX_INTEGER;
  1455. return value === value ? value : 0;
  1456. }
  1457. //#endregion
  1458. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toInteger.js
  1459. /**
  1460. * Converts `value` to an integer.
  1461. *
  1462. * **Note:** This method is loosely based on
  1463. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  1464. *
  1465. * @static
  1466. * @memberOf _
  1467. * @since 4.0.0
  1468. * @category Lang
  1469. * @param {*} value The value to convert.
  1470. * @returns {number} Returns the converted integer.
  1471. * @example
  1472. *
  1473. * _.toInteger(3.2);
  1474. * // => 3
  1475. *
  1476. * _.toInteger(Number.MIN_VALUE);
  1477. * // => 0
  1478. *
  1479. * _.toInteger(Infinity);
  1480. * // => 1.7976931348623157e+308
  1481. *
  1482. * _.toInteger('3.2');
  1483. * // => 3
  1484. */
  1485. function toInteger(value) {
  1486. var result = toFinite(value), remainder = result % 1;
  1487. return result === result ? remainder ? result - remainder : result : 0;
  1488. }
  1489. //#endregion
  1490. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/identity.js
  1491. /**
  1492. * This method returns the first argument it receives.
  1493. *
  1494. * @static
  1495. * @since 0.1.0
  1496. * @memberOf _
  1497. * @category Util
  1498. * @param {*} value Any value.
  1499. * @returns {*} Returns `value`.
  1500. * @example
  1501. *
  1502. * var object = { 'a': 1 };
  1503. *
  1504. * console.log(_.identity(object) === object);
  1505. * // => true
  1506. */
  1507. function identity(value) {
  1508. return value;
  1509. }
  1510. //#endregion
  1511. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js
  1512. /** `Object#toString` result references. */
  1513. var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  1514. /**
  1515. * Checks if `value` is classified as a `Function` object.
  1516. *
  1517. * @static
  1518. * @memberOf _
  1519. * @since 0.1.0
  1520. * @category Lang
  1521. * @param {*} value The value to check.
  1522. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1523. * @example
  1524. *
  1525. * _.isFunction(_);
  1526. * // => true
  1527. *
  1528. * _.isFunction(/abc/);
  1529. * // => false
  1530. */
  1531. function isFunction(value) {
  1532. if (!isObject(value)) return false;
  1533. var tag = baseGetTag(value);
  1534. return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
  1535. }
  1536. //#endregion
  1537. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js
  1538. /** Used to detect overreaching core-js shims. */
  1539. var coreJsData = root["__core-js_shared__"];
  1540. //#endregion
  1541. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js
  1542. /** Used to detect methods masquerading as native. */
  1543. var maskSrcKey = function() {
  1544. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  1545. return uid ? "Symbol(src)_1." + uid : "";
  1546. }();
  1547. /**
  1548. * Checks if `func` has its source masked.
  1549. *
  1550. * @private
  1551. * @param {Function} func The function to check.
  1552. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1553. */
  1554. function isMasked(func) {
  1555. return !!maskSrcKey && maskSrcKey in func;
  1556. }
  1557. //#endregion
  1558. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js
  1559. /** Used to resolve the decompiled source of functions. */
  1560. var funcToString$2 = Function.prototype.toString;
  1561. /**
  1562. * Converts `func` to its source code.
  1563. *
  1564. * @private
  1565. * @param {Function} func The function to convert.
  1566. * @returns {string} Returns the source code.
  1567. */
  1568. function toSource(func) {
  1569. if (func != null) {
  1570. try {
  1571. return funcToString$2.call(func);
  1572. } catch (e) {}
  1573. try {
  1574. return func + "";
  1575. } catch (e) {}
  1576. }
  1577. return "";
  1578. }
  1579. //#endregion
  1580. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js
  1581. /**
  1582. * Used to match `RegExp`
  1583. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1584. */
  1585. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1586. /** Used to detect host constructors (Safari). */
  1587. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1588. /** Used for built-in method references. */
  1589. var funcProto$1 = Function.prototype, objectProto$3 = Object.prototype;
  1590. /** Used to resolve the decompiled source of functions. */
  1591. var funcToString$1 = funcProto$1.toString;
  1592. /** Used to check objects for own properties. */
  1593. var hasOwnProperty$12 = objectProto$3.hasOwnProperty;
  1594. /** Used to detect if a method is native. */
  1595. var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$12).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
  1596. /**
  1597. * The base implementation of `_.isNative` without bad shim checks.
  1598. *
  1599. * @private
  1600. * @param {*} value The value to check.
  1601. * @returns {boolean} Returns `true` if `value` is a native function,
  1602. * else `false`.
  1603. */
  1604. function baseIsNative(value) {
  1605. if (!isObject(value) || isMasked(value)) return false;
  1606. return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
  1607. }
  1608. //#endregion
  1609. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js
  1610. /**
  1611. * Gets the value at `key` of `object`.
  1612. *
  1613. * @private
  1614. * @param {Object} [object] The object to query.
  1615. * @param {string} key The key of the property to get.
  1616. * @returns {*} Returns the property value.
  1617. */
  1618. function getValue$1(object, key) {
  1619. return object == null ? void 0 : object[key];
  1620. }
  1621. //#endregion
  1622. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js
  1623. /**
  1624. * Gets the native function at `key` of `object`.
  1625. *
  1626. * @private
  1627. * @param {Object} object The object to query.
  1628. * @param {string} key The key of the method to get.
  1629. * @returns {*} Returns the function if it's native, else `undefined`.
  1630. */
  1631. function getNative(object, key) {
  1632. var value = getValue$1(object, key);
  1633. return baseIsNative(value) ? value : void 0;
  1634. }
  1635. //#endregion
  1636. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js
  1637. var WeakMap$1 = getNative(root, "WeakMap");
  1638. //#endregion
  1639. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js
  1640. /** Built-in value references. */
  1641. var objectCreate = Object.create;
  1642. /**
  1643. * The base implementation of `_.create` without support for assigning
  1644. * properties to the created object.
  1645. *
  1646. * @private
  1647. * @param {Object} proto The object to inherit from.
  1648. * @returns {Object} Returns the new object.
  1649. */
  1650. var baseCreate = function() {
  1651. function object() {}
  1652. return function(proto) {
  1653. if (!isObject(proto)) return {};
  1654. if (objectCreate) return objectCreate(proto);
  1655. object.prototype = proto;
  1656. var result = new object();
  1657. object.prototype = void 0;
  1658. return result;
  1659. };
  1660. }();
  1661. //#endregion
  1662. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_apply.js
  1663. /**
  1664. * A faster alternative to `Function#apply`, this function invokes `func`
  1665. * with the `this` binding of `thisArg` and the arguments of `args`.
  1666. *
  1667. * @private
  1668. * @param {Function} func The function to invoke.
  1669. * @param {*} thisArg The `this` binding of `func`.
  1670. * @param {Array} args The arguments to invoke `func` with.
  1671. * @returns {*} Returns the result of `func`.
  1672. */
  1673. function apply(func, thisArg, args) {
  1674. switch (args.length) {
  1675. case 0: return func.call(thisArg);
  1676. case 1: return func.call(thisArg, args[0]);
  1677. case 2: return func.call(thisArg, args[0], args[1]);
  1678. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1679. }
  1680. return func.apply(thisArg, args);
  1681. }
  1682. //#endregion
  1683. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/noop.js
  1684. /**
  1685. * This method returns `undefined`.
  1686. *
  1687. * @static
  1688. * @memberOf _
  1689. * @since 2.3.0
  1690. * @category Util
  1691. * @example
  1692. *
  1693. * _.times(2, _.noop);
  1694. * // => [undefined, undefined]
  1695. */
  1696. function noop() {}
  1697. //#endregion
  1698. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js
  1699. /**
  1700. * Copies the values of `source` to `array`.
  1701. *
  1702. * @private
  1703. * @param {Array} source The array to copy values from.
  1704. * @param {Array} [array=[]] The array to copy values to.
  1705. * @returns {Array} Returns `array`.
  1706. */
  1707. function copyArray(source, array) {
  1708. var index = -1, length = source.length;
  1709. array || (array = Array(length));
  1710. while (++index < length) array[index] = source[index];
  1711. return array;
  1712. }
  1713. //#endregion
  1714. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js
  1715. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1716. var HOT_COUNT = 800, HOT_SPAN = 16;
  1717. var nativeNow = Date.now;
  1718. /**
  1719. * Creates a function that'll short out and invoke `identity` instead
  1720. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  1721. * milliseconds.
  1722. *
  1723. * @private
  1724. * @param {Function} func The function to restrict.
  1725. * @returns {Function} Returns the new shortable function.
  1726. */
  1727. function shortOut(func) {
  1728. var count = 0, lastCalled = 0;
  1729. return function() {
  1730. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  1731. lastCalled = stamp;
  1732. if (remaining > 0) {
  1733. if (++count >= HOT_COUNT) return arguments[0];
  1734. } else count = 0;
  1735. return func.apply(void 0, arguments);
  1736. };
  1737. }
  1738. //#endregion
  1739. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/constant.js
  1740. /**
  1741. * Creates a function that returns `value`.
  1742. *
  1743. * @static
  1744. * @memberOf _
  1745. * @since 2.4.0
  1746. * @category Util
  1747. * @param {*} value The value to return from the new function.
  1748. * @returns {Function} Returns the new constant function.
  1749. * @example
  1750. *
  1751. * var objects = _.times(2, _.constant({ 'a': 1 }));
  1752. *
  1753. * console.log(objects);
  1754. * // => [{ 'a': 1 }, { 'a': 1 }]
  1755. *
  1756. * console.log(objects[0] === objects[1]);
  1757. * // => true
  1758. */
  1759. function constant(value) {
  1760. return function() {
  1761. return value;
  1762. };
  1763. }
  1764. //#endregion
  1765. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js
  1766. var defineProperty = function() {
  1767. try {
  1768. var func = getNative(Object, "defineProperty");
  1769. func({}, "", {});
  1770. return func;
  1771. } catch (e) {}
  1772. }();
  1773. //#endregion
  1774. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js
  1775. /**
  1776. * The base implementation of `setToString` without support for hot loop shorting.
  1777. *
  1778. * @private
  1779. * @param {Function} func The function to modify.
  1780. * @param {Function} string The `toString` result.
  1781. * @returns {Function} Returns `func`.
  1782. */
  1783. var baseSetToString = !defineProperty ? identity : function(func, string) {
  1784. return defineProperty(func, "toString", {
  1785. "configurable": true,
  1786. "enumerable": false,
  1787. "value": constant(string),
  1788. "writable": true
  1789. });
  1790. };
  1791. //#endregion
  1792. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js
  1793. /**
  1794. * Sets the `toString` method of `func` to return `string`.
  1795. *
  1796. * @private
  1797. * @param {Function} func The function to modify.
  1798. * @param {Function} string The `toString` result.
  1799. * @returns {Function} Returns `func`.
  1800. */
  1801. var setToString = shortOut(baseSetToString);
  1802. //#endregion
  1803. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js
  1804. /**
  1805. * A specialized version of `_.forEach` for arrays without support for
  1806. * iteratee shorthands.
  1807. *
  1808. * @private
  1809. * @param {Array} [array] The array to iterate over.
  1810. * @param {Function} iteratee The function invoked per iteration.
  1811. * @returns {Array} Returns `array`.
  1812. */
  1813. function arrayEach(array, iteratee) {
  1814. var index = -1, length = array == null ? 0 : array.length;
  1815. while (++index < length) if (iteratee(array[index], index, array) === false) break;
  1816. return array;
  1817. }
  1818. //#endregion
  1819. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js
  1820. /**
  1821. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1822. * support for iteratee shorthands.
  1823. *
  1824. * @private
  1825. * @param {Array} array The array to inspect.
  1826. * @param {Function} predicate The function invoked per iteration.
  1827. * @param {number} fromIndex The index to search from.
  1828. * @param {boolean} [fromRight] Specify iterating from right to left.
  1829. * @returns {number} Returns the index of the matched value, else `-1`.
  1830. */
  1831. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1832. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  1833. while (fromRight ? index-- : ++index < length) if (predicate(array[index], index, array)) return index;
  1834. return -1;
  1835. }
  1836. //#endregion
  1837. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js
  1838. /**
  1839. * The base implementation of `_.isNaN` without support for number objects.
  1840. *
  1841. * @private
  1842. * @param {*} value The value to check.
  1843. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1844. */
  1845. function baseIsNaN(value) {
  1846. return value !== value;
  1847. }
  1848. //#endregion
  1849. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js
  1850. /**
  1851. * A specialized version of `_.indexOf` which performs strict equality
  1852. * comparisons of values, i.e. `===`.
  1853. *
  1854. * @private
  1855. * @param {Array} array The array to inspect.
  1856. * @param {*} value The value to search for.
  1857. * @param {number} fromIndex The index to search from.
  1858. * @returns {number} Returns the index of the matched value, else `-1`.
  1859. */
  1860. function strictIndexOf(array, value, fromIndex) {
  1861. var index = fromIndex - 1, length = array.length;
  1862. while (++index < length) if (array[index] === value) return index;
  1863. return -1;
  1864. }
  1865. //#endregion
  1866. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js
  1867. /**
  1868. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1869. *
  1870. * @private
  1871. * @param {Array} array The array to inspect.
  1872. * @param {*} value The value to search for.
  1873. * @param {number} fromIndex The index to search from.
  1874. * @returns {number} Returns the index of the matched value, else `-1`.
  1875. */
  1876. function baseIndexOf(array, value, fromIndex) {
  1877. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  1878. }
  1879. //#endregion
  1880. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js
  1881. /**
  1882. * A specialized version of `_.includes` for arrays without support for
  1883. * specifying an index to search from.
  1884. *
  1885. * @private
  1886. * @param {Array} [array] The array to inspect.
  1887. * @param {*} target The value to search for.
  1888. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1889. */
  1890. function arrayIncludes(array, value) {
  1891. return !!(array == null ? 0 : array.length) && baseIndexOf(array, value, 0) > -1;
  1892. }
  1893. //#endregion
  1894. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js
  1895. /** Used as references for various `Number` constants. */
  1896. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  1897. /** Used to detect unsigned integer values. */
  1898. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1899. /**
  1900. * Checks if `value` is a valid array-like index.
  1901. *
  1902. * @private
  1903. * @param {*} value The value to check.
  1904. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  1905. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  1906. */
  1907. function isIndex(value, length) {
  1908. var type = typeof value;
  1909. length = length == null ? MAX_SAFE_INTEGER$1 : length;
  1910. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  1911. }
  1912. //#endregion
  1913. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js
  1914. /**
  1915. * The base implementation of `assignValue` and `assignMergeValue` without
  1916. * value checks.
  1917. *
  1918. * @private
  1919. * @param {Object} object The object to modify.
  1920. * @param {string} key The key of the property to assign.
  1921. * @param {*} value The value to assign.
  1922. */
  1923. function baseAssignValue(object, key, value) {
  1924. if (key == "__proto__" && defineProperty) defineProperty(object, key, {
  1925. "configurable": true,
  1926. "enumerable": true,
  1927. "value": value,
  1928. "writable": true
  1929. });
  1930. else object[key] = value;
  1931. }
  1932. //#endregion
  1933. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/eq.js
  1934. /**
  1935. * Performs a
  1936. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1937. * comparison between two values to determine if they are equivalent.
  1938. *
  1939. * @static
  1940. * @memberOf _
  1941. * @since 4.0.0
  1942. * @category Lang
  1943. * @param {*} value The value to compare.
  1944. * @param {*} other The other value to compare.
  1945. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1946. * @example
  1947. *
  1948. * var object = { 'a': 1 };
  1949. * var other = { 'a': 1 };
  1950. *
  1951. * _.eq(object, object);
  1952. * // => true
  1953. *
  1954. * _.eq(object, other);
  1955. * // => false
  1956. *
  1957. * _.eq('a', 'a');
  1958. * // => true
  1959. *
  1960. * _.eq('a', Object('a'));
  1961. * // => false
  1962. *
  1963. * _.eq(NaN, NaN);
  1964. * // => true
  1965. */
  1966. function eq(value, other) {
  1967. return value === other || value !== value && other !== other;
  1968. }
  1969. //#endregion
  1970. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js
  1971. /** Used to check objects for own properties. */
  1972. var hasOwnProperty$11 = Object.prototype.hasOwnProperty;
  1973. /**
  1974. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  1975. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1976. * for equality comparisons.
  1977. *
  1978. * @private
  1979. * @param {Object} object The object to modify.
  1980. * @param {string} key The key of the property to assign.
  1981. * @param {*} value The value to assign.
  1982. */
  1983. function assignValue(object, key, value) {
  1984. var objValue = object[key];
  1985. if (!(hasOwnProperty$11.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
  1986. }
  1987. //#endregion
  1988. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js
  1989. /**
  1990. * Copies properties of `source` to `object`.
  1991. *
  1992. * @private
  1993. * @param {Object} source The object to copy properties from.
  1994. * @param {Array} props The property identifiers to copy.
  1995. * @param {Object} [object={}] The object to copy properties to.
  1996. * @param {Function} [customizer] The function to customize copied values.
  1997. * @returns {Object} Returns `object`.
  1998. */
  1999. function copyObject(source, props, object, customizer) {
  2000. var isNew = !object;
  2001. object || (object = {});
  2002. var index = -1, length = props.length;
  2003. while (++index < length) {
  2004. var key = props[index];
  2005. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
  2006. if (newValue === void 0) newValue = source[key];
  2007. if (isNew) baseAssignValue(object, key, newValue);
  2008. else assignValue(object, key, newValue);
  2009. }
  2010. return object;
  2011. }
  2012. //#endregion
  2013. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js
  2014. var nativeMax$2 = Math.max;
  2015. /**
  2016. * A specialized version of `baseRest` which transforms the rest array.
  2017. *
  2018. * @private
  2019. * @param {Function} func The function to apply a rest parameter to.
  2020. * @param {number} [start=func.length-1] The start position of the rest parameter.
  2021. * @param {Function} transform The rest array transform.
  2022. * @returns {Function} Returns the new function.
  2023. */
  2024. function overRest(func, start, transform) {
  2025. start = nativeMax$2(start === void 0 ? func.length - 1 : start, 0);
  2026. return function() {
  2027. var args = arguments, index = -1, length = nativeMax$2(args.length - start, 0), array = Array(length);
  2028. while (++index < length) array[index] = args[start + index];
  2029. index = -1;
  2030. var otherArgs = Array(start + 1);
  2031. while (++index < start) otherArgs[index] = args[index];
  2032. otherArgs[start] = transform(array);
  2033. return apply(func, this, otherArgs);
  2034. };
  2035. }
  2036. //#endregion
  2037. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js
  2038. /**
  2039. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  2040. *
  2041. * @private
  2042. * @param {Function} func The function to apply a rest parameter to.
  2043. * @param {number} [start=func.length-1] The start position of the rest parameter.
  2044. * @returns {Function} Returns the new function.
  2045. */
  2046. function baseRest(func, start) {
  2047. return setToString(overRest(func, start, identity), func + "");
  2048. }
  2049. //#endregion
  2050. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isLength.js
  2051. /** Used as references for various `Number` constants. */
  2052. var MAX_SAFE_INTEGER = 9007199254740991;
  2053. /**
  2054. * Checks if `value` is a valid array-like length.
  2055. *
  2056. * **Note:** This method is loosely based on
  2057. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  2058. *
  2059. * @static
  2060. * @memberOf _
  2061. * @since 4.0.0
  2062. * @category Lang
  2063. * @param {*} value The value to check.
  2064. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  2065. * @example
  2066. *
  2067. * _.isLength(3);
  2068. * // => true
  2069. *
  2070. * _.isLength(Number.MIN_VALUE);
  2071. * // => false
  2072. *
  2073. * _.isLength(Infinity);
  2074. * // => false
  2075. *
  2076. * _.isLength('3');
  2077. * // => false
  2078. */
  2079. function isLength(value) {
  2080. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  2081. }
  2082. //#endregion
  2083. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js
  2084. /**
  2085. * Checks if `value` is array-like. A value is considered array-like if it's
  2086. * not a function and has a `value.length` that's an integer greater than or
  2087. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  2088. *
  2089. * @static
  2090. * @memberOf _
  2091. * @since 4.0.0
  2092. * @category Lang
  2093. * @param {*} value The value to check.
  2094. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  2095. * @example
  2096. *
  2097. * _.isArrayLike([1, 2, 3]);
  2098. * // => true
  2099. *
  2100. * _.isArrayLike(document.body.children);
  2101. * // => true
  2102. *
  2103. * _.isArrayLike('abc');
  2104. * // => true
  2105. *
  2106. * _.isArrayLike(_.noop);
  2107. * // => false
  2108. */
  2109. function isArrayLike(value) {
  2110. return value != null && isLength(value.length) && !isFunction(value);
  2111. }
  2112. //#endregion
  2113. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js
  2114. /**
  2115. * Checks if the given arguments are from an iteratee call.
  2116. *
  2117. * @private
  2118. * @param {*} value The potential iteratee value argument.
  2119. * @param {*} index The potential iteratee index or key argument.
  2120. * @param {*} object The potential iteratee object argument.
  2121. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  2122. * else `false`.
  2123. */
  2124. function isIterateeCall(value, index, object) {
  2125. if (!isObject(object)) return false;
  2126. var type = typeof index;
  2127. if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) return eq(object[index], value);
  2128. return false;
  2129. }
  2130. //#endregion
  2131. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js
  2132. /**
  2133. * Creates a function like `_.assign`.
  2134. *
  2135. * @private
  2136. * @param {Function} assigner The function to assign values.
  2137. * @returns {Function} Returns the new assigner function.
  2138. */
  2139. function createAssigner(assigner) {
  2140. return baseRest(function(object, sources) {
  2141. var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
  2142. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
  2143. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  2144. customizer = length < 3 ? void 0 : customizer;
  2145. length = 1;
  2146. }
  2147. object = Object(object);
  2148. while (++index < length) {
  2149. var source = sources[index];
  2150. if (source) assigner(object, source, index, customizer);
  2151. }
  2152. return object;
  2153. });
  2154. }
  2155. //#endregion
  2156. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js
  2157. /** Used for built-in method references. */
  2158. var objectProto$2 = Object.prototype;
  2159. /**
  2160. * Checks if `value` is likely a prototype object.
  2161. *
  2162. * @private
  2163. * @param {*} value The value to check.
  2164. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  2165. */
  2166. function isPrototype(value) {
  2167. var Ctor = value && value.constructor;
  2168. return value === (typeof Ctor == "function" && Ctor.prototype || objectProto$2);
  2169. }
  2170. //#endregion
  2171. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js
  2172. /**
  2173. * The base implementation of `_.times` without support for iteratee shorthands
  2174. * or max array length checks.
  2175. *
  2176. * @private
  2177. * @param {number} n The number of times to invoke `iteratee`.
  2178. * @param {Function} iteratee The function invoked per iteration.
  2179. * @returns {Array} Returns the array of results.
  2180. */
  2181. function baseTimes(n, iteratee) {
  2182. var index = -1, result = Array(n);
  2183. while (++index < n) result[index] = iteratee(index);
  2184. return result;
  2185. }
  2186. //#endregion
  2187. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js
  2188. /** `Object#toString` result references. */
  2189. var argsTag$3 = "[object Arguments]";
  2190. /**
  2191. * The base implementation of `_.isArguments`.
  2192. *
  2193. * @private
  2194. * @param {*} value The value to check.
  2195. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2196. */
  2197. function baseIsArguments(value) {
  2198. return isObjectLike(value) && baseGetTag(value) == argsTag$3;
  2199. }
  2200. //#endregion
  2201. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js
  2202. /** Used for built-in method references. */
  2203. var objectProto$1 = Object.prototype;
  2204. /** Used to check objects for own properties. */
  2205. var hasOwnProperty$10 = objectProto$1.hasOwnProperty;
  2206. /** Built-in value references. */
  2207. var propertyIsEnumerable$1 = objectProto$1.propertyIsEnumerable;
  2208. /**
  2209. * Checks if `value` is likely an `arguments` object.
  2210. *
  2211. * @static
  2212. * @memberOf _
  2213. * @since 0.1.0
  2214. * @category Lang
  2215. * @param {*} value The value to check.
  2216. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2217. * else `false`.
  2218. * @example
  2219. *
  2220. * _.isArguments(function() { return arguments; }());
  2221. * // => true
  2222. *
  2223. * _.isArguments([1, 2, 3]);
  2224. * // => false
  2225. */
  2226. var isArguments = baseIsArguments(function() {
  2227. return arguments;
  2228. }()) ? baseIsArguments : function(value) {
  2229. return isObjectLike(value) && hasOwnProperty$10.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  2230. };
  2231. //#endregion
  2232. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js
  2233. /**
  2234. * This method returns `false`.
  2235. *
  2236. * @static
  2237. * @memberOf _
  2238. * @since 4.13.0
  2239. * @category Util
  2240. * @returns {boolean} Returns `false`.
  2241. * @example
  2242. *
  2243. * _.times(2, _.stubFalse);
  2244. * // => [false, false]
  2245. */
  2246. function stubFalse() {
  2247. return false;
  2248. }
  2249. //#endregion
  2250. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js
  2251. /** Detect free variable `exports`. */
  2252. var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
  2253. /** Detect free variable `module`. */
  2254. var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
  2255. /** Built-in value references. */
  2256. var Buffer$2 = freeModule$2 && freeModule$2.exports === freeExports$2 ? root.Buffer : void 0;
  2257. /**
  2258. * Checks if `value` is a buffer.
  2259. *
  2260. * @static
  2261. * @memberOf _
  2262. * @since 4.3.0
  2263. * @category Lang
  2264. * @param {*} value The value to check.
  2265. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  2266. * @example
  2267. *
  2268. * _.isBuffer(new Buffer(2));
  2269. * // => true
  2270. *
  2271. * _.isBuffer(new Uint8Array(2));
  2272. * // => false
  2273. */
  2274. var isBuffer = (Buffer$2 ? Buffer$2.isBuffer : void 0) || stubFalse;
  2275. //#endregion
  2276. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js
  2277. /** `Object#toString` result references. */
  2278. var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
  2279. var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
  2280. /** Used to identify `toStringTag` values of typed arrays. */
  2281. var typedArrayTags = {};
  2282. typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
  2283. typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
  2284. /**
  2285. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  2286. *
  2287. * @private
  2288. * @param {*} value The value to check.
  2289. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  2290. */
  2291. function baseIsTypedArray(value) {
  2292. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  2293. }
  2294. //#endregion
  2295. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js
  2296. /**
  2297. * The base implementation of `_.unary` without support for storing metadata.
  2298. *
  2299. * @private
  2300. * @param {Function} func The function to cap arguments for.
  2301. * @returns {Function} Returns the new capped function.
  2302. */
  2303. function baseUnary(func) {
  2304. return function(value) {
  2305. return func(value);
  2306. };
  2307. }
  2308. //#endregion
  2309. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js
  2310. /** Detect free variable `exports`. */
  2311. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  2312. /** Detect free variable `module`. */
  2313. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  2314. /** Detect free variable `process` from Node.js. */
  2315. var freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && freeGlobal.process;
  2316. /** Used to access faster Node.js helpers. */
  2317. var nodeUtil = function() {
  2318. try {
  2319. var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
  2320. if (types) return types;
  2321. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  2322. } catch (e) {}
  2323. }();
  2324. //#endregion
  2325. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js
  2326. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2327. /**
  2328. * Checks if `value` is classified as a typed array.
  2329. *
  2330. * @static
  2331. * @memberOf _
  2332. * @since 3.0.0
  2333. * @category Lang
  2334. * @param {*} value The value to check.
  2335. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  2336. * @example
  2337. *
  2338. * _.isTypedArray(new Uint8Array);
  2339. * // => true
  2340. *
  2341. * _.isTypedArray([]);
  2342. * // => false
  2343. */
  2344. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  2345. //#endregion
  2346. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js
  2347. /** Used to check objects for own properties. */
  2348. var hasOwnProperty$9 = Object.prototype.hasOwnProperty;
  2349. /**
  2350. * Creates an array of the enumerable property names of the array-like `value`.
  2351. *
  2352. * @private
  2353. * @param {*} value The value to query.
  2354. * @param {boolean} inherited Specify returning inherited property names.
  2355. * @returns {Array} Returns the array of property names.
  2356. */
  2357. function arrayLikeKeys(value, inherited) {
  2358. var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  2359. for (var key in value) if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
  2360. return result;
  2361. }
  2362. //#endregion
  2363. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js
  2364. /**
  2365. * Creates a unary function that invokes `func` with its argument transformed.
  2366. *
  2367. * @private
  2368. * @param {Function} func The function to wrap.
  2369. * @param {Function} transform The argument transform.
  2370. * @returns {Function} Returns the new function.
  2371. */
  2372. function overArg(func, transform) {
  2373. return function(arg) {
  2374. return func(transform(arg));
  2375. };
  2376. }
  2377. //#endregion
  2378. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js
  2379. var nativeKeys = overArg(Object.keys, Object);
  2380. //#endregion
  2381. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js
  2382. /** Used to check objects for own properties. */
  2383. var hasOwnProperty$8 = Object.prototype.hasOwnProperty;
  2384. /**
  2385. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  2386. *
  2387. * @private
  2388. * @param {Object} object The object to query.
  2389. * @returns {Array} Returns the array of property names.
  2390. */
  2391. function baseKeys(object) {
  2392. if (!isPrototype(object)) return nativeKeys(object);
  2393. var result = [];
  2394. for (var key in Object(object)) if (hasOwnProperty$8.call(object, key) && key != "constructor") result.push(key);
  2395. return result;
  2396. }
  2397. //#endregion
  2398. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/keys.js
  2399. /**
  2400. * Creates an array of the own enumerable property names of `object`.
  2401. *
  2402. * **Note:** Non-object values are coerced to objects. See the
  2403. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2404. * for more details.
  2405. *
  2406. * @static
  2407. * @since 0.1.0
  2408. * @memberOf _
  2409. * @category Object
  2410. * @param {Object} object The object to query.
  2411. * @returns {Array} Returns the array of property names.
  2412. * @example
  2413. *
  2414. * function Foo() {
  2415. * this.a = 1;
  2416. * this.b = 2;
  2417. * }
  2418. *
  2419. * Foo.prototype.c = 3;
  2420. *
  2421. * _.keys(new Foo);
  2422. * // => ['a', 'b'] (iteration order is not guaranteed)
  2423. *
  2424. * _.keys('hi');
  2425. * // => ['0', '1']
  2426. */
  2427. function keys(object) {
  2428. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  2429. }
  2430. //#endregion
  2431. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js
  2432. /**
  2433. * This function is like
  2434. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2435. * except that it includes inherited enumerable properties.
  2436. *
  2437. * @private
  2438. * @param {Object} object The object to query.
  2439. * @returns {Array} Returns the array of property names.
  2440. */
  2441. function nativeKeysIn(object) {
  2442. var result = [];
  2443. if (object != null) for (var key in Object(object)) result.push(key);
  2444. return result;
  2445. }
  2446. //#endregion
  2447. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js
  2448. /** Used to check objects for own properties. */
  2449. var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
  2450. /**
  2451. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  2452. *
  2453. * @private
  2454. * @param {Object} object The object to query.
  2455. * @returns {Array} Returns the array of property names.
  2456. */
  2457. function baseKeysIn(object) {
  2458. if (!isObject(object)) return nativeKeysIn(object);
  2459. var isProto = isPrototype(object), result = [];
  2460. for (var key in object) if (!(key == "constructor" && (isProto || !hasOwnProperty$7.call(object, key)))) result.push(key);
  2461. return result;
  2462. }
  2463. //#endregion
  2464. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js
  2465. /**
  2466. * Creates an array of the own and inherited enumerable property names of `object`.
  2467. *
  2468. * **Note:** Non-object values are coerced to objects.
  2469. *
  2470. * @static
  2471. * @memberOf _
  2472. * @since 3.0.0
  2473. * @category Object
  2474. * @param {Object} object The object to query.
  2475. * @returns {Array} Returns the array of property names.
  2476. * @example
  2477. *
  2478. * function Foo() {
  2479. * this.a = 1;
  2480. * this.b = 2;
  2481. * }
  2482. *
  2483. * Foo.prototype.c = 3;
  2484. *
  2485. * _.keysIn(new Foo);
  2486. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  2487. */
  2488. function keysIn(object) {
  2489. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  2490. }
  2491. //#endregion
  2492. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js
  2493. /** Used to match property names within property paths. */
  2494. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
  2495. /**
  2496. * Checks if `value` is a property name and not a property path.
  2497. *
  2498. * @private
  2499. * @param {*} value The value to check.
  2500. * @param {Object} [object] The object to query keys on.
  2501. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  2502. */
  2503. function isKey(value, object) {
  2504. if (isArray(value)) return false;
  2505. var type = typeof value;
  2506. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) return true;
  2507. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  2508. }
  2509. //#endregion
  2510. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js
  2511. var nativeCreate = getNative(Object, "create");
  2512. //#endregion
  2513. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js
  2514. /**
  2515. * Removes all key-value entries from the hash.
  2516. *
  2517. * @private
  2518. * @name clear
  2519. * @memberOf Hash
  2520. */
  2521. function hashClear() {
  2522. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2523. this.size = 0;
  2524. }
  2525. //#endregion
  2526. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js
  2527. /**
  2528. * Removes `key` and its value from the hash.
  2529. *
  2530. * @private
  2531. * @name delete
  2532. * @memberOf Hash
  2533. * @param {Object} hash The hash to modify.
  2534. * @param {string} key The key of the value to remove.
  2535. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2536. */
  2537. function hashDelete(key) {
  2538. var result = this.has(key) && delete this.__data__[key];
  2539. this.size -= result ? 1 : 0;
  2540. return result;
  2541. }
  2542. //#endregion
  2543. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js
  2544. /** Used to stand-in for `undefined` hash values. */
  2545. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  2546. /** Used to check objects for own properties. */
  2547. var hasOwnProperty$6 = Object.prototype.hasOwnProperty;
  2548. /**
  2549. * Gets the hash value for `key`.
  2550. *
  2551. * @private
  2552. * @name get
  2553. * @memberOf Hash
  2554. * @param {string} key The key of the value to get.
  2555. * @returns {*} Returns the entry value.
  2556. */
  2557. function hashGet(key) {
  2558. var data = this.__data__;
  2559. if (nativeCreate) {
  2560. var result = data[key];
  2561. return result === HASH_UNDEFINED$2 ? void 0 : result;
  2562. }
  2563. return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
  2564. }
  2565. //#endregion
  2566. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js
  2567. /** Used to check objects for own properties. */
  2568. var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
  2569. /**
  2570. * Checks if a hash value for `key` exists.
  2571. *
  2572. * @private
  2573. * @name has
  2574. * @memberOf Hash
  2575. * @param {string} key The key of the entry to check.
  2576. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2577. */
  2578. function hashHas(key) {
  2579. var data = this.__data__;
  2580. return nativeCreate ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
  2581. }
  2582. //#endregion
  2583. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js
  2584. /** Used to stand-in for `undefined` hash values. */
  2585. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  2586. /**
  2587. * Sets the hash `key` to `value`.
  2588. *
  2589. * @private
  2590. * @name set
  2591. * @memberOf Hash
  2592. * @param {string} key The key of the value to set.
  2593. * @param {*} value The value to set.
  2594. * @returns {Object} Returns the hash instance.
  2595. */
  2596. function hashSet(key, value) {
  2597. var data = this.__data__;
  2598. this.size += this.has(key) ? 0 : 1;
  2599. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
  2600. return this;
  2601. }
  2602. //#endregion
  2603. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js
  2604. /**
  2605. * Creates a hash object.
  2606. *
  2607. * @private
  2608. * @constructor
  2609. * @param {Array} [entries] The key-value pairs to cache.
  2610. */
  2611. function Hash(entries) {
  2612. var index = -1, length = entries == null ? 0 : entries.length;
  2613. this.clear();
  2614. while (++index < length) {
  2615. var entry = entries[index];
  2616. this.set(entry[0], entry[1]);
  2617. }
  2618. }
  2619. Hash.prototype.clear = hashClear;
  2620. Hash.prototype["delete"] = hashDelete;
  2621. Hash.prototype.get = hashGet;
  2622. Hash.prototype.has = hashHas;
  2623. Hash.prototype.set = hashSet;
  2624. //#endregion
  2625. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js
  2626. /**
  2627. * Removes all key-value entries from the list cache.
  2628. *
  2629. * @private
  2630. * @name clear
  2631. * @memberOf ListCache
  2632. */
  2633. function listCacheClear() {
  2634. this.__data__ = [];
  2635. this.size = 0;
  2636. }
  2637. //#endregion
  2638. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js
  2639. /**
  2640. * Gets the index at which the `key` is found in `array` of key-value pairs.
  2641. *
  2642. * @private
  2643. * @param {Array} array The array to inspect.
  2644. * @param {*} key The key to search for.
  2645. * @returns {number} Returns the index of the matched value, else `-1`.
  2646. */
  2647. function assocIndexOf(array, key) {
  2648. var length = array.length;
  2649. while (length--) if (eq(array[length][0], key)) return length;
  2650. return -1;
  2651. }
  2652. //#endregion
  2653. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js
  2654. /** Built-in value references. */
  2655. var splice = Array.prototype.splice;
  2656. /**
  2657. * Removes `key` and its value from the list cache.
  2658. *
  2659. * @private
  2660. * @name delete
  2661. * @memberOf ListCache
  2662. * @param {string} key The key of the value to remove.
  2663. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2664. */
  2665. function listCacheDelete(key) {
  2666. var data = this.__data__, index = assocIndexOf(data, key);
  2667. if (index < 0) return false;
  2668. if (index == data.length - 1) data.pop();
  2669. else splice.call(data, index, 1);
  2670. --this.size;
  2671. return true;
  2672. }
  2673. //#endregion
  2674. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js
  2675. /**
  2676. * Gets the list cache value for `key`.
  2677. *
  2678. * @private
  2679. * @name get
  2680. * @memberOf ListCache
  2681. * @param {string} key The key of the value to get.
  2682. * @returns {*} Returns the entry value.
  2683. */
  2684. function listCacheGet(key) {
  2685. var data = this.__data__, index = assocIndexOf(data, key);
  2686. return index < 0 ? void 0 : data[index][1];
  2687. }
  2688. //#endregion
  2689. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js
  2690. /**
  2691. * Checks if a list cache value for `key` exists.
  2692. *
  2693. * @private
  2694. * @name has
  2695. * @memberOf ListCache
  2696. * @param {string} key The key of the entry to check.
  2697. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2698. */
  2699. function listCacheHas(key) {
  2700. return assocIndexOf(this.__data__, key) > -1;
  2701. }
  2702. //#endregion
  2703. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js
  2704. /**
  2705. * Sets the list cache `key` to `value`.
  2706. *
  2707. * @private
  2708. * @name set
  2709. * @memberOf ListCache
  2710. * @param {string} key The key of the value to set.
  2711. * @param {*} value The value to set.
  2712. * @returns {Object} Returns the list cache instance.
  2713. */
  2714. function listCacheSet(key, value) {
  2715. var data = this.__data__, index = assocIndexOf(data, key);
  2716. if (index < 0) {
  2717. ++this.size;
  2718. data.push([key, value]);
  2719. } else data[index][1] = value;
  2720. return this;
  2721. }
  2722. //#endregion
  2723. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js
  2724. /**
  2725. * Creates an list cache object.
  2726. *
  2727. * @private
  2728. * @constructor
  2729. * @param {Array} [entries] The key-value pairs to cache.
  2730. */
  2731. function ListCache(entries) {
  2732. var index = -1, length = entries == null ? 0 : entries.length;
  2733. this.clear();
  2734. while (++index < length) {
  2735. var entry = entries[index];
  2736. this.set(entry[0], entry[1]);
  2737. }
  2738. }
  2739. ListCache.prototype.clear = listCacheClear;
  2740. ListCache.prototype["delete"] = listCacheDelete;
  2741. ListCache.prototype.get = listCacheGet;
  2742. ListCache.prototype.has = listCacheHas;
  2743. ListCache.prototype.set = listCacheSet;
  2744. //#endregion
  2745. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Map.js
  2746. var Map$1 = getNative(root, "Map");
  2747. //#endregion
  2748. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js
  2749. /**
  2750. * Removes all key-value entries from the map.
  2751. *
  2752. * @private
  2753. * @name clear
  2754. * @memberOf MapCache
  2755. */
  2756. function mapCacheClear() {
  2757. this.size = 0;
  2758. this.__data__ = {
  2759. "hash": new Hash(),
  2760. "map": new (Map$1 || ListCache)(),
  2761. "string": new Hash()
  2762. };
  2763. }
  2764. //#endregion
  2765. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js
  2766. /**
  2767. * Checks if `value` is suitable for use as unique object key.
  2768. *
  2769. * @private
  2770. * @param {*} value The value to check.
  2771. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2772. */
  2773. function isKeyable(value) {
  2774. var type = typeof value;
  2775. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  2776. }
  2777. //#endregion
  2778. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js
  2779. /**
  2780. * Gets the data for `map`.
  2781. *
  2782. * @private
  2783. * @param {Object} map The map to query.
  2784. * @param {string} key The reference key.
  2785. * @returns {*} Returns the map data.
  2786. */
  2787. function getMapData(map, key) {
  2788. var data = map.__data__;
  2789. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  2790. }
  2791. //#endregion
  2792. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js
  2793. /**
  2794. * Removes `key` and its value from the map.
  2795. *
  2796. * @private
  2797. * @name delete
  2798. * @memberOf MapCache
  2799. * @param {string} key The key of the value to remove.
  2800. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2801. */
  2802. function mapCacheDelete(key) {
  2803. var result = getMapData(this, key)["delete"](key);
  2804. this.size -= result ? 1 : 0;
  2805. return result;
  2806. }
  2807. //#endregion
  2808. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js
  2809. /**
  2810. * Gets the map value for `key`.
  2811. *
  2812. * @private
  2813. * @name get
  2814. * @memberOf MapCache
  2815. * @param {string} key The key of the value to get.
  2816. * @returns {*} Returns the entry value.
  2817. */
  2818. function mapCacheGet(key) {
  2819. return getMapData(this, key).get(key);
  2820. }
  2821. //#endregion
  2822. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js
  2823. /**
  2824. * Checks if a map value for `key` exists.
  2825. *
  2826. * @private
  2827. * @name has
  2828. * @memberOf MapCache
  2829. * @param {string} key The key of the entry to check.
  2830. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2831. */
  2832. function mapCacheHas(key) {
  2833. return getMapData(this, key).has(key);
  2834. }
  2835. //#endregion
  2836. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js
  2837. /**
  2838. * Sets the map `key` to `value`.
  2839. *
  2840. * @private
  2841. * @name set
  2842. * @memberOf MapCache
  2843. * @param {string} key The key of the value to set.
  2844. * @param {*} value The value to set.
  2845. * @returns {Object} Returns the map cache instance.
  2846. */
  2847. function mapCacheSet(key, value) {
  2848. var data = getMapData(this, key), size = data.size;
  2849. data.set(key, value);
  2850. this.size += data.size == size ? 0 : 1;
  2851. return this;
  2852. }
  2853. //#endregion
  2854. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js
  2855. /**
  2856. * Creates a map cache object to store key-value pairs.
  2857. *
  2858. * @private
  2859. * @constructor
  2860. * @param {Array} [entries] The key-value pairs to cache.
  2861. */
  2862. function MapCache(entries) {
  2863. var index = -1, length = entries == null ? 0 : entries.length;
  2864. this.clear();
  2865. while (++index < length) {
  2866. var entry = entries[index];
  2867. this.set(entry[0], entry[1]);
  2868. }
  2869. }
  2870. MapCache.prototype.clear = mapCacheClear;
  2871. MapCache.prototype["delete"] = mapCacheDelete;
  2872. MapCache.prototype.get = mapCacheGet;
  2873. MapCache.prototype.has = mapCacheHas;
  2874. MapCache.prototype.set = mapCacheSet;
  2875. //#endregion
  2876. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/memoize.js
  2877. /** Error message constants. */
  2878. var FUNC_ERROR_TEXT$2 = "Expected a function";
  2879. /**
  2880. * Creates a function that memoizes the result of `func`. If `resolver` is
  2881. * provided, it determines the cache key for storing the result based on the
  2882. * arguments provided to the memoized function. By default, the first argument
  2883. * provided to the memoized function is used as the map cache key. The `func`
  2884. * is invoked with the `this` binding of the memoized function.
  2885. *
  2886. * **Note:** The cache is exposed as the `cache` property on the memoized
  2887. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  2888. * constructor with one whose instances implement the
  2889. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  2890. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  2891. *
  2892. * @static
  2893. * @memberOf _
  2894. * @since 0.1.0
  2895. * @category Function
  2896. * @param {Function} func The function to have its output memoized.
  2897. * @param {Function} [resolver] The function to resolve the cache key.
  2898. * @returns {Function} Returns the new memoized function.
  2899. * @example
  2900. *
  2901. * var object = { 'a': 1, 'b': 2 };
  2902. * var other = { 'c': 3, 'd': 4 };
  2903. *
  2904. * var values = _.memoize(_.values);
  2905. * values(object);
  2906. * // => [1, 2]
  2907. *
  2908. * values(other);
  2909. * // => [3, 4]
  2910. *
  2911. * object.a = 2;
  2912. * values(object);
  2913. * // => [1, 2]
  2914. *
  2915. * // Modify the result cache.
  2916. * values.cache.set(object, ['a', 'b']);
  2917. * values(object);
  2918. * // => ['a', 'b']
  2919. *
  2920. * // Replace `_.memoize.Cache`.
  2921. * _.memoize.Cache = WeakMap;
  2922. */
  2923. function memoize(func, resolver) {
  2924. if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT$2);
  2925. var memoized = function() {
  2926. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  2927. if (cache.has(key)) return cache.get(key);
  2928. var result = func.apply(this, args);
  2929. memoized.cache = cache.set(key, result) || cache;
  2930. return result;
  2931. };
  2932. memoized.cache = new (memoize.Cache || MapCache)();
  2933. return memoized;
  2934. }
  2935. memoize.Cache = MapCache;
  2936. //#endregion
  2937. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js
  2938. /** Used as the maximum memoize cache size. */
  2939. var MAX_MEMOIZE_SIZE = 500;
  2940. /**
  2941. * A specialized version of `_.memoize` which clears the memoized function's
  2942. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  2943. *
  2944. * @private
  2945. * @param {Function} func The function to have its output memoized.
  2946. * @returns {Function} Returns the new memoized function.
  2947. */
  2948. function memoizeCapped(func) {
  2949. var result = memoize(func, function(key) {
  2950. if (cache.size === MAX_MEMOIZE_SIZE) cache.clear();
  2951. return key;
  2952. });
  2953. var cache = result.cache;
  2954. return result;
  2955. }
  2956. //#endregion
  2957. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js
  2958. /** Used to match property names within property paths. */
  2959. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  2960. /** Used to match backslashes in property paths. */
  2961. var reEscapeChar = /\\(\\)?/g;
  2962. /**
  2963. * Converts `string` to a property path array.
  2964. *
  2965. * @private
  2966. * @param {string} string The string to convert.
  2967. * @returns {Array} Returns the property path array.
  2968. */
  2969. var stringToPath = memoizeCapped(function(string) {
  2970. var result = [];
  2971. if (string.charCodeAt(0) === 46) result.push("");
  2972. string.replace(rePropName, function(match, number, quote, subString) {
  2973. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  2974. });
  2975. return result;
  2976. });
  2977. //#endregion
  2978. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toString.js
  2979. /**
  2980. * Converts `value` to a string. An empty string is returned for `null`
  2981. * and `undefined` values. The sign of `-0` is preserved.
  2982. *
  2983. * @static
  2984. * @memberOf _
  2985. * @since 4.0.0
  2986. * @category Lang
  2987. * @param {*} value The value to convert.
  2988. * @returns {string} Returns the converted string.
  2989. * @example
  2990. *
  2991. * _.toString(null);
  2992. * // => ''
  2993. *
  2994. * _.toString(-0);
  2995. * // => '-0'
  2996. *
  2997. * _.toString([1, 2, 3]);
  2998. * // => '1,2,3'
  2999. */
  3000. function toString(value) {
  3001. return value == null ? "" : baseToString(value);
  3002. }
  3003. //#endregion
  3004. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js
  3005. /**
  3006. * Casts `value` to a path array if it's not one.
  3007. *
  3008. * @private
  3009. * @param {*} value The value to inspect.
  3010. * @param {Object} [object] The object to query keys on.
  3011. * @returns {Array} Returns the cast property path array.
  3012. */
  3013. function castPath(value, object) {
  3014. if (isArray(value)) return value;
  3015. return isKey(value, object) ? [value] : stringToPath(toString(value));
  3016. }
  3017. //#endregion
  3018. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js
  3019. /** Used as references for various `Number` constants. */
  3020. var INFINITY$1 = Infinity;
  3021. /**
  3022. * Converts `value` to a string key if it's not a string or symbol.
  3023. *
  3024. * @private
  3025. * @param {*} value The value to inspect.
  3026. * @returns {string|symbol} Returns the key.
  3027. */
  3028. function toKey(value) {
  3029. if (typeof value == "string" || isSymbol(value)) return value;
  3030. var result = value + "";
  3031. return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
  3032. }
  3033. //#endregion
  3034. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js
  3035. /**
  3036. * The base implementation of `_.get` without support for default values.
  3037. *
  3038. * @private
  3039. * @param {Object} object The object to query.
  3040. * @param {Array|string} path The path of the property to get.
  3041. * @returns {*} Returns the resolved value.
  3042. */
  3043. function baseGet(object, path) {
  3044. path = castPath(path, object);
  3045. var index = 0, length = path.length;
  3046. while (object != null && index < length) object = object[toKey(path[index++])];
  3047. return index && index == length ? object : void 0;
  3048. }
  3049. //#endregion
  3050. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/get.js
  3051. /**
  3052. * Gets the value at `path` of `object`. If the resolved value is
  3053. * `undefined`, the `defaultValue` is returned in its place.
  3054. *
  3055. * @static
  3056. * @memberOf _
  3057. * @since 3.7.0
  3058. * @category Object
  3059. * @param {Object} object The object to query.
  3060. * @param {Array|string} path The path of the property to get.
  3061. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  3062. * @returns {*} Returns the resolved value.
  3063. * @example
  3064. *
  3065. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  3066. *
  3067. * _.get(object, 'a[0].b.c');
  3068. * // => 3
  3069. *
  3070. * _.get(object, ['a', '0', 'b', 'c']);
  3071. * // => 3
  3072. *
  3073. * _.get(object, 'a.b.c', 'default');
  3074. * // => 'default'
  3075. */
  3076. function get(object, path, defaultValue) {
  3077. var result = object == null ? void 0 : baseGet(object, path);
  3078. return result === void 0 ? defaultValue : result;
  3079. }
  3080. //#endregion
  3081. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js
  3082. /**
  3083. * Appends the elements of `values` to `array`.
  3084. *
  3085. * @private
  3086. * @param {Array} array The array to modify.
  3087. * @param {Array} values The values to append.
  3088. * @returns {Array} Returns `array`.
  3089. */
  3090. function arrayPush(array, values) {
  3091. var index = -1, length = values.length, offset = array.length;
  3092. while (++index < length) array[offset + index] = values[index];
  3093. return array;
  3094. }
  3095. //#endregion
  3096. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isFlattenable.js
  3097. /** Built-in value references. */
  3098. var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
  3099. /**
  3100. * Checks if `value` is a flattenable `arguments` object or array.
  3101. *
  3102. * @private
  3103. * @param {*} value The value to check.
  3104. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  3105. */
  3106. function isFlattenable(value) {
  3107. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  3108. }
  3109. //#endregion
  3110. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFlatten.js
  3111. /**
  3112. * The base implementation of `_.flatten` with support for restricting flattening.
  3113. *
  3114. * @private
  3115. * @param {Array} array The array to flatten.
  3116. * @param {number} depth The maximum recursion depth.
  3117. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3118. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3119. * @param {Array} [result=[]] The initial result value.
  3120. * @returns {Array} Returns the new flattened array.
  3121. */
  3122. function baseFlatten(array, depth, predicate, isStrict, result) {
  3123. var index = -1, length = array.length;
  3124. predicate || (predicate = isFlattenable);
  3125. result || (result = []);
  3126. while (++index < length) {
  3127. var value = array[index];
  3128. if (depth > 0 && predicate(value)) if (depth > 1) baseFlatten(value, depth - 1, predicate, isStrict, result);
  3129. else arrayPush(result, value);
  3130. else if (!isStrict) result[result.length] = value;
  3131. }
  3132. return result;
  3133. }
  3134. //#endregion
  3135. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flatten.js
  3136. /**
  3137. * Flattens `array` a single level deep.
  3138. *
  3139. * @static
  3140. * @memberOf _
  3141. * @since 0.1.0
  3142. * @category Array
  3143. * @param {Array} array The array to flatten.
  3144. * @returns {Array} Returns the new flattened array.
  3145. * @example
  3146. *
  3147. * _.flatten([1, [2, [3, [4]], 5]]);
  3148. * // => [1, 2, [3, [4]], 5]
  3149. */
  3150. function flatten(array) {
  3151. return (array == null ? 0 : array.length) ? baseFlatten(array, 1) : [];
  3152. }
  3153. //#endregion
  3154. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_flatRest.js
  3155. /**
  3156. * A specialized version of `baseRest` which flattens the rest array.
  3157. *
  3158. * @private
  3159. * @param {Function} func The function to apply a rest parameter to.
  3160. * @returns {Function} Returns the new function.
  3161. */
  3162. function flatRest(func) {
  3163. return setToString(overRest(func, void 0, flatten), func + "");
  3164. }
  3165. //#endregion
  3166. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js
  3167. /** Built-in value references. */
  3168. var getPrototype = overArg(Object.getPrototypeOf, Object);
  3169. //#endregion
  3170. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js
  3171. /** `Object#toString` result references. */
  3172. var objectTag$3 = "[object Object]";
  3173. /** Used for built-in method references. */
  3174. var funcProto = Function.prototype, objectProto = Object.prototype;
  3175. /** Used to resolve the decompiled source of functions. */
  3176. var funcToString = funcProto.toString;
  3177. /** Used to check objects for own properties. */
  3178. var hasOwnProperty$4 = objectProto.hasOwnProperty;
  3179. /** Used to infer the `Object` constructor. */
  3180. var objectCtorString = funcToString.call(Object);
  3181. /**
  3182. * Checks if `value` is a plain object, that is, an object created by the
  3183. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  3184. *
  3185. * @static
  3186. * @memberOf _
  3187. * @since 0.8.0
  3188. * @category Lang
  3189. * @param {*} value The value to check.
  3190. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  3191. * @example
  3192. *
  3193. * function Foo() {
  3194. * this.a = 1;
  3195. * }
  3196. *
  3197. * _.isPlainObject(new Foo);
  3198. * // => false
  3199. *
  3200. * _.isPlainObject([1, 2, 3]);
  3201. * // => false
  3202. *
  3203. * _.isPlainObject({ 'x': 0, 'y': 0 });
  3204. * // => true
  3205. *
  3206. * _.isPlainObject(Object.create(null));
  3207. * // => true
  3208. */
  3209. function isPlainObject(value) {
  3210. if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) return false;
  3211. var proto = getPrototype(value);
  3212. if (proto === null) return true;
  3213. var Ctor = hasOwnProperty$4.call(proto, "constructor") && proto.constructor;
  3214. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  3215. }
  3216. //#endregion
  3217. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSlice.js
  3218. /**
  3219. * The base implementation of `_.slice` without an iteratee call guard.
  3220. *
  3221. * @private
  3222. * @param {Array} array The array to slice.
  3223. * @param {number} [start=0] The start position.
  3224. * @param {number} [end=array.length] The end position.
  3225. * @returns {Array} Returns the slice of `array`.
  3226. */
  3227. function baseSlice(array, start, end) {
  3228. var index = -1, length = array.length;
  3229. if (start < 0) start = -start > length ? 0 : length + start;
  3230. end = end > length ? length : end;
  3231. if (end < 0) end += length;
  3232. length = start > end ? 0 : end - start >>> 0;
  3233. start >>>= 0;
  3234. var result = Array(length);
  3235. while (++index < length) result[index] = array[index + start];
  3236. return result;
  3237. }
  3238. //#endregion
  3239. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/castArray.js
  3240. /**
  3241. * Casts `value` as an array if it's not one.
  3242. *
  3243. * @static
  3244. * @memberOf _
  3245. * @since 4.4.0
  3246. * @category Lang
  3247. * @param {*} value The value to inspect.
  3248. * @returns {Array} Returns the cast array.
  3249. * @example
  3250. *
  3251. * _.castArray(1);
  3252. * // => [1]
  3253. *
  3254. * _.castArray({ 'a': 1 });
  3255. * // => [{ 'a': 1 }]
  3256. *
  3257. * _.castArray('abc');
  3258. * // => ['abc']
  3259. *
  3260. * _.castArray(null);
  3261. * // => [null]
  3262. *
  3263. * _.castArray(undefined);
  3264. * // => [undefined]
  3265. *
  3266. * _.castArray();
  3267. * // => []
  3268. *
  3269. * var array = [1, 2, 3];
  3270. * console.log(_.castArray(array) === array);
  3271. * // => true
  3272. */
  3273. function castArray$1() {
  3274. if (!arguments.length) return [];
  3275. var value = arguments[0];
  3276. return isArray(value) ? value : [value];
  3277. }
  3278. //#endregion
  3279. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseClamp.js
  3280. /**
  3281. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3282. *
  3283. * @private
  3284. * @param {number} number The number to clamp.
  3285. * @param {number} [lower] The lower bound.
  3286. * @param {number} upper The upper bound.
  3287. * @returns {number} Returns the clamped number.
  3288. */
  3289. function baseClamp(number, lower, upper) {
  3290. if (number === number) {
  3291. if (upper !== void 0) number = number <= upper ? number : upper;
  3292. if (lower !== void 0) number = number >= lower ? number : lower;
  3293. }
  3294. return number;
  3295. }
  3296. //#endregion
  3297. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/clamp.js
  3298. /**
  3299. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  3300. *
  3301. * @static
  3302. * @memberOf _
  3303. * @since 4.0.0
  3304. * @category Number
  3305. * @param {number} number The number to clamp.
  3306. * @param {number} [lower] The lower bound.
  3307. * @param {number} upper The upper bound.
  3308. * @returns {number} Returns the clamped number.
  3309. * @example
  3310. *
  3311. * _.clamp(-10, -5, 5);
  3312. * // => -5
  3313. *
  3314. * _.clamp(10, -5, 5);
  3315. * // => 5
  3316. */
  3317. function clamp$1(number, lower, upper) {
  3318. if (upper === void 0) {
  3319. upper = lower;
  3320. lower = void 0;
  3321. }
  3322. if (upper !== void 0) {
  3323. upper = toNumber(upper);
  3324. upper = upper === upper ? upper : 0;
  3325. }
  3326. if (lower !== void 0) {
  3327. lower = toNumber(lower);
  3328. lower = lower === lower ? lower : 0;
  3329. }
  3330. return baseClamp(toNumber(number), lower, upper);
  3331. }
  3332. //#endregion
  3333. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js
  3334. /**
  3335. * Removes all key-value entries from the stack.
  3336. *
  3337. * @private
  3338. * @name clear
  3339. * @memberOf Stack
  3340. */
  3341. function stackClear() {
  3342. this.__data__ = new ListCache();
  3343. this.size = 0;
  3344. }
  3345. //#endregion
  3346. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js
  3347. /**
  3348. * Removes `key` and its value from the stack.
  3349. *
  3350. * @private
  3351. * @name delete
  3352. * @memberOf Stack
  3353. * @param {string} key The key of the value to remove.
  3354. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3355. */
  3356. function stackDelete(key) {
  3357. var data = this.__data__, result = data["delete"](key);
  3358. this.size = data.size;
  3359. return result;
  3360. }
  3361. //#endregion
  3362. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js
  3363. /**
  3364. * Gets the stack value for `key`.
  3365. *
  3366. * @private
  3367. * @name get
  3368. * @memberOf Stack
  3369. * @param {string} key The key of the value to get.
  3370. * @returns {*} Returns the entry value.
  3371. */
  3372. function stackGet(key) {
  3373. return this.__data__.get(key);
  3374. }
  3375. //#endregion
  3376. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js
  3377. /**
  3378. * Checks if a stack value for `key` exists.
  3379. *
  3380. * @private
  3381. * @name has
  3382. * @memberOf Stack
  3383. * @param {string} key The key of the entry to check.
  3384. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3385. */
  3386. function stackHas(key) {
  3387. return this.__data__.has(key);
  3388. }
  3389. //#endregion
  3390. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js
  3391. /** Used as the size to enable large array optimizations. */
  3392. var LARGE_ARRAY_SIZE$1 = 200;
  3393. /**
  3394. * Sets the stack `key` to `value`.
  3395. *
  3396. * @private
  3397. * @name set
  3398. * @memberOf Stack
  3399. * @param {string} key The key of the value to set.
  3400. * @param {*} value The value to set.
  3401. * @returns {Object} Returns the stack cache instance.
  3402. */
  3403. function stackSet(key, value) {
  3404. var data = this.__data__;
  3405. if (data instanceof ListCache) {
  3406. var pairs = data.__data__;
  3407. if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
  3408. pairs.push([key, value]);
  3409. this.size = ++data.size;
  3410. return this;
  3411. }
  3412. data = this.__data__ = new MapCache(pairs);
  3413. }
  3414. data.set(key, value);
  3415. this.size = data.size;
  3416. return this;
  3417. }
  3418. //#endregion
  3419. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js
  3420. /**
  3421. * Creates a stack cache object to store key-value pairs.
  3422. *
  3423. * @private
  3424. * @constructor
  3425. * @param {Array} [entries] The key-value pairs to cache.
  3426. */
  3427. function Stack(entries) {
  3428. this.size = (this.__data__ = new ListCache(entries)).size;
  3429. }
  3430. Stack.prototype.clear = stackClear;
  3431. Stack.prototype["delete"] = stackDelete;
  3432. Stack.prototype.get = stackGet;
  3433. Stack.prototype.has = stackHas;
  3434. Stack.prototype.set = stackSet;
  3435. //#endregion
  3436. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js
  3437. /**
  3438. * The base implementation of `_.assign` without support for multiple sources
  3439. * or `customizer` functions.
  3440. *
  3441. * @private
  3442. * @param {Object} object The destination object.
  3443. * @param {Object} source The source object.
  3444. * @returns {Object} Returns `object`.
  3445. */
  3446. function baseAssign(object, source) {
  3447. return object && copyObject(source, keys(source), object);
  3448. }
  3449. //#endregion
  3450. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js
  3451. /**
  3452. * The base implementation of `_.assignIn` without support for multiple sources
  3453. * or `customizer` functions.
  3454. *
  3455. * @private
  3456. * @param {Object} object The destination object.
  3457. * @param {Object} source The source object.
  3458. * @returns {Object} Returns `object`.
  3459. */
  3460. function baseAssignIn(object, source) {
  3461. return object && copyObject(source, keysIn(source), object);
  3462. }
  3463. //#endregion
  3464. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js
  3465. /** Detect free variable `exports`. */
  3466. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  3467. /** Detect free variable `module`. */
  3468. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  3469. /** Built-in value references. */
  3470. var Buffer$1 = freeModule && freeModule.exports === freeExports ? root.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
  3471. /**
  3472. * Creates a clone of `buffer`.
  3473. *
  3474. * @private
  3475. * @param {Buffer} buffer The buffer to clone.
  3476. * @param {boolean} [isDeep] Specify a deep clone.
  3477. * @returns {Buffer} Returns the cloned buffer.
  3478. */
  3479. function cloneBuffer(buffer, isDeep) {
  3480. if (isDeep) return buffer.slice();
  3481. var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  3482. buffer.copy(result);
  3483. return result;
  3484. }
  3485. //#endregion
  3486. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js
  3487. /**
  3488. * A specialized version of `_.filter` for arrays without support for
  3489. * iteratee shorthands.
  3490. *
  3491. * @private
  3492. * @param {Array} [array] The array to iterate over.
  3493. * @param {Function} predicate The function invoked per iteration.
  3494. * @returns {Array} Returns the new filtered array.
  3495. */
  3496. function arrayFilter(array, predicate) {
  3497. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  3498. while (++index < length) {
  3499. var value = array[index];
  3500. if (predicate(value, index, array)) result[resIndex++] = value;
  3501. }
  3502. return result;
  3503. }
  3504. //#endregion
  3505. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js
  3506. /**
  3507. * This method returns a new empty array.
  3508. *
  3509. * @static
  3510. * @memberOf _
  3511. * @since 4.13.0
  3512. * @category Util
  3513. * @returns {Array} Returns the new empty array.
  3514. * @example
  3515. *
  3516. * var arrays = _.times(2, _.stubArray);
  3517. *
  3518. * console.log(arrays);
  3519. * // => [[], []]
  3520. *
  3521. * console.log(arrays[0] === arrays[1]);
  3522. * // => false
  3523. */
  3524. function stubArray() {
  3525. return [];
  3526. }
  3527. //#endregion
  3528. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js
  3529. /** Built-in value references. */
  3530. var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  3531. var nativeGetSymbols = Object.getOwnPropertySymbols;
  3532. /**
  3533. * Creates an array of the own enumerable symbols of `object`.
  3534. *
  3535. * @private
  3536. * @param {Object} object The object to query.
  3537. * @returns {Array} Returns the array of symbols.
  3538. */
  3539. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  3540. if (object == null) return [];
  3541. object = Object(object);
  3542. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  3543. return propertyIsEnumerable.call(object, symbol);
  3544. });
  3545. };
  3546. //#endregion
  3547. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js
  3548. /**
  3549. * Copies own symbols of `source` to `object`.
  3550. *
  3551. * @private
  3552. * @param {Object} source The object to copy symbols from.
  3553. * @param {Object} [object={}] The object to copy symbols to.
  3554. * @returns {Object} Returns `object`.
  3555. */
  3556. function copySymbols(source, object) {
  3557. return copyObject(source, getSymbols(source), object);
  3558. }
  3559. //#endregion
  3560. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js
  3561. /**
  3562. * Creates an array of the own and inherited enumerable symbols of `object`.
  3563. *
  3564. * @private
  3565. * @param {Object} object The object to query.
  3566. * @returns {Array} Returns the array of symbols.
  3567. */
  3568. var getSymbolsIn = !Object.getOwnPropertySymbols ? stubArray : function(object) {
  3569. var result = [];
  3570. while (object) {
  3571. arrayPush(result, getSymbols(object));
  3572. object = getPrototype(object);
  3573. }
  3574. return result;
  3575. };
  3576. //#endregion
  3577. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js
  3578. /**
  3579. * Copies own and inherited symbols of `source` to `object`.
  3580. *
  3581. * @private
  3582. * @param {Object} source The object to copy symbols from.
  3583. * @param {Object} [object={}] The object to copy symbols to.
  3584. * @returns {Object} Returns `object`.
  3585. */
  3586. function copySymbolsIn(source, object) {
  3587. return copyObject(source, getSymbolsIn(source), object);
  3588. }
  3589. //#endregion
  3590. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js
  3591. /**
  3592. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3593. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3594. * symbols of `object`.
  3595. *
  3596. * @private
  3597. * @param {Object} object The object to query.
  3598. * @param {Function} keysFunc The function to get the keys of `object`.
  3599. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3600. * @returns {Array} Returns the array of property names and symbols.
  3601. */
  3602. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3603. var result = keysFunc(object);
  3604. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3605. }
  3606. //#endregion
  3607. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js
  3608. /**
  3609. * Creates an array of own enumerable property names and symbols of `object`.
  3610. *
  3611. * @private
  3612. * @param {Object} object The object to query.
  3613. * @returns {Array} Returns the array of property names and symbols.
  3614. */
  3615. function getAllKeys(object) {
  3616. return baseGetAllKeys(object, keys, getSymbols);
  3617. }
  3618. //#endregion
  3619. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js
  3620. /**
  3621. * Creates an array of own and inherited enumerable property names and
  3622. * symbols of `object`.
  3623. *
  3624. * @private
  3625. * @param {Object} object The object to query.
  3626. * @returns {Array} Returns the array of property names and symbols.
  3627. */
  3628. function getAllKeysIn(object) {
  3629. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  3630. }
  3631. //#endregion
  3632. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js
  3633. var DataView = getNative(root, "DataView");
  3634. //#endregion
  3635. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js
  3636. var Promise$1 = getNative(root, "Promise");
  3637. //#endregion
  3638. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Set.js
  3639. var Set$1 = getNative(root, "Set");
  3640. //#endregion
  3641. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js
  3642. /** `Object#toString` result references. */
  3643. var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
  3644. var dataViewTag$3 = "[object DataView]";
  3645. /** Used to detect maps, sets, and weakmaps. */
  3646. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
  3647. /**
  3648. * Gets the `toStringTag` of `value`.
  3649. *
  3650. * @private
  3651. * @param {*} value The value to query.
  3652. * @returns {string} Returns the `toStringTag`.
  3653. */
  3654. var getTag = baseGetTag;
  3655. if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) getTag = function(value) {
  3656. var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  3657. if (ctorString) switch (ctorString) {
  3658. case dataViewCtorString: return dataViewTag$3;
  3659. case mapCtorString: return mapTag$4;
  3660. case promiseCtorString: return promiseTag;
  3661. case setCtorString: return setTag$4;
  3662. case weakMapCtorString: return weakMapTag$1;
  3663. }
  3664. return result;
  3665. };
  3666. var _getTag_default = getTag;
  3667. //#endregion
  3668. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js
  3669. /** Used to check objects for own properties. */
  3670. var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
  3671. /**
  3672. * Initializes an array clone.
  3673. *
  3674. * @private
  3675. * @param {Array} array The array to clone.
  3676. * @returns {Array} Returns the initialized clone.
  3677. */
  3678. function initCloneArray(array) {
  3679. var length = array.length, result = new array.constructor(length);
  3680. if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
  3681. result.index = array.index;
  3682. result.input = array.input;
  3683. }
  3684. return result;
  3685. }
  3686. //#endregion
  3687. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js
  3688. /** Built-in value references. */
  3689. var Uint8Array$1 = root.Uint8Array;
  3690. //#endregion
  3691. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js
  3692. /**
  3693. * Creates a clone of `arrayBuffer`.
  3694. *
  3695. * @private
  3696. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  3697. * @returns {ArrayBuffer} Returns the cloned array buffer.
  3698. */
  3699. function cloneArrayBuffer(arrayBuffer) {
  3700. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  3701. new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
  3702. return result;
  3703. }
  3704. //#endregion
  3705. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js
  3706. /**
  3707. * Creates a clone of `dataView`.
  3708. *
  3709. * @private
  3710. * @param {Object} dataView The data view to clone.
  3711. * @param {boolean} [isDeep] Specify a deep clone.
  3712. * @returns {Object} Returns the cloned data view.
  3713. */
  3714. function cloneDataView(dataView, isDeep) {
  3715. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  3716. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  3717. }
  3718. //#endregion
  3719. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js
  3720. /** Used to match `RegExp` flags from their coerced string values. */
  3721. var reFlags = /\w*$/;
  3722. /**
  3723. * Creates a clone of `regexp`.
  3724. *
  3725. * @private
  3726. * @param {Object} regexp The regexp to clone.
  3727. * @returns {Object} Returns the cloned regexp.
  3728. */
  3729. function cloneRegExp(regexp) {
  3730. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  3731. result.lastIndex = regexp.lastIndex;
  3732. return result;
  3733. }
  3734. //#endregion
  3735. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js
  3736. /** Used to convert symbols to primitives and strings. */
  3737. var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
  3738. /**
  3739. * Creates a clone of the `symbol` object.
  3740. *
  3741. * @private
  3742. * @param {Object} symbol The symbol object to clone.
  3743. * @returns {Object} Returns the cloned symbol object.
  3744. */
  3745. function cloneSymbol(symbol) {
  3746. return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
  3747. }
  3748. //#endregion
  3749. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js
  3750. /**
  3751. * Creates a clone of `typedArray`.
  3752. *
  3753. * @private
  3754. * @param {Object} typedArray The typed array to clone.
  3755. * @param {boolean} [isDeep] Specify a deep clone.
  3756. * @returns {Object} Returns the cloned typed array.
  3757. */
  3758. function cloneTypedArray(typedArray, isDeep) {
  3759. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  3760. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  3761. }
  3762. //#endregion
  3763. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js
  3764. /** `Object#toString` result references. */
  3765. var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
  3766. var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
  3767. /**
  3768. * Initializes an object clone based on its `toStringTag`.
  3769. *
  3770. * **Note:** This function only supports cloning values with tags of
  3771. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  3772. *
  3773. * @private
  3774. * @param {Object} object The object to clone.
  3775. * @param {string} tag The `toStringTag` of the object to clone.
  3776. * @param {boolean} [isDeep] Specify a deep clone.
  3777. * @returns {Object} Returns the initialized clone.
  3778. */
  3779. function initCloneByTag(object, tag, isDeep) {
  3780. var Ctor = object.constructor;
  3781. switch (tag) {
  3782. case arrayBufferTag$2: return cloneArrayBuffer(object);
  3783. case boolTag$2:
  3784. case dateTag$2: return new Ctor(+object);
  3785. case dataViewTag$2: return cloneDataView(object, isDeep);
  3786. case float32Tag$1:
  3787. case float64Tag$1:
  3788. case int8Tag$1:
  3789. case int16Tag$1:
  3790. case int32Tag$1:
  3791. case uint8Tag$1:
  3792. case uint8ClampedTag$1:
  3793. case uint16Tag$1:
  3794. case uint32Tag$1: return cloneTypedArray(object, isDeep);
  3795. case mapTag$3: return new Ctor();
  3796. case numberTag$2:
  3797. case stringTag$2: return new Ctor(object);
  3798. case regexpTag$2: return cloneRegExp(object);
  3799. case setTag$3: return new Ctor();
  3800. case symbolTag$2: return cloneSymbol(object);
  3801. }
  3802. }
  3803. //#endregion
  3804. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js
  3805. /**
  3806. * Initializes an object clone.
  3807. *
  3808. * @private
  3809. * @param {Object} object The object to clone.
  3810. * @returns {Object} Returns the initialized clone.
  3811. */
  3812. function initCloneObject(object) {
  3813. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  3814. }
  3815. //#endregion
  3816. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js
  3817. /** `Object#toString` result references. */
  3818. var mapTag$2 = "[object Map]";
  3819. /**
  3820. * The base implementation of `_.isMap` without Node.js optimizations.
  3821. *
  3822. * @private
  3823. * @param {*} value The value to check.
  3824. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  3825. */
  3826. function baseIsMap(value) {
  3827. return isObjectLike(value) && _getTag_default(value) == mapTag$2;
  3828. }
  3829. //#endregion
  3830. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isMap.js
  3831. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  3832. /**
  3833. * Checks if `value` is classified as a `Map` object.
  3834. *
  3835. * @static
  3836. * @memberOf _
  3837. * @since 4.3.0
  3838. * @category Lang
  3839. * @param {*} value The value to check.
  3840. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  3841. * @example
  3842. *
  3843. * _.isMap(new Map);
  3844. * // => true
  3845. *
  3846. * _.isMap(new WeakMap);
  3847. * // => false
  3848. */
  3849. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  3850. //#endregion
  3851. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js
  3852. /** `Object#toString` result references. */
  3853. var setTag$2 = "[object Set]";
  3854. /**
  3855. * The base implementation of `_.isSet` without Node.js optimizations.
  3856. *
  3857. * @private
  3858. * @param {*} value The value to check.
  3859. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  3860. */
  3861. function baseIsSet(value) {
  3862. return isObjectLike(value) && _getTag_default(value) == setTag$2;
  3863. }
  3864. //#endregion
  3865. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isSet.js
  3866. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  3867. /**
  3868. * Checks if `value` is classified as a `Set` object.
  3869. *
  3870. * @static
  3871. * @memberOf _
  3872. * @since 4.3.0
  3873. * @category Lang
  3874. * @param {*} value The value to check.
  3875. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  3876. * @example
  3877. *
  3878. * _.isSet(new Set);
  3879. * // => true
  3880. *
  3881. * _.isSet(new WeakSet);
  3882. * // => false
  3883. */
  3884. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  3885. //#endregion
  3886. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js
  3887. /** Used to compose bitmasks for cloning. */
  3888. var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
  3889. /** `Object#toString` result references. */
  3890. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
  3891. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  3892. /** Used to identify `toStringTag` values supported by `_.clone`. */
  3893. var cloneableTags = {};
  3894. cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  3895. cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  3896. /**
  3897. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3898. * traversed objects.
  3899. *
  3900. * @private
  3901. * @param {*} value The value to clone.
  3902. * @param {boolean} bitmask The bitmask flags.
  3903. * 1 - Deep clone
  3904. * 2 - Flatten inherited properties
  3905. * 4 - Clone symbols
  3906. * @param {Function} [customizer] The function to customize cloning.
  3907. * @param {string} [key] The key of `value`.
  3908. * @param {Object} [object] The parent object of `value`.
  3909. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3910. * @returns {*} Returns the cloned value.
  3911. */
  3912. function baseClone(value, bitmask, customizer, key, object, stack) {
  3913. var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
  3914. if (customizer) result = object ? customizer(value, key, object, stack) : customizer(value);
  3915. if (result !== void 0) return result;
  3916. if (!isObject(value)) return value;
  3917. var isArr = isArray(value);
  3918. if (isArr) {
  3919. result = initCloneArray(value);
  3920. if (!isDeep) return copyArray(value, result);
  3921. } else {
  3922. var tag = _getTag_default(value), isFunc = tag == funcTag || tag == genTag;
  3923. if (isBuffer(value)) return cloneBuffer(value, isDeep);
  3924. if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
  3925. result = isFlat || isFunc ? {} : initCloneObject(value);
  3926. if (!isDeep) return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
  3927. } else {
  3928. if (!cloneableTags[tag]) return object ? value : {};
  3929. result = initCloneByTag(value, tag, isDeep);
  3930. }
  3931. }
  3932. stack || (stack = new Stack());
  3933. var stacked = stack.get(value);
  3934. if (stacked) return stacked;
  3935. stack.set(value, result);
  3936. if (isSet(value)) value.forEach(function(subValue) {
  3937. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3938. });
  3939. else if (isMap(value)) value.forEach(function(subValue, key) {
  3940. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3941. });
  3942. var props = isArr ? void 0 : (isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys)(value);
  3943. arrayEach(props || value, function(subValue, key) {
  3944. if (props) {
  3945. key = subValue;
  3946. subValue = value[key];
  3947. }
  3948. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3949. });
  3950. return result;
  3951. }
  3952. //#endregion
  3953. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js
  3954. /** Used to compose bitmasks for cloning. */
  3955. var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
  3956. /**
  3957. * This method is like `_.clone` except that it recursively clones `value`.
  3958. *
  3959. * @static
  3960. * @memberOf _
  3961. * @since 1.0.0
  3962. * @category Lang
  3963. * @param {*} value The value to recursively clone.
  3964. * @returns {*} Returns the deep cloned value.
  3965. * @see _.clone
  3966. * @example
  3967. *
  3968. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  3969. *
  3970. * var deep = _.cloneDeep(objects);
  3971. * console.log(deep[0] === objects[0]);
  3972. * // => false
  3973. */
  3974. function cloneDeep(value) {
  3975. return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
  3976. }
  3977. //#endregion
  3978. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js
  3979. /** Used to stand-in for `undefined` hash values. */
  3980. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  3981. /**
  3982. * Adds `value` to the array cache.
  3983. *
  3984. * @private
  3985. * @name add
  3986. * @memberOf SetCache
  3987. * @alias push
  3988. * @param {*} value The value to cache.
  3989. * @returns {Object} Returns the cache instance.
  3990. */
  3991. function setCacheAdd(value) {
  3992. this.__data__.set(value, HASH_UNDEFINED);
  3993. return this;
  3994. }
  3995. //#endregion
  3996. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js
  3997. /**
  3998. * Checks if `value` is in the array cache.
  3999. *
  4000. * @private
  4001. * @name has
  4002. * @memberOf SetCache
  4003. * @param {*} value The value to search for.
  4004. * @returns {number} Returns `true` if `value` is found, else `false`.
  4005. */
  4006. function setCacheHas(value) {
  4007. return this.__data__.has(value);
  4008. }
  4009. //#endregion
  4010. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js
  4011. /**
  4012. *
  4013. * Creates an array cache object to store unique values.
  4014. *
  4015. * @private
  4016. * @constructor
  4017. * @param {Array} [values] The values to cache.
  4018. */
  4019. function SetCache(values) {
  4020. var index = -1, length = values == null ? 0 : values.length;
  4021. this.__data__ = new MapCache();
  4022. while (++index < length) this.add(values[index]);
  4023. }
  4024. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  4025. SetCache.prototype.has = setCacheHas;
  4026. //#endregion
  4027. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js
  4028. /**
  4029. * A specialized version of `_.some` for arrays without support for iteratee
  4030. * shorthands.
  4031. *
  4032. * @private
  4033. * @param {Array} [array] The array to iterate over.
  4034. * @param {Function} predicate The function invoked per iteration.
  4035. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4036. * else `false`.
  4037. */
  4038. function arraySome(array, predicate) {
  4039. var index = -1, length = array == null ? 0 : array.length;
  4040. while (++index < length) if (predicate(array[index], index, array)) return true;
  4041. return false;
  4042. }
  4043. //#endregion
  4044. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js
  4045. /**
  4046. * Checks if a `cache` value for `key` exists.
  4047. *
  4048. * @private
  4049. * @param {Object} cache The cache to query.
  4050. * @param {string} key The key of the entry to check.
  4051. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4052. */
  4053. function cacheHas(cache, key) {
  4054. return cache.has(key);
  4055. }
  4056. //#endregion
  4057. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js
  4058. /** Used to compose bitmasks for value comparisons. */
  4059. var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
  4060. /**
  4061. * A specialized version of `baseIsEqualDeep` for arrays with support for
  4062. * partial deep comparisons.
  4063. *
  4064. * @private
  4065. * @param {Array} array The array to compare.
  4066. * @param {Array} other The other array to compare.
  4067. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4068. * @param {Function} customizer The function to customize comparisons.
  4069. * @param {Function} equalFunc The function to determine equivalents of values.
  4070. * @param {Object} stack Tracks traversed `array` and `other` objects.
  4071. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  4072. */
  4073. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  4074. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
  4075. if (arrLength != othLength && !(isPartial && othLength > arrLength)) return false;
  4076. var arrStacked = stack.get(array);
  4077. var othStacked = stack.get(other);
  4078. if (arrStacked && othStacked) return arrStacked == other && othStacked == array;
  4079. var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
  4080. stack.set(array, other);
  4081. stack.set(other, array);
  4082. while (++index < arrLength) {
  4083. var arrValue = array[index], othValue = other[index];
  4084. if (customizer) var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  4085. if (compared !== void 0) {
  4086. if (compared) continue;
  4087. result = false;
  4088. break;
  4089. }
  4090. if (seen) {
  4091. if (!arraySome(other, function(othValue, othIndex) {
  4092. if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) return seen.push(othIndex);
  4093. })) {
  4094. result = false;
  4095. break;
  4096. }
  4097. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  4098. result = false;
  4099. break;
  4100. }
  4101. }
  4102. stack["delete"](array);
  4103. stack["delete"](other);
  4104. return result;
  4105. }
  4106. //#endregion
  4107. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js
  4108. /**
  4109. * Converts `map` to its key-value pairs.
  4110. *
  4111. * @private
  4112. * @param {Object} map The map to convert.
  4113. * @returns {Array} Returns the key-value pairs.
  4114. */
  4115. function mapToArray(map) {
  4116. var index = -1, result = Array(map.size);
  4117. map.forEach(function(value, key) {
  4118. result[++index] = [key, value];
  4119. });
  4120. return result;
  4121. }
  4122. //#endregion
  4123. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js
  4124. /**
  4125. * Converts `set` to an array of its values.
  4126. *
  4127. * @private
  4128. * @param {Object} set The set to convert.
  4129. * @returns {Array} Returns the values.
  4130. */
  4131. function setToArray(set) {
  4132. var index = -1, result = Array(set.size);
  4133. set.forEach(function(value) {
  4134. result[++index] = value;
  4135. });
  4136. return result;
  4137. }
  4138. //#endregion
  4139. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js
  4140. /** Used to compose bitmasks for value comparisons. */
  4141. var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
  4142. /** `Object#toString` result references. */
  4143. var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
  4144. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
  4145. /** Used to convert symbols to primitives and strings. */
  4146. var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  4147. /**
  4148. * A specialized version of `baseIsEqualDeep` for comparing objects of
  4149. * the same `toStringTag`.
  4150. *
  4151. * **Note:** This function only supports comparing values with tags of
  4152. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  4153. *
  4154. * @private
  4155. * @param {Object} object The object to compare.
  4156. * @param {Object} other The other object to compare.
  4157. * @param {string} tag The `toStringTag` of the objects to compare.
  4158. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4159. * @param {Function} customizer The function to customize comparisons.
  4160. * @param {Function} equalFunc The function to determine equivalents of values.
  4161. * @param {Object} stack Tracks traversed `object` and `other` objects.
  4162. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4163. */
  4164. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  4165. switch (tag) {
  4166. case dataViewTag:
  4167. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) return false;
  4168. object = object.buffer;
  4169. other = other.buffer;
  4170. case arrayBufferTag:
  4171. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) return false;
  4172. return true;
  4173. case boolTag:
  4174. case dateTag:
  4175. case numberTag: return eq(+object, +other);
  4176. case errorTag: return object.name == other.name && object.message == other.message;
  4177. case regexpTag:
  4178. case stringTag: return object == other + "";
  4179. case mapTag: var convert = mapToArray;
  4180. case setTag:
  4181. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
  4182. convert || (convert = setToArray);
  4183. if (object.size != other.size && !isPartial) return false;
  4184. var stacked = stack.get(object);
  4185. if (stacked) return stacked == other;
  4186. bitmask |= COMPARE_UNORDERED_FLAG$2;
  4187. stack.set(object, other);
  4188. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  4189. stack["delete"](object);
  4190. return result;
  4191. case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
  4192. }
  4193. return false;
  4194. }
  4195. //#endregion
  4196. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js
  4197. /** Used to compose bitmasks for value comparisons. */
  4198. var COMPARE_PARTIAL_FLAG$3 = 1;
  4199. /** Used to check objects for own properties. */
  4200. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  4201. /**
  4202. * A specialized version of `baseIsEqualDeep` for objects with support for
  4203. * partial deep comparisons.
  4204. *
  4205. * @private
  4206. * @param {Object} object The object to compare.
  4207. * @param {Object} other The other object to compare.
  4208. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4209. * @param {Function} customizer The function to customize comparisons.
  4210. * @param {Function} equalFunc The function to determine equivalents of values.
  4211. * @param {Object} stack Tracks traversed `object` and `other` objects.
  4212. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4213. */
  4214. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  4215. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length;
  4216. if (objLength != getAllKeys(other).length && !isPartial) return false;
  4217. var index = objLength;
  4218. while (index--) {
  4219. var key = objProps[index];
  4220. if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) return false;
  4221. }
  4222. var objStacked = stack.get(object);
  4223. var othStacked = stack.get(other);
  4224. if (objStacked && othStacked) return objStacked == other && othStacked == object;
  4225. var result = true;
  4226. stack.set(object, other);
  4227. stack.set(other, object);
  4228. var skipCtor = isPartial;
  4229. while (++index < objLength) {
  4230. key = objProps[index];
  4231. var objValue = object[key], othValue = other[key];
  4232. if (customizer) var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  4233. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  4234. result = false;
  4235. break;
  4236. }
  4237. skipCtor || (skipCtor = key == "constructor");
  4238. }
  4239. if (result && !skipCtor) {
  4240. var objCtor = object.constructor, othCtor = other.constructor;
  4241. if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) result = false;
  4242. }
  4243. stack["delete"](object);
  4244. stack["delete"](other);
  4245. return result;
  4246. }
  4247. //#endregion
  4248. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js
  4249. /** Used to compose bitmasks for value comparisons. */
  4250. var COMPARE_PARTIAL_FLAG$2 = 1;
  4251. /** `Object#toString` result references. */
  4252. var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  4253. /** Used to check objects for own properties. */
  4254. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  4255. /**
  4256. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4257. * deep comparisons and tracks traversed objects enabling objects with circular
  4258. * references to be compared.
  4259. *
  4260. * @private
  4261. * @param {Object} object The object to compare.
  4262. * @param {Object} other The other object to compare.
  4263. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4264. * @param {Function} customizer The function to customize comparisons.
  4265. * @param {Function} equalFunc The function to determine equivalents of values.
  4266. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4267. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4268. */
  4269. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4270. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : _getTag_default(object), othTag = othIsArr ? arrayTag : _getTag_default(other);
  4271. objTag = objTag == argsTag ? objectTag : objTag;
  4272. othTag = othTag == argsTag ? objectTag : othTag;
  4273. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  4274. if (isSameTag && isBuffer(object)) {
  4275. if (!isBuffer(other)) return false;
  4276. objIsArr = true;
  4277. objIsObj = false;
  4278. }
  4279. if (isSameTag && !objIsObj) {
  4280. stack || (stack = new Stack());
  4281. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4282. }
  4283. if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
  4284. var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
  4285. if (objIsWrapped || othIsWrapped) {
  4286. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  4287. stack || (stack = new Stack());
  4288. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4289. }
  4290. }
  4291. if (!isSameTag) return false;
  4292. stack || (stack = new Stack());
  4293. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4294. }
  4295. //#endregion
  4296. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js
  4297. /**
  4298. * The base implementation of `_.isEqual` which supports partial comparisons
  4299. * and tracks traversed objects.
  4300. *
  4301. * @private
  4302. * @param {*} value The value to compare.
  4303. * @param {*} other The other value to compare.
  4304. * @param {boolean} bitmask The bitmask flags.
  4305. * 1 - Unordered comparison
  4306. * 2 - Partial comparison
  4307. * @param {Function} [customizer] The function to customize comparisons.
  4308. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4309. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4310. */
  4311. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4312. if (value === other) return true;
  4313. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) return value !== value && other !== other;
  4314. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4315. }
  4316. //#endregion
  4317. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js
  4318. /** Used to compose bitmasks for value comparisons. */
  4319. var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  4320. /**
  4321. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4322. *
  4323. * @private
  4324. * @param {Object} object The object to inspect.
  4325. * @param {Object} source The object of property values to match.
  4326. * @param {Array} matchData The property names, values, and compare flags to match.
  4327. * @param {Function} [customizer] The function to customize comparisons.
  4328. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4329. */
  4330. function baseIsMatch(object, source, matchData, customizer) {
  4331. var index = matchData.length, length = index, noCustomizer = !customizer;
  4332. if (object == null) return !length;
  4333. object = Object(object);
  4334. while (index--) {
  4335. var data = matchData[index];
  4336. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) return false;
  4337. }
  4338. while (++index < length) {
  4339. data = matchData[index];
  4340. var key = data[0], objValue = object[key], srcValue = data[1];
  4341. if (noCustomizer && data[2]) {
  4342. if (objValue === void 0 && !(key in object)) return false;
  4343. } else {
  4344. var stack = new Stack();
  4345. if (customizer) var result = customizer(objValue, srcValue, key, object, source, stack);
  4346. if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) return false;
  4347. }
  4348. }
  4349. return true;
  4350. }
  4351. //#endregion
  4352. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js
  4353. /**
  4354. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  4355. *
  4356. * @private
  4357. * @param {*} value The value to check.
  4358. * @returns {boolean} Returns `true` if `value` if suitable for strict
  4359. * equality comparisons, else `false`.
  4360. */
  4361. function isStrictComparable(value) {
  4362. return value === value && !isObject(value);
  4363. }
  4364. //#endregion
  4365. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js
  4366. /**
  4367. * Gets the property names, values, and compare flags of `object`.
  4368. *
  4369. * @private
  4370. * @param {Object} object The object to query.
  4371. * @returns {Array} Returns the match data of `object`.
  4372. */
  4373. function getMatchData(object) {
  4374. var result = keys(object), length = result.length;
  4375. while (length--) {
  4376. var key = result[length], value = object[key];
  4377. result[length] = [
  4378. key,
  4379. value,
  4380. isStrictComparable(value)
  4381. ];
  4382. }
  4383. return result;
  4384. }
  4385. //#endregion
  4386. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js
  4387. /**
  4388. * A specialized version of `matchesProperty` for source values suitable
  4389. * for strict equality comparisons, i.e. `===`.
  4390. *
  4391. * @private
  4392. * @param {string} key The key of the property to get.
  4393. * @param {*} srcValue The value to match.
  4394. * @returns {Function} Returns the new spec function.
  4395. */
  4396. function matchesStrictComparable(key, srcValue) {
  4397. return function(object) {
  4398. if (object == null) return false;
  4399. return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
  4400. };
  4401. }
  4402. //#endregion
  4403. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js
  4404. /**
  4405. * The base implementation of `_.matches` which doesn't clone `source`.
  4406. *
  4407. * @private
  4408. * @param {Object} source The object of property values to match.
  4409. * @returns {Function} Returns the new spec function.
  4410. */
  4411. function baseMatches(source) {
  4412. var matchData = getMatchData(source);
  4413. if (matchData.length == 1 && matchData[0][2]) return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4414. return function(object) {
  4415. return object === source || baseIsMatch(object, source, matchData);
  4416. };
  4417. }
  4418. //#endregion
  4419. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js
  4420. /**
  4421. * The base implementation of `_.hasIn` without support for deep paths.
  4422. *
  4423. * @private
  4424. * @param {Object} [object] The object to query.
  4425. * @param {Array|string} key The key to check.
  4426. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4427. */
  4428. function baseHasIn(object, key) {
  4429. return object != null && key in Object(object);
  4430. }
  4431. //#endregion
  4432. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js
  4433. /**
  4434. * Checks if `path` exists on `object`.
  4435. *
  4436. * @private
  4437. * @param {Object} object The object to query.
  4438. * @param {Array|string} path The path to check.
  4439. * @param {Function} hasFunc The function to check properties.
  4440. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  4441. */
  4442. function hasPath(object, path, hasFunc) {
  4443. path = castPath(path, object);
  4444. var index = -1, length = path.length, result = false;
  4445. while (++index < length) {
  4446. var key = toKey(path[index]);
  4447. if (!(result = object != null && hasFunc(object, key))) break;
  4448. object = object[key];
  4449. }
  4450. if (result || ++index != length) return result;
  4451. length = object == null ? 0 : object.length;
  4452. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  4453. }
  4454. //#endregion
  4455. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js
  4456. /**
  4457. * Checks if `path` is a direct or inherited property of `object`.
  4458. *
  4459. * @static
  4460. * @memberOf _
  4461. * @since 4.0.0
  4462. * @category Object
  4463. * @param {Object} object The object to query.
  4464. * @param {Array|string} path The path to check.
  4465. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  4466. * @example
  4467. *
  4468. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  4469. *
  4470. * _.hasIn(object, 'a');
  4471. * // => true
  4472. *
  4473. * _.hasIn(object, 'a.b');
  4474. * // => true
  4475. *
  4476. * _.hasIn(object, ['a', 'b']);
  4477. * // => true
  4478. *
  4479. * _.hasIn(object, 'b');
  4480. * // => false
  4481. */
  4482. function hasIn(object, path) {
  4483. return object != null && hasPath(object, path, baseHasIn);
  4484. }
  4485. //#endregion
  4486. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js
  4487. /** Used to compose bitmasks for value comparisons. */
  4488. var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
  4489. /**
  4490. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4491. *
  4492. * @private
  4493. * @param {string} path The path of the property to get.
  4494. * @param {*} srcValue The value to match.
  4495. * @returns {Function} Returns the new spec function.
  4496. */
  4497. function baseMatchesProperty(path, srcValue) {
  4498. if (isKey(path) && isStrictComparable(srcValue)) return matchesStrictComparable(toKey(path), srcValue);
  4499. return function(object) {
  4500. var objValue = get(object, path);
  4501. return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4502. };
  4503. }
  4504. //#endregion
  4505. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js
  4506. /**
  4507. * The base implementation of `_.property` without support for deep paths.
  4508. *
  4509. * @private
  4510. * @param {string} key The key of the property to get.
  4511. * @returns {Function} Returns the new accessor function.
  4512. */
  4513. function baseProperty(key) {
  4514. return function(object) {
  4515. return object == null ? void 0 : object[key];
  4516. };
  4517. }
  4518. //#endregion
  4519. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js
  4520. /**
  4521. * A specialized version of `baseProperty` which supports deep paths.
  4522. *
  4523. * @private
  4524. * @param {Array|string} path The path of the property to get.
  4525. * @returns {Function} Returns the new accessor function.
  4526. */
  4527. function basePropertyDeep(path) {
  4528. return function(object) {
  4529. return baseGet(object, path);
  4530. };
  4531. }
  4532. //#endregion
  4533. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/property.js
  4534. /**
  4535. * Creates a function that returns the value at `path` of a given object.
  4536. *
  4537. * @static
  4538. * @memberOf _
  4539. * @since 2.4.0
  4540. * @category Util
  4541. * @param {Array|string} path The path of the property to get.
  4542. * @returns {Function} Returns the new accessor function.
  4543. * @example
  4544. *
  4545. * var objects = [
  4546. * { 'a': { 'b': 2 } },
  4547. * { 'a': { 'b': 1 } }
  4548. * ];
  4549. *
  4550. * _.map(objects, _.property('a.b'));
  4551. * // => [2, 1]
  4552. *
  4553. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  4554. * // => [1, 2]
  4555. */
  4556. function property(path) {
  4557. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  4558. }
  4559. //#endregion
  4560. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js
  4561. /**
  4562. * The base implementation of `_.iteratee`.
  4563. *
  4564. * @private
  4565. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4566. * @returns {Function} Returns the iteratee.
  4567. */
  4568. function baseIteratee(value) {
  4569. if (typeof value == "function") return value;
  4570. if (value == null) return identity;
  4571. if (typeof value == "object") return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  4572. return property(value);
  4573. }
  4574. //#endregion
  4575. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js
  4576. /**
  4577. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  4578. *
  4579. * @private
  4580. * @param {boolean} [fromRight] Specify iterating from right to left.
  4581. * @returns {Function} Returns the new base function.
  4582. */
  4583. function createBaseFor(fromRight) {
  4584. return function(object, iteratee, keysFunc) {
  4585. var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
  4586. while (length--) {
  4587. var key = props[fromRight ? length : ++index];
  4588. if (iteratee(iterable[key], key, iterable) === false) break;
  4589. }
  4590. return object;
  4591. };
  4592. }
  4593. //#endregion
  4594. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js
  4595. /**
  4596. * The base implementation of `baseForOwn` which iterates over `object`
  4597. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4598. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4599. *
  4600. * @private
  4601. * @param {Object} object The object to iterate over.
  4602. * @param {Function} iteratee The function invoked per iteration.
  4603. * @param {Function} keysFunc The function to get the keys of `object`.
  4604. * @returns {Object} Returns `object`.
  4605. */
  4606. var baseFor = createBaseFor();
  4607. //#endregion
  4608. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseForOwn.js
  4609. /**
  4610. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4611. *
  4612. * @private
  4613. * @param {Object} object The object to iterate over.
  4614. * @param {Function} iteratee The function invoked per iteration.
  4615. * @returns {Object} Returns `object`.
  4616. */
  4617. function baseForOwn(object, iteratee) {
  4618. return object && baseFor(object, iteratee, keys);
  4619. }
  4620. //#endregion
  4621. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createBaseEach.js
  4622. /**
  4623. * Creates a `baseEach` or `baseEachRight` function.
  4624. *
  4625. * @private
  4626. * @param {Function} eachFunc The function to iterate over a collection.
  4627. * @param {boolean} [fromRight] Specify iterating from right to left.
  4628. * @returns {Function} Returns the new base function.
  4629. */
  4630. function createBaseEach(eachFunc, fromRight) {
  4631. return function(collection, iteratee) {
  4632. if (collection == null) return collection;
  4633. if (!isArrayLike(collection)) return eachFunc(collection, iteratee);
  4634. var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
  4635. while (fromRight ? index-- : ++index < length) if (iteratee(iterable[index], index, iterable) === false) break;
  4636. return collection;
  4637. };
  4638. }
  4639. //#endregion
  4640. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseEach.js
  4641. /**
  4642. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4643. *
  4644. * @private
  4645. * @param {Array|Object} collection The collection to iterate over.
  4646. * @param {Function} iteratee The function invoked per iteration.
  4647. * @returns {Array|Object} Returns `collection`.
  4648. */
  4649. var baseEach = createBaseEach(baseForOwn);
  4650. //#endregion
  4651. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/now.js
  4652. /**
  4653. * Gets the timestamp of the number of milliseconds that have elapsed since
  4654. * the Unix epoch (1 January 1970 00:00:00 UTC).
  4655. *
  4656. * @static
  4657. * @memberOf _
  4658. * @since 2.4.0
  4659. * @category Date
  4660. * @returns {number} Returns the timestamp.
  4661. * @example
  4662. *
  4663. * _.defer(function(stamp) {
  4664. * console.log(_.now() - stamp);
  4665. * }, _.now());
  4666. * // => Logs the number of milliseconds it took for the deferred invocation.
  4667. */
  4668. var now = function() {
  4669. return root.Date.now();
  4670. };
  4671. //#endregion
  4672. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/debounce.js
  4673. /** Error message constants. */
  4674. var FUNC_ERROR_TEXT$1 = "Expected a function";
  4675. var nativeMax$1 = Math.max, nativeMin$1 = Math.min;
  4676. /**
  4677. * Creates a debounced function that delays invoking `func` until after `wait`
  4678. * milliseconds have elapsed since the last time the debounced function was
  4679. * invoked. The debounced function comes with a `cancel` method to cancel
  4680. * delayed `func` invocations and a `flush` method to immediately invoke them.
  4681. * Provide `options` to indicate whether `func` should be invoked on the
  4682. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  4683. * with the last arguments provided to the debounced function. Subsequent
  4684. * calls to the debounced function return the result of the last `func`
  4685. * invocation.
  4686. *
  4687. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  4688. * invoked on the trailing edge of the timeout only if the debounced function
  4689. * is invoked more than once during the `wait` timeout.
  4690. *
  4691. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  4692. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  4693. *
  4694. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  4695. * for details over the differences between `_.debounce` and `_.throttle`.
  4696. *
  4697. * @static
  4698. * @memberOf _
  4699. * @since 0.1.0
  4700. * @category Function
  4701. * @param {Function} func The function to debounce.
  4702. * @param {number} [wait=0] The number of milliseconds to delay.
  4703. * @param {Object} [options={}] The options object.
  4704. * @param {boolean} [options.leading=false]
  4705. * Specify invoking on the leading edge of the timeout.
  4706. * @param {number} [options.maxWait]
  4707. * The maximum time `func` is allowed to be delayed before it's invoked.
  4708. * @param {boolean} [options.trailing=true]
  4709. * Specify invoking on the trailing edge of the timeout.
  4710. * @returns {Function} Returns the new debounced function.
  4711. * @example
  4712. *
  4713. * // Avoid costly calculations while the window size is in flux.
  4714. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  4715. *
  4716. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  4717. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  4718. * 'leading': true,
  4719. * 'trailing': false
  4720. * }));
  4721. *
  4722. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  4723. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  4724. * var source = new EventSource('/stream');
  4725. * jQuery(source).on('message', debounced);
  4726. *
  4727. * // Cancel the trailing debounced invocation.
  4728. * jQuery(window).on('popstate', debounced.cancel);
  4729. */
  4730. function debounce(func, wait, options) {
  4731. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  4732. if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT$1);
  4733. wait = toNumber(wait) || 0;
  4734. if (isObject(options)) {
  4735. leading = !!options.leading;
  4736. maxing = "maxWait" in options;
  4737. maxWait = maxing ? nativeMax$1(toNumber(options.maxWait) || 0, wait) : maxWait;
  4738. trailing = "trailing" in options ? !!options.trailing : trailing;
  4739. }
  4740. function invokeFunc(time) {
  4741. var args = lastArgs, thisArg = lastThis;
  4742. lastArgs = lastThis = void 0;
  4743. lastInvokeTime = time;
  4744. result = func.apply(thisArg, args);
  4745. return result;
  4746. }
  4747. function leadingEdge(time) {
  4748. lastInvokeTime = time;
  4749. timerId = setTimeout(timerExpired, wait);
  4750. return leading ? invokeFunc(time) : result;
  4751. }
  4752. function remainingWait(time) {
  4753. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  4754. return maxing ? nativeMin$1(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  4755. }
  4756. function shouldInvoke(time) {
  4757. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  4758. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  4759. }
  4760. function timerExpired() {
  4761. var time = now();
  4762. if (shouldInvoke(time)) return trailingEdge(time);
  4763. timerId = setTimeout(timerExpired, remainingWait(time));
  4764. }
  4765. function trailingEdge(time) {
  4766. timerId = void 0;
  4767. if (trailing && lastArgs) return invokeFunc(time);
  4768. lastArgs = lastThis = void 0;
  4769. return result;
  4770. }
  4771. function cancel() {
  4772. if (timerId !== void 0) clearTimeout(timerId);
  4773. lastInvokeTime = 0;
  4774. lastArgs = lastCallTime = lastThis = timerId = void 0;
  4775. }
  4776. function flush() {
  4777. return timerId === void 0 ? result : trailingEdge(now());
  4778. }
  4779. function debounced() {
  4780. var time = now(), isInvoking = shouldInvoke(time);
  4781. lastArgs = arguments;
  4782. lastThis = this;
  4783. lastCallTime = time;
  4784. if (isInvoking) {
  4785. if (timerId === void 0) return leadingEdge(lastCallTime);
  4786. if (maxing) {
  4787. clearTimeout(timerId);
  4788. timerId = setTimeout(timerExpired, wait);
  4789. return invokeFunc(lastCallTime);
  4790. }
  4791. }
  4792. if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
  4793. return result;
  4794. }
  4795. debounced.cancel = cancel;
  4796. debounced.flush = flush;
  4797. return debounced;
  4798. }
  4799. //#endregion
  4800. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js
  4801. /**
  4802. * This function is like `assignValue` except that it doesn't assign
  4803. * `undefined` values.
  4804. *
  4805. * @private
  4806. * @param {Object} object The object to modify.
  4807. * @param {string} key The key of the property to assign.
  4808. * @param {*} value The value to assign.
  4809. */
  4810. function assignMergeValue(object, key, value) {
  4811. if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
  4812. }
  4813. //#endregion
  4814. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js
  4815. /**
  4816. * This method is like `_.isArrayLike` except that it also checks if `value`
  4817. * is an object.
  4818. *
  4819. * @static
  4820. * @memberOf _
  4821. * @since 4.0.0
  4822. * @category Lang
  4823. * @param {*} value The value to check.
  4824. * @returns {boolean} Returns `true` if `value` is an array-like object,
  4825. * else `false`.
  4826. * @example
  4827. *
  4828. * _.isArrayLikeObject([1, 2, 3]);
  4829. * // => true
  4830. *
  4831. * _.isArrayLikeObject(document.body.children);
  4832. * // => true
  4833. *
  4834. * _.isArrayLikeObject('abc');
  4835. * // => false
  4836. *
  4837. * _.isArrayLikeObject(_.noop);
  4838. * // => false
  4839. */
  4840. function isArrayLikeObject(value) {
  4841. return isObjectLike(value) && isArrayLike(value);
  4842. }
  4843. //#endregion
  4844. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js
  4845. /**
  4846. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  4847. *
  4848. * @private
  4849. * @param {Object} object The object to query.
  4850. * @param {string} key The key of the property to get.
  4851. * @returns {*} Returns the property value.
  4852. */
  4853. function safeGet(object, key) {
  4854. if (key === "constructor" && typeof object[key] === "function") return;
  4855. if (key == "__proto__") return;
  4856. return object[key];
  4857. }
  4858. //#endregion
  4859. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js
  4860. /**
  4861. * Converts `value` to a plain object flattening inherited enumerable string
  4862. * keyed properties of `value` to own properties of the plain object.
  4863. *
  4864. * @static
  4865. * @memberOf _
  4866. * @since 3.0.0
  4867. * @category Lang
  4868. * @param {*} value The value to convert.
  4869. * @returns {Object} Returns the converted plain object.
  4870. * @example
  4871. *
  4872. * function Foo() {
  4873. * this.b = 2;
  4874. * }
  4875. *
  4876. * Foo.prototype.c = 3;
  4877. *
  4878. * _.assign({ 'a': 1 }, new Foo);
  4879. * // => { 'a': 1, 'b': 2 }
  4880. *
  4881. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  4882. * // => { 'a': 1, 'b': 2, 'c': 3 }
  4883. */
  4884. function toPlainObject(value) {
  4885. return copyObject(value, keysIn(value));
  4886. }
  4887. //#endregion
  4888. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js
  4889. /**
  4890. * A specialized version of `baseMerge` for arrays and objects which performs
  4891. * deep merges and tracks traversed objects enabling objects with circular
  4892. * references to be merged.
  4893. *
  4894. * @private
  4895. * @param {Object} object The destination object.
  4896. * @param {Object} source The source object.
  4897. * @param {string} key The key of the value to merge.
  4898. * @param {number} srcIndex The index of `source`.
  4899. * @param {Function} mergeFunc The function to merge values.
  4900. * @param {Function} [customizer] The function to customize assigned values.
  4901. * @param {Object} [stack] Tracks traversed source values and their merged
  4902. * counterparts.
  4903. */
  4904. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4905. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
  4906. if (stacked) {
  4907. assignMergeValue(object, key, stacked);
  4908. return;
  4909. }
  4910. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
  4911. var isCommon = newValue === void 0;
  4912. if (isCommon) {
  4913. var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4914. newValue = srcValue;
  4915. if (isArr || isBuff || isTyped) if (isArray(objValue)) newValue = objValue;
  4916. else if (isArrayLikeObject(objValue)) newValue = copyArray(objValue);
  4917. else if (isBuff) {
  4918. isCommon = false;
  4919. newValue = cloneBuffer(srcValue, true);
  4920. } else if (isTyped) {
  4921. isCommon = false;
  4922. newValue = cloneTypedArray(srcValue, true);
  4923. } else newValue = [];
  4924. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4925. newValue = objValue;
  4926. if (isArguments(objValue)) newValue = toPlainObject(objValue);
  4927. else if (!isObject(objValue) || isFunction(objValue)) newValue = initCloneObject(srcValue);
  4928. } else isCommon = false;
  4929. }
  4930. if (isCommon) {
  4931. stack.set(srcValue, newValue);
  4932. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4933. stack["delete"](srcValue);
  4934. }
  4935. assignMergeValue(object, key, newValue);
  4936. }
  4937. //#endregion
  4938. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js
  4939. /**
  4940. * The base implementation of `_.merge` without support for multiple sources.
  4941. *
  4942. * @private
  4943. * @param {Object} object The destination object.
  4944. * @param {Object} source The source object.
  4945. * @param {number} srcIndex The index of `source`.
  4946. * @param {Function} [customizer] The function to customize merged values.
  4947. * @param {Object} [stack] Tracks traversed source values and their merged
  4948. * counterparts.
  4949. */
  4950. function baseMerge(object, source, srcIndex, customizer, stack) {
  4951. if (object === source) return;
  4952. baseFor(source, function(srcValue, key) {
  4953. stack || (stack = new Stack());
  4954. if (isObject(srcValue)) baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4955. else {
  4956. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
  4957. if (newValue === void 0) newValue = srcValue;
  4958. assignMergeValue(object, key, newValue);
  4959. }
  4960. }, keysIn);
  4961. }
  4962. //#endregion
  4963. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js
  4964. /**
  4965. * This function is like `arrayIncludes` except that it accepts a comparator.
  4966. *
  4967. * @private
  4968. * @param {Array} [array] The array to inspect.
  4969. * @param {*} target The value to search for.
  4970. * @param {Function} comparator The comparator invoked per element.
  4971. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4972. */
  4973. function arrayIncludesWith(array, value, comparator) {
  4974. var index = -1, length = array == null ? 0 : array.length;
  4975. while (++index < length) if (comparator(value, array[index])) return true;
  4976. return false;
  4977. }
  4978. //#endregion
  4979. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/last.js
  4980. /**
  4981. * Gets the last element of `array`.
  4982. *
  4983. * @static
  4984. * @memberOf _
  4985. * @since 0.1.0
  4986. * @category Array
  4987. * @param {Array} array The array to query.
  4988. * @returns {*} Returns the last element of `array`.
  4989. * @example
  4990. *
  4991. * _.last([1, 2, 3]);
  4992. * // => 3
  4993. */
  4994. function last(array) {
  4995. var length = array == null ? 0 : array.length;
  4996. return length ? array[length - 1] : void 0;
  4997. }
  4998. //#endregion
  4999. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/findLastIndex.js
  5000. var nativeMax = Math.max, nativeMin = Math.min;
  5001. /**
  5002. * This method is like `_.findIndex` except that it iterates over elements
  5003. * of `collection` from right to left.
  5004. *
  5005. * @static
  5006. * @memberOf _
  5007. * @since 2.0.0
  5008. * @category Array
  5009. * @param {Array} array The array to inspect.
  5010. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  5011. * @param {number} [fromIndex=array.length-1] The index to search from.
  5012. * @returns {number} Returns the index of the found element, else `-1`.
  5013. * @example
  5014. *
  5015. * var users = [
  5016. * { 'user': 'barney', 'active': true },
  5017. * { 'user': 'fred', 'active': false },
  5018. * { 'user': 'pebbles', 'active': false }
  5019. * ];
  5020. *
  5021. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  5022. * // => 2
  5023. *
  5024. * // The `_.matches` iteratee shorthand.
  5025. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  5026. * // => 0
  5027. *
  5028. * // The `_.matchesProperty` iteratee shorthand.
  5029. * _.findLastIndex(users, ['active', false]);
  5030. * // => 2
  5031. *
  5032. * // The `_.property` iteratee shorthand.
  5033. * _.findLastIndex(users, 'active');
  5034. * // => 0
  5035. */
  5036. function findLastIndex(array, predicate, fromIndex) {
  5037. var length = array == null ? 0 : array.length;
  5038. if (!length) return -1;
  5039. var index = length - 1;
  5040. if (fromIndex !== void 0) {
  5041. index = toInteger(fromIndex);
  5042. index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  5043. }
  5044. return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
  5045. }
  5046. //#endregion
  5047. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMap.js
  5048. /**
  5049. * The base implementation of `_.map` without support for iteratee shorthands.
  5050. *
  5051. * @private
  5052. * @param {Array|Object} collection The collection to iterate over.
  5053. * @param {Function} iteratee The function invoked per iteration.
  5054. * @returns {Array} Returns the new mapped array.
  5055. */
  5056. function baseMap(collection, iteratee) {
  5057. var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
  5058. baseEach(collection, function(value, key, collection) {
  5059. result[++index] = iteratee(value, key, collection);
  5060. });
  5061. return result;
  5062. }
  5063. //#endregion
  5064. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/map.js
  5065. /**
  5066. * Creates an array of values by running each element in `collection` thru
  5067. * `iteratee`. The iteratee is invoked with three arguments:
  5068. * (value, index|key, collection).
  5069. *
  5070. * Many lodash methods are guarded to work as iteratees for methods like
  5071. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  5072. *
  5073. * The guarded methods are:
  5074. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  5075. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  5076. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  5077. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  5078. *
  5079. * @static
  5080. * @memberOf _
  5081. * @since 0.1.0
  5082. * @category Collection
  5083. * @param {Array|Object} collection The collection to iterate over.
  5084. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  5085. * @returns {Array} Returns the new mapped array.
  5086. * @example
  5087. *
  5088. * function square(n) {
  5089. * return n * n;
  5090. * }
  5091. *
  5092. * _.map([4, 8], square);
  5093. * // => [16, 64]
  5094. *
  5095. * _.map({ 'a': 4, 'b': 8 }, square);
  5096. * // => [16, 64] (iteration order is not guaranteed)
  5097. *
  5098. * var users = [
  5099. * { 'user': 'barney' },
  5100. * { 'user': 'fred' }
  5101. * ];
  5102. *
  5103. * // The `_.property` iteratee shorthand.
  5104. * _.map(users, 'user');
  5105. * // => ['barney', 'fred']
  5106. */
  5107. function map(collection, iteratee) {
  5108. return (isArray(collection) ? arrayMap : baseMap)(collection, baseIteratee(iteratee, 3));
  5109. }
  5110. //#endregion
  5111. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flatMap.js
  5112. /**
  5113. * Creates a flattened array of values by running each element in `collection`
  5114. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  5115. * with three arguments: (value, index|key, collection).
  5116. *
  5117. * @static
  5118. * @memberOf _
  5119. * @since 4.0.0
  5120. * @category Collection
  5121. * @param {Array|Object} collection The collection to iterate over.
  5122. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  5123. * @returns {Array} Returns the new flattened array.
  5124. * @example
  5125. *
  5126. * function duplicate(n) {
  5127. * return [n, n];
  5128. * }
  5129. *
  5130. * _.flatMap([1, 2], duplicate);
  5131. * // => [1, 1, 2, 2]
  5132. */
  5133. function flatMap(collection, iteratee) {
  5134. return baseFlatten(map(collection, iteratee), 1);
  5135. }
  5136. //#endregion
  5137. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flattenDeep.js
  5138. /** Used as references for various `Number` constants. */
  5139. var INFINITY = Infinity;
  5140. /**
  5141. * Recursively flattens `array`.
  5142. *
  5143. * @static
  5144. * @memberOf _
  5145. * @since 3.0.0
  5146. * @category Array
  5147. * @param {Array} array The array to flatten.
  5148. * @returns {Array} Returns the new flattened array.
  5149. * @example
  5150. *
  5151. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  5152. * // => [1, 2, 3, 4, 5]
  5153. */
  5154. function flattenDeep(array) {
  5155. return (array == null ? 0 : array.length) ? baseFlatten(array, INFINITY) : [];
  5156. }
  5157. //#endregion
  5158. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/fromPairs.js
  5159. /**
  5160. * The inverse of `_.toPairs`; this method returns an object composed
  5161. * from key-value `pairs`.
  5162. *
  5163. * @static
  5164. * @memberOf _
  5165. * @since 4.0.0
  5166. * @category Array
  5167. * @param {Array} pairs The key-value pairs.
  5168. * @returns {Object} Returns the new object.
  5169. * @example
  5170. *
  5171. * _.fromPairs([['a', 1], ['b', 2]]);
  5172. * // => { 'a': 1, 'b': 2 }
  5173. */
  5174. function fromPairs(pairs) {
  5175. var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
  5176. while (++index < length) {
  5177. var pair = pairs[index];
  5178. result[pair[0]] = pair[1];
  5179. }
  5180. return result;
  5181. }
  5182. //#endregion
  5183. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_parent.js
  5184. /**
  5185. * Gets the parent value at `path` of `object`.
  5186. *
  5187. * @private
  5188. * @param {Object} object The object to query.
  5189. * @param {Array} path The path to get the parent value of.
  5190. * @returns {*} Returns the parent value.
  5191. */
  5192. function parent(object, path) {
  5193. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  5194. }
  5195. //#endregion
  5196. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js
  5197. /**
  5198. * Performs a deep comparison between two values to determine if they are
  5199. * equivalent.
  5200. *
  5201. * **Note:** This method supports comparing arrays, array buffers, booleans,
  5202. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  5203. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  5204. * by their own, not inherited, enumerable properties. Functions and DOM
  5205. * nodes are compared by strict equality, i.e. `===`.
  5206. *
  5207. * @static
  5208. * @memberOf _
  5209. * @since 0.1.0
  5210. * @category Lang
  5211. * @param {*} value The value to compare.
  5212. * @param {*} other The other value to compare.
  5213. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5214. * @example
  5215. *
  5216. * var object = { 'a': 1 };
  5217. * var other = { 'a': 1 };
  5218. *
  5219. * _.isEqual(object, other);
  5220. * // => true
  5221. *
  5222. * object === other;
  5223. * // => false
  5224. */
  5225. function isEqual$1(value, other) {
  5226. return baseIsEqual(value, other);
  5227. }
  5228. //#endregion
  5229. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isNil.js
  5230. /**
  5231. * Checks if `value` is `null` or `undefined`.
  5232. *
  5233. * @static
  5234. * @memberOf _
  5235. * @since 4.0.0
  5236. * @category Lang
  5237. * @param {*} value The value to check.
  5238. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  5239. * @example
  5240. *
  5241. * _.isNil(null);
  5242. * // => true
  5243. *
  5244. * _.isNil(void 0);
  5245. * // => true
  5246. *
  5247. * _.isNil(NaN);
  5248. * // => false
  5249. */
  5250. function isNil(value) {
  5251. return value == null;
  5252. }
  5253. //#endregion
  5254. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isNull.js
  5255. /**
  5256. * Checks if `value` is `null`.
  5257. *
  5258. * @static
  5259. * @memberOf _
  5260. * @since 0.1.0
  5261. * @category Lang
  5262. * @param {*} value The value to check.
  5263. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  5264. * @example
  5265. *
  5266. * _.isNull(null);
  5267. * // => true
  5268. *
  5269. * _.isNull(void 0);
  5270. * // => false
  5271. */
  5272. function isNull(value) {
  5273. return value === null;
  5274. }
  5275. //#endregion
  5276. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isUndefined.js
  5277. /**
  5278. * Checks if `value` is `undefined`.
  5279. *
  5280. * @static
  5281. * @since 0.1.0
  5282. * @memberOf _
  5283. * @category Lang
  5284. * @param {*} value The value to check.
  5285. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  5286. * @example
  5287. *
  5288. * _.isUndefined(void 0);
  5289. * // => true
  5290. *
  5291. * _.isUndefined(null);
  5292. * // => false
  5293. */
  5294. function isUndefined$1(value) {
  5295. return value === void 0;
  5296. }
  5297. //#endregion
  5298. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/merge.js
  5299. /**
  5300. * This method is like `_.assign` except that it recursively merges own and
  5301. * inherited enumerable string keyed properties of source objects into the
  5302. * destination object. Source properties that resolve to `undefined` are
  5303. * skipped if a destination value exists. Array and plain object properties
  5304. * are merged recursively. Other objects and value types are overridden by
  5305. * assignment. Source objects are applied from left to right. Subsequent
  5306. * sources overwrite property assignments of previous sources.
  5307. *
  5308. * **Note:** This method mutates `object`.
  5309. *
  5310. * @static
  5311. * @memberOf _
  5312. * @since 0.5.0
  5313. * @category Object
  5314. * @param {Object} object The destination object.
  5315. * @param {...Object} [sources] The source objects.
  5316. * @returns {Object} Returns `object`.
  5317. * @example
  5318. *
  5319. * var object = {
  5320. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  5321. * };
  5322. *
  5323. * var other = {
  5324. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  5325. * };
  5326. *
  5327. * _.merge(object, other);
  5328. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  5329. */
  5330. var merge = createAssigner(function(object, source, srcIndex) {
  5331. baseMerge(object, source, srcIndex);
  5332. });
  5333. //#endregion
  5334. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUnset.js
  5335. /** Used to check objects for own properties. */
  5336. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5337. /**
  5338. * The base implementation of `_.unset`.
  5339. *
  5340. * @private
  5341. * @param {Object} object The object to modify.
  5342. * @param {Array|string} path The property path to unset.
  5343. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5344. */
  5345. function baseUnset(object, path) {
  5346. path = castPath(path, object);
  5347. var index = -1, length = path.length;
  5348. if (!length) return true;
  5349. var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
  5350. while (++index < length) {
  5351. var key = path[index];
  5352. if (typeof key !== "string") continue;
  5353. if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) return false;
  5354. if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
  5355. if (isRootPrimitive && index === 0) continue;
  5356. return false;
  5357. }
  5358. }
  5359. var obj = parent(object, path);
  5360. return obj == null || delete obj[toKey(last(path))];
  5361. }
  5362. //#endregion
  5363. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_customOmitClone.js
  5364. /**
  5365. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  5366. * objects.
  5367. *
  5368. * @private
  5369. * @param {*} value The value to inspect.
  5370. * @param {string} key The key of the property to inspect.
  5371. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  5372. */
  5373. function customOmitClone(value) {
  5374. return isPlainObject(value) ? void 0 : value;
  5375. }
  5376. //#endregion
  5377. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/omit.js
  5378. /** Used to compose bitmasks for cloning. */
  5379. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
  5380. /**
  5381. * The opposite of `_.pick`; this method creates an object composed of the
  5382. * own and inherited enumerable property paths of `object` that are not omitted.
  5383. *
  5384. * **Note:** This method is considerably slower than `_.pick`.
  5385. *
  5386. * @static
  5387. * @since 0.1.0
  5388. * @memberOf _
  5389. * @category Object
  5390. * @param {Object} object The source object.
  5391. * @param {...(string|string[])} [paths] The property paths to omit.
  5392. * @returns {Object} Returns the new object.
  5393. * @example
  5394. *
  5395. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  5396. *
  5397. * _.omit(object, ['a', 'c']);
  5398. * // => { 'b': '2' }
  5399. */
  5400. var omit = flatRest(function(object, paths) {
  5401. var result = {};
  5402. if (object == null) return result;
  5403. var isDeep = false;
  5404. paths = arrayMap(paths, function(path) {
  5405. path = castPath(path, object);
  5406. isDeep || (isDeep = path.length > 1);
  5407. return path;
  5408. });
  5409. copyObject(object, getAllKeysIn(object), result);
  5410. if (isDeep) result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  5411. var length = paths.length;
  5412. while (length--) baseUnset(result, paths[length]);
  5413. return result;
  5414. });
  5415. //#endregion
  5416. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js
  5417. /**
  5418. * The base implementation of `_.set`.
  5419. *
  5420. * @private
  5421. * @param {Object} object The object to modify.
  5422. * @param {Array|string} path The path of the property to set.
  5423. * @param {*} value The value to set.
  5424. * @param {Function} [customizer] The function to customize path creation.
  5425. * @returns {Object} Returns `object`.
  5426. */
  5427. function baseSet(object, path, value, customizer) {
  5428. if (!isObject(object)) return object;
  5429. path = castPath(path, object);
  5430. var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  5431. while (nested != null && ++index < length) {
  5432. var key = toKey(path[index]), newValue = value;
  5433. if (key === "__proto__" || key === "constructor" || key === "prototype") return object;
  5434. if (index != lastIndex) {
  5435. var objValue = nested[key];
  5436. newValue = customizer ? customizer(objValue, key, nested) : void 0;
  5437. if (newValue === void 0) newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
  5438. }
  5439. assignValue(nested, key, newValue);
  5440. nested = nested[key];
  5441. }
  5442. return object;
  5443. }
  5444. //#endregion
  5445. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js
  5446. /**
  5447. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5448. *
  5449. * @private
  5450. * @param {Object} object The source object.
  5451. * @param {string[]} paths The property paths to pick.
  5452. * @param {Function} predicate The function invoked per property.
  5453. * @returns {Object} Returns the new object.
  5454. */
  5455. function basePickBy(object, paths, predicate) {
  5456. var index = -1, length = paths.length, result = {};
  5457. while (++index < length) {
  5458. var path = paths[index], value = baseGet(object, path);
  5459. if (predicate(value, path)) baseSet(result, castPath(path, object), value);
  5460. }
  5461. return result;
  5462. }
  5463. //#endregion
  5464. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePick.js
  5465. /**
  5466. * The base implementation of `_.pick` without support for individual
  5467. * property identifiers.
  5468. *
  5469. * @private
  5470. * @param {Object} object The source object.
  5471. * @param {string[]} paths The property paths to pick.
  5472. * @returns {Object} Returns the new object.
  5473. */
  5474. function basePick(object, paths) {
  5475. return basePickBy(object, paths, function(value, path) {
  5476. return hasIn(object, path);
  5477. });
  5478. }
  5479. //#endregion
  5480. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/pick.js
  5481. /**
  5482. * Creates an object composed of the picked `object` properties.
  5483. *
  5484. * @static
  5485. * @since 0.1.0
  5486. * @memberOf _
  5487. * @category Object
  5488. * @param {Object} object The source object.
  5489. * @param {...(string|string[])} [paths] The property paths to pick.
  5490. * @returns {Object} Returns the new object.
  5491. * @example
  5492. *
  5493. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  5494. *
  5495. * _.pick(object, ['a', 'c']);
  5496. * // => { 'a': 1, 'c': 3 }
  5497. */
  5498. var pick = flatRest(function(object, paths) {
  5499. return object == null ? {} : basePick(object, paths);
  5500. });
  5501. //#endregion
  5502. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/set.js
  5503. /**
  5504. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  5505. * it's created. Arrays are created for missing index properties while objects
  5506. * are created for all other missing properties. Use `_.setWith` to customize
  5507. * `path` creation.
  5508. *
  5509. * **Note:** This method mutates `object`.
  5510. *
  5511. * @static
  5512. * @memberOf _
  5513. * @since 3.7.0
  5514. * @category Object
  5515. * @param {Object} object The object to modify.
  5516. * @param {Array|string} path The path of the property to set.
  5517. * @param {*} value The value to set.
  5518. * @returns {Object} Returns `object`.
  5519. * @example
  5520. *
  5521. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  5522. *
  5523. * _.set(object, 'a[0].b.c', 4);
  5524. * console.log(object.a[0].b.c);
  5525. * // => 4
  5526. *
  5527. * _.set(object, ['x', '0', 'y', 'z'], 5);
  5528. * console.log(object.x[0].y.z);
  5529. * // => 5
  5530. */
  5531. function set(object, path, value) {
  5532. return object == null ? object : baseSet(object, path, value);
  5533. }
  5534. //#endregion
  5535. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/throttle.js
  5536. /** Error message constants. */
  5537. var FUNC_ERROR_TEXT = "Expected a function";
  5538. /**
  5539. * Creates a throttled function that only invokes `func` at most once per
  5540. * every `wait` milliseconds. The throttled function comes with a `cancel`
  5541. * method to cancel delayed `func` invocations and a `flush` method to
  5542. * immediately invoke them. Provide `options` to indicate whether `func`
  5543. * should be invoked on the leading and/or trailing edge of the `wait`
  5544. * timeout. The `func` is invoked with the last arguments provided to the
  5545. * throttled function. Subsequent calls to the throttled function return the
  5546. * result of the last `func` invocation.
  5547. *
  5548. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  5549. * invoked on the trailing edge of the timeout only if the throttled function
  5550. * is invoked more than once during the `wait` timeout.
  5551. *
  5552. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  5553. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  5554. *
  5555. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  5556. * for details over the differences between `_.throttle` and `_.debounce`.
  5557. *
  5558. * @static
  5559. * @memberOf _
  5560. * @since 0.1.0
  5561. * @category Function
  5562. * @param {Function} func The function to throttle.
  5563. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  5564. * @param {Object} [options={}] The options object.
  5565. * @param {boolean} [options.leading=true]
  5566. * Specify invoking on the leading edge of the timeout.
  5567. * @param {boolean} [options.trailing=true]
  5568. * Specify invoking on the trailing edge of the timeout.
  5569. * @returns {Function} Returns the new throttled function.
  5570. * @example
  5571. *
  5572. * // Avoid excessively updating the position while scrolling.
  5573. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  5574. *
  5575. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  5576. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  5577. * jQuery(element).on('click', throttled);
  5578. *
  5579. * // Cancel the trailing throttled invocation.
  5580. * jQuery(window).on('popstate', throttled.cancel);
  5581. */
  5582. function throttle(func, wait, options) {
  5583. var leading = true, trailing = true;
  5584. if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
  5585. if (isObject(options)) {
  5586. leading = "leading" in options ? !!options.leading : leading;
  5587. trailing = "trailing" in options ? !!options.trailing : trailing;
  5588. }
  5589. return debounce(func, wait, {
  5590. "leading": leading,
  5591. "maxWait": wait,
  5592. "trailing": trailing
  5593. });
  5594. }
  5595. //#endregion
  5596. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js
  5597. /**
  5598. * Creates a set object of `values`.
  5599. *
  5600. * @private
  5601. * @param {Array} values The values to add to the set.
  5602. * @returns {Object} Returns the new set.
  5603. */
  5604. var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == Infinity) ? noop : function(values) {
  5605. return new Set$1(values);
  5606. };
  5607. //#endregion
  5608. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js
  5609. /** Used as the size to enable large array optimizations. */
  5610. var LARGE_ARRAY_SIZE = 200;
  5611. /**
  5612. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5613. *
  5614. * @private
  5615. * @param {Array} array The array to inspect.
  5616. * @param {Function} [iteratee] The iteratee invoked per element.
  5617. * @param {Function} [comparator] The comparator invoked per element.
  5618. * @returns {Array} Returns the new duplicate free array.
  5619. */
  5620. function baseUniq(array, iteratee, comparator) {
  5621. var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
  5622. if (comparator) {
  5623. isCommon = false;
  5624. includes = arrayIncludesWith;
  5625. } else if (length >= LARGE_ARRAY_SIZE) {
  5626. var set = iteratee ? null : createSet(array);
  5627. if (set) return setToArray(set);
  5628. isCommon = false;
  5629. includes = cacheHas;
  5630. seen = new SetCache();
  5631. } else seen = iteratee ? [] : result;
  5632. outer: while (++index < length) {
  5633. var value = array[index], computed = iteratee ? iteratee(value) : value;
  5634. value = comparator || value !== 0 ? value : 0;
  5635. if (isCommon && computed === computed) {
  5636. var seenIndex = seen.length;
  5637. while (seenIndex--) if (seen[seenIndex] === computed) continue outer;
  5638. if (iteratee) seen.push(computed);
  5639. result.push(value);
  5640. } else if (!includes(seen, computed, comparator)) {
  5641. if (seen !== result) seen.push(computed);
  5642. result.push(value);
  5643. }
  5644. }
  5645. return result;
  5646. }
  5647. //#endregion
  5648. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/union.js
  5649. /**
  5650. * Creates an array of unique values, in order, from all given arrays using
  5651. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5652. * for equality comparisons.
  5653. *
  5654. * @static
  5655. * @memberOf _
  5656. * @since 0.1.0
  5657. * @category Array
  5658. * @param {...Array} [arrays] The arrays to inspect.
  5659. * @returns {Array} Returns the new array of combined values.
  5660. * @example
  5661. *
  5662. * _.union([2], [1, 2]);
  5663. * // => [2, 1]
  5664. */
  5665. var union = baseRest(function(arrays) {
  5666. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  5667. });
  5668. //#endregion
  5669. //#region ../../packages/utils/types.ts
  5670. const isUndefined = (val) => val === void 0;
  5671. const isBoolean = (val) => typeof val === "boolean";
  5672. const isNumber = (val) => typeof val === "number";
  5673. const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
  5674. const isElement$1 = (e) => {
  5675. if (typeof Element === "undefined") return false;
  5676. return e instanceof Element;
  5677. };
  5678. const isPropAbsent = (prop) => isNil(prop);
  5679. const isStringNumber = (val) => {
  5680. if (!isString(val)) return false;
  5681. return !Number.isNaN(Number(val));
  5682. };
  5683. const isWindow = (val) => val === window;
  5684. //#endregion
  5685. //#region ../../packages/utils/raf.ts
  5686. const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
  5687. const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
  5688. //#endregion
  5689. //#region ../../packages/utils/strings.ts
  5690. /**
  5691. * fork from {@link https://github.com/sindresorhus/escape-string-regexp}
  5692. */
  5693. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  5694. const capitalize = (str) => capitalize$1(str);
  5695. //#endregion
  5696. //#region ../../packages/utils/objects.ts
  5697. const keysOf = (arr) => Object.keys(arr);
  5698. const entriesOf = (arr) => Object.entries(arr);
  5699. const getProp = (obj, path, defaultValue) => {
  5700. return {
  5701. get value() {
  5702. return get(obj, path, defaultValue);
  5703. },
  5704. set value(val) {
  5705. set(obj, path, val);
  5706. }
  5707. };
  5708. };
  5709. //#endregion
  5710. //#region ../../packages/utils/error.ts
  5711. var ElementPlusError = class extends Error {
  5712. constructor(m) {
  5713. super(m);
  5714. this.name = "ElementPlusError";
  5715. }
  5716. };
  5717. function throwError(scope, m) {
  5718. throw new ElementPlusError(`[${scope}] ${m}`);
  5719. }
  5720. function debugWarn(scope, message) {}
  5721. //#endregion
  5722. //#region ../../packages/utils/dom/style.ts
  5723. const SCOPE$9 = "utils/dom/style";
  5724. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  5725. const hasClass = (el, cls) => {
  5726. if (!el || !cls) return false;
  5727. if (cls.includes(" ")) throw new Error("className should not contain space.");
  5728. return el.classList.contains(cls);
  5729. };
  5730. const addClass = (el, cls) => {
  5731. if (!el || !cls.trim()) return;
  5732. el.classList.add(...classNameToArray(cls));
  5733. };
  5734. const removeClass = (el, cls) => {
  5735. if (!el || !cls.trim()) return;
  5736. el.classList.remove(...classNameToArray(cls));
  5737. };
  5738. const getStyle = (element, styleName) => {
  5739. if (!isClient || !element || !styleName || isShadowRoot$1(element)) return "";
  5740. let key = camelize(styleName);
  5741. if (key === "float") key = "cssFloat";
  5742. try {
  5743. const style = element.style[key];
  5744. if (style) return style;
  5745. const computed = document.defaultView?.getComputedStyle(element, "");
  5746. return computed ? computed[key] : "";
  5747. } catch {
  5748. return element.style[key];
  5749. }
  5750. };
  5751. const setStyle = (element, styleName, value) => {
  5752. if (!element || !styleName) return;
  5753. if (isObject$1(styleName)) entriesOf(styleName).forEach(([prop, value]) => setStyle(element, prop, value));
  5754. else {
  5755. const key = camelize(styleName);
  5756. element.style[key] = value;
  5757. }
  5758. };
  5759. function addUnit(value, defaultUnit = "px") {
  5760. if (!value && value !== 0) return "";
  5761. if (isNumber(value) || isStringNumber(value)) return `${value}${defaultUnit}`;
  5762. else if (isString(value)) return value;
  5763. /* @__PURE__ */ debugWarn(SCOPE$9, "binding value must be a string or number");
  5764. }
  5765. //#endregion
  5766. //#region ../../packages/utils/dom/scroll.ts
  5767. const isScroll = (el, isVertical) => {
  5768. if (!isClient) return false;
  5769. const key = {
  5770. undefined: "overflow",
  5771. true: "overflow-y",
  5772. false: "overflow-x"
  5773. }[String(isVertical)];
  5774. const overflow = getStyle(el, key);
  5775. return [
  5776. "scroll",
  5777. "auto",
  5778. "overlay"
  5779. ].some((s) => overflow.includes(s));
  5780. };
  5781. const getScrollContainer = (el, isVertical) => {
  5782. if (!isClient) return;
  5783. let parent = el;
  5784. while (parent) {
  5785. if ([
  5786. window,
  5787. document,
  5788. document.documentElement
  5789. ].includes(parent)) return window;
  5790. if (isScroll(parent, isVertical)) return parent;
  5791. if (isShadowRoot$1(parent)) parent = parent.host;
  5792. else parent = parent.parentNode;
  5793. }
  5794. return parent;
  5795. };
  5796. let scrollBarWidth;
  5797. const getScrollBarWidth = (namespace) => {
  5798. if (!isClient) return 0;
  5799. if (scrollBarWidth !== void 0) return scrollBarWidth;
  5800. const outer = document.createElement("div");
  5801. outer.className = `${namespace}-scrollbar__wrap`;
  5802. outer.style.visibility = "hidden";
  5803. outer.style.width = "100px";
  5804. outer.style.position = "absolute";
  5805. outer.style.top = "-9999px";
  5806. document.body.appendChild(outer);
  5807. const widthNoScroll = outer.offsetWidth;
  5808. outer.style.overflow = "scroll";
  5809. const inner = document.createElement("div");
  5810. inner.style.width = "100%";
  5811. outer.appendChild(inner);
  5812. const widthWithScroll = inner.offsetWidth;
  5813. outer.parentNode?.removeChild(outer);
  5814. scrollBarWidth = widthNoScroll - widthWithScroll;
  5815. return scrollBarWidth;
  5816. };
  5817. /**
  5818. * Scroll with in the container element, positioning the **selected** element at the top
  5819. * of the container
  5820. */
  5821. function scrollIntoView(container, selected) {
  5822. if (!isClient) return;
  5823. if (!selected) {
  5824. container.scrollTop = 0;
  5825. return;
  5826. }
  5827. const offsetParents = [];
  5828. let pointer = selected.offsetParent;
  5829. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  5830. offsetParents.push(pointer);
  5831. pointer = pointer.offsetParent;
  5832. }
  5833. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  5834. const bottom = top + selected.offsetHeight;
  5835. const viewRectTop = container.scrollTop;
  5836. const viewRectBottom = viewRectTop + container.clientHeight;
  5837. if (top < viewRectTop) container.scrollTop = top;
  5838. else if (bottom > viewRectBottom) container.scrollTop = bottom - container.clientHeight;
  5839. }
  5840. function animateScrollTo(container, from, to, duration, callback) {
  5841. const startTime = Date.now();
  5842. let handle;
  5843. const scroll = () => {
  5844. const time = Date.now() - startTime;
  5845. const nextScrollTop = easeInOutCubic(time > duration ? duration : time, from, to, duration);
  5846. if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop);
  5847. else container.scrollTop = nextScrollTop;
  5848. if (time < duration) handle = rAF(scroll);
  5849. else if (isFunction$1(callback)) callback();
  5850. };
  5851. scroll();
  5852. return () => {
  5853. handle && cAF(handle);
  5854. };
  5855. }
  5856. const getScrollElement = (target, container) => {
  5857. if (isWindow(container)) return target.ownerDocument.documentElement;
  5858. return container;
  5859. };
  5860. const getScrollTop = (container) => {
  5861. if (isWindow(container)) return window.scrollY;
  5862. return container.scrollTop;
  5863. };
  5864. //#endregion
  5865. //#region ../../packages/utils/dom/element.ts
  5866. const getElement = ((target) => {
  5867. if (!isClient || target === "") return null;
  5868. if (isString(target)) try {
  5869. return document.querySelector(target);
  5870. } catch {
  5871. return null;
  5872. }
  5873. return target;
  5874. });
  5875. //#endregion
  5876. //#region ../../packages/utils/vue/global-node.ts
  5877. const globalNodes = [];
  5878. let target = !isClient ? void 0 : document.body;
  5879. function createGlobalNode(id) {
  5880. const el = document.createElement("div");
  5881. if (id !== void 0) el.setAttribute("id", id);
  5882. if (target) {
  5883. target.appendChild(el);
  5884. globalNodes.push(el);
  5885. }
  5886. return el;
  5887. }
  5888. function removeGlobalNode(el) {
  5889. globalNodes.splice(globalNodes.indexOf(el), 1);
  5890. el.remove();
  5891. }
  5892. //#endregion
  5893. //#region ../../node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.25_typescript@5.5.4_/node_modules/@element-plus/icons-vue/dist/index.js
  5894. var arrow_down_default = /* @__PURE__ */ defineComponent({
  5895. name: "ArrowDown",
  5896. __name: "arrow-down",
  5897. setup(__props) {
  5898. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5899. xmlns: "http://www.w3.org/2000/svg",
  5900. viewBox: "0 0 1024 1024"
  5901. }, [createElementVNode("path", {
  5902. fill: "currentColor",
  5903. d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
  5904. })]));
  5905. }
  5906. });
  5907. var arrow_left_default = /* @__PURE__ */ defineComponent({
  5908. name: "ArrowLeft",
  5909. __name: "arrow-left",
  5910. setup(__props) {
  5911. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5912. xmlns: "http://www.w3.org/2000/svg",
  5913. viewBox: "0 0 1024 1024"
  5914. }, [createElementVNode("path", {
  5915. fill: "currentColor",
  5916. d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
  5917. })]));
  5918. }
  5919. });
  5920. var arrow_right_default = /* @__PURE__ */ defineComponent({
  5921. name: "ArrowRight",
  5922. __name: "arrow-right",
  5923. setup(__props) {
  5924. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5925. xmlns: "http://www.w3.org/2000/svg",
  5926. viewBox: "0 0 1024 1024"
  5927. }, [createElementVNode("path", {
  5928. fill: "currentColor",
  5929. d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
  5930. })]));
  5931. }
  5932. });
  5933. var arrow_up_default = /* @__PURE__ */ defineComponent({
  5934. name: "ArrowUp",
  5935. __name: "arrow-up",
  5936. setup(__props) {
  5937. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5938. xmlns: "http://www.w3.org/2000/svg",
  5939. viewBox: "0 0 1024 1024"
  5940. }, [createElementVNode("path", {
  5941. fill: "currentColor",
  5942. d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
  5943. })]));
  5944. }
  5945. });
  5946. var back_default = /* @__PURE__ */ defineComponent({
  5947. name: "Back",
  5948. __name: "back",
  5949. setup(__props) {
  5950. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5951. xmlns: "http://www.w3.org/2000/svg",
  5952. viewBox: "0 0 1024 1024"
  5953. }, [createElementVNode("path", {
  5954. fill: "currentColor",
  5955. d: "M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"
  5956. }), createElementVNode("path", {
  5957. fill: "currentColor",
  5958. d: "m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"
  5959. })]));
  5960. }
  5961. });
  5962. var calendar_default$1 = /* @__PURE__ */ defineComponent({
  5963. name: "Calendar",
  5964. __name: "calendar",
  5965. setup(__props) {
  5966. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5967. xmlns: "http://www.w3.org/2000/svg",
  5968. viewBox: "0 0 1024 1024"
  5969. }, [createElementVNode("path", {
  5970. fill: "currentColor",
  5971. d: "M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"
  5972. })]));
  5973. }
  5974. });
  5975. var caret_right_default = /* @__PURE__ */ defineComponent({
  5976. name: "CaretRight",
  5977. __name: "caret-right",
  5978. setup(__props) {
  5979. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5980. xmlns: "http://www.w3.org/2000/svg",
  5981. viewBox: "0 0 1024 1024"
  5982. }, [createElementVNode("path", {
  5983. fill: "currentColor",
  5984. d: "M384 192v640l384-320.064z"
  5985. })]));
  5986. }
  5987. });
  5988. var caret_top_default = /* @__PURE__ */ defineComponent({
  5989. name: "CaretTop",
  5990. __name: "caret-top",
  5991. setup(__props) {
  5992. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  5993. xmlns: "http://www.w3.org/2000/svg",
  5994. viewBox: "0 0 1024 1024"
  5995. }, [createElementVNode("path", {
  5996. fill: "currentColor",
  5997. d: "M512 320 192 704h639.936z"
  5998. })]));
  5999. }
  6000. });
  6001. var check_default = /* @__PURE__ */ defineComponent({
  6002. name: "Check",
  6003. __name: "check",
  6004. setup(__props) {
  6005. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6006. xmlns: "http://www.w3.org/2000/svg",
  6007. viewBox: "0 0 1024 1024"
  6008. }, [createElementVNode("path", {
  6009. fill: "currentColor",
  6010. d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
  6011. })]));
  6012. }
  6013. });
  6014. var circle_check_filled_default = /* @__PURE__ */ defineComponent({
  6015. name: "CircleCheckFilled",
  6016. __name: "circle-check-filled",
  6017. setup(__props) {
  6018. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6019. xmlns: "http://www.w3.org/2000/svg",
  6020. viewBox: "0 0 1024 1024"
  6021. }, [createElementVNode("path", {
  6022. fill: "currentColor",
  6023. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
  6024. })]));
  6025. }
  6026. });
  6027. var circle_check_default = /* @__PURE__ */ defineComponent({
  6028. name: "CircleCheck",
  6029. __name: "circle-check",
  6030. setup(__props) {
  6031. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6032. xmlns: "http://www.w3.org/2000/svg",
  6033. viewBox: "0 0 1024 1024"
  6034. }, [createElementVNode("path", {
  6035. fill: "currentColor",
  6036. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6037. }), createElementVNode("path", {
  6038. fill: "currentColor",
  6039. d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"
  6040. })]));
  6041. }
  6042. });
  6043. var circle_close_filled_default = /* @__PURE__ */ defineComponent({
  6044. name: "CircleCloseFilled",
  6045. __name: "circle-close-filled",
  6046. setup(__props) {
  6047. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6048. xmlns: "http://www.w3.org/2000/svg",
  6049. viewBox: "0 0 1024 1024"
  6050. }, [createElementVNode("path", {
  6051. fill: "currentColor",
  6052. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
  6053. })]));
  6054. }
  6055. });
  6056. var circle_close_default = /* @__PURE__ */ defineComponent({
  6057. name: "CircleClose",
  6058. __name: "circle-close",
  6059. setup(__props) {
  6060. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6061. xmlns: "http://www.w3.org/2000/svg",
  6062. viewBox: "0 0 1024 1024"
  6063. }, [createElementVNode("path", {
  6064. fill: "currentColor",
  6065. d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
  6066. }), createElementVNode("path", {
  6067. fill: "currentColor",
  6068. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6069. })]));
  6070. }
  6071. });
  6072. var clock_default = /* @__PURE__ */ defineComponent({
  6073. name: "Clock",
  6074. __name: "clock",
  6075. setup(__props) {
  6076. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6077. xmlns: "http://www.w3.org/2000/svg",
  6078. viewBox: "0 0 1024 1024"
  6079. }, [
  6080. createElementVNode("path", {
  6081. fill: "currentColor",
  6082. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6083. }),
  6084. createElementVNode("path", {
  6085. fill: "currentColor",
  6086. d: "M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
  6087. }),
  6088. createElementVNode("path", {
  6089. fill: "currentColor",
  6090. d: "M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"
  6091. })
  6092. ]));
  6093. }
  6094. });
  6095. var close_default = /* @__PURE__ */ defineComponent({
  6096. name: "Close",
  6097. __name: "close",
  6098. setup(__props) {
  6099. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6100. xmlns: "http://www.w3.org/2000/svg",
  6101. viewBox: "0 0 1024 1024"
  6102. }, [createElementVNode("path", {
  6103. fill: "currentColor",
  6104. d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
  6105. })]));
  6106. }
  6107. });
  6108. var d_arrow_left_default = /* @__PURE__ */ defineComponent({
  6109. name: "DArrowLeft",
  6110. __name: "d-arrow-left",
  6111. setup(__props) {
  6112. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6113. xmlns: "http://www.w3.org/2000/svg",
  6114. viewBox: "0 0 1024 1024"
  6115. }, [createElementVNode("path", {
  6116. fill: "currentColor",
  6117. d: "M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z"
  6118. })]));
  6119. }
  6120. });
  6121. var d_arrow_right_default = /* @__PURE__ */ defineComponent({
  6122. name: "DArrowRight",
  6123. __name: "d-arrow-right",
  6124. setup(__props) {
  6125. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6126. xmlns: "http://www.w3.org/2000/svg",
  6127. viewBox: "0 0 1024 1024"
  6128. }, [createElementVNode("path", {
  6129. fill: "currentColor",
  6130. d: "M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"
  6131. })]));
  6132. }
  6133. });
  6134. var delete_default = /* @__PURE__ */ defineComponent({
  6135. name: "Delete",
  6136. __name: "delete",
  6137. setup(__props) {
  6138. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6139. xmlns: "http://www.w3.org/2000/svg",
  6140. viewBox: "0 0 1024 1024"
  6141. }, [createElementVNode("path", {
  6142. fill: "currentColor",
  6143. d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
  6144. })]));
  6145. }
  6146. });
  6147. var document_default = /* @__PURE__ */ defineComponent({
  6148. name: "Document",
  6149. __name: "document",
  6150. setup(__props) {
  6151. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6152. xmlns: "http://www.w3.org/2000/svg",
  6153. viewBox: "0 0 1024 1024"
  6154. }, [createElementVNode("path", {
  6155. fill: "currentColor",
  6156. d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
  6157. })]));
  6158. }
  6159. });
  6160. var full_screen_default = /* @__PURE__ */ defineComponent({
  6161. name: "FullScreen",
  6162. __name: "full-screen",
  6163. setup(__props) {
  6164. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6165. xmlns: "http://www.w3.org/2000/svg",
  6166. viewBox: "0 0 1024 1024"
  6167. }, [createElementVNode("path", {
  6168. fill: "currentColor",
  6169. d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
  6170. })]));
  6171. }
  6172. });
  6173. var hide_default = /* @__PURE__ */ defineComponent({
  6174. name: "Hide",
  6175. __name: "hide",
  6176. setup(__props) {
  6177. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6178. xmlns: "http://www.w3.org/2000/svg",
  6179. viewBox: "0 0 1024 1024"
  6180. }, [createElementVNode("path", {
  6181. fill: "currentColor",
  6182. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"
  6183. }), createElementVNode("path", {
  6184. fill: "currentColor",
  6185. d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"
  6186. })]));
  6187. }
  6188. });
  6189. var info_filled_default = /* @__PURE__ */ defineComponent({
  6190. name: "InfoFilled",
  6191. __name: "info-filled",
  6192. setup(__props) {
  6193. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6194. xmlns: "http://www.w3.org/2000/svg",
  6195. viewBox: "0 0 1024 1024"
  6196. }, [createElementVNode("path", {
  6197. fill: "currentColor",
  6198. d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"
  6199. })]));
  6200. }
  6201. });
  6202. var loading_default = /* @__PURE__ */ defineComponent({
  6203. name: "Loading",
  6204. __name: "loading",
  6205. setup(__props) {
  6206. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6207. xmlns: "http://www.w3.org/2000/svg",
  6208. viewBox: "0 0 1024 1024"
  6209. }, [createElementVNode("path", {
  6210. fill: "currentColor",
  6211. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
  6212. })]));
  6213. }
  6214. });
  6215. var minus_default = /* @__PURE__ */ defineComponent({
  6216. name: "Minus",
  6217. __name: "minus",
  6218. setup(__props) {
  6219. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6220. xmlns: "http://www.w3.org/2000/svg",
  6221. viewBox: "0 0 1024 1024"
  6222. }, [createElementVNode("path", {
  6223. fill: "currentColor",
  6224. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
  6225. })]));
  6226. }
  6227. });
  6228. var more_filled_default = /* @__PURE__ */ defineComponent({
  6229. name: "MoreFilled",
  6230. __name: "more-filled",
  6231. setup(__props) {
  6232. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6233. xmlns: "http://www.w3.org/2000/svg",
  6234. viewBox: "0 0 1024 1024"
  6235. }, [createElementVNode("path", {
  6236. fill: "currentColor",
  6237. d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"
  6238. })]));
  6239. }
  6240. });
  6241. var more_default = /* @__PURE__ */ defineComponent({
  6242. name: "More",
  6243. __name: "more",
  6244. setup(__props) {
  6245. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6246. xmlns: "http://www.w3.org/2000/svg",
  6247. viewBox: "0 0 1024 1024"
  6248. }, [createElementVNode("path", {
  6249. fill: "currentColor",
  6250. d: "M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"
  6251. })]));
  6252. }
  6253. });
  6254. var picture_filled_default = /* @__PURE__ */ defineComponent({
  6255. name: "PictureFilled",
  6256. __name: "picture-filled",
  6257. setup(__props) {
  6258. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6259. xmlns: "http://www.w3.org/2000/svg",
  6260. viewBox: "0 0 1024 1024"
  6261. }, [createElementVNode("path", {
  6262. fill: "currentColor",
  6263. d: "M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"
  6264. })]));
  6265. }
  6266. });
  6267. var plus_default = /* @__PURE__ */ defineComponent({
  6268. name: "Plus",
  6269. __name: "plus",
  6270. setup(__props) {
  6271. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6272. xmlns: "http://www.w3.org/2000/svg",
  6273. viewBox: "0 0 1024 1024"
  6274. }, [createElementVNode("path", {
  6275. fill: "currentColor",
  6276. d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
  6277. })]));
  6278. }
  6279. });
  6280. var question_filled_default = /* @__PURE__ */ defineComponent({
  6281. name: "QuestionFilled",
  6282. __name: "question-filled",
  6283. setup(__props) {
  6284. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6285. xmlns: "http://www.w3.org/2000/svg",
  6286. viewBox: "0 0 1024 1024"
  6287. }, [createElementVNode("path", {
  6288. fill: "currentColor",
  6289. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
  6290. })]));
  6291. }
  6292. });
  6293. var refresh_left_default = /* @__PURE__ */ defineComponent({
  6294. name: "RefreshLeft",
  6295. __name: "refresh-left",
  6296. setup(__props) {
  6297. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6298. xmlns: "http://www.w3.org/2000/svg",
  6299. viewBox: "0 0 1024 1024"
  6300. }, [createElementVNode("path", {
  6301. fill: "currentColor",
  6302. d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
  6303. })]));
  6304. }
  6305. });
  6306. var refresh_right_default = /* @__PURE__ */ defineComponent({
  6307. name: "RefreshRight",
  6308. __name: "refresh-right",
  6309. setup(__props) {
  6310. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6311. xmlns: "http://www.w3.org/2000/svg",
  6312. viewBox: "0 0 1024 1024"
  6313. }, [createElementVNode("path", {
  6314. fill: "currentColor",
  6315. d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"
  6316. })]));
  6317. }
  6318. });
  6319. var scale_to_original_default = /* @__PURE__ */ defineComponent({
  6320. name: "ScaleToOriginal",
  6321. __name: "scale-to-original",
  6322. setup(__props) {
  6323. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6324. xmlns: "http://www.w3.org/2000/svg",
  6325. viewBox: "0 0 1024 1024"
  6326. }, [createElementVNode("path", {
  6327. fill: "currentColor",
  6328. d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"
  6329. })]));
  6330. }
  6331. });
  6332. var search_default = /* @__PURE__ */ defineComponent({
  6333. name: "Search",
  6334. __name: "search",
  6335. setup(__props) {
  6336. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6337. xmlns: "http://www.w3.org/2000/svg",
  6338. viewBox: "0 0 1024 1024"
  6339. }, [createElementVNode("path", {
  6340. fill: "currentColor",
  6341. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
  6342. })]));
  6343. }
  6344. });
  6345. var sort_down_default = /* @__PURE__ */ defineComponent({
  6346. name: "SortDown",
  6347. __name: "sort-down",
  6348. setup(__props) {
  6349. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6350. xmlns: "http://www.w3.org/2000/svg",
  6351. viewBox: "0 0 1024 1024"
  6352. }, [createElementVNode("path", {
  6353. fill: "currentColor",
  6354. d: "M576 96v709.568L333.312 562.816A32 32 0 1 0 288 608l297.408 297.344A32 32 0 0 0 640 882.688V96a32 32 0 0 0-64 0"
  6355. })]));
  6356. }
  6357. });
  6358. var sort_up_default = /* @__PURE__ */ defineComponent({
  6359. name: "SortUp",
  6360. __name: "sort-up",
  6361. setup(__props) {
  6362. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6363. xmlns: "http://www.w3.org/2000/svg",
  6364. viewBox: "0 0 1024 1024"
  6365. }, [createElementVNode("path", {
  6366. fill: "currentColor",
  6367. d: "M384 141.248V928a32 32 0 1 0 64 0V218.56l242.688 242.688A32 32 0 1 0 736 416L438.592 118.656A32 32 0 0 0 384 141.248"
  6368. })]));
  6369. }
  6370. });
  6371. var star_filled_default = /* @__PURE__ */ defineComponent({
  6372. name: "StarFilled",
  6373. __name: "star-filled",
  6374. setup(__props) {
  6375. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6376. xmlns: "http://www.w3.org/2000/svg",
  6377. viewBox: "0 0 1024 1024"
  6378. }, [createElementVNode("path", {
  6379. fill: "currentColor",
  6380. d: "M313.6 924.48a70.4 70.4 0 0 1-74.152-5.365 70.4 70.4 0 0 1-27.992-68.875l37.888-220.928L88.96 472.96a70.4 70.4 0 0 1 3.788-104.225A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 100.246-28.595 70.4 70.4 0 0 1 25.962 28.595l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"
  6381. })]));
  6382. }
  6383. });
  6384. var star_default = /* @__PURE__ */ defineComponent({
  6385. name: "Star",
  6386. __name: "star",
  6387. setup(__props) {
  6388. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6389. xmlns: "http://www.w3.org/2000/svg",
  6390. viewBox: "0 0 1024 1024"
  6391. }, [createElementVNode("path", {
  6392. fill: "currentColor",
  6393. d: "m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"
  6394. })]));
  6395. }
  6396. });
  6397. var success_filled_default = /* @__PURE__ */ defineComponent({
  6398. name: "SuccessFilled",
  6399. __name: "success-filled",
  6400. setup(__props) {
  6401. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6402. xmlns: "http://www.w3.org/2000/svg",
  6403. viewBox: "0 0 1024 1024"
  6404. }, [createElementVNode("path", {
  6405. fill: "currentColor",
  6406. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
  6407. })]));
  6408. }
  6409. });
  6410. var view_default = /* @__PURE__ */ defineComponent({
  6411. name: "View",
  6412. __name: "view",
  6413. setup(__props) {
  6414. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6415. xmlns: "http://www.w3.org/2000/svg",
  6416. viewBox: "0 0 1024 1024"
  6417. }, [createElementVNode("path", {
  6418. fill: "currentColor",
  6419. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
  6420. })]));
  6421. }
  6422. });
  6423. var warning_filled_default = /* @__PURE__ */ defineComponent({
  6424. name: "WarningFilled",
  6425. __name: "warning-filled",
  6426. setup(__props) {
  6427. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6428. xmlns: "http://www.w3.org/2000/svg",
  6429. viewBox: "0 0 1024 1024"
  6430. }, [createElementVNode("path", {
  6431. fill: "currentColor",
  6432. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
  6433. })]));
  6434. }
  6435. });
  6436. var zoom_in_default = /* @__PURE__ */ defineComponent({
  6437. name: "ZoomIn",
  6438. __name: "zoom-in",
  6439. setup(__props) {
  6440. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6441. xmlns: "http://www.w3.org/2000/svg",
  6442. viewBox: "0 0 1024 1024"
  6443. }, [createElementVNode("path", {
  6444. fill: "currentColor",
  6445. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
  6446. })]));
  6447. }
  6448. });
  6449. var zoom_out_default = /* @__PURE__ */ defineComponent({
  6450. name: "ZoomOut",
  6451. __name: "zoom-out",
  6452. setup(__props) {
  6453. return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
  6454. xmlns: "http://www.w3.org/2000/svg",
  6455. viewBox: "0 0 1024 1024"
  6456. }, [createElementVNode("path", {
  6457. fill: "currentColor",
  6458. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
  6459. })]));
  6460. }
  6461. });
  6462. //#endregion
  6463. //#region ../../packages/utils/vue/props/runtime.ts
  6464. const epPropKey = "__epPropKey";
  6465. const definePropType = (val) => val;
  6466. const isEpProp = (val) => isObject$1(val) && !!val[epPropKey];
  6467. /**
  6468. * @description Build prop. It can better optimize prop types
  6469. * @description 生成 prop,能更好地优化类型
  6470. * @example
  6471. // limited options
  6472. // the type will be PropType<'light' | 'dark'>
  6473. buildProp({
  6474. type: String,
  6475. values: ['light', 'dark'],
  6476. } as const)
  6477. * @example
  6478. // limited options and other types
  6479. // the type will be PropType<'small' | 'large' | number>
  6480. buildProp({
  6481. type: [String, Number],
  6482. values: ['small', 'large'],
  6483. validator: (val: unknown): val is number => typeof val === 'number',
  6484. } as const)
  6485. @link see more: https://github.com/element-plus/element-plus/pull/3341
  6486. */
  6487. const buildProp = (prop, key) => {
  6488. if (!isObject$1(prop) || isEpProp(prop)) return prop;
  6489. const { values, required, default: defaultValue, type, validator } = prop;
  6490. const epProp = {
  6491. type,
  6492. required: !!required,
  6493. validator: values || validator ? (val) => {
  6494. let valid = false;
  6495. let allowedValues = [];
  6496. if (values) {
  6497. allowedValues = Array.from(values);
  6498. if (hasOwn(prop, "default")) allowedValues.push(defaultValue);
  6499. valid ||= allowedValues.includes(val);
  6500. }
  6501. if (validator) valid ||= validator(val);
  6502. if (!valid && allowedValues.length > 0) {
  6503. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  6504. warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  6505. }
  6506. return valid;
  6507. } : void 0,
  6508. [epPropKey]: true
  6509. };
  6510. if (hasOwn(prop, "default")) epProp.default = defaultValue;
  6511. return epProp;
  6512. };
  6513. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [key, buildProp(option, key)]));
  6514. //#endregion
  6515. //#region ../../packages/utils/vue/icon.ts
  6516. const iconPropType = definePropType([
  6517. String,
  6518. Object,
  6519. Function
  6520. ]);
  6521. const CloseComponents = { Close: close_default };
  6522. const TypeComponents = {
  6523. Close: close_default,
  6524. SuccessFilled: success_filled_default,
  6525. InfoFilled: info_filled_default,
  6526. WarningFilled: warning_filled_default,
  6527. CircleCloseFilled: circle_close_filled_default
  6528. };
  6529. const TypeComponentsMap = {
  6530. primary: info_filled_default,
  6531. success: success_filled_default,
  6532. warning: warning_filled_default,
  6533. error: circle_close_filled_default,
  6534. info: info_filled_default
  6535. };
  6536. const ValidateComponentsMap = {
  6537. validating: loading_default,
  6538. success: circle_check_default,
  6539. error: circle_close_default
  6540. };
  6541. //#endregion
  6542. //#region ../../packages/utils/vue/install.ts
  6543. const withPropsDefaultsSetter = (target) => {
  6544. const _p = target.props;
  6545. const props = isArray$1(_p) ? fromPairs(_p.map((key) => [key, {}])) : _p;
  6546. target.setPropsDefaults = (defaults) => {
  6547. if (!props) return;
  6548. for (const [key, value] of Object.entries(defaults)) {
  6549. const prop = props[key];
  6550. if (!hasOwn(props, key)) continue;
  6551. if (isPlainObject(prop)) {
  6552. props[key] = {
  6553. ...prop,
  6554. default: value
  6555. };
  6556. continue;
  6557. }
  6558. props[key] = {
  6559. type: prop,
  6560. default: value
  6561. };
  6562. }
  6563. target.props = props;
  6564. };
  6565. };
  6566. const withInstall = (main, extra) => {
  6567. main.install = (app) => {
  6568. for (const comp of [main, ...Object.values(extra ?? {})]) app.component(comp.name, comp);
  6569. };
  6570. if (extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp;
  6571. withPropsDefaultsSetter(main);
  6572. return main;
  6573. };
  6574. const withInstallFunction = (fn, name) => {
  6575. fn.install = (app) => {
  6576. fn._context = app._context;
  6577. app.config.globalProperties[name] = fn;
  6578. };
  6579. return fn;
  6580. };
  6581. const withInstallDirective = (directive, name) => {
  6582. directive.install = (app) => {
  6583. app.directive(name, directive);
  6584. };
  6585. return directive;
  6586. };
  6587. const withNoopInstall = (component) => {
  6588. component.install = NOOP;
  6589. withPropsDefaultsSetter(component);
  6590. return component;
  6591. };
  6592. //#endregion
  6593. //#region ../../packages/utils/vue/refs.ts
  6594. const composeRefs = (...refs) => {
  6595. return (el) => {
  6596. refs.forEach((ref) => {
  6597. ref.value = el;
  6598. });
  6599. };
  6600. };
  6601. //#endregion
  6602. //#region ../../packages/utils/vue/validator.ts
  6603. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  6604. //#endregion
  6605. //#region ../../packages/utils/vue/vnode.ts
  6606. const SCOPE$8 = "utils/vue/vnode";
  6607. let PatchFlags = /* @__PURE__ */ function(PatchFlags) {
  6608. PatchFlags[PatchFlags["TEXT"] = 1] = "TEXT";
  6609. PatchFlags[PatchFlags["CLASS"] = 2] = "CLASS";
  6610. PatchFlags[PatchFlags["STYLE"] = 4] = "STYLE";
  6611. PatchFlags[PatchFlags["PROPS"] = 8] = "PROPS";
  6612. PatchFlags[PatchFlags["FULL_PROPS"] = 16] = "FULL_PROPS";
  6613. PatchFlags[PatchFlags["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  6614. PatchFlags[PatchFlags["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  6615. PatchFlags[PatchFlags["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  6616. PatchFlags[PatchFlags["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  6617. PatchFlags[PatchFlags["NEED_PATCH"] = 512] = "NEED_PATCH";
  6618. PatchFlags[PatchFlags["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  6619. PatchFlags[PatchFlags["HOISTED"] = -1] = "HOISTED";
  6620. PatchFlags[PatchFlags["BAIL"] = -2] = "BAIL";
  6621. return PatchFlags;
  6622. }({});
  6623. function isFragment(node) {
  6624. return isVNode(node) && node.type === Fragment;
  6625. }
  6626. function isComment(node) {
  6627. return isVNode(node) && node.type === Comment;
  6628. }
  6629. function isValidElementNode(node) {
  6630. return isVNode(node) && !isFragment(node) && !isComment(node);
  6631. }
  6632. const getNormalizedProps = (node) => {
  6633. if (!isVNode(node)) {
  6634. /* @__PURE__ */ debugWarn(SCOPE$8, "[getNormalizedProps] must be a VNode");
  6635. return {};
  6636. }
  6637. const raw = node.props || {};
  6638. const type = (isVNode(node.type) ? node.type.props : void 0) || {};
  6639. const props = {};
  6640. Object.keys(type).forEach((key) => {
  6641. if (hasOwn(type[key], "default")) props[key] = type[key].default;
  6642. });
  6643. Object.keys(raw).forEach((key) => {
  6644. props[camelize(key)] = raw[key];
  6645. });
  6646. return props;
  6647. };
  6648. const flattedChildren = (children) => {
  6649. const vNodes = isArray$1(children) ? children : [children];
  6650. const result = [];
  6651. vNodes.forEach((child) => {
  6652. if (isArray$1(child)) result.push(...flattedChildren(child));
  6653. else if (isVNode(child) && child.component?.subTree) result.push(child, ...flattedChildren(child.component.subTree));
  6654. else if (isVNode(child) && isArray$1(child.children)) result.push(...flattedChildren(child.children));
  6655. else if (isVNode(child) && child.shapeFlag === 2) result.push(...flattedChildren(child.type()));
  6656. else result.push(child);
  6657. });
  6658. return result;
  6659. };
  6660. //#endregion
  6661. //#region ../../packages/utils/arrays.ts
  6662. const unique = (arr) => [...new Set(arr)];
  6663. const extractFirst = (arr) => {
  6664. return isArray$1(arr) ? arr[0] : arr;
  6665. };
  6666. /** like `_.castArray`, except falsy value returns empty array. */
  6667. const castArray = (arr) => {
  6668. if (!arr && arr !== 0) return [];
  6669. return isArray$1(arr) ? arr : [arr];
  6670. };
  6671. //#endregion
  6672. //#region ../../packages/utils/i18n.ts
  6673. const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
  6674. //#endregion
  6675. //#region ../../packages/utils/typescript.ts
  6676. const mutable = (val) => val;
  6677. //#endregion
  6678. //#region ../../packages/utils/throttleByRaf.ts
  6679. function throttleByRaf(cb) {
  6680. let timer = 0;
  6681. const throttle = (...args) => {
  6682. if (timer) cAF(timer);
  6683. timer = rAF(() => {
  6684. cb(...args);
  6685. timer = 0;
  6686. });
  6687. };
  6688. throttle.cancel = () => {
  6689. cAF(timer);
  6690. timer = 0;
  6691. };
  6692. return throttle;
  6693. }
  6694. //#endregion
  6695. //#region ../../packages/hooks/use-attrs/index.ts
  6696. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  6697. const LISTENER_PREFIX = /^on[A-Z]/;
  6698. const useAttrs = (params = {}) => {
  6699. const { excludeListeners = false, excludeKeys } = params;
  6700. const allExcludeKeys = computed(() => {
  6701. return (excludeKeys?.value || []).concat(DEFAULT_EXCLUDE_KEYS);
  6702. });
  6703. const instance = getCurrentInstance();
  6704. if (!instance) {
  6705. /* @__PURE__ */ debugWarn("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function");
  6706. return computed(() => ({}));
  6707. }
  6708. return computed(() => fromPairs(Object.entries(instance.proxy?.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key)))));
  6709. };
  6710. //#endregion
  6711. //#region ../../packages/hooks/use-calc-input-width/index.ts
  6712. function useCalcInputWidth() {
  6713. const calculatorRef = shallowRef();
  6714. const calculatorWidth = ref(0);
  6715. const inputStyle = computed(() => ({ minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px` }));
  6716. const resetCalculatorWidth = () => {
  6717. calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
  6718. };
  6719. useResizeObserver(calculatorRef, resetCalculatorWidth);
  6720. return {
  6721. calculatorRef,
  6722. calculatorWidth,
  6723. inputStyle
  6724. };
  6725. }
  6726. //#endregion
  6727. //#region ../../packages/hooks/use-deprecated/index.ts
  6728. const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
  6729. watch(() => unref(condition), (val) => {
  6730. if (val) /* @__PURE__ */ debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
  6731. For more detail, please visit: ${ref}
  6732. `);
  6733. }, { immediate: true });
  6734. };
  6735. //#endregion
  6736. //#region ../../packages/hooks/use-draggable/index.ts
  6737. const useDraggable = (targetRef, dragRef, draggable, overflow) => {
  6738. const transform = {
  6739. offsetX: 0,
  6740. offsetY: 0
  6741. };
  6742. const isDragging = ref(false);
  6743. const adjustPosition = (moveX, moveY) => {
  6744. if (targetRef.value) {
  6745. const { offsetX, offsetY } = transform;
  6746. const targetRect = targetRef.value.getBoundingClientRect();
  6747. const targetLeft = targetRect.left;
  6748. const targetTop = targetRect.top;
  6749. const targetWidth = targetRect.width;
  6750. const targetHeight = targetRect.height;
  6751. const clientWidth = document.documentElement.clientWidth;
  6752. const clientHeight = document.documentElement.clientHeight;
  6753. const minLeft = -targetLeft + offsetX;
  6754. const minTop = -targetTop + offsetY;
  6755. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  6756. const maxTop = clientHeight - targetTop - (targetHeight < clientHeight ? targetHeight : 0) + offsetY;
  6757. if (!overflow?.value) {
  6758. moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
  6759. moveY = Math.min(Math.max(moveY, minTop), maxTop);
  6760. }
  6761. transform.offsetX = moveX;
  6762. transform.offsetY = moveY;
  6763. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  6764. }
  6765. };
  6766. const onMousedown = (e) => {
  6767. const downX = e.clientX;
  6768. const downY = e.clientY;
  6769. const { offsetX, offsetY } = transform;
  6770. const onMousemove = (e) => {
  6771. if (!isDragging.value) isDragging.value = true;
  6772. adjustPosition(offsetX + e.clientX - downX, offsetY + e.clientY - downY);
  6773. };
  6774. const onMouseup = () => {
  6775. isDragging.value = false;
  6776. document.removeEventListener("mousemove", onMousemove);
  6777. document.removeEventListener("mouseup", onMouseup);
  6778. };
  6779. document.addEventListener("mousemove", onMousemove);
  6780. document.addEventListener("mouseup", onMouseup);
  6781. };
  6782. const onDraggable = () => {
  6783. if (dragRef.value && targetRef.value) {
  6784. dragRef.value.addEventListener("mousedown", onMousedown);
  6785. window.addEventListener("resize", updatePosition);
  6786. }
  6787. };
  6788. const offDraggable = () => {
  6789. if (dragRef.value && targetRef.value) {
  6790. dragRef.value.removeEventListener("mousedown", onMousedown);
  6791. window.removeEventListener("resize", updatePosition);
  6792. }
  6793. };
  6794. const resetPosition = () => {
  6795. transform.offsetX = 0;
  6796. transform.offsetY = 0;
  6797. if (targetRef.value) targetRef.value.style.transform = "";
  6798. };
  6799. const updatePosition = () => {
  6800. const { offsetX, offsetY } = transform;
  6801. adjustPosition(offsetX, offsetY);
  6802. };
  6803. onMounted(() => {
  6804. watchEffect(() => {
  6805. if (draggable.value) onDraggable();
  6806. else offDraggable();
  6807. });
  6808. });
  6809. onBeforeUnmount(() => {
  6810. offDraggable();
  6811. });
  6812. return {
  6813. isDragging,
  6814. resetPosition,
  6815. updatePosition
  6816. };
  6817. };
  6818. //#endregion
  6819. //#region ../../packages/hooks/use-focus/index.ts
  6820. const useFocus = (el) => {
  6821. return { focus: () => {
  6822. el.value?.focus?.();
  6823. } };
  6824. };
  6825. //#endregion
  6826. //#region ../../packages/locale/lang/en.ts
  6827. var en_default = {
  6828. name: "en",
  6829. el: {
  6830. breadcrumb: { label: "Breadcrumb" },
  6831. colorpicker: {
  6832. confirm: "OK",
  6833. clear: "Clear",
  6834. defaultLabel: "color picker",
  6835. description: "current color is {color}. press enter to select a new color.",
  6836. alphaLabel: "pick alpha value",
  6837. alphaDescription: "alpha {alpha}, current color is {color}",
  6838. hueLabel: "pick hue value",
  6839. hueDescription: "hue {hue}, current color is {color}",
  6840. svLabel: "pick saturation and brightness value",
  6841. svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}",
  6842. predefineDescription: "select {value} as the color"
  6843. },
  6844. datepicker: {
  6845. now: "Now",
  6846. today: "Today",
  6847. cancel: "Cancel",
  6848. clear: "Clear",
  6849. confirm: "OK",
  6850. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  6851. monthTablePrompt: "Use the arrow keys and enter to select the month",
  6852. yearTablePrompt: "Use the arrow keys and enter to select the year",
  6853. selectedDate: "Selected date",
  6854. selectDate: "Select date",
  6855. selectTime: "Select time",
  6856. startDate: "Start Date",
  6857. startTime: "Start Time",
  6858. endDate: "End Date",
  6859. endTime: "End Time",
  6860. prevYear: "Previous Year",
  6861. nextYear: "Next Year",
  6862. prevMonth: "Previous Month",
  6863. nextMonth: "Next Month",
  6864. year: "",
  6865. month1: "January",
  6866. month2: "February",
  6867. month3: "March",
  6868. month4: "April",
  6869. month5: "May",
  6870. month6: "June",
  6871. month7: "July",
  6872. month8: "August",
  6873. month9: "September",
  6874. month10: "October",
  6875. month11: "November",
  6876. month12: "December",
  6877. weeks: {
  6878. sun: "Sun",
  6879. mon: "Mon",
  6880. tue: "Tue",
  6881. wed: "Wed",
  6882. thu: "Thu",
  6883. fri: "Fri",
  6884. sat: "Sat"
  6885. },
  6886. weeksFull: {
  6887. sun: "Sunday",
  6888. mon: "Monday",
  6889. tue: "Tuesday",
  6890. wed: "Wednesday",
  6891. thu: "Thursday",
  6892. fri: "Friday",
  6893. sat: "Saturday"
  6894. },
  6895. months: {
  6896. jan: "Jan",
  6897. feb: "Feb",
  6898. mar: "Mar",
  6899. apr: "Apr",
  6900. may: "May",
  6901. jun: "Jun",
  6902. jul: "Jul",
  6903. aug: "Aug",
  6904. sep: "Sep",
  6905. oct: "Oct",
  6906. nov: "Nov",
  6907. dec: "Dec"
  6908. }
  6909. },
  6910. inputNumber: {
  6911. decrease: "decrease number",
  6912. increase: "increase number"
  6913. },
  6914. select: {
  6915. loading: "Loading",
  6916. noMatch: "No matching data",
  6917. noData: "No data",
  6918. placeholder: "Select"
  6919. },
  6920. mention: { loading: "Loading" },
  6921. dropdown: { toggleDropdown: "Toggle Dropdown" },
  6922. cascader: {
  6923. noMatch: "No matching data",
  6924. loading: "Loading",
  6925. placeholder: "Select",
  6926. noData: "No data"
  6927. },
  6928. pagination: {
  6929. goto: "Go to",
  6930. pagesize: "/page",
  6931. total: "Total {total}",
  6932. pageClassifier: "",
  6933. page: "Page",
  6934. prev: "Go to previous page",
  6935. next: "Go to next page",
  6936. currentPage: "page {pager}",
  6937. prevPages: "Previous {pager} pages",
  6938. nextPages: "Next {pager} pages",
  6939. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  6940. },
  6941. dialog: { close: "Close this dialog" },
  6942. drawer: { close: "Close this dialog" },
  6943. messagebox: {
  6944. title: "Message",
  6945. confirm: "OK",
  6946. cancel: "Cancel",
  6947. error: "Illegal input",
  6948. close: "Close this dialog"
  6949. },
  6950. upload: {
  6951. deleteTip: "press delete to remove",
  6952. delete: "Delete",
  6953. preview: "Preview",
  6954. continue: "Continue"
  6955. },
  6956. slider: {
  6957. defaultLabel: "slider between {min} and {max}",
  6958. defaultRangeStartLabel: "pick start value",
  6959. defaultRangeEndLabel: "pick end value"
  6960. },
  6961. table: {
  6962. emptyText: "No Data",
  6963. confirmFilter: "Confirm",
  6964. resetFilter: "Reset",
  6965. clearFilter: "All",
  6966. sumText: "Sum",
  6967. selectAllLabel: "Select all rows",
  6968. selectRowLabel: "Select this row",
  6969. expandRowLabel: "Expand this row",
  6970. collapseRowLabel: "Collapse this row",
  6971. sortLabel: "Sort by {column}",
  6972. filterLabel: "Filter by {column}"
  6973. },
  6974. tag: { close: "Close this tag" },
  6975. tour: {
  6976. next: "Next",
  6977. previous: "Previous",
  6978. finish: "Finish",
  6979. close: "Close this dialog"
  6980. },
  6981. tree: { emptyText: "No Data" },
  6982. transfer: {
  6983. noMatch: "No matching data",
  6984. noData: "No data",
  6985. titles: ["List 1", "List 2"],
  6986. filterPlaceholder: "Enter keyword",
  6987. noCheckedFormat: "{total} items",
  6988. hasCheckedFormat: "{checked}/{total} checked"
  6989. },
  6990. image: { error: "FAILED" },
  6991. pageHeader: { title: "Back" },
  6992. popconfirm: {
  6993. confirmButtonText: "Yes",
  6994. cancelButtonText: "No"
  6995. },
  6996. carousel: {
  6997. leftArrow: "Carousel arrow left",
  6998. rightArrow: "Carousel arrow right",
  6999. indicator: "Carousel switch to index {index}"
  7000. }
  7001. }
  7002. };
  7003. //#endregion
  7004. //#region ../../packages/hooks/use-locale/index.ts
  7005. const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
  7006. const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${option?.[key] ?? `{${key}}`}`);
  7007. const buildLocaleContext = (locale) => {
  7008. return {
  7009. lang: computed(() => unref(locale).name),
  7010. locale: isRef(locale) ? locale : ref(locale),
  7011. t: buildTranslator(locale)
  7012. };
  7013. };
  7014. const localeContextKey = Symbol("localeContextKey");
  7015. const useLocale = (localeOverrides) => {
  7016. const locale = localeOverrides || inject(localeContextKey, ref());
  7017. return buildLocaleContext(computed(() => locale.value || en_default));
  7018. };
  7019. //#endregion
  7020. //#region ../../packages/hooks/use-namespace/index.ts
  7021. const defaultNamespace = "el";
  7022. const statePrefix = "is-";
  7023. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  7024. let cls = `${namespace}-${block}`;
  7025. if (blockSuffix) cls += `-${blockSuffix}`;
  7026. if (element) cls += `__${element}`;
  7027. if (modifier) cls += `--${modifier}`;
  7028. return cls;
  7029. };
  7030. const namespaceContextKey = Symbol("namespaceContextKey");
  7031. const useGetDerivedNamespace = (namespaceOverrides) => {
  7032. const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
  7033. return computed(() => {
  7034. return unref(derivedNamespace) || defaultNamespace;
  7035. });
  7036. };
  7037. const useNamespace = (block, namespaceOverrides) => {
  7038. const namespace = useGetDerivedNamespace(namespaceOverrides);
  7039. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  7040. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  7041. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  7042. const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  7043. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  7044. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  7045. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  7046. const is = (name, ...args) => {
  7047. const state = args.length >= 1 ? args[0] : true;
  7048. return name && state ? `${statePrefix}${name}` : "";
  7049. };
  7050. const cssVar = (object) => {
  7051. const styles = {};
  7052. for (const key in object) if (object[key]) styles[`--${namespace.value}-${key}`] = object[key];
  7053. return styles;
  7054. };
  7055. const cssVarBlock = (object) => {
  7056. const styles = {};
  7057. for (const key in object) if (object[key]) styles[`--${namespace.value}-${block}-${key}`] = object[key];
  7058. return styles;
  7059. };
  7060. const cssVarName = (name) => `--${namespace.value}-${name}`;
  7061. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  7062. return {
  7063. namespace,
  7064. b,
  7065. e,
  7066. m,
  7067. be,
  7068. em,
  7069. bm,
  7070. bem,
  7071. is,
  7072. cssVar,
  7073. cssVarName,
  7074. cssVarBlock,
  7075. cssVarBlockName
  7076. };
  7077. };
  7078. //#endregion
  7079. //#region ../../packages/hooks/use-lockscreen/index.ts
  7080. /**
  7081. * Hook that monitoring the ref value to lock or unlock the screen.
  7082. * When the trigger became true, it assumes modal is now opened and vice versa.
  7083. * @param trigger {Ref<boolean>}
  7084. */
  7085. const useLockscreen = (trigger, options = {}) => {
  7086. if (!isRef(trigger)) throwError("[useLockscreen]", "You need to pass a ref param to this function");
  7087. const ns = options.ns || useNamespace("popup");
  7088. const hiddenCls = computed(() => ns.bm("parent", "hidden"));
  7089. let scrollBarWidth = 0;
  7090. let withoutHiddenClass = false;
  7091. let bodyWidth = "0";
  7092. let cleaned = false;
  7093. const cleanup = () => {
  7094. if (cleaned) return;
  7095. cleaned = true;
  7096. setTimeout(() => {
  7097. if (typeof document === "undefined") return;
  7098. if (withoutHiddenClass && document) {
  7099. document.body.style.width = bodyWidth;
  7100. removeClass(document.body, hiddenCls.value);
  7101. }
  7102. }, 200);
  7103. };
  7104. watch(trigger, (val) => {
  7105. if (!val) {
  7106. cleanup();
  7107. return;
  7108. }
  7109. cleaned = false;
  7110. withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
  7111. if (withoutHiddenClass) {
  7112. bodyWidth = document.body.style.width;
  7113. addClass(document.body, hiddenCls.value);
  7114. }
  7115. scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  7116. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  7117. const bodyOverflowY = getStyle(document.body, "overflowY");
  7118. if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;
  7119. });
  7120. onScopeDispose(() => cleanup());
  7121. };
  7122. //#endregion
  7123. //#region ../../packages/hooks/use-modal/index.ts
  7124. const modalStack = [];
  7125. const closeModal = (e) => {
  7126. if (modalStack.length === 0) return;
  7127. if (getEventCode(e) === EVENT_CODE.esc) {
  7128. e.stopPropagation();
  7129. modalStack[modalStack.length - 1].handleClose();
  7130. }
  7131. };
  7132. const useModal = (instance, visibleRef) => {
  7133. watch(visibleRef, (val) => {
  7134. if (val) modalStack.push(instance);
  7135. else modalStack.splice(modalStack.indexOf(instance), 1);
  7136. });
  7137. };
  7138. if (isClient) useEventListener(document, "keydown", closeModal);
  7139. //#endregion
  7140. //#region ../../packages/hooks/use-model-toggle/index.ts
  7141. const _prop = buildProp({
  7142. type: definePropType(Boolean),
  7143. default: null
  7144. });
  7145. const _event = buildProp({ type: definePropType(Function) });
  7146. const createModelToggleComposable = (name) => {
  7147. const updateEventKey = `update:${name}`;
  7148. const updateEventKeyRaw = `onUpdate:${name}`;
  7149. const useModelToggleEmits = [updateEventKey];
  7150. const useModelToggleProps = {
  7151. [name]: _prop,
  7152. [updateEventKeyRaw]: _event
  7153. };
  7154. const useModelToggle = ({ indicator, toggleReason, shouldHideWhenRouteChanges, shouldProceed, onShow, onHide }) => {
  7155. const instance = getCurrentInstance();
  7156. const { emit } = instance;
  7157. const props = instance.props;
  7158. const hasUpdateHandler = computed(() => isFunction$1(props[updateEventKeyRaw]));
  7159. const isModelBindingAbsent = computed(() => props[name] === null);
  7160. const doShow = (event) => {
  7161. if (indicator.value === true) return;
  7162. indicator.value = true;
  7163. if (toggleReason) toggleReason.value = event;
  7164. if (isFunction$1(onShow)) onShow(event);
  7165. };
  7166. const doHide = (event) => {
  7167. if (indicator.value === false) return;
  7168. indicator.value = false;
  7169. if (toggleReason) toggleReason.value = event;
  7170. if (isFunction$1(onHide)) onHide(event);
  7171. };
  7172. const show = (event) => {
  7173. if (props.disabled === true || isFunction$1(shouldProceed) && !shouldProceed()) return;
  7174. const shouldEmit = hasUpdateHandler.value && isClient;
  7175. if (shouldEmit) emit(updateEventKey, true);
  7176. if (isModelBindingAbsent.value || !shouldEmit) doShow(event);
  7177. };
  7178. const hide = (event) => {
  7179. if (props.disabled === true || !isClient) return;
  7180. const shouldEmit = hasUpdateHandler.value && isClient;
  7181. if (shouldEmit) emit(updateEventKey, false);
  7182. if (isModelBindingAbsent.value || !shouldEmit) doHide(event);
  7183. };
  7184. const onChange = (val) => {
  7185. if (!isBoolean(val)) return;
  7186. if (props.disabled && val) {
  7187. if (hasUpdateHandler.value) emit(updateEventKey, false);
  7188. } else if (indicator.value !== val) if (val) doShow();
  7189. else doHide();
  7190. };
  7191. const toggle = () => {
  7192. if (indicator.value) hide();
  7193. else show();
  7194. };
  7195. watch(() => props[name], onChange);
  7196. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) watch(() => ({ ...instance.proxy.$route }), () => {
  7197. if (shouldHideWhenRouteChanges.value && indicator.value) hide();
  7198. });
  7199. onMounted(() => {
  7200. onChange(props[name]);
  7201. });
  7202. return {
  7203. hide,
  7204. show,
  7205. toggle,
  7206. hasUpdateHandler
  7207. };
  7208. };
  7209. return {
  7210. useModelToggle,
  7211. useModelToggleProps,
  7212. useModelToggleEmits
  7213. };
  7214. };
  7215. const { useModelToggle, useModelToggleProps, useModelToggleEmits } = createModelToggleComposable("modelValue");
  7216. //#endregion
  7217. //#region ../../packages/hooks/use-prevent-global/index.ts
  7218. const usePreventGlobal = (indicator, evt, cb) => {
  7219. const prevent = (e) => {
  7220. if (cb(e)) e.stopImmediatePropagation();
  7221. };
  7222. let stop = void 0;
  7223. watch(() => indicator.value, (val) => {
  7224. if (val) stop = useEventListener(document, evt, prevent, true);
  7225. else stop?.();
  7226. }, { immediate: true });
  7227. };
  7228. //#endregion
  7229. //#region ../../packages/hooks/use-prop/index.ts
  7230. const useProp = (name) => {
  7231. const vm = getCurrentInstance();
  7232. return computed(() => (vm?.proxy?.$props)?.[name]);
  7233. };
  7234. //#endregion
  7235. //#region ../../node_modules/.pnpm/@sxzz+popperjs-es@2.11.7/node_modules/@sxzz/popperjs-es/dist/index.mjs
  7236. var E$1 = "top", R = "bottom", W = "right", P$1 = "left", me = "auto", G = [
  7237. E$1,
  7238. R,
  7239. W,
  7240. P$1
  7241. ], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t, e) {
  7242. return t.concat([e + "-" + U, e + "-" + J]);
  7243. }, []), Ee = [].concat(G, [me]).reduce(function(t, e) {
  7244. return t.concat([
  7245. e,
  7246. e + "-" + U,
  7247. e + "-" + J
  7248. ]);
  7249. }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt = "afterWrite", ot = [
  7250. Ge,
  7251. Je,
  7252. Ke,
  7253. Qe,
  7254. Ze,
  7255. et,
  7256. tt,
  7257. nt,
  7258. rt
  7259. ];
  7260. function C(t) {
  7261. return t ? (t.nodeName || "").toLowerCase() : null;
  7262. }
  7263. function H(t) {
  7264. if (t == null) return window;
  7265. if (t.toString() !== "[object Window]") {
  7266. var e = t.ownerDocument;
  7267. return e && e.defaultView || window;
  7268. }
  7269. return t;
  7270. }
  7271. function Q(t) {
  7272. return t instanceof H(t).Element || t instanceof Element;
  7273. }
  7274. function B(t) {
  7275. return t instanceof H(t).HTMLElement || t instanceof HTMLElement;
  7276. }
  7277. function Pe(t) {
  7278. if (typeof ShadowRoot == "undefined") return !1;
  7279. return t instanceof H(t).ShadowRoot || t instanceof ShadowRoot;
  7280. }
  7281. function Mt(t) {
  7282. var e = t.state;
  7283. Object.keys(e.elements).forEach(function(n) {
  7284. var r = e.styles[n] || {}, o = e.attributes[n] || {}, i = e.elements[n];
  7285. !B(i) || !C(i) || (Object.assign(i.style, r), Object.keys(o).forEach(function(a) {
  7286. var s = o[a];
  7287. s === !1 ? i.removeAttribute(a) : i.setAttribute(a, s === !0 ? "" : s);
  7288. }));
  7289. });
  7290. }
  7291. function Rt(t) {
  7292. var e = t.state, n = {
  7293. popper: {
  7294. position: e.options.strategy,
  7295. left: "0",
  7296. top: "0",
  7297. margin: "0"
  7298. },
  7299. arrow: { position: "absolute" },
  7300. reference: {}
  7301. };
  7302. return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
  7303. Object.keys(e.elements).forEach(function(r) {
  7304. var o = e.elements[r], i = e.attributes[r] || {}, s = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]).reduce(function(f, c) {
  7305. return f[c] = "", f;
  7306. }, {});
  7307. !B(o) || !C(o) || (Object.assign(o.style, s), Object.keys(i).forEach(function(f) {
  7308. o.removeAttribute(f);
  7309. }));
  7310. });
  7311. };
  7312. }
  7313. var Ae = {
  7314. name: "applyStyles",
  7315. enabled: !0,
  7316. phase: "write",
  7317. fn: Mt,
  7318. effect: Rt,
  7319. requires: ["computeStyles"]
  7320. };
  7321. function q(t) {
  7322. return t.split("-")[0];
  7323. }
  7324. var X$1 = Math.max, ve = Math.min, Z = Math.round;
  7325. function ee(t, e) {
  7326. e === void 0 && (e = !1);
  7327. var n = t.getBoundingClientRect(), r = 1, o = 1;
  7328. if (B(t) && e) {
  7329. var i = t.offsetHeight, a = t.offsetWidth;
  7330. a > 0 && (r = Z(n.width) / a || 1), i > 0 && (o = Z(n.height) / i || 1);
  7331. }
  7332. return {
  7333. width: n.width / r,
  7334. height: n.height / o,
  7335. top: n.top / o,
  7336. right: n.right / r,
  7337. bottom: n.bottom / o,
  7338. left: n.left / r,
  7339. x: n.left / r,
  7340. y: n.top / o
  7341. };
  7342. }
  7343. function ke(t) {
  7344. var e = ee(t), n = t.offsetWidth, r = t.offsetHeight;
  7345. return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
  7346. x: t.offsetLeft,
  7347. y: t.offsetTop,
  7348. width: n,
  7349. height: r
  7350. };
  7351. }
  7352. function it(t, e) {
  7353. var n = e.getRootNode && e.getRootNode();
  7354. if (t.contains(e)) return !0;
  7355. if (n && Pe(n)) {
  7356. var r = e;
  7357. do {
  7358. if (r && t.isSameNode(r)) return !0;
  7359. r = r.parentNode || r.host;
  7360. } while (r);
  7361. }
  7362. return !1;
  7363. }
  7364. function N$1(t) {
  7365. return H(t).getComputedStyle(t);
  7366. }
  7367. function Wt(t) {
  7368. return [
  7369. "table",
  7370. "td",
  7371. "th"
  7372. ].indexOf(C(t)) >= 0;
  7373. }
  7374. function I$1(t) {
  7375. return ((Q(t) ? t.ownerDocument : t.document) || window.document).documentElement;
  7376. }
  7377. function ge(t) {
  7378. return C(t) === "html" ? t : t.assignedSlot || t.parentNode || (Pe(t) ? t.host : null) || I$1(t);
  7379. }
  7380. function at(t) {
  7381. return !B(t) || N$1(t).position === "fixed" ? null : t.offsetParent;
  7382. }
  7383. function Bt(t) {
  7384. var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
  7385. if (navigator.userAgent.indexOf("Trident") !== -1 && B(t)) {
  7386. if (N$1(t).position === "fixed") return null;
  7387. }
  7388. var o = ge(t);
  7389. for (Pe(o) && (o = o.host); B(o) && ["html", "body"].indexOf(C(o)) < 0;) {
  7390. var i = N$1(o);
  7391. if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return o;
  7392. o = o.parentNode;
  7393. }
  7394. return null;
  7395. }
  7396. function se(t) {
  7397. for (var e = H(t), n = at(t); n && Wt(n) && N$1(n).position === "static";) n = at(n);
  7398. return n && (C(n) === "html" || C(n) === "body" && N$1(n).position === "static") ? e : n || Bt(t) || e;
  7399. }
  7400. function Le(t) {
  7401. return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
  7402. }
  7403. function fe(t, e, n) {
  7404. return X$1(t, ve(e, n));
  7405. }
  7406. function St(t, e, n) {
  7407. var r = fe(t, e, n);
  7408. return r > n ? n : r;
  7409. }
  7410. function st() {
  7411. return {
  7412. top: 0,
  7413. right: 0,
  7414. bottom: 0,
  7415. left: 0
  7416. };
  7417. }
  7418. function ft(t) {
  7419. return Object.assign({}, st(), t);
  7420. }
  7421. function ct(t, e) {
  7422. return e.reduce(function(n, r) {
  7423. return n[r] = t, n;
  7424. }, {});
  7425. }
  7426. var Tt = function(t, e) {
  7427. return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, ft(typeof t != "number" ? t : ct(t, G));
  7428. };
  7429. function Ht(t) {
  7430. var e, n = t.state, r = t.name, o = t.options, i = n.elements.arrow, a = n.modifiersData.popperOffsets, s = q(n.placement), f = Le(s), u = [P$1, W].indexOf(s) >= 0 ? "height" : "width";
  7431. if (!(!i || !a)) {
  7432. var m = Tt(o.padding, n), v = ke(i), l = f === "y" ? E$1 : P$1, h = f === "y" ? R : W, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], x = se(i), y = x ? f === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, $ = p / 2 - g / 2, d = m[l], b = y - v[u] - m[h], w = y / 2 - v[u] / 2 + $, O = fe(d, w, b), j = f;
  7433. n.modifiersData[r] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
  7434. }
  7435. }
  7436. function Ct(t) {
  7437. var e = t.state, r = t.options.element, o = r === void 0 ? "[data-popper-arrow]" : r;
  7438. o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !it(e.elements.popper, o) || (e.elements.arrow = o));
  7439. }
  7440. var pt = {
  7441. name: "arrow",
  7442. enabled: !0,
  7443. phase: "main",
  7444. fn: Ht,
  7445. effect: Ct,
  7446. requires: ["popperOffsets"],
  7447. requiresIfExists: ["preventOverflow"]
  7448. };
  7449. function te(t) {
  7450. return t.split("-")[1];
  7451. }
  7452. var qt = {
  7453. top: "auto",
  7454. right: "auto",
  7455. bottom: "auto",
  7456. left: "auto"
  7457. };
  7458. function Vt(t) {
  7459. var e = t.x, n = t.y, o = window.devicePixelRatio || 1;
  7460. return {
  7461. x: Z(e * o) / o || 0,
  7462. y: Z(n * o) / o || 0
  7463. };
  7464. }
  7465. function ut(t) {
  7466. var e, n = t.popper, r = t.popperRect, o = t.placement, i = t.variation, a = t.offsets, s = t.position, f = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, m = t.isFixed, v = a.x, l = v === void 0 ? 0 : v, h = a.y, p = h === void 0 ? 0 : h, g = typeof u == "function" ? u({
  7467. x: l,
  7468. y: p
  7469. }) : {
  7470. x: l,
  7471. y: p
  7472. };
  7473. l = g.x, p = g.y;
  7474. var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $ = P$1, d = E$1, b = window;
  7475. if (c) {
  7476. var w = se(n), O = "clientHeight", j = "clientWidth";
  7477. if (w === H(n) && (w = I$1(n), N$1(w).position !== "static" && s === "absolute" && (O = "scrollHeight", j = "scrollWidth")), w = w, o === E$1 || (o === P$1 || o === W) && i === J) {
  7478. d = R;
  7479. var A = m && w === b && b.visualViewport ? b.visualViewport.height : w[O];
  7480. p -= A - r.height, p *= f ? 1 : -1;
  7481. }
  7482. if (o === P$1 || (o === E$1 || o === R) && i === J) {
  7483. $ = W;
  7484. var k = m && w === b && b.visualViewport ? b.visualViewport.width : w[j];
  7485. l -= k - r.width, l *= f ? 1 : -1;
  7486. }
  7487. }
  7488. var D = Object.assign({ position: s }, c && qt), S = u === !0 ? Vt({
  7489. x: l,
  7490. y: p
  7491. }) : {
  7492. x: l,
  7493. y: p
  7494. };
  7495. if (l = S.x, p = S.y, f) {
  7496. var L;
  7497. return Object.assign({}, D, (L = {}, L[d] = y ? "0" : "", L[$] = x ? "0" : "", L.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + l + "px, " + p + "px)" : "translate3d(" + l + "px, " + p + "px, 0)", L));
  7498. }
  7499. return Object.assign({}, D, (e = {}, e[d] = y ? p + "px" : "", e[$] = x ? l + "px" : "", e.transform = "", e));
  7500. }
  7501. function Nt(t) {
  7502. var e = t.state, n = t.options, r = n.gpuAcceleration, o = r === void 0 ? !0 : r, i = n.adaptive, a = i === void 0 ? !0 : i, s = n.roundOffsets, f = s === void 0 ? !0 : s, c = {
  7503. placement: q(e.placement),
  7504. variation: te(e.placement),
  7505. popper: e.elements.popper,
  7506. popperRect: e.rects.popper,
  7507. gpuAcceleration: o,
  7508. isFixed: e.options.strategy === "fixed"
  7509. };
  7510. e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, ut(Object.assign({}, c, {
  7511. offsets: e.modifiersData.popperOffsets,
  7512. position: e.options.strategy,
  7513. adaptive: a,
  7514. roundOffsets: f
  7515. })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, ut(Object.assign({}, c, {
  7516. offsets: e.modifiersData.arrow,
  7517. position: "absolute",
  7518. adaptive: !1,
  7519. roundOffsets: f
  7520. })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
  7521. }
  7522. var Me = {
  7523. name: "computeStyles",
  7524. enabled: !0,
  7525. phase: "beforeWrite",
  7526. fn: Nt,
  7527. data: {}
  7528. }, ye = { passive: !0 };
  7529. function It(t) {
  7530. var e = t.state, n = t.instance, r = t.options, o = r.scroll, i = o === void 0 ? !0 : o, a = r.resize, s = a === void 0 ? !0 : a, f = H(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  7531. return i && c.forEach(function(u) {
  7532. u.addEventListener("scroll", n.update, ye);
  7533. }), s && f.addEventListener("resize", n.update, ye), function() {
  7534. i && c.forEach(function(u) {
  7535. u.removeEventListener("scroll", n.update, ye);
  7536. }), s && f.removeEventListener("resize", n.update, ye);
  7537. };
  7538. }
  7539. var Re = {
  7540. name: "eventListeners",
  7541. enabled: !0,
  7542. phase: "write",
  7543. fn: function() {},
  7544. effect: It,
  7545. data: {}
  7546. }, _t = {
  7547. left: "right",
  7548. right: "left",
  7549. bottom: "top",
  7550. top: "bottom"
  7551. };
  7552. function be(t) {
  7553. return t.replace(/left|right|bottom|top/g, function(e) {
  7554. return _t[e];
  7555. });
  7556. }
  7557. var zt = {
  7558. start: "end",
  7559. end: "start"
  7560. };
  7561. function lt(t) {
  7562. return t.replace(/start|end/g, function(e) {
  7563. return zt[e];
  7564. });
  7565. }
  7566. function We(t) {
  7567. var e = H(t);
  7568. return {
  7569. scrollLeft: e.pageXOffset,
  7570. scrollTop: e.pageYOffset
  7571. };
  7572. }
  7573. function Be(t) {
  7574. return ee(I$1(t)).left + We(t).scrollLeft;
  7575. }
  7576. function Ft(t) {
  7577. var e = H(t), n = I$1(t), r = e.visualViewport, o = n.clientWidth, i = n.clientHeight, a = 0, s = 0;
  7578. return r && (o = r.width, i = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), {
  7579. width: o,
  7580. height: i,
  7581. x: a + Be(t),
  7582. y: s
  7583. };
  7584. }
  7585. function Ut(t) {
  7586. var e, n = I$1(t), r = We(t), o = (e = t.ownerDocument) == null ? void 0 : e.body, i = X$1(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = X$1(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), s = -r.scrollLeft + Be(t), f = -r.scrollTop;
  7587. return N$1(o || n).direction === "rtl" && (s += X$1(n.clientWidth, o ? o.clientWidth : 0) - i), {
  7588. width: i,
  7589. height: a,
  7590. x: s,
  7591. y: f
  7592. };
  7593. }
  7594. function Se(t) {
  7595. var e = N$1(t), n = e.overflow, r = e.overflowX, o = e.overflowY;
  7596. return /auto|scroll|overlay|hidden/.test(n + o + r);
  7597. }
  7598. function dt(t) {
  7599. return [
  7600. "html",
  7601. "body",
  7602. "#document"
  7603. ].indexOf(C(t)) >= 0 ? t.ownerDocument.body : B(t) && Se(t) ? t : dt(ge(t));
  7604. }
  7605. function ce(t, e) {
  7606. var n;
  7607. e === void 0 && (e = []);
  7608. var r = dt(t), o = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i = H(r), a = o ? [i].concat(i.visualViewport || [], Se(r) ? r : []) : r, s = e.concat(a);
  7609. return o ? s : s.concat(ce(ge(a)));
  7610. }
  7611. function Te(t) {
  7612. return Object.assign({}, t, {
  7613. left: t.x,
  7614. top: t.y,
  7615. right: t.x + t.width,
  7616. bottom: t.y + t.height
  7617. });
  7618. }
  7619. function Xt(t) {
  7620. var e = ee(t);
  7621. return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e;
  7622. }
  7623. function ht(t, e) {
  7624. return e === je ? Te(Ft(t)) : Q(e) ? Xt(e) : Te(Ut(I$1(t)));
  7625. }
  7626. function Yt(t) {
  7627. var e = ce(ge(t)), r = ["absolute", "fixed"].indexOf(N$1(t).position) >= 0 && B(t) ? se(t) : t;
  7628. return Q(r) ? e.filter(function(o) {
  7629. return Q(o) && it(o, r) && C(o) !== "body";
  7630. }) : [];
  7631. }
  7632. function Gt(t, e, n) {
  7633. var r = e === "clippingParents" ? Yt(t) : [].concat(e), o = [].concat(r, [n]), i = o[0], a = o.reduce(function(s, f) {
  7634. var c = ht(t, f);
  7635. return s.top = X$1(c.top, s.top), s.right = ve(c.right, s.right), s.bottom = ve(c.bottom, s.bottom), s.left = X$1(c.left, s.left), s;
  7636. }, ht(t, i));
  7637. return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
  7638. }
  7639. function mt(t) {
  7640. var e = t.reference, n = t.element, r = t.placement, o = r ? q(r) : null, i = r ? te(r) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, f;
  7641. switch (o) {
  7642. case E$1:
  7643. f = {
  7644. x: a,
  7645. y: e.y - n.height
  7646. };
  7647. break;
  7648. case R:
  7649. f = {
  7650. x: a,
  7651. y: e.y + e.height
  7652. };
  7653. break;
  7654. case W:
  7655. f = {
  7656. x: e.x + e.width,
  7657. y: s
  7658. };
  7659. break;
  7660. case P$1:
  7661. f = {
  7662. x: e.x - n.width,
  7663. y: s
  7664. };
  7665. break;
  7666. default: f = {
  7667. x: e.x,
  7668. y: e.y
  7669. };
  7670. }
  7671. var c = o ? Le(o) : null;
  7672. if (c != null) {
  7673. var u = c === "y" ? "height" : "width";
  7674. switch (i) {
  7675. case U:
  7676. f[c] = f[c] - (e[u] / 2 - n[u] / 2);
  7677. break;
  7678. case J:
  7679. f[c] = f[c] + (e[u] / 2 - n[u] / 2);
  7680. break;
  7681. }
  7682. }
  7683. return f;
  7684. }
  7685. function ne(t, e) {
  7686. e === void 0 && (e = {});
  7687. var n = e, r = n.placement, o = r === void 0 ? t.placement : r, i = n.boundary, a = i === void 0 ? Xe : i, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? !1 : m, l = n.padding, h = l === void 0 ? 0 : l, p = ft(typeof h != "number" ? h : ct(h, G)), g = u === K ? Ye : K, x = t.rects.popper, y = t.elements[v ? g : u], $ = Gt(Q(y) ? y : y.contextElement || I$1(t.elements.popper), a, f), d = ee(t.elements.reference), b = mt({
  7688. reference: d,
  7689. element: x,
  7690. strategy: "absolute",
  7691. placement: o
  7692. }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d, j = {
  7693. top: $.top - O.top + p.top,
  7694. bottom: O.bottom - $.bottom + p.bottom,
  7695. left: $.left - O.left + p.left,
  7696. right: O.right - $.right + p.right
  7697. }, A = t.modifiersData.offset;
  7698. if (u === K && A) {
  7699. var k = A[o];
  7700. Object.keys(j).forEach(function(D) {
  7701. var S = [W, R].indexOf(D) >= 0 ? 1 : -1, L = [E$1, R].indexOf(D) >= 0 ? "y" : "x";
  7702. j[D] += k[L] * S;
  7703. });
  7704. }
  7705. return j;
  7706. }
  7707. function Jt(t, e) {
  7708. e === void 0 && (e = {});
  7709. var n = e, r = n.placement, o = n.boundary, i = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r), m = u ? s ? De : De.filter(function(h) {
  7710. return te(h) === u;
  7711. }) : G, v = m.filter(function(h) {
  7712. return c.indexOf(h) >= 0;
  7713. });
  7714. v.length === 0 && (v = m);
  7715. var l = v.reduce(function(h, p) {
  7716. return h[p] = ne(t, {
  7717. placement: p,
  7718. boundary: o,
  7719. rootBoundary: i,
  7720. padding: a
  7721. })[q(p)], h;
  7722. }, {});
  7723. return Object.keys(l).sort(function(h, p) {
  7724. return l[h] - l[p];
  7725. });
  7726. }
  7727. function Kt(t) {
  7728. if (q(t) === me) return [];
  7729. var e = be(t);
  7730. return [
  7731. lt(t),
  7732. e,
  7733. lt(e)
  7734. ];
  7735. }
  7736. function Qt(t) {
  7737. var e = t.state, n = t.options, r = t.name;
  7738. if (!e.modifiersData[r]._skip) {
  7739. for (var o = n.mainAxis, i = o === void 0 ? !0 : o, a = n.altAxis, s = a === void 0 ? !0 : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, h = l === void 0 ? !0 : l, p = n.allowedAutoPlacements, g = e.options.placement, y = q(g) === g, $ = f || (y || !h ? [be(g)] : Kt(g)), d = [g].concat($).reduce(function(z, V) {
  7740. return z.concat(q(V) === me ? Jt(e, {
  7741. placement: V,
  7742. boundary: u,
  7743. rootBoundary: m,
  7744. padding: c,
  7745. flipVariations: h,
  7746. allowedAutoPlacements: p
  7747. }) : V);
  7748. }, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = !0, A = d[0], k = 0; k < d.length; k++) {
  7749. var D = d[k], S = q(D), L = te(D) === U, re = [E$1, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, {
  7750. placement: D,
  7751. boundary: u,
  7752. rootBoundary: m,
  7753. altBoundary: v,
  7754. padding: c
  7755. }), T = re ? L ? W : P$1 : L ? R : E$1;
  7756. b[oe] > w[oe] && (T = be(T));
  7757. var pe = be(T), _ = [];
  7758. if (i && _.push(M[S] <= 0), s && _.push(M[T] <= 0, M[pe] <= 0), _.every(function(z) {
  7759. return z;
  7760. })) {
  7761. A = D, j = !1;
  7762. break;
  7763. }
  7764. O.set(D, _);
  7765. }
  7766. if (j) {
  7767. for (var ue = h ? 3 : 1, xe = function(z) {
  7768. var V = d.find(function(de) {
  7769. var ae = O.get(de);
  7770. if (ae) return ae.slice(0, z).every(function(Y) {
  7771. return Y;
  7772. });
  7773. });
  7774. if (V) return A = V, "break";
  7775. }, ie = ue; ie > 0; ie--) if (xe(ie) === "break") break;
  7776. }
  7777. e.placement !== A && (e.modifiersData[r]._skip = !0, e.placement = A, e.reset = !0);
  7778. }
  7779. }
  7780. var vt = {
  7781. name: "flip",
  7782. enabled: !0,
  7783. phase: "main",
  7784. fn: Qt,
  7785. requiresIfExists: ["offset"],
  7786. data: { _skip: !1 }
  7787. };
  7788. function gt(t, e, n) {
  7789. return n === void 0 && (n = {
  7790. x: 0,
  7791. y: 0
  7792. }), {
  7793. top: t.top - e.height - n.y,
  7794. right: t.right - e.width + n.x,
  7795. bottom: t.bottom - e.height + n.y,
  7796. left: t.left - e.width - n.x
  7797. };
  7798. }
  7799. function yt(t) {
  7800. return [
  7801. E$1,
  7802. W,
  7803. R,
  7804. P$1
  7805. ].some(function(e) {
  7806. return t[e] >= 0;
  7807. });
  7808. }
  7809. function Zt(t) {
  7810. var e = t.state, n = t.name, r = e.rects.reference, o = e.rects.popper, i = e.modifiersData.preventOverflow, a = ne(e, { elementContext: "reference" }), s = ne(e, { altBoundary: !0 }), f = gt(a, r), c = gt(s, o, i), u = yt(f), m = yt(c);
  7811. e.modifiersData[n] = {
  7812. referenceClippingOffsets: f,
  7813. popperEscapeOffsets: c,
  7814. isReferenceHidden: u,
  7815. hasPopperEscaped: m
  7816. }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
  7817. "data-popper-reference-hidden": u,
  7818. "data-popper-escaped": m
  7819. });
  7820. }
  7821. var bt = {
  7822. name: "hide",
  7823. enabled: !0,
  7824. phase: "main",
  7825. requiresIfExists: ["preventOverflow"],
  7826. fn: Zt
  7827. };
  7828. function en(t, e, n) {
  7829. var r = q(t), o = [P$1, E$1].indexOf(r) >= 0 ? -1 : 1, i = typeof n == "function" ? n(Object.assign({}, e, { placement: t })) : n, a = i[0], s = i[1];
  7830. return a = a || 0, s = (s || 0) * o, [P$1, W].indexOf(r) >= 0 ? {
  7831. x: s,
  7832. y: a
  7833. } : {
  7834. x: a,
  7835. y: s
  7836. };
  7837. }
  7838. function tn(t) {
  7839. var e = t.state, n = t.options, r = t.name, o = n.offset, i = o === void 0 ? [0, 0] : o, a = Ee.reduce(function(u, m) {
  7840. return u[m] = en(m, e.rects, i), u;
  7841. }, {}), s = a[e.placement], f = s.x, c = s.y;
  7842. e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r] = a;
  7843. }
  7844. var wt = {
  7845. name: "offset",
  7846. enabled: !0,
  7847. phase: "main",
  7848. requires: ["popperOffsets"],
  7849. fn: tn
  7850. };
  7851. function nn(t) {
  7852. var e = t.state, n = t.name;
  7853. e.modifiersData[n] = mt({
  7854. reference: e.rects.reference,
  7855. element: e.rects.popper,
  7856. strategy: "absolute",
  7857. placement: e.placement
  7858. });
  7859. }
  7860. var He = {
  7861. name: "popperOffsets",
  7862. enabled: !0,
  7863. phase: "read",
  7864. fn: nn,
  7865. data: {}
  7866. };
  7867. function rn(t) {
  7868. return t === "x" ? "y" : "x";
  7869. }
  7870. function on(t) {
  7871. var e = t.state, n = t.options, r = t.name, o = n.mainAxis, i = o === void 0 ? !0 : o, a = n.altAxis, s = a === void 0 ? !1 : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? !0 : v, h = n.tetherOffset, p = h === void 0 ? 0 : h, g = ne(e, {
  7872. boundary: f,
  7873. rootBoundary: c,
  7874. padding: m,
  7875. altBoundary: u
  7876. }), x = q(e.placement), y = te(e.placement), $ = !y, d = Le(x), b = rn(d), w = e.modifiersData.popperOffsets, O = e.rects.reference, j = e.rects.popper, A = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, k = typeof A == "number" ? {
  7877. mainAxis: A,
  7878. altAxis: A
  7879. } : Object.assign({
  7880. mainAxis: 0,
  7881. altAxis: 0
  7882. }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = {
  7883. x: 0,
  7884. y: 0
  7885. };
  7886. if (w) {
  7887. if (i) {
  7888. var L, re = d === "y" ? E$1 : P$1, oe = d === "y" ? R : W, M = d === "y" ? "height" : "width", T = w[d], pe = T + g[re], _ = T - g[oe], ue = l ? -j[M] / 2 : 0, xe = y === U ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : {
  7889. width: 0,
  7890. height: 0
  7891. }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : st(), de = V[re], ae = V[oe], Y = fe(0, O[M], z[M]), jt = $ ? O[M] / 2 - ue - Y - de - k.mainAxis : xe - Y - de - k.mainAxis, Dt = $ ? -O[M] / 2 + ue + Y + ae + k.mainAxis : ie + Y + ae + k.mainAxis, Oe = e.elements.arrow && se(e.elements.arrow), Et = Oe ? d === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L = D == null ? void 0 : D[d]) != null ? L : 0, Pt = T + jt - Ce - Et, At = T + Dt - Ce, qe = fe(l ? ve(pe, Pt) : pe, T, l ? X$1(_, At) : _);
  7892. w[d] = qe, S[d] = qe - T;
  7893. }
  7894. if (s) {
  7895. var Ve, kt = d === "x" ? E$1 : P$1, Lt = d === "x" ? R : W, F = w[b], he = b === "y" ? "height" : "width", Ne = F + g[kt], Ie = F - g[Lt], $e = [E$1, P$1].indexOf(x) !== -1, _e = (Ve = D == null ? void 0 : D[b]) != null ? Ve : 0, ze = $e ? Ne : F - O[he] - j[he] - _e + k.altAxis, Fe = $e ? F + O[he] + j[he] - _e - k.altAxis : Ie, Ue = l && $e ? St(ze, F, Fe) : fe(l ? ze : Ne, F, l ? Fe : Ie);
  7896. w[b] = Ue, S[b] = Ue - F;
  7897. }
  7898. e.modifiersData[r] = S;
  7899. }
  7900. }
  7901. var xt = {
  7902. name: "preventOverflow",
  7903. enabled: !0,
  7904. phase: "main",
  7905. fn: on,
  7906. requiresIfExists: ["offset"]
  7907. };
  7908. function an(t) {
  7909. return {
  7910. scrollLeft: t.scrollLeft,
  7911. scrollTop: t.scrollTop
  7912. };
  7913. }
  7914. function sn(t) {
  7915. return t === H(t) || !B(t) ? We(t) : an(t);
  7916. }
  7917. function fn(t) {
  7918. var e = t.getBoundingClientRect(), n = Z(e.width) / t.offsetWidth || 1, r = Z(e.height) / t.offsetHeight || 1;
  7919. return n !== 1 || r !== 1;
  7920. }
  7921. function cn(t, e, n) {
  7922. n === void 0 && (n = !1);
  7923. var r = B(e), o = B(e) && fn(e), i = I$1(e), a = ee(t, o), s = {
  7924. scrollLeft: 0,
  7925. scrollTop: 0
  7926. }, f = {
  7927. x: 0,
  7928. y: 0
  7929. };
  7930. return (r || !r && !n) && ((C(e) !== "body" || Se(i)) && (s = sn(e)), B(e) ? (f = ee(e, !0), f.x += e.clientLeft, f.y += e.clientTop) : i && (f.x = Be(i))), {
  7931. x: a.left + s.scrollLeft - f.x,
  7932. y: a.top + s.scrollTop - f.y,
  7933. width: a.width,
  7934. height: a.height
  7935. };
  7936. }
  7937. function pn(t) {
  7938. var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
  7939. t.forEach(function(i) {
  7940. e.set(i.name, i);
  7941. });
  7942. function o(i) {
  7943. n.add(i.name);
  7944. [].concat(i.requires || [], i.requiresIfExists || []).forEach(function(s) {
  7945. if (!n.has(s)) {
  7946. var f = e.get(s);
  7947. f && o(f);
  7948. }
  7949. }), r.push(i);
  7950. }
  7951. return t.forEach(function(i) {
  7952. n.has(i.name) || o(i);
  7953. }), r;
  7954. }
  7955. function un(t) {
  7956. var e = pn(t);
  7957. return ot.reduce(function(n, r) {
  7958. return n.concat(e.filter(function(o) {
  7959. return o.phase === r;
  7960. }));
  7961. }, []);
  7962. }
  7963. function ln(t) {
  7964. var e;
  7965. return function() {
  7966. return e || (e = new Promise(function(n) {
  7967. Promise.resolve().then(function() {
  7968. e = void 0, n(t());
  7969. });
  7970. })), e;
  7971. };
  7972. }
  7973. function dn(t) {
  7974. var e = t.reduce(function(n, r) {
  7975. var o = n[r.name];
  7976. return n[r.name] = o ? Object.assign({}, o, r, {
  7977. options: Object.assign({}, o.options, r.options),
  7978. data: Object.assign({}, o.data, r.data)
  7979. }) : r, n;
  7980. }, {});
  7981. return Object.keys(e).map(function(n) {
  7982. return e[n];
  7983. });
  7984. }
  7985. var Ot = {
  7986. placement: "bottom",
  7987. modifiers: [],
  7988. strategy: "absolute"
  7989. };
  7990. function $t() {
  7991. for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
  7992. return !e.some(function(r) {
  7993. return !(r && typeof r.getBoundingClientRect == "function");
  7994. });
  7995. }
  7996. function we(t) {
  7997. t === void 0 && (t = {});
  7998. var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, o = e.defaultOptions, i = o === void 0 ? Ot : o;
  7999. return function(a, s, f) {
  8000. f === void 0 && (f = i);
  8001. var c = {
  8002. placement: "bottom",
  8003. orderedModifiers: [],
  8004. options: Object.assign({}, Ot, i),
  8005. modifiersData: {},
  8006. elements: {
  8007. reference: a,
  8008. popper: s
  8009. },
  8010. attributes: {},
  8011. styles: {}
  8012. }, u = [], m = !1, v = {
  8013. state: c,
  8014. setOptions: function(p) {
  8015. var g = typeof p == "function" ? p(c.options) : p;
  8016. h(), c.options = Object.assign({}, i, c.options, g), c.scrollParents = {
  8017. reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [],
  8018. popper: ce(s)
  8019. };
  8020. var x = un(dn([].concat(r, c.options.modifiers)));
  8021. return c.orderedModifiers = x.filter(function(y) {
  8022. return y.enabled;
  8023. }), l(), v.update();
  8024. },
  8025. forceUpdate: function() {
  8026. if (!m) {
  8027. var p = c.elements, g = p.reference, x = p.popper;
  8028. if ($t(g, x)) {
  8029. c.rects = {
  8030. reference: cn(g, se(x), c.options.strategy === "fixed"),
  8031. popper: ke(x)
  8032. }, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(j) {
  8033. return c.modifiersData[j.name] = Object.assign({}, j.data);
  8034. });
  8035. for (var y = 0; y < c.orderedModifiers.length; y++) {
  8036. if (c.reset === !0) {
  8037. c.reset = !1, y = -1;
  8038. continue;
  8039. }
  8040. var $ = c.orderedModifiers[y], d = $.fn, b = $.options, w = b === void 0 ? {} : b, O = $.name;
  8041. typeof d == "function" && (c = d({
  8042. state: c,
  8043. options: w,
  8044. name: O,
  8045. instance: v
  8046. }) || c);
  8047. }
  8048. }
  8049. }
  8050. },
  8051. update: ln(function() {
  8052. return new Promise(function(p) {
  8053. v.forceUpdate(), p(c);
  8054. });
  8055. }),
  8056. destroy: function() {
  8057. h(), m = !0;
  8058. }
  8059. };
  8060. if (!$t(a, s)) return v;
  8061. v.setOptions(f).then(function(p) {
  8062. !m && f.onFirstUpdate && f.onFirstUpdate(p);
  8063. });
  8064. function l() {
  8065. c.orderedModifiers.forEach(function(p) {
  8066. var g = p.name, x = p.options, y = x === void 0 ? {} : x, $ = p.effect;
  8067. if (typeof $ == "function") {
  8068. var d = $({
  8069. state: c,
  8070. name: g,
  8071. instance: v,
  8072. options: y
  8073. }), b = function() {};
  8074. u.push(d || b);
  8075. }
  8076. });
  8077. }
  8078. function h() {
  8079. u.forEach(function(p) {
  8080. return p();
  8081. }), u = [];
  8082. }
  8083. return v;
  8084. };
  8085. }
  8086. var hn = we(), vn = we({ defaultModifiers: [
  8087. Re,
  8088. He,
  8089. Me,
  8090. Ae
  8091. ] }), yn = we({ defaultModifiers: [
  8092. Re,
  8093. He,
  8094. Me,
  8095. Ae,
  8096. wt,
  8097. vt,
  8098. xt,
  8099. pt,
  8100. bt
  8101. ] });
  8102. //#endregion
  8103. //#region ../../packages/hooks/use-popper/index.ts
  8104. const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
  8105. const stateUpdater = {
  8106. name: "updateState",
  8107. enabled: true,
  8108. phase: "write",
  8109. fn: ({ state }) => {
  8110. const derivedState = deriveState(state);
  8111. Object.assign(states.value, derivedState);
  8112. },
  8113. requires: ["computeStyles"]
  8114. };
  8115. const options = computed(() => {
  8116. const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
  8117. return {
  8118. onFirstUpdate,
  8119. placement: placement || "bottom",
  8120. strategy: strategy || "absolute",
  8121. modifiers: [
  8122. ...modifiers || [],
  8123. stateUpdater,
  8124. {
  8125. name: "applyStyles",
  8126. enabled: false
  8127. }
  8128. ]
  8129. };
  8130. });
  8131. const instanceRef = shallowRef();
  8132. const states = ref({
  8133. styles: {
  8134. popper: {
  8135. position: unref(options).strategy,
  8136. left: "0",
  8137. top: "0"
  8138. },
  8139. arrow: { position: "absolute" }
  8140. },
  8141. attributes: {}
  8142. });
  8143. const destroy = () => {
  8144. if (!instanceRef.value) return;
  8145. instanceRef.value.destroy();
  8146. instanceRef.value = void 0;
  8147. };
  8148. watch(options, (newOptions) => {
  8149. const instance = unref(instanceRef);
  8150. if (instance) instance.setOptions(newOptions);
  8151. }, { deep: true });
  8152. watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
  8153. destroy();
  8154. if (!referenceElement || !popperElement) return;
  8155. instanceRef.value = yn(referenceElement, popperElement, unref(options));
  8156. });
  8157. onBeforeUnmount(() => {
  8158. destroy();
  8159. });
  8160. return {
  8161. state: computed(() => ({ ...unref(instanceRef)?.state || {} })),
  8162. styles: computed(() => unref(states).styles),
  8163. attributes: computed(() => unref(states).attributes),
  8164. update: () => unref(instanceRef)?.update(),
  8165. forceUpdate: () => unref(instanceRef)?.forceUpdate(),
  8166. instanceRef: computed(() => unref(instanceRef))
  8167. };
  8168. };
  8169. function deriveState(state) {
  8170. const elements = Object.keys(state.elements);
  8171. return {
  8172. styles: fromPairs(elements.map((element) => [element, state.styles[element] || {}])),
  8173. attributes: fromPairs(elements.map((element) => [element, state.attributes[element]]))
  8174. };
  8175. }
  8176. //#endregion
  8177. //#region ../../packages/hooks/use-same-target/index.ts
  8178. const useSameTarget = (handleClick) => {
  8179. if (!handleClick) return {
  8180. onClick: NOOP,
  8181. onMousedown: NOOP,
  8182. onMouseup: NOOP
  8183. };
  8184. let mousedownTarget = false;
  8185. let mouseupTarget = false;
  8186. const onClick = (e) => {
  8187. if (mousedownTarget && mouseupTarget) handleClick(e);
  8188. mousedownTarget = mouseupTarget = false;
  8189. };
  8190. const onMousedown = (e) => {
  8191. mousedownTarget = e.target === e.currentTarget;
  8192. };
  8193. const onMouseup = (e) => {
  8194. mouseupTarget = e.target === e.currentTarget;
  8195. };
  8196. return {
  8197. onClick,
  8198. onMousedown,
  8199. onMouseup
  8200. };
  8201. };
  8202. //#endregion
  8203. //#region ../../packages/hooks/use-teleport/index.ts
  8204. const useTeleport = (contentRenderer, appendToBody) => {
  8205. const isTeleportVisible = ref(false);
  8206. if (!isClient) return {
  8207. isTeleportVisible,
  8208. showTeleport: NOOP,
  8209. hideTeleport: NOOP,
  8210. renderTeleport: NOOP
  8211. };
  8212. let $el = null;
  8213. const showTeleport = () => {
  8214. isTeleportVisible.value = true;
  8215. if ($el !== null) return;
  8216. $el = createGlobalNode();
  8217. };
  8218. const hideTeleport = () => {
  8219. isTeleportVisible.value = false;
  8220. if ($el !== null) {
  8221. removeGlobalNode($el);
  8222. $el = null;
  8223. }
  8224. };
  8225. const renderTeleport = () => {
  8226. return appendToBody.value !== true ? contentRenderer() : isTeleportVisible.value ? [h(Teleport, { to: $el }, contentRenderer())] : void 0;
  8227. };
  8228. onUnmounted(hideTeleport);
  8229. return {
  8230. isTeleportVisible,
  8231. showTeleport,
  8232. hideTeleport,
  8233. renderTeleport
  8234. };
  8235. };
  8236. //#endregion
  8237. //#region ../../packages/hooks/use-throttle-render/index.ts
  8238. const useThrottleRender = (loading, throttle = 0) => {
  8239. if (throttle === 0) return loading;
  8240. const throttled = ref(isObject$1(throttle) && Boolean(throttle.initVal));
  8241. let timeoutHandle = null;
  8242. const dispatchThrottling = (timer) => {
  8243. if (isUndefined(timer)) {
  8244. throttled.value = loading.value;
  8245. return;
  8246. }
  8247. if (timeoutHandle) clearTimeout(timeoutHandle);
  8248. timeoutHandle = setTimeout(() => {
  8249. throttled.value = loading.value;
  8250. }, timer);
  8251. };
  8252. const dispatcher = (type) => {
  8253. if (type === "leading") if (isNumber(throttle)) dispatchThrottling(throttle);
  8254. else dispatchThrottling(throttle.leading);
  8255. else if (isObject$1(throttle)) dispatchThrottling(throttle.trailing);
  8256. else throttled.value = false;
  8257. };
  8258. onMounted(() => dispatcher("leading"));
  8259. watch(() => loading.value, (val) => {
  8260. dispatcher(val ? "leading" : "trailing");
  8261. });
  8262. return throttled;
  8263. };
  8264. //#endregion
  8265. //#region ../../packages/hooks/use-timeout/index.ts
  8266. function useTimeout() {
  8267. let timeoutHandle;
  8268. const registerTimeout = (fn, delay) => {
  8269. cancelTimeout();
  8270. timeoutHandle = window.setTimeout(fn, delay);
  8271. };
  8272. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  8273. tryOnScopeDispose(() => cancelTimeout());
  8274. return {
  8275. registerTimeout,
  8276. cancelTimeout
  8277. };
  8278. }
  8279. //#endregion
  8280. //#region ../../packages/hooks/use-transition-fallthrough/index.ts
  8281. /* istanbul ignore file */
  8282. const AFTER_APPEAR = "after-appear";
  8283. const AFTER_ENTER = "after-enter";
  8284. const AFTER_LEAVE = "after-leave";
  8285. const APPEAR = "appear";
  8286. const APPEAR_CANCELLED = "appear-cancelled";
  8287. const BEFORE_ENTER = "before-enter";
  8288. const BEFORE_LEAVE = "before-leave";
  8289. const ENTER = "enter";
  8290. const ENTER_CANCELLED = "enter-cancelled";
  8291. const LEAVE = "leave";
  8292. const LEAVE_CANCELLED = "leave-cancelled";
  8293. const useTransitionFallthroughEmits = [
  8294. AFTER_APPEAR,
  8295. AFTER_ENTER,
  8296. AFTER_LEAVE,
  8297. APPEAR,
  8298. APPEAR_CANCELLED,
  8299. BEFORE_ENTER,
  8300. BEFORE_LEAVE,
  8301. ENTER,
  8302. ENTER_CANCELLED,
  8303. LEAVE,
  8304. LEAVE_CANCELLED
  8305. ];
  8306. /**
  8307. * NOTE:
  8308. * This is only a delegator for delegating transition callbacks.
  8309. * Use this at your need.
  8310. */
  8311. /**
  8312. * Simple usage
  8313. *
  8314. * In your setups:
  8315. *
  8316. * setup() {
  8317. * const fallthroughMethods = useTransitionFallthrough()
  8318. * return fallthrough
  8319. * }
  8320. *
  8321. * In your template:
  8322. *
  8323. * <template>
  8324. * <transition name="whatever" v-bind="fallthrough">
  8325. * <slot />
  8326. * </transition>
  8327. * </template>
  8328. *
  8329. */
  8330. const useTransitionFallthrough = () => {
  8331. const { emit } = getCurrentInstance();
  8332. return {
  8333. onAfterAppear: () => {
  8334. emit(AFTER_APPEAR);
  8335. },
  8336. onAfterEnter: () => {
  8337. emit(AFTER_ENTER);
  8338. },
  8339. onAfterLeave: () => {
  8340. emit(AFTER_LEAVE);
  8341. },
  8342. onAppearCancelled: () => {
  8343. emit(APPEAR_CANCELLED);
  8344. },
  8345. onBeforeEnter: () => {
  8346. emit(BEFORE_ENTER);
  8347. },
  8348. onBeforeLeave: () => {
  8349. emit(BEFORE_LEAVE);
  8350. },
  8351. onEnter: () => {
  8352. emit(ENTER);
  8353. },
  8354. onEnterCancelled: () => {
  8355. emit(ENTER_CANCELLED);
  8356. },
  8357. onLeave: () => {
  8358. emit(LEAVE);
  8359. },
  8360. onLeaveCancelled: () => {
  8361. emit(LEAVE_CANCELLED);
  8362. }
  8363. };
  8364. };
  8365. //#endregion
  8366. //#region ../../packages/hooks/use-id/index.ts
  8367. const defaultIdInjection = {
  8368. prefix: Math.floor(Math.random() * 1e4),
  8369. current: 0
  8370. };
  8371. const ID_INJECTION_KEY = Symbol("elIdInjection");
  8372. const useIdInjection = () => {
  8373. return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  8374. };
  8375. const useId = (deterministicId) => {
  8376. const idInjection = useIdInjection();
  8377. if (!isClient && idInjection === defaultIdInjection) /* @__PURE__ */ debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
  8378. usage: app.provide(ID_INJECTION_KEY, {
  8379. prefix: number,
  8380. current: number,
  8381. })`);
  8382. const namespace = useGetDerivedNamespace();
  8383. return computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  8384. };
  8385. //#endregion
  8386. //#region ../../packages/hooks/use-escape-keydown/index.ts
  8387. let registeredEscapeHandlers = [];
  8388. const cachedHandler = (event) => {
  8389. if (getEventCode(event) === EVENT_CODE.esc) registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
  8390. };
  8391. const useEscapeKeydown = (handler) => {
  8392. onMounted(() => {
  8393. if (registeredEscapeHandlers.length === 0) document.addEventListener("keydown", cachedHandler);
  8394. if (isClient) registeredEscapeHandlers.push(handler);
  8395. });
  8396. onBeforeUnmount(() => {
  8397. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  8398. if (registeredEscapeHandlers.length === 0) {
  8399. if (isClient) document.removeEventListener("keydown", cachedHandler);
  8400. }
  8401. });
  8402. };
  8403. //#endregion
  8404. //#region ../../packages/hooks/use-popper-container/index.ts
  8405. const usePopperContainerId = () => {
  8406. const namespace = useGetDerivedNamespace();
  8407. const idInjection = useIdInjection();
  8408. const id = computed(() => {
  8409. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  8410. });
  8411. return {
  8412. id,
  8413. selector: computed(() => `#${id.value}`)
  8414. };
  8415. };
  8416. const createContainer = (id) => {
  8417. const container = document.createElement("div");
  8418. container.id = id;
  8419. document.body.appendChild(container);
  8420. return container;
  8421. };
  8422. const usePopperContainer = () => {
  8423. const { id, selector } = usePopperContainerId();
  8424. onBeforeMount(() => {
  8425. if (!isClient) return;
  8426. if (!document.body.querySelector(selector.value)) createContainer(id.value);
  8427. });
  8428. return {
  8429. id,
  8430. selector
  8431. };
  8432. };
  8433. //#endregion
  8434. //#region ../../packages/hooks/use-intermediate-render/index.ts
  8435. const useDelayedRender = ({ indicator, intermediateIndicator, shouldSetIntermediate = () => true, beforeShow, afterShow, afterHide, beforeHide }) => {
  8436. watch(() => unref(indicator), (val) => {
  8437. if (val) {
  8438. beforeShow?.();
  8439. nextTick(() => {
  8440. if (!unref(indicator)) return;
  8441. if (shouldSetIntermediate("show")) intermediateIndicator.value = true;
  8442. });
  8443. } else {
  8444. beforeHide?.();
  8445. nextTick(() => {
  8446. if (unref(indicator)) return;
  8447. if (shouldSetIntermediate("hide")) intermediateIndicator.value = false;
  8448. });
  8449. }
  8450. });
  8451. watch(() => intermediateIndicator.value, (val) => {
  8452. if (val) afterShow?.();
  8453. else afterHide?.();
  8454. });
  8455. };
  8456. //#endregion
  8457. //#region ../../packages/hooks/use-delayed-toggle/index.ts
  8458. /**
  8459. * @deprecated Removed after 3.0.0, Use `UseDelayedToggleProps` instead.
  8460. */
  8461. const useDelayedToggleProps = buildProps({
  8462. showAfter: {
  8463. type: Number,
  8464. default: 0
  8465. },
  8466. hideAfter: {
  8467. type: Number,
  8468. default: 200
  8469. },
  8470. autoClose: {
  8471. type: Number,
  8472. default: 0
  8473. }
  8474. });
  8475. const useDelayedTogglePropsDefaults = {
  8476. showAfter: 0,
  8477. hideAfter: 200,
  8478. autoClose: 0
  8479. };
  8480. const useDelayedToggle = ({ showAfter, hideAfter, autoClose, open, close }) => {
  8481. const { registerTimeout } = useTimeout();
  8482. const { registerTimeout: registerTimeoutForAutoClose, cancelTimeout: cancelTimeoutForAutoClose } = useTimeout();
  8483. const onOpen = (event, delay = unref(showAfter)) => {
  8484. registerTimeout(() => {
  8485. open(event);
  8486. const _autoClose = unref(autoClose);
  8487. if (isNumber(_autoClose) && _autoClose > 0) registerTimeoutForAutoClose(() => {
  8488. close(event);
  8489. }, _autoClose);
  8490. }, delay);
  8491. };
  8492. const onClose = (event, delay = unref(hideAfter)) => {
  8493. cancelTimeoutForAutoClose();
  8494. registerTimeout(() => {
  8495. close(event);
  8496. }, delay);
  8497. };
  8498. return {
  8499. onOpen,
  8500. onClose
  8501. };
  8502. };
  8503. //#endregion
  8504. //#region ../../packages/hooks/use-forward-ref/index.ts
  8505. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  8506. const useForwardRef = (forwardRef) => {
  8507. const setForwardRef = ((el) => {
  8508. forwardRef.value = el;
  8509. });
  8510. provide(FORWARD_REF_INJECTION_KEY, { setForwardRef });
  8511. };
  8512. const useForwardRefDirective = (setForwardRef) => {
  8513. return {
  8514. mounted(el) {
  8515. setForwardRef(el);
  8516. },
  8517. updated(el) {
  8518. setForwardRef(el);
  8519. },
  8520. unmounted() {
  8521. setForwardRef(null);
  8522. }
  8523. };
  8524. };
  8525. //#endregion
  8526. //#region ../../packages/hooks/use-z-index/index.ts
  8527. const initial = { current: 0 };
  8528. const zIndex = ref(0);
  8529. const defaultInitialZIndex = 2e3;
  8530. const ZINDEX_INJECTION_KEY = Symbol("elZIndexContextKey");
  8531. const zIndexContextKey = Symbol("zIndexContextKey");
  8532. const useZIndex = (zIndexOverrides) => {
  8533. const increasingInjection = getCurrentInstance() ? inject(ZINDEX_INJECTION_KEY, initial) : initial;
  8534. const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0);
  8535. const initialZIndex = computed(() => {
  8536. const zIndexFromInjection = unref(zIndexInjection);
  8537. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  8538. });
  8539. const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
  8540. const nextZIndex = () => {
  8541. increasingInjection.current++;
  8542. zIndex.value = increasingInjection.current;
  8543. return currentZIndex.value;
  8544. };
  8545. if (!isClient && !inject(ZINDEX_INJECTION_KEY)) /* @__PURE__ */ debugWarn("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
  8546. usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
  8547. return {
  8548. initialZIndex,
  8549. currentZIndex,
  8550. nextZIndex
  8551. };
  8552. };
  8553. //#endregion
  8554. //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
  8555. const min$1 = Math.min;
  8556. const max$1 = Math.max;
  8557. const round = Math.round;
  8558. const floor$1 = Math.floor;
  8559. const createCoords = (v) => ({
  8560. x: v,
  8561. y: v
  8562. });
  8563. const oppositeSideMap = {
  8564. left: "right",
  8565. right: "left",
  8566. bottom: "top",
  8567. top: "bottom"
  8568. };
  8569. const oppositeAlignmentMap = {
  8570. start: "end",
  8571. end: "start"
  8572. };
  8573. function clamp(start, value, end) {
  8574. return max$1(start, min$1(value, end));
  8575. }
  8576. function evaluate(value, param) {
  8577. return typeof value === "function" ? value(param) : value;
  8578. }
  8579. function getSide(placement) {
  8580. return placement.split("-")[0];
  8581. }
  8582. function getAlignment(placement) {
  8583. return placement.split("-")[1];
  8584. }
  8585. function getOppositeAxis(axis) {
  8586. return axis === "x" ? "y" : "x";
  8587. }
  8588. function getAxisLength(axis) {
  8589. return axis === "y" ? "height" : "width";
  8590. }
  8591. const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
  8592. function getSideAxis(placement) {
  8593. return yAxisSides.has(getSide(placement)) ? "y" : "x";
  8594. }
  8595. function getAlignmentAxis(placement) {
  8596. return getOppositeAxis(getSideAxis(placement));
  8597. }
  8598. function getAlignmentSides(placement, rects, rtl) {
  8599. if (rtl === void 0) rtl = false;
  8600. const alignment = getAlignment(placement);
  8601. const alignmentAxis = getAlignmentAxis(placement);
  8602. const length = getAxisLength(alignmentAxis);
  8603. let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
  8604. if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
  8605. return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
  8606. }
  8607. function getExpandedPlacements(placement) {
  8608. const oppositePlacement = getOppositePlacement(placement);
  8609. return [
  8610. getOppositeAlignmentPlacement(placement),
  8611. oppositePlacement,
  8612. getOppositeAlignmentPlacement(oppositePlacement)
  8613. ];
  8614. }
  8615. function getOppositeAlignmentPlacement(placement) {
  8616. return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
  8617. }
  8618. const lrPlacement = ["left", "right"];
  8619. const rlPlacement = ["right", "left"];
  8620. const tbPlacement = ["top", "bottom"];
  8621. const btPlacement = ["bottom", "top"];
  8622. function getSideList(side, isStart, rtl) {
  8623. switch (side) {
  8624. case "top":
  8625. case "bottom":
  8626. if (rtl) return isStart ? rlPlacement : lrPlacement;
  8627. return isStart ? lrPlacement : rlPlacement;
  8628. case "left":
  8629. case "right": return isStart ? tbPlacement : btPlacement;
  8630. default: return [];
  8631. }
  8632. }
  8633. function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
  8634. const alignment = getAlignment(placement);
  8635. let list = getSideList(getSide(placement), direction === "start", rtl);
  8636. if (alignment) {
  8637. list = list.map((side) => side + "-" + alignment);
  8638. if (flipAlignment) list = list.concat(list.map(getOppositeAlignmentPlacement));
  8639. }
  8640. return list;
  8641. }
  8642. function getOppositePlacement(placement) {
  8643. return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
  8644. }
  8645. function expandPaddingObject(padding) {
  8646. return {
  8647. top: 0,
  8648. right: 0,
  8649. bottom: 0,
  8650. left: 0,
  8651. ...padding
  8652. };
  8653. }
  8654. function getPaddingObject(padding) {
  8655. return typeof padding !== "number" ? expandPaddingObject(padding) : {
  8656. top: padding,
  8657. right: padding,
  8658. bottom: padding,
  8659. left: padding
  8660. };
  8661. }
  8662. function rectToClientRect(rect) {
  8663. const { x, y, width, height } = rect;
  8664. return {
  8665. width,
  8666. height,
  8667. top: y,
  8668. left: x,
  8669. right: x + width,
  8670. bottom: y + height,
  8671. x,
  8672. y
  8673. };
  8674. }
  8675. //#endregion
  8676. //#region ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
  8677. function computeCoordsFromPlacement(_ref, placement, rtl) {
  8678. let { reference, floating } = _ref;
  8679. const sideAxis = getSideAxis(placement);
  8680. const alignmentAxis = getAlignmentAxis(placement);
  8681. const alignLength = getAxisLength(alignmentAxis);
  8682. const side = getSide(placement);
  8683. const isVertical = sideAxis === "y";
  8684. const commonX = reference.x + reference.width / 2 - floating.width / 2;
  8685. const commonY = reference.y + reference.height / 2 - floating.height / 2;
  8686. const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
  8687. let coords;
  8688. switch (side) {
  8689. case "top":
  8690. coords = {
  8691. x: commonX,
  8692. y: reference.y - floating.height
  8693. };
  8694. break;
  8695. case "bottom":
  8696. coords = {
  8697. x: commonX,
  8698. y: reference.y + reference.height
  8699. };
  8700. break;
  8701. case "right":
  8702. coords = {
  8703. x: reference.x + reference.width,
  8704. y: commonY
  8705. };
  8706. break;
  8707. case "left":
  8708. coords = {
  8709. x: reference.x - floating.width,
  8710. y: commonY
  8711. };
  8712. break;
  8713. default: coords = {
  8714. x: reference.x,
  8715. y: reference.y
  8716. };
  8717. }
  8718. switch (getAlignment(placement)) {
  8719. case "start":
  8720. coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
  8721. break;
  8722. case "end":
  8723. coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
  8724. break;
  8725. }
  8726. return coords;
  8727. }
  8728. /**
  8729. * Computes the `x` and `y` coordinates that will place the floating element
  8730. * next to a given reference element.
  8731. *
  8732. * This export does not have any `platform` interface logic. You will need to
  8733. * write one for the platform you are using Floating UI with.
  8734. */
  8735. const computePosition$1 = async (reference, floating, config) => {
  8736. const { placement = "bottom", strategy = "absolute", middleware = [], platform } = config;
  8737. const validMiddleware = middleware.filter(Boolean);
  8738. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
  8739. let rects = await platform.getElementRects({
  8740. reference,
  8741. floating,
  8742. strategy
  8743. });
  8744. let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
  8745. let statefulPlacement = placement;
  8746. let middlewareData = {};
  8747. let resetCount = 0;
  8748. for (let i = 0; i < validMiddleware.length; i++) {
  8749. const { name, fn } = validMiddleware[i];
  8750. const { x: nextX, y: nextY, data, reset } = await fn({
  8751. x,
  8752. y,
  8753. initialPlacement: placement,
  8754. placement: statefulPlacement,
  8755. strategy,
  8756. middlewareData,
  8757. rects,
  8758. platform,
  8759. elements: {
  8760. reference,
  8761. floating
  8762. }
  8763. });
  8764. x = nextX != null ? nextX : x;
  8765. y = nextY != null ? nextY : y;
  8766. middlewareData = {
  8767. ...middlewareData,
  8768. [name]: {
  8769. ...middlewareData[name],
  8770. ...data
  8771. }
  8772. };
  8773. if (reset && resetCount <= 50) {
  8774. resetCount++;
  8775. if (typeof reset === "object") {
  8776. if (reset.placement) statefulPlacement = reset.placement;
  8777. if (reset.rects) rects = reset.rects === true ? await platform.getElementRects({
  8778. reference,
  8779. floating,
  8780. strategy
  8781. }) : reset.rects;
  8782. ({x, y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
  8783. }
  8784. i = -1;
  8785. }
  8786. }
  8787. return {
  8788. x,
  8789. y,
  8790. placement: statefulPlacement,
  8791. strategy,
  8792. middlewareData
  8793. };
  8794. };
  8795. /**
  8796. * Resolves with an object of overflow side offsets that determine how much the
  8797. * element is overflowing a given clipping boundary on each side.
  8798. * - positive = overflowing the boundary by that number of pixels
  8799. * - negative = how many pixels left before it will overflow
  8800. * - 0 = lies flush with the boundary
  8801. * @see https://floating-ui.com/docs/detectOverflow
  8802. */
  8803. async function detectOverflow$1(state, options) {
  8804. var _await$platform$isEle;
  8805. if (options === void 0) options = {};
  8806. const { x, y, platform, rects, elements, strategy } = state;
  8807. const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state);
  8808. const paddingObject = getPaddingObject(padding);
  8809. const element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext];
  8810. const clippingClientRect = rectToClientRect(await platform.getClippingRect({
  8811. element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
  8812. boundary,
  8813. rootBoundary,
  8814. strategy
  8815. }));
  8816. const rect = elementContext === "floating" ? {
  8817. x,
  8818. y,
  8819. width: rects.floating.width,
  8820. height: rects.floating.height
  8821. } : rects.reference;
  8822. const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
  8823. const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
  8824. x: 1,
  8825. y: 1
  8826. } : {
  8827. x: 1,
  8828. y: 1
  8829. };
  8830. const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
  8831. elements,
  8832. rect,
  8833. offsetParent,
  8834. strategy
  8835. }) : rect);
  8836. return {
  8837. top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
  8838. bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
  8839. left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
  8840. right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
  8841. };
  8842. }
  8843. /**
  8844. * Provides data to position an inner element of the floating element so that it
  8845. * appears centered to the reference element.
  8846. * @see https://floating-ui.com/docs/arrow
  8847. */
  8848. const arrow$1 = (options) => ({
  8849. name: "arrow",
  8850. options,
  8851. async fn(state) {
  8852. const { x, y, placement, rects, platform, elements, middlewareData } = state;
  8853. const { element, padding = 0 } = evaluate(options, state) || {};
  8854. if (element == null) return {};
  8855. const paddingObject = getPaddingObject(padding);
  8856. const coords = {
  8857. x,
  8858. y
  8859. };
  8860. const axis = getAlignmentAxis(placement);
  8861. const length = getAxisLength(axis);
  8862. const arrowDimensions = await platform.getDimensions(element);
  8863. const isYAxis = axis === "y";
  8864. const minProp = isYAxis ? "top" : "left";
  8865. const maxProp = isYAxis ? "bottom" : "right";
  8866. const clientProp = isYAxis ? "clientHeight" : "clientWidth";
  8867. const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
  8868. const startDiff = coords[axis] - rects.reference[axis];
  8869. const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
  8870. let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
  8871. if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) clientSize = elements.floating[clientProp] || rects.floating[length];
  8872. const centerToReference = endDiff / 2 - startDiff / 2;
  8873. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
  8874. const minPadding = min$1(paddingObject[minProp], largestPossiblePadding);
  8875. const maxPadding = min$1(paddingObject[maxProp], largestPossiblePadding);
  8876. const min$1$1 = minPadding;
  8877. const max = clientSize - arrowDimensions[length] - maxPadding;
  8878. const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
  8879. const offset = clamp(min$1$1, center, max);
  8880. const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
  8881. const alignmentOffset = shouldAddOffset ? center < min$1$1 ? center - min$1$1 : center - max : 0;
  8882. return {
  8883. [axis]: coords[axis] + alignmentOffset,
  8884. data: {
  8885. [axis]: offset,
  8886. centerOffset: center - offset - alignmentOffset,
  8887. ...shouldAddOffset && { alignmentOffset }
  8888. },
  8889. reset: shouldAddOffset
  8890. };
  8891. }
  8892. });
  8893. /**
  8894. * Optimizes the visibility of the floating element by flipping the `placement`
  8895. * in order to keep it in view when the preferred placement(s) will overflow the
  8896. * clipping boundary. Alternative to `autoPlacement`.
  8897. * @see https://floating-ui.com/docs/flip
  8898. */
  8899. const flip$1 = function(options) {
  8900. if (options === void 0) options = {};
  8901. return {
  8902. name: "flip",
  8903. options,
  8904. async fn(state) {
  8905. var _middlewareData$arrow, _middlewareData$flip;
  8906. const { placement, middlewareData, rects, initialPlacement, platform, elements } = state;
  8907. const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
  8908. if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
  8909. const side = getSide(placement);
  8910. const initialSideAxis = getSideAxis(initialPlacement);
  8911. const isBasePlacement = getSide(initialPlacement) === initialPlacement;
  8912. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
  8913. const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
  8914. const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
  8915. if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
  8916. const placements = [initialPlacement, ...fallbackPlacements];
  8917. const overflow = await detectOverflow$1(state, detectOverflowOptions);
  8918. const overflows = [];
  8919. let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
  8920. if (checkMainAxis) overflows.push(overflow[side]);
  8921. if (checkCrossAxis) {
  8922. const sides = getAlignmentSides(placement, rects, rtl);
  8923. overflows.push(overflow[sides[0]], overflow[sides[1]]);
  8924. }
  8925. overflowsData = [...overflowsData, {
  8926. placement,
  8927. overflows
  8928. }];
  8929. if (!overflows.every((side) => side <= 0)) {
  8930. var _middlewareData$flip2, _overflowsData$filter;
  8931. const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
  8932. const nextPlacement = placements[nextIndex];
  8933. if (nextPlacement) {
  8934. if (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false) || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) return {
  8935. data: {
  8936. index: nextIndex,
  8937. overflows: overflowsData
  8938. },
  8939. reset: { placement: nextPlacement }
  8940. };
  8941. }
  8942. let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
  8943. if (!resetPlacement) switch (fallbackStrategy) {
  8944. case "bestFit": {
  8945. var _overflowsData$filter2;
  8946. const placement = (_overflowsData$filter2 = overflowsData.filter((d) => {
  8947. if (hasFallbackAxisSideDirection) {
  8948. const currentSideAxis = getSideAxis(d.placement);
  8949. return currentSideAxis === initialSideAxis || currentSideAxis === "y";
  8950. }
  8951. return true;
  8952. }).map((d) => [d.placement, d.overflows.filter((overflow) => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
  8953. if (placement) resetPlacement = placement;
  8954. break;
  8955. }
  8956. case "initialPlacement":
  8957. resetPlacement = initialPlacement;
  8958. break;
  8959. }
  8960. if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
  8961. }
  8962. return {};
  8963. }
  8964. };
  8965. };
  8966. const originSides = /* @__PURE__ */ new Set(["left", "top"]);
  8967. async function convertValueToCoords(state, options) {
  8968. const { placement, platform, elements } = state;
  8969. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
  8970. const side = getSide(placement);
  8971. const alignment = getAlignment(placement);
  8972. const isVertical = getSideAxis(placement) === "y";
  8973. const mainAxisMulti = originSides.has(side) ? -1 : 1;
  8974. const crossAxisMulti = rtl && isVertical ? -1 : 1;
  8975. const rawValue = evaluate(options, state);
  8976. let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? {
  8977. mainAxis: rawValue,
  8978. crossAxis: 0,
  8979. alignmentAxis: null
  8980. } : {
  8981. mainAxis: rawValue.mainAxis || 0,
  8982. crossAxis: rawValue.crossAxis || 0,
  8983. alignmentAxis: rawValue.alignmentAxis
  8984. };
  8985. if (alignment && typeof alignmentAxis === "number") crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
  8986. return isVertical ? {
  8987. x: crossAxis * crossAxisMulti,
  8988. y: mainAxis * mainAxisMulti
  8989. } : {
  8990. x: mainAxis * mainAxisMulti,
  8991. y: crossAxis * crossAxisMulti
  8992. };
  8993. }
  8994. /**
  8995. * Modifies the placement by translating the floating element along the
  8996. * specified axes.
  8997. * A number (shorthand for `mainAxis` or distance), or an axes configuration
  8998. * object may be passed.
  8999. * @see https://floating-ui.com/docs/offset
  9000. */
  9001. const offset$1 = function(options) {
  9002. if (options === void 0) options = 0;
  9003. return {
  9004. name: "offset",
  9005. options,
  9006. async fn(state) {
  9007. var _middlewareData$offse, _middlewareData$arrow;
  9008. const { x, y, placement, middlewareData } = state;
  9009. const diffCoords = await convertValueToCoords(state, options);
  9010. if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
  9011. return {
  9012. x: x + diffCoords.x,
  9013. y: y + diffCoords.y,
  9014. data: {
  9015. ...diffCoords,
  9016. placement
  9017. }
  9018. };
  9019. }
  9020. };
  9021. };
  9022. /**
  9023. * Optimizes the visibility of the floating element by shifting it in order to
  9024. * keep it in view when it will overflow the clipping boundary.
  9025. * @see https://floating-ui.com/docs/shift
  9026. */
  9027. const shift$1 = function(options) {
  9028. if (options === void 0) options = {};
  9029. return {
  9030. name: "shift",
  9031. options,
  9032. async fn(state) {
  9033. const { x, y, placement } = state;
  9034. const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => {
  9035. let { x, y } = _ref;
  9036. return {
  9037. x,
  9038. y
  9039. };
  9040. } }, ...detectOverflowOptions } = evaluate(options, state);
  9041. const coords = {
  9042. x,
  9043. y
  9044. };
  9045. const overflow = await detectOverflow$1(state, detectOverflowOptions);
  9046. const crossAxis = getSideAxis(getSide(placement));
  9047. const mainAxis = getOppositeAxis(crossAxis);
  9048. let mainAxisCoord = coords[mainAxis];
  9049. let crossAxisCoord = coords[crossAxis];
  9050. if (checkMainAxis) {
  9051. const minSide = mainAxis === "y" ? "top" : "left";
  9052. const maxSide = mainAxis === "y" ? "bottom" : "right";
  9053. const min = mainAxisCoord + overflow[minSide];
  9054. const max = mainAxisCoord - overflow[maxSide];
  9055. mainAxisCoord = clamp(min, mainAxisCoord, max);
  9056. }
  9057. if (checkCrossAxis) {
  9058. const minSide = crossAxis === "y" ? "top" : "left";
  9059. const maxSide = crossAxis === "y" ? "bottom" : "right";
  9060. const min = crossAxisCoord + overflow[minSide];
  9061. const max = crossAxisCoord - overflow[maxSide];
  9062. crossAxisCoord = clamp(min, crossAxisCoord, max);
  9063. }
  9064. const limitedCoords = limiter.fn({
  9065. ...state,
  9066. [mainAxis]: mainAxisCoord,
  9067. [crossAxis]: crossAxisCoord
  9068. });
  9069. return {
  9070. ...limitedCoords,
  9071. data: {
  9072. x: limitedCoords.x - x,
  9073. y: limitedCoords.y - y,
  9074. enabled: {
  9075. [mainAxis]: checkMainAxis,
  9076. [crossAxis]: checkCrossAxis
  9077. }
  9078. }
  9079. };
  9080. }
  9081. };
  9082. };
  9083. //#endregion
  9084. //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
  9085. function hasWindow() {
  9086. return typeof window !== "undefined";
  9087. }
  9088. function getNodeName(node) {
  9089. if (isNode(node)) return (node.nodeName || "").toLowerCase();
  9090. return "#document";
  9091. }
  9092. function getWindow(node) {
  9093. var _node$ownerDocument;
  9094. return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
  9095. }
  9096. function getDocumentElement(node) {
  9097. var _ref;
  9098. return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
  9099. }
  9100. function isNode(value) {
  9101. if (!hasWindow()) return false;
  9102. return value instanceof Node || value instanceof getWindow(value).Node;
  9103. }
  9104. function isElement(value) {
  9105. if (!hasWindow()) return false;
  9106. return value instanceof Element || value instanceof getWindow(value).Element;
  9107. }
  9108. function isHTMLElement(value) {
  9109. if (!hasWindow()) return false;
  9110. return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
  9111. }
  9112. function isShadowRoot(value) {
  9113. if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
  9114. return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
  9115. }
  9116. const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
  9117. function isOverflowElement(element) {
  9118. const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
  9119. return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
  9120. }
  9121. const tableElements = /* @__PURE__ */ new Set([
  9122. "table",
  9123. "td",
  9124. "th"
  9125. ]);
  9126. function isTableElement(element) {
  9127. return tableElements.has(getNodeName(element));
  9128. }
  9129. const topLayerSelectors = [":popover-open", ":modal"];
  9130. function isTopLayer(element) {
  9131. return topLayerSelectors.some((selector) => {
  9132. try {
  9133. return element.matches(selector);
  9134. } catch (_e) {
  9135. return false;
  9136. }
  9137. });
  9138. }
  9139. const transformProperties = [
  9140. "transform",
  9141. "translate",
  9142. "scale",
  9143. "rotate",
  9144. "perspective"
  9145. ];
  9146. const willChangeValues = [
  9147. "transform",
  9148. "translate",
  9149. "scale",
  9150. "rotate",
  9151. "perspective",
  9152. "filter"
  9153. ];
  9154. const containValues = [
  9155. "paint",
  9156. "layout",
  9157. "strict",
  9158. "content"
  9159. ];
  9160. function isContainingBlock(elementOrCss) {
  9161. const webkit = isWebKit();
  9162. const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
  9163. return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
  9164. }
  9165. function getContainingBlock(element) {
  9166. let currentNode = getParentNode(element);
  9167. while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
  9168. if (isContainingBlock(currentNode)) return currentNode;
  9169. else if (isTopLayer(currentNode)) return null;
  9170. currentNode = getParentNode(currentNode);
  9171. }
  9172. return null;
  9173. }
  9174. function isWebKit() {
  9175. if (typeof CSS === "undefined" || !CSS.supports) return false;
  9176. return CSS.supports("-webkit-backdrop-filter", "none");
  9177. }
  9178. const lastTraversableNodeNames = /* @__PURE__ */ new Set([
  9179. "html",
  9180. "body",
  9181. "#document"
  9182. ]);
  9183. function isLastTraversableNode(node) {
  9184. return lastTraversableNodeNames.has(getNodeName(node));
  9185. }
  9186. function getComputedStyle$1(element) {
  9187. return getWindow(element).getComputedStyle(element);
  9188. }
  9189. function getNodeScroll(element) {
  9190. if (isElement(element)) return {
  9191. scrollLeft: element.scrollLeft,
  9192. scrollTop: element.scrollTop
  9193. };
  9194. return {
  9195. scrollLeft: element.scrollX,
  9196. scrollTop: element.scrollY
  9197. };
  9198. }
  9199. function getParentNode(node) {
  9200. if (getNodeName(node) === "html") return node;
  9201. const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
  9202. return isShadowRoot(result) ? result.host : result;
  9203. }
  9204. function getNearestOverflowAncestor(node) {
  9205. const parentNode = getParentNode(node);
  9206. if (isLastTraversableNode(parentNode)) return node.ownerDocument ? node.ownerDocument.body : node.body;
  9207. if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
  9208. return getNearestOverflowAncestor(parentNode);
  9209. }
  9210. function getOverflowAncestors(node, list, traverseIframes) {
  9211. var _node$ownerDocument2;
  9212. if (list === void 0) list = [];
  9213. if (traverseIframes === void 0) traverseIframes = true;
  9214. const scrollableAncestor = getNearestOverflowAncestor(node);
  9215. const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
  9216. const win = getWindow(scrollableAncestor);
  9217. if (isBody) {
  9218. const frameElement = getFrameElement(win);
  9219. return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
  9220. }
  9221. return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
  9222. }
  9223. function getFrameElement(win) {
  9224. return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
  9225. }
  9226. //#endregion
  9227. //#region ../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
  9228. function getCssDimensions(element) {
  9229. const css = getComputedStyle$1(element);
  9230. let width = parseFloat(css.width) || 0;
  9231. let height = parseFloat(css.height) || 0;
  9232. const hasOffset = isHTMLElement(element);
  9233. const offsetWidth = hasOffset ? element.offsetWidth : width;
  9234. const offsetHeight = hasOffset ? element.offsetHeight : height;
  9235. const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
  9236. if (shouldFallback) {
  9237. width = offsetWidth;
  9238. height = offsetHeight;
  9239. }
  9240. return {
  9241. width,
  9242. height,
  9243. $: shouldFallback
  9244. };
  9245. }
  9246. function unwrapElement(element) {
  9247. return !isElement(element) ? element.contextElement : element;
  9248. }
  9249. function getScale(element) {
  9250. const domElement = unwrapElement(element);
  9251. if (!isHTMLElement(domElement)) return createCoords(1);
  9252. const rect = domElement.getBoundingClientRect();
  9253. const { width, height, $ } = getCssDimensions(domElement);
  9254. let x = ($ ? round(rect.width) : rect.width) / width;
  9255. let y = ($ ? round(rect.height) : rect.height) / height;
  9256. if (!x || !Number.isFinite(x)) x = 1;
  9257. if (!y || !Number.isFinite(y)) y = 1;
  9258. return {
  9259. x,
  9260. y
  9261. };
  9262. }
  9263. const noOffsets = /* @__PURE__ */ createCoords(0);
  9264. function getVisualOffsets(element) {
  9265. const win = getWindow(element);
  9266. if (!isWebKit() || !win.visualViewport) return noOffsets;
  9267. return {
  9268. x: win.visualViewport.offsetLeft,
  9269. y: win.visualViewport.offsetTop
  9270. };
  9271. }
  9272. function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
  9273. if (isFixed === void 0) isFixed = false;
  9274. if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) return false;
  9275. return isFixed;
  9276. }
  9277. function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
  9278. if (includeScale === void 0) includeScale = false;
  9279. if (isFixedStrategy === void 0) isFixedStrategy = false;
  9280. const clientRect = element.getBoundingClientRect();
  9281. const domElement = unwrapElement(element);
  9282. let scale = createCoords(1);
  9283. if (includeScale) if (offsetParent) {
  9284. if (isElement(offsetParent)) scale = getScale(offsetParent);
  9285. } else scale = getScale(element);
  9286. const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
  9287. let x = (clientRect.left + visualOffsets.x) / scale.x;
  9288. let y = (clientRect.top + visualOffsets.y) / scale.y;
  9289. let width = clientRect.width / scale.x;
  9290. let height = clientRect.height / scale.y;
  9291. if (domElement) {
  9292. const win = getWindow(domElement);
  9293. const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
  9294. let currentWin = win;
  9295. let currentIFrame = getFrameElement(currentWin);
  9296. while (currentIFrame && offsetParent && offsetWin !== currentWin) {
  9297. const iframeScale = getScale(currentIFrame);
  9298. const iframeRect = currentIFrame.getBoundingClientRect();
  9299. const css = getComputedStyle$1(currentIFrame);
  9300. const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
  9301. const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
  9302. x *= iframeScale.x;
  9303. y *= iframeScale.y;
  9304. width *= iframeScale.x;
  9305. height *= iframeScale.y;
  9306. x += left;
  9307. y += top;
  9308. currentWin = getWindow(currentIFrame);
  9309. currentIFrame = getFrameElement(currentWin);
  9310. }
  9311. }
  9312. return rectToClientRect({
  9313. width,
  9314. height,
  9315. x,
  9316. y
  9317. });
  9318. }
  9319. function getWindowScrollBarX(element, rect) {
  9320. const leftScroll = getNodeScroll(element).scrollLeft;
  9321. if (!rect) return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
  9322. return rect.left + leftScroll;
  9323. }
  9324. function getHTMLOffset(documentElement, scroll) {
  9325. const htmlRect = documentElement.getBoundingClientRect();
  9326. return {
  9327. x: htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
  9328. y: htmlRect.top + scroll.scrollTop
  9329. };
  9330. }
  9331. function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
  9332. let { elements, rect, offsetParent, strategy } = _ref;
  9333. const isFixed = strategy === "fixed";
  9334. const documentElement = getDocumentElement(offsetParent);
  9335. const topLayer = elements ? isTopLayer(elements.floating) : false;
  9336. if (offsetParent === documentElement || topLayer && isFixed) return rect;
  9337. let scroll = {
  9338. scrollLeft: 0,
  9339. scrollTop: 0
  9340. };
  9341. let scale = createCoords(1);
  9342. const offsets = createCoords(0);
  9343. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9344. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  9345. if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
  9346. if (isHTMLElement(offsetParent)) {
  9347. const offsetRect = getBoundingClientRect(offsetParent);
  9348. scale = getScale(offsetParent);
  9349. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9350. offsets.y = offsetRect.y + offsetParent.clientTop;
  9351. }
  9352. }
  9353. const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
  9354. return {
  9355. width: rect.width * scale.x,
  9356. height: rect.height * scale.y,
  9357. x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
  9358. y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
  9359. };
  9360. }
  9361. function getClientRects(element) {
  9362. return Array.from(element.getClientRects());
  9363. }
  9364. function getDocumentRect(element) {
  9365. const html = getDocumentElement(element);
  9366. const scroll = getNodeScroll(element);
  9367. const body = element.ownerDocument.body;
  9368. const width = max$1(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
  9369. const height = max$1(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
  9370. let x = -scroll.scrollLeft + getWindowScrollBarX(element);
  9371. const y = -scroll.scrollTop;
  9372. if (getComputedStyle$1(body).direction === "rtl") x += max$1(html.clientWidth, body.clientWidth) - width;
  9373. return {
  9374. width,
  9375. height,
  9376. x,
  9377. y
  9378. };
  9379. }
  9380. const SCROLLBAR_MAX = 25;
  9381. function getViewportRect(element, strategy) {
  9382. const win = getWindow(element);
  9383. const html = getDocumentElement(element);
  9384. const visualViewport = win.visualViewport;
  9385. let width = html.clientWidth;
  9386. let height = html.clientHeight;
  9387. let x = 0;
  9388. let y = 0;
  9389. if (visualViewport) {
  9390. width = visualViewport.width;
  9391. height = visualViewport.height;
  9392. const visualViewportBased = isWebKit();
  9393. if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
  9394. x = visualViewport.offsetLeft;
  9395. y = visualViewport.offsetTop;
  9396. }
  9397. }
  9398. const windowScrollbarX = getWindowScrollBarX(html);
  9399. if (windowScrollbarX <= 0) {
  9400. const doc = html.ownerDocument;
  9401. const body = doc.body;
  9402. const bodyStyles = getComputedStyle(body);
  9403. const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
  9404. const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
  9405. if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) width -= clippingStableScrollbarWidth;
  9406. } else if (windowScrollbarX <= SCROLLBAR_MAX) width += windowScrollbarX;
  9407. return {
  9408. width,
  9409. height,
  9410. x,
  9411. y
  9412. };
  9413. }
  9414. const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
  9415. function getInnerBoundingClientRect(element, strategy) {
  9416. const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
  9417. const top = clientRect.top + element.clientTop;
  9418. const left = clientRect.left + element.clientLeft;
  9419. const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
  9420. return {
  9421. width: element.clientWidth * scale.x,
  9422. height: element.clientHeight * scale.y,
  9423. x: left * scale.x,
  9424. y: top * scale.y
  9425. };
  9426. }
  9427. function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
  9428. let rect;
  9429. if (clippingAncestor === "viewport") rect = getViewportRect(element, strategy);
  9430. else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
  9431. else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
  9432. else {
  9433. const visualOffsets = getVisualOffsets(element);
  9434. rect = {
  9435. x: clippingAncestor.x - visualOffsets.x,
  9436. y: clippingAncestor.y - visualOffsets.y,
  9437. width: clippingAncestor.width,
  9438. height: clippingAncestor.height
  9439. };
  9440. }
  9441. return rectToClientRect(rect);
  9442. }
  9443. function hasFixedPositionAncestor(element, stopNode) {
  9444. const parentNode = getParentNode(element);
  9445. if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) return false;
  9446. return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
  9447. }
  9448. function getClippingElementAncestors(element, cache) {
  9449. const cachedResult = cache.get(element);
  9450. if (cachedResult) return cachedResult;
  9451. let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
  9452. let currentContainingBlockComputedStyle = null;
  9453. const elementIsFixed = getComputedStyle$1(element).position === "fixed";
  9454. let currentNode = elementIsFixed ? getParentNode(element) : element;
  9455. while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
  9456. const computedStyle = getComputedStyle$1(currentNode);
  9457. const currentNodeIsContaining = isContainingBlock(currentNode);
  9458. if (!currentNodeIsContaining && computedStyle.position === "fixed") currentContainingBlockComputedStyle = null;
  9459. if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
  9460. else currentContainingBlockComputedStyle = computedStyle;
  9461. currentNode = getParentNode(currentNode);
  9462. }
  9463. cache.set(element, result);
  9464. return result;
  9465. }
  9466. function getClippingRect(_ref) {
  9467. let { element, boundary, rootBoundary, strategy } = _ref;
  9468. const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
  9469. const firstClippingAncestor = clippingAncestors[0];
  9470. const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
  9471. const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
  9472. accRect.top = max$1(rect.top, accRect.top);
  9473. accRect.right = min$1(rect.right, accRect.right);
  9474. accRect.bottom = min$1(rect.bottom, accRect.bottom);
  9475. accRect.left = max$1(rect.left, accRect.left);
  9476. return accRect;
  9477. }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
  9478. return {
  9479. width: clippingRect.right - clippingRect.left,
  9480. height: clippingRect.bottom - clippingRect.top,
  9481. x: clippingRect.left,
  9482. y: clippingRect.top
  9483. };
  9484. }
  9485. function getDimensions(element) {
  9486. const { width, height } = getCssDimensions(element);
  9487. return {
  9488. width,
  9489. height
  9490. };
  9491. }
  9492. function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
  9493. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9494. const documentElement = getDocumentElement(offsetParent);
  9495. const isFixed = strategy === "fixed";
  9496. const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
  9497. let scroll = {
  9498. scrollLeft: 0,
  9499. scrollTop: 0
  9500. };
  9501. const offsets = createCoords(0);
  9502. function setLeftRTLScrollbarOffset() {
  9503. offsets.x = getWindowScrollBarX(documentElement);
  9504. }
  9505. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  9506. if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
  9507. if (isOffsetParentAnElement) {
  9508. const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
  9509. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9510. offsets.y = offsetRect.y + offsetParent.clientTop;
  9511. } else if (documentElement) setLeftRTLScrollbarOffset();
  9512. }
  9513. if (isFixed && !isOffsetParentAnElement && documentElement) setLeftRTLScrollbarOffset();
  9514. const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
  9515. return {
  9516. x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
  9517. y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
  9518. width: rect.width,
  9519. height: rect.height
  9520. };
  9521. }
  9522. function isStaticPositioned(element) {
  9523. return getComputedStyle$1(element).position === "static";
  9524. }
  9525. function getTrueOffsetParent(element, polyfill) {
  9526. if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") return null;
  9527. if (polyfill) return polyfill(element);
  9528. let rawOffsetParent = element.offsetParent;
  9529. if (getDocumentElement(element) === rawOffsetParent) rawOffsetParent = rawOffsetParent.ownerDocument.body;
  9530. return rawOffsetParent;
  9531. }
  9532. function getOffsetParent(element, polyfill) {
  9533. const win = getWindow(element);
  9534. if (isTopLayer(element)) return win;
  9535. if (!isHTMLElement(element)) {
  9536. let svgOffsetParent = getParentNode(element);
  9537. while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
  9538. if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) return svgOffsetParent;
  9539. svgOffsetParent = getParentNode(svgOffsetParent);
  9540. }
  9541. return win;
  9542. }
  9543. let offsetParent = getTrueOffsetParent(element, polyfill);
  9544. while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) offsetParent = getTrueOffsetParent(offsetParent, polyfill);
  9545. if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) return win;
  9546. return offsetParent || getContainingBlock(element) || win;
  9547. }
  9548. const getElementRects = async function(data) {
  9549. const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
  9550. const getDimensionsFn = this.getDimensions;
  9551. const floatingDimensions = await getDimensionsFn(data.floating);
  9552. return {
  9553. reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
  9554. floating: {
  9555. x: 0,
  9556. y: 0,
  9557. width: floatingDimensions.width,
  9558. height: floatingDimensions.height
  9559. }
  9560. };
  9561. };
  9562. function isRTL$1(element) {
  9563. return getComputedStyle$1(element).direction === "rtl";
  9564. }
  9565. const platform = {
  9566. convertOffsetParentRelativeRectToViewportRelativeRect,
  9567. getDocumentElement,
  9568. getClippingRect,
  9569. getOffsetParent,
  9570. getElementRects,
  9571. getClientRects,
  9572. getDimensions,
  9573. getScale,
  9574. isElement,
  9575. isRTL: isRTL$1
  9576. };
  9577. function rectsAreEqual(a, b) {
  9578. return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
  9579. }
  9580. function observeMove(element, onMove) {
  9581. let io = null;
  9582. let timeoutId;
  9583. const root = getDocumentElement(element);
  9584. function cleanup() {
  9585. var _io;
  9586. clearTimeout(timeoutId);
  9587. (_io = io) == null || _io.disconnect();
  9588. io = null;
  9589. }
  9590. function refresh(skip, threshold) {
  9591. if (skip === void 0) skip = false;
  9592. if (threshold === void 0) threshold = 1;
  9593. cleanup();
  9594. const elementRectForRootMargin = element.getBoundingClientRect();
  9595. const { left, top, width, height } = elementRectForRootMargin;
  9596. if (!skip) onMove();
  9597. if (!width || !height) return;
  9598. const insetTop = floor$1(top);
  9599. const insetRight = floor$1(root.clientWidth - (left + width));
  9600. const insetBottom = floor$1(root.clientHeight - (top + height));
  9601. const insetLeft = floor$1(left);
  9602. const options = {
  9603. rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
  9604. threshold: max$1(0, min$1(1, threshold)) || 1
  9605. };
  9606. let isFirstUpdate = true;
  9607. function handleObserve(entries) {
  9608. const ratio = entries[0].intersectionRatio;
  9609. if (ratio !== threshold) {
  9610. if (!isFirstUpdate) return refresh();
  9611. if (!ratio) timeoutId = setTimeout(() => {
  9612. refresh(false, 1e-7);
  9613. }, 1e3);
  9614. else refresh(false, ratio);
  9615. }
  9616. if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) refresh();
  9617. isFirstUpdate = false;
  9618. }
  9619. try {
  9620. io = new IntersectionObserver(handleObserve, {
  9621. ...options,
  9622. root: root.ownerDocument
  9623. });
  9624. } catch (_e) {
  9625. io = new IntersectionObserver(handleObserve, options);
  9626. }
  9627. io.observe(element);
  9628. }
  9629. refresh(true);
  9630. return cleanup;
  9631. }
  9632. /**
  9633. * Automatically updates the position of the floating element when necessary.
  9634. * Should only be called when the floating element is mounted on the DOM or
  9635. * visible on the screen.
  9636. * @returns cleanup function that should be invoked when the floating element is
  9637. * removed from the DOM or hidden from the screen.
  9638. * @see https://floating-ui.com/docs/autoUpdate
  9639. */
  9640. function autoUpdate(reference, floating, update, options) {
  9641. if (options === void 0) options = {};
  9642. const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
  9643. const referenceEl = unwrapElement(reference);
  9644. const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
  9645. ancestors.forEach((ancestor) => {
  9646. ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
  9647. ancestorResize && ancestor.addEventListener("resize", update);
  9648. });
  9649. const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
  9650. let reobserveFrame = -1;
  9651. let resizeObserver = null;
  9652. if (elementResize) {
  9653. resizeObserver = new ResizeObserver((_ref) => {
  9654. let [firstEntry] = _ref;
  9655. if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
  9656. resizeObserver.unobserve(floating);
  9657. cancelAnimationFrame(reobserveFrame);
  9658. reobserveFrame = requestAnimationFrame(() => {
  9659. var _resizeObserver;
  9660. (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
  9661. });
  9662. }
  9663. update();
  9664. });
  9665. if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
  9666. resizeObserver.observe(floating);
  9667. }
  9668. let frameId;
  9669. let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
  9670. if (animationFrame) frameLoop();
  9671. function frameLoop() {
  9672. const nextRefRect = getBoundingClientRect(reference);
  9673. if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) update();
  9674. prevRefRect = nextRefRect;
  9675. frameId = requestAnimationFrame(frameLoop);
  9676. }
  9677. update();
  9678. return () => {
  9679. var _resizeObserver2;
  9680. ancestors.forEach((ancestor) => {
  9681. ancestorScroll && ancestor.removeEventListener("scroll", update);
  9682. ancestorResize && ancestor.removeEventListener("resize", update);
  9683. });
  9684. cleanupIo?.();
  9685. (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
  9686. resizeObserver = null;
  9687. if (animationFrame) cancelAnimationFrame(frameId);
  9688. };
  9689. }
  9690. /**
  9691. * Resolves with an object of overflow side offsets that determine how much the
  9692. * element is overflowing a given clipping boundary on each side.
  9693. * - positive = overflowing the boundary by that number of pixels
  9694. * - negative = how many pixels left before it will overflow
  9695. * - 0 = lies flush with the boundary
  9696. * @see https://floating-ui.com/docs/detectOverflow
  9697. */
  9698. const detectOverflow = detectOverflow$1;
  9699. /**
  9700. * Modifies the placement by translating the floating element along the
  9701. * specified axes.
  9702. * A number (shorthand for `mainAxis` or distance), or an axes configuration
  9703. * object may be passed.
  9704. * @see https://floating-ui.com/docs/offset
  9705. */
  9706. const offset = offset$1;
  9707. /**
  9708. * Optimizes the visibility of the floating element by shifting it in order to
  9709. * keep it in view when it will overflow the clipping boundary.
  9710. * @see https://floating-ui.com/docs/shift
  9711. */
  9712. const shift = shift$1;
  9713. /**
  9714. * Optimizes the visibility of the floating element by flipping the `placement`
  9715. * in order to keep it in view when the preferred placement(s) will overflow the
  9716. * clipping boundary. Alternative to `autoPlacement`.
  9717. * @see https://floating-ui.com/docs/flip
  9718. */
  9719. const flip = flip$1;
  9720. /**
  9721. * Provides data to position an inner element of the floating element so that it
  9722. * appears centered to the reference element.
  9723. * @see https://floating-ui.com/docs/arrow
  9724. */
  9725. const arrow = arrow$1;
  9726. /**
  9727. * Computes the `x` and `y` coordinates that will place the floating element
  9728. * next to a given reference element.
  9729. */
  9730. const computePosition = (reference, floating, options) => {
  9731. const cache = /* @__PURE__ */ new Map();
  9732. const mergedOptions = {
  9733. platform,
  9734. ...options
  9735. };
  9736. const platformWithCache = {
  9737. ...mergedOptions.platform,
  9738. _c: cache
  9739. };
  9740. return computePosition$1(reference, floating, {
  9741. ...mergedOptions,
  9742. platform: platformWithCache
  9743. });
  9744. };
  9745. //#endregion
  9746. //#region ../../packages/hooks/use-floating/index.ts
  9747. const useFloatingProps = buildProps({});
  9748. const unrefReference = (elRef) => {
  9749. if (!isClient) return;
  9750. if (!elRef) return elRef;
  9751. const unrefEl = unrefElement(elRef);
  9752. if (unrefEl) return unrefEl;
  9753. return isRef(elRef) ? unrefEl : elRef;
  9754. };
  9755. const getPositionDataWithUnit = (record, key) => {
  9756. const value = record?.[key];
  9757. return isNil(value) ? "" : `${value}px`;
  9758. };
  9759. const useFloating = ({ middleware, placement, strategy }) => {
  9760. const referenceRef = ref();
  9761. const contentRef = ref();
  9762. const states = {
  9763. x: ref(),
  9764. y: ref(),
  9765. placement,
  9766. strategy,
  9767. middlewareData: ref({})
  9768. };
  9769. const update = async () => {
  9770. if (!isClient) return;
  9771. const referenceEl = unrefReference(referenceRef);
  9772. const contentEl = unrefElement(contentRef);
  9773. if (!referenceEl || !contentEl) return;
  9774. const data = await computePosition(referenceEl, contentEl, {
  9775. placement: unref(placement),
  9776. strategy: unref(strategy),
  9777. middleware: unref(middleware)
  9778. });
  9779. keysOf(states).forEach((key) => {
  9780. states[key].value = data[key];
  9781. });
  9782. };
  9783. onMounted(() => {
  9784. watchEffect(() => {
  9785. update();
  9786. });
  9787. });
  9788. return {
  9789. ...states,
  9790. update,
  9791. referenceRef,
  9792. contentRef
  9793. };
  9794. };
  9795. const arrowMiddleware = ({ arrowRef, padding }) => {
  9796. return {
  9797. name: "arrow",
  9798. options: {
  9799. element: arrowRef,
  9800. padding
  9801. },
  9802. fn(args) {
  9803. const arrowEl = unref(arrowRef);
  9804. if (!arrowEl) return {};
  9805. return arrow({
  9806. element: arrowEl,
  9807. padding
  9808. }).fn(args);
  9809. }
  9810. };
  9811. };
  9812. //#endregion
  9813. //#region ../../packages/hooks/use-cursor/index.ts
  9814. function useCursor(input) {
  9815. let selectionInfo;
  9816. function recordCursor() {
  9817. if (input.value == void 0) return;
  9818. const { selectionStart, selectionEnd, value } = input.value;
  9819. if (selectionStart == null || selectionEnd == null) return;
  9820. selectionInfo = {
  9821. selectionStart,
  9822. selectionEnd,
  9823. value,
  9824. beforeTxt: value.slice(0, Math.max(0, selectionStart)),
  9825. afterTxt: value.slice(Math.max(0, selectionEnd))
  9826. };
  9827. }
  9828. function setCursor() {
  9829. if (input.value == void 0 || selectionInfo == void 0) return;
  9830. const { value } = input.value;
  9831. const { beforeTxt, afterTxt, selectionStart } = selectionInfo;
  9832. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0) return;
  9833. let startPos = value.length;
  9834. if (value.endsWith(afterTxt)) startPos = value.length - afterTxt.length;
  9835. else if (value.startsWith(beforeTxt)) startPos = beforeTxt.length;
  9836. else {
  9837. const beforeLastChar = beforeTxt[selectionStart - 1];
  9838. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  9839. if (newIndex !== -1) startPos = newIndex + 1;
  9840. }
  9841. input.value.setSelectionRange(startPos, startPos);
  9842. }
  9843. return [recordCursor, setCursor];
  9844. }
  9845. //#endregion
  9846. //#region ../../packages/hooks/use-ordered-children/index.ts
  9847. const getOrderedChildren = (vm, childComponentName, children) => {
  9848. return flattedChildren(vm.subTree).filter((n) => isVNode(n) && n.type?.name === childComponentName && !!n.component).map((n) => n.component.uid).map((uid) => children[uid]).filter((p) => !!p);
  9849. };
  9850. const useOrderedChildren = (vm, childComponentName) => {
  9851. const children = shallowRef({});
  9852. const orderedChildren = shallowRef([]);
  9853. const nodesMap = /* @__PURE__ */ new WeakMap();
  9854. const addChild = (child) => {
  9855. children.value[child.uid] = child;
  9856. triggerRef(children);
  9857. onMounted(() => {
  9858. const childNode = child.getVnode().el;
  9859. const parentNode = childNode.parentNode;
  9860. if (!nodesMap.has(parentNode)) {
  9861. nodesMap.set(parentNode, []);
  9862. const originalFn = parentNode.insertBefore.bind(parentNode);
  9863. parentNode.insertBefore = (node, anchor) => {
  9864. if (nodesMap.get(parentNode).some((el) => node === el || anchor === el)) triggerRef(children);
  9865. return originalFn(node, anchor);
  9866. };
  9867. }
  9868. nodesMap.get(parentNode).push(childNode);
  9869. });
  9870. };
  9871. const removeChild = (child) => {
  9872. delete children.value[child.uid];
  9873. triggerRef(children);
  9874. const childNode = child.getVnode().el;
  9875. const parentNode = childNode.parentNode;
  9876. const childNodes = nodesMap.get(parentNode);
  9877. const index = childNodes.indexOf(childNode);
  9878. childNodes.splice(index, 1);
  9879. };
  9880. const sortChildren = () => {
  9881. orderedChildren.value = getOrderedChildren(vm, childComponentName, children.value);
  9882. };
  9883. const IsolatedRenderer = (props) => {
  9884. return props.render();
  9885. };
  9886. return {
  9887. children: orderedChildren,
  9888. addChild,
  9889. removeChild,
  9890. ChildrenSorter: defineComponent({ setup(_, { slots }) {
  9891. return () => {
  9892. sortChildren();
  9893. return slots.default ? h(IsolatedRenderer, { render: slots.default }) : null;
  9894. };
  9895. } })
  9896. };
  9897. };
  9898. //#endregion
  9899. //#region ../../packages/hooks/use-size/index.ts
  9900. const useSizeProp = buildProp({
  9901. type: String,
  9902. values: componentSizes,
  9903. required: false
  9904. });
  9905. const useSizeProps = { size: useSizeProp };
  9906. const SIZE_INJECTION_KEY = Symbol("size");
  9907. const useGlobalSize = () => {
  9908. const injectedSize = inject(SIZE_INJECTION_KEY, {});
  9909. return computed(() => {
  9910. return unref(injectedSize.size) || "";
  9911. });
  9912. };
  9913. //#endregion
  9914. //#region ../../packages/hooks/use-focus-controller/index.ts
  9915. function useFocusController(target, { disabled, beforeFocus, afterFocus, beforeBlur, afterBlur } = {}) {
  9916. const { emit } = getCurrentInstance();
  9917. const wrapperRef = shallowRef();
  9918. const isFocused = ref(false);
  9919. const handleFocus = (event) => {
  9920. const cancelFocus = isFunction$1(beforeFocus) ? beforeFocus(event) : false;
  9921. if (unref(disabled) || isFocused.value || cancelFocus) return;
  9922. isFocused.value = true;
  9923. emit("focus", event);
  9924. afterFocus?.();
  9925. };
  9926. const handleBlur = (event) => {
  9927. const cancelBlur = isFunction$1(beforeBlur) ? beforeBlur(event) : false;
  9928. if (unref(disabled) || event.relatedTarget && wrapperRef.value?.contains(event.relatedTarget) || cancelBlur) return;
  9929. isFocused.value = false;
  9930. emit("blur", event);
  9931. afterBlur?.();
  9932. };
  9933. const handleClick = (event) => {
  9934. if (unref(disabled) || isFocusable(event.target) || wrapperRef.value?.contains(document.activeElement) && wrapperRef.value !== document.activeElement) return;
  9935. target.value?.focus();
  9936. };
  9937. watch([wrapperRef, () => unref(disabled)], ([el, disabled]) => {
  9938. if (!el) return;
  9939. if (disabled) el.removeAttribute("tabindex");
  9940. else el.setAttribute("tabindex", "-1");
  9941. });
  9942. useEventListener(wrapperRef, "focus", handleFocus, true);
  9943. useEventListener(wrapperRef, "blur", handleBlur, true);
  9944. useEventListener(wrapperRef, "click", handleClick, true);
  9945. return {
  9946. isFocused,
  9947. wrapperRef,
  9948. handleFocus,
  9949. handleBlur
  9950. };
  9951. }
  9952. //#endregion
  9953. //#region ../../packages/hooks/use-composition/index.ts
  9954. function useComposition({ afterComposition, emit }) {
  9955. const isComposing = ref(false);
  9956. const handleCompositionStart = (event) => {
  9957. emit?.("compositionstart", event);
  9958. isComposing.value = true;
  9959. };
  9960. const handleCompositionUpdate = (event) => {
  9961. emit?.("compositionupdate", event);
  9962. const text = event.target?.value;
  9963. isComposing.value = !isKorean(text[text.length - 1] || "");
  9964. };
  9965. const handleCompositionEnd = (event) => {
  9966. emit?.("compositionend", event);
  9967. if (isComposing.value) {
  9968. isComposing.value = false;
  9969. nextTick(() => afterComposition(event));
  9970. }
  9971. };
  9972. const handleComposition = (event) => {
  9973. event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
  9974. };
  9975. return {
  9976. isComposing,
  9977. handleComposition,
  9978. handleCompositionStart,
  9979. handleCompositionUpdate,
  9980. handleCompositionEnd
  9981. };
  9982. }
  9983. //#endregion
  9984. //#region ../../packages/hooks/use-empty-values/index.ts
  9985. const emptyValuesContextKey = Symbol("emptyValuesContextKey");
  9986. const SCOPE = "use-empty-values";
  9987. const DEFAULT_EMPTY_VALUES = [
  9988. "",
  9989. void 0,
  9990. null
  9991. ];
  9992. const DEFAULT_VALUE_ON_CLEAR = void 0;
  9993. /**
  9994. * @deprecated Removed after 3.0.0, Use `UseEmptyValuesProps` instead.
  9995. */
  9996. const useEmptyValuesProps = buildProps({
  9997. emptyValues: Array,
  9998. valueOnClear: {
  9999. type: definePropType([
  10000. String,
  10001. Number,
  10002. Boolean,
  10003. Function
  10004. ]),
  10005. default: void 0,
  10006. validator: (val) => {
  10007. val = isFunction$1(val) ? val() : val;
  10008. if (isArray$1(val)) return val.every((item) => !item);
  10009. return !val;
  10010. }
  10011. }
  10012. });
  10013. const useEmptyValues = (props, defaultValue) => {
  10014. const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
  10015. const emptyValues = computed(() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES);
  10016. const valueOnClear = computed(() => {
  10017. if (isFunction$1(props.valueOnClear)) return props.valueOnClear();
  10018. else if (props.valueOnClear !== void 0) return props.valueOnClear;
  10019. else if (isFunction$1(config.value.valueOnClear)) return config.value.valueOnClear();
  10020. else if (config.value.valueOnClear !== void 0) return config.value.valueOnClear;
  10021. return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR;
  10022. });
  10023. const isEmptyValue = (value) => {
  10024. let result = true;
  10025. if (isArray$1(value)) result = emptyValues.value.some((emptyValue) => {
  10026. return isEqual$1(value, emptyValue);
  10027. });
  10028. else result = emptyValues.value.includes(value);
  10029. return result;
  10030. };
  10031. if (!isEmptyValue(valueOnClear.value)) /* @__PURE__ */ debugWarn(SCOPE, "value-on-clear should be a value of empty-values");
  10032. return {
  10033. emptyValues,
  10034. valueOnClear,
  10035. isEmptyValue
  10036. };
  10037. };
  10038. //#endregion
  10039. //#region ../../packages/hooks/use-aria/index.ts
  10040. /**
  10041. * @deprecated Removed after 3.0.0, Use `AriaProps` instead.
  10042. */
  10043. const ariaProps = buildProps({
  10044. ariaLabel: String,
  10045. ariaOrientation: {
  10046. type: String,
  10047. values: [
  10048. "horizontal",
  10049. "vertical",
  10050. "undefined"
  10051. ]
  10052. },
  10053. ariaControls: String
  10054. });
  10055. const useAriaProps = (arias) => {
  10056. return pick(ariaProps, arias);
  10057. };
  10058. //#endregion
  10059. //#region ../../packages/components/config-provider/src/constants.ts
  10060. const configProviderContextKey = Symbol();
  10061. //#endregion
  10062. //#region ../../packages/components/config-provider/src/hooks/use-global-config.ts
  10063. const globalConfig = ref();
  10064. function useGlobalConfig(key, defaultValue = void 0) {
  10065. const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
  10066. if (key) return computed(() => config.value?.[key] ?? defaultValue);
  10067. else return config;
  10068. }
  10069. function useGlobalComponentSettings(block, sizeFallback) {
  10070. const config = useGlobalConfig();
  10071. const ns = useNamespace(block, computed(() => config.value?.namespace || defaultNamespace));
  10072. const locale = useLocale(computed(() => config.value?.locale));
  10073. const zIndex = useZIndex(computed(() => config.value?.zIndex || defaultInitialZIndex));
  10074. const size = computed(() => unref(sizeFallback) || config.value?.size || "");
  10075. provideGlobalConfig(computed(() => unref(config) || {}));
  10076. return {
  10077. ns,
  10078. locale,
  10079. zIndex,
  10080. size
  10081. };
  10082. }
  10083. const provideGlobalConfig = (config, app, global = false) => {
  10084. const inSetup = !!getCurrentInstance();
  10085. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  10086. const provideFn = app?.provide ?? (inSetup ? provide : void 0);
  10087. if (!provideFn) {
  10088. /* @__PURE__ */ debugWarn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
  10089. return;
  10090. }
  10091. const context = computed(() => {
  10092. const cfg = unref(config);
  10093. if (!oldConfig?.value) return cfg;
  10094. return mergeConfig(oldConfig.value, cfg);
  10095. });
  10096. provideFn(configProviderContextKey, context);
  10097. provideFn(localeContextKey, computed(() => context.value.locale));
  10098. provideFn(namespaceContextKey, computed(() => context.value.namespace));
  10099. provideFn(zIndexContextKey, computed(() => context.value.zIndex));
  10100. provideFn(SIZE_INJECTION_KEY, { size: computed(() => context.value.size || "") });
  10101. provideFn(emptyValuesContextKey, computed(() => ({
  10102. emptyValues: context.value.emptyValues,
  10103. valueOnClear: context.value.valueOnClear
  10104. })));
  10105. if (global || !globalConfig.value) globalConfig.value = context.value;
  10106. return context;
  10107. };
  10108. const mergeConfig = (a, b) => {
  10109. const keys = [...new Set([...keysOf(a), ...keysOf(b)])];
  10110. const obj = {};
  10111. for (const key of keys) obj[key] = b[key] !== void 0 ? b[key] : a[key];
  10112. return obj;
  10113. };
  10114. //#endregion
  10115. //#region ../../packages/components/config-provider/src/config-provider-props.ts
  10116. const configProviderProps = buildProps({
  10117. a11y: {
  10118. type: Boolean,
  10119. default: true
  10120. },
  10121. locale: { type: definePropType(Object) },
  10122. size: useSizeProp,
  10123. button: { type: definePropType(Object) },
  10124. card: { type: definePropType(Object) },
  10125. dialog: { type: definePropType(Object) },
  10126. link: { type: definePropType(Object) },
  10127. experimentalFeatures: { type: definePropType(Object) },
  10128. keyboardNavigation: {
  10129. type: Boolean,
  10130. default: true
  10131. },
  10132. message: { type: definePropType(Object) },
  10133. zIndex: Number,
  10134. namespace: {
  10135. type: String,
  10136. default: "el"
  10137. },
  10138. table: { type: definePropType(Object) },
  10139. ...useEmptyValuesProps
  10140. });
  10141. //#endregion
  10142. //#region ../../packages/components/config-provider/src/config-provider.ts
  10143. const messageConfig = { placement: "top" };
  10144. const ConfigProvider = defineComponent({
  10145. name: "ElConfigProvider",
  10146. props: configProviderProps,
  10147. setup(props, { slots }) {
  10148. const config = provideGlobalConfig(props);
  10149. watch(() => props.message, (val) => {
  10150. Object.assign(messageConfig, config?.value?.message ?? {}, val ?? {});
  10151. }, {
  10152. immediate: true,
  10153. deep: true
  10154. });
  10155. return () => renderSlot(slots, "default", { config: config?.value });
  10156. }
  10157. });
  10158. //#endregion
  10159. //#region ../../packages/components/config-provider/index.ts
  10160. const ElConfigProvider = withInstall(ConfigProvider);
  10161. //#endregion
  10162. //#region ../../packages/element-plus/version.ts
  10163. const version$1 = "2.13.5";
  10164. //#endregion
  10165. //#region ../../packages/element-plus/make-installer.ts
  10166. const makeInstaller = (components = []) => {
  10167. const install = (app, options) => {
  10168. if (app[INSTALLED_KEY]) return;
  10169. app[INSTALLED_KEY] = true;
  10170. components.forEach((c) => app.use(c));
  10171. if (options) provideGlobalConfig(options, app, true);
  10172. };
  10173. return {
  10174. version: version$1,
  10175. install
  10176. };
  10177. };
  10178. //#endregion
  10179. //#region ../../packages/components/teleport/src/teleport.ts
  10180. const teleportProps = buildProps({
  10181. to: {
  10182. type: definePropType([String, Object]),
  10183. required: true
  10184. },
  10185. disabled: Boolean
  10186. });
  10187. //#endregion
  10188. //#region ../../packages/components/teleport/src/teleport.vue?vue&type=script&setup=true&lang.ts
  10189. var teleport_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10190. __name: "teleport",
  10191. props: teleportProps,
  10192. setup(__props) {
  10193. return (_ctx, _cache) => {
  10194. return _ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, {
  10195. key: 1,
  10196. to: _ctx.to
  10197. }, [renderSlot(_ctx.$slots, "default")], 8, ["to"]));
  10198. };
  10199. }
  10200. });
  10201. //#endregion
  10202. //#region ../../packages/components/teleport/src/teleport.vue
  10203. var teleport_default = teleport_vue_vue_type_script_setup_true_lang_default;
  10204. //#endregion
  10205. //#region ../../packages/components/teleport/index.ts
  10206. const ElTeleport = withInstall(teleport_default);
  10207. //#endregion
  10208. //#region ../../packages/components/affix/src/affix.ts
  10209. /**
  10210. * @deprecated Removed after 3.0.0, Use `AffixProps` instead.
  10211. */
  10212. const affixProps = buildProps({
  10213. zIndex: {
  10214. type: definePropType([Number, String]),
  10215. default: 100
  10216. },
  10217. target: {
  10218. type: String,
  10219. default: ""
  10220. },
  10221. offset: {
  10222. type: Number,
  10223. default: 0
  10224. },
  10225. position: {
  10226. type: String,
  10227. values: ["top", "bottom"],
  10228. default: "top"
  10229. },
  10230. teleported: Boolean,
  10231. appendTo: {
  10232. type: teleportProps.to.type,
  10233. default: "body"
  10234. }
  10235. });
  10236. const affixEmits = {
  10237. scroll: ({ scrollTop, fixed }) => isNumber(scrollTop) && isBoolean(fixed),
  10238. [CHANGE_EVENT]: (fixed) => isBoolean(fixed)
  10239. };
  10240. //#endregion
  10241. //#region ../../packages/components/affix/src/affix.vue?vue&type=script&setup=true&lang.ts
  10242. const COMPONENT_NAME$22 = "ElAffix";
  10243. var affix_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10244. name: COMPONENT_NAME$22,
  10245. __name: "affix",
  10246. props: affixProps,
  10247. emits: affixEmits,
  10248. setup(__props, { expose: __expose, emit: __emit }) {
  10249. const props = __props;
  10250. const emit = __emit;
  10251. const ns = useNamespace("affix");
  10252. const target = shallowRef();
  10253. const root = shallowRef();
  10254. const scrollContainer = shallowRef();
  10255. const { height: windowHeight } = useWindowSize();
  10256. const { height: rootHeight, width: rootWidth, top: rootTop, bottom: rootBottom, left: rootLeft, update: updateRoot } = useElementBounding(root, { windowScroll: false });
  10257. const targetRect = useElementBounding(target);
  10258. const fixed = ref(false);
  10259. const scrollTop = ref(0);
  10260. const transform = ref(0);
  10261. const teleportDisabled = computed(() => {
  10262. return !props.teleported || !fixed.value;
  10263. });
  10264. const rootStyle = computed(() => {
  10265. return {
  10266. display: "flow-root",
  10267. height: fixed.value ? `${rootHeight.value}px` : "",
  10268. width: fixed.value ? `${rootWidth.value}px` : ""
  10269. };
  10270. });
  10271. const affixStyle = computed(() => {
  10272. if (!fixed.value) return {};
  10273. const offset = addUnit(props.offset);
  10274. return {
  10275. height: `${rootHeight.value}px`,
  10276. width: `${rootWidth.value}px`,
  10277. top: props.position === "top" ? offset : "",
  10278. bottom: props.position === "bottom" ? offset : "",
  10279. left: props.teleported ? `${rootLeft.value}px` : "",
  10280. transform: transform.value ? `translateY(${transform.value}px)` : "",
  10281. zIndex: props.zIndex
  10282. };
  10283. });
  10284. const update = () => {
  10285. if (!scrollContainer.value) return;
  10286. scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
  10287. const { position, target, offset } = props;
  10288. const rootHeightOffset = offset + rootHeight.value;
  10289. if (position === "top") if (target) {
  10290. const difference = targetRect.bottom.value - rootHeightOffset;
  10291. fixed.value = offset > rootTop.value && targetRect.bottom.value > 0;
  10292. transform.value = difference < 0 ? difference : 0;
  10293. } else fixed.value = offset > rootTop.value;
  10294. else if (target) {
  10295. const difference = windowHeight.value - targetRect.top.value - rootHeightOffset;
  10296. fixed.value = windowHeight.value - offset < rootBottom.value && windowHeight.value > targetRect.top.value;
  10297. transform.value = difference < 0 ? -difference : 0;
  10298. } else fixed.value = windowHeight.value - offset < rootBottom.value;
  10299. };
  10300. const updateRootRect = async () => {
  10301. if (!fixed.value) {
  10302. updateRoot();
  10303. return;
  10304. }
  10305. fixed.value = false;
  10306. await nextTick();
  10307. updateRoot();
  10308. fixed.value = true;
  10309. };
  10310. const handleScroll = async () => {
  10311. updateRoot();
  10312. await nextTick();
  10313. emit("scroll", {
  10314. scrollTop: scrollTop.value,
  10315. fixed: fixed.value
  10316. });
  10317. };
  10318. watch(fixed, (val) => emit(CHANGE_EVENT, val));
  10319. onMounted(() => {
  10320. if (props.target) {
  10321. target.value = document.querySelector(props.target) ?? void 0;
  10322. if (!target.value) throwError(COMPONENT_NAME$22, `Target does not exist: ${props.target}`);
  10323. } else target.value = document.documentElement;
  10324. scrollContainer.value = getScrollContainer(root.value, true);
  10325. updateRoot();
  10326. });
  10327. onActivated(() => {
  10328. nextTick(updateRootRect);
  10329. });
  10330. onDeactivated(() => {
  10331. fixed.value = false;
  10332. });
  10333. useEventListener(scrollContainer, "scroll", handleScroll);
  10334. watchEffect(update);
  10335. __expose({
  10336. update,
  10337. updateRoot: updateRootRect
  10338. });
  10339. return (_ctx, _cache) => {
  10340. return openBlock(), createElementBlock("div", {
  10341. ref_key: "root",
  10342. ref: root,
  10343. class: normalizeClass(unref(ns).b()),
  10344. style: normalizeStyle(rootStyle.value)
  10345. }, [createVNode(unref(ElTeleport), {
  10346. disabled: teleportDisabled.value,
  10347. to: __props.appendTo
  10348. }, {
  10349. default: withCtx(() => [createElementVNode("div", {
  10350. class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }),
  10351. style: normalizeStyle(affixStyle.value)
  10352. }, [renderSlot(_ctx.$slots, "default")], 6)]),
  10353. _: 3
  10354. }, 8, ["disabled", "to"])], 6);
  10355. };
  10356. }
  10357. });
  10358. //#endregion
  10359. //#region ../../packages/components/affix/src/affix.vue
  10360. var affix_default = affix_vue_vue_type_script_setup_true_lang_default;
  10361. //#endregion
  10362. //#region ../../packages/components/affix/index.ts
  10363. const ElAffix = withInstall(affix_default);
  10364. //#endregion
  10365. //#region ../../packages/components/alert/src/alert.ts
  10366. const alertEffects = ["light", "dark"];
  10367. /**
  10368. * @deprecated Removed after 3.0.0, Use `AlertProps` instead.
  10369. */
  10370. const alertProps = buildProps({
  10371. title: {
  10372. type: String,
  10373. default: ""
  10374. },
  10375. description: {
  10376. type: String,
  10377. default: ""
  10378. },
  10379. type: {
  10380. type: String,
  10381. values: keysOf(TypeComponentsMap),
  10382. default: "info"
  10383. },
  10384. closable: {
  10385. type: Boolean,
  10386. default: true
  10387. },
  10388. closeText: {
  10389. type: String,
  10390. default: ""
  10391. },
  10392. showIcon: Boolean,
  10393. center: Boolean,
  10394. effect: {
  10395. type: String,
  10396. values: alertEffects,
  10397. default: "light"
  10398. }
  10399. });
  10400. const alertEmits = { close: (evt) => evt instanceof MouseEvent };
  10401. //#endregion
  10402. //#region ../../packages/components/icon/src/icon.ts
  10403. /**
  10404. * @deprecated Removed after 3.0.0, Use `IconProps` instead.
  10405. */
  10406. const iconProps = buildProps({
  10407. size: { type: definePropType([Number, String]) },
  10408. color: { type: String }
  10409. });
  10410. //#endregion
  10411. //#region ../../packages/components/icon/src/icon.vue?vue&type=script&setup=true&lang.ts
  10412. var icon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10413. name: "ElIcon",
  10414. inheritAttrs: false,
  10415. __name: "icon",
  10416. props: iconProps,
  10417. setup(__props) {
  10418. const props = __props;
  10419. const ns = useNamespace("icon");
  10420. const style = computed(() => {
  10421. const { size, color } = props;
  10422. const fontSize = addUnit(size);
  10423. if (!fontSize && !color) return {};
  10424. return {
  10425. fontSize,
  10426. "--color": color
  10427. };
  10428. });
  10429. return (_ctx, _cache) => {
  10430. return openBlock(), createElementBlock("i", mergeProps({
  10431. class: unref(ns).b(),
  10432. style: style.value
  10433. }, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16);
  10434. };
  10435. }
  10436. });
  10437. //#endregion
  10438. //#region ../../packages/components/icon/src/icon.vue
  10439. var icon_default = icon_vue_vue_type_script_setup_true_lang_default;
  10440. //#endregion
  10441. //#region ../../packages/components/icon/index.ts
  10442. const ElIcon = withInstall(icon_default);
  10443. //#endregion
  10444. //#region ../../packages/components/alert/src/alert.vue?vue&type=script&setup=true&lang.ts
  10445. var alert_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10446. name: "ElAlert",
  10447. __name: "alert",
  10448. props: alertProps,
  10449. emits: alertEmits,
  10450. setup(__props, { emit: __emit }) {
  10451. const { Close } = TypeComponents;
  10452. const props = __props;
  10453. const emit = __emit;
  10454. const slots = useSlots();
  10455. const ns = useNamespace("alert");
  10456. const visible = ref(true);
  10457. const iconComponent = computed(() => TypeComponentsMap[props.type]);
  10458. const hasDesc = computed(() => {
  10459. if (props.description) return true;
  10460. const slotContent = slots.default?.();
  10461. if (!slotContent) return false;
  10462. return flattedChildren(slotContent).some((child) => !isComment(child));
  10463. });
  10464. const close = (evt) => {
  10465. visible.value = false;
  10466. emit("close", evt);
  10467. };
  10468. return (_ctx, _cache) => {
  10469. return openBlock(), createBlock(Transition, {
  10470. name: unref(ns).b("fade"),
  10471. persisted: ""
  10472. }, {
  10473. default: withCtx(() => [withDirectives(createElementVNode("div", {
  10474. class: normalizeClass([
  10475. unref(ns).b(),
  10476. unref(ns).m(__props.type),
  10477. unref(ns).is("center", __props.center),
  10478. unref(ns).is(__props.effect)
  10479. ]),
  10480. role: "alert"
  10481. }, [__props.showIcon && (_ctx.$slots.icon || iconComponent.value) ? (openBlock(), createBlock(unref(ElIcon), {
  10482. key: 0,
  10483. class: normalizeClass([unref(ns).e("icon"), unref(ns).is("big", hasDesc.value)])
  10484. }, {
  10485. default: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))])]),
  10486. _: 3
  10487. }, 8, ["class"])) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [
  10488. __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", {
  10489. key: 0,
  10490. class: normalizeClass([unref(ns).e("title"), { "with-description": hasDesc.value }])
  10491. }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true),
  10492. hasDesc.value ? (openBlock(), createElementBlock("p", {
  10493. key: 1,
  10494. class: normalizeClass(unref(ns).e("description"))
  10495. }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 2)) : createCommentVNode("v-if", true),
  10496. __props.closable ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [__props.closeText ? (openBlock(), createElementBlock("div", {
  10497. key: 0,
  10498. class: normalizeClass([unref(ns).e("close-btn"), unref(ns).is("customed")]),
  10499. onClick: close
  10500. }, toDisplayString(__props.closeText), 3)) : (openBlock(), createBlock(unref(ElIcon), {
  10501. key: 1,
  10502. class: normalizeClass(unref(ns).e("close-btn")),
  10503. onClick: close
  10504. }, {
  10505. default: withCtx(() => [createVNode(unref(Close))]),
  10506. _: 1
  10507. }, 8, ["class"]))], 64)) : createCommentVNode("v-if", true)
  10508. ], 2)], 2), [[vShow, visible.value]])]),
  10509. _: 3
  10510. }, 8, ["name"]);
  10511. };
  10512. }
  10513. });
  10514. //#endregion
  10515. //#region ../../packages/components/alert/src/alert.vue
  10516. var alert_default = alert_vue_vue_type_script_setup_true_lang_default;
  10517. //#endregion
  10518. //#region ../../packages/components/alert/index.ts
  10519. const ElAlert = withInstall(alert_default);
  10520. //#endregion
  10521. //#region ../../packages/components/popper/src/popper.ts
  10522. const Effect = {
  10523. LIGHT: "light",
  10524. DARK: "dark"
  10525. };
  10526. const roleTypes = [
  10527. "dialog",
  10528. "grid",
  10529. "group",
  10530. "listbox",
  10531. "menu",
  10532. "navigation",
  10533. "tooltip",
  10534. "tree"
  10535. ];
  10536. /**
  10537. * @deprecated Removed after 3.0.0, Use `PopperProps` instead.
  10538. */
  10539. const popperProps = buildProps({ role: {
  10540. type: String,
  10541. values: roleTypes,
  10542. default: "tooltip"
  10543. } });
  10544. /** @deprecated use `popperProps` instead, and it will be deprecated in the next major version */
  10545. const usePopperProps = popperProps;
  10546. //#endregion
  10547. //#region ../../packages/components/popper/src/constants.ts
  10548. const POPPER_INJECTION_KEY = Symbol("popper");
  10549. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  10550. //#endregion
  10551. //#region ../../packages/components/popper/src/popper.vue?vue&type=script&setup=true&lang.ts
  10552. var popper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10553. name: "ElPopper",
  10554. inheritAttrs: false,
  10555. __name: "popper",
  10556. props: popperProps,
  10557. setup(__props, { expose: __expose }) {
  10558. const props = __props;
  10559. const popperProvides = {
  10560. triggerRef: ref(),
  10561. popperInstanceRef: ref(),
  10562. contentRef: ref(),
  10563. referenceRef: ref(),
  10564. role: computed(() => props.role)
  10565. };
  10566. __expose(popperProvides);
  10567. provide(POPPER_INJECTION_KEY, popperProvides);
  10568. return (_ctx, _cache) => {
  10569. return renderSlot(_ctx.$slots, "default");
  10570. };
  10571. }
  10572. });
  10573. //#endregion
  10574. //#region ../../packages/components/popper/src/popper.vue
  10575. var popper_default = popper_vue_vue_type_script_setup_true_lang_default;
  10576. //#endregion
  10577. //#region ../../packages/components/popper/src/arrow.vue?vue&type=script&setup=true&lang.ts
  10578. var arrow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  10579. name: "ElPopperArrow",
  10580. inheritAttrs: false,
  10581. __name: "arrow",
  10582. setup(__props, { expose: __expose }) {
  10583. const ns = useNamespace("popper");
  10584. const { arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
  10585. onBeforeUnmount(() => {
  10586. arrowRef.value = void 0;
  10587. });
  10588. __expose({ arrowRef });
  10589. return (_ctx, _cache) => {
  10590. return openBlock(), createElementBlock("span", {
  10591. ref_key: "arrowRef",
  10592. ref: arrowRef,
  10593. class: normalizeClass(unref(ns).e("arrow")),
  10594. style: normalizeStyle(unref(arrowStyle)),
  10595. "data-popper-arrow": ""
  10596. }, null, 6);
  10597. };
  10598. }
  10599. });
  10600. //#endregion
  10601. //#region ../../packages/components/popper/src/arrow.vue
  10602. var arrow_default = arrow_vue_vue_type_script_setup_true_lang_default;
  10603. //#endregion
  10604. //#region ../../packages/components/popper/src/trigger.ts
  10605. /**
  10606. * @deprecated Removed after 3.0.0, Use `PopperTriggerProps` instead.
  10607. */
  10608. const popperTriggerProps = buildProps({
  10609. virtualRef: { type: definePropType(Object) },
  10610. virtualTriggering: Boolean,
  10611. onMouseenter: { type: definePropType(Function) },
  10612. onMouseleave: { type: definePropType(Function) },
  10613. onClick: { type: definePropType(Function) },
  10614. onKeydown: { type: definePropType(Function) },
  10615. onFocus: { type: definePropType(Function) },
  10616. onBlur: { type: definePropType(Function) },
  10617. onContextmenu: { type: definePropType(Function) },
  10618. id: String,
  10619. open: Boolean
  10620. });
  10621. /** @deprecated use `popperTriggerProps` instead, and it will be deprecated in the next major version */
  10622. const usePopperTriggerProps = popperTriggerProps;
  10623. //#endregion
  10624. //#region ../../packages/components/slot/src/only-child.tsx
  10625. const NAME = "ElOnlyChild";
  10626. const OnlyChild = /* @__PURE__ */ defineComponent({
  10627. name: NAME,
  10628. setup(_, { slots, attrs }) {
  10629. const forwardRefDirective = useForwardRefDirective(inject(FORWARD_REF_INJECTION_KEY)?.setForwardRef ?? NOOP);
  10630. return () => {
  10631. const defaultSlot = slots.default?.(attrs);
  10632. if (!defaultSlot) return null;
  10633. const [firstLegitNode, length] = findFirstLegitChild(defaultSlot);
  10634. if (!firstLegitNode) {
  10635. /* @__PURE__ */ debugWarn(NAME, "no valid child node found");
  10636. return null;
  10637. }
  10638. if (length > 1) /* @__PURE__ */ debugWarn(NAME, "requires exact only one valid child.");
  10639. return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
  10640. };
  10641. }
  10642. });
  10643. function findFirstLegitChild(node) {
  10644. if (!node) return [null, 0];
  10645. const children = node;
  10646. const len = children.filter((c) => c.type !== Comment).length;
  10647. for (const child of children) {
  10648. /**
  10649. * when user uses h(Fragment, [text]) to render plain string,
  10650. * this switch case just cannot handle, when the value is primitives
  10651. * we should just return the wrapped string
  10652. */
  10653. if (isObject$1(child)) switch (child.type) {
  10654. case Comment: continue;
  10655. case Text:
  10656. case "svg": return [wrapTextContent(child), len];
  10657. case Fragment: return findFirstLegitChild(child.children);
  10658. default: return [child, len];
  10659. }
  10660. return [wrapTextContent(child), len];
  10661. }
  10662. return [null, 0];
  10663. }
  10664. function wrapTextContent(s) {
  10665. const ns = useNamespace("only-child");
  10666. return createVNode("span", { "class": ns.e("content") }, [s]);
  10667. }
  10668. //#endregion
  10669. //#region ../../packages/components/popper/src/trigger.vue?vue&type=script&setup=true&lang.ts
  10670. var trigger_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
  10671. name: "ElPopperTrigger",
  10672. inheritAttrs: false,
  10673. __name: "trigger",
  10674. props: popperTriggerProps,
  10675. setup(__props, { expose: __expose }) {
  10676. const props = __props;
  10677. const { role, triggerRef } = inject(POPPER_INJECTION_KEY, void 0);
  10678. useForwardRef(triggerRef);
  10679. const ariaControls = computed(() => {
  10680. return ariaHaspopup.value ? props.id : void 0;
  10681. });
  10682. const ariaDescribedby = computed(() => {
  10683. if (role && role.value === "tooltip") return props.open && props.id ? props.id : void 0;
  10684. });
  10685. const ariaHaspopup = computed(() => {
  10686. if (role && role.value !== "tooltip") return role.value;
  10687. });
  10688. const ariaExpanded = computed(() => {
  10689. return ariaHaspopup.value ? `${props.open}` : void 0;
  10690. });
  10691. let virtualTriggerAriaStopWatch = void 0;
  10692. const TRIGGER_ELE_EVENTS = [
  10693. "onMouseenter",
  10694. "onMouseleave",
  10695. "onClick",
  10696. "onKeydown",
  10697. "onFocus",
  10698. "onBlur",
  10699. "onContextmenu"
  10700. ];
  10701. onMounted(() => {
  10702. watch(() => props.virtualRef, (virtualEl) => {
  10703. if (virtualEl) triggerRef.value = unrefElement(virtualEl);
  10704. }, { immediate: true });
  10705. watch(triggerRef, (el, prevEl) => {
  10706. virtualTriggerAriaStopWatch?.();
  10707. virtualTriggerAriaStopWatch = void 0;
  10708. if (isElement$1(prevEl)) TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10709. const handler = props[eventName];
  10710. if (handler) prevEl.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10711. });
  10712. if (isElement$1(el)) {
  10713. TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10714. const handler = props[eventName];
  10715. if (handler) el.addEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10716. });
  10717. if (isFocusable(el)) virtualTriggerAriaStopWatch = watch([
  10718. ariaControls,
  10719. ariaDescribedby,
  10720. ariaHaspopup,
  10721. ariaExpanded
  10722. ], (watches) => {
  10723. [
  10724. "aria-controls",
  10725. "aria-describedby",
  10726. "aria-haspopup",
  10727. "aria-expanded"
  10728. ].forEach((key, idx) => {
  10729. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  10730. });
  10731. }, { immediate: true });
  10732. }
  10733. if (isElement$1(prevEl) && isFocusable(prevEl)) [
  10734. "aria-controls",
  10735. "aria-describedby",
  10736. "aria-haspopup",
  10737. "aria-expanded"
  10738. ].forEach((key) => prevEl.removeAttribute(key));
  10739. }, { immediate: true });
  10740. });
  10741. onBeforeUnmount(() => {
  10742. virtualTriggerAriaStopWatch?.();
  10743. virtualTriggerAriaStopWatch = void 0;
  10744. if (triggerRef.value && isElement$1(triggerRef.value)) {
  10745. const el = triggerRef.value;
  10746. TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10747. const handler = props[eventName];
  10748. if (handler) el.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10749. });
  10750. triggerRef.value = void 0;
  10751. }
  10752. });
  10753. __expose({ triggerRef });
  10754. return (_ctx, _cache) => {
  10755. return !__props.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
  10756. "aria-controls": ariaControls.value,
  10757. "aria-describedby": ariaDescribedby.value,
  10758. "aria-expanded": ariaExpanded.value,
  10759. "aria-haspopup": ariaHaspopup.value
  10760. }), {
  10761. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  10762. _: 3
  10763. }, 16, [
  10764. "aria-controls",
  10765. "aria-describedby",
  10766. "aria-expanded",
  10767. "aria-haspopup"
  10768. ])) : createCommentVNode("v-if", true);
  10769. };
  10770. }
  10771. });
  10772. //#endregion
  10773. //#region ../../packages/components/popper/src/trigger.vue
  10774. var trigger_default = trigger_vue_vue_type_script_setup_true_lang_default$1;
  10775. //#endregion
  10776. //#region ../../packages/components/popper/src/arrow.ts
  10777. /**
  10778. * @deprecated Removed after 3.0.0, Use `PopperArrowProps` instead.
  10779. */
  10780. const popperArrowProps = buildProps({ arrowOffset: {
  10781. type: Number,
  10782. default: 5
  10783. } });
  10784. const popperArrowPropsDefaults = { arrowOffset: 5 };
  10785. /** @deprecated use `popperArrowProps` instead, and it will be deprecated in the next major version */
  10786. const usePopperArrowProps = popperArrowProps;
  10787. //#endregion
  10788. //#region ../../packages/components/popper/src/content.ts
  10789. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  10790. /**
  10791. * @deprecated Removed after 3.0.0, Use `PopperCoreConfigProps` instead.
  10792. */
  10793. const popperCoreConfigProps = buildProps({
  10794. boundariesPadding: {
  10795. type: Number,
  10796. default: 0
  10797. },
  10798. fallbackPlacements: {
  10799. type: definePropType(Array),
  10800. default: void 0
  10801. },
  10802. gpuAcceleration: {
  10803. type: Boolean,
  10804. default: true
  10805. },
  10806. offset: {
  10807. type: Number,
  10808. default: 12
  10809. },
  10810. placement: {
  10811. type: String,
  10812. values: Ee,
  10813. default: "bottom"
  10814. },
  10815. popperOptions: {
  10816. type: definePropType(Object),
  10817. default: () => ({})
  10818. },
  10819. strategy: {
  10820. type: String,
  10821. values: POSITIONING_STRATEGIES,
  10822. default: "absolute"
  10823. }
  10824. });
  10825. /**
  10826. * @deprecated Removed after 3.0.0, Use `PopperContentProps` instead.
  10827. */
  10828. const popperContentProps = buildProps({
  10829. ...popperCoreConfigProps,
  10830. ...popperArrowProps,
  10831. id: String,
  10832. style: { type: definePropType([
  10833. String,
  10834. Array,
  10835. Object
  10836. ]) },
  10837. className: { type: definePropType([
  10838. String,
  10839. Array,
  10840. Object
  10841. ]) },
  10842. effect: {
  10843. type: definePropType(String),
  10844. default: "dark"
  10845. },
  10846. visible: Boolean,
  10847. enterable: {
  10848. type: Boolean,
  10849. default: true
  10850. },
  10851. pure: Boolean,
  10852. focusOnShow: Boolean,
  10853. trapping: Boolean,
  10854. popperClass: { type: definePropType([
  10855. String,
  10856. Array,
  10857. Object
  10858. ]) },
  10859. popperStyle: { type: definePropType([
  10860. String,
  10861. Array,
  10862. Object
  10863. ]) },
  10864. referenceEl: { type: definePropType(Object) },
  10865. triggerTargetEl: { type: definePropType(Object) },
  10866. stopPopperMouseEvent: {
  10867. type: Boolean,
  10868. default: true
  10869. },
  10870. virtualTriggering: Boolean,
  10871. zIndex: Number,
  10872. ...useAriaProps(["ariaLabel"]),
  10873. loop: Boolean
  10874. });
  10875. const popperCoreConfigPropsDefaults = {
  10876. boundariesPadding: 0,
  10877. gpuAcceleration: true,
  10878. offset: 12,
  10879. placement: "bottom",
  10880. popperOptions: () => ({}),
  10881. strategy: "absolute"
  10882. };
  10883. const popperContentPropsDefaults = {
  10884. ...popperCoreConfigPropsDefaults,
  10885. ...popperArrowPropsDefaults,
  10886. effect: "dark",
  10887. enterable: true,
  10888. stopPopperMouseEvent: true,
  10889. visible: false,
  10890. pure: false,
  10891. focusOnShow: false,
  10892. trapping: false,
  10893. virtualTriggering: false,
  10894. loop: false,
  10895. style: void 0,
  10896. popperStyle: void 0
  10897. };
  10898. const popperContentEmits = {
  10899. mouseenter: (evt) => evt instanceof MouseEvent,
  10900. mouseleave: (evt) => evt instanceof MouseEvent,
  10901. focus: () => true,
  10902. blur: () => true,
  10903. close: () => true
  10904. };
  10905. /** @deprecated use `popperCoreConfigProps` instead, and it will be deprecated in the next major version */
  10906. const usePopperCoreConfigProps = popperCoreConfigProps;
  10907. /** @deprecated use `popperContentProps` instead, and it will be deprecated in the next major version */
  10908. const usePopperContentProps = popperContentProps;
  10909. /** @deprecated use `popperContentEmits` instead, and it will be deprecated in the next major version */
  10910. const usePopperContentEmits = popperContentEmits;
  10911. //#endregion
  10912. //#region ../../packages/components/focus-trap/src/tokens.ts
  10913. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  10914. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  10915. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  10916. const FOCUS_AFTER_TRAPPED_OPTS = {
  10917. cancelable: true,
  10918. bubbles: false
  10919. };
  10920. const FOCUSOUT_PREVENTED_OPTS = {
  10921. cancelable: true,
  10922. bubbles: false
  10923. };
  10924. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  10925. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  10926. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  10927. //#endregion
  10928. //#region ../../packages/components/focus-trap/src/utils.ts
  10929. const focusReason = ref();
  10930. const lastUserFocusTimestamp = ref(0);
  10931. const lastAutomatedFocusTimestamp = ref(0);
  10932. let focusReasonUserCount = 0;
  10933. const obtainAllFocusableElements = (element) => {
  10934. const nodes = [];
  10935. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
  10936. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  10937. if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
  10938. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  10939. } });
  10940. while (walker.nextNode()) nodes.push(walker.currentNode);
  10941. return nodes;
  10942. };
  10943. const getVisibleElement = (elements, container) => {
  10944. for (const element of elements) if (!isHidden(element, container)) return element;
  10945. };
  10946. const isHidden = (element, container) => {
  10947. if (getComputedStyle(element).visibility === "hidden") return true;
  10948. while (element) {
  10949. if (container && element === container) return false;
  10950. if (getComputedStyle(element).display === "none") return true;
  10951. element = element.parentElement;
  10952. }
  10953. return false;
  10954. };
  10955. const getEdges = (container) => {
  10956. const focusable = obtainAllFocusableElements(container);
  10957. return [getVisibleElement(focusable, container), getVisibleElement(focusable.reverse(), container)];
  10958. };
  10959. const isSelectable = (element) => {
  10960. return element instanceof HTMLInputElement && "select" in element;
  10961. };
  10962. const tryFocus = (element, shouldSelect) => {
  10963. if (element) {
  10964. const prevFocusedElement = document.activeElement;
  10965. focusElement(element, { preventScroll: true });
  10966. lastAutomatedFocusTimestamp.value = window.performance.now();
  10967. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) element.select();
  10968. }
  10969. };
  10970. function removeFromStack(list, item) {
  10971. const copy = [...list];
  10972. const idx = list.indexOf(item);
  10973. if (idx !== -1) copy.splice(idx, 1);
  10974. return copy;
  10975. }
  10976. const createFocusableStack = () => {
  10977. let stack = [];
  10978. const push = (layer) => {
  10979. const currentLayer = stack[0];
  10980. if (currentLayer && layer !== currentLayer) currentLayer.pause();
  10981. stack = removeFromStack(stack, layer);
  10982. stack.unshift(layer);
  10983. };
  10984. const remove = (layer) => {
  10985. stack = removeFromStack(stack, layer);
  10986. stack[0]?.resume?.();
  10987. };
  10988. return {
  10989. push,
  10990. remove
  10991. };
  10992. };
  10993. const focusFirstDescendant = (elements, shouldSelect = false) => {
  10994. const prevFocusedElement = document.activeElement;
  10995. for (const element of elements) {
  10996. tryFocus(element, shouldSelect);
  10997. if (document.activeElement !== prevFocusedElement) return;
  10998. }
  10999. };
  11000. const focusableStack = createFocusableStack();
  11001. const isFocusCausedByUserEvent = () => {
  11002. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  11003. };
  11004. const notifyFocusReasonPointer = () => {
  11005. focusReason.value = "pointer";
  11006. lastUserFocusTimestamp.value = window.performance.now();
  11007. };
  11008. const notifyFocusReasonKeydown = () => {
  11009. focusReason.value = "keyboard";
  11010. lastUserFocusTimestamp.value = window.performance.now();
  11011. };
  11012. const useFocusReason = () => {
  11013. onMounted(() => {
  11014. if (focusReasonUserCount === 0) {
  11015. document.addEventListener("mousedown", notifyFocusReasonPointer);
  11016. document.addEventListener("touchstart", notifyFocusReasonPointer);
  11017. document.addEventListener("keydown", notifyFocusReasonKeydown);
  11018. }
  11019. focusReasonUserCount++;
  11020. });
  11021. onBeforeUnmount(() => {
  11022. focusReasonUserCount--;
  11023. if (focusReasonUserCount <= 0) {
  11024. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  11025. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  11026. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  11027. }
  11028. });
  11029. return {
  11030. focusReason,
  11031. lastUserFocusTimestamp,
  11032. lastAutomatedFocusTimestamp
  11033. };
  11034. };
  11035. const createFocusOutPreventedEvent = (detail) => {
  11036. return new CustomEvent(FOCUSOUT_PREVENTED, {
  11037. ...FOCUSOUT_PREVENTED_OPTS,
  11038. detail
  11039. });
  11040. };
  11041. //#endregion
  11042. //#region ../../packages/components/focus-trap/src/focus-trap.vue?vue&type=script&lang.ts
  11043. var focus_trap_vue_vue_type_script_lang_default = defineComponent({
  11044. name: "ElFocusTrap",
  11045. inheritAttrs: false,
  11046. props: {
  11047. loop: Boolean,
  11048. trapped: Boolean,
  11049. focusTrapEl: Object,
  11050. focusStartEl: {
  11051. type: [Object, String],
  11052. default: "first"
  11053. }
  11054. },
  11055. emits: [
  11056. ON_TRAP_FOCUS_EVT,
  11057. ON_RELEASE_FOCUS_EVT,
  11058. "focusin",
  11059. "focusout",
  11060. "focusout-prevented",
  11061. "release-requested"
  11062. ],
  11063. setup(props, { emit }) {
  11064. const forwardRef = ref();
  11065. let lastFocusBeforeTrapped;
  11066. let lastFocusAfterTrapped;
  11067. const { focusReason } = useFocusReason();
  11068. useEscapeKeydown((event) => {
  11069. if (props.trapped && !focusLayer.paused) emit("release-requested", event);
  11070. });
  11071. const focusLayer = {
  11072. paused: false,
  11073. pause() {
  11074. this.paused = true;
  11075. },
  11076. resume() {
  11077. this.paused = false;
  11078. }
  11079. };
  11080. const onKeydown = (e) => {
  11081. if (!props.loop && !props.trapped) return;
  11082. if (focusLayer.paused) return;
  11083. const { altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  11084. const { loop } = props;
  11085. const isTabbing = getEventCode(e) === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  11086. const currentFocusingEl = document.activeElement;
  11087. if (isTabbing && currentFocusingEl) {
  11088. const container = currentTarget;
  11089. const [first, last] = getEdges(container);
  11090. if (!(first && last)) {
  11091. if (currentFocusingEl === container) {
  11092. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11093. emit("focusout-prevented", focusoutPreventedEvent);
  11094. if (!focusoutPreventedEvent.defaultPrevented) e.preventDefault();
  11095. }
  11096. } else if (!shiftKey && currentFocusingEl === last) {
  11097. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11098. emit("focusout-prevented", focusoutPreventedEvent);
  11099. if (!focusoutPreventedEvent.defaultPrevented) {
  11100. e.preventDefault();
  11101. if (loop) tryFocus(first, true);
  11102. }
  11103. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  11104. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11105. emit("focusout-prevented", focusoutPreventedEvent);
  11106. if (!focusoutPreventedEvent.defaultPrevented) {
  11107. e.preventDefault();
  11108. if (loop) tryFocus(last, true);
  11109. }
  11110. }
  11111. }
  11112. };
  11113. provide(FOCUS_TRAP_INJECTION_KEY, {
  11114. focusTrapRef: forwardRef,
  11115. onKeydown
  11116. });
  11117. watch(() => props.focusTrapEl, (focusTrapEl) => {
  11118. if (focusTrapEl) forwardRef.value = focusTrapEl;
  11119. }, { immediate: true });
  11120. watch([forwardRef], ([forwardRef], [oldForwardRef]) => {
  11121. if (forwardRef) {
  11122. forwardRef.addEventListener("keydown", onKeydown);
  11123. forwardRef.addEventListener("focusin", onFocusIn);
  11124. forwardRef.addEventListener("focusout", onFocusOut);
  11125. }
  11126. if (oldForwardRef) {
  11127. oldForwardRef.removeEventListener("keydown", onKeydown);
  11128. oldForwardRef.removeEventListener("focusin", onFocusIn);
  11129. oldForwardRef.removeEventListener("focusout", onFocusOut);
  11130. }
  11131. });
  11132. const trapOnFocus = (e) => {
  11133. emit(ON_TRAP_FOCUS_EVT, e);
  11134. };
  11135. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  11136. const onFocusIn = (e) => {
  11137. const trapContainer = unref(forwardRef);
  11138. if (!trapContainer) return;
  11139. const target = e.target;
  11140. const relatedTarget = e.relatedTarget;
  11141. const isFocusedInTrap = target && trapContainer.contains(target);
  11142. if (!props.trapped) {
  11143. if (!(relatedTarget && trapContainer.contains(relatedTarget))) lastFocusBeforeTrapped = relatedTarget;
  11144. }
  11145. if (isFocusedInTrap) emit("focusin", e);
  11146. if (focusLayer.paused) return;
  11147. if (props.trapped) if (isFocusedInTrap) lastFocusAfterTrapped = target;
  11148. else tryFocus(lastFocusAfterTrapped, true);
  11149. };
  11150. const onFocusOut = (e) => {
  11151. const trapContainer = unref(forwardRef);
  11152. if (focusLayer.paused || !trapContainer) return;
  11153. if (props.trapped) {
  11154. const relatedTarget = e.relatedTarget;
  11155. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) setTimeout(() => {
  11156. if (!focusLayer.paused && props.trapped) {
  11157. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11158. emit("focusout-prevented", focusoutPreventedEvent);
  11159. if (!focusoutPreventedEvent.defaultPrevented) tryFocus(lastFocusAfterTrapped, true);
  11160. }
  11161. }, 0);
  11162. } else {
  11163. const target = e.target;
  11164. if (!(target && trapContainer.contains(target))) emit("focusout", e);
  11165. }
  11166. };
  11167. async function startTrap() {
  11168. await nextTick();
  11169. const trapContainer = unref(forwardRef);
  11170. if (trapContainer) {
  11171. focusableStack.push(focusLayer);
  11172. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  11173. lastFocusBeforeTrapped = prevFocusedElement;
  11174. if (!trapContainer.contains(prevFocusedElement)) {
  11175. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  11176. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  11177. trapContainer.dispatchEvent(focusEvent);
  11178. if (!focusEvent.defaultPrevented) nextTick(() => {
  11179. let focusStartEl = props.focusStartEl;
  11180. if (!isString(focusStartEl)) {
  11181. tryFocus(focusStartEl);
  11182. if (document.activeElement !== focusStartEl) focusStartEl = "first";
  11183. }
  11184. if (focusStartEl === "first") focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  11185. if (document.activeElement === prevFocusedElement || focusStartEl === "container") tryFocus(trapContainer);
  11186. });
  11187. }
  11188. }
  11189. }
  11190. function stopTrap() {
  11191. const trapContainer = unref(forwardRef);
  11192. if (trapContainer) {
  11193. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  11194. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  11195. ...FOCUS_AFTER_TRAPPED_OPTS,
  11196. detail: { focusReason: focusReason.value }
  11197. });
  11198. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  11199. trapContainer.dispatchEvent(releasedEvent);
  11200. if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) tryFocus(lastFocusBeforeTrapped ?? document.body);
  11201. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  11202. focusableStack.remove(focusLayer);
  11203. lastFocusBeforeTrapped = null;
  11204. lastFocusAfterTrapped = null;
  11205. }
  11206. }
  11207. onMounted(() => {
  11208. if (props.trapped) startTrap();
  11209. watch(() => props.trapped, (trapped) => {
  11210. if (trapped) startTrap();
  11211. else stopTrap();
  11212. });
  11213. });
  11214. onBeforeUnmount(() => {
  11215. if (props.trapped) stopTrap();
  11216. if (forwardRef.value) {
  11217. forwardRef.value.removeEventListener("keydown", onKeydown);
  11218. forwardRef.value.removeEventListener("focusin", onFocusIn);
  11219. forwardRef.value.removeEventListener("focusout", onFocusOut);
  11220. forwardRef.value = void 0;
  11221. }
  11222. lastFocusBeforeTrapped = null;
  11223. lastFocusAfterTrapped = null;
  11224. });
  11225. return { onKeydown };
  11226. }
  11227. });
  11228. //#endregion
  11229. //#region \0plugin-vue:export-helper
  11230. var _plugin_vue_export_helper_default = (sfc, props) => {
  11231. const target = sfc.__vccOpts || sfc;
  11232. for (const [key, val] of props) target[key] = val;
  11233. return target;
  11234. };
  11235. //#endregion
  11236. //#region ../../packages/components/focus-trap/src/focus-trap.vue
  11237. function _sfc_render$21(_ctx, _cache, $props, $setup, $data, $options) {
  11238. return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  11239. }
  11240. var focus_trap_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(focus_trap_vue_vue_type_script_lang_default, [["render", _sfc_render$21]]);
  11241. //#endregion
  11242. //#region ../../packages/components/focus-trap/index.ts
  11243. var focus_trap_default = focus_trap_default$1;
  11244. //#endregion
  11245. //#region ../../packages/components/form/src/form.ts
  11246. /**
  11247. * @deprecated Removed after 3.0.0, Use `FormMetaProps` instead.
  11248. */
  11249. const formMetaProps = buildProps({
  11250. size: {
  11251. type: String,
  11252. values: componentSizes
  11253. },
  11254. disabled: Boolean
  11255. });
  11256. /**
  11257. * @deprecated Removed after 3.0.0, Use `FormProps` instead.
  11258. */
  11259. const formProps = buildProps({
  11260. ...formMetaProps,
  11261. model: Object,
  11262. rules: { type: definePropType(Object) },
  11263. labelPosition: {
  11264. type: String,
  11265. values: [
  11266. "left",
  11267. "right",
  11268. "top"
  11269. ],
  11270. default: "right"
  11271. },
  11272. requireAsteriskPosition: {
  11273. type: String,
  11274. values: ["left", "right"],
  11275. default: "left"
  11276. },
  11277. labelWidth: {
  11278. type: [String, Number],
  11279. default: ""
  11280. },
  11281. labelSuffix: {
  11282. type: String,
  11283. default: ""
  11284. },
  11285. inline: Boolean,
  11286. inlineMessage: Boolean,
  11287. statusIcon: Boolean,
  11288. showMessage: {
  11289. type: Boolean,
  11290. default: true
  11291. },
  11292. validateOnRuleChange: {
  11293. type: Boolean,
  11294. default: true
  11295. },
  11296. hideRequiredAsterisk: Boolean,
  11297. scrollToError: Boolean,
  11298. scrollIntoViewOptions: {
  11299. type: definePropType([Object, Boolean]),
  11300. default: true
  11301. }
  11302. });
  11303. const formEmits = { validate: (prop, isValid, message) => (isArray$1(prop) || isString(prop)) && isBoolean(isValid) && isString(message) };
  11304. //#endregion
  11305. //#region ../../packages/components/form/src/constants.ts
  11306. const formContextKey = Symbol("formContextKey");
  11307. const formItemContextKey = Symbol("formItemContextKey");
  11308. //#endregion
  11309. //#region ../../packages/components/form/src/hooks/use-form-common-props.ts
  11310. const useFormSize = (fallback, ignore = {}) => {
  11311. const emptyRef = ref(void 0);
  11312. const size = ignore.prop ? emptyRef : useProp("size");
  11313. const globalConfig = ignore.global ? emptyRef : useGlobalSize();
  11314. const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
  11315. const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
  11316. return computed(() => size.value || unref(fallback) || formItem?.size || form?.size || globalConfig.value || "");
  11317. };
  11318. const useFormDisabled = (fallback) => {
  11319. const disabled = useProp("disabled");
  11320. const form = inject(formContextKey, void 0);
  11321. return computed(() => {
  11322. return disabled.value ?? unref(fallback) ?? form?.disabled ?? false;
  11323. });
  11324. };
  11325. const useSize = useFormSize;
  11326. const useDisabled = useFormDisabled;
  11327. //#endregion
  11328. //#region ../../packages/components/form/src/hooks/use-form-item.ts
  11329. const useFormItem = () => {
  11330. return {
  11331. form: inject(formContextKey, void 0),
  11332. formItem: inject(formItemContextKey, void 0)
  11333. };
  11334. };
  11335. const useFormItemInputId = (props, { formItemContext, disableIdGeneration, disableIdManagement }) => {
  11336. if (!disableIdGeneration) disableIdGeneration = ref(false);
  11337. if (!disableIdManagement) disableIdManagement = ref(false);
  11338. const instance = getCurrentInstance();
  11339. const inLabel = () => {
  11340. let parent = instance?.parent;
  11341. while (parent) {
  11342. if (parent.type.name === "ElFormItem") return false;
  11343. if (parent.type.name === "ElLabelWrap") return true;
  11344. parent = parent.parent;
  11345. }
  11346. return false;
  11347. };
  11348. const inputId = ref();
  11349. let idUnwatch = void 0;
  11350. const isLabeledByFormItem = computed(() => {
  11351. return !!(!(props.label || props.ariaLabel) && formItemContext && formItemContext.inputIds && formItemContext.inputIds?.length <= 1);
  11352. });
  11353. onMounted(() => {
  11354. idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration]) => {
  11355. const newId = id ?? (!disableIdGeneration ? useId().value : void 0);
  11356. if (newId !== inputId.value) {
  11357. if (formItemContext?.removeInputId && !inLabel()) {
  11358. inputId.value && formItemContext.removeInputId(inputId.value);
  11359. if (!disableIdManagement?.value && !disableIdGeneration && newId) formItemContext.addInputId(newId);
  11360. }
  11361. inputId.value = newId;
  11362. }
  11363. }, { immediate: true });
  11364. });
  11365. onUnmounted(() => {
  11366. idUnwatch && idUnwatch();
  11367. if (formItemContext?.removeInputId) inputId.value && formItemContext.removeInputId(inputId.value);
  11368. });
  11369. return {
  11370. isLabeledByFormItem,
  11371. inputId
  11372. };
  11373. };
  11374. //#endregion
  11375. //#region ../../packages/components/form/src/utils.ts
  11376. const SCOPE$7 = "ElForm";
  11377. function useFormLabelWidth() {
  11378. const potentialLabelWidthArr = ref([]);
  11379. const autoLabelWidth = computed(() => {
  11380. if (!potentialLabelWidthArr.value.length) return "0";
  11381. const max = Math.max(...potentialLabelWidthArr.value);
  11382. return max ? `${max}px` : "";
  11383. });
  11384. function getLabelWidthIndex(width) {
  11385. const index = potentialLabelWidthArr.value.indexOf(width);
  11386. if (index === -1 && autoLabelWidth.value === "0") /* @__PURE__ */ debugWarn(SCOPE$7, `unexpected width ${width}`);
  11387. return index;
  11388. }
  11389. function registerLabelWidth(val, oldVal) {
  11390. if (val && oldVal) {
  11391. const index = getLabelWidthIndex(oldVal);
  11392. potentialLabelWidthArr.value.splice(index, 1, val);
  11393. } else if (val) potentialLabelWidthArr.value.push(val);
  11394. }
  11395. function deregisterLabelWidth(val) {
  11396. const index = getLabelWidthIndex(val);
  11397. if (index > -1) potentialLabelWidthArr.value.splice(index, 1);
  11398. }
  11399. return {
  11400. autoLabelWidth,
  11401. registerLabelWidth,
  11402. deregisterLabelWidth
  11403. };
  11404. }
  11405. const filterFields = (fields, props) => {
  11406. const normalized = castArray$1(props).map((prop) => isArray$1(prop) ? prop.join(".") : prop);
  11407. return normalized.length > 0 ? fields.filter((field) => field.propString && normalized.includes(field.propString)) : fields;
  11408. };
  11409. //#endregion
  11410. //#region ../../packages/components/form/src/form.vue?vue&type=script&setup=true&lang.ts
  11411. const COMPONENT_NAME$21 = "ElForm";
  11412. var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  11413. name: COMPONENT_NAME$21,
  11414. __name: "form",
  11415. props: formProps,
  11416. emits: formEmits,
  11417. setup(__props, { expose: __expose, emit: __emit }) {
  11418. const props = __props;
  11419. const emit = __emit;
  11420. const formRef = ref();
  11421. const fields = reactive([]);
  11422. const initialValues = /* @__PURE__ */ new Map();
  11423. const formSize = useFormSize();
  11424. const ns = useNamespace("form");
  11425. const formClasses = computed(() => {
  11426. const { labelPosition, inline } = props;
  11427. return [
  11428. ns.b(),
  11429. ns.m(formSize.value || "default"),
  11430. {
  11431. [ns.m(`label-${labelPosition}`)]: labelPosition,
  11432. [ns.m("inline")]: inline
  11433. }
  11434. ];
  11435. });
  11436. const getField = (prop) => {
  11437. return filterFields(fields, [prop])[0];
  11438. };
  11439. const addField = (field) => {
  11440. fields.push(field);
  11441. if (field.propString) if (initialValues.has(field.propString)) field.setInitialValue(initialValues.get(field.propString));
  11442. else initialValues.set(field.propString, cloneDeep(field.fieldValue));
  11443. };
  11444. const removeField = (field) => {
  11445. if (field.prop) fields.splice(fields.indexOf(field), 1);
  11446. };
  11447. const setInitialValues = (initModel) => {
  11448. if (!props.model) {
  11449. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for setInitialValues to work.");
  11450. return;
  11451. }
  11452. if (!initModel) {
  11453. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "initModel is required for setInitialValues to work.");
  11454. return;
  11455. }
  11456. for (const key of initialValues.keys()) initialValues.set(key, cloneDeep(getProp(initModel, key).value));
  11457. fields.forEach((field) => {
  11458. if (field.prop) field.setInitialValue(getProp(initModel, field.prop).value);
  11459. });
  11460. };
  11461. const resetFields = (properties = []) => {
  11462. if (!props.model) {
  11463. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for resetFields to work.");
  11464. return;
  11465. }
  11466. filterFields(fields, properties).forEach((field) => field.resetField());
  11467. const activePropStrings = new Set(fields.map((f) => f.propString).filter(Boolean));
  11468. const propsToCheck = properties.length > 0 ? castArray$1(properties).map((p) => isArray$1(p) ? p.join(".") : p) : [...initialValues.keys()];
  11469. for (const propString of propsToCheck) if (!activePropStrings.has(propString) && initialValues.has(propString)) getProp(props.model, propString).value = cloneDeep(initialValues.get(propString));
  11470. };
  11471. const clearValidate = (props = []) => {
  11472. filterFields(fields, props).forEach((field) => field.clearValidate());
  11473. };
  11474. const isValidatable = computed(() => {
  11475. const hasModel = !!props.model;
  11476. if (!hasModel) /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for validate to work.");
  11477. return hasModel;
  11478. });
  11479. const obtainValidateFields = (props) => {
  11480. if (fields.length === 0) return [];
  11481. const filteredFields = filterFields(fields, props);
  11482. if (!filteredFields.length) {
  11483. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "please pass correct props!");
  11484. return [];
  11485. }
  11486. return filteredFields;
  11487. };
  11488. const validate = async (callback) => validateField(void 0, callback);
  11489. const doValidateField = async (props = []) => {
  11490. if (!isValidatable.value) return false;
  11491. const fields = obtainValidateFields(props);
  11492. if (fields.length === 0) return true;
  11493. let validationErrors = {};
  11494. for (const field of fields) try {
  11495. await field.validate("");
  11496. if (field.validateState === "error" && !field.error) field.resetField();
  11497. } catch (fields) {
  11498. validationErrors = {
  11499. ...validationErrors,
  11500. ...fields
  11501. };
  11502. }
  11503. if (Object.keys(validationErrors).length === 0) return true;
  11504. return Promise.reject(validationErrors);
  11505. };
  11506. const validateField = async (modelProps = [], callback) => {
  11507. let result = false;
  11508. const shouldThrow = !isFunction$1(callback);
  11509. try {
  11510. result = await doValidateField(modelProps);
  11511. if (result === true) await callback?.(result);
  11512. return result;
  11513. } catch (e) {
  11514. if (e instanceof Error) throw e;
  11515. const invalidFields = e;
  11516. if (props.scrollToError) {
  11517. if (formRef.value) formRef.value.querySelector(`.${ns.b()}-item.is-error`)?.scrollIntoView(props.scrollIntoViewOptions);
  11518. }
  11519. !result && await callback?.(false, invalidFields);
  11520. return shouldThrow && Promise.reject(invalidFields);
  11521. }
  11522. };
  11523. const scrollToField = (prop) => {
  11524. const field = getField(prop);
  11525. if (field) field.$el?.scrollIntoView(props.scrollIntoViewOptions);
  11526. };
  11527. watch(() => props.rules, () => {
  11528. if (props.validateOnRuleChange) validate().catch((err) => /* @__PURE__ */ debugWarn(err));
  11529. }, {
  11530. deep: true,
  11531. flush: "post"
  11532. });
  11533. provide(formContextKey, reactive({
  11534. ...toRefs(props),
  11535. emit,
  11536. resetFields,
  11537. clearValidate,
  11538. validateField,
  11539. getField,
  11540. addField,
  11541. removeField,
  11542. setInitialValues,
  11543. ...useFormLabelWidth()
  11544. }));
  11545. __expose({
  11546. validate,
  11547. validateField,
  11548. resetFields,
  11549. clearValidate,
  11550. scrollToField,
  11551. getField,
  11552. fields,
  11553. setInitialValues
  11554. });
  11555. return (_ctx, _cache) => {
  11556. return openBlock(), createElementBlock("form", {
  11557. ref_key: "formRef",
  11558. ref: formRef,
  11559. class: normalizeClass(formClasses.value)
  11560. }, [renderSlot(_ctx.$slots, "default")], 2);
  11561. };
  11562. }
  11563. });
  11564. //#endregion
  11565. //#region ../../packages/components/form/src/form.vue
  11566. var form_default = form_vue_vue_type_script_setup_true_lang_default;
  11567. //#endregion
  11568. //#region ../../packages/components/form/src/form-item.ts
  11569. const formItemValidateStates = [
  11570. "",
  11571. "error",
  11572. "validating",
  11573. "success"
  11574. ];
  11575. /**
  11576. * @deprecated Removed after 3.0.0, Use `FormItemProps` instead.
  11577. */
  11578. const formItemProps = buildProps({
  11579. label: String,
  11580. labelWidth: { type: [String, Number] },
  11581. labelPosition: {
  11582. type: String,
  11583. values: [
  11584. "left",
  11585. "right",
  11586. "top",
  11587. ""
  11588. ],
  11589. default: ""
  11590. },
  11591. prop: { type: definePropType([String, Array]) },
  11592. required: {
  11593. type: Boolean,
  11594. default: void 0
  11595. },
  11596. rules: { type: definePropType([Object, Array]) },
  11597. error: String,
  11598. validateStatus: {
  11599. type: String,
  11600. values: formItemValidateStates
  11601. },
  11602. for: String,
  11603. inlineMessage: {
  11604. type: Boolean,
  11605. default: void 0
  11606. },
  11607. showMessage: {
  11608. type: Boolean,
  11609. default: true
  11610. },
  11611. size: {
  11612. type: String,
  11613. values: componentSizes
  11614. }
  11615. });
  11616. //#endregion
  11617. //#region ../../node_modules/.pnpm/async-validator@4.2.5_patch_hash=cc6d77b35ed2a1683012935ca9ed998d418912785fcf78c6497d3268ac596d23/node_modules/async-validator/dist-web/index.js
  11618. function _extends() {
  11619. _extends = Object.assign ? Object.assign.bind() : function(target) {
  11620. for (var i = 1; i < arguments.length; i++) {
  11621. var source = arguments[i];
  11622. for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
  11623. }
  11624. return target;
  11625. };
  11626. return _extends.apply(this, arguments);
  11627. }
  11628. function _inheritsLoose(subClass, superClass) {
  11629. subClass.prototype = Object.create(superClass.prototype);
  11630. subClass.prototype.constructor = subClass;
  11631. _setPrototypeOf(subClass, superClass);
  11632. }
  11633. function _getPrototypeOf(o) {
  11634. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  11635. return o.__proto__ || Object.getPrototypeOf(o);
  11636. };
  11637. return _getPrototypeOf(o);
  11638. }
  11639. function _setPrototypeOf(o, p) {
  11640. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  11641. o.__proto__ = p;
  11642. return o;
  11643. };
  11644. return _setPrototypeOf(o, p);
  11645. }
  11646. function _isNativeReflectConstruct() {
  11647. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  11648. if (Reflect.construct.sham) return false;
  11649. if (typeof Proxy === "function") return true;
  11650. try {
  11651. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
  11652. return true;
  11653. } catch (e) {
  11654. return false;
  11655. }
  11656. }
  11657. function _construct(Parent, args, Class) {
  11658. if (_isNativeReflectConstruct()) _construct = Reflect.construct.bind();
  11659. else _construct = function _construct(Parent, args, Class) {
  11660. var a = [null];
  11661. a.push.apply(a, args);
  11662. var instance = new (Function.bind.apply(Parent, a))();
  11663. if (Class) _setPrototypeOf(instance, Class.prototype);
  11664. return instance;
  11665. };
  11666. return _construct.apply(null, arguments);
  11667. }
  11668. function _isNativeFunction(fn) {
  11669. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  11670. }
  11671. function _wrapNativeSuper(Class) {
  11672. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  11673. _wrapNativeSuper = function _wrapNativeSuper(Class) {
  11674. if (Class === null || !_isNativeFunction(Class)) return Class;
  11675. if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
  11676. if (typeof _cache !== "undefined") {
  11677. if (_cache.has(Class)) return _cache.get(Class);
  11678. _cache.set(Class, Wrapper);
  11679. }
  11680. function Wrapper() {
  11681. return _construct(Class, arguments, _getPrototypeOf(this).constructor);
  11682. }
  11683. Wrapper.prototype = Object.create(Class.prototype, { constructor: {
  11684. value: Wrapper,
  11685. enumerable: false,
  11686. writable: true,
  11687. configurable: true
  11688. } });
  11689. return _setPrototypeOf(Wrapper, Class);
  11690. };
  11691. return _wrapNativeSuper(Class);
  11692. }
  11693. var formatRegExp = /%[sdj%]/g;
  11694. var warning = function warning() {};
  11695. if (typeof process !== "undefined" && process.env && false);
  11696. function convertFieldsError(errors) {
  11697. if (!errors || !errors.length) return null;
  11698. var fields = {};
  11699. errors.forEach(function(error) {
  11700. var field = error.field;
  11701. fields[field] = fields[field] || [];
  11702. fields[field].push(error);
  11703. });
  11704. return fields;
  11705. }
  11706. function format(template) {
  11707. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
  11708. var i = 0;
  11709. var len = args.length;
  11710. if (typeof template === "function") return template.apply(null, args);
  11711. if (typeof template === "string") return template.replace(formatRegExp, function(x) {
  11712. if (x === "%%") return "%";
  11713. if (i >= len) return x;
  11714. switch (x) {
  11715. case "%s": return String(args[i++]);
  11716. case "%d": return Number(args[i++]);
  11717. case "%j":
  11718. try {
  11719. return JSON.stringify(args[i++]);
  11720. } catch (_) {
  11721. return "[Circular]";
  11722. }
  11723. break;
  11724. default: return x;
  11725. }
  11726. });
  11727. return template;
  11728. }
  11729. function isNativeStringType(type) {
  11730. return type === "string" || type === "url" || type === "hex" || type === "email" || type === "date" || type === "pattern";
  11731. }
  11732. function isEmptyValue(value, type) {
  11733. if (value === void 0 || value === null) return true;
  11734. if (type === "array" && Array.isArray(value) && !value.length) return true;
  11735. if (isNativeStringType(type) && typeof value === "string" && !value) return true;
  11736. return false;
  11737. }
  11738. function asyncParallelArray(arr, func, callback) {
  11739. var results = [];
  11740. var total = 0;
  11741. var arrLength = arr.length;
  11742. function count(errors) {
  11743. results.push.apply(results, errors || []);
  11744. total++;
  11745. if (total === arrLength) callback(results);
  11746. }
  11747. arr.forEach(function(a) {
  11748. func(a, count);
  11749. });
  11750. }
  11751. function asyncSerialArray(arr, func, callback) {
  11752. var index = 0;
  11753. var arrLength = arr.length;
  11754. function next(errors) {
  11755. if (errors && errors.length) {
  11756. callback(errors);
  11757. return;
  11758. }
  11759. var original = index;
  11760. index = index + 1;
  11761. if (original < arrLength) func(arr[original], next);
  11762. else callback([]);
  11763. }
  11764. next([]);
  11765. }
  11766. function flattenObjArr(objArr) {
  11767. var ret = [];
  11768. Object.keys(objArr).forEach(function(k) {
  11769. ret.push.apply(ret, objArr[k] || []);
  11770. });
  11771. return ret;
  11772. }
  11773. var AsyncValidationError = /* @__PURE__ */ function(_Error) {
  11774. _inheritsLoose(AsyncValidationError, _Error);
  11775. function AsyncValidationError(errors, fields) {
  11776. var _this = _Error.call(this, "Async Validation Error") || this;
  11777. _this.errors = errors;
  11778. _this.fields = fields;
  11779. return _this;
  11780. }
  11781. return AsyncValidationError;
  11782. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  11783. function asyncMap(objArr, option, func, callback, source) {
  11784. if (option.first) {
  11785. var _pending = new Promise(function(resolve, reject) {
  11786. asyncSerialArray(flattenObjArr(objArr), func, function next(errors) {
  11787. callback(errors);
  11788. return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
  11789. });
  11790. });
  11791. _pending["catch"](function(e) {
  11792. return e;
  11793. });
  11794. return _pending;
  11795. }
  11796. var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
  11797. var objArrKeys = Object.keys(objArr);
  11798. var objArrLength = objArrKeys.length;
  11799. var total = 0;
  11800. var results = [];
  11801. var pending = new Promise(function(resolve, reject) {
  11802. var next = function next(errors) {
  11803. results.push.apply(results, errors);
  11804. total++;
  11805. if (total === objArrLength) {
  11806. callback(results);
  11807. return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
  11808. }
  11809. };
  11810. if (!objArrKeys.length) {
  11811. callback(results);
  11812. resolve(source);
  11813. }
  11814. objArrKeys.forEach(function(key) {
  11815. var arr = objArr[key];
  11816. if (firstFields.indexOf(key) !== -1) asyncSerialArray(arr, func, next);
  11817. else asyncParallelArray(arr, func, next);
  11818. });
  11819. });
  11820. pending["catch"](function(e) {
  11821. return e;
  11822. });
  11823. return pending;
  11824. }
  11825. function isErrorObj(obj) {
  11826. return !!(obj && obj.message !== void 0);
  11827. }
  11828. function getValue(value, path) {
  11829. var v = value;
  11830. for (var i = 0; i < path.length; i++) {
  11831. if (v == void 0) return v;
  11832. v = v[path[i]];
  11833. }
  11834. return v;
  11835. }
  11836. function complementError(rule, source) {
  11837. return function(oe) {
  11838. var fieldValue;
  11839. if (rule.fullFields) fieldValue = getValue(source, rule.fullFields);
  11840. else fieldValue = source[oe.field || rule.fullField];
  11841. if (isErrorObj(oe)) {
  11842. oe.field = oe.field || rule.fullField;
  11843. oe.fieldValue = fieldValue;
  11844. return oe;
  11845. }
  11846. return {
  11847. message: typeof oe === "function" ? oe() : oe,
  11848. fieldValue,
  11849. field: oe.field || rule.fullField
  11850. };
  11851. };
  11852. }
  11853. function deepMerge(target, source) {
  11854. if (source) {
  11855. for (var s in source) if (source.hasOwnProperty(s)) {
  11856. var value = source[s];
  11857. if (typeof value === "object" && typeof target[s] === "object") target[s] = _extends({}, target[s], value);
  11858. else target[s] = value;
  11859. }
  11860. }
  11861. return target;
  11862. }
  11863. var required$1 = function required(rule, value, source, errors, options, type) {
  11864. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) errors.push(format(options.messages.required, rule.fullField));
  11865. };
  11866. /**
  11867. * Rule for validating whitespace.
  11868. *
  11869. * @param rule The validation rule.
  11870. * @param value The value of the field on the source object.
  11871. * @param source The source object being validated.
  11872. * @param errors An array of errors that this rule may add
  11873. * validation errors to.
  11874. * @param options The validation options.
  11875. * @param options.messages The validation messages.
  11876. */
  11877. var whitespace = function whitespace(rule, value, source, errors, options) {
  11878. if (/^\s+$/.test(value) || value === "") errors.push(format(options.messages.whitespace, rule.fullField));
  11879. };
  11880. var urlReg;
  11881. var getUrlRegex = (function() {
  11882. if (urlReg) return urlReg;
  11883. var word = "[a-fA-F\\d:]";
  11884. var b = function b(options) {
  11885. return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
  11886. };
  11887. var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
  11888. var v6seg = "[a-fA-F\\d]{1,4}";
  11889. var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
  11890. var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
  11891. var v4exact = new RegExp("^" + v4 + "$");
  11892. var v6exact = new RegExp("^" + v6 + "$");
  11893. var ip = function ip(options) {
  11894. return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", "g");
  11895. };
  11896. ip.v4 = function(options) {
  11897. return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), "g");
  11898. };
  11899. ip.v6 = function(options) {
  11900. return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), "g");
  11901. };
  11902. var protocol = "(?:(?:[a-z]+:)?//)";
  11903. var auth = "(?:\\S+(?::\\S*)?@)?";
  11904. var ipv4 = ip.v4().source;
  11905. var ipv6 = ip.v6().source;
  11906. var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s\"]*)?";
  11907. urlReg = new RegExp("(?:^" + regex + "$)", "i");
  11908. return urlReg;
  11909. });
  11910. var pattern$2 = {
  11911. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
  11912. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  11913. };
  11914. var types = {
  11915. integer: function integer(value) {
  11916. return types.number(value) && parseInt(value, 10) === value;
  11917. },
  11918. "float": function float(value) {
  11919. return types.number(value) && !types.integer(value);
  11920. },
  11921. array: function array(value) {
  11922. return Array.isArray(value);
  11923. },
  11924. regexp: function regexp(value) {
  11925. if (value instanceof RegExp) return true;
  11926. try {
  11927. return !!new RegExp(value);
  11928. } catch (e) {
  11929. return false;
  11930. }
  11931. },
  11932. date: function date(value) {
  11933. return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
  11934. },
  11935. number: function number(value) {
  11936. if (isNaN(value)) return false;
  11937. return typeof value === "number";
  11938. },
  11939. object: function object(value) {
  11940. return typeof value === "object" && !types.array(value);
  11941. },
  11942. method: function method(value) {
  11943. return typeof value === "function";
  11944. },
  11945. email: function email(value) {
  11946. return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
  11947. },
  11948. url: function url(value) {
  11949. return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
  11950. },
  11951. hex: function hex(value) {
  11952. return typeof value === "string" && !!value.match(pattern$2.hex);
  11953. }
  11954. };
  11955. var type$1 = function type(rule, value, source, errors, options) {
  11956. if (rule.required && value === void 0) {
  11957. required$1(rule, value, source, errors, options);
  11958. return;
  11959. }
  11960. var custom = [
  11961. "integer",
  11962. "float",
  11963. "array",
  11964. "regexp",
  11965. "object",
  11966. "method",
  11967. "email",
  11968. "number",
  11969. "date",
  11970. "url",
  11971. "hex"
  11972. ];
  11973. var ruleType = rule.type;
  11974. if (custom.indexOf(ruleType) > -1) {
  11975. if (!types[ruleType](value)) errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11976. } else if (ruleType && typeof value !== rule.type) errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11977. };
  11978. var range = function range(rule, value, source, errors, options) {
  11979. var len = typeof rule.len === "number";
  11980. var min = typeof rule.min === "number";
  11981. var max = typeof rule.max === "number";
  11982. var val = value;
  11983. var key = null;
  11984. var num = typeof value === "number";
  11985. var str = typeof value === "string";
  11986. var arr = Array.isArray(value);
  11987. if (num) key = "number";
  11988. else if (str) key = "string";
  11989. else if (arr) key = "array";
  11990. if (!key) return false;
  11991. if (arr) val = value.length;
  11992. if (str) val = value.length;
  11993. if (len) {
  11994. if (val !== rule.len) errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  11995. } else if (min && !max && val < rule.min) errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  11996. else if (max && !min && val > rule.max) errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  11997. else if (min && max && (val < rule.min || val > rule.max)) errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  11998. };
  11999. var ENUM$1 = "enum";
  12000. var enumerable$1 = function enumerable(rule, value, source, errors, options) {
  12001. rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
  12002. if (rule[ENUM$1].indexOf(value) === -1) errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
  12003. };
  12004. var pattern$1 = function pattern(rule, value, source, errors, options) {
  12005. if (rule.pattern) {
  12006. if (rule.pattern instanceof RegExp) {
  12007. rule.pattern.lastIndex = 0;
  12008. if (!rule.pattern.test(value)) errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12009. } else if (typeof rule.pattern === "string") {
  12010. if (!new RegExp(rule.pattern).test(value)) errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12011. }
  12012. }
  12013. };
  12014. var rules = {
  12015. required: required$1,
  12016. whitespace,
  12017. type: type$1,
  12018. range,
  12019. "enum": enumerable$1,
  12020. pattern: pattern$1
  12021. };
  12022. var string = function string(rule, value, callback, source, options) {
  12023. var errors = [];
  12024. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12025. if (isEmptyValue(value, "string") && !rule.required) return callback();
  12026. rules.required(rule, value, source, errors, options, "string");
  12027. if (!isEmptyValue(value, "string")) {
  12028. rules.type(rule, value, source, errors, options);
  12029. rules.range(rule, value, source, errors, options);
  12030. rules.pattern(rule, value, source, errors, options);
  12031. if (rule.whitespace === true) rules.whitespace(rule, value, source, errors, options);
  12032. }
  12033. }
  12034. callback(errors);
  12035. };
  12036. var method = function method(rule, value, callback, source, options) {
  12037. var errors = [];
  12038. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12039. if (isEmptyValue(value) && !rule.required) return callback();
  12040. rules.required(rule, value, source, errors, options);
  12041. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12042. }
  12043. callback(errors);
  12044. };
  12045. var number = function number(rule, value, callback, source, options) {
  12046. var errors = [];
  12047. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12048. if (value === "") value = void 0;
  12049. if (isEmptyValue(value) && !rule.required) return callback();
  12050. rules.required(rule, value, source, errors, options);
  12051. if (value !== void 0) {
  12052. rules.type(rule, value, source, errors, options);
  12053. rules.range(rule, value, source, errors, options);
  12054. }
  12055. }
  12056. callback(errors);
  12057. };
  12058. var _boolean = function _boolean(rule, value, callback, source, options) {
  12059. var errors = [];
  12060. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12061. if (isEmptyValue(value) && !rule.required) return callback();
  12062. rules.required(rule, value, source, errors, options);
  12063. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12064. }
  12065. callback(errors);
  12066. };
  12067. var regexp = function regexp(rule, value, callback, source, options) {
  12068. var errors = [];
  12069. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12070. if (isEmptyValue(value) && !rule.required) return callback();
  12071. rules.required(rule, value, source, errors, options);
  12072. if (!isEmptyValue(value)) rules.type(rule, value, source, errors, options);
  12073. }
  12074. callback(errors);
  12075. };
  12076. var integer = function integer(rule, value, callback, source, options) {
  12077. var errors = [];
  12078. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12079. if (isEmptyValue(value) && !rule.required) return callback();
  12080. rules.required(rule, value, source, errors, options);
  12081. if (value !== void 0) {
  12082. rules.type(rule, value, source, errors, options);
  12083. rules.range(rule, value, source, errors, options);
  12084. }
  12085. }
  12086. callback(errors);
  12087. };
  12088. var floatFn = function floatFn(rule, value, callback, source, options) {
  12089. var errors = [];
  12090. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12091. if (isEmptyValue(value) && !rule.required) return callback();
  12092. rules.required(rule, value, source, errors, options);
  12093. if (value !== void 0) {
  12094. rules.type(rule, value, source, errors, options);
  12095. rules.range(rule, value, source, errors, options);
  12096. }
  12097. }
  12098. callback(errors);
  12099. };
  12100. var array = function array(rule, value, callback, source, options) {
  12101. var errors = [];
  12102. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12103. if ((value === void 0 || value === null) && !rule.required) return callback();
  12104. rules.required(rule, value, source, errors, options, "array");
  12105. if (value !== void 0 && value !== null) {
  12106. rules.type(rule, value, source, errors, options);
  12107. rules.range(rule, value, source, errors, options);
  12108. }
  12109. }
  12110. callback(errors);
  12111. };
  12112. var object = function object(rule, value, callback, source, options) {
  12113. var errors = [];
  12114. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12115. if (isEmptyValue(value) && !rule.required) return callback();
  12116. rules.required(rule, value, source, errors, options);
  12117. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12118. }
  12119. callback(errors);
  12120. };
  12121. var ENUM = "enum";
  12122. var enumerable = function enumerable(rule, value, callback, source, options) {
  12123. var errors = [];
  12124. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12125. if (isEmptyValue(value) && !rule.required) return callback();
  12126. rules.required(rule, value, source, errors, options);
  12127. if (value !== void 0) rules[ENUM](rule, value, source, errors, options);
  12128. }
  12129. callback(errors);
  12130. };
  12131. var pattern = function pattern(rule, value, callback, source, options) {
  12132. var errors = [];
  12133. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12134. if (isEmptyValue(value, "string") && !rule.required) return callback();
  12135. rules.required(rule, value, source, errors, options);
  12136. if (!isEmptyValue(value, "string")) rules.pattern(rule, value, source, errors, options);
  12137. }
  12138. callback(errors);
  12139. };
  12140. var date = function date(rule, value, callback, source, options) {
  12141. var errors = [];
  12142. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12143. if (isEmptyValue(value, "date") && !rule.required) return callback();
  12144. rules.required(rule, value, source, errors, options);
  12145. if (!isEmptyValue(value, "date")) {
  12146. var dateObject;
  12147. if (value instanceof Date) dateObject = value;
  12148. else dateObject = new Date(value);
  12149. rules.type(rule, dateObject, source, errors, options);
  12150. if (dateObject) rules.range(rule, dateObject.getTime(), source, errors, options);
  12151. }
  12152. }
  12153. callback(errors);
  12154. };
  12155. var required = function required(rule, value, callback, source, options) {
  12156. var errors = [];
  12157. var type = Array.isArray(value) ? "array" : typeof value;
  12158. rules.required(rule, value, source, errors, options, type);
  12159. callback(errors);
  12160. };
  12161. var type = function type(rule, value, callback, source, options) {
  12162. var ruleType = rule.type;
  12163. var errors = [];
  12164. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12165. if (isEmptyValue(value, ruleType) && !rule.required) return callback();
  12166. rules.required(rule, value, source, errors, options, ruleType);
  12167. if (!isEmptyValue(value, ruleType)) rules.type(rule, value, source, errors, options);
  12168. }
  12169. callback(errors);
  12170. };
  12171. var any = function any(rule, value, callback, source, options) {
  12172. var errors = [];
  12173. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12174. if (isEmptyValue(value) && !rule.required) return callback();
  12175. rules.required(rule, value, source, errors, options);
  12176. }
  12177. callback(errors);
  12178. };
  12179. var validators = {
  12180. string,
  12181. method,
  12182. number,
  12183. "boolean": _boolean,
  12184. regexp,
  12185. integer,
  12186. "float": floatFn,
  12187. array,
  12188. object,
  12189. "enum": enumerable,
  12190. pattern,
  12191. date,
  12192. url: type,
  12193. hex: type,
  12194. email: type,
  12195. required,
  12196. any
  12197. };
  12198. function newMessages() {
  12199. return {
  12200. "default": "Validation error on field %s",
  12201. required: "%s is required",
  12202. "enum": "%s must be one of %s",
  12203. whitespace: "%s cannot be empty",
  12204. date: {
  12205. format: "%s date %s is invalid for format %s",
  12206. parse: "%s date could not be parsed, %s is invalid ",
  12207. invalid: "%s date %s is invalid"
  12208. },
  12209. types: {
  12210. string: "%s is not a %s",
  12211. method: "%s is not a %s (function)",
  12212. array: "%s is not an %s",
  12213. object: "%s is not an %s",
  12214. number: "%s is not a %s",
  12215. date: "%s is not a %s",
  12216. "boolean": "%s is not a %s",
  12217. integer: "%s is not an %s",
  12218. "float": "%s is not a %s",
  12219. regexp: "%s is not a valid %s",
  12220. email: "%s is not a valid %s",
  12221. url: "%s is not a valid %s",
  12222. hex: "%s is not a valid %s"
  12223. },
  12224. string: {
  12225. len: "%s must be exactly %s characters",
  12226. min: "%s must be at least %s characters",
  12227. max: "%s cannot be longer than %s characters",
  12228. range: "%s must be between %s and %s characters"
  12229. },
  12230. number: {
  12231. len: "%s must equal %s",
  12232. min: "%s cannot be less than %s",
  12233. max: "%s cannot be greater than %s",
  12234. range: "%s must be between %s and %s"
  12235. },
  12236. array: {
  12237. len: "%s must be exactly %s in length",
  12238. min: "%s cannot be less than %s in length",
  12239. max: "%s cannot be greater than %s in length",
  12240. range: "%s must be between %s and %s in length"
  12241. },
  12242. pattern: { mismatch: "%s value %s does not match pattern %s" },
  12243. clone: function clone() {
  12244. var cloned = JSON.parse(JSON.stringify(this));
  12245. cloned.clone = this.clone;
  12246. return cloned;
  12247. }
  12248. };
  12249. }
  12250. var messages = newMessages();
  12251. /**
  12252. * Encapsulates a validation schema.
  12253. *
  12254. * @param descriptor An object declaring validation rules
  12255. * for this schema.
  12256. */
  12257. var Schema = /* @__PURE__ */ function() {
  12258. function Schema(descriptor) {
  12259. this.rules = null;
  12260. this._messages = messages;
  12261. this.define(descriptor);
  12262. }
  12263. var _proto = Schema.prototype;
  12264. _proto.define = function define(rules) {
  12265. var _this = this;
  12266. if (!rules) throw new Error("Cannot configure a schema with no rules");
  12267. if (typeof rules !== "object" || Array.isArray(rules)) throw new Error("Rules must be an object");
  12268. this.rules = {};
  12269. Object.keys(rules).forEach(function(name) {
  12270. var item = rules[name];
  12271. _this.rules[name] = Array.isArray(item) ? item : [item];
  12272. });
  12273. };
  12274. _proto.messages = function messages(_messages) {
  12275. if (_messages) this._messages = deepMerge(newMessages(), _messages);
  12276. return this._messages;
  12277. };
  12278. _proto.validate = function validate(source_, o, oc) {
  12279. var _this2 = this;
  12280. if (o === void 0) o = {};
  12281. if (oc === void 0) oc = function oc() {};
  12282. var source = source_;
  12283. var options = o;
  12284. var callback = oc;
  12285. if (typeof options === "function") {
  12286. callback = options;
  12287. options = {};
  12288. }
  12289. if (!this.rules || Object.keys(this.rules).length === 0) {
  12290. if (callback) callback(null, source);
  12291. return Promise.resolve(source);
  12292. }
  12293. function complete(results) {
  12294. var errors = [];
  12295. var fields = {};
  12296. function add(e) {
  12297. if (Array.isArray(e)) {
  12298. var _errors;
  12299. errors = (_errors = errors).concat.apply(_errors, e);
  12300. } else errors.push(e);
  12301. }
  12302. for (var i = 0; i < results.length; i++) add(results[i]);
  12303. if (!errors.length) callback(null, source);
  12304. else {
  12305. fields = convertFieldsError(errors);
  12306. callback(errors, fields);
  12307. }
  12308. }
  12309. if (options.messages) {
  12310. var messages$1 = this.messages();
  12311. if (messages$1 === messages) messages$1 = newMessages();
  12312. deepMerge(messages$1, options.messages);
  12313. options.messages = messages$1;
  12314. } else options.messages = this.messages();
  12315. var series = {};
  12316. (options.keys || Object.keys(this.rules)).forEach(function(z) {
  12317. var arr = _this2.rules[z];
  12318. var value = source[z];
  12319. arr.forEach(function(r) {
  12320. var rule = r;
  12321. if (typeof rule.transform === "function") {
  12322. if (source === source_) source = _extends({}, source);
  12323. value = source[z] = rule.transform(value);
  12324. }
  12325. if (typeof rule === "function") rule = { validator: rule };
  12326. else rule = _extends({}, rule);
  12327. rule.validator = _this2.getValidationMethod(rule);
  12328. if (!rule.validator) return;
  12329. rule.field = z;
  12330. rule.fullField = rule.fullField || z;
  12331. rule.type = _this2.getType(rule);
  12332. series[z] = series[z] || [];
  12333. series[z].push({
  12334. rule,
  12335. value,
  12336. source,
  12337. field: z
  12338. });
  12339. });
  12340. });
  12341. var errorFields = {};
  12342. return asyncMap(series, options, function(data, doIt) {
  12343. var rule = data.rule;
  12344. var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
  12345. deep = deep && (rule.required || !rule.required && data.value);
  12346. rule.field = data.field;
  12347. function addFullField(key, schema) {
  12348. return _extends({}, schema, {
  12349. fullField: rule.fullField + "." + key,
  12350. fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
  12351. });
  12352. }
  12353. function cb(e) {
  12354. if (e === void 0) e = [];
  12355. var errorList = Array.isArray(e) ? e : [e];
  12356. if (!options.suppressWarning && errorList.length) Schema.warning("async-validator:", errorList);
  12357. if (errorList.length && rule.message !== void 0) errorList = [].concat(rule.message);
  12358. var filledErrors = errorList.map(complementError(rule, source));
  12359. if (options.first && filledErrors.length) {
  12360. errorFields[rule.field] = 1;
  12361. return doIt(filledErrors);
  12362. }
  12363. if (!deep) doIt(filledErrors);
  12364. else {
  12365. if (rule.required && !data.value) {
  12366. if (rule.message !== void 0) filledErrors = [].concat(rule.message).map(complementError(rule, source));
  12367. else if (options.error) filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
  12368. return doIt(filledErrors);
  12369. }
  12370. var fieldsSchema = {};
  12371. if (rule.defaultField) Object.keys(data.value).map(function(key) {
  12372. fieldsSchema[key] = rule.defaultField;
  12373. });
  12374. fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
  12375. var paredFieldsSchema = {};
  12376. Object.keys(fieldsSchema).forEach(function(field) {
  12377. var fieldSchema = fieldsSchema[field];
  12378. paredFieldsSchema[field] = (Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema]).map(addFullField.bind(null, field));
  12379. });
  12380. var schema = new Schema(paredFieldsSchema);
  12381. schema.messages(options.messages);
  12382. if (data.rule.options) {
  12383. data.rule.options.messages = options.messages;
  12384. data.rule.options.error = options.error;
  12385. }
  12386. schema.validate(data.value, data.rule.options || options, function(errs) {
  12387. var finalErrors = [];
  12388. if (filledErrors && filledErrors.length) finalErrors.push.apply(finalErrors, filledErrors);
  12389. if (errs && errs.length) finalErrors.push.apply(finalErrors, errs);
  12390. doIt(finalErrors.length ? finalErrors : null);
  12391. });
  12392. }
  12393. }
  12394. var res;
  12395. if (rule.asyncValidator) res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  12396. else if (rule.validator) {
  12397. try {
  12398. res = rule.validator(rule, data.value, cb, data.source, options);
  12399. } catch (error) {
  12400. console.error == null || console.error(error);
  12401. if (!options.suppressValidatorError) setTimeout(function() {
  12402. throw error;
  12403. }, 0);
  12404. cb(error.message);
  12405. }
  12406. if (res === true) cb();
  12407. else if (res === false) cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
  12408. else if (res instanceof Array) cb(res);
  12409. else if (res instanceof Error) cb(res.message);
  12410. }
  12411. if (res && res.then) res.then(function() {
  12412. return cb();
  12413. }, function(e) {
  12414. return cb(e);
  12415. });
  12416. }, function(results) {
  12417. complete(results);
  12418. }, source);
  12419. };
  12420. _proto.getType = function getType(rule) {
  12421. if (rule.type === void 0 && rule.pattern instanceof RegExp) rule.type = "pattern";
  12422. if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) throw new Error(format("Unknown rule type %s", rule.type));
  12423. return rule.type || "string";
  12424. };
  12425. _proto.getValidationMethod = function getValidationMethod(rule) {
  12426. if (typeof rule.validator === "function") return rule.validator;
  12427. var keys = Object.keys(rule);
  12428. var messageIndex = keys.indexOf("message");
  12429. if (messageIndex !== -1) keys.splice(messageIndex, 1);
  12430. if (keys.length === 1 && keys[0] === "required") return validators.required;
  12431. return validators[this.getType(rule)] || void 0;
  12432. };
  12433. return Schema;
  12434. }();
  12435. Schema.register = function register(type, validator) {
  12436. if (typeof validator !== "function") throw new Error("Cannot register a validator by type, validator is not a function");
  12437. validators[type] = validator;
  12438. };
  12439. Schema.warning = warning;
  12440. Schema.messages = messages;
  12441. Schema.validators = validators;
  12442. //#endregion
  12443. //#region ../../packages/components/form/src/form-label-wrap.tsx
  12444. const COMPONENT_NAME$20 = "ElLabelWrap";
  12445. var form_label_wrap_default = /* @__PURE__ */ defineComponent({
  12446. name: COMPONENT_NAME$20,
  12447. props: {
  12448. isAutoWidth: Boolean,
  12449. updateAll: Boolean
  12450. },
  12451. setup(props, { slots }) {
  12452. const formContext = inject(formContextKey, void 0);
  12453. const formItemContext = inject(formItemContextKey);
  12454. if (!formItemContext) throwError(COMPONENT_NAME$20, "usage: <el-form-item><label-wrap /></el-form-item>");
  12455. const ns = useNamespace("form");
  12456. const el = ref();
  12457. const computedWidth = ref(0);
  12458. const getLabelWidth = () => {
  12459. if (el.value?.firstElementChild) {
  12460. const width = window.getComputedStyle(el.value.firstElementChild).width;
  12461. return Math.ceil(Number.parseFloat(width));
  12462. } else return 0;
  12463. };
  12464. const updateLabelWidth = (action = "update") => {
  12465. nextTick(() => {
  12466. if (slots.default && props.isAutoWidth) {
  12467. if (action === "update") computedWidth.value = getLabelWidth();
  12468. else if (action === "remove") formContext?.deregisterLabelWidth(computedWidth.value);
  12469. }
  12470. });
  12471. };
  12472. const updateLabelWidthFn = () => updateLabelWidth("update");
  12473. onMounted(() => {
  12474. updateLabelWidthFn();
  12475. });
  12476. onBeforeUnmount(() => {
  12477. updateLabelWidth("remove");
  12478. });
  12479. onUpdated(() => updateLabelWidthFn());
  12480. watch(computedWidth, (val, oldVal) => {
  12481. if (props.updateAll) formContext?.registerLabelWidth(val, oldVal);
  12482. });
  12483. useResizeObserver(computed(() => el.value?.firstElementChild ?? null), updateLabelWidthFn);
  12484. return () => {
  12485. if (!slots) return null;
  12486. const { isAutoWidth } = props;
  12487. if (isAutoWidth) {
  12488. const autoLabelWidth = formContext?.autoLabelWidth;
  12489. const hasLabel = formItemContext?.hasLabel;
  12490. const style = {};
  12491. if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") {
  12492. const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value);
  12493. const marginPosition = (formItemContext.labelPosition || formContext.labelPosition) === "left" ? "marginRight" : "marginLeft";
  12494. if (marginWidth) style[marginPosition] = `${marginWidth}px`;
  12495. }
  12496. return createVNode("div", {
  12497. "ref": el,
  12498. "class": [ns.be("item", "label-wrap")],
  12499. "style": style
  12500. }, [slots.default?.()]);
  12501. } else return createVNode(Fragment, { "ref": el }, [slots.default?.()]);
  12502. };
  12503. }
  12504. });
  12505. //#endregion
  12506. //#region ../../packages/components/form/src/form-item.vue?vue&type=script&setup=true&lang.ts
  12507. const _hoisted_1$78 = ["role", "aria-labelledby"];
  12508. var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  12509. name: "ElFormItem",
  12510. __name: "form-item",
  12511. props: formItemProps,
  12512. setup(__props, { expose: __expose }) {
  12513. const props = __props;
  12514. const slots = useSlots();
  12515. const formContext = inject(formContextKey, void 0);
  12516. const parentFormItemContext = inject(formItemContextKey, void 0);
  12517. const _size = useFormSize(void 0, { formItem: false });
  12518. const ns = useNamespace("form-item");
  12519. const labelId = useId().value;
  12520. const inputIds = ref([]);
  12521. const validateState = ref("");
  12522. const validateStateDebounced = refDebounced(validateState, 100);
  12523. const validateMessage = ref("");
  12524. const formItemRef = ref();
  12525. let initialValue = void 0;
  12526. let isResettingField = false;
  12527. const labelPosition = computed(() => props.labelPosition || formContext?.labelPosition);
  12528. const labelStyle = computed(() => {
  12529. if (labelPosition.value === "top") return {};
  12530. return { width: addUnit(props.labelWidth ?? formContext?.labelWidth) };
  12531. });
  12532. const contentStyle = computed(() => {
  12533. if (labelPosition.value === "top" || formContext?.inline) return {};
  12534. if (!props.label && !props.labelWidth && isNested) return {};
  12535. const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth);
  12536. if (!props.label && !slots.label) return { marginLeft: labelWidth };
  12537. return {};
  12538. });
  12539. const formItemClasses = computed(() => [
  12540. ns.b(),
  12541. ns.m(_size.value),
  12542. ns.is("error", validateState.value === "error"),
  12543. ns.is("validating", validateState.value === "validating"),
  12544. ns.is("success", validateState.value === "success"),
  12545. ns.is("required", isRequired.value || props.required),
  12546. ns.is("no-asterisk", formContext?.hideRequiredAsterisk),
  12547. formContext?.requireAsteriskPosition === "right" ? "asterisk-right" : "asterisk-left",
  12548. {
  12549. [ns.m("feedback")]: formContext?.statusIcon,
  12550. [ns.m(`label-${labelPosition.value}`)]: labelPosition.value
  12551. }
  12552. ]);
  12553. const _inlineMessage = computed(() => isBoolean(props.inlineMessage) ? props.inlineMessage : formContext?.inlineMessage || false);
  12554. const validateClasses = computed(() => [ns.e("error"), { [ns.em("error", "inline")]: _inlineMessage.value }]);
  12555. const propString = computed(() => {
  12556. if (!props.prop) return "";
  12557. return isArray$1(props.prop) ? props.prop.join(".") : props.prop;
  12558. });
  12559. const hasLabel = computed(() => {
  12560. return !!(props.label || slots.label);
  12561. });
  12562. const labelFor = computed(() => {
  12563. return props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : void 0);
  12564. });
  12565. const isGroup = computed(() => {
  12566. return !labelFor.value && hasLabel.value;
  12567. });
  12568. const isNested = !!parentFormItemContext;
  12569. const fieldValue = computed(() => {
  12570. const model = formContext?.model;
  12571. if (!model || !props.prop) return;
  12572. return getProp(model, props.prop).value;
  12573. });
  12574. const normalizedRules = computed(() => {
  12575. const { required } = props;
  12576. const rules = [];
  12577. if (props.rules) rules.push(...castArray$1(props.rules));
  12578. const formRules = formContext?.rules;
  12579. if (formRules && props.prop) {
  12580. const _rules = getProp(formRules, props.prop).value;
  12581. if (_rules) rules.push(...castArray$1(_rules));
  12582. }
  12583. if (required !== void 0) {
  12584. const requiredRules = rules.map((rule, i) => [rule, i]).filter(([rule]) => "required" in rule);
  12585. if (requiredRules.length > 0) for (const [rule, i] of requiredRules) {
  12586. if (rule.required === required) continue;
  12587. rules[i] = {
  12588. ...rule,
  12589. required
  12590. };
  12591. }
  12592. else rules.push({ required });
  12593. }
  12594. return rules;
  12595. });
  12596. const validateEnabled = computed(() => normalizedRules.value.length > 0);
  12597. const getFilteredRule = (trigger) => {
  12598. return normalizedRules.value.filter((rule) => {
  12599. if (!rule.trigger || !trigger) return true;
  12600. if (isArray$1(rule.trigger)) return rule.trigger.includes(trigger);
  12601. else return rule.trigger === trigger;
  12602. }).map(({ trigger, ...rule }) => rule);
  12603. };
  12604. const isRequired = computed(() => normalizedRules.value.some((rule) => rule.required));
  12605. const shouldShowError = computed(() => validateStateDebounced.value === "error" && props.showMessage && (formContext?.showMessage ?? true));
  12606. const currentLabel = computed(() => `${props.label || ""}${formContext?.labelSuffix || ""}`);
  12607. const setValidationState = (state) => {
  12608. validateState.value = state;
  12609. };
  12610. const onValidationFailed = (error) => {
  12611. const { errors, fields } = error;
  12612. if (!errors || !fields) console.error(error);
  12613. setValidationState("error");
  12614. validateMessage.value = errors ? errors?.[0]?.message ?? `${props.prop} is required` : "";
  12615. formContext?.emit("validate", props.prop, false, validateMessage.value);
  12616. };
  12617. const onValidationSucceeded = () => {
  12618. setValidationState("success");
  12619. formContext?.emit("validate", props.prop, true, "");
  12620. };
  12621. const doValidate = async (rules) => {
  12622. const modelName = propString.value;
  12623. return new Schema({ [modelName]: rules }).validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => {
  12624. onValidationSucceeded();
  12625. return true;
  12626. }).catch((err) => {
  12627. onValidationFailed(err);
  12628. return Promise.reject(err);
  12629. });
  12630. };
  12631. const validate = async (trigger, callback) => {
  12632. if (isResettingField || !props.prop) return false;
  12633. const hasCallback = isFunction$1(callback);
  12634. if (!validateEnabled.value) {
  12635. callback?.(false);
  12636. return false;
  12637. }
  12638. const rules = getFilteredRule(trigger);
  12639. if (rules.length === 0) {
  12640. callback?.(true);
  12641. return true;
  12642. }
  12643. setValidationState("validating");
  12644. return doValidate(rules).then(() => {
  12645. callback?.(true);
  12646. return true;
  12647. }).catch((err) => {
  12648. const { fields } = err;
  12649. callback?.(false, fields);
  12650. return hasCallback ? false : Promise.reject(fields);
  12651. });
  12652. };
  12653. const clearValidate = () => {
  12654. setValidationState("");
  12655. validateMessage.value = "";
  12656. isResettingField = false;
  12657. };
  12658. const resetField = async () => {
  12659. const model = formContext?.model;
  12660. if (!model || !props.prop) return;
  12661. const computedValue = getProp(model, props.prop);
  12662. isResettingField = true;
  12663. computedValue.value = cloneDeep(initialValue);
  12664. await nextTick();
  12665. clearValidate();
  12666. isResettingField = false;
  12667. };
  12668. const addInputId = (id) => {
  12669. if (!inputIds.value.includes(id)) inputIds.value.push(id);
  12670. };
  12671. const removeInputId = (id) => {
  12672. inputIds.value = inputIds.value.filter((listId) => listId !== id);
  12673. };
  12674. const setInitialValue = (value) => {
  12675. initialValue = cloneDeep(value);
  12676. };
  12677. watch(() => props.error, (val) => {
  12678. validateMessage.value = val || "";
  12679. setValidationState(val ? "error" : "");
  12680. }, { immediate: true });
  12681. watch(() => props.validateStatus, (val) => setValidationState(val || ""));
  12682. const context = reactive({
  12683. ...toRefs(props),
  12684. $el: formItemRef,
  12685. size: _size,
  12686. validateMessage,
  12687. validateState,
  12688. labelId,
  12689. inputIds,
  12690. isGroup,
  12691. hasLabel,
  12692. fieldValue,
  12693. addInputId,
  12694. removeInputId,
  12695. resetField,
  12696. clearValidate,
  12697. validate,
  12698. propString,
  12699. setInitialValue
  12700. });
  12701. provide(formItemContextKey, context);
  12702. onMounted(() => {
  12703. if (props.prop) {
  12704. setInitialValue(fieldValue.value);
  12705. formContext?.addField(context);
  12706. }
  12707. });
  12708. onBeforeUnmount(() => {
  12709. formContext?.removeField(context);
  12710. });
  12711. __expose({
  12712. size: _size,
  12713. validateMessage,
  12714. validateState,
  12715. validate,
  12716. clearValidate,
  12717. resetField,
  12718. setInitialValue
  12719. });
  12720. return (_ctx, _cache) => {
  12721. return openBlock(), createElementBlock("div", {
  12722. ref_key: "formItemRef",
  12723. ref: formItemRef,
  12724. class: normalizeClass(formItemClasses.value),
  12725. role: isGroup.value ? "group" : void 0,
  12726. "aria-labelledby": isGroup.value ? unref(labelId) : void 0
  12727. }, [createVNode(unref(form_label_wrap_default), {
  12728. "is-auto-width": labelStyle.value.width === "auto",
  12729. "update-all": unref(formContext)?.labelWidth === "auto"
  12730. }, {
  12731. default: withCtx(() => [!!(__props.label || _ctx.$slots.label) ? (openBlock(), createBlock(resolveDynamicComponent(labelFor.value ? "label" : "div"), {
  12732. key: 0,
  12733. id: unref(labelId),
  12734. for: labelFor.value,
  12735. class: normalizeClass(unref(ns).e("label")),
  12736. style: normalizeStyle(labelStyle.value)
  12737. }, {
  12738. default: withCtx(() => [renderSlot(_ctx.$slots, "label", { label: currentLabel.value }, () => [createTextVNode(toDisplayString(currentLabel.value), 1)])]),
  12739. _: 3
  12740. }, 8, [
  12741. "id",
  12742. "for",
  12743. "class",
  12744. "style"
  12745. ])) : createCommentVNode("v-if", true)]),
  12746. _: 3
  12747. }, 8, ["is-auto-width", "update-all"]), createElementVNode("div", {
  12748. class: normalizeClass(unref(ns).e("content")),
  12749. style: normalizeStyle(contentStyle.value)
  12750. }, [renderSlot(_ctx.$slots, "default"), createVNode(TransitionGroup, { name: `${unref(ns).namespace.value}-zoom-in-top` }, {
  12751. default: withCtx(() => [shouldShowError.value ? renderSlot(_ctx.$slots, "error", {
  12752. key: 0,
  12753. error: validateMessage.value
  12754. }, () => [createElementVNode("div", { class: normalizeClass(validateClasses.value) }, toDisplayString(validateMessage.value), 3)]) : createCommentVNode("v-if", true)]),
  12755. _: 3
  12756. }, 8, ["name"])], 6)], 10, _hoisted_1$78);
  12757. };
  12758. }
  12759. });
  12760. //#endregion
  12761. //#region ../../packages/components/form/src/form-item.vue
  12762. var form_item_default = form_item_vue_vue_type_script_setup_true_lang_default;
  12763. //#endregion
  12764. //#region ../../packages/components/form/index.ts
  12765. const ElForm = withInstall(form_default, { FormItem: form_item_default });
  12766. const ElFormItem = withNoopInstall(form_item_default);
  12767. //#endregion
  12768. //#region ../../packages/components/popper/src/utils.ts
  12769. const buildPopperOptions = (props, modifiers = []) => {
  12770. const { placement, strategy, popperOptions } = props;
  12771. const options = {
  12772. placement,
  12773. strategy,
  12774. ...popperOptions,
  12775. modifiers: [...genModifiers(props), ...modifiers]
  12776. };
  12777. deriveExtraModifiers(options, popperOptions?.modifiers);
  12778. return options;
  12779. };
  12780. const unwrapMeasurableEl = ($el) => {
  12781. if (!isClient) return;
  12782. return unrefElement($el);
  12783. };
  12784. function genModifiers(options) {
  12785. const { offset, gpuAcceleration, fallbackPlacements } = options;
  12786. return [
  12787. {
  12788. name: "offset",
  12789. options: { offset: [0, offset ?? 12] }
  12790. },
  12791. {
  12792. name: "preventOverflow",
  12793. options: { padding: {
  12794. top: 0,
  12795. bottom: 0,
  12796. left: 0,
  12797. right: 0
  12798. } }
  12799. },
  12800. {
  12801. name: "flip",
  12802. options: {
  12803. padding: 5,
  12804. fallbackPlacements
  12805. }
  12806. },
  12807. {
  12808. name: "computeStyles",
  12809. options: { gpuAcceleration }
  12810. }
  12811. ];
  12812. }
  12813. function deriveExtraModifiers(options, modifiers) {
  12814. if (modifiers) options.modifiers = [...options.modifiers, ...modifiers ?? []];
  12815. }
  12816. //#endregion
  12817. //#region ../../packages/components/popper/src/composables/use-content.ts
  12818. const DEFAULT_ARROW_OFFSET = 0;
  12819. const usePopperContent = (props) => {
  12820. const { popperInstanceRef, contentRef, triggerRef, role } = inject(POPPER_INJECTION_KEY, void 0);
  12821. const arrowRef = ref();
  12822. const arrowOffset = computed(() => props.arrowOffset);
  12823. const eventListenerModifier = computed(() => {
  12824. return {
  12825. name: "eventListeners",
  12826. enabled: !!props.visible
  12827. };
  12828. });
  12829. const arrowModifier = computed(() => {
  12830. const arrowEl = unref(arrowRef);
  12831. const offset = unref(arrowOffset) ?? DEFAULT_ARROW_OFFSET;
  12832. return {
  12833. name: "arrow",
  12834. enabled: !isUndefined$1(arrowEl),
  12835. options: {
  12836. element: arrowEl,
  12837. padding: offset
  12838. }
  12839. };
  12840. });
  12841. const options = computed(() => {
  12842. return {
  12843. onFirstUpdate: () => {
  12844. update();
  12845. },
  12846. ...buildPopperOptions(props, [unref(arrowModifier), unref(eventListenerModifier)])
  12847. };
  12848. });
  12849. const computedReference = computed(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef));
  12850. const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options);
  12851. watch(instanceRef, (instance) => popperInstanceRef.value = instance, { flush: "sync" });
  12852. onMounted(() => {
  12853. watch(() => unref(computedReference)?.getBoundingClientRect?.(), () => {
  12854. update();
  12855. });
  12856. });
  12857. onBeforeUnmount(() => {
  12858. popperInstanceRef.value = void 0;
  12859. });
  12860. return {
  12861. attributes,
  12862. arrowRef,
  12863. contentRef,
  12864. instanceRef,
  12865. state,
  12866. styles,
  12867. role,
  12868. forceUpdate,
  12869. update
  12870. };
  12871. };
  12872. //#endregion
  12873. //#region ../../packages/components/popper/src/composables/use-content-dom.ts
  12874. const usePopperContentDOM = (props, { attributes, styles, role }) => {
  12875. const { nextZIndex } = useZIndex();
  12876. const ns = useNamespace("popper");
  12877. const contentAttrs = computed(() => unref(attributes).popper);
  12878. const contentZIndex = ref(isNumber(props.zIndex) ? props.zIndex : nextZIndex());
  12879. const contentClass = computed(() => [
  12880. ns.b(),
  12881. ns.is("pure", props.pure),
  12882. ns.is(props.effect),
  12883. props.popperClass
  12884. ]);
  12885. const contentStyle = computed(() => {
  12886. return [
  12887. { zIndex: unref(contentZIndex) },
  12888. unref(styles).popper,
  12889. props.popperStyle || {}
  12890. ];
  12891. });
  12892. const ariaModal = computed(() => role.value === "dialog" ? "false" : void 0);
  12893. const arrowStyle = computed(() => unref(styles).arrow || {});
  12894. const updateZIndex = () => {
  12895. contentZIndex.value = isNumber(props.zIndex) ? props.zIndex : nextZIndex();
  12896. };
  12897. return {
  12898. ariaModal,
  12899. arrowStyle,
  12900. contentAttrs,
  12901. contentClass,
  12902. contentStyle,
  12903. contentZIndex,
  12904. updateZIndex
  12905. };
  12906. };
  12907. //#endregion
  12908. //#region ../../packages/components/popper/src/composables/use-focus-trap.ts
  12909. const usePopperContentFocusTrap = (props, emit) => {
  12910. const trapped = ref(false);
  12911. const focusStartRef = ref();
  12912. const onFocusAfterTrapped = () => {
  12913. emit("focus");
  12914. };
  12915. const onFocusAfterReleased = (event) => {
  12916. if (event.detail?.focusReason !== "pointer") {
  12917. focusStartRef.value = "first";
  12918. emit("blur");
  12919. }
  12920. };
  12921. const onFocusInTrap = (event) => {
  12922. if (props.visible && !trapped.value) {
  12923. if (event.target) focusStartRef.value = event.target;
  12924. trapped.value = true;
  12925. }
  12926. };
  12927. const onFocusoutPrevented = (event) => {
  12928. if (!props.trapping) {
  12929. if (event.detail.focusReason === "pointer") event.preventDefault();
  12930. trapped.value = false;
  12931. }
  12932. };
  12933. const onReleaseRequested = () => {
  12934. trapped.value = false;
  12935. emit("close");
  12936. };
  12937. onBeforeUnmount(() => {
  12938. focusStartRef.value = void 0;
  12939. });
  12940. return {
  12941. focusStartRef,
  12942. trapped,
  12943. onFocusAfterReleased,
  12944. onFocusAfterTrapped,
  12945. onFocusInTrap,
  12946. onFocusoutPrevented,
  12947. onReleaseRequested
  12948. };
  12949. };
  12950. //#endregion
  12951. //#region ../../packages/components/popper/src/content.vue?vue&type=script&setup=true&lang.ts
  12952. var content_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({
  12953. name: "ElPopperContent",
  12954. __name: "content",
  12955. props: popperContentProps,
  12956. emits: popperContentEmits,
  12957. setup(__props, { expose: __expose, emit: __emit }) {
  12958. const emit = __emit;
  12959. const props = __props;
  12960. const { focusStartRef, trapped, onFocusAfterReleased, onFocusAfterTrapped, onFocusInTrap, onFocusoutPrevented, onReleaseRequested } = usePopperContentFocusTrap(props, emit);
  12961. const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
  12962. const { ariaModal, arrowStyle, contentAttrs, contentClass, contentStyle, updateZIndex } = usePopperContentDOM(props, {
  12963. styles,
  12964. attributes,
  12965. role
  12966. });
  12967. const formItemContext = inject(formItemContextKey, void 0);
  12968. provide(POPPER_CONTENT_INJECTION_KEY, {
  12969. arrowStyle,
  12970. arrowRef
  12971. });
  12972. if (formItemContext) provide(formItemContextKey, {
  12973. ...formItemContext,
  12974. addInputId: NOOP,
  12975. removeInputId: NOOP
  12976. });
  12977. let triggerTargetAriaStopWatch = void 0;
  12978. const updatePopper = (shouldUpdateZIndex = true) => {
  12979. update();
  12980. shouldUpdateZIndex && updateZIndex();
  12981. };
  12982. const togglePopperAlive = () => {
  12983. updatePopper(false);
  12984. if (props.visible && props.focusOnShow) trapped.value = true;
  12985. else if (props.visible === false) trapped.value = false;
  12986. };
  12987. onMounted(() => {
  12988. watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  12989. triggerTargetAriaStopWatch?.();
  12990. triggerTargetAriaStopWatch = void 0;
  12991. const el = unref(triggerTargetEl || contentRef.value);
  12992. const prevEl = unref(prevTriggerTargetEl || contentRef.value);
  12993. if (isElement$1(el)) triggerTargetAriaStopWatch = watch([
  12994. role,
  12995. () => props.ariaLabel,
  12996. ariaModal,
  12997. () => props.id
  12998. ], (watches) => {
  12999. [
  13000. "role",
  13001. "aria-label",
  13002. "aria-modal",
  13003. "id"
  13004. ].forEach((key, idx) => {
  13005. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  13006. });
  13007. }, { immediate: true });
  13008. if (prevEl !== el && isElement$1(prevEl)) [
  13009. "role",
  13010. "aria-label",
  13011. "aria-modal",
  13012. "id"
  13013. ].forEach((key) => {
  13014. prevEl.removeAttribute(key);
  13015. });
  13016. }, { immediate: true });
  13017. watch(() => props.visible, togglePopperAlive, { immediate: true });
  13018. });
  13019. onBeforeUnmount(() => {
  13020. triggerTargetAriaStopWatch?.();
  13021. triggerTargetAriaStopWatch = void 0;
  13022. contentRef.value = void 0;
  13023. });
  13024. __expose({
  13025. popperContentRef: contentRef,
  13026. popperInstanceRef: instanceRef,
  13027. updatePopper,
  13028. contentStyle
  13029. });
  13030. return (_ctx, _cache) => {
  13031. return openBlock(), createElementBlock("div", mergeProps({
  13032. ref_key: "contentRef",
  13033. ref: contentRef
  13034. }, unref(contentAttrs), {
  13035. style: unref(contentStyle),
  13036. class: unref(contentClass),
  13037. tabindex: "-1",
  13038. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  13039. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  13040. }), [createVNode(unref(focus_trap_default), {
  13041. loop: __props.loop,
  13042. trapped: unref(trapped),
  13043. "trap-on-focus-in": true,
  13044. "focus-trap-el": unref(contentRef),
  13045. "focus-start-el": unref(focusStartRef),
  13046. onFocusAfterTrapped: unref(onFocusAfterTrapped),
  13047. onFocusAfterReleased: unref(onFocusAfterReleased),
  13048. onFocusin: unref(onFocusInTrap),
  13049. onFocusoutPrevented: unref(onFocusoutPrevented),
  13050. onReleaseRequested: unref(onReleaseRequested)
  13051. }, {
  13052. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  13053. _: 3
  13054. }, 8, [
  13055. "loop",
  13056. "trapped",
  13057. "focus-trap-el",
  13058. "focus-start-el",
  13059. "onFocusAfterTrapped",
  13060. "onFocusAfterReleased",
  13061. "onFocusin",
  13062. "onFocusoutPrevented",
  13063. "onReleaseRequested"
  13064. ])], 16);
  13065. };
  13066. }
  13067. });
  13068. //#endregion
  13069. //#region ../../packages/components/popper/src/content.vue
  13070. var content_default = content_vue_vue_type_script_setup_true_lang_default$2;
  13071. //#endregion
  13072. //#region ../../packages/components/popper/index.ts
  13073. const ElPopper = withInstall(popper_default);
  13074. //#endregion
  13075. //#region ../../packages/components/tooltip/src/content.ts
  13076. const useTooltipContentPropsDefaults = {
  13077. ...useDelayedTogglePropsDefaults,
  13078. ...popperContentPropsDefaults,
  13079. content: "",
  13080. visible: null,
  13081. teleported: true
  13082. };
  13083. /**
  13084. * @deprecated Removed after 3.0.0, Use `ElTooltipContentProps` instead.
  13085. */
  13086. const useTooltipContentProps = buildProps({
  13087. ...useDelayedToggleProps,
  13088. ...popperContentProps,
  13089. appendTo: { type: teleportProps.to.type },
  13090. content: {
  13091. type: String,
  13092. default: ""
  13093. },
  13094. rawContent: Boolean,
  13095. persistent: Boolean,
  13096. visible: {
  13097. type: definePropType(Boolean),
  13098. default: null
  13099. },
  13100. transition: String,
  13101. teleported: {
  13102. type: Boolean,
  13103. default: true
  13104. },
  13105. disabled: Boolean,
  13106. ...useAriaProps(["ariaLabel"])
  13107. });
  13108. //#endregion
  13109. //#region ../../packages/components/tooltip/src/trigger.ts
  13110. const useTooltipTriggerPropsDefaults = {
  13111. trigger: "hover",
  13112. triggerKeys: () => [
  13113. EVENT_CODE.enter,
  13114. EVENT_CODE.numpadEnter,
  13115. EVENT_CODE.space
  13116. ]
  13117. };
  13118. /**
  13119. * @deprecated Removed after 3.0.0, Use `UseTooltipTriggerProps` instead.
  13120. */
  13121. const useTooltipTriggerProps = buildProps({
  13122. ...popperTriggerProps,
  13123. disabled: Boolean,
  13124. trigger: {
  13125. type: definePropType([String, Array]),
  13126. default: "hover"
  13127. },
  13128. triggerKeys: {
  13129. type: definePropType(Array),
  13130. default: () => [
  13131. EVENT_CODE.enter,
  13132. EVENT_CODE.numpadEnter,
  13133. EVENT_CODE.space
  13134. ]
  13135. },
  13136. focusOnTarget: Boolean
  13137. });
  13138. //#endregion
  13139. //#region ../../packages/components/tooltip/src/tooltip.ts
  13140. const { useModelToggleProps: useTooltipModelToggleProps, useModelToggleEmits: useTooltipModelToggleEmits, useModelToggle: useTooltipModelToggle } = createModelToggleComposable("visible");
  13141. /**
  13142. * @deprecated Removed after 3.0.0, Use `UseTooltipProps` instead.
  13143. */
  13144. const useTooltipProps = buildProps({
  13145. ...popperProps,
  13146. ...useTooltipModelToggleProps,
  13147. ...useTooltipContentProps,
  13148. ...useTooltipTriggerProps,
  13149. ...popperArrowProps,
  13150. showArrow: {
  13151. type: Boolean,
  13152. default: true
  13153. }
  13154. });
  13155. const tooltipEmits = [
  13156. ...useTooltipModelToggleEmits,
  13157. "before-show",
  13158. "before-hide",
  13159. "show",
  13160. "hide",
  13161. "open",
  13162. "close"
  13163. ];
  13164. //#endregion
  13165. //#region ../../packages/components/tooltip/src/constants.ts
  13166. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  13167. //#endregion
  13168. //#region ../../packages/components/tooltip/src/utils.ts
  13169. const isTriggerType = (trigger, type) => {
  13170. if (isArray$1(trigger)) return trigger.includes(type);
  13171. return trigger === type;
  13172. };
  13173. const whenTrigger = (trigger, type, handler) => {
  13174. return (e) => {
  13175. isTriggerType(unref(trigger), type) && handler(e);
  13176. };
  13177. };
  13178. //#endregion
  13179. //#region ../../packages/components/tooltip/src/trigger.vue?vue&type=script&setup=true&lang.ts
  13180. var trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  13181. name: "ElTooltipTrigger",
  13182. __name: "trigger",
  13183. props: useTooltipTriggerProps,
  13184. setup(__props, { expose: __expose }) {
  13185. const props = __props;
  13186. const ns = useNamespace("tooltip");
  13187. const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
  13188. const triggerRef = ref(null);
  13189. const stopWhenControlledOrDisabled = () => {
  13190. if (unref(controlled) || props.disabled) return true;
  13191. };
  13192. const trigger = toRef(props, "trigger");
  13193. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => {
  13194. onOpen(e);
  13195. if (props.focusOnTarget && e.target) nextTick(() => {
  13196. focusElement(e.target, { preventScroll: true });
  13197. });
  13198. }));
  13199. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
  13200. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
  13201. if (e.button === 0) onToggle(e);
  13202. }));
  13203. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
  13204. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
  13205. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
  13206. e.preventDefault();
  13207. onToggle(e);
  13208. }));
  13209. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  13210. const code = getEventCode(e);
  13211. if (props.triggerKeys.includes(code)) {
  13212. e.preventDefault();
  13213. onToggle(e);
  13214. }
  13215. });
  13216. __expose({ triggerRef });
  13217. return (_ctx, _cache) => {
  13218. return openBlock(), createBlock(unref(trigger_default), {
  13219. id: unref(id),
  13220. "virtual-ref": __props.virtualRef,
  13221. open: unref(open),
  13222. "virtual-triggering": __props.virtualTriggering,
  13223. class: normalizeClass(unref(ns).e("trigger")),
  13224. onBlur: unref(onBlur),
  13225. onClick: unref(onClick),
  13226. onContextmenu: unref(onContextMenu),
  13227. onFocus: unref(onFocus),
  13228. onMouseenter: unref(onMouseenter),
  13229. onMouseleave: unref(onMouseleave),
  13230. onKeydown: unref(onKeydown)
  13231. }, {
  13232. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  13233. _: 3
  13234. }, 8, [
  13235. "id",
  13236. "virtual-ref",
  13237. "open",
  13238. "virtual-triggering",
  13239. "class",
  13240. "onBlur",
  13241. "onClick",
  13242. "onContextmenu",
  13243. "onFocus",
  13244. "onMouseenter",
  13245. "onMouseleave",
  13246. "onKeydown"
  13247. ]);
  13248. };
  13249. }
  13250. });
  13251. //#endregion
  13252. //#region ../../packages/components/tooltip/src/trigger.vue
  13253. var trigger_default$1 = trigger_vue_vue_type_script_setup_true_lang_default;
  13254. //#endregion
  13255. //#region ../../packages/components/tooltip/src/content.vue?vue&type=script&setup=true&lang.ts
  13256. var content_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
  13257. name: "ElTooltipContent",
  13258. inheritAttrs: false,
  13259. __name: "content",
  13260. props: useTooltipContentProps,
  13261. setup(__props, { expose: __expose }) {
  13262. const props = __props;
  13263. const { selector } = usePopperContainerId();
  13264. const ns = useNamespace("tooltip");
  13265. const contentRef = ref();
  13266. const popperContentRef = computedEager(() => contentRef.value?.popperContentRef);
  13267. let stopHandle;
  13268. const { controlled, id, open, trigger, onClose, onOpen, onShow, onHide, onBeforeShow, onBeforeHide } = inject(TOOLTIP_INJECTION_KEY, void 0);
  13269. const transitionClass = computed(() => {
  13270. return props.transition || `${ns.namespace.value}-fade-in-linear`;
  13271. });
  13272. const persistentRef = computed(() => {
  13273. return props.persistent;
  13274. });
  13275. onBeforeUnmount(() => {
  13276. stopHandle?.();
  13277. });
  13278. const shouldRender = computed(() => {
  13279. return unref(persistentRef) ? true : unref(open);
  13280. });
  13281. const shouldShow = computed(() => {
  13282. return props.disabled ? false : unref(open);
  13283. });
  13284. const appendTo = computed(() => {
  13285. return props.appendTo || selector.value;
  13286. });
  13287. const contentStyle = computed(() => props.style ?? {});
  13288. const ariaHidden = ref(true);
  13289. const onTransitionLeave = () => {
  13290. onHide();
  13291. isFocusInsideContent() && focusElement(document.body, { preventScroll: true });
  13292. ariaHidden.value = true;
  13293. };
  13294. const stopWhenControlled = () => {
  13295. if (unref(controlled)) return true;
  13296. };
  13297. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  13298. if (props.enterable && isTriggerType(unref(trigger), "hover")) onOpen();
  13299. });
  13300. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  13301. if (isTriggerType(unref(trigger), "hover")) onClose();
  13302. });
  13303. const onBeforeEnter = () => {
  13304. contentRef.value?.updatePopper?.();
  13305. onBeforeShow?.();
  13306. };
  13307. const onBeforeLeave = () => {
  13308. onBeforeHide?.();
  13309. };
  13310. const onAfterShow = () => {
  13311. onShow();
  13312. };
  13313. const onBlur = () => {
  13314. if (!props.virtualTriggering) onClose();
  13315. };
  13316. const isFocusInsideContent = (event) => {
  13317. const popperContent = contentRef.value?.popperContentRef;
  13318. const activeElement = event?.relatedTarget || document.activeElement;
  13319. return popperContent?.contains(activeElement);
  13320. };
  13321. watch(() => unref(open), (val) => {
  13322. if (!val) stopHandle?.();
  13323. else {
  13324. ariaHidden.value = false;
  13325. stopHandle = onClickOutside(popperContentRef, () => {
  13326. if (unref(controlled)) return;
  13327. if (castArray(unref(trigger)).every((item) => {
  13328. return item !== "hover" && item !== "focus";
  13329. })) onClose();
  13330. }, { detectIframe: true });
  13331. }
  13332. }, { flush: "post" });
  13333. watch(() => props.content, () => {
  13334. contentRef.value?.updatePopper?.();
  13335. });
  13336. __expose({
  13337. contentRef,
  13338. isFocusInsideContent
  13339. });
  13340. return (_ctx, _cache) => {
  13341. return openBlock(), createBlock(unref(ElTeleport), {
  13342. disabled: !__props.teleported,
  13343. to: appendTo.value
  13344. }, {
  13345. default: withCtx(() => [shouldRender.value || !ariaHidden.value ? (openBlock(), createBlock(Transition, {
  13346. key: 0,
  13347. name: transitionClass.value,
  13348. appear: !persistentRef.value,
  13349. onAfterLeave: onTransitionLeave,
  13350. onBeforeEnter,
  13351. onAfterEnter: onAfterShow,
  13352. onBeforeLeave,
  13353. persisted: ""
  13354. }, {
  13355. default: withCtx(() => [withDirectives(createVNode(unref(content_default), mergeProps({
  13356. id: unref(id),
  13357. ref_key: "contentRef",
  13358. ref: contentRef
  13359. }, _ctx.$attrs, {
  13360. "aria-label": __props.ariaLabel,
  13361. "aria-hidden": ariaHidden.value,
  13362. "boundaries-padding": __props.boundariesPadding,
  13363. "fallback-placements": __props.fallbackPlacements,
  13364. "gpu-acceleration": __props.gpuAcceleration,
  13365. offset: __props.offset,
  13366. placement: __props.placement,
  13367. "popper-options": __props.popperOptions,
  13368. "arrow-offset": __props.arrowOffset,
  13369. strategy: __props.strategy,
  13370. effect: __props.effect,
  13371. enterable: __props.enterable,
  13372. pure: __props.pure,
  13373. "popper-class": __props.popperClass,
  13374. "popper-style": [__props.popperStyle, contentStyle.value],
  13375. "reference-el": __props.referenceEl,
  13376. "trigger-target-el": __props.triggerTargetEl,
  13377. visible: shouldShow.value,
  13378. "z-index": __props.zIndex,
  13379. loop: __props.loop,
  13380. onMouseenter: unref(onContentEnter),
  13381. onMouseleave: unref(onContentLeave),
  13382. onBlur,
  13383. onClose: unref(onClose)
  13384. }), {
  13385. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  13386. _: 3
  13387. }, 16, [
  13388. "id",
  13389. "aria-label",
  13390. "aria-hidden",
  13391. "boundaries-padding",
  13392. "fallback-placements",
  13393. "gpu-acceleration",
  13394. "offset",
  13395. "placement",
  13396. "popper-options",
  13397. "arrow-offset",
  13398. "strategy",
  13399. "effect",
  13400. "enterable",
  13401. "pure",
  13402. "popper-class",
  13403. "popper-style",
  13404. "reference-el",
  13405. "trigger-target-el",
  13406. "visible",
  13407. "z-index",
  13408. "loop",
  13409. "onMouseenter",
  13410. "onMouseleave",
  13411. "onClose"
  13412. ]), [[vShow, shouldShow.value]])]),
  13413. _: 3
  13414. }, 8, ["name", "appear"])) : createCommentVNode("v-if", true)]),
  13415. _: 3
  13416. }, 8, ["disabled", "to"]);
  13417. };
  13418. }
  13419. });
  13420. //#endregion
  13421. //#region ../../packages/components/tooltip/src/content.vue
  13422. var content_default$2 = content_vue_vue_type_script_setup_true_lang_default$1;
  13423. //#endregion
  13424. //#region ../../packages/components/tooltip/src/tooltip.vue?vue&type=script&setup=true&lang.ts
  13425. const _hoisted_1$77 = ["innerHTML"];
  13426. const _hoisted_2$43 = { key: 1 };
  13427. var tooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  13428. name: "ElTooltip",
  13429. __name: "tooltip",
  13430. props: useTooltipProps,
  13431. emits: tooltipEmits,
  13432. setup(__props, { expose: __expose, emit: __emit }) {
  13433. const props = __props;
  13434. const emit = __emit;
  13435. usePopperContainer();
  13436. const ns = useNamespace("tooltip");
  13437. const id = useId();
  13438. const popperRef = ref();
  13439. const contentRef = ref();
  13440. const updatePopper = () => {
  13441. const popperComponent = unref(popperRef);
  13442. if (popperComponent) popperComponent.popperInstanceRef?.update();
  13443. };
  13444. const open = ref(false);
  13445. const toggleReason = ref();
  13446. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  13447. indicator: open,
  13448. toggleReason
  13449. });
  13450. const { onOpen, onClose } = useDelayedToggle({
  13451. showAfter: toRef(props, "showAfter"),
  13452. hideAfter: toRef(props, "hideAfter"),
  13453. autoClose: toRef(props, "autoClose"),
  13454. open: show,
  13455. close: hide
  13456. });
  13457. const controlled = computed(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  13458. const kls = computed(() => {
  13459. return [ns.b(), props.popperClass];
  13460. });
  13461. provide(TOOLTIP_INJECTION_KEY, {
  13462. controlled,
  13463. id,
  13464. open: readonly(open),
  13465. trigger: toRef(props, "trigger"),
  13466. onOpen,
  13467. onClose,
  13468. onToggle: (event) => {
  13469. if (unref(open)) onClose(event);
  13470. else onOpen(event);
  13471. },
  13472. onShow: () => {
  13473. emit("show", toggleReason.value);
  13474. },
  13475. onHide: () => {
  13476. emit("hide", toggleReason.value);
  13477. },
  13478. onBeforeShow: () => {
  13479. emit("before-show", toggleReason.value);
  13480. },
  13481. onBeforeHide: () => {
  13482. emit("before-hide", toggleReason.value);
  13483. },
  13484. updatePopper
  13485. });
  13486. watch(() => props.disabled, (disabled) => {
  13487. if (disabled && open.value) open.value = false;
  13488. });
  13489. const isFocusInsideContent = (event) => {
  13490. return contentRef.value?.isFocusInsideContent(event);
  13491. };
  13492. onDeactivated(() => open.value && hide());
  13493. onBeforeUnmount(() => {
  13494. toggleReason.value = void 0;
  13495. });
  13496. __expose({
  13497. popperRef,
  13498. contentRef,
  13499. isFocusInsideContent,
  13500. updatePopper,
  13501. onOpen,
  13502. onClose,
  13503. hide
  13504. });
  13505. return (_ctx, _cache) => {
  13506. return openBlock(), createBlock(unref(ElPopper), {
  13507. ref_key: "popperRef",
  13508. ref: popperRef,
  13509. role: __props.role
  13510. }, {
  13511. default: withCtx(() => [createVNode(trigger_default$1, {
  13512. disabled: __props.disabled,
  13513. trigger: __props.trigger,
  13514. "trigger-keys": __props.triggerKeys,
  13515. "virtual-ref": __props.virtualRef,
  13516. "virtual-triggering": __props.virtualTriggering,
  13517. "focus-on-target": __props.focusOnTarget
  13518. }, {
  13519. default: withCtx(() => [_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)]),
  13520. _: 3
  13521. }, 8, [
  13522. "disabled",
  13523. "trigger",
  13524. "trigger-keys",
  13525. "virtual-ref",
  13526. "virtual-triggering",
  13527. "focus-on-target"
  13528. ]), createVNode(content_default$2, {
  13529. ref_key: "contentRef",
  13530. ref: contentRef,
  13531. "aria-label": __props.ariaLabel,
  13532. "boundaries-padding": __props.boundariesPadding,
  13533. content: __props.content,
  13534. disabled: __props.disabled,
  13535. effect: __props.effect,
  13536. enterable: __props.enterable,
  13537. "fallback-placements": __props.fallbackPlacements,
  13538. "hide-after": __props.hideAfter,
  13539. "gpu-acceleration": __props.gpuAcceleration,
  13540. offset: __props.offset,
  13541. persistent: __props.persistent,
  13542. "popper-class": kls.value,
  13543. "popper-style": __props.popperStyle,
  13544. placement: __props.placement,
  13545. "popper-options": __props.popperOptions,
  13546. "arrow-offset": __props.arrowOffset,
  13547. pure: __props.pure,
  13548. "raw-content": __props.rawContent,
  13549. "reference-el": __props.referenceEl,
  13550. "trigger-target-el": __props.triggerTargetEl,
  13551. "show-after": __props.showAfter,
  13552. strategy: __props.strategy,
  13553. teleported: __props.teleported,
  13554. transition: __props.transition,
  13555. "virtual-triggering": __props.virtualTriggering,
  13556. "z-index": __props.zIndex,
  13557. "append-to": __props.appendTo,
  13558. loop: __props.loop
  13559. }, {
  13560. default: withCtx(() => [renderSlot(_ctx.$slots, "content", {}, () => [__props.rawContent ? (openBlock(), createElementBlock("span", {
  13561. key: 0,
  13562. innerHTML: __props.content
  13563. }, null, 8, _hoisted_1$77)) : (openBlock(), createElementBlock("span", _hoisted_2$43, toDisplayString(__props.content), 1))]), __props.showArrow ? (openBlock(), createBlock(unref(arrow_default), { key: 0 })) : createCommentVNode("v-if", true)]),
  13564. _: 3
  13565. }, 8, [
  13566. "aria-label",
  13567. "boundaries-padding",
  13568. "content",
  13569. "disabled",
  13570. "effect",
  13571. "enterable",
  13572. "fallback-placements",
  13573. "hide-after",
  13574. "gpu-acceleration",
  13575. "offset",
  13576. "persistent",
  13577. "popper-class",
  13578. "popper-style",
  13579. "placement",
  13580. "popper-options",
  13581. "arrow-offset",
  13582. "pure",
  13583. "raw-content",
  13584. "reference-el",
  13585. "trigger-target-el",
  13586. "show-after",
  13587. "strategy",
  13588. "teleported",
  13589. "transition",
  13590. "virtual-triggering",
  13591. "z-index",
  13592. "append-to",
  13593. "loop"
  13594. ])]),
  13595. _: 3
  13596. }, 8, ["role"]);
  13597. };
  13598. }
  13599. });
  13600. //#endregion
  13601. //#region ../../packages/components/tooltip/src/tooltip.vue
  13602. var tooltip_default = tooltip_vue_vue_type_script_setup_true_lang_default;
  13603. //#endregion
  13604. //#region ../../packages/components/tooltip/index.ts
  13605. const ElTooltip = withInstall(tooltip_default);
  13606. //#endregion
  13607. //#region ../../packages/components/input/src/input.ts
  13608. /**
  13609. * @deprecated Removed after 3.0.0, Use `InputProps` instead.
  13610. */
  13611. const inputProps = buildProps({
  13612. id: {
  13613. type: String,
  13614. default: void 0
  13615. },
  13616. size: useSizeProp,
  13617. disabled: {
  13618. type: Boolean,
  13619. default: void 0
  13620. },
  13621. modelValue: {
  13622. type: definePropType([
  13623. String,
  13624. Number,
  13625. Object
  13626. ]),
  13627. default: ""
  13628. },
  13629. modelModifiers: {
  13630. type: definePropType(Object),
  13631. default: () => ({})
  13632. },
  13633. maxlength: { type: [String, Number] },
  13634. minlength: { type: [String, Number] },
  13635. type: {
  13636. type: definePropType(String),
  13637. default: "text"
  13638. },
  13639. resize: {
  13640. type: String,
  13641. values: [
  13642. "none",
  13643. "both",
  13644. "horizontal",
  13645. "vertical"
  13646. ]
  13647. },
  13648. autosize: {
  13649. type: definePropType([Boolean, Object]),
  13650. default: false
  13651. },
  13652. autocomplete: {
  13653. type: definePropType(String),
  13654. default: "off"
  13655. },
  13656. formatter: { type: Function },
  13657. parser: { type: Function },
  13658. placeholder: { type: String },
  13659. form: { type: String },
  13660. readonly: Boolean,
  13661. clearable: Boolean,
  13662. clearIcon: {
  13663. type: iconPropType,
  13664. default: circle_close_default
  13665. },
  13666. showPassword: Boolean,
  13667. showWordLimit: Boolean,
  13668. wordLimitPosition: {
  13669. type: String,
  13670. values: ["inside", "outside"],
  13671. default: "inside"
  13672. },
  13673. suffixIcon: { type: iconPropType },
  13674. prefixIcon: { type: iconPropType },
  13675. containerRole: {
  13676. type: String,
  13677. default: void 0
  13678. },
  13679. tabindex: {
  13680. type: [String, Number],
  13681. default: 0
  13682. },
  13683. validateEvent: {
  13684. type: Boolean,
  13685. default: true
  13686. },
  13687. inputStyle: {
  13688. type: definePropType([
  13689. Object,
  13690. Array,
  13691. String
  13692. ]),
  13693. default: () => mutable({})
  13694. },
  13695. autofocus: Boolean,
  13696. rows: {
  13697. type: Number,
  13698. default: 2
  13699. },
  13700. ...useAriaProps(["ariaLabel"]),
  13701. inputmode: {
  13702. type: definePropType(String),
  13703. default: void 0
  13704. },
  13705. name: String
  13706. });
  13707. const inputEmits = {
  13708. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  13709. input: (value) => isString(value),
  13710. change: (value, evt) => isString(value) && (evt instanceof Event || evt === void 0),
  13711. focus: (evt) => evt instanceof FocusEvent,
  13712. blur: (evt) => evt instanceof FocusEvent,
  13713. clear: (evt) => evt === void 0 || evt instanceof MouseEvent,
  13714. mouseleave: (evt) => evt instanceof MouseEvent,
  13715. mouseenter: (evt) => evt instanceof MouseEvent,
  13716. keydown: (evt) => evt instanceof Event,
  13717. compositionstart: (evt) => evt instanceof CompositionEvent,
  13718. compositionupdate: (evt) => evt instanceof CompositionEvent,
  13719. compositionend: (evt) => evt instanceof CompositionEvent
  13720. };
  13721. /**
  13722. * @description default values for InputProps, used in components that extend InputProps like Autocomplete
  13723. */
  13724. const inputPropsDefaults = {
  13725. disabled: void 0,
  13726. modelValue: "",
  13727. modelModifiers: () => ({}),
  13728. type: "text",
  13729. autocomplete: "off",
  13730. clearIcon: markRaw(circle_close_default),
  13731. wordLimitPosition: "inside",
  13732. tabindex: 0,
  13733. validateEvent: true,
  13734. inputStyle: () => ({}),
  13735. rows: 2
  13736. };
  13737. //#endregion
  13738. //#region ../../packages/components/input/src/utils.ts
  13739. let hiddenTextarea = void 0;
  13740. const HIDDEN_STYLE = {
  13741. height: "0",
  13742. visibility: "hidden",
  13743. overflow: isFirefox() ? "" : "hidden",
  13744. position: "absolute",
  13745. "z-index": "-1000",
  13746. top: "0",
  13747. right: "0"
  13748. };
  13749. const CONTEXT_STYLE = [
  13750. "letter-spacing",
  13751. "line-height",
  13752. "padding-top",
  13753. "padding-bottom",
  13754. "font-family",
  13755. "font-weight",
  13756. "font-size",
  13757. "text-rendering",
  13758. "text-transform",
  13759. "width",
  13760. "text-indent",
  13761. "padding-left",
  13762. "padding-right",
  13763. "border-width",
  13764. "box-sizing",
  13765. "word-break"
  13766. ];
  13767. const looseToNumber = (val) => {
  13768. const n = Number.parseFloat(val);
  13769. return Number.isNaN(n) ? val : n;
  13770. };
  13771. function calculateNodeStyling(targetElement) {
  13772. const style = window.getComputedStyle(targetElement);
  13773. const boxSizing = style.getPropertyValue("box-sizing");
  13774. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  13775. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  13776. return {
  13777. contextStyle: CONTEXT_STYLE.map((name) => [name, style.getPropertyValue(name)]),
  13778. paddingSize,
  13779. borderSize,
  13780. boxSizing
  13781. };
  13782. }
  13783. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  13784. if (!hiddenTextarea) {
  13785. hiddenTextarea = document.createElement("textarea");
  13786. let hostNode = document.body;
  13787. if (!isFirefox() && targetElement.parentNode) hostNode = targetElement.parentNode;
  13788. hostNode.appendChild(hiddenTextarea);
  13789. }
  13790. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  13791. contextStyle.forEach(([key, value]) => hiddenTextarea?.style.setProperty(key, value));
  13792. Object.entries(HIDDEN_STYLE).forEach(([key, value]) => hiddenTextarea?.style.setProperty(key, value, "important"));
  13793. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  13794. let height = hiddenTextarea.scrollHeight;
  13795. const result = {};
  13796. if (boxSizing === "border-box") height = height + borderSize;
  13797. else if (boxSizing === "content-box") height = height - paddingSize;
  13798. hiddenTextarea.value = "";
  13799. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  13800. if (isNumber(minRows)) {
  13801. let minHeight = singleRowHeight * minRows;
  13802. if (boxSizing === "border-box") minHeight = minHeight + paddingSize + borderSize;
  13803. height = Math.max(minHeight, height);
  13804. result.minHeight = `${minHeight}px`;
  13805. }
  13806. if (isNumber(maxRows)) {
  13807. let maxHeight = singleRowHeight * maxRows;
  13808. if (boxSizing === "border-box") maxHeight = maxHeight + paddingSize + borderSize;
  13809. height = Math.min(maxHeight, height);
  13810. }
  13811. result.height = `${height}px`;
  13812. hiddenTextarea.parentNode?.removeChild(hiddenTextarea);
  13813. hiddenTextarea = void 0;
  13814. return result;
  13815. }
  13816. //#endregion
  13817. //#region ../../packages/components/input/src/input.vue?vue&type=script&setup=true&lang.ts
  13818. const _hoisted_1$76 = [
  13819. "id",
  13820. "name",
  13821. "minlength",
  13822. "maxlength",
  13823. "type",
  13824. "disabled",
  13825. "readonly",
  13826. "autocomplete",
  13827. "tabindex",
  13828. "aria-label",
  13829. "placeholder",
  13830. "form",
  13831. "autofocus",
  13832. "role",
  13833. "inputmode"
  13834. ];
  13835. const _hoisted_2$42 = [
  13836. "id",
  13837. "name",
  13838. "minlength",
  13839. "maxlength",
  13840. "tabindex",
  13841. "disabled",
  13842. "readonly",
  13843. "autocomplete",
  13844. "aria-label",
  13845. "placeholder",
  13846. "form",
  13847. "autofocus",
  13848. "rows",
  13849. "role"
  13850. ];
  13851. const COMPONENT_NAME$19 = "ElInput";
  13852. var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  13853. name: COMPONENT_NAME$19,
  13854. inheritAttrs: false,
  13855. __name: "input",
  13856. props: inputProps,
  13857. emits: inputEmits,
  13858. setup(__props, { expose: __expose, emit: __emit }) {
  13859. const props = __props;
  13860. const emit = __emit;
  13861. const rawAttrs = useAttrs$1();
  13862. const attrs = useAttrs();
  13863. const slots = useSlots();
  13864. const containerKls = computed(() => [
  13865. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  13866. nsInput.m(inputSize.value),
  13867. nsInput.is("disabled", inputDisabled.value),
  13868. nsInput.is("exceed", inputExceed.value),
  13869. {
  13870. [nsInput.b("group")]: slots.prepend || slots.append,
  13871. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  13872. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  13873. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value,
  13874. [nsInput.b("hidden")]: props.type === "hidden"
  13875. },
  13876. rawAttrs.class
  13877. ]);
  13878. const wrapperKls = computed(() => [nsInput.e("wrapper"), nsInput.is("focus", isFocused.value)]);
  13879. const { form: elForm, formItem: elFormItem } = useFormItem();
  13880. const { inputId } = useFormItemInputId(props, { formItemContext: elFormItem });
  13881. const inputSize = useFormSize();
  13882. const inputDisabled = useFormDisabled();
  13883. const nsInput = useNamespace("input");
  13884. const nsTextarea = useNamespace("textarea");
  13885. const input = shallowRef();
  13886. const textarea = shallowRef();
  13887. const hovering = ref(false);
  13888. const passwordVisible = ref(false);
  13889. const countStyle = ref();
  13890. const textareaCalcStyle = shallowRef(props.inputStyle);
  13891. const _ref = computed(() => input.value || textarea.value);
  13892. const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(_ref, {
  13893. disabled: inputDisabled,
  13894. afterBlur() {
  13895. if (props.validateEvent) elFormItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  13896. }
  13897. });
  13898. const needStatusIcon = computed(() => elForm?.statusIcon ?? false);
  13899. const validateState = computed(() => elFormItem?.validateState || "");
  13900. const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
  13901. const passwordIcon = computed(() => passwordVisible.value ? view_default : hide_default);
  13902. const containerStyle = computed(() => [rawAttrs.style]);
  13903. const textareaStyle = computed(() => [
  13904. props.inputStyle,
  13905. textareaCalcStyle.value,
  13906. { resize: props.resize }
  13907. ]);
  13908. const nativeInputValue = computed(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  13909. const showClear = computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value));
  13910. const showPwdVisible = computed(() => props.showPassword && !inputDisabled.value && !!nativeInputValue.value);
  13911. const isWordLimitVisible = computed(() => props.showWordLimit && !!props.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  13912. const textLength = computed(() => nativeInputValue.value.length);
  13913. const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(props.maxlength));
  13914. const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  13915. const hasModelModifiers = computed(() => !!Object.keys(props.modelModifiers).length);
  13916. const [recordCursor, setCursor] = useCursor(input);
  13917. useResizeObserver(textarea, (entries) => {
  13918. onceInitSizeTextarea();
  13919. if (!isWordLimitVisible.value || props.resize !== "both" && props.resize !== "horizontal") return;
  13920. const { width } = entries[0].contentRect;
  13921. countStyle.value = { right: `calc(100% - ${width + 22 - 10}px)` };
  13922. });
  13923. const resizeTextarea = () => {
  13924. const { type, autosize } = props;
  13925. if (!isClient || type !== "textarea" || !textarea.value) return;
  13926. if (autosize) {
  13927. const minRows = isObject$1(autosize) ? autosize.minRows : void 0;
  13928. const maxRows = isObject$1(autosize) ? autosize.maxRows : void 0;
  13929. const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows);
  13930. textareaCalcStyle.value = {
  13931. overflowY: "hidden",
  13932. ...textareaStyle
  13933. };
  13934. nextTick(() => {
  13935. textarea.value.offsetHeight;
  13936. textareaCalcStyle.value = textareaStyle;
  13937. });
  13938. } else textareaCalcStyle.value = { minHeight: calcTextareaHeight(textarea.value).minHeight };
  13939. };
  13940. const createOnceInitResize = (resizeTextarea) => {
  13941. let isInit = false;
  13942. return () => {
  13943. if (isInit || !props.autosize) return;
  13944. if (!(textarea.value?.offsetParent === null)) {
  13945. setTimeout(resizeTextarea);
  13946. isInit = true;
  13947. }
  13948. };
  13949. };
  13950. const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
  13951. const setNativeInputValue = () => {
  13952. const input = _ref.value;
  13953. const formatterValue = props.formatter ? props.formatter(nativeInputValue.value) : nativeInputValue.value;
  13954. if (!input || input.value === formatterValue || props.type === "file") return;
  13955. input.value = formatterValue;
  13956. };
  13957. const formatValue = (value) => {
  13958. const { trim, number } = props.modelModifiers;
  13959. if (trim) value = value.trim();
  13960. if (number) value = `${looseToNumber(value)}`;
  13961. if (props.formatter && props.parser) value = props.parser(value);
  13962. return value;
  13963. };
  13964. const handleInput = async (event) => {
  13965. if (isComposing.value) return;
  13966. const { lazy } = props.modelModifiers;
  13967. let { value } = event.target;
  13968. if (lazy) {
  13969. emit(INPUT_EVENT, value);
  13970. return;
  13971. }
  13972. value = formatValue(value);
  13973. if (String(value) === nativeInputValue.value) {
  13974. if (props.formatter) setNativeInputValue();
  13975. return;
  13976. }
  13977. recordCursor();
  13978. emit(UPDATE_MODEL_EVENT, value);
  13979. emit(INPUT_EVENT, value);
  13980. await nextTick();
  13981. if (props.formatter && props.parser || !hasModelModifiers.value) setNativeInputValue();
  13982. setCursor();
  13983. };
  13984. const handleChange = async (event) => {
  13985. let { value } = event.target;
  13986. value = formatValue(value);
  13987. if (props.modelModifiers.lazy) emit(UPDATE_MODEL_EVENT, value);
  13988. emit(CHANGE_EVENT, value, event);
  13989. await nextTick();
  13990. setNativeInputValue();
  13991. };
  13992. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({
  13993. emit,
  13994. afterComposition: handleInput
  13995. });
  13996. const handlePasswordVisible = () => {
  13997. passwordVisible.value = !passwordVisible.value;
  13998. };
  13999. const focus = () => _ref.value?.focus();
  14000. const blur = () => _ref.value?.blur();
  14001. const handleMouseLeave = (evt) => {
  14002. hovering.value = false;
  14003. emit("mouseleave", evt);
  14004. };
  14005. const handleMouseEnter = (evt) => {
  14006. hovering.value = true;
  14007. emit("mouseenter", evt);
  14008. };
  14009. const handleKeydown = (evt) => {
  14010. emit("keydown", evt);
  14011. };
  14012. const select = () => {
  14013. _ref.value?.select();
  14014. };
  14015. const clear = (evt) => {
  14016. emit(UPDATE_MODEL_EVENT, "");
  14017. emit(CHANGE_EVENT, "");
  14018. emit("clear", evt);
  14019. emit(INPUT_EVENT, "");
  14020. };
  14021. watch(() => props.modelValue, () => {
  14022. nextTick(() => resizeTextarea());
  14023. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  14024. });
  14025. watch(nativeInputValue, (newValue) => {
  14026. if (!_ref.value) return;
  14027. const { trim, number } = props.modelModifiers;
  14028. const elValue = _ref.value.value;
  14029. const displayValue = (number || props.type === "number") && !/^0\d/.test(elValue) ? `${looseToNumber(elValue)}` : elValue;
  14030. if (displayValue === newValue) return;
  14031. if (document.activeElement === _ref.value && _ref.value.type !== "range") {
  14032. if (trim && displayValue.trim() === newValue) return;
  14033. }
  14034. setNativeInputValue();
  14035. });
  14036. watch(() => props.type, async () => {
  14037. await nextTick();
  14038. setNativeInputValue();
  14039. resizeTextarea();
  14040. });
  14041. onMounted(() => {
  14042. if (!props.formatter && props.parser) /* @__PURE__ */ debugWarn(COMPONENT_NAME$19, "If you set the parser, you also need to set the formatter.");
  14043. setNativeInputValue();
  14044. nextTick(resizeTextarea);
  14045. });
  14046. __expose({
  14047. input,
  14048. textarea,
  14049. ref: _ref,
  14050. textareaStyle,
  14051. autosize: toRef(props, "autosize"),
  14052. isComposing,
  14053. focus,
  14054. blur,
  14055. select,
  14056. clear,
  14057. resizeTextarea
  14058. });
  14059. return (_ctx, _cache) => {
  14060. return openBlock(), createElementBlock("div", {
  14061. class: normalizeClass([containerKls.value, {
  14062. [unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
  14063. [unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend
  14064. }]),
  14065. style: normalizeStyle(containerStyle.value),
  14066. onMouseenter: handleMouseEnter,
  14067. onMouseleave: handleMouseLeave
  14068. }, [createCommentVNode(" input "), __props.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  14069. createCommentVNode(" prepend slot "),
  14070. _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
  14071. key: 0,
  14072. class: normalizeClass(unref(nsInput).be("group", "prepend"))
  14073. }, [renderSlot(_ctx.$slots, "prepend")], 2)) : createCommentVNode("v-if", true),
  14074. createElementVNode("div", {
  14075. ref_key: "wrapperRef",
  14076. ref: wrapperRef,
  14077. class: normalizeClass(wrapperKls.value)
  14078. }, [
  14079. createCommentVNode(" prefix slot "),
  14080. _ctx.$slots.prefix || __props.prefixIcon ? (openBlock(), createElementBlock("span", {
  14081. key: 0,
  14082. class: normalizeClass(unref(nsInput).e("prefix"))
  14083. }, [createElementVNode("span", { class: normalizeClass(unref(nsInput).e("prefix-inner")) }, [renderSlot(_ctx.$slots, "prefix"), __props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  14084. key: 0,
  14085. class: normalizeClass(unref(nsInput).e("icon"))
  14086. }, {
  14087. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))]),
  14088. _: 1
  14089. }, 8, ["class"])) : createCommentVNode("v-if", true)], 2)], 2)) : createCommentVNode("v-if", true),
  14090. createElementVNode("input", mergeProps({
  14091. id: unref(inputId),
  14092. ref_key: "input",
  14093. ref: input,
  14094. class: unref(nsInput).e("inner")
  14095. }, unref(attrs), {
  14096. name: __props.name,
  14097. minlength: __props.minlength,
  14098. maxlength: __props.maxlength,
  14099. type: __props.showPassword ? passwordVisible.value ? "text" : "password" : __props.type,
  14100. disabled: unref(inputDisabled),
  14101. readonly: __props.readonly,
  14102. autocomplete: __props.autocomplete,
  14103. tabindex: __props.tabindex,
  14104. "aria-label": __props.ariaLabel,
  14105. placeholder: __props.placeholder,
  14106. style: __props.inputStyle,
  14107. form: __props.form,
  14108. autofocus: __props.autofocus,
  14109. role: __props.containerRole,
  14110. inputmode: __props.inputmode,
  14111. onCompositionstart: _cache[0] || (_cache[0] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
  14112. onCompositionupdate: _cache[1] || (_cache[1] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
  14113. onCompositionend: _cache[2] || (_cache[2] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
  14114. onInput: handleInput,
  14115. onChange: handleChange,
  14116. onKeydown: handleKeydown
  14117. }), null, 16, _hoisted_1$76),
  14118. createCommentVNode(" suffix slot "),
  14119. suffixVisible.value ? (openBlock(), createElementBlock("span", {
  14120. key: 1,
  14121. class: normalizeClass(unref(nsInput).e("suffix"))
  14122. }, [createElementVNode("span", { class: normalizeClass(unref(nsInput).e("suffix-inner")) }, [
  14123. !showClear.value || !showPwdVisible.value || !isWordLimitVisible.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [renderSlot(_ctx.$slots, "suffix"), __props.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  14124. key: 0,
  14125. class: normalizeClass(unref(nsInput).e("icon"))
  14126. }, {
  14127. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.suffixIcon)))]),
  14128. _: 1
  14129. }, 8, ["class"])) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true),
  14130. showClear.value ? (openBlock(), createBlock(unref(ElIcon), {
  14131. key: 1,
  14132. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
  14133. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  14134. onClick: clear
  14135. }, {
  14136. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]),
  14137. _: 1
  14138. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
  14139. showPwdVisible.value ? (openBlock(), createBlock(unref(ElIcon), {
  14140. key: 2,
  14141. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
  14142. onClick: handlePasswordVisible,
  14143. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  14144. onMouseup: withModifiers(unref(NOOP), ["prevent"])
  14145. }, {
  14146. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(passwordIcon.value)))]),
  14147. _: 1
  14148. }, 8, [
  14149. "class",
  14150. "onMousedown",
  14151. "onMouseup"
  14152. ])) : createCommentVNode("v-if", true),
  14153. isWordLimitVisible.value ? (openBlock(), createElementBlock("span", {
  14154. key: 3,
  14155. class: normalizeClass([unref(nsInput).e("count"), unref(nsInput).is("outside", __props.wordLimitPosition === "outside")])
  14156. }, [createElementVNode("span", { class: normalizeClass(unref(nsInput).e("count-inner")) }, toDisplayString(textLength.value) + " / " + toDisplayString(__props.maxlength), 3)], 2)) : createCommentVNode("v-if", true),
  14157. validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
  14158. key: 4,
  14159. class: normalizeClass([
  14160. unref(nsInput).e("icon"),
  14161. unref(nsInput).e("validateIcon"),
  14162. unref(nsInput).is("loading", validateState.value === "validating")
  14163. ])
  14164. }, {
  14165. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))]),
  14166. _: 1
  14167. }, 8, ["class"])) : createCommentVNode("v-if", true)
  14168. ], 2)], 2)) : createCommentVNode("v-if", true)
  14169. ], 2),
  14170. createCommentVNode(" append slot "),
  14171. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  14172. key: 1,
  14173. class: normalizeClass(unref(nsInput).be("group", "append"))
  14174. }, [renderSlot(_ctx.$slots, "append")], 2)) : createCommentVNode("v-if", true)
  14175. ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  14176. createCommentVNode(" textarea "),
  14177. createElementVNode("textarea", mergeProps({
  14178. id: unref(inputId),
  14179. ref_key: "textarea",
  14180. ref: textarea,
  14181. class: [
  14182. unref(nsTextarea).e("inner"),
  14183. unref(nsInput).is("focus", unref(isFocused)),
  14184. unref(nsTextarea).is("clearable", __props.clearable)
  14185. ]
  14186. }, unref(attrs), {
  14187. name: __props.name,
  14188. minlength: __props.minlength,
  14189. maxlength: __props.maxlength,
  14190. tabindex: __props.tabindex,
  14191. disabled: unref(inputDisabled),
  14192. readonly: __props.readonly,
  14193. autocomplete: __props.autocomplete,
  14194. style: textareaStyle.value,
  14195. "aria-label": __props.ariaLabel,
  14196. placeholder: __props.placeholder,
  14197. form: __props.form,
  14198. autofocus: __props.autofocus,
  14199. rows: __props.rows,
  14200. role: __props.containerRole,
  14201. onCompositionstart: _cache[3] || (_cache[3] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
  14202. onCompositionupdate: _cache[4] || (_cache[4] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
  14203. onCompositionend: _cache[5] || (_cache[5] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
  14204. onInput: handleInput,
  14205. onFocus: _cache[6] || (_cache[6] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  14206. onBlur: _cache[7] || (_cache[7] = (...args) => unref(handleBlur) && unref(handleBlur)(...args)),
  14207. onChange: handleChange,
  14208. onKeydown: handleKeydown
  14209. }), null, 16, _hoisted_2$42),
  14210. showClear.value ? (openBlock(), createBlock(unref(ElIcon), {
  14211. key: 0,
  14212. class: normalizeClass([unref(nsTextarea).e("icon"), unref(nsTextarea).e("clear")]),
  14213. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  14214. onClick: clear
  14215. }, {
  14216. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]),
  14217. _: 1
  14218. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
  14219. isWordLimitVisible.value ? (openBlock(), createElementBlock("span", {
  14220. key: 1,
  14221. style: normalizeStyle(countStyle.value),
  14222. class: normalizeClass([unref(nsInput).e("count"), unref(nsInput).is("outside", __props.wordLimitPosition === "outside")])
  14223. }, toDisplayString(textLength.value) + " / " + toDisplayString(__props.maxlength), 7)) : createCommentVNode("v-if", true)
  14224. ], 64))], 38);
  14225. };
  14226. }
  14227. });
  14228. //#endregion
  14229. //#region ../../packages/components/input/src/input.vue
  14230. var input_default = input_vue_vue_type_script_setup_true_lang_default;
  14231. //#endregion
  14232. //#region ../../packages/components/input/index.ts
  14233. const ElInput = withInstall(input_default);
  14234. //#endregion
  14235. //#region ../../packages/components/autocomplete/src/autocomplete.ts
  14236. /**
  14237. * @deprecated Removed after 3.0.0, Use `AutocompleteProps` instead.
  14238. */
  14239. const autocompleteProps = buildProps({
  14240. ...inputProps,
  14241. valueKey: {
  14242. type: String,
  14243. default: "value"
  14244. },
  14245. modelValue: {
  14246. type: [String, Number],
  14247. default: ""
  14248. },
  14249. debounce: {
  14250. type: Number,
  14251. default: 300
  14252. },
  14253. placement: {
  14254. type: definePropType(String),
  14255. values: [
  14256. "top",
  14257. "top-start",
  14258. "top-end",
  14259. "bottom",
  14260. "bottom-start",
  14261. "bottom-end"
  14262. ],
  14263. default: "bottom-start"
  14264. },
  14265. fetchSuggestions: {
  14266. type: definePropType([Function, Array]),
  14267. default: NOOP
  14268. },
  14269. popperClass: useTooltipContentProps.popperClass,
  14270. popperStyle: useTooltipContentProps.popperStyle,
  14271. triggerOnFocus: {
  14272. type: Boolean,
  14273. default: true
  14274. },
  14275. selectWhenUnmatched: Boolean,
  14276. hideLoading: Boolean,
  14277. teleported: useTooltipContentProps.teleported,
  14278. appendTo: useTooltipContentProps.appendTo,
  14279. highlightFirstItem: Boolean,
  14280. fitInputWidth: Boolean,
  14281. loopNavigation: {
  14282. type: Boolean,
  14283. default: true
  14284. }
  14285. });
  14286. const autocompleteEmits = {
  14287. [UPDATE_MODEL_EVENT]: (value) => isString(value) || isNumber(value),
  14288. [INPUT_EVENT]: (value) => isString(value) || isNumber(value),
  14289. [CHANGE_EVENT]: (value) => isString(value) || isNumber(value),
  14290. focus: (evt) => evt instanceof FocusEvent,
  14291. blur: (evt) => evt instanceof FocusEvent,
  14292. clear: () => true,
  14293. select: (item) => isObject$1(item)
  14294. };
  14295. //#endregion
  14296. //#region ../../packages/components/scrollbar/src/scrollbar.ts
  14297. /**
  14298. * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
  14299. */
  14300. const scrollbarProps = buildProps({
  14301. distance: {
  14302. type: Number,
  14303. default: 0
  14304. },
  14305. height: {
  14306. type: [String, Number],
  14307. default: ""
  14308. },
  14309. maxHeight: {
  14310. type: [String, Number],
  14311. default: ""
  14312. },
  14313. native: Boolean,
  14314. wrapStyle: {
  14315. type: definePropType([
  14316. String,
  14317. Object,
  14318. Array
  14319. ]),
  14320. default: ""
  14321. },
  14322. wrapClass: {
  14323. type: [String, Array],
  14324. default: ""
  14325. },
  14326. viewClass: {
  14327. type: [String, Array],
  14328. default: ""
  14329. },
  14330. viewStyle: {
  14331. type: [
  14332. String,
  14333. Array,
  14334. Object
  14335. ],
  14336. default: ""
  14337. },
  14338. noresize: Boolean,
  14339. tag: {
  14340. type: String,
  14341. default: "div"
  14342. },
  14343. always: Boolean,
  14344. minSize: {
  14345. type: Number,
  14346. default: 20
  14347. },
  14348. tabindex: {
  14349. type: [String, Number],
  14350. default: void 0
  14351. },
  14352. id: String,
  14353. role: String,
  14354. ...useAriaProps(["ariaLabel", "ariaOrientation"])
  14355. });
  14356. const scrollbarEmits = {
  14357. "end-reached": (direction) => [
  14358. "left",
  14359. "right",
  14360. "top",
  14361. "bottom"
  14362. ].includes(direction),
  14363. scroll: ({ scrollTop, scrollLeft }) => [scrollTop, scrollLeft].every(isNumber)
  14364. };
  14365. //#endregion
  14366. //#region ../../packages/components/scrollbar/src/bar.ts
  14367. /**
  14368. * @deprecated Removed after 3.0.0, Use `BarProps` instead.
  14369. */
  14370. const barProps = buildProps({
  14371. always: {
  14372. type: Boolean,
  14373. default: true
  14374. },
  14375. minSize: {
  14376. type: Number,
  14377. required: true
  14378. }
  14379. });
  14380. //#endregion
  14381. //#region ../../packages/components/scrollbar/src/util.ts
  14382. const GAP = 4;
  14383. const BAR_MAP = {
  14384. vertical: {
  14385. offset: "offsetHeight",
  14386. scroll: "scrollTop",
  14387. scrollSize: "scrollHeight",
  14388. size: "height",
  14389. key: "vertical",
  14390. axis: "Y",
  14391. client: "clientY",
  14392. direction: "top"
  14393. },
  14394. horizontal: {
  14395. offset: "offsetWidth",
  14396. scroll: "scrollLeft",
  14397. scrollSize: "scrollWidth",
  14398. size: "width",
  14399. key: "horizontal",
  14400. axis: "X",
  14401. client: "clientX",
  14402. direction: "left"
  14403. }
  14404. };
  14405. const renderThumbStyle = ({ move, size, bar }) => ({
  14406. [bar.size]: size,
  14407. transform: `translate${bar.axis}(${move}%)`
  14408. });
  14409. //#endregion
  14410. //#region ../../packages/components/scrollbar/src/thumb.ts
  14411. /**
  14412. * @deprecated Removed after 3.0.0, Use `ThumbProps` instead.
  14413. */
  14414. const thumbProps = buildProps({
  14415. vertical: Boolean,
  14416. size: String,
  14417. move: Number,
  14418. ratio: {
  14419. type: Number,
  14420. required: true
  14421. },
  14422. always: Boolean
  14423. });
  14424. //#endregion
  14425. //#region ../../packages/components/scrollbar/src/constants.ts
  14426. const scrollbarContextKey = Symbol("scrollbarContextKey");
  14427. //#endregion
  14428. //#region ../../packages/components/scrollbar/src/thumb.vue?vue&type=script&setup=true&lang.ts
  14429. const COMPONENT_NAME$18 = "Thumb";
  14430. var thumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  14431. __name: "thumb",
  14432. props: thumbProps,
  14433. setup(__props) {
  14434. const props = __props;
  14435. const scrollbar = inject(scrollbarContextKey);
  14436. const ns = useNamespace("scrollbar");
  14437. if (!scrollbar) throwError(COMPONENT_NAME$18, "can not inject scrollbar context");
  14438. const instance = ref();
  14439. const thumb = ref();
  14440. const thumbState = ref({});
  14441. const visible = ref(false);
  14442. let cursorDown = false;
  14443. let cursorLeave = false;
  14444. let baseScrollHeight = 0;
  14445. let baseScrollWidth = 0;
  14446. let originalOnSelectStart = isClient ? document.onselectstart : null;
  14447. const bar = computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  14448. const thumbStyle = computed(() => renderThumbStyle({
  14449. size: props.size,
  14450. move: props.move,
  14451. bar: bar.value
  14452. }));
  14453. const offsetRatio = computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  14454. const clickThumbHandler = (e) => {
  14455. e.stopPropagation();
  14456. if (e.ctrlKey || [1, 2].includes(e.button)) return;
  14457. window.getSelection()?.removeAllRanges();
  14458. startDrag(e);
  14459. const el = e.currentTarget;
  14460. if (!el) return;
  14461. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  14462. };
  14463. const clickTrackHandler = (e) => {
  14464. if (!thumb.value || !instance.value || !scrollbar.wrapElement) return;
  14465. const thumbPositionPercentage = (Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumb.value[bar.value.offset] / 2) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  14466. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  14467. };
  14468. const startDrag = (e) => {
  14469. e.stopImmediatePropagation();
  14470. cursorDown = true;
  14471. baseScrollHeight = scrollbar.wrapElement.scrollHeight;
  14472. baseScrollWidth = scrollbar.wrapElement.scrollWidth;
  14473. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  14474. document.addEventListener("mouseup", mouseUpDocumentHandler);
  14475. originalOnSelectStart = document.onselectstart;
  14476. document.onselectstart = () => false;
  14477. };
  14478. const mouseMoveDocumentHandler = (e) => {
  14479. if (!instance.value || !thumb.value) return;
  14480. if (cursorDown === false) return;
  14481. const prevPage = thumbState.value[bar.value.axis];
  14482. if (!prevPage) return;
  14483. const thumbPositionPercentage = ((instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumb.value[bar.value.offset] - prevPage)) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  14484. if (bar.value.scroll === "scrollLeft") scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollWidth / 100;
  14485. else scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollHeight / 100;
  14486. };
  14487. const mouseUpDocumentHandler = () => {
  14488. cursorDown = false;
  14489. thumbState.value[bar.value.axis] = 0;
  14490. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  14491. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  14492. restoreOnselectstart();
  14493. if (cursorLeave) visible.value = false;
  14494. };
  14495. const mouseMoveScrollbarHandler = () => {
  14496. cursorLeave = false;
  14497. visible.value = !!props.size;
  14498. };
  14499. const mouseLeaveScrollbarHandler = () => {
  14500. cursorLeave = true;
  14501. visible.value = cursorDown;
  14502. };
  14503. onBeforeUnmount(() => {
  14504. restoreOnselectstart();
  14505. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  14506. });
  14507. const restoreOnselectstart = () => {
  14508. if (document.onselectstart !== originalOnSelectStart) document.onselectstart = originalOnSelectStart;
  14509. };
  14510. useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  14511. useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  14512. return (_ctx, _cache) => {
  14513. return openBlock(), createBlock(Transition, {
  14514. name: unref(ns).b("fade"),
  14515. persisted: ""
  14516. }, {
  14517. default: withCtx(() => [withDirectives(createElementVNode("div", {
  14518. ref_key: "instance",
  14519. ref: instance,
  14520. class: normalizeClass([unref(ns).e("bar"), unref(ns).is(bar.value.key)]),
  14521. onMousedown: clickTrackHandler,
  14522. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  14523. }, [createElementVNode("div", {
  14524. ref_key: "thumb",
  14525. ref: thumb,
  14526. class: normalizeClass(unref(ns).e("thumb")),
  14527. style: normalizeStyle(thumbStyle.value),
  14528. onMousedown: clickThumbHandler
  14529. }, null, 38)], 34), [[vShow, __props.always || visible.value]])]),
  14530. _: 1
  14531. }, 8, ["name"]);
  14532. };
  14533. }
  14534. });
  14535. //#endregion
  14536. //#region ../../packages/components/scrollbar/src/thumb.vue
  14537. var thumb_default = thumb_vue_vue_type_script_setup_true_lang_default;
  14538. //#endregion
  14539. //#region ../../packages/components/scrollbar/src/bar.vue?vue&type=script&setup=true&lang.ts
  14540. var bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  14541. __name: "bar",
  14542. props: barProps,
  14543. setup(__props, { expose: __expose }) {
  14544. const props = __props;
  14545. const scrollbar = inject(scrollbarContextKey);
  14546. const moveX = ref(0);
  14547. const moveY = ref(0);
  14548. const sizeWidth = ref("");
  14549. const sizeHeight = ref("");
  14550. const ratioY = ref(1);
  14551. const ratioX = ref(1);
  14552. const handleScroll = (wrap) => {
  14553. if (wrap) {
  14554. const offsetHeight = wrap.offsetHeight - GAP;
  14555. const offsetWidth = wrap.offsetWidth - GAP;
  14556. moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
  14557. moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
  14558. }
  14559. };
  14560. const update = () => {
  14561. const wrap = scrollbar?.wrapElement;
  14562. if (!wrap) return;
  14563. const offsetHeight = wrap.offsetHeight - GAP;
  14564. const offsetWidth = wrap.offsetWidth - GAP;
  14565. const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
  14566. const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
  14567. const height = Math.max(originalHeight, props.minSize);
  14568. const width = Math.max(originalWidth, props.minSize);
  14569. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
  14570. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
  14571. sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
  14572. sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
  14573. };
  14574. __expose({
  14575. handleScroll,
  14576. update
  14577. });
  14578. return (_ctx, _cache) => {
  14579. return openBlock(), createElementBlock(Fragment, null, [createVNode(thumb_default, {
  14580. move: moveX.value,
  14581. ratio: ratioX.value,
  14582. size: sizeWidth.value,
  14583. always: __props.always
  14584. }, null, 8, [
  14585. "move",
  14586. "ratio",
  14587. "size",
  14588. "always"
  14589. ]), createVNode(thumb_default, {
  14590. move: moveY.value,
  14591. ratio: ratioY.value,
  14592. size: sizeHeight.value,
  14593. vertical: "",
  14594. always: __props.always
  14595. }, null, 8, [
  14596. "move",
  14597. "ratio",
  14598. "size",
  14599. "always"
  14600. ])], 64);
  14601. };
  14602. }
  14603. });
  14604. //#endregion
  14605. //#region ../../packages/components/scrollbar/src/bar.vue
  14606. var bar_default = bar_vue_vue_type_script_setup_true_lang_default;
  14607. //#endregion
  14608. //#region ../../packages/components/scrollbar/src/scrollbar.vue?vue&type=script&setup=true&lang.ts
  14609. const _hoisted_1$75 = ["tabindex"];
  14610. const COMPONENT_NAME$17 = "ElScrollbar";
  14611. var scrollbar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  14612. name: COMPONENT_NAME$17,
  14613. __name: "scrollbar",
  14614. props: scrollbarProps,
  14615. emits: scrollbarEmits,
  14616. setup(__props, { expose: __expose, emit: __emit }) {
  14617. const props = __props;
  14618. const emit = __emit;
  14619. const ns = useNamespace("scrollbar");
  14620. let stopResizeObserver = void 0;
  14621. let stopWrapResizeObserver = void 0;
  14622. let stopResizeListener = void 0;
  14623. let wrapScrollTop = 0;
  14624. let wrapScrollLeft = 0;
  14625. let direction = "";
  14626. const distanceScrollState = {
  14627. bottom: false,
  14628. top: false,
  14629. right: false,
  14630. left: false
  14631. };
  14632. const scrollbarRef = ref();
  14633. const wrapRef = ref();
  14634. const resizeRef = ref();
  14635. const barRef = ref();
  14636. const wrapStyle = computed(() => {
  14637. const style = {};
  14638. const height = addUnit(props.height);
  14639. const maxHeight = addUnit(props.maxHeight);
  14640. if (height) style.height = height;
  14641. if (maxHeight) style.maxHeight = maxHeight;
  14642. return [props.wrapStyle, style];
  14643. });
  14644. const wrapKls = computed(() => {
  14645. return [
  14646. props.wrapClass,
  14647. ns.e("wrap"),
  14648. { [ns.em("wrap", "hidden-default")]: !props.native }
  14649. ];
  14650. });
  14651. const resizeKls = computed(() => {
  14652. return [ns.e("view"), props.viewClass];
  14653. });
  14654. const shouldSkipDirection = (direction) => {
  14655. return distanceScrollState[direction] ?? false;
  14656. };
  14657. const DIRECTION_PAIRS = {
  14658. top: "bottom",
  14659. bottom: "top",
  14660. left: "right",
  14661. right: "left"
  14662. };
  14663. const updateTriggerStatus = (arrivedStates) => {
  14664. const oppositeDirection = DIRECTION_PAIRS[direction];
  14665. if (!oppositeDirection) return;
  14666. const arrived = arrivedStates[direction];
  14667. const oppositeArrived = arrivedStates[oppositeDirection];
  14668. if (arrived && !distanceScrollState[direction]) distanceScrollState[direction] = true;
  14669. if (!oppositeArrived && distanceScrollState[oppositeDirection]) distanceScrollState[oppositeDirection] = false;
  14670. };
  14671. const handleScroll = () => {
  14672. if (wrapRef.value) {
  14673. barRef.value?.handleScroll(wrapRef.value);
  14674. const prevTop = wrapScrollTop;
  14675. const prevLeft = wrapScrollLeft;
  14676. wrapScrollTop = wrapRef.value.scrollTop;
  14677. wrapScrollLeft = wrapRef.value.scrollLeft;
  14678. const arrivedStates = {
  14679. bottom: wrapScrollTop + wrapRef.value.clientHeight >= wrapRef.value.scrollHeight - props.distance,
  14680. top: wrapScrollTop <= props.distance && prevTop !== 0,
  14681. right: wrapScrollLeft + wrapRef.value.clientWidth >= wrapRef.value.scrollWidth - props.distance && prevLeft !== wrapScrollLeft,
  14682. left: wrapScrollLeft <= props.distance && prevLeft !== 0
  14683. };
  14684. emit("scroll", {
  14685. scrollTop: wrapScrollTop,
  14686. scrollLeft: wrapScrollLeft
  14687. });
  14688. if (prevTop !== wrapScrollTop) direction = wrapScrollTop > prevTop ? "bottom" : "top";
  14689. if (prevLeft !== wrapScrollLeft) direction = wrapScrollLeft > prevLeft ? "right" : "left";
  14690. if (props.distance > 0) {
  14691. if (shouldSkipDirection(direction)) return;
  14692. updateTriggerStatus(arrivedStates);
  14693. }
  14694. if (arrivedStates[direction]) emit("end-reached", direction);
  14695. }
  14696. };
  14697. function scrollTo(arg1, arg2) {
  14698. if (isObject$1(arg1)) wrapRef.value.scrollTo(arg1);
  14699. else if (isNumber(arg1) && isNumber(arg2)) wrapRef.value.scrollTo(arg1, arg2);
  14700. }
  14701. const setScrollTop = (value) => {
  14702. if (!isNumber(value)) {
  14703. /* @__PURE__ */ debugWarn(COMPONENT_NAME$17, "value must be a number");
  14704. return;
  14705. }
  14706. wrapRef.value.scrollTop = value;
  14707. };
  14708. const setScrollLeft = (value) => {
  14709. if (!isNumber(value)) {
  14710. /* @__PURE__ */ debugWarn(COMPONENT_NAME$17, "value must be a number");
  14711. return;
  14712. }
  14713. wrapRef.value.scrollLeft = value;
  14714. };
  14715. const update = () => {
  14716. barRef.value?.update();
  14717. distanceScrollState[direction] = false;
  14718. };
  14719. watch(() => props.noresize, (noresize) => {
  14720. if (noresize) {
  14721. stopResizeObserver?.();
  14722. stopWrapResizeObserver?.();
  14723. stopResizeListener?.();
  14724. } else {
  14725. ({stop: stopResizeObserver} = useResizeObserver(resizeRef, update));
  14726. ({stop: stopWrapResizeObserver} = useResizeObserver(wrapRef, update));
  14727. stopResizeListener = useEventListener("resize", update);
  14728. }
  14729. }, { immediate: true });
  14730. watch(() => [props.maxHeight, props.height], () => {
  14731. if (!props.native) nextTick(() => {
  14732. update();
  14733. if (wrapRef.value) barRef.value?.handleScroll(wrapRef.value);
  14734. });
  14735. });
  14736. provide(scrollbarContextKey, reactive({
  14737. scrollbarElement: scrollbarRef,
  14738. wrapElement: wrapRef
  14739. }));
  14740. onActivated(() => {
  14741. if (wrapRef.value) {
  14742. wrapRef.value.scrollTop = wrapScrollTop;
  14743. wrapRef.value.scrollLeft = wrapScrollLeft;
  14744. }
  14745. });
  14746. onMounted(() => {
  14747. if (!props.native) nextTick(() => {
  14748. update();
  14749. });
  14750. });
  14751. onUpdated(() => update());
  14752. __expose({
  14753. wrapRef,
  14754. update,
  14755. scrollTo,
  14756. setScrollTop,
  14757. setScrollLeft,
  14758. handleScroll
  14759. });
  14760. return (_ctx, _cache) => {
  14761. return openBlock(), createElementBlock("div", {
  14762. ref_key: "scrollbarRef",
  14763. ref: scrollbarRef,
  14764. class: normalizeClass(unref(ns).b())
  14765. }, [createElementVNode("div", {
  14766. ref_key: "wrapRef",
  14767. ref: wrapRef,
  14768. class: normalizeClass(wrapKls.value),
  14769. style: normalizeStyle(wrapStyle.value),
  14770. tabindex: __props.tabindex,
  14771. onScroll: handleScroll
  14772. }, [(openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
  14773. id: __props.id,
  14774. ref_key: "resizeRef",
  14775. ref: resizeRef,
  14776. class: normalizeClass(resizeKls.value),
  14777. style: normalizeStyle(__props.viewStyle),
  14778. role: __props.role,
  14779. "aria-label": __props.ariaLabel,
  14780. "aria-orientation": __props.ariaOrientation
  14781. }, {
  14782. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  14783. _: 3
  14784. }, 8, [
  14785. "id",
  14786. "class",
  14787. "style",
  14788. "role",
  14789. "aria-label",
  14790. "aria-orientation"
  14791. ]))], 46, _hoisted_1$75), !__props.native ? (openBlock(), createBlock(bar_default, {
  14792. key: 0,
  14793. ref_key: "barRef",
  14794. ref: barRef,
  14795. always: __props.always,
  14796. "min-size": __props.minSize
  14797. }, null, 8, ["always", "min-size"])) : createCommentVNode("v-if", true)], 2);
  14798. };
  14799. }
  14800. });
  14801. //#endregion
  14802. //#region ../../packages/components/scrollbar/src/scrollbar.vue
  14803. var scrollbar_default = scrollbar_vue_vue_type_script_setup_true_lang_default;
  14804. //#endregion
  14805. //#region ../../packages/components/scrollbar/index.ts
  14806. const ElScrollbar = withInstall(scrollbar_default);
  14807. //#endregion
  14808. //#region ../../packages/components/autocomplete/src/autocomplete.vue?vue&type=script&setup=true&lang.ts
  14809. const _hoisted_1$74 = ["aria-expanded", "aria-owns"];
  14810. const _hoisted_2$41 = { key: 0 };
  14811. const _hoisted_3$18 = [
  14812. "id",
  14813. "aria-selected",
  14814. "onClick"
  14815. ];
  14816. const COMPONENT_NAME$16 = "ElAutocomplete";
  14817. var autocomplete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  14818. name: COMPONENT_NAME$16,
  14819. inheritAttrs: false,
  14820. __name: "autocomplete",
  14821. props: autocompleteProps,
  14822. emits: autocompleteEmits,
  14823. setup(__props, { expose: __expose, emit: __emit }) {
  14824. const props = __props;
  14825. const emit = __emit;
  14826. const passInputProps = computed(() => pick(props, Object.keys(inputProps)));
  14827. const rawAttrs = useAttrs$1();
  14828. const disabled = useFormDisabled();
  14829. const ns = useNamespace("autocomplete");
  14830. const inputRef = ref();
  14831. const regionRef = ref();
  14832. const popperRef = ref();
  14833. const listboxRef = ref();
  14834. let readonly = false;
  14835. let ignoreFocusEvent = false;
  14836. const suggestions = ref([]);
  14837. const highlightedIndex = ref(-1);
  14838. const dropdownWidth = ref("");
  14839. const activated = ref(false);
  14840. const suggestionDisabled = ref(false);
  14841. const loading = ref(false);
  14842. const listboxId = useId();
  14843. const styles = computed(() => rawAttrs.style);
  14844. const suggestionVisible = computed(() => {
  14845. return (suggestions.value.length > 0 || loading.value) && activated.value;
  14846. });
  14847. const suggestionLoading = computed(() => !props.hideLoading && loading.value);
  14848. const refInput = computed(() => {
  14849. if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input"));
  14850. return [];
  14851. });
  14852. const onSuggestionShow = () => {
  14853. if (suggestionVisible.value) dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
  14854. };
  14855. const onHide = () => {
  14856. highlightedIndex.value = -1;
  14857. };
  14858. const getData = async (queryString) => {
  14859. if (suggestionDisabled.value) return;
  14860. const cb = (suggestionList) => {
  14861. loading.value = false;
  14862. if (suggestionDisabled.value) return;
  14863. if (isArray$1(suggestionList)) {
  14864. suggestions.value = suggestionList;
  14865. highlightedIndex.value = props.highlightFirstItem ? 0 : -1;
  14866. } else throwError(COMPONENT_NAME$16, "autocomplete suggestions must be an array");
  14867. };
  14868. loading.value = true;
  14869. if (isArray$1(props.fetchSuggestions)) cb(props.fetchSuggestions);
  14870. else {
  14871. const result = await props.fetchSuggestions(queryString, cb);
  14872. if (isArray$1(result)) cb(result);
  14873. }
  14874. };
  14875. const debouncedGetData = useDebounceFn(getData, computed(() => props.debounce));
  14876. const handleInput = (value) => {
  14877. const valuePresented = !!value;
  14878. emit(INPUT_EVENT, value);
  14879. emit(UPDATE_MODEL_EVENT, value);
  14880. suggestionDisabled.value = false;
  14881. activated.value ||= valuePresented;
  14882. if (!props.triggerOnFocus && !value) {
  14883. suggestionDisabled.value = true;
  14884. suggestions.value = [];
  14885. return;
  14886. }
  14887. debouncedGetData(value);
  14888. };
  14889. const handleMouseDown = (event) => {
  14890. if (disabled.value) return;
  14891. if (event.target?.tagName !== "INPUT" || refInput.value.includes(document.activeElement)) activated.value = true;
  14892. };
  14893. const handleChange = (value) => {
  14894. emit(CHANGE_EVENT, value);
  14895. };
  14896. const handleFocus = (evt) => {
  14897. if (!ignoreFocusEvent) {
  14898. activated.value = true;
  14899. emit("focus", evt);
  14900. const queryString = props.modelValue ?? "";
  14901. if (props.triggerOnFocus && !readonly) debouncedGetData(String(queryString));
  14902. } else ignoreFocusEvent = false;
  14903. };
  14904. const handleBlur = (evt) => {
  14905. setTimeout(() => {
  14906. if (popperRef.value?.isFocusInsideContent()) {
  14907. ignoreFocusEvent = true;
  14908. return;
  14909. }
  14910. activated.value && close();
  14911. emit("blur", evt);
  14912. });
  14913. };
  14914. const handleClear = () => {
  14915. activated.value = false;
  14916. emit(UPDATE_MODEL_EVENT, "");
  14917. emit("clear");
  14918. };
  14919. const handleKeyEnter = async () => {
  14920. if (inputRef.value?.isComposing) return;
  14921. if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) handleSelect(suggestions.value[highlightedIndex.value]);
  14922. else {
  14923. if (props.selectWhenUnmatched) {
  14924. emit("select", { value: props.modelValue });
  14925. suggestions.value = [];
  14926. highlightedIndex.value = -1;
  14927. }
  14928. activated.value = true;
  14929. debouncedGetData(String(props.modelValue));
  14930. }
  14931. };
  14932. const handleKeyEscape = (evt) => {
  14933. if (suggestionVisible.value) {
  14934. evt.preventDefault();
  14935. evt.stopPropagation();
  14936. close();
  14937. }
  14938. };
  14939. const close = () => {
  14940. activated.value = false;
  14941. };
  14942. const focus = () => {
  14943. inputRef.value?.focus();
  14944. };
  14945. const blur = () => {
  14946. inputRef.value?.blur();
  14947. };
  14948. const handleSelect = async (item) => {
  14949. emit(INPUT_EVENT, item[props.valueKey]);
  14950. emit(UPDATE_MODEL_EVENT, item[props.valueKey]);
  14951. emit("select", item);
  14952. suggestions.value = [];
  14953. highlightedIndex.value = -1;
  14954. };
  14955. const highlight = (index) => {
  14956. if (!suggestionVisible.value || loading.value) return;
  14957. if (index < 0) {
  14958. if (!props.loopNavigation) {
  14959. highlightedIndex.value = -1;
  14960. return;
  14961. }
  14962. index = suggestions.value.length - 1;
  14963. }
  14964. if (index >= suggestions.value.length) index = props.loopNavigation ? 0 : suggestions.value.length - 1;
  14965. const [suggestion, suggestionList] = getSuggestionContext();
  14966. const highlightItem = suggestionList[index];
  14967. const scrollTop = suggestion.scrollTop;
  14968. const { offsetTop, scrollHeight } = highlightItem;
  14969. if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) suggestion.scrollTop = offsetTop + scrollHeight - suggestion.clientHeight;
  14970. if (offsetTop < scrollTop) suggestion.scrollTop = offsetTop;
  14971. highlightedIndex.value = index;
  14972. inputRef.value?.ref?.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
  14973. };
  14974. const getSuggestionContext = () => {
  14975. const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`);
  14976. return [suggestion, suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`)];
  14977. };
  14978. const stopHandle = onClickOutside(listboxRef, (event) => {
  14979. if (popperRef.value?.isFocusInsideContent()) return;
  14980. const hadIgnoredFocus = ignoreFocusEvent;
  14981. ignoreFocusEvent = false;
  14982. if (!suggestionVisible.value) return;
  14983. if (hadIgnoredFocus) handleBlur(new FocusEvent("blur", event));
  14984. else close();
  14985. });
  14986. const handleKeydown = (e) => {
  14987. switch (getEventCode(e)) {
  14988. case EVENT_CODE.up:
  14989. e.preventDefault();
  14990. highlight(highlightedIndex.value - 1);
  14991. break;
  14992. case EVENT_CODE.down:
  14993. e.preventDefault();
  14994. highlight(highlightedIndex.value + 1);
  14995. break;
  14996. case EVENT_CODE.enter:
  14997. case EVENT_CODE.numpadEnter:
  14998. e.preventDefault();
  14999. handleKeyEnter();
  15000. break;
  15001. case EVENT_CODE.tab:
  15002. close();
  15003. break;
  15004. case EVENT_CODE.esc:
  15005. handleKeyEscape(e);
  15006. break;
  15007. case EVENT_CODE.home:
  15008. e.preventDefault();
  15009. highlight(0);
  15010. break;
  15011. case EVENT_CODE.end:
  15012. e.preventDefault();
  15013. highlight(suggestions.value.length - 1);
  15014. break;
  15015. case EVENT_CODE.pageUp:
  15016. e.preventDefault();
  15017. highlight(Math.max(0, highlightedIndex.value - 10));
  15018. break;
  15019. case EVENT_CODE.pageDown:
  15020. e.preventDefault();
  15021. highlight(Math.min(suggestions.value.length - 1, highlightedIndex.value + 10));
  15022. break;
  15023. }
  15024. };
  15025. onBeforeUnmount(() => {
  15026. stopHandle?.();
  15027. });
  15028. onMounted(() => {
  15029. const inputElement = inputRef.value?.ref;
  15030. if (!inputElement) return;
  15031. [
  15032. {
  15033. key: "role",
  15034. value: "textbox"
  15035. },
  15036. {
  15037. key: "aria-autocomplete",
  15038. value: "list"
  15039. },
  15040. {
  15041. key: "aria-controls",
  15042. value: listboxId.value
  15043. },
  15044. {
  15045. key: "aria-activedescendant",
  15046. value: `${listboxId.value}-item-${highlightedIndex.value}`
  15047. }
  15048. ].forEach(({ key, value }) => inputElement.setAttribute(key, value));
  15049. readonly = inputElement.hasAttribute("readonly");
  15050. });
  15051. __expose({
  15052. highlightedIndex,
  15053. activated,
  15054. loading,
  15055. inputRef,
  15056. popperRef,
  15057. suggestions,
  15058. handleSelect,
  15059. handleKeyEnter,
  15060. focus,
  15061. blur,
  15062. close,
  15063. highlight,
  15064. getData
  15065. });
  15066. return (_ctx, _cache) => {
  15067. return openBlock(), createBlock(unref(ElTooltip), {
  15068. ref_key: "popperRef",
  15069. ref: popperRef,
  15070. visible: suggestionVisible.value,
  15071. placement: __props.placement,
  15072. "fallback-placements": ["bottom-start", "top-start"],
  15073. "popper-class": [unref(ns).e("popper"), __props.popperClass],
  15074. "popper-style": __props.popperStyle,
  15075. teleported: __props.teleported,
  15076. "append-to": __props.appendTo,
  15077. "gpu-acceleration": false,
  15078. pure: "",
  15079. "manual-mode": "",
  15080. effect: "light",
  15081. trigger: "click",
  15082. transition: `${unref(ns).namespace.value}-zoom-in-top`,
  15083. persistent: "",
  15084. role: "listbox",
  15085. onBeforeShow: onSuggestionShow,
  15086. onHide
  15087. }, {
  15088. content: withCtx(() => [createElementVNode("div", {
  15089. ref_key: "regionRef",
  15090. ref: regionRef,
  15091. class: normalizeClass([unref(ns).b("suggestion"), unref(ns).is("loading", suggestionLoading.value)]),
  15092. style: normalizeStyle({
  15093. [__props.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
  15094. outline: "none"
  15095. }),
  15096. role: "region"
  15097. }, [
  15098. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  15099. key: 0,
  15100. class: normalizeClass(unref(ns).be("suggestion", "header")),
  15101. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  15102. }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true),
  15103. createVNode(unref(ElScrollbar), {
  15104. id: unref(listboxId),
  15105. tag: "ul",
  15106. "wrap-class": unref(ns).be("suggestion", "wrap"),
  15107. "view-class": unref(ns).be("suggestion", "list"),
  15108. role: "listbox"
  15109. }, {
  15110. default: withCtx(() => [suggestionLoading.value ? (openBlock(), createElementBlock("li", _hoisted_2$41, [renderSlot(_ctx.$slots, "loading", {}, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).is("loading")) }, {
  15111. default: withCtx(() => [createVNode(unref(loading_default))]),
  15112. _: 1
  15113. }, 8, ["class"])])])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(suggestions.value, (item, index) => {
  15114. return openBlock(), createElementBlock("li", {
  15115. id: `${unref(listboxId)}-item-${index}`,
  15116. key: index,
  15117. class: normalizeClass({ highlighted: highlightedIndex.value === index }),
  15118. role: "option",
  15119. "aria-selected": highlightedIndex.value === index,
  15120. onClick: ($event) => handleSelect(item)
  15121. }, [renderSlot(_ctx.$slots, "default", { item }, () => [createTextVNode(toDisplayString(item[__props.valueKey]), 1)])], 10, _hoisted_3$18);
  15122. }), 128))]),
  15123. _: 3
  15124. }, 8, [
  15125. "id",
  15126. "wrap-class",
  15127. "view-class"
  15128. ]),
  15129. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  15130. key: 1,
  15131. class: normalizeClass(unref(ns).be("suggestion", "footer")),
  15132. onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
  15133. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  15134. ], 6)]),
  15135. default: withCtx(() => [createElementVNode("div", {
  15136. ref_key: "listboxRef",
  15137. ref: listboxRef,
  15138. class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]),
  15139. style: normalizeStyle(styles.value),
  15140. role: "combobox",
  15141. "aria-haspopup": "listbox",
  15142. "aria-expanded": suggestionVisible.value,
  15143. "aria-owns": unref(listboxId)
  15144. }, [createVNode(unref(ElInput), mergeProps({
  15145. ref_key: "inputRef",
  15146. ref: inputRef
  15147. }, mergeProps(passInputProps.value, _ctx.$attrs), {
  15148. "model-value": __props.modelValue,
  15149. disabled: unref(disabled),
  15150. onInput: handleInput,
  15151. onChange: handleChange,
  15152. onFocus: handleFocus,
  15153. onBlur: handleBlur,
  15154. onClear: handleClear,
  15155. onKeydown: handleKeydown,
  15156. onMousedown: handleMouseDown
  15157. }), createSlots({ _: 2 }, [
  15158. _ctx.$slots.prepend ? {
  15159. name: "prepend",
  15160. fn: withCtx(() => [renderSlot(_ctx.$slots, "prepend")]),
  15161. key: "0"
  15162. } : void 0,
  15163. _ctx.$slots.append ? {
  15164. name: "append",
  15165. fn: withCtx(() => [renderSlot(_ctx.$slots, "append")]),
  15166. key: "1"
  15167. } : void 0,
  15168. _ctx.$slots.prefix ? {
  15169. name: "prefix",
  15170. fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
  15171. key: "2"
  15172. } : void 0,
  15173. _ctx.$slots.suffix ? {
  15174. name: "suffix",
  15175. fn: withCtx(() => [renderSlot(_ctx.$slots, "suffix")]),
  15176. key: "3"
  15177. } : void 0
  15178. ]), 1040, ["model-value", "disabled"])], 14, _hoisted_1$74)]),
  15179. _: 3
  15180. }, 8, [
  15181. "visible",
  15182. "placement",
  15183. "popper-class",
  15184. "popper-style",
  15185. "teleported",
  15186. "append-to",
  15187. "transition"
  15188. ]);
  15189. };
  15190. }
  15191. });
  15192. //#endregion
  15193. //#region ../../packages/components/autocomplete/src/autocomplete.vue
  15194. var autocomplete_default = autocomplete_vue_vue_type_script_setup_true_lang_default;
  15195. //#endregion
  15196. //#region ../../packages/components/autocomplete/index.ts
  15197. const ElAutocomplete = withInstall(autocomplete_default);
  15198. //#endregion
  15199. //#region ../../packages/components/avatar/src/avatar.ts
  15200. /**
  15201. * @deprecated Removed after 3.0.0, Use `AvatarProps` instead.
  15202. */
  15203. const avatarProps = buildProps({
  15204. size: {
  15205. type: [Number, String],
  15206. values: componentSizes,
  15207. validator: (val) => isNumber(val)
  15208. },
  15209. shape: {
  15210. type: String,
  15211. values: ["circle", "square"]
  15212. },
  15213. icon: { type: iconPropType },
  15214. src: {
  15215. type: String,
  15216. default: ""
  15217. },
  15218. alt: String,
  15219. srcSet: String,
  15220. fit: {
  15221. type: definePropType(String),
  15222. default: "cover"
  15223. }
  15224. });
  15225. const avatarEmits = { error: (evt) => evt instanceof Event };
  15226. //#endregion
  15227. //#region ../../packages/components/avatar/src/constants.ts
  15228. const avatarGroupContextKey = Symbol("avatarGroupContextKey");
  15229. //#endregion
  15230. //#region ../../packages/components/avatar/src/avatar.vue?vue&type=script&setup=true&lang.ts
  15231. const _hoisted_1$73 = [
  15232. "src",
  15233. "alt",
  15234. "srcset"
  15235. ];
  15236. var avatar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  15237. name: "ElAvatar",
  15238. __name: "avatar",
  15239. props: avatarProps,
  15240. emits: avatarEmits,
  15241. setup(__props, { emit: __emit }) {
  15242. const props = __props;
  15243. const emit = __emit;
  15244. const avatarGroupContext = inject(avatarGroupContextKey, void 0);
  15245. const ns = useNamespace("avatar");
  15246. const hasLoadError = ref(false);
  15247. const size = computed(() => props.size ?? avatarGroupContext?.size);
  15248. const shape = computed(() => props.shape ?? avatarGroupContext?.shape ?? "circle");
  15249. const avatarClass = computed(() => {
  15250. const { icon } = props;
  15251. const classList = [ns.b()];
  15252. if (isString(size.value)) classList.push(ns.m(size.value));
  15253. if (icon) classList.push(ns.m("icon"));
  15254. if (shape.value) classList.push(ns.m(shape.value));
  15255. return classList;
  15256. });
  15257. const sizeStyle = computed(() => {
  15258. return isNumber(size.value) ? ns.cssVarBlock({ size: addUnit(size.value) }) : void 0;
  15259. });
  15260. const fitStyle = computed(() => ({ objectFit: props.fit }));
  15261. watch(() => [props.src, props.srcSet], () => hasLoadError.value = false);
  15262. function handleError(e) {
  15263. hasLoadError.value = true;
  15264. emit("error", e);
  15265. }
  15266. return (_ctx, _cache) => {
  15267. return openBlock(), createElementBlock("span", {
  15268. class: normalizeClass(avatarClass.value),
  15269. style: normalizeStyle(sizeStyle.value)
  15270. }, [(__props.src || __props.srcSet) && !hasLoadError.value ? (openBlock(), createElementBlock("img", {
  15271. key: 0,
  15272. src: __props.src,
  15273. alt: __props.alt,
  15274. srcset: __props.srcSet,
  15275. style: normalizeStyle(fitStyle.value),
  15276. onError: handleError
  15277. }, null, 44, _hoisted_1$73)) : __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  15278. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  15279. _: 1
  15280. })) : renderSlot(_ctx.$slots, "default", { key: 2 })], 6);
  15281. };
  15282. }
  15283. });
  15284. //#endregion
  15285. //#region ../../packages/components/avatar/src/avatar.vue
  15286. var avatar_default = avatar_vue_vue_type_script_setup_true_lang_default;
  15287. //#endregion
  15288. //#region ../../packages/components/avatar/src/avatar-group-props.ts
  15289. const avatarGroupProps = {
  15290. size: {
  15291. type: definePropType([Number, String]),
  15292. values: componentSizes,
  15293. validator: (val) => isNumber(val)
  15294. },
  15295. shape: {
  15296. type: definePropType(String),
  15297. values: ["circle", "square"]
  15298. },
  15299. collapseAvatars: Boolean,
  15300. collapseAvatarsTooltip: Boolean,
  15301. maxCollapseAvatars: {
  15302. type: Number,
  15303. default: 1
  15304. },
  15305. effect: {
  15306. type: definePropType(String),
  15307. default: "light"
  15308. },
  15309. placement: {
  15310. type: definePropType(String),
  15311. values: Ee,
  15312. default: "top"
  15313. },
  15314. popperClass: useTooltipContentProps.popperClass,
  15315. popperStyle: useTooltipContentProps.popperStyle,
  15316. collapseClass: String,
  15317. collapseStyle: { type: definePropType([
  15318. String,
  15319. Array,
  15320. Object
  15321. ]) }
  15322. };
  15323. //#endregion
  15324. //#region ../../packages/components/avatar/src/avatar-group.tsx
  15325. var avatar_group_default = /* @__PURE__ */ defineComponent({
  15326. name: "ElAvatarGroup",
  15327. props: avatarGroupProps,
  15328. setup(props, { slots }) {
  15329. const ns = useNamespace("avatar-group");
  15330. provide(avatarGroupContextKey, reactive({
  15331. size: toRef(props, "size"),
  15332. shape: toRef(props, "shape")
  15333. }));
  15334. return () => {
  15335. const avatars = flattedChildren(slots.default?.() ?? []);
  15336. let visibleAvatars = avatars;
  15337. if (props.collapseAvatars && avatars.length > props.maxCollapseAvatars) {
  15338. visibleAvatars = avatars.slice(0, props.maxCollapseAvatars);
  15339. const hiddenAvatars = avatars.slice(props.maxCollapseAvatars);
  15340. visibleAvatars.push(createVNode(ElTooltip, {
  15341. "popperClass": props.popperClass,
  15342. "popperStyle": props.popperStyle,
  15343. "placement": props.placement,
  15344. "effect": props.effect,
  15345. "disabled": !props.collapseAvatarsTooltip
  15346. }, {
  15347. default: () => createVNode(avatar_default, {
  15348. "size": props.size,
  15349. "shape": props.shape,
  15350. "class": props.collapseClass,
  15351. "style": props.collapseStyle
  15352. }, { default: () => [createTextVNode("+ "), hiddenAvatars.length] }),
  15353. content: () => createVNode("div", { "class": ns.e("collapse-avatars") }, [hiddenAvatars.map((node, idx) => isVNode(node) ? cloneVNode(node, { key: node.key ?? idx }) : node)])
  15354. }));
  15355. }
  15356. return createVNode("div", { "class": ns.b() }, [visibleAvatars]);
  15357. };
  15358. }
  15359. });
  15360. //#endregion
  15361. //#region ../../packages/components/avatar/index.ts
  15362. const ElAvatar = withInstall(avatar_default, { AvatarGroup: avatar_group_default });
  15363. const ElAvatarGroup = withNoopInstall(avatar_group_default);
  15364. //#endregion
  15365. //#region ../../packages/components/backtop/src/backtop.ts
  15366. /**
  15367. * @deprecated Removed after 3.0.0, Use `BacktopProps` instead.
  15368. */
  15369. const backtopProps = {
  15370. visibilityHeight: {
  15371. type: Number,
  15372. default: 200
  15373. },
  15374. target: {
  15375. type: String,
  15376. default: ""
  15377. },
  15378. right: {
  15379. type: Number,
  15380. default: 40
  15381. },
  15382. bottom: {
  15383. type: Number,
  15384. default: 40
  15385. }
  15386. };
  15387. const backtopEmits = { click: (evt) => evt instanceof MouseEvent };
  15388. //#endregion
  15389. //#region ../../packages/components/backtop/src/use-backtop.ts
  15390. const useBackTop = (props, emit, componentName) => {
  15391. const el = shallowRef();
  15392. const container = shallowRef();
  15393. const visible = ref(false);
  15394. const handleScroll = () => {
  15395. if (el.value) visible.value = el.value.scrollTop >= props.visibilityHeight;
  15396. };
  15397. const handleClick = (event) => {
  15398. el.value?.scrollTo({
  15399. top: 0,
  15400. behavior: "smooth"
  15401. });
  15402. emit("click", event);
  15403. };
  15404. useEventListener(container, "scroll", useThrottleFn(handleScroll, 300, true));
  15405. onMounted(() => {
  15406. container.value = document;
  15407. el.value = document.documentElement;
  15408. if (props.target) {
  15409. el.value = document.querySelector(props.target) ?? void 0;
  15410. if (!el.value) throwError(componentName, `target does not exist: ${props.target}`);
  15411. container.value = el.value;
  15412. }
  15413. handleScroll();
  15414. });
  15415. return {
  15416. visible,
  15417. handleClick
  15418. };
  15419. };
  15420. //#endregion
  15421. //#region ../../packages/components/backtop/src/backtop.vue?vue&type=script&setup=true&lang.ts
  15422. const COMPONENT_NAME$15 = "ElBacktop";
  15423. var backtop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  15424. name: COMPONENT_NAME$15,
  15425. __name: "backtop",
  15426. props: backtopProps,
  15427. emits: backtopEmits,
  15428. setup(__props, { emit: __emit }) {
  15429. const props = __props;
  15430. const emit = __emit;
  15431. const ns = useNamespace("backtop");
  15432. const { handleClick, visible } = useBackTop(props, emit, COMPONENT_NAME$15);
  15433. const backTopStyle = computed(() => ({
  15434. right: `${props.right}px`,
  15435. bottom: `${props.bottom}px`
  15436. }));
  15437. return (_ctx, _cache) => {
  15438. return openBlock(), createBlock(Transition, { name: `${unref(ns).namespace.value}-fade-in` }, {
  15439. default: withCtx(() => [unref(visible) ? (openBlock(), createElementBlock("div", {
  15440. key: 0,
  15441. style: normalizeStyle(backTopStyle.value),
  15442. class: normalizeClass(unref(ns).b()),
  15443. onClick: _cache[0] || (_cache[0] = withModifiers((...args) => unref(handleClick) && unref(handleClick)(...args), ["stop"]))
  15444. }, [renderSlot(_ctx.$slots, "default", {}, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("icon")) }, {
  15445. default: withCtx(() => [createVNode(unref(caret_top_default))]),
  15446. _: 1
  15447. }, 8, ["class"])])], 6)) : createCommentVNode("v-if", true)]),
  15448. _: 3
  15449. }, 8, ["name"]);
  15450. };
  15451. }
  15452. });
  15453. //#endregion
  15454. //#region ../../packages/components/backtop/src/backtop.vue
  15455. var backtop_default = backtop_vue_vue_type_script_setup_true_lang_default;
  15456. //#endregion
  15457. //#region ../../packages/components/backtop/index.ts
  15458. const ElBacktop = withInstall(backtop_default);
  15459. //#endregion
  15460. //#region ../../packages/components/badge/src/badge.ts
  15461. /**
  15462. * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
  15463. */
  15464. const badgeProps = buildProps({
  15465. value: {
  15466. type: [String, Number],
  15467. default: ""
  15468. },
  15469. max: {
  15470. type: Number,
  15471. default: 99
  15472. },
  15473. isDot: Boolean,
  15474. hidden: Boolean,
  15475. type: {
  15476. type: String,
  15477. values: [
  15478. "primary",
  15479. "success",
  15480. "warning",
  15481. "info",
  15482. "danger"
  15483. ],
  15484. default: "danger"
  15485. },
  15486. showZero: {
  15487. type: Boolean,
  15488. default: true
  15489. },
  15490. color: String,
  15491. badgeStyle: { type: definePropType([
  15492. String,
  15493. Object,
  15494. Array
  15495. ]) },
  15496. offset: {
  15497. type: definePropType(Array),
  15498. default: () => [0, 0]
  15499. },
  15500. badgeClass: { type: String }
  15501. });
  15502. //#endregion
  15503. //#region ../../packages/components/badge/src/badge.vue?vue&type=script&setup=true&lang.ts
  15504. var badge_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  15505. name: "ElBadge",
  15506. __name: "badge",
  15507. props: badgeProps,
  15508. setup(__props, { expose: __expose }) {
  15509. const props = __props;
  15510. const ns = useNamespace("badge");
  15511. const content = computed(() => {
  15512. if (props.isDot) return "";
  15513. if (isNumber(props.value) && isNumber(props.max)) return props.max < props.value ? `${props.max}+` : `${props.value}`;
  15514. return `${props.value}`;
  15515. });
  15516. const style = computed(() => {
  15517. return [{
  15518. backgroundColor: props.color,
  15519. marginRight: addUnit(-props.offset[0]),
  15520. marginTop: addUnit(props.offset[1])
  15521. }, props.badgeStyle ?? {}];
  15522. });
  15523. __expose({ content });
  15524. return (_ctx, _cache) => {
  15525. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [renderSlot(_ctx.$slots, "default"), createVNode(Transition, { name: `${unref(ns).namespace.value}-zoom-in-center` }, {
  15526. default: withCtx(() => [!__props.hidden && (content.value || __props.isDot || _ctx.$slots.content) ? (openBlock(), createElementBlock("sup", {
  15527. key: 0,
  15528. class: normalizeClass([
  15529. unref(ns).e("content"),
  15530. unref(ns).em("content", __props.type),
  15531. unref(ns).is("fixed", !!_ctx.$slots.default),
  15532. unref(ns).is("dot", __props.isDot),
  15533. unref(ns).is("hide-zero", !__props.showZero && __props.value === 0),
  15534. __props.badgeClass
  15535. ]),
  15536. style: normalizeStyle(style.value)
  15537. }, [renderSlot(_ctx.$slots, "content", { value: content.value }, () => [createTextVNode(toDisplayString(content.value), 1)])], 6)) : createCommentVNode("v-if", true)]),
  15538. _: 3
  15539. }, 8, ["name"])], 2);
  15540. };
  15541. }
  15542. });
  15543. //#endregion
  15544. //#region ../../packages/components/badge/src/badge.vue
  15545. var badge_default = badge_vue_vue_type_script_setup_true_lang_default;
  15546. //#endregion
  15547. //#region ../../packages/components/badge/index.ts
  15548. const ElBadge = withInstall(badge_default);
  15549. //#endregion
  15550. //#region ../../packages/components/breadcrumb/src/breadcrumb.ts
  15551. /**
  15552. * @deprecated Removed after 3.0.0, Use `BreadcrumbProps` instead.
  15553. */
  15554. const breadcrumbProps = buildProps({
  15555. separator: {
  15556. type: String,
  15557. default: "/"
  15558. },
  15559. separatorIcon: { type: iconPropType }
  15560. });
  15561. //#endregion
  15562. //#region ../../packages/components/breadcrumb/src/constants.ts
  15563. const breadcrumbKey = Symbol("breadcrumbKey");
  15564. //#endregion
  15565. //#region ../../packages/components/breadcrumb/src/breadcrumb.vue?vue&type=script&setup=true&lang.ts
  15566. const _hoisted_1$72 = ["aria-label"];
  15567. var breadcrumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  15568. name: "ElBreadcrumb",
  15569. __name: "breadcrumb",
  15570. props: breadcrumbProps,
  15571. setup(__props) {
  15572. const { t } = useLocale();
  15573. const props = __props;
  15574. const ns = useNamespace("breadcrumb");
  15575. const breadcrumb = ref();
  15576. provide(breadcrumbKey, props);
  15577. onMounted(() => {
  15578. const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
  15579. if (items.length) items[items.length - 1].setAttribute("aria-current", "page");
  15580. });
  15581. return (_ctx, _cache) => {
  15582. return openBlock(), createElementBlock("div", {
  15583. ref_key: "breadcrumb",
  15584. ref: breadcrumb,
  15585. class: normalizeClass(unref(ns).b()),
  15586. "aria-label": unref(t)("el.breadcrumb.label"),
  15587. role: "navigation"
  15588. }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$72);
  15589. };
  15590. }
  15591. });
  15592. //#endregion
  15593. //#region ../../packages/components/breadcrumb/src/breadcrumb.vue
  15594. var breadcrumb_default = breadcrumb_vue_vue_type_script_setup_true_lang_default;
  15595. //#endregion
  15596. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.ts
  15597. /**
  15598. * @deprecated Removed after 3.0.0, Use `BreadcrumbItemProps` instead.
  15599. */
  15600. const breadcrumbItemProps = buildProps({
  15601. to: {
  15602. type: definePropType([String, Object]),
  15603. default: ""
  15604. },
  15605. replace: Boolean
  15606. });
  15607. //#endregion
  15608. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.vue?vue&type=script&setup=true&lang.ts
  15609. var breadcrumb_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  15610. name: "ElBreadcrumbItem",
  15611. __name: "breadcrumb-item",
  15612. props: breadcrumbItemProps,
  15613. setup(__props) {
  15614. const props = __props;
  15615. const instance = getCurrentInstance();
  15616. const breadcrumbContext = inject(breadcrumbKey, void 0);
  15617. const ns = useNamespace("breadcrumb");
  15618. const router = instance.appContext.config.globalProperties.$router;
  15619. const onClick = () => {
  15620. if (!props.to || !router) return;
  15621. props.replace ? router.replace(props.to) : router.push(props.to);
  15622. };
  15623. return (_ctx, _cache) => {
  15624. return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("item")) }, [createElementVNode("span", {
  15625. class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!__props.to)]),
  15626. role: "link",
  15627. onClick
  15628. }, [renderSlot(_ctx.$slots, "default")], 2), unref(breadcrumbContext)?.separatorIcon ? (openBlock(), createBlock(unref(ElIcon), {
  15629. key: 0,
  15630. class: normalizeClass(unref(ns).e("separator"))
  15631. }, {
  15632. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(breadcrumbContext).separatorIcon)))]),
  15633. _: 1
  15634. }, 8, ["class"])) : (openBlock(), createElementBlock("span", {
  15635. key: 1,
  15636. class: normalizeClass(unref(ns).e("separator")),
  15637. role: "presentation"
  15638. }, toDisplayString(unref(breadcrumbContext)?.separator), 3))], 2);
  15639. };
  15640. }
  15641. });
  15642. //#endregion
  15643. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.vue
  15644. var breadcrumb_item_default = breadcrumb_item_vue_vue_type_script_setup_true_lang_default;
  15645. //#endregion
  15646. //#region ../../packages/components/breadcrumb/index.ts
  15647. const ElBreadcrumb = withInstall(breadcrumb_default, { BreadcrumbItem: breadcrumb_item_default });
  15648. const ElBreadcrumbItem = withNoopInstall(breadcrumb_item_default);
  15649. //#endregion
  15650. //#region ../../packages/components/button/src/button.ts
  15651. const buttonTypes = [
  15652. "default",
  15653. "primary",
  15654. "success",
  15655. "warning",
  15656. "info",
  15657. "danger",
  15658. "text",
  15659. ""
  15660. ];
  15661. const buttonNativeTypes = [
  15662. "button",
  15663. "submit",
  15664. "reset"
  15665. ];
  15666. /**
  15667. * @deprecated Removed after 3.0.0, Use `ButtonProps` instead.
  15668. */
  15669. const buttonProps = buildProps({
  15670. size: useSizeProp,
  15671. disabled: {
  15672. type: Boolean,
  15673. default: void 0
  15674. },
  15675. type: {
  15676. type: String,
  15677. values: buttonTypes,
  15678. default: ""
  15679. },
  15680. icon: { type: iconPropType },
  15681. nativeType: {
  15682. type: String,
  15683. values: buttonNativeTypes,
  15684. default: "button"
  15685. },
  15686. loading: Boolean,
  15687. loadingIcon: {
  15688. type: iconPropType,
  15689. default: () => loading_default
  15690. },
  15691. plain: {
  15692. type: Boolean,
  15693. default: void 0
  15694. },
  15695. text: {
  15696. type: Boolean,
  15697. default: void 0
  15698. },
  15699. link: Boolean,
  15700. bg: Boolean,
  15701. autofocus: Boolean,
  15702. round: {
  15703. type: Boolean,
  15704. default: void 0
  15705. },
  15706. circle: Boolean,
  15707. dashed: {
  15708. type: Boolean,
  15709. default: void 0
  15710. },
  15711. color: String,
  15712. dark: Boolean,
  15713. autoInsertSpace: {
  15714. type: Boolean,
  15715. default: void 0
  15716. },
  15717. tag: {
  15718. type: definePropType([String, Object]),
  15719. default: "button"
  15720. }
  15721. });
  15722. const buttonEmits = { click: (evt) => evt instanceof MouseEvent };
  15723. //#endregion
  15724. //#region ../../packages/components/button/src/constants.ts
  15725. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  15726. //#endregion
  15727. //#region ../../packages/components/button/src/use-button.ts
  15728. const useButton = (props, emit) => {
  15729. useDeprecated({
  15730. from: "type.text",
  15731. replacement: "link",
  15732. version: "3.0.0",
  15733. scope: "props",
  15734. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  15735. }, computed(() => props.type === "text"));
  15736. const buttonGroupContext = inject(buttonGroupContextKey, void 0);
  15737. const globalConfig = useGlobalConfig("button");
  15738. const { form } = useFormItem();
  15739. const _size = useFormSize(computed(() => buttonGroupContext?.size));
  15740. const _disabled = useFormDisabled();
  15741. const _ref = ref();
  15742. const slots = useSlots();
  15743. const _type = computed(() => props.type || buttonGroupContext?.type || globalConfig.value?.type || "");
  15744. const autoInsertSpace = computed(() => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false);
  15745. const _plain = computed(() => props.plain ?? globalConfig.value?.plain ?? false);
  15746. const _round = computed(() => props.round ?? globalConfig.value?.round ?? false);
  15747. const _text = computed(() => props.text ?? globalConfig.value?.text ?? false);
  15748. const _dashed = computed(() => props.dashed ?? globalConfig.value?.dashed ?? false);
  15749. const _props = computed(() => {
  15750. if (props.tag === "button") return {
  15751. ariaDisabled: _disabled.value || props.loading,
  15752. disabled: _disabled.value || props.loading,
  15753. autofocus: props.autofocus,
  15754. type: props.nativeType
  15755. };
  15756. return {};
  15757. });
  15758. const shouldAddSpace = computed(() => {
  15759. const defaultSlot = slots.default?.();
  15760. if (autoInsertSpace.value && defaultSlot?.length === 1) {
  15761. const slot = defaultSlot[0];
  15762. if (slot?.type === Text) {
  15763. const text = slot.children;
  15764. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  15765. }
  15766. }
  15767. return false;
  15768. });
  15769. const handleClick = (evt) => {
  15770. if (_disabled.value || props.loading) {
  15771. evt.stopPropagation();
  15772. return;
  15773. }
  15774. if (props.nativeType === "reset") form?.resetFields();
  15775. emit("click", evt);
  15776. };
  15777. return {
  15778. _disabled,
  15779. _size,
  15780. _type,
  15781. _ref,
  15782. _props,
  15783. _plain,
  15784. _round,
  15785. _text,
  15786. _dashed,
  15787. shouldAddSpace,
  15788. handleClick
  15789. };
  15790. };
  15791. //#endregion
  15792. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/util.js
  15793. /**
  15794. * Take input from [0, n] and return it as [0, 1]
  15795. * @hidden
  15796. */
  15797. function bound01(n, max) {
  15798. if (isOnePointZero(n)) n = "100%";
  15799. var isPercent = isPercentage(n);
  15800. n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
  15801. if (isPercent) n = parseInt(String(n * max), 10) / 100;
  15802. if (Math.abs(n - max) < 1e-6) return 1;
  15803. if (max === 360) n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
  15804. else n = n % max / parseFloat(String(max));
  15805. return n;
  15806. }
  15807. /**
  15808. * Force a number between 0 and 1
  15809. * @hidden
  15810. */
  15811. function clamp01(val) {
  15812. return Math.min(1, Math.max(0, val));
  15813. }
  15814. /**
  15815. * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  15816. * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  15817. * @hidden
  15818. */
  15819. function isOnePointZero(n) {
  15820. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  15821. }
  15822. /**
  15823. * Check to see if string passed in is a percentage
  15824. * @hidden
  15825. */
  15826. function isPercentage(n) {
  15827. return typeof n === "string" && n.indexOf("%") !== -1;
  15828. }
  15829. /**
  15830. * Return a valid alpha value [0,1] with all invalid values being set to 1
  15831. * @hidden
  15832. */
  15833. function boundAlpha(a) {
  15834. a = parseFloat(a);
  15835. if (isNaN(a) || a < 0 || a > 1) a = 1;
  15836. return a;
  15837. }
  15838. /**
  15839. * Replace a decimal with it's percentage value
  15840. * @hidden
  15841. */
  15842. function convertToPercentage(n) {
  15843. if (n <= 1) return "".concat(Number(n) * 100, "%");
  15844. return n;
  15845. }
  15846. /**
  15847. * Force a hex value to have 2 characters
  15848. * @hidden
  15849. */
  15850. function pad2(c) {
  15851. return c.length === 1 ? "0" + c : String(c);
  15852. }
  15853. //#endregion
  15854. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/conversion.js
  15855. /**
  15856. * Handle bounds / percentage checking to conform to CSS color spec
  15857. * <http://www.w3.org/TR/css3-color/>
  15858. * *Assumes:* r, g, b in [0, 255] or [0, 1]
  15859. * *Returns:* { r, g, b } in [0, 255]
  15860. */
  15861. function rgbToRgb(r, g, b) {
  15862. return {
  15863. r: bound01(r, 255) * 255,
  15864. g: bound01(g, 255) * 255,
  15865. b: bound01(b, 255) * 255
  15866. };
  15867. }
  15868. /**
  15869. * Converts an RGB color value to HSL.
  15870. * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
  15871. * *Returns:* { h, s, l } in [0,1]
  15872. */
  15873. function rgbToHsl(r, g, b) {
  15874. r = bound01(r, 255);
  15875. g = bound01(g, 255);
  15876. b = bound01(b, 255);
  15877. var max = Math.max(r, g, b);
  15878. var min = Math.min(r, g, b);
  15879. var h = 0;
  15880. var s = 0;
  15881. var l = (max + min) / 2;
  15882. if (max === min) {
  15883. s = 0;
  15884. h = 0;
  15885. } else {
  15886. var d = max - min;
  15887. s = l > .5 ? d / (2 - max - min) : d / (max + min);
  15888. switch (max) {
  15889. case r:
  15890. h = (g - b) / d + (g < b ? 6 : 0);
  15891. break;
  15892. case g:
  15893. h = (b - r) / d + 2;
  15894. break;
  15895. case b:
  15896. h = (r - g) / d + 4;
  15897. break;
  15898. default: break;
  15899. }
  15900. h /= 6;
  15901. }
  15902. return {
  15903. h,
  15904. s,
  15905. l
  15906. };
  15907. }
  15908. function hue2rgb(p, q, t) {
  15909. if (t < 0) t += 1;
  15910. if (t > 1) t -= 1;
  15911. if (t < 1 / 6) return p + (q - p) * (6 * t);
  15912. if (t < 1 / 2) return q;
  15913. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  15914. return p;
  15915. }
  15916. /**
  15917. * Converts an HSL color value to RGB.
  15918. *
  15919. * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
  15920. * *Returns:* { r, g, b } in the set [0, 255]
  15921. */
  15922. function hslToRgb(h, s, l) {
  15923. var r;
  15924. var g;
  15925. var b;
  15926. h = bound01(h, 360);
  15927. s = bound01(s, 100);
  15928. l = bound01(l, 100);
  15929. if (s === 0) {
  15930. g = l;
  15931. b = l;
  15932. r = l;
  15933. } else {
  15934. var q = l < .5 ? l * (1 + s) : l + s - l * s;
  15935. var p = 2 * l - q;
  15936. r = hue2rgb(p, q, h + 1 / 3);
  15937. g = hue2rgb(p, q, h);
  15938. b = hue2rgb(p, q, h - 1 / 3);
  15939. }
  15940. return {
  15941. r: r * 255,
  15942. g: g * 255,
  15943. b: b * 255
  15944. };
  15945. }
  15946. /**
  15947. * Converts an RGB color value to HSV
  15948. *
  15949. * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  15950. * *Returns:* { h, s, v } in [0,1]
  15951. */
  15952. function rgbToHsv(r, g, b) {
  15953. r = bound01(r, 255);
  15954. g = bound01(g, 255);
  15955. b = bound01(b, 255);
  15956. var max = Math.max(r, g, b);
  15957. var min = Math.min(r, g, b);
  15958. var h = 0;
  15959. var v = max;
  15960. var d = max - min;
  15961. var s = max === 0 ? 0 : d / max;
  15962. if (max === min) h = 0;
  15963. else {
  15964. switch (max) {
  15965. case r:
  15966. h = (g - b) / d + (g < b ? 6 : 0);
  15967. break;
  15968. case g:
  15969. h = (b - r) / d + 2;
  15970. break;
  15971. case b:
  15972. h = (r - g) / d + 4;
  15973. break;
  15974. default: break;
  15975. }
  15976. h /= 6;
  15977. }
  15978. return {
  15979. h,
  15980. s,
  15981. v
  15982. };
  15983. }
  15984. /**
  15985. * Converts an HSV color value to RGB.
  15986. *
  15987. * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  15988. * *Returns:* { r, g, b } in the set [0, 255]
  15989. */
  15990. function hsvToRgb(h, s, v) {
  15991. h = bound01(h, 360) * 6;
  15992. s = bound01(s, 100);
  15993. v = bound01(v, 100);
  15994. var i = Math.floor(h);
  15995. var f = h - i;
  15996. var p = v * (1 - s);
  15997. var q = v * (1 - f * s);
  15998. var t = v * (1 - (1 - f) * s);
  15999. var mod = i % 6;
  16000. var r = [
  16001. v,
  16002. q,
  16003. p,
  16004. p,
  16005. t,
  16006. v
  16007. ][mod];
  16008. var g = [
  16009. t,
  16010. v,
  16011. v,
  16012. q,
  16013. p,
  16014. p
  16015. ][mod];
  16016. var b = [
  16017. p,
  16018. p,
  16019. t,
  16020. v,
  16021. v,
  16022. q
  16023. ][mod];
  16024. return {
  16025. r: r * 255,
  16026. g: g * 255,
  16027. b: b * 255
  16028. };
  16029. }
  16030. /**
  16031. * Converts an RGB color to hex
  16032. *
  16033. * Assumes r, g, and b are contained in the set [0, 255]
  16034. * Returns a 3 or 6 character hex
  16035. */
  16036. function rgbToHex(r, g, b, allow3Char) {
  16037. var hex = [
  16038. pad2(Math.round(r).toString(16)),
  16039. pad2(Math.round(g).toString(16)),
  16040. pad2(Math.round(b).toString(16))
  16041. ];
  16042. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  16043. return hex.join("");
  16044. }
  16045. /**
  16046. * Converts an RGBA color plus alpha transparency to hex
  16047. *
  16048. * Assumes r, g, b are contained in the set [0, 255] and
  16049. * a in [0, 1]. Returns a 4 or 8 character rgba hex
  16050. */
  16051. function rgbaToHex(r, g, b, a, allow4Char) {
  16052. var hex = [
  16053. pad2(Math.round(r).toString(16)),
  16054. pad2(Math.round(g).toString(16)),
  16055. pad2(Math.round(b).toString(16)),
  16056. pad2(convertDecimalToHex(a))
  16057. ];
  16058. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  16059. return hex.join("");
  16060. }
  16061. /** Converts a decimal to a hex value */
  16062. function convertDecimalToHex(d) {
  16063. return Math.round(parseFloat(d) * 255).toString(16);
  16064. }
  16065. /** Converts a hex value to a decimal */
  16066. function convertHexToDecimal(h) {
  16067. return parseIntFromHex(h) / 255;
  16068. }
  16069. /** Parse a base-16 hex value into a base-10 integer */
  16070. function parseIntFromHex(val) {
  16071. return parseInt(val, 16);
  16072. }
  16073. function numberInputToObject(color) {
  16074. return {
  16075. r: color >> 16,
  16076. g: (color & 65280) >> 8,
  16077. b: color & 255
  16078. };
  16079. }
  16080. //#endregion
  16081. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
  16082. /**
  16083. * @hidden
  16084. */
  16085. var names = {
  16086. aliceblue: "#f0f8ff",
  16087. antiquewhite: "#faebd7",
  16088. aqua: "#00ffff",
  16089. aquamarine: "#7fffd4",
  16090. azure: "#f0ffff",
  16091. beige: "#f5f5dc",
  16092. bisque: "#ffe4c4",
  16093. black: "#000000",
  16094. blanchedalmond: "#ffebcd",
  16095. blue: "#0000ff",
  16096. blueviolet: "#8a2be2",
  16097. brown: "#a52a2a",
  16098. burlywood: "#deb887",
  16099. cadetblue: "#5f9ea0",
  16100. chartreuse: "#7fff00",
  16101. chocolate: "#d2691e",
  16102. coral: "#ff7f50",
  16103. cornflowerblue: "#6495ed",
  16104. cornsilk: "#fff8dc",
  16105. crimson: "#dc143c",
  16106. cyan: "#00ffff",
  16107. darkblue: "#00008b",
  16108. darkcyan: "#008b8b",
  16109. darkgoldenrod: "#b8860b",
  16110. darkgray: "#a9a9a9",
  16111. darkgreen: "#006400",
  16112. darkgrey: "#a9a9a9",
  16113. darkkhaki: "#bdb76b",
  16114. darkmagenta: "#8b008b",
  16115. darkolivegreen: "#556b2f",
  16116. darkorange: "#ff8c00",
  16117. darkorchid: "#9932cc",
  16118. darkred: "#8b0000",
  16119. darksalmon: "#e9967a",
  16120. darkseagreen: "#8fbc8f",
  16121. darkslateblue: "#483d8b",
  16122. darkslategray: "#2f4f4f",
  16123. darkslategrey: "#2f4f4f",
  16124. darkturquoise: "#00ced1",
  16125. darkviolet: "#9400d3",
  16126. deeppink: "#ff1493",
  16127. deepskyblue: "#00bfff",
  16128. dimgray: "#696969",
  16129. dimgrey: "#696969",
  16130. dodgerblue: "#1e90ff",
  16131. firebrick: "#b22222",
  16132. floralwhite: "#fffaf0",
  16133. forestgreen: "#228b22",
  16134. fuchsia: "#ff00ff",
  16135. gainsboro: "#dcdcdc",
  16136. ghostwhite: "#f8f8ff",
  16137. goldenrod: "#daa520",
  16138. gold: "#ffd700",
  16139. gray: "#808080",
  16140. green: "#008000",
  16141. greenyellow: "#adff2f",
  16142. grey: "#808080",
  16143. honeydew: "#f0fff0",
  16144. hotpink: "#ff69b4",
  16145. indianred: "#cd5c5c",
  16146. indigo: "#4b0082",
  16147. ivory: "#fffff0",
  16148. khaki: "#f0e68c",
  16149. lavenderblush: "#fff0f5",
  16150. lavender: "#e6e6fa",
  16151. lawngreen: "#7cfc00",
  16152. lemonchiffon: "#fffacd",
  16153. lightblue: "#add8e6",
  16154. lightcoral: "#f08080",
  16155. lightcyan: "#e0ffff",
  16156. lightgoldenrodyellow: "#fafad2",
  16157. lightgray: "#d3d3d3",
  16158. lightgreen: "#90ee90",
  16159. lightgrey: "#d3d3d3",
  16160. lightpink: "#ffb6c1",
  16161. lightsalmon: "#ffa07a",
  16162. lightseagreen: "#20b2aa",
  16163. lightskyblue: "#87cefa",
  16164. lightslategray: "#778899",
  16165. lightslategrey: "#778899",
  16166. lightsteelblue: "#b0c4de",
  16167. lightyellow: "#ffffe0",
  16168. lime: "#00ff00",
  16169. limegreen: "#32cd32",
  16170. linen: "#faf0e6",
  16171. magenta: "#ff00ff",
  16172. maroon: "#800000",
  16173. mediumaquamarine: "#66cdaa",
  16174. mediumblue: "#0000cd",
  16175. mediumorchid: "#ba55d3",
  16176. mediumpurple: "#9370db",
  16177. mediumseagreen: "#3cb371",
  16178. mediumslateblue: "#7b68ee",
  16179. mediumspringgreen: "#00fa9a",
  16180. mediumturquoise: "#48d1cc",
  16181. mediumvioletred: "#c71585",
  16182. midnightblue: "#191970",
  16183. mintcream: "#f5fffa",
  16184. mistyrose: "#ffe4e1",
  16185. moccasin: "#ffe4b5",
  16186. navajowhite: "#ffdead",
  16187. navy: "#000080",
  16188. oldlace: "#fdf5e6",
  16189. olive: "#808000",
  16190. olivedrab: "#6b8e23",
  16191. orange: "#ffa500",
  16192. orangered: "#ff4500",
  16193. orchid: "#da70d6",
  16194. palegoldenrod: "#eee8aa",
  16195. palegreen: "#98fb98",
  16196. paleturquoise: "#afeeee",
  16197. palevioletred: "#db7093",
  16198. papayawhip: "#ffefd5",
  16199. peachpuff: "#ffdab9",
  16200. peru: "#cd853f",
  16201. pink: "#ffc0cb",
  16202. plum: "#dda0dd",
  16203. powderblue: "#b0e0e6",
  16204. purple: "#800080",
  16205. rebeccapurple: "#663399",
  16206. red: "#ff0000",
  16207. rosybrown: "#bc8f8f",
  16208. royalblue: "#4169e1",
  16209. saddlebrown: "#8b4513",
  16210. salmon: "#fa8072",
  16211. sandybrown: "#f4a460",
  16212. seagreen: "#2e8b57",
  16213. seashell: "#fff5ee",
  16214. sienna: "#a0522d",
  16215. silver: "#c0c0c0",
  16216. skyblue: "#87ceeb",
  16217. slateblue: "#6a5acd",
  16218. slategray: "#708090",
  16219. slategrey: "#708090",
  16220. snow: "#fffafa",
  16221. springgreen: "#00ff7f",
  16222. steelblue: "#4682b4",
  16223. tan: "#d2b48c",
  16224. teal: "#008080",
  16225. thistle: "#d8bfd8",
  16226. tomato: "#ff6347",
  16227. turquoise: "#40e0d0",
  16228. violet: "#ee82ee",
  16229. wheat: "#f5deb3",
  16230. white: "#ffffff",
  16231. whitesmoke: "#f5f5f5",
  16232. yellow: "#ffff00",
  16233. yellowgreen: "#9acd32"
  16234. };
  16235. //#endregion
  16236. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/format-input.js
  16237. /**
  16238. * Given a string or object, convert that input to RGB
  16239. *
  16240. * Possible string inputs:
  16241. * ```
  16242. * "red"
  16243. * "#f00" or "f00"
  16244. * "#ff0000" or "ff0000"
  16245. * "#ff000000" or "ff000000"
  16246. * "rgb 255 0 0" or "rgb (255, 0, 0)"
  16247. * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
  16248. * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
  16249. * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
  16250. * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
  16251. * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
  16252. * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
  16253. * ```
  16254. */
  16255. function inputToRGB(color) {
  16256. var rgb = {
  16257. r: 0,
  16258. g: 0,
  16259. b: 0
  16260. };
  16261. var a = 1;
  16262. var s = null;
  16263. var v = null;
  16264. var l = null;
  16265. var ok = false;
  16266. var format = false;
  16267. if (typeof color === "string") color = stringInputToObject(color);
  16268. if (typeof color === "object") {
  16269. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  16270. rgb = rgbToRgb(color.r, color.g, color.b);
  16271. ok = true;
  16272. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  16273. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  16274. s = convertToPercentage(color.s);
  16275. v = convertToPercentage(color.v);
  16276. rgb = hsvToRgb(color.h, s, v);
  16277. ok = true;
  16278. format = "hsv";
  16279. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  16280. s = convertToPercentage(color.s);
  16281. l = convertToPercentage(color.l);
  16282. rgb = hslToRgb(color.h, s, l);
  16283. ok = true;
  16284. format = "hsl";
  16285. }
  16286. if (Object.prototype.hasOwnProperty.call(color, "a")) a = color.a;
  16287. }
  16288. a = boundAlpha(a);
  16289. return {
  16290. ok,
  16291. format: color.format || format,
  16292. r: Math.min(255, Math.max(rgb.r, 0)),
  16293. g: Math.min(255, Math.max(rgb.g, 0)),
  16294. b: Math.min(255, Math.max(rgb.b, 0)),
  16295. a
  16296. };
  16297. }
  16298. var CSS_UNIT = "(?:".concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:").concat("[-\\+]?\\d+%?", ")");
  16299. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  16300. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  16301. var matchers = {
  16302. CSS_UNIT: new RegExp(CSS_UNIT),
  16303. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  16304. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  16305. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  16306. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  16307. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  16308. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  16309. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  16310. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  16311. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  16312. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  16313. };
  16314. /**
  16315. * Permissive string parsing. Take in a number of formats, and output an object
  16316. * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
  16317. */
  16318. function stringInputToObject(color) {
  16319. color = color.trim().toLowerCase();
  16320. if (color.length === 0) return false;
  16321. var named = false;
  16322. if (names[color]) {
  16323. color = names[color];
  16324. named = true;
  16325. } else if (color === "transparent") return {
  16326. r: 0,
  16327. g: 0,
  16328. b: 0,
  16329. a: 0,
  16330. format: "name"
  16331. };
  16332. var match = matchers.rgb.exec(color);
  16333. if (match) return {
  16334. r: match[1],
  16335. g: match[2],
  16336. b: match[3]
  16337. };
  16338. match = matchers.rgba.exec(color);
  16339. if (match) return {
  16340. r: match[1],
  16341. g: match[2],
  16342. b: match[3],
  16343. a: match[4]
  16344. };
  16345. match = matchers.hsl.exec(color);
  16346. if (match) return {
  16347. h: match[1],
  16348. s: match[2],
  16349. l: match[3]
  16350. };
  16351. match = matchers.hsla.exec(color);
  16352. if (match) return {
  16353. h: match[1],
  16354. s: match[2],
  16355. l: match[3],
  16356. a: match[4]
  16357. };
  16358. match = matchers.hsv.exec(color);
  16359. if (match) return {
  16360. h: match[1],
  16361. s: match[2],
  16362. v: match[3]
  16363. };
  16364. match = matchers.hsva.exec(color);
  16365. if (match) return {
  16366. h: match[1],
  16367. s: match[2],
  16368. v: match[3],
  16369. a: match[4]
  16370. };
  16371. match = matchers.hex8.exec(color);
  16372. if (match) return {
  16373. r: parseIntFromHex(match[1]),
  16374. g: parseIntFromHex(match[2]),
  16375. b: parseIntFromHex(match[3]),
  16376. a: convertHexToDecimal(match[4]),
  16377. format: named ? "name" : "hex8"
  16378. };
  16379. match = matchers.hex6.exec(color);
  16380. if (match) return {
  16381. r: parseIntFromHex(match[1]),
  16382. g: parseIntFromHex(match[2]),
  16383. b: parseIntFromHex(match[3]),
  16384. format: named ? "name" : "hex"
  16385. };
  16386. match = matchers.hex4.exec(color);
  16387. if (match) return {
  16388. r: parseIntFromHex(match[1] + match[1]),
  16389. g: parseIntFromHex(match[2] + match[2]),
  16390. b: parseIntFromHex(match[3] + match[3]),
  16391. a: convertHexToDecimal(match[4] + match[4]),
  16392. format: named ? "name" : "hex8"
  16393. };
  16394. match = matchers.hex3.exec(color);
  16395. if (match) return {
  16396. r: parseIntFromHex(match[1] + match[1]),
  16397. g: parseIntFromHex(match[2] + match[2]),
  16398. b: parseIntFromHex(match[3] + match[3]),
  16399. format: named ? "name" : "hex"
  16400. };
  16401. return false;
  16402. }
  16403. /**
  16404. * Check to see if it looks like a CSS unit
  16405. * (see `matchers` above for definition).
  16406. */
  16407. function isValidCSSUnit(color) {
  16408. return Boolean(matchers.CSS_UNIT.exec(String(color)));
  16409. }
  16410. //#endregion
  16411. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/index.js
  16412. var TinyColor = function() {
  16413. function TinyColor(color, opts) {
  16414. if (color === void 0) color = "";
  16415. if (opts === void 0) opts = {};
  16416. var _a;
  16417. if (color instanceof TinyColor) return color;
  16418. if (typeof color === "number") color = numberInputToObject(color);
  16419. this.originalInput = color;
  16420. var rgb = inputToRGB(color);
  16421. this.originalInput = color;
  16422. this.r = rgb.r;
  16423. this.g = rgb.g;
  16424. this.b = rgb.b;
  16425. this.a = rgb.a;
  16426. this.roundA = Math.round(100 * this.a) / 100;
  16427. this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
  16428. this.gradientType = opts.gradientType;
  16429. if (this.r < 1) this.r = Math.round(this.r);
  16430. if (this.g < 1) this.g = Math.round(this.g);
  16431. if (this.b < 1) this.b = Math.round(this.b);
  16432. this.isValid = rgb.ok;
  16433. }
  16434. TinyColor.prototype.isDark = function() {
  16435. return this.getBrightness() < 128;
  16436. };
  16437. TinyColor.prototype.isLight = function() {
  16438. return !this.isDark();
  16439. };
  16440. /**
  16441. * Returns the perceived brightness of the color, from 0-255.
  16442. */
  16443. TinyColor.prototype.getBrightness = function() {
  16444. var rgb = this.toRgb();
  16445. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  16446. };
  16447. /**
  16448. * Returns the perceived luminance of a color, from 0-1.
  16449. */
  16450. TinyColor.prototype.getLuminance = function() {
  16451. var rgb = this.toRgb();
  16452. var R;
  16453. var G;
  16454. var B;
  16455. var RsRGB = rgb.r / 255;
  16456. var GsRGB = rgb.g / 255;
  16457. var BsRGB = rgb.b / 255;
  16458. if (RsRGB <= .03928) R = RsRGB / 12.92;
  16459. else R = Math.pow((RsRGB + .055) / 1.055, 2.4);
  16460. if (GsRGB <= .03928) G = GsRGB / 12.92;
  16461. else G = Math.pow((GsRGB + .055) / 1.055, 2.4);
  16462. if (BsRGB <= .03928) B = BsRGB / 12.92;
  16463. else B = Math.pow((BsRGB + .055) / 1.055, 2.4);
  16464. return .2126 * R + .7152 * G + .0722 * B;
  16465. };
  16466. /**
  16467. * Returns the alpha value of a color, from 0-1.
  16468. */
  16469. TinyColor.prototype.getAlpha = function() {
  16470. return this.a;
  16471. };
  16472. /**
  16473. * Sets the alpha value on the current color.
  16474. *
  16475. * @param alpha - The new alpha value. The accepted range is 0-1.
  16476. */
  16477. TinyColor.prototype.setAlpha = function(alpha) {
  16478. this.a = boundAlpha(alpha);
  16479. this.roundA = Math.round(100 * this.a) / 100;
  16480. return this;
  16481. };
  16482. /**
  16483. * Returns whether the color is monochrome.
  16484. */
  16485. TinyColor.prototype.isMonochrome = function() {
  16486. return this.toHsl().s === 0;
  16487. };
  16488. /**
  16489. * Returns the object as a HSVA object.
  16490. */
  16491. TinyColor.prototype.toHsv = function() {
  16492. var hsv = rgbToHsv(this.r, this.g, this.b);
  16493. return {
  16494. h: hsv.h * 360,
  16495. s: hsv.s,
  16496. v: hsv.v,
  16497. a: this.a
  16498. };
  16499. };
  16500. /**
  16501. * Returns the hsva values interpolated into a string with the following format:
  16502. * "hsva(xxx, xxx, xxx, xx)".
  16503. */
  16504. TinyColor.prototype.toHsvString = function() {
  16505. var hsv = rgbToHsv(this.r, this.g, this.b);
  16506. var h = Math.round(hsv.h * 360);
  16507. var s = Math.round(hsv.s * 100);
  16508. var v = Math.round(hsv.v * 100);
  16509. return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  16510. };
  16511. /**
  16512. * Returns the object as a HSLA object.
  16513. */
  16514. TinyColor.prototype.toHsl = function() {
  16515. var hsl = rgbToHsl(this.r, this.g, this.b);
  16516. return {
  16517. h: hsl.h * 360,
  16518. s: hsl.s,
  16519. l: hsl.l,
  16520. a: this.a
  16521. };
  16522. };
  16523. /**
  16524. * Returns the hsla values interpolated into a string with the following format:
  16525. * "hsla(xxx, xxx, xxx, xx)".
  16526. */
  16527. TinyColor.prototype.toHslString = function() {
  16528. var hsl = rgbToHsl(this.r, this.g, this.b);
  16529. var h = Math.round(hsl.h * 360);
  16530. var s = Math.round(hsl.s * 100);
  16531. var l = Math.round(hsl.l * 100);
  16532. return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  16533. };
  16534. /**
  16535. * Returns the hex value of the color.
  16536. * @param allow3Char will shorten hex value to 3 char if possible
  16537. */
  16538. TinyColor.prototype.toHex = function(allow3Char) {
  16539. if (allow3Char === void 0) allow3Char = false;
  16540. return rgbToHex(this.r, this.g, this.b, allow3Char);
  16541. };
  16542. /**
  16543. * Returns the hex value of the color -with a # prefixed.
  16544. * @param allow3Char will shorten hex value to 3 char if possible
  16545. */
  16546. TinyColor.prototype.toHexString = function(allow3Char) {
  16547. if (allow3Char === void 0) allow3Char = false;
  16548. return "#" + this.toHex(allow3Char);
  16549. };
  16550. /**
  16551. * Returns the hex 8 value of the color.
  16552. * @param allow4Char will shorten hex value to 4 char if possible
  16553. */
  16554. TinyColor.prototype.toHex8 = function(allow4Char) {
  16555. if (allow4Char === void 0) allow4Char = false;
  16556. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  16557. };
  16558. /**
  16559. * Returns the hex 8 value of the color -with a # prefixed.
  16560. * @param allow4Char will shorten hex value to 4 char if possible
  16561. */
  16562. TinyColor.prototype.toHex8String = function(allow4Char) {
  16563. if (allow4Char === void 0) allow4Char = false;
  16564. return "#" + this.toHex8(allow4Char);
  16565. };
  16566. /**
  16567. * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
  16568. * @param allowShortChar will shorten hex value to 3 or 4 char if possible
  16569. */
  16570. TinyColor.prototype.toHexShortString = function(allowShortChar) {
  16571. if (allowShortChar === void 0) allowShortChar = false;
  16572. return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
  16573. };
  16574. /**
  16575. * Returns the object as a RGBA object.
  16576. */
  16577. TinyColor.prototype.toRgb = function() {
  16578. return {
  16579. r: Math.round(this.r),
  16580. g: Math.round(this.g),
  16581. b: Math.round(this.b),
  16582. a: this.a
  16583. };
  16584. };
  16585. /**
  16586. * Returns the RGBA values interpolated into a string with the following format:
  16587. * "RGBA(xxx, xxx, xxx, xx)".
  16588. */
  16589. TinyColor.prototype.toRgbString = function() {
  16590. var r = Math.round(this.r);
  16591. var g = Math.round(this.g);
  16592. var b = Math.round(this.b);
  16593. return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  16594. };
  16595. /**
  16596. * Returns the object as a RGBA object.
  16597. */
  16598. TinyColor.prototype.toPercentageRgb = function() {
  16599. var fmt = function(x) {
  16600. return "".concat(Math.round(bound01(x, 255) * 100), "%");
  16601. };
  16602. return {
  16603. r: fmt(this.r),
  16604. g: fmt(this.g),
  16605. b: fmt(this.b),
  16606. a: this.a
  16607. };
  16608. };
  16609. /**
  16610. * Returns the RGBA relative values interpolated into a string
  16611. */
  16612. TinyColor.prototype.toPercentageRgbString = function() {
  16613. var rnd = function(x) {
  16614. return Math.round(bound01(x, 255) * 100);
  16615. };
  16616. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  16617. };
  16618. /**
  16619. * The 'real' name of the color -if there is one.
  16620. */
  16621. TinyColor.prototype.toName = function() {
  16622. if (this.a === 0) return "transparent";
  16623. if (this.a < 1) return false;
  16624. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  16625. for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
  16626. var _b = _a[_i], key = _b[0];
  16627. if (hex === _b[1]) return key;
  16628. }
  16629. return false;
  16630. };
  16631. TinyColor.prototype.toString = function(format) {
  16632. var formatSet = Boolean(format);
  16633. format = format !== null && format !== void 0 ? format : this.format;
  16634. var formattedString = false;
  16635. var hasAlpha = this.a < 1 && this.a >= 0;
  16636. if (!formatSet && hasAlpha && (format.startsWith("hex") || format === "name")) {
  16637. if (format === "name" && this.a === 0) return this.toName();
  16638. return this.toRgbString();
  16639. }
  16640. if (format === "rgb") formattedString = this.toRgbString();
  16641. if (format === "prgb") formattedString = this.toPercentageRgbString();
  16642. if (format === "hex" || format === "hex6") formattedString = this.toHexString();
  16643. if (format === "hex3") formattedString = this.toHexString(true);
  16644. if (format === "hex4") formattedString = this.toHex8String(true);
  16645. if (format === "hex8") formattedString = this.toHex8String();
  16646. if (format === "name") formattedString = this.toName();
  16647. if (format === "hsl") formattedString = this.toHslString();
  16648. if (format === "hsv") formattedString = this.toHsvString();
  16649. return formattedString || this.toHexString();
  16650. };
  16651. TinyColor.prototype.toNumber = function() {
  16652. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  16653. };
  16654. TinyColor.prototype.clone = function() {
  16655. return new TinyColor(this.toString());
  16656. };
  16657. /**
  16658. * Lighten the color a given amount. Providing 100 will always return white.
  16659. * @param amount - valid between 1-100
  16660. */
  16661. TinyColor.prototype.lighten = function(amount) {
  16662. if (amount === void 0) amount = 10;
  16663. var hsl = this.toHsl();
  16664. hsl.l += amount / 100;
  16665. hsl.l = clamp01(hsl.l);
  16666. return new TinyColor(hsl);
  16667. };
  16668. /**
  16669. * Brighten the color a given amount, from 0 to 100.
  16670. * @param amount - valid between 1-100
  16671. */
  16672. TinyColor.prototype.brighten = function(amount) {
  16673. if (amount === void 0) amount = 10;
  16674. var rgb = this.toRgb();
  16675. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  16676. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  16677. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  16678. return new TinyColor(rgb);
  16679. };
  16680. /**
  16681. * Darken the color a given amount, from 0 to 100.
  16682. * Providing 100 will always return black.
  16683. * @param amount - valid between 1-100
  16684. */
  16685. TinyColor.prototype.darken = function(amount) {
  16686. if (amount === void 0) amount = 10;
  16687. var hsl = this.toHsl();
  16688. hsl.l -= amount / 100;
  16689. hsl.l = clamp01(hsl.l);
  16690. return new TinyColor(hsl);
  16691. };
  16692. /**
  16693. * Mix the color with pure white, from 0 to 100.
  16694. * Providing 0 will do nothing, providing 100 will always return white.
  16695. * @param amount - valid between 1-100
  16696. */
  16697. TinyColor.prototype.tint = function(amount) {
  16698. if (amount === void 0) amount = 10;
  16699. return this.mix("white", amount);
  16700. };
  16701. /**
  16702. * Mix the color with pure black, from 0 to 100.
  16703. * Providing 0 will do nothing, providing 100 will always return black.
  16704. * @param amount - valid between 1-100
  16705. */
  16706. TinyColor.prototype.shade = function(amount) {
  16707. if (amount === void 0) amount = 10;
  16708. return this.mix("black", amount);
  16709. };
  16710. /**
  16711. * Desaturate the color a given amount, from 0 to 100.
  16712. * Providing 100 will is the same as calling greyscale
  16713. * @param amount - valid between 1-100
  16714. */
  16715. TinyColor.prototype.desaturate = function(amount) {
  16716. if (amount === void 0) amount = 10;
  16717. var hsl = this.toHsl();
  16718. hsl.s -= amount / 100;
  16719. hsl.s = clamp01(hsl.s);
  16720. return new TinyColor(hsl);
  16721. };
  16722. /**
  16723. * Saturate the color a given amount, from 0 to 100.
  16724. * @param amount - valid between 1-100
  16725. */
  16726. TinyColor.prototype.saturate = function(amount) {
  16727. if (amount === void 0) amount = 10;
  16728. var hsl = this.toHsl();
  16729. hsl.s += amount / 100;
  16730. hsl.s = clamp01(hsl.s);
  16731. return new TinyColor(hsl);
  16732. };
  16733. /**
  16734. * Completely desaturates a color into greyscale.
  16735. * Same as calling `desaturate(100)`
  16736. */
  16737. TinyColor.prototype.greyscale = function() {
  16738. return this.desaturate(100);
  16739. };
  16740. /**
  16741. * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
  16742. * Values outside of this range will be wrapped into this range.
  16743. */
  16744. TinyColor.prototype.spin = function(amount) {
  16745. var hsl = this.toHsl();
  16746. var hue = (hsl.h + amount) % 360;
  16747. hsl.h = hue < 0 ? 360 + hue : hue;
  16748. return new TinyColor(hsl);
  16749. };
  16750. /**
  16751. * Mix the current color a given amount with another color, from 0 to 100.
  16752. * 0 means no mixing (return current color).
  16753. */
  16754. TinyColor.prototype.mix = function(color, amount) {
  16755. if (amount === void 0) amount = 50;
  16756. var rgb1 = this.toRgb();
  16757. var rgb2 = new TinyColor(color).toRgb();
  16758. var p = amount / 100;
  16759. return new TinyColor({
  16760. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  16761. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  16762. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  16763. a: (rgb2.a - rgb1.a) * p + rgb1.a
  16764. });
  16765. };
  16766. TinyColor.prototype.analogous = function(results, slices) {
  16767. if (results === void 0) results = 6;
  16768. if (slices === void 0) slices = 30;
  16769. var hsl = this.toHsl();
  16770. var part = 360 / slices;
  16771. var ret = [this];
  16772. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
  16773. hsl.h = (hsl.h + part) % 360;
  16774. ret.push(new TinyColor(hsl));
  16775. }
  16776. return ret;
  16777. };
  16778. /**
  16779. * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
  16780. */
  16781. TinyColor.prototype.complement = function() {
  16782. var hsl = this.toHsl();
  16783. hsl.h = (hsl.h + 180) % 360;
  16784. return new TinyColor(hsl);
  16785. };
  16786. TinyColor.prototype.monochromatic = function(results) {
  16787. if (results === void 0) results = 6;
  16788. var hsv = this.toHsv();
  16789. var h = hsv.h;
  16790. var s = hsv.s;
  16791. var v = hsv.v;
  16792. var res = [];
  16793. var modification = 1 / results;
  16794. while (results--) {
  16795. res.push(new TinyColor({
  16796. h,
  16797. s,
  16798. v
  16799. }));
  16800. v = (v + modification) % 1;
  16801. }
  16802. return res;
  16803. };
  16804. TinyColor.prototype.splitcomplement = function() {
  16805. var hsl = this.toHsl();
  16806. var h = hsl.h;
  16807. return [
  16808. this,
  16809. new TinyColor({
  16810. h: (h + 72) % 360,
  16811. s: hsl.s,
  16812. l: hsl.l
  16813. }),
  16814. new TinyColor({
  16815. h: (h + 216) % 360,
  16816. s: hsl.s,
  16817. l: hsl.l
  16818. })
  16819. ];
  16820. };
  16821. /**
  16822. * Compute how the color would appear on a background
  16823. */
  16824. TinyColor.prototype.onBackground = function(background) {
  16825. var fg = this.toRgb();
  16826. var bg = new TinyColor(background).toRgb();
  16827. var alpha = fg.a + bg.a * (1 - fg.a);
  16828. return new TinyColor({
  16829. r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
  16830. g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
  16831. b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
  16832. a: alpha
  16833. });
  16834. };
  16835. /**
  16836. * Alias for `polyad(3)`
  16837. */
  16838. TinyColor.prototype.triad = function() {
  16839. return this.polyad(3);
  16840. };
  16841. /**
  16842. * Alias for `polyad(4)`
  16843. */
  16844. TinyColor.prototype.tetrad = function() {
  16845. return this.polyad(4);
  16846. };
  16847. /**
  16848. * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
  16849. * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
  16850. */
  16851. TinyColor.prototype.polyad = function(n) {
  16852. var hsl = this.toHsl();
  16853. var h = hsl.h;
  16854. var result = [this];
  16855. var increment = 360 / n;
  16856. for (var i = 1; i < n; i++) result.push(new TinyColor({
  16857. h: (h + i * increment) % 360,
  16858. s: hsl.s,
  16859. l: hsl.l
  16860. }));
  16861. return result;
  16862. };
  16863. /**
  16864. * compare color vs current color
  16865. */
  16866. TinyColor.prototype.equals = function(color) {
  16867. return this.toRgbString() === new TinyColor(color).toRgbString();
  16868. };
  16869. return TinyColor;
  16870. }();
  16871. //#endregion
  16872. //#region ../../packages/components/button/src/button-custom.ts
  16873. function darken(color, amount = 20) {
  16874. return color.mix("#141414", amount).toString();
  16875. }
  16876. function useButtonCustomStyle(props) {
  16877. const _disabled = useFormDisabled();
  16878. const ns = useNamespace("button");
  16879. return computed(() => {
  16880. let styles = {};
  16881. let buttonColor = props.color;
  16882. if (buttonColor) {
  16883. const match = buttonColor.match(/var\((.*?)\)/);
  16884. if (match) buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
  16885. const color = new TinyColor(buttonColor);
  16886. const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
  16887. if (props.plain) {
  16888. styles = ns.cssVarBlock({
  16889. "bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
  16890. "text-color": buttonColor,
  16891. "border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
  16892. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  16893. "hover-bg-color": buttonColor,
  16894. "hover-border-color": buttonColor,
  16895. "active-bg-color": activeBgColor,
  16896. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  16897. "active-border-color": activeBgColor
  16898. });
  16899. if (_disabled.value) {
  16900. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
  16901. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
  16902. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
  16903. }
  16904. } else {
  16905. const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
  16906. const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  16907. styles = ns.cssVarBlock({
  16908. "bg-color": buttonColor,
  16909. "text-color": textColor,
  16910. "border-color": buttonColor,
  16911. "hover-bg-color": hoverBgColor,
  16912. "hover-text-color": textColor,
  16913. "hover-border-color": hoverBgColor,
  16914. "active-bg-color": activeBgColor,
  16915. "active-border-color": activeBgColor
  16916. });
  16917. if (_disabled.value) {
  16918. const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
  16919. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  16920. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  16921. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  16922. }
  16923. }
  16924. }
  16925. return styles;
  16926. });
  16927. }
  16928. //#endregion
  16929. //#region ../../packages/components/button/src/button.vue?vue&type=script&setup=true&lang.ts
  16930. var button_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ defineComponent({
  16931. name: "ElButton",
  16932. __name: "button",
  16933. props: buttonProps,
  16934. emits: buttonEmits,
  16935. setup(__props, { expose: __expose, emit: __emit }) {
  16936. const props = __props;
  16937. const emit = __emit;
  16938. const buttonStyle = useButtonCustomStyle(props);
  16939. const ns = useNamespace("button");
  16940. const { _ref, _size, _type, _disabled, _props, _plain, _round, _text, _dashed, shouldAddSpace, handleClick } = useButton(props, emit);
  16941. const buttonKls = computed(() => [
  16942. ns.b(),
  16943. ns.m(_type.value),
  16944. ns.m(_size.value),
  16945. ns.is("disabled", _disabled.value),
  16946. ns.is("loading", props.loading),
  16947. ns.is("plain", _plain.value),
  16948. ns.is("round", _round.value),
  16949. ns.is("circle", props.circle),
  16950. ns.is("text", _text.value),
  16951. ns.is("dashed", _dashed.value),
  16952. ns.is("link", props.link),
  16953. ns.is("has-bg", props.bg)
  16954. ]);
  16955. __expose({
  16956. ref: _ref,
  16957. size: _size,
  16958. type: _type,
  16959. disabled: _disabled,
  16960. shouldAddSpace
  16961. });
  16962. return (_ctx, _cache) => {
  16963. return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps({
  16964. ref_key: "_ref",
  16965. ref: _ref
  16966. }, unref(_props), {
  16967. class: buttonKls.value,
  16968. style: unref(buttonStyle),
  16969. onClick: unref(handleClick)
  16970. }), {
  16971. default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
  16972. key: 1,
  16973. class: normalizeClass(unref(ns).is("loading"))
  16974. }, {
  16975. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.loadingIcon)))]),
  16976. _: 1
  16977. }, 8, ["class"]))], 64)) : __props.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  16978. default: withCtx(() => [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })]),
  16979. _: 3
  16980. })) : createCommentVNode("v-if", true), _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
  16981. key: 2,
  16982. class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
  16983. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)]),
  16984. _: 3
  16985. }, 16, [
  16986. "class",
  16987. "style",
  16988. "onClick"
  16989. ]);
  16990. };
  16991. }
  16992. });
  16993. //#endregion
  16994. //#region ../../packages/components/button/src/button.vue
  16995. var button_default$1 = button_vue_vue_type_script_setup_true_lang_default$1;
  16996. //#endregion
  16997. //#region ../../packages/components/button/src/button-group.ts
  16998. /**
  16999. * @deprecated Removed after 3.0.0, Use `ButtonGroupProps` instead.
  17000. */
  17001. const buttonGroupProps = {
  17002. size: buttonProps.size,
  17003. type: buttonProps.type,
  17004. direction: {
  17005. type: definePropType(String),
  17006. values: ["horizontal", "vertical"],
  17007. default: "horizontal"
  17008. }
  17009. };
  17010. //#endregion
  17011. //#region ../../packages/components/button/src/button-group.vue?vue&type=script&setup=true&lang.ts
  17012. var button_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  17013. name: "ElButtonGroup",
  17014. __name: "button-group",
  17015. props: buttonGroupProps,
  17016. setup(__props) {
  17017. const props = __props;
  17018. provide(buttonGroupContextKey, reactive({
  17019. size: toRef(props, "size"),
  17020. type: toRef(props, "type")
  17021. }));
  17022. const ns = useNamespace("button");
  17023. return (_ctx, _cache) => {
  17024. return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("group"), unref(ns).bm("group", props.direction)]) }, [renderSlot(_ctx.$slots, "default")], 2);
  17025. };
  17026. }
  17027. });
  17028. //#endregion
  17029. //#region ../../packages/components/button/src/button-group.vue
  17030. var button_group_default = button_group_vue_vue_type_script_setup_true_lang_default;
  17031. //#endregion
  17032. //#region ../../packages/components/button/index.ts
  17033. const ElButton = withInstall(button_default$1, { ButtonGroup: button_group_default });
  17034. const ElButtonGroup = withNoopInstall(button_group_default);
  17035. //#endregion
  17036. //#region ../../packages/components/calendar/src/calendar.ts
  17037. const isValidRange$1 = (range) => isArray$1(range) && range.length === 2 && range.every((item) => isDate(item));
  17038. /**
  17039. * @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
  17040. */
  17041. const calendarProps = buildProps({
  17042. modelValue: { type: Date },
  17043. range: {
  17044. type: definePropType(Array),
  17045. validator: isValidRange$1
  17046. },
  17047. controllerType: {
  17048. type: String,
  17049. values: ["button", "select"],
  17050. default: "button"
  17051. },
  17052. formatter: { type: definePropType(Function) }
  17053. });
  17054. const calendarEmits = {
  17055. [UPDATE_MODEL_EVENT]: (value) => isDate(value),
  17056. [INPUT_EVENT]: (value) => isDate(value)
  17057. };
  17058. //#endregion
  17059. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
  17060. var require_dayjs_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  17061. (function(t, e) {
  17062. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
  17063. })(exports, (function() {
  17064. "use strict";
  17065. var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "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 = {
  17066. name: "en",
  17067. weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
  17068. months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
  17069. ordinal: function(t) {
  17070. var e = [
  17071. "th",
  17072. "st",
  17073. "nd",
  17074. "rd"
  17075. ], n = t % 100;
  17076. return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
  17077. }
  17078. }, m = function(t, e, n) {
  17079. var r = String(t);
  17080. return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
  17081. }, v = {
  17082. s: m,
  17083. z: function(t) {
  17084. var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60;
  17085. return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
  17086. },
  17087. m: function t(e, n) {
  17088. if (e.date() < n.date()) return -t(n, e);
  17089. var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, c), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), c);
  17090. return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
  17091. },
  17092. a: function(t) {
  17093. return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
  17094. },
  17095. p: function(t) {
  17096. return {
  17097. M: c,
  17098. y: h,
  17099. w: o,
  17100. d: a,
  17101. D: d,
  17102. h: u,
  17103. m: s,
  17104. s: i,
  17105. ms: r,
  17106. Q: f
  17107. }[t] || String(t || "").toLowerCase().replace(/s$/, "");
  17108. },
  17109. u: function(t) {
  17110. return void 0 === t;
  17111. }
  17112. }, g = "en", D = {};
  17113. D[g] = M;
  17114. var p = "$isDayjsObject", S = function(t) {
  17115. return t instanceof _ || !(!t || !t[p]);
  17116. }, w = function t(e, n, r) {
  17117. var i;
  17118. if (!e) return g;
  17119. if ("string" == typeof e) {
  17120. var s = e.toLowerCase();
  17121. D[s] && (i = s), n && (D[s] = n, i = s);
  17122. var u = e.split("-");
  17123. if (!i && u.length > 1) return t(u[0]);
  17124. } else {
  17125. var a = e.name;
  17126. D[a] = e, i = a;
  17127. }
  17128. return !r && i && (g = i), i || !r && g;
  17129. }, O = function(t, e) {
  17130. if (S(t)) return t.clone();
  17131. var n = "object" == typeof e ? e : {};
  17132. return n.date = t, n.args = arguments, new _(n);
  17133. }, b = v;
  17134. b.l = w, b.i = S, b.w = function(t, e) {
  17135. return O(t, {
  17136. locale: e.$L,
  17137. utc: e.$u,
  17138. x: e.$x,
  17139. $offset: e.$offset
  17140. });
  17141. };
  17142. var _ = function() {
  17143. function M(t) {
  17144. this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0;
  17145. }
  17146. var m = M.prototype;
  17147. return m.parse = function(t) {
  17148. this.$d = function(t) {
  17149. var e = t.date, n = t.utc;
  17150. if (null === e) return /* @__PURE__ */ new Date(NaN);
  17151. if (b.u(e)) return /* @__PURE__ */ new Date();
  17152. if (e instanceof Date) return new Date(e);
  17153. if ("string" == typeof e && !/Z$/i.test(e)) {
  17154. var r = e.match($);
  17155. if (r) {
  17156. var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3);
  17157. return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
  17158. }
  17159. }
  17160. return new Date(e);
  17161. }(t), this.init();
  17162. }, m.init = function() {
  17163. var t = this.$d;
  17164. this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
  17165. }, m.$utils = function() {
  17166. return b;
  17167. }, m.isValid = function() {
  17168. return !(this.$d.toString() === l);
  17169. }, m.isSame = function(t, e) {
  17170. var n = O(t);
  17171. return this.startOf(e) <= n && n <= this.endOf(e);
  17172. }, m.isAfter = function(t, e) {
  17173. return O(t) < this.startOf(e);
  17174. }, m.isBefore = function(t, e) {
  17175. return this.endOf(e) < O(t);
  17176. }, m.$g = function(t, e, n) {
  17177. return b.u(t) ? this[e] : this.set(n, t);
  17178. }, m.unix = function() {
  17179. return Math.floor(this.valueOf() / 1e3);
  17180. }, m.valueOf = function() {
  17181. return this.$d.getTime();
  17182. }, m.startOf = function(t, e) {
  17183. var n = this, r = !!b.u(e) || e, f = b.p(t), l = function(t, e) {
  17184. var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
  17185. return r ? i : i.endOf(a);
  17186. }, $ = function(t, e) {
  17187. return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [
  17188. 0,
  17189. 0,
  17190. 0,
  17191. 0
  17192. ] : [
  17193. 23,
  17194. 59,
  17195. 59,
  17196. 999
  17197. ]).slice(e)), n);
  17198. }, y = this.$W, M = this.$M, m = this.$D, v = "set" + (this.$u ? "UTC" : "");
  17199. switch (f) {
  17200. case h: return r ? l(1, 0) : l(31, 11);
  17201. case c: return r ? l(1, M) : l(0, M + 1);
  17202. case o:
  17203. var g = this.$locale().weekStart || 0, D = (y < g ? y + 7 : y) - g;
  17204. return l(r ? m - D : m + (6 - D), M);
  17205. case a:
  17206. case d: return $(v + "Hours", 0);
  17207. case u: return $(v + "Minutes", 1);
  17208. case s: return $(v + "Seconds", 2);
  17209. case i: return $(v + "Milliseconds", 3);
  17210. default: return this.clone();
  17211. }
  17212. }, m.endOf = function(t) {
  17213. return this.startOf(t, !1);
  17214. }, m.$set = function(t, e) {
  17215. var n, o = b.p(t), f = "set" + (this.$u ? "UTC" : ""), l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o], $ = o === a ? this.$D + (e - this.$W) : e;
  17216. if (o === c || o === h) {
  17217. var y = this.clone().set(d, 1);
  17218. y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
  17219. } else l && this.$d[l]($);
  17220. return this.init(), this;
  17221. }, m.set = function(t, e) {
  17222. return this.clone().$set(t, e);
  17223. }, m.get = function(t) {
  17224. return this[b.p(t)]();
  17225. }, m.add = function(r, f) {
  17226. var d, l = this;
  17227. r = Number(r);
  17228. var $ = b.p(f), y = function(t) {
  17229. var e = O(l);
  17230. return b.w(e.date(e.date() + Math.round(t * r)), l);
  17231. };
  17232. if ($ === c) return this.set(c, this.$M + r);
  17233. if ($ === h) return this.set(h, this.$y + r);
  17234. if ($ === a) return y(1);
  17235. if ($ === o) return y(7);
  17236. var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, m = this.$d.getTime() + r * M;
  17237. return b.w(m, this);
  17238. }, m.subtract = function(t, e) {
  17239. return this.add(-1 * t, e);
  17240. }, m.format = function(t) {
  17241. var e = this, n = this.$locale();
  17242. if (!this.isValid()) return n.invalidDate || l;
  17243. var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = b.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, c = n.months, f = n.meridiem, h = function(t, n, i, s) {
  17244. return t && (t[n] || t(e, r)) || i[n].slice(0, s);
  17245. }, d = function(t) {
  17246. return b.s(s % 12 || 12, t, "0");
  17247. }, $ = f || function(t, e, n) {
  17248. var r = t < 12 ? "AM" : "PM";
  17249. return n ? r.toLowerCase() : r;
  17250. };
  17251. return r.replace(y, (function(t, r) {
  17252. return r || function(t) {
  17253. switch (t) {
  17254. case "YY": return String(e.$y).slice(-2);
  17255. case "YYYY": return b.s(e.$y, 4, "0");
  17256. case "M": return a + 1;
  17257. case "MM": return b.s(a + 1, 2, "0");
  17258. case "MMM": return h(n.monthsShort, a, c, 3);
  17259. case "MMMM": return h(c, a);
  17260. case "D": return e.$D;
  17261. case "DD": return b.s(e.$D, 2, "0");
  17262. case "d": return String(e.$W);
  17263. case "dd": return h(n.weekdaysMin, e.$W, o, 2);
  17264. case "ddd": return h(n.weekdaysShort, e.$W, o, 3);
  17265. case "dddd": return o[e.$W];
  17266. case "H": return String(s);
  17267. case "HH": return b.s(s, 2, "0");
  17268. case "h": return d(1);
  17269. case "hh": return d(2);
  17270. case "a": return $(s, u, !0);
  17271. case "A": return $(s, u, !1);
  17272. case "m": return String(u);
  17273. case "mm": return b.s(u, 2, "0");
  17274. case "s": return String(e.$s);
  17275. case "ss": return b.s(e.$s, 2, "0");
  17276. case "SSS": return b.s(e.$ms, 3, "0");
  17277. case "Z": return i;
  17278. }
  17279. return null;
  17280. }(t) || i.replace(":", "");
  17281. }));
  17282. }, m.utcOffset = function() {
  17283. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  17284. }, m.diff = function(r, d, l) {
  17285. var $, y = this, M = b.p(d), m = O(r), v = (m.utcOffset() - this.utcOffset()) * e, g = this - m, D = function() {
  17286. return b.m(y, m);
  17287. };
  17288. switch (M) {
  17289. case h:
  17290. $ = D() / 12;
  17291. break;
  17292. case c:
  17293. $ = D();
  17294. break;
  17295. case f:
  17296. $ = D() / 3;
  17297. break;
  17298. case o:
  17299. $ = (g - v) / 6048e5;
  17300. break;
  17301. case a:
  17302. $ = (g - v) / 864e5;
  17303. break;
  17304. case u:
  17305. $ = g / n;
  17306. break;
  17307. case s:
  17308. $ = g / e;
  17309. break;
  17310. case i:
  17311. $ = g / t;
  17312. break;
  17313. default: $ = g;
  17314. }
  17315. return l ? $ : b.a($);
  17316. }, m.daysInMonth = function() {
  17317. return this.endOf(c).$D;
  17318. }, m.$locale = function() {
  17319. return D[this.$L];
  17320. }, m.locale = function(t, e) {
  17321. if (!t) return this.$L;
  17322. var n = this.clone(), r = w(t, e, !0);
  17323. return r && (n.$L = r), n;
  17324. }, m.clone = function() {
  17325. return b.w(this.$d, this);
  17326. }, m.toDate = function() {
  17327. return new Date(this.valueOf());
  17328. }, m.toJSON = function() {
  17329. return this.isValid() ? this.toISOString() : null;
  17330. }, m.toISOString = function() {
  17331. return this.$d.toISOString();
  17332. }, m.toString = function() {
  17333. return this.$d.toUTCString();
  17334. }, M;
  17335. }(), k = _.prototype;
  17336. return O.prototype = k, [
  17337. ["$ms", r],
  17338. ["$s", i],
  17339. ["$m", s],
  17340. ["$H", u],
  17341. ["$W", a],
  17342. ["$M", c],
  17343. ["$y", h],
  17344. ["$D", d]
  17345. ].forEach((function(t) {
  17346. k[t[1]] = function(e) {
  17347. return this.$g(e, t[0], t[1]);
  17348. };
  17349. })), O.extend = function(t, e) {
  17350. return t.$i || (t(e, _, O), t.$i = !0), O;
  17351. }, O.locale = w, O.isDayjs = S, O.unix = function(t) {
  17352. return O(1e3 * t);
  17353. }, O.en = D[g], O.Ls = D, O.p = {}, O;
  17354. }));
  17355. }));
  17356. //#endregion
  17357. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js
  17358. var require_customParseFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  17359. (function(e, t) {
  17360. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
  17361. })(exports, (function() {
  17362. "use strict";
  17363. var e = {
  17364. LTS: "h:mm:ss A",
  17365. LT: "h:mm A",
  17366. L: "MM/DD/YYYY",
  17367. LL: "MMMM D, YYYY",
  17368. LLL: "MMMM D, YYYY h:mm A",
  17369. LLLL: "dddd, MMMM D, YYYY h:mm A"
  17370. }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e) {
  17371. return (e = +e) + (e > 68 ? 1900 : 2e3);
  17372. };
  17373. var f = function(e) {
  17374. return function(t) {
  17375. this[e] = +t;
  17376. };
  17377. }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e) {
  17378. (this.zone || (this.zone = {})).offset = function(e) {
  17379. if (!e) return 0;
  17380. if ("Z" === e) return 0;
  17381. var t = e.match(/([+-]|\d\d)/g), n = 60 * t[1] + (+t[2] || 0);
  17382. return 0 === n ? 0 : "+" === t[0] ? -n : n;
  17383. }(e);
  17384. }], u = function(e) {
  17385. var t = s[e];
  17386. return t && (t.indexOf ? t : t.s.concat(t.f));
  17387. }, d = function(e, t) {
  17388. var n, r = s.meridiem;
  17389. if (r) {
  17390. for (var i = 1; i <= 24; i += 1) if (e.indexOf(r(i, 0, t)) > -1) {
  17391. n = i > 12;
  17392. break;
  17393. }
  17394. } else n = e === (t ? "pm" : "PM");
  17395. return n;
  17396. }, c = {
  17397. A: [o, function(e) {
  17398. this.afternoon = d(e, !1);
  17399. }],
  17400. a: [o, function(e) {
  17401. this.afternoon = d(e, !0);
  17402. }],
  17403. Q: [n, function(e) {
  17404. this.month = 3 * (e - 1) + 1;
  17405. }],
  17406. S: [n, function(e) {
  17407. this.milliseconds = 100 * +e;
  17408. }],
  17409. SS: [r, function(e) {
  17410. this.milliseconds = 10 * +e;
  17411. }],
  17412. SSS: [/\d{3}/, function(e) {
  17413. this.milliseconds = +e;
  17414. }],
  17415. s: [i, f("seconds")],
  17416. ss: [i, f("seconds")],
  17417. m: [i, f("minutes")],
  17418. mm: [i, f("minutes")],
  17419. H: [i, f("hours")],
  17420. h: [i, f("hours")],
  17421. HH: [i, f("hours")],
  17422. hh: [i, f("hours")],
  17423. D: [i, f("day")],
  17424. DD: [r, f("day")],
  17425. Do: [o, function(e) {
  17426. var t = s.ordinal;
  17427. if (this.day = e.match(/\d+/)[0], t) for (var r = 1; r <= 31; r += 1) t(r).replace(/\[|\]/g, "") === e && (this.day = r);
  17428. }],
  17429. w: [i, f("week")],
  17430. ww: [r, f("week")],
  17431. M: [i, f("month")],
  17432. MM: [r, f("month")],
  17433. MMM: [o, function(e) {
  17434. var t = u("months"), n = (u("monthsShort") || t.map((function(e) {
  17435. return e.slice(0, 3);
  17436. }))).indexOf(e) + 1;
  17437. if (n < 1) throw new Error();
  17438. this.month = n % 12 || n;
  17439. }],
  17440. MMMM: [o, function(e) {
  17441. var t = u("months").indexOf(e) + 1;
  17442. if (t < 1) throw new Error();
  17443. this.month = t % 12 || t;
  17444. }],
  17445. Y: [/[+-]?\d+/, f("year")],
  17446. YY: [r, function(e) {
  17447. this.year = a(e);
  17448. }],
  17449. YYYY: [/\d{4}/, f("year")],
  17450. Z: h,
  17451. ZZ: h
  17452. };
  17453. function l(n) {
  17454. var r = n, i = s && s.formats;
  17455. for (var o = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t, n, r) {
  17456. var o = r && r.toUpperCase();
  17457. return n || i[r] || e[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e, t, n) {
  17458. return t || n.slice(1);
  17459. }));
  17460. }))).match(t), a = o.length, f = 0; f < a; f += 1) {
  17461. var h = o[f], u = c[h], d = u && u[0], l = u && u[1];
  17462. o[f] = l ? {
  17463. regex: d,
  17464. parser: l
  17465. } : h.replace(/^\[|\]$/g, "");
  17466. }
  17467. return function(e) {
  17468. for (var t = {}, n = 0, r = 0; n < a; n += 1) {
  17469. var i = o[n];
  17470. if ("string" == typeof i) r += i.length;
  17471. else {
  17472. var s = i.regex, f = i.parser, h = e.slice(r), u = s.exec(h)[0];
  17473. f.call(t, u), e = e.replace(u, "");
  17474. }
  17475. }
  17476. return function(e) {
  17477. var t = e.afternoon;
  17478. if (void 0 !== t) {
  17479. var n = e.hours;
  17480. t ? n < 12 && (e.hours += 12) : 12 === n && (e.hours = 0), delete e.afternoon;
  17481. }
  17482. }(t), t;
  17483. };
  17484. }
  17485. return function(e, t, n) {
  17486. n.p.customParseFormat = !0, e && e.parseTwoDigitYear && (a = e.parseTwoDigitYear);
  17487. var r = t.prototype, i = r.parse;
  17488. r.parse = function(e) {
  17489. var t = e.date, r = e.utc, o = e.args;
  17490. this.$u = r;
  17491. var a = o[1];
  17492. if ("string" == typeof a) {
  17493. var f = !0 === o[2], h = !0 === o[3], u = f || h, d = o[2];
  17494. h && (d = o[2]), s = this.$locale(), !f && d && (s = n.Ls[d]), this.$d = function(e, t, n, r) {
  17495. try {
  17496. if (["x", "X"].indexOf(t) > -1) return /* @__PURE__ */ new Date(("X" === t ? 1e3 : 1) * e);
  17497. var i = l(t)(e), o = i.year, s = i.month, a = i.day, f = i.hours, h = i.minutes, u = i.seconds, d = i.milliseconds, c = i.zone, m = i.week, M = /* @__PURE__ */ new Date(), Y = a || (o || s ? 1 : M.getDate()), p = o || M.getFullYear(), v = 0;
  17498. o && !s || (v = s > 0 ? s - 1 : M.getMonth());
  17499. var D, w = f || 0, g = h || 0, y = u || 0, L = d || 0;
  17500. return c ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c.offset * 1e3)) : n ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m && (D = r(D).week(m).toDate()), D);
  17501. } catch (e) {
  17502. return /* @__PURE__ */ new Date("");
  17503. }
  17504. }(t, a, r, n), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), u && t != this.format(a) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
  17505. } else if (a instanceof Array) for (var c = a.length, m = 1; m <= c; m += 1) {
  17506. o[1] = a[m - 1];
  17507. var M = n.apply(this, o);
  17508. if (M.isValid()) {
  17509. this.$d = M.$d, this.$L = M.$L, this.init();
  17510. break;
  17511. }
  17512. m === c && (this.$d = /* @__PURE__ */ new Date(""));
  17513. }
  17514. else i.call(this, e);
  17515. };
  17516. };
  17517. }));
  17518. }));
  17519. //#endregion
  17520. //#region ../../packages/components/time-picker/src/constants.ts
  17521. var import_customParseFormat = /* @__PURE__ */ __toESM(require_customParseFormat());
  17522. var import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min());
  17523. const timeUnits = [
  17524. "hours",
  17525. "minutes",
  17526. "seconds"
  17527. ];
  17528. const PICKER_BASE_INJECTION_KEY = "EP_PICKER_BASE";
  17529. const PICKER_POPPER_OPTIONS_INJECTION_KEY = "ElPopperOptions";
  17530. const ROOT_COMMON_PICKER_INJECTION_KEY = Symbol("commonPickerContextKey");
  17531. const DEFAULT_FORMATS_TIME = "HH:mm:ss";
  17532. const DEFAULT_FORMATS_DATE = "YYYY-MM-DD";
  17533. const DEFAULT_FORMATS_DATEPICKER = {
  17534. date: DEFAULT_FORMATS_DATE,
  17535. dates: DEFAULT_FORMATS_DATE,
  17536. week: "gggg[w]ww",
  17537. year: "YYYY",
  17538. years: "YYYY",
  17539. month: "YYYY-MM",
  17540. months: "YYYY-MM",
  17541. datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`,
  17542. monthrange: "YYYY-MM",
  17543. yearrange: "YYYY",
  17544. daterange: DEFAULT_FORMATS_DATE,
  17545. datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`
  17546. };
  17547. //#endregion
  17548. //#region ../../packages/components/time-picker/src/utils.ts
  17549. const buildTimeList = (value, bound) => {
  17550. return [
  17551. value > 0 ? value - 1 : void 0,
  17552. value,
  17553. value < bound ? value + 1 : void 0
  17554. ];
  17555. };
  17556. const rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
  17557. const extractDateFormat = (format) => {
  17558. return format.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
  17559. };
  17560. const extractTimeFormat = (format) => {
  17561. return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim();
  17562. };
  17563. const dateEquals = function(a, b) {
  17564. const aIsDate = isDate(a);
  17565. const bIsDate = isDate(b);
  17566. if (aIsDate && bIsDate) return a.getTime() === b.getTime();
  17567. if (!aIsDate && !bIsDate) return a === b;
  17568. return false;
  17569. };
  17570. const valueEquals = function(a, b) {
  17571. const aIsArray = isArray$1(a);
  17572. const bIsArray = isArray$1(b);
  17573. if (aIsArray && bIsArray) {
  17574. if (a.length !== b.length) return false;
  17575. return a.every((item, index) => dateEquals(item, b[index]));
  17576. }
  17577. if (!aIsArray && !bIsArray) return dateEquals(a, b);
  17578. return false;
  17579. };
  17580. const parseDate = function(date, format, lang) {
  17581. const day = isEmpty(format) || format === "x" ? (0, import_dayjs_min.default)(date).locale(lang) : (0, import_dayjs_min.default)(date, format).locale(lang);
  17582. return day.isValid() ? day : void 0;
  17583. };
  17584. const formatter = function(date, format, lang) {
  17585. if (isEmpty(format)) return date;
  17586. if (format === "x") return +date;
  17587. return (0, import_dayjs_min.default)(date).locale(lang).format(format);
  17588. };
  17589. const makeList = (total, method) => {
  17590. const arr = [];
  17591. const disabledArr = method?.();
  17592. for (let i = 0; i < total; i++) arr.push(disabledArr?.includes(i) ?? false);
  17593. return arr;
  17594. };
  17595. const dayOrDaysToDate = (dayOrDays) => {
  17596. return isArray$1(dayOrDays) ? dayOrDays.map((d) => d.toDate()) : dayOrDays.toDate();
  17597. };
  17598. //#endregion
  17599. //#region ../../packages/components/time-picker/src/composables/use-common-picker.ts
  17600. const useCommonPicker = (props, emit) => {
  17601. const { lang } = useLocale();
  17602. const pickerVisible = ref(false);
  17603. const pickerActualVisible = ref(false);
  17604. const userInput = ref(null);
  17605. const valueIsEmpty = computed(() => {
  17606. const { modelValue } = props;
  17607. return !modelValue || isArray$1(modelValue) && !modelValue.filter(Boolean).length;
  17608. });
  17609. const emitInput = (input) => {
  17610. if (!valueEquals(props.modelValue, input)) {
  17611. let formatted;
  17612. if (isArray$1(input)) formatted = input.map((item) => formatter(item, props.valueFormat, lang.value));
  17613. else if (input) formatted = formatter(input, props.valueFormat, lang.value);
  17614. emit(UPDATE_MODEL_EVENT, input ? formatted : input, lang.value);
  17615. }
  17616. };
  17617. const parsedValue = computed(() => {
  17618. let dayOrDays;
  17619. if (valueIsEmpty.value) {
  17620. if (pickerOptions.value.getDefaultValue) dayOrDays = pickerOptions.value.getDefaultValue();
  17621. } else if (isArray$1(props.modelValue)) dayOrDays = props.modelValue.map((d) => parseDate(d, props.valueFormat, lang.value));
  17622. else dayOrDays = parseDate(props.modelValue ?? "", props.valueFormat, lang.value);
  17623. if (pickerOptions.value.getRangeAvailableTime) {
  17624. const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays);
  17625. if (!isEqual$1(availableResult, dayOrDays)) {
  17626. dayOrDays = availableResult;
  17627. if (!valueIsEmpty.value) emitInput(dayOrDaysToDate(dayOrDays));
  17628. }
  17629. }
  17630. if (isArray$1(dayOrDays) && dayOrDays.some((day) => !day)) dayOrDays = [];
  17631. return dayOrDays;
  17632. });
  17633. const pickerOptions = ref({});
  17634. const onSetPickerOption = (e) => {
  17635. pickerOptions.value[e[0]] = e[1];
  17636. pickerOptions.value.panelReady = true;
  17637. };
  17638. const onCalendarChange = (e) => {
  17639. emit("calendar-change", e);
  17640. };
  17641. const onPanelChange = (value, mode, view) => {
  17642. emit("panel-change", value, mode, view);
  17643. };
  17644. const onPick = (date = "", visible = false) => {
  17645. pickerVisible.value = visible;
  17646. let result;
  17647. if (isArray$1(date)) result = date.map((_) => _.toDate());
  17648. else result = date ? date.toDate() : date;
  17649. userInput.value = null;
  17650. emitInput(result);
  17651. };
  17652. return {
  17653. parsedValue,
  17654. pickerActualVisible,
  17655. pickerOptions,
  17656. pickerVisible,
  17657. userInput,
  17658. valueIsEmpty,
  17659. emitInput,
  17660. onCalendarChange,
  17661. onPanelChange,
  17662. onPick,
  17663. onSetPickerOption
  17664. };
  17665. };
  17666. //#endregion
  17667. //#region ../../packages/components/time-picker/src/props/shared.ts
  17668. const disabledTimeListsProps = buildProps({
  17669. disabledHours: { type: definePropType(Function) },
  17670. disabledMinutes: { type: definePropType(Function) },
  17671. disabledSeconds: { type: definePropType(Function) }
  17672. });
  17673. const timePanelSharedProps = buildProps({
  17674. visible: Boolean,
  17675. actualVisible: {
  17676. type: Boolean,
  17677. default: void 0
  17678. },
  17679. format: {
  17680. type: String,
  17681. default: ""
  17682. }
  17683. });
  17684. //#endregion
  17685. //#region ../../packages/components/time-picker/src/common/props.ts
  17686. const timePickerDefaultProps = buildProps({
  17687. automaticDropdown: {
  17688. type: Boolean,
  17689. default: true
  17690. },
  17691. id: { type: definePropType([Array, String]) },
  17692. name: { type: definePropType([Array, String]) },
  17693. popperClass: useTooltipContentProps.popperClass,
  17694. popperStyle: useTooltipContentProps.popperStyle,
  17695. format: String,
  17696. valueFormat: String,
  17697. dateFormat: String,
  17698. timeFormat: String,
  17699. type: {
  17700. type: String,
  17701. default: ""
  17702. },
  17703. clearable: {
  17704. type: Boolean,
  17705. default: true
  17706. },
  17707. clearIcon: {
  17708. type: definePropType([String, Object]),
  17709. default: circle_close_default
  17710. },
  17711. editable: {
  17712. type: Boolean,
  17713. default: true
  17714. },
  17715. saveOnBlur: {
  17716. type: Boolean,
  17717. default: true
  17718. },
  17719. prefixIcon: {
  17720. type: definePropType([String, Object]),
  17721. default: ""
  17722. },
  17723. size: useSizeProp,
  17724. readonly: Boolean,
  17725. disabled: {
  17726. type: Boolean,
  17727. default: void 0
  17728. },
  17729. placeholder: {
  17730. type: String,
  17731. default: ""
  17732. },
  17733. popperOptions: {
  17734. type: definePropType(Object),
  17735. default: () => ({})
  17736. },
  17737. modelValue: {
  17738. type: definePropType([
  17739. Date,
  17740. Array,
  17741. String,
  17742. Number
  17743. ]),
  17744. default: ""
  17745. },
  17746. rangeSeparator: {
  17747. type: String,
  17748. default: "-"
  17749. },
  17750. startPlaceholder: String,
  17751. endPlaceholder: String,
  17752. defaultValue: { type: definePropType([Date, Array]) },
  17753. defaultTime: { type: definePropType([Date, Array]) },
  17754. isRange: Boolean,
  17755. ...disabledTimeListsProps,
  17756. disabledDate: { type: Function },
  17757. cellClassName: { type: Function },
  17758. shortcuts: {
  17759. type: Array,
  17760. default: () => []
  17761. },
  17762. arrowControl: Boolean,
  17763. tabindex: {
  17764. type: definePropType([String, Number]),
  17765. default: 0
  17766. },
  17767. validateEvent: {
  17768. type: Boolean,
  17769. default: true
  17770. },
  17771. unlinkPanels: Boolean,
  17772. placement: {
  17773. type: definePropType(String),
  17774. values: Ee,
  17775. default: "bottom"
  17776. },
  17777. fallbackPlacements: {
  17778. type: definePropType(Array),
  17779. default: [
  17780. "bottom",
  17781. "top",
  17782. "right",
  17783. "left"
  17784. ]
  17785. },
  17786. ...useEmptyValuesProps,
  17787. ...useAriaProps(["ariaLabel"]),
  17788. showNow: {
  17789. type: Boolean,
  17790. default: true
  17791. },
  17792. showConfirm: {
  17793. type: Boolean,
  17794. default: true
  17795. },
  17796. showFooter: {
  17797. type: Boolean,
  17798. default: true
  17799. },
  17800. showWeekNumber: Boolean
  17801. });
  17802. const timePickerRangeTriggerProps = buildProps({
  17803. id: { type: definePropType(Array) },
  17804. name: { type: definePropType(Array) },
  17805. modelValue: { type: definePropType([Array, String]) },
  17806. startPlaceholder: String,
  17807. endPlaceholder: String,
  17808. disabled: Boolean
  17809. });
  17810. /**
  17811. * @deprecated Use `timePickerRangeTriggerProps` instead. This will be removed in future versions.
  17812. */
  17813. const timePickerRngeTriggerProps = timePickerRangeTriggerProps;
  17814. //#endregion
  17815. //#region ../../packages/components/time-picker/src/common/picker-range-trigger.vue?vue&type=script&setup=true&lang.ts
  17816. const _hoisted_1$71 = [
  17817. "id",
  17818. "name",
  17819. "placeholder",
  17820. "value",
  17821. "disabled"
  17822. ];
  17823. const _hoisted_2$40 = [
  17824. "id",
  17825. "name",
  17826. "placeholder",
  17827. "value",
  17828. "disabled"
  17829. ];
  17830. var picker_range_trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  17831. name: "PickerRangeTrigger",
  17832. inheritAttrs: false,
  17833. __name: "picker-range-trigger",
  17834. props: timePickerRangeTriggerProps,
  17835. emits: [
  17836. "mouseenter",
  17837. "mouseleave",
  17838. "click",
  17839. "touchstart",
  17840. "focus",
  17841. "blur",
  17842. "startInput",
  17843. "endInput",
  17844. "startChange",
  17845. "endChange"
  17846. ],
  17847. setup(__props, { expose: __expose, emit: __emit }) {
  17848. const props = __props;
  17849. const emit = __emit;
  17850. const { formItem } = useFormItem();
  17851. const { inputId } = useFormItemInputId(reactive({ id: computed(() => props.id?.[0]) }), { formItemContext: formItem });
  17852. const attrs = useAttrs();
  17853. const nsDate = useNamespace("date");
  17854. const nsRange = useNamespace("range");
  17855. const inputRef = ref();
  17856. const endInputRef = ref();
  17857. const { wrapperRef, isFocused } = useFocusController(inputRef, { disabled: computed(() => props.disabled) });
  17858. const handleClick = (evt) => {
  17859. emit("click", evt);
  17860. };
  17861. const handleMouseEnter = (evt) => {
  17862. emit("mouseenter", evt);
  17863. };
  17864. const handleMouseLeave = (evt) => {
  17865. emit("mouseleave", evt);
  17866. };
  17867. const handleTouchStart = (evt) => {
  17868. emit("touchstart", evt);
  17869. };
  17870. const handleStartInput = (evt) => {
  17871. emit("startInput", evt);
  17872. };
  17873. const handleEndInput = (evt) => {
  17874. emit("endInput", evt);
  17875. };
  17876. const handleStartChange = (evt) => {
  17877. emit("startChange", evt);
  17878. };
  17879. const handleEndChange = (evt) => {
  17880. emit("endChange", evt);
  17881. };
  17882. const focus = () => {
  17883. inputRef.value?.focus();
  17884. };
  17885. const blur = () => {
  17886. inputRef.value?.blur();
  17887. endInputRef.value?.blur();
  17888. };
  17889. __expose({
  17890. focus,
  17891. blur
  17892. });
  17893. return (_ctx, _cache) => {
  17894. return openBlock(), createElementBlock("div", {
  17895. ref_key: "wrapperRef",
  17896. ref: wrapperRef,
  17897. class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]),
  17898. style: normalizeStyle(_ctx.$attrs.style),
  17899. onClick: handleClick,
  17900. onMouseenter: handleMouseEnter,
  17901. onMouseleave: handleMouseLeave,
  17902. onTouchstartPassive: handleTouchStart
  17903. }, [
  17904. renderSlot(_ctx.$slots, "prefix"),
  17905. createElementVNode("input", mergeProps(unref(attrs), {
  17906. id: unref(inputId),
  17907. ref_key: "inputRef",
  17908. ref: inputRef,
  17909. name: _ctx.name && _ctx.name[0],
  17910. placeholder: _ctx.startPlaceholder,
  17911. value: _ctx.modelValue && _ctx.modelValue[0],
  17912. class: unref(nsRange).b("input"),
  17913. disabled: _ctx.disabled,
  17914. onInput: handleStartInput,
  17915. onChange: handleStartChange
  17916. }), null, 16, _hoisted_1$71),
  17917. renderSlot(_ctx.$slots, "range-separator"),
  17918. createElementVNode("input", mergeProps(unref(attrs), {
  17919. id: _ctx.id && _ctx.id[1],
  17920. ref_key: "endInputRef",
  17921. ref: endInputRef,
  17922. name: _ctx.name && _ctx.name[1],
  17923. placeholder: _ctx.endPlaceholder,
  17924. value: _ctx.modelValue && _ctx.modelValue[1],
  17925. class: unref(nsRange).b("input"),
  17926. disabled: _ctx.disabled,
  17927. onInput: handleEndInput,
  17928. onChange: handleEndChange
  17929. }), null, 16, _hoisted_2$40),
  17930. renderSlot(_ctx.$slots, "suffix")
  17931. ], 38);
  17932. };
  17933. }
  17934. });
  17935. //#endregion
  17936. //#region ../../packages/components/time-picker/src/common/picker-range-trigger.vue
  17937. var picker_range_trigger_default = picker_range_trigger_vue_vue_type_script_setup_true_lang_default;
  17938. //#endregion
  17939. //#region ../../packages/components/time-picker/src/common/picker.vue?vue&type=script&setup=true&lang.ts
  17940. var picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  17941. name: "Picker",
  17942. __name: "picker",
  17943. props: timePickerDefaultProps,
  17944. emits: [
  17945. UPDATE_MODEL_EVENT,
  17946. CHANGE_EVENT,
  17947. "focus",
  17948. "blur",
  17949. "clear",
  17950. "calendar-change",
  17951. "panel-change",
  17952. "visible-change",
  17953. "keydown"
  17954. ],
  17955. setup(__props, { expose: __expose, emit: __emit }) {
  17956. const props = __props;
  17957. const emit = __emit;
  17958. const attrs = useAttrs$1();
  17959. const nsDate = useNamespace("date");
  17960. const nsInput = useNamespace("input");
  17961. const nsRange = useNamespace("range");
  17962. const { formItem } = useFormItem();
  17963. const elPopperOptions = inject(PICKER_POPPER_OPTIONS_INJECTION_KEY, {});
  17964. const emptyValues = useEmptyValues(props, null);
  17965. const refPopper = ref();
  17966. const inputRef = ref();
  17967. const valueOnOpen = ref(null);
  17968. let hasJustTabExitedInput = false;
  17969. const pickerDisabled = useFormDisabled();
  17970. const commonPicker = useCommonPicker(props, emit);
  17971. const { parsedValue, pickerActualVisible, userInput, pickerVisible, pickerOptions, valueIsEmpty, emitInput, onPick, onSetPickerOption, onCalendarChange, onPanelChange } = commonPicker;
  17972. const { isFocused, handleFocus, handleBlur } = useFocusController(inputRef, {
  17973. disabled: pickerDisabled,
  17974. beforeFocus() {
  17975. return props.readonly;
  17976. },
  17977. afterFocus() {
  17978. if (!props.automaticDropdown) return;
  17979. pickerVisible.value = true;
  17980. },
  17981. beforeBlur(event) {
  17982. return !hasJustTabExitedInput && refPopper.value?.isFocusInsideContent(event);
  17983. },
  17984. afterBlur() {
  17985. if (isTimePicker.value && !props.saveOnBlur) {
  17986. if (!valueIsEmpty.value) pickerOptions.value.handleCancel?.();
  17987. } else handleChange();
  17988. pickerVisible.value = false;
  17989. hasJustTabExitedInput = false;
  17990. props.validateEvent && formItem?.validate("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  17991. }
  17992. });
  17993. const hovering = ref(false);
  17994. const rangeInputKls = computed(() => [
  17995. nsDate.b("editor"),
  17996. nsDate.bm("editor", props.type),
  17997. nsInput.e("wrapper"),
  17998. nsDate.is("disabled", pickerDisabled.value),
  17999. nsDate.is("active", pickerVisible.value),
  18000. nsRange.b("editor"),
  18001. pickerSize ? nsRange.bm("editor", pickerSize.value) : "",
  18002. attrs.class
  18003. ]);
  18004. const clearIconKls = computed(() => [
  18005. nsInput.e("icon"),
  18006. nsRange.e("close-icon"),
  18007. !showClearBtn.value ? nsRange.em("close-icon", "hidden") : ""
  18008. ]);
  18009. watch(pickerVisible, (val) => {
  18010. if (!val) {
  18011. userInput.value = null;
  18012. nextTick(() => {
  18013. emitChange(props.modelValue);
  18014. });
  18015. } else nextTick(() => {
  18016. if (val) valueOnOpen.value = props.modelValue;
  18017. });
  18018. });
  18019. const emitChange = (val, isClear) => {
  18020. if (isClear || !valueEquals(val, valueOnOpen.value)) {
  18021. emit(CHANGE_EVENT, val);
  18022. isClear && (valueOnOpen.value = val);
  18023. props.validateEvent && formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  18024. }
  18025. };
  18026. const emitKeydown = (e) => {
  18027. emit("keydown", e);
  18028. };
  18029. const refInput = computed(() => {
  18030. if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input"));
  18031. return [];
  18032. });
  18033. const setSelectionRange = (start, end, pos) => {
  18034. const _inputs = refInput.value;
  18035. if (!_inputs.length) return;
  18036. if (!pos || pos === "min") {
  18037. _inputs[0].setSelectionRange(start, end);
  18038. _inputs[0].focus();
  18039. } else if (pos === "max") {
  18040. _inputs[1].setSelectionRange(start, end);
  18041. _inputs[1].focus();
  18042. }
  18043. };
  18044. const onBeforeShow = () => {
  18045. pickerActualVisible.value = true;
  18046. };
  18047. const onShow = () => {
  18048. emit("visible-change", true);
  18049. };
  18050. const onHide = () => {
  18051. pickerActualVisible.value = false;
  18052. pickerVisible.value = false;
  18053. emit("visible-change", false);
  18054. };
  18055. const handleOpen = () => {
  18056. pickerVisible.value = true;
  18057. };
  18058. const handleClose = () => {
  18059. pickerVisible.value = false;
  18060. };
  18061. const displayValue = computed(() => {
  18062. const formattedValue = formatToString(parsedValue.value);
  18063. if (isArray$1(userInput.value)) return [userInput.value[0] || formattedValue && formattedValue[0] || "", userInput.value[1] || formattedValue && formattedValue[1] || ""];
  18064. else if (userInput.value !== null) return userInput.value;
  18065. if (isTimePicker.value && valueIsEmpty.value && !props.saveOnBlur) return "";
  18066. if (!isTimePicker.value && valueIsEmpty.value) return "";
  18067. if (!pickerVisible.value && valueIsEmpty.value) return "";
  18068. if (formattedValue) return isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value ? formattedValue.join(", ") : formattedValue;
  18069. return "";
  18070. });
  18071. const isTimeLikePicker = computed(() => props.type.includes("time"));
  18072. const isTimePicker = computed(() => props.type.startsWith("time"));
  18073. const isDatesPicker = computed(() => props.type === "dates");
  18074. const isMonthsPicker = computed(() => props.type === "months");
  18075. const isYearsPicker = computed(() => props.type === "years");
  18076. const triggerIcon = computed(() => props.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default$1));
  18077. const showClearBtn = computed(() => props.clearable && !pickerDisabled.value && !props.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value));
  18078. const onClear = (event) => {
  18079. if (props.readonly || pickerDisabled.value) return;
  18080. if (showClearBtn.value) {
  18081. event?.stopPropagation();
  18082. if (pickerOptions.value.handleClear) pickerOptions.value.handleClear();
  18083. else emitInput(emptyValues.valueOnClear.value);
  18084. emitChange(emptyValues.valueOnClear.value, true);
  18085. onHide();
  18086. }
  18087. emit("clear");
  18088. };
  18089. const onMouseDownInput = async (event) => {
  18090. if (props.readonly || pickerDisabled.value) return;
  18091. if (event.target?.tagName !== "INPUT" || isFocused.value || !props.automaticDropdown) pickerVisible.value = true;
  18092. };
  18093. const onMouseEnter = () => {
  18094. if (props.readonly || pickerDisabled.value) return;
  18095. if (!valueIsEmpty.value && props.clearable) hovering.value = true;
  18096. };
  18097. const onMouseLeave = () => {
  18098. hovering.value = false;
  18099. };
  18100. const onTouchStartInput = (event) => {
  18101. if (props.readonly || pickerDisabled.value) return;
  18102. if (event.touches[0].target?.tagName !== "INPUT" || isFocused.value || !props.automaticDropdown) pickerVisible.value = true;
  18103. };
  18104. const isRangeInput = computed(() => {
  18105. return props.type.includes("range");
  18106. });
  18107. const pickerSize = useFormSize();
  18108. const popperEl = computed(() => unref(refPopper)?.popperRef?.contentRef);
  18109. const stophandle = onClickOutside(inputRef, (e) => {
  18110. const unrefedPopperEl = unref(popperEl);
  18111. const inputEl = unrefElement(inputRef);
  18112. if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl)) return;
  18113. pickerVisible.value = false;
  18114. });
  18115. onBeforeUnmount(() => {
  18116. stophandle?.();
  18117. });
  18118. const handleChange = () => {
  18119. if (isTimePicker.value && !props.saveOnBlur) return;
  18120. if (userInput.value) {
  18121. const value = parseUserInputToDayjs(displayValue.value);
  18122. if (value) {
  18123. if (isValidValue(value)) emitInput(dayOrDaysToDate(value));
  18124. userInput.value = null;
  18125. }
  18126. }
  18127. if (userInput.value === "") {
  18128. emitInput(emptyValues.valueOnClear.value);
  18129. emitChange(emptyValues.valueOnClear.value, true);
  18130. userInput.value = null;
  18131. }
  18132. };
  18133. const parseUserInputToDayjs = (value) => {
  18134. if (!value) return null;
  18135. return pickerOptions.value.parseUserInput(value);
  18136. };
  18137. const formatToString = (value) => {
  18138. if (!value) return null;
  18139. return isArray$1(value) ? value.map((_) => _.format(props.format)) : value.format(props.format);
  18140. };
  18141. const isValidValue = (value) => {
  18142. return pickerOptions.value.isValidValue(value);
  18143. };
  18144. const handleKeydownInput = async (event) => {
  18145. if (props.readonly || pickerDisabled.value) return;
  18146. const code = getEventCode(event);
  18147. emitKeydown(event);
  18148. if (code === EVENT_CODE.esc) {
  18149. if (pickerVisible.value === true) {
  18150. pickerVisible.value = false;
  18151. event.preventDefault();
  18152. event.stopPropagation();
  18153. }
  18154. return;
  18155. }
  18156. if (code === EVENT_CODE.down) {
  18157. if (pickerOptions.value.handleFocusPicker) {
  18158. event.preventDefault();
  18159. event.stopPropagation();
  18160. }
  18161. if (pickerVisible.value === false) {
  18162. pickerVisible.value = true;
  18163. await nextTick();
  18164. }
  18165. if (pickerOptions.value.handleFocusPicker) {
  18166. pickerOptions.value.handleFocusPicker();
  18167. return;
  18168. }
  18169. }
  18170. if (code === EVENT_CODE.tab) {
  18171. hasJustTabExitedInput = true;
  18172. return;
  18173. }
  18174. if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) {
  18175. if (!pickerVisible.value) pickerVisible.value = true;
  18176. else if (userInput.value === null || userInput.value === "" || isValidValue(parseUserInputToDayjs(displayValue.value))) {
  18177. handleChange();
  18178. pickerVisible.value = false;
  18179. }
  18180. event.preventDefault();
  18181. event.stopPropagation();
  18182. return;
  18183. }
  18184. if (userInput.value) {
  18185. event.stopPropagation();
  18186. return;
  18187. }
  18188. if (pickerOptions.value.handleKeydownInput) pickerOptions.value.handleKeydownInput(event);
  18189. };
  18190. const onUserInput = (e) => {
  18191. userInput.value = e;
  18192. if (!pickerVisible.value) pickerVisible.value = true;
  18193. };
  18194. const handleStartInput = (event) => {
  18195. const target = event.target;
  18196. if (userInput.value) userInput.value = [target.value, userInput.value[1]];
  18197. else userInput.value = [target.value, null];
  18198. };
  18199. const handleEndInput = (event) => {
  18200. const target = event.target;
  18201. if (userInput.value) userInput.value = [userInput.value[0], target.value];
  18202. else userInput.value = [null, target.value];
  18203. };
  18204. const handleStartChange = () => {
  18205. const values = userInput.value;
  18206. const value = parseUserInputToDayjs(values && values[0]);
  18207. const parsedVal = unref(parsedValue);
  18208. if (value && value.isValid()) {
  18209. userInput.value = [formatToString(value), displayValue.value?.[1] || null];
  18210. const newValue = [value, parsedVal && (parsedVal[1] || null)];
  18211. if (isValidValue(newValue)) {
  18212. emitInput(dayOrDaysToDate(newValue));
  18213. userInput.value = null;
  18214. }
  18215. }
  18216. };
  18217. const handleEndChange = () => {
  18218. const values = unref(userInput);
  18219. const value = parseUserInputToDayjs(values && values[1]);
  18220. const parsedVal = unref(parsedValue);
  18221. if (value && value.isValid()) {
  18222. userInput.value = [unref(displayValue)?.[0] || null, formatToString(value)];
  18223. const newValue = [parsedVal && parsedVal[0], value];
  18224. if (isValidValue(newValue)) {
  18225. emitInput(dayOrDaysToDate(newValue));
  18226. userInput.value = null;
  18227. }
  18228. }
  18229. };
  18230. const focus = () => {
  18231. inputRef.value?.focus();
  18232. };
  18233. const blur = () => {
  18234. inputRef.value?.blur();
  18235. };
  18236. provide(PICKER_BASE_INJECTION_KEY, {
  18237. props,
  18238. emptyValues
  18239. });
  18240. provide(ROOT_COMMON_PICKER_INJECTION_KEY, commonPicker);
  18241. __expose({
  18242. focus,
  18243. blur,
  18244. handleOpen,
  18245. handleClose,
  18246. onPick
  18247. });
  18248. return (_ctx, _cache) => {
  18249. return openBlock(), createBlock(unref(ElTooltip), mergeProps({
  18250. ref_key: "refPopper",
  18251. ref: refPopper,
  18252. visible: unref(pickerVisible),
  18253. effect: "light",
  18254. pure: "",
  18255. trigger: "click"
  18256. }, _ctx.$attrs, {
  18257. role: "dialog",
  18258. teleported: "",
  18259. transition: `${unref(nsDate).namespace.value}-zoom-in-top`,
  18260. "popper-class": [`${unref(nsDate).namespace.value}-picker__popper`, _ctx.popperClass],
  18261. "popper-style": _ctx.popperStyle,
  18262. "popper-options": unref(elPopperOptions),
  18263. "fallback-placements": _ctx.fallbackPlacements,
  18264. "gpu-acceleration": false,
  18265. placement: _ctx.placement,
  18266. "stop-popper-mouse-event": false,
  18267. "hide-after": 0,
  18268. persistent: "",
  18269. onBeforeShow,
  18270. onShow,
  18271. onHide
  18272. }), {
  18273. default: withCtx(() => [!isRangeInput.value ? (openBlock(), createBlock(unref(ElInput), {
  18274. key: 0,
  18275. id: _ctx.id,
  18276. ref_key: "inputRef",
  18277. ref: inputRef,
  18278. "container-role": "combobox",
  18279. "model-value": displayValue.value,
  18280. name: _ctx.name,
  18281. size: unref(pickerSize),
  18282. disabled: unref(pickerDisabled),
  18283. placeholder: _ctx.placeholder,
  18284. class: normalizeClass([
  18285. unref(nsDate).b("editor"),
  18286. unref(nsDate).bm("editor", _ctx.type),
  18287. unref(nsDate).is("focus", unref(pickerVisible)),
  18288. _ctx.$attrs.class
  18289. ]),
  18290. style: normalizeStyle(_ctx.$attrs.style),
  18291. readonly: !_ctx.editable || _ctx.readonly || isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value || _ctx.type === "week",
  18292. "aria-label": _ctx.ariaLabel,
  18293. tabindex: _ctx.tabindex,
  18294. "validate-event": false,
  18295. onInput: onUserInput,
  18296. onFocus: unref(handleFocus),
  18297. onBlur: unref(handleBlur),
  18298. onKeydown: handleKeydownInput,
  18299. onChange: handleChange,
  18300. onMousedown: onMouseDownInput,
  18301. onMouseenter: onMouseEnter,
  18302. onMouseleave: onMouseLeave,
  18303. onTouchstartPassive: onTouchStartInput,
  18304. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  18305. }, {
  18306. prefix: withCtx(() => [triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
  18307. key: 0,
  18308. class: normalizeClass(unref(nsInput).e("icon")),
  18309. onMousedown: withModifiers(onMouseDownInput, ["prevent"]),
  18310. onTouchstartPassive: onTouchStartInput
  18311. }, {
  18312. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))]),
  18313. _: 1
  18314. }, 8, ["class"])) : createCommentVNode("v-if", true)]),
  18315. suffix: withCtx(() => [showClearBtn.value && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18316. key: 0,
  18317. class: normalizeClass(`${unref(nsInput).e("icon")} clear-icon`),
  18318. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  18319. onClick: onClear
  18320. }, {
  18321. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]),
  18322. _: 1
  18323. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)]),
  18324. _: 1
  18325. }, 8, [
  18326. "id",
  18327. "model-value",
  18328. "name",
  18329. "size",
  18330. "disabled",
  18331. "placeholder",
  18332. "class",
  18333. "style",
  18334. "readonly",
  18335. "aria-label",
  18336. "tabindex",
  18337. "onFocus",
  18338. "onBlur"
  18339. ])) : (openBlock(), createBlock(picker_range_trigger_default, {
  18340. key: 1,
  18341. id: _ctx.id,
  18342. ref_key: "inputRef",
  18343. ref: inputRef,
  18344. "model-value": displayValue.value,
  18345. name: _ctx.name,
  18346. disabled: unref(pickerDisabled),
  18347. readonly: !_ctx.editable || _ctx.readonly,
  18348. "start-placeholder": _ctx.startPlaceholder,
  18349. "end-placeholder": _ctx.endPlaceholder,
  18350. class: normalizeClass(rangeInputKls.value),
  18351. style: normalizeStyle(_ctx.$attrs.style),
  18352. "aria-label": _ctx.ariaLabel,
  18353. tabindex: _ctx.tabindex,
  18354. autocomplete: "off",
  18355. role: "combobox",
  18356. onClick: onMouseDownInput,
  18357. onFocus: unref(handleFocus),
  18358. onBlur: unref(handleBlur),
  18359. onStartInput: handleStartInput,
  18360. onStartChange: handleStartChange,
  18361. onEndInput: handleEndInput,
  18362. onEndChange: handleEndChange,
  18363. onMousedown: onMouseDownInput,
  18364. onMouseenter: onMouseEnter,
  18365. onMouseleave: onMouseLeave,
  18366. onTouchstartPassive: onTouchStartInput,
  18367. onKeydown: handleKeydownInput
  18368. }, {
  18369. prefix: withCtx(() => [triggerIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
  18370. key: 0,
  18371. class: normalizeClass([unref(nsInput).e("icon"), unref(nsRange).e("icon")])
  18372. }, {
  18373. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(triggerIcon.value)))]),
  18374. _: 1
  18375. }, 8, ["class"])) : createCommentVNode("v-if", true)]),
  18376. "range-separator": withCtx(() => [renderSlot(_ctx.$slots, "range-separator", {}, () => [createElementVNode("span", { class: normalizeClass(unref(nsRange).b("separator")) }, toDisplayString(_ctx.rangeSeparator), 3)])]),
  18377. suffix: withCtx(() => [_ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18378. key: 0,
  18379. class: normalizeClass(clearIconKls.value),
  18380. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  18381. onClick: onClear
  18382. }, {
  18383. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]),
  18384. _: 1
  18385. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)]),
  18386. _: 3
  18387. }, 8, [
  18388. "id",
  18389. "model-value",
  18390. "name",
  18391. "disabled",
  18392. "readonly",
  18393. "start-placeholder",
  18394. "end-placeholder",
  18395. "class",
  18396. "style",
  18397. "aria-label",
  18398. "tabindex",
  18399. "onFocus",
  18400. "onBlur"
  18401. ]))]),
  18402. content: withCtx(() => [renderSlot(_ctx.$slots, "default", {
  18403. visible: unref(pickerVisible),
  18404. actualVisible: unref(pickerActualVisible),
  18405. parsedValue: unref(parsedValue),
  18406. format: _ctx.format,
  18407. dateFormat: _ctx.dateFormat,
  18408. timeFormat: _ctx.timeFormat,
  18409. unlinkPanels: _ctx.unlinkPanels,
  18410. type: _ctx.type,
  18411. defaultValue: _ctx.defaultValue,
  18412. showNow: _ctx.showNow,
  18413. showConfirm: _ctx.showConfirm,
  18414. showFooter: _ctx.showFooter,
  18415. showWeekNumber: _ctx.showWeekNumber,
  18416. onPick: _cache[1] || (_cache[1] = (...args) => unref(onPick) && unref(onPick)(...args)),
  18417. onSelectRange: setSelectionRange,
  18418. onSetPickerOption: _cache[2] || (_cache[2] = (...args) => unref(onSetPickerOption) && unref(onSetPickerOption)(...args)),
  18419. onCalendarChange: _cache[3] || (_cache[3] = (...args) => unref(onCalendarChange) && unref(onCalendarChange)(...args)),
  18420. onClear,
  18421. onPanelChange: _cache[4] || (_cache[4] = (...args) => unref(onPanelChange) && unref(onPanelChange)(...args)),
  18422. onMousedown: _cache[5] || (_cache[5] = withModifiers(() => {}, ["stop"]))
  18423. })]),
  18424. _: 3
  18425. }, 16, [
  18426. "visible",
  18427. "transition",
  18428. "popper-class",
  18429. "popper-style",
  18430. "popper-options",
  18431. "fallback-placements",
  18432. "placement"
  18433. ]);
  18434. };
  18435. }
  18436. });
  18437. //#endregion
  18438. //#region ../../packages/components/time-picker/src/common/picker.vue
  18439. var picker_default = picker_vue_vue_type_script_setup_true_lang_default;
  18440. //#endregion
  18441. //#region ../../packages/components/time-picker/src/props/panel-time-picker.ts
  18442. const panelTimePickerProps = buildProps({
  18443. ...timePanelSharedProps,
  18444. datetimeRole: String,
  18445. parsedValue: { type: definePropType(Object) }
  18446. });
  18447. //#endregion
  18448. //#region ../../packages/components/time-picker/src/composables/use-time-panel.ts
  18449. const useTimePanel = ({ getAvailableHours, getAvailableMinutes, getAvailableSeconds }) => {
  18450. const getAvailableTime = (date, role, first, compareDate) => {
  18451. const availableTimeGetters = {
  18452. hour: getAvailableHours,
  18453. minute: getAvailableMinutes,
  18454. second: getAvailableSeconds
  18455. };
  18456. let result = date;
  18457. [
  18458. "hour",
  18459. "minute",
  18460. "second"
  18461. ].forEach((type) => {
  18462. if (availableTimeGetters[type]) {
  18463. let availableTimeSlots;
  18464. const method = availableTimeGetters[type];
  18465. switch (type) {
  18466. case "minute":
  18467. availableTimeSlots = method(result.hour(), role, compareDate);
  18468. break;
  18469. case "second":
  18470. availableTimeSlots = method(result.hour(), result.minute(), role, compareDate);
  18471. break;
  18472. default:
  18473. availableTimeSlots = method(role, compareDate);
  18474. break;
  18475. }
  18476. if (availableTimeSlots?.length && !availableTimeSlots.includes(result[type]())) {
  18477. const pos = first ? 0 : availableTimeSlots.length - 1;
  18478. result = result[type](availableTimeSlots[pos]);
  18479. }
  18480. }
  18481. });
  18482. return result;
  18483. };
  18484. const timePickerOptions = {};
  18485. const onSetOption = ([key, val]) => {
  18486. timePickerOptions[key] = val;
  18487. };
  18488. return {
  18489. timePickerOptions,
  18490. getAvailableTime,
  18491. onSetOption
  18492. };
  18493. };
  18494. //#endregion
  18495. //#region ../../packages/components/time-picker/src/composables/use-time-picker.ts
  18496. const makeAvailableArr = (disabledList) => {
  18497. const trueOrNumber = (isDisabled, index) => isDisabled || index;
  18498. const getNumber = (predicate) => predicate !== true;
  18499. return disabledList.map(trueOrNumber).filter(getNumber);
  18500. };
  18501. const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
  18502. const getHoursList = (role, compare) => {
  18503. return makeList(24, disabledHours && (() => disabledHours?.(role, compare)));
  18504. };
  18505. const getMinutesList = (hour, role, compare) => {
  18506. return makeList(60, disabledMinutes && (() => disabledMinutes?.(hour, role, compare)));
  18507. };
  18508. const getSecondsList = (hour, minute, role, compare) => {
  18509. return makeList(60, disabledSeconds && (() => disabledSeconds?.(hour, minute, role, compare)));
  18510. };
  18511. return {
  18512. getHoursList,
  18513. getMinutesList,
  18514. getSecondsList
  18515. };
  18516. };
  18517. const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
  18518. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds);
  18519. const getAvailableHours = (role, compare) => {
  18520. return makeAvailableArr(getHoursList(role, compare));
  18521. };
  18522. const getAvailableMinutes = (hour, role, compare) => {
  18523. return makeAvailableArr(getMinutesList(hour, role, compare));
  18524. };
  18525. const getAvailableSeconds = (hour, minute, role, compare) => {
  18526. return makeAvailableArr(getSecondsList(hour, minute, role, compare));
  18527. };
  18528. return {
  18529. getAvailableHours,
  18530. getAvailableMinutes,
  18531. getAvailableSeconds
  18532. };
  18533. };
  18534. const useOldValue = (props, options) => {
  18535. const oldValue = ref(props.parsedValue);
  18536. watch(() => props.visible, (val) => {
  18537. const modelValue = toValue(options.modelValue);
  18538. const valueOnClear = toValue(options.valueOnClear);
  18539. if (val && modelValue === valueOnClear) {
  18540. oldValue.value = valueOnClear;
  18541. return;
  18542. }
  18543. if (!val) oldValue.value = props.parsedValue;
  18544. });
  18545. return oldValue;
  18546. };
  18547. //#endregion
  18548. //#region ../../packages/directives/click-outside/index.ts
  18549. const nodeList = /* @__PURE__ */ new Map();
  18550. if (isClient) {
  18551. let startClick;
  18552. document.addEventListener("mousedown", (e) => startClick = e);
  18553. document.addEventListener("mouseup", (e) => {
  18554. if (startClick) {
  18555. for (const handlers of nodeList.values()) for (const { documentHandler } of handlers) documentHandler(e, startClick);
  18556. startClick = void 0;
  18557. }
  18558. });
  18559. }
  18560. function createDocumentHandler(el, binding) {
  18561. let excludes = [];
  18562. if (isArray$1(binding.arg)) excludes = binding.arg;
  18563. else if (isElement$1(binding.arg)) excludes.push(binding.arg);
  18564. return function(mouseup, mousedown) {
  18565. const popperRef = binding.instance.popperRef;
  18566. const mouseUpTarget = mouseup.target;
  18567. const mouseDownTarget = mousedown?.target;
  18568. const isBound = !binding || !binding.instance;
  18569. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  18570. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  18571. const isSelf = el === mouseUpTarget;
  18572. const isTargetExcluded = excludes.length && excludes.some((item) => item?.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  18573. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  18574. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) return;
  18575. binding.value(mouseup, mousedown);
  18576. };
  18577. }
  18578. const ClickOutside = {
  18579. beforeMount(el, binding) {
  18580. if (!nodeList.has(el)) nodeList.set(el, []);
  18581. nodeList.get(el).push({
  18582. documentHandler: createDocumentHandler(el, binding),
  18583. bindingFn: binding.value
  18584. });
  18585. },
  18586. updated(el, binding) {
  18587. if (!nodeList.has(el)) nodeList.set(el, []);
  18588. const handlers = nodeList.get(el);
  18589. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  18590. const newHandler = {
  18591. documentHandler: createDocumentHandler(el, binding),
  18592. bindingFn: binding.value
  18593. };
  18594. if (oldHandlerIndex >= 0) handlers.splice(oldHandlerIndex, 1, newHandler);
  18595. else handlers.push(newHandler);
  18596. },
  18597. unmounted(el) {
  18598. nodeList.delete(el);
  18599. }
  18600. };
  18601. //#endregion
  18602. //#region ../../packages/directives/repeat-click/index.ts
  18603. const REPEAT_INTERVAL = 100;
  18604. const REPEAT_DELAY = 600;
  18605. const SCOPE$6 = "_RepeatClick";
  18606. const vRepeatClick = {
  18607. beforeMount(el, binding) {
  18608. const value = binding.value;
  18609. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$1(value) ? {} : value;
  18610. let intervalId;
  18611. let delayId;
  18612. const handler = () => isFunction$1(value) ? value() : value.handler();
  18613. const clear = () => {
  18614. if (delayId) {
  18615. clearTimeout(delayId);
  18616. delayId = void 0;
  18617. }
  18618. if (intervalId) {
  18619. clearInterval(intervalId);
  18620. intervalId = void 0;
  18621. }
  18622. };
  18623. const start = (evt) => {
  18624. if (evt.button !== 0) return;
  18625. clear();
  18626. handler();
  18627. document.addEventListener("mouseup", clear, { once: true });
  18628. delayId = setTimeout(() => {
  18629. intervalId = setInterval(() => {
  18630. handler();
  18631. }, interval);
  18632. }, delay);
  18633. };
  18634. el[SCOPE$6] = {
  18635. start,
  18636. clear
  18637. };
  18638. el.addEventListener("mousedown", start);
  18639. },
  18640. unmounted(el) {
  18641. if (!el[SCOPE$6]) return;
  18642. const { start, clear } = el[SCOPE$6];
  18643. if (start) el.removeEventListener("mousedown", start);
  18644. if (clear) {
  18645. clear();
  18646. document.removeEventListener("mouseup", clear);
  18647. }
  18648. el[SCOPE$6] = null;
  18649. }
  18650. };
  18651. //#endregion
  18652. //#region ../../packages/directives/trap-focus/index.ts
  18653. const FOCUSABLE_CHILDREN = "_trap-focus-children";
  18654. const FOCUS_STACK = [];
  18655. const FOCUS_HANDLER = (e) => {
  18656. if (FOCUS_STACK.length === 0) return;
  18657. const code = getEventCode(e);
  18658. const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN];
  18659. if (focusableElement.length > 0 && code === EVENT_CODE.tab) {
  18660. if (focusableElement.length === 1) {
  18661. e.preventDefault();
  18662. if (document.activeElement !== focusableElement[0]) focusableElement[0].focus();
  18663. return;
  18664. }
  18665. const goingBackward = e.shiftKey;
  18666. const isFirst = e.target === focusableElement[0];
  18667. const isLast = e.target === focusableElement[focusableElement.length - 1];
  18668. if (isFirst && goingBackward) {
  18669. e.preventDefault();
  18670. focusableElement[focusableElement.length - 1].focus();
  18671. }
  18672. if (isLast && !goingBackward) {
  18673. e.preventDefault();
  18674. focusableElement[0].focus();
  18675. }
  18676. }
  18677. };
  18678. const TrapFocus = {
  18679. beforeMount(el) {
  18680. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  18681. FOCUS_STACK.push(el);
  18682. if (FOCUS_STACK.length <= 1) document.addEventListener("keydown", FOCUS_HANDLER);
  18683. },
  18684. updated(el) {
  18685. nextTick(() => {
  18686. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  18687. });
  18688. },
  18689. unmounted() {
  18690. FOCUS_STACK.shift();
  18691. if (FOCUS_STACK.length === 0) document.removeEventListener("keydown", FOCUS_HANDLER);
  18692. }
  18693. };
  18694. //#endregion
  18695. //#region ../../node_modules/.pnpm/normalize-wheel-es@1.2.0/node_modules/normalize-wheel-es/dist/index.mjs
  18696. var v = !1, o, f, s, u, d, N, l, p, m, w, D, x, E, M, F;
  18697. function a() {
  18698. if (!v) {
  18699. v = !0;
  18700. var e = navigator.userAgent, n = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e), i = /(Mac OS X)|(Windows)|(Linux)/.exec(e);
  18701. if (x = /\b(iPhone|iP[ao]d)/.exec(e), E = /\b(iP[ao]d)/.exec(e), w = /Android/i.exec(e), M = /FBAN\/\w+;/i.exec(e), F = /Mobile/i.exec(e), D = !!/Win64/.exec(e), n) {
  18702. o = n[1] ? parseFloat(n[1]) : n[5] ? parseFloat(n[5]) : NaN, o && document && document.documentMode && (o = document.documentMode);
  18703. var r = /(?:Trident\/(\d+.\d+))/.exec(e);
  18704. N = r ? parseFloat(r[1]) + 4 : o, f = n[2] ? parseFloat(n[2]) : NaN, s = n[3] ? parseFloat(n[3]) : NaN, u = n[4] ? parseFloat(n[4]) : NaN, u ? (n = /(?:Chrome\/(\d+\.\d+))/.exec(e), d = n && n[1] ? parseFloat(n[1]) : NaN) : d = NaN;
  18705. } else o = f = s = d = u = NaN;
  18706. if (i) {
  18707. if (i[1]) {
  18708. var t = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);
  18709. l = t ? parseFloat(t[1].replace("_", ".")) : !0;
  18710. } else l = !1;
  18711. p = !!i[2], m = !!i[3];
  18712. } else l = p = m = !1;
  18713. }
  18714. }
  18715. var _ = {
  18716. ie: function() {
  18717. return a() || o;
  18718. },
  18719. ieCompatibilityMode: function() {
  18720. return a() || N > o;
  18721. },
  18722. ie64: function() {
  18723. return _.ie() && D;
  18724. },
  18725. firefox: function() {
  18726. return a() || f;
  18727. },
  18728. opera: function() {
  18729. return a() || s;
  18730. },
  18731. webkit: function() {
  18732. return a() || u;
  18733. },
  18734. safari: function() {
  18735. return _.webkit();
  18736. },
  18737. chrome: function() {
  18738. return a() || d;
  18739. },
  18740. windows: function() {
  18741. return a() || p;
  18742. },
  18743. osx: function() {
  18744. return a() || l;
  18745. },
  18746. linux: function() {
  18747. return a() || m;
  18748. },
  18749. iphone: function() {
  18750. return a() || x;
  18751. },
  18752. mobile: function() {
  18753. return a() || x || E || w || F;
  18754. },
  18755. nativeApp: function() {
  18756. return a() || M;
  18757. },
  18758. android: function() {
  18759. return a() || w;
  18760. },
  18761. ipad: function() {
  18762. return a() || E;
  18763. }
  18764. }, A = _;
  18765. var c = !!(typeof window < "u" && window.document && window.document.createElement), h$1 = {
  18766. canUseDOM: c,
  18767. canUseWorkers: typeof Worker < "u",
  18768. canUseEventListeners: c && !!(window.addEventListener || window.attachEvent),
  18769. canUseViewport: c && !!window.screen,
  18770. isInWorker: !c
  18771. };
  18772. var X;
  18773. h$1.canUseDOM && (X = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
  18774. function S(e, n) {
  18775. if (!h$1.canUseDOM || n && !("addEventListener" in document)) return !1;
  18776. var i = "on" + e, r = i in document;
  18777. if (!r) {
  18778. var t = document.createElement("div");
  18779. t.setAttribute(i, "return;"), r = typeof t[i] == "function";
  18780. }
  18781. return !r && X && e === "wheel" && (r = document.implementation.hasFeature("Events.wheel", "3.0")), r;
  18782. }
  18783. var b = S;
  18784. var O = 10, I = 40, P = 800;
  18785. function T(e) {
  18786. var n = 0, i = 0, r = 0, t = 0;
  18787. return "detail" in e && (i = e.detail), "wheelDelta" in e && (i = -e.wheelDelta / 120), "wheelDeltaY" in e && (i = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (n = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (n = i, i = 0), r = n * O, t = i * O, "deltaY" in e && (t = e.deltaY), "deltaX" in e && (r = e.deltaX), (r || t) && e.deltaMode && (e.deltaMode == 1 ? (r *= I, t *= I) : (r *= P, t *= P)), r && !n && (n = r < 1 ? -1 : 1), t && !i && (i = t < 1 ? -1 : 1), {
  18788. spinX: n,
  18789. spinY: i,
  18790. pixelX: r,
  18791. pixelY: t
  18792. };
  18793. }
  18794. T.getEventType = function() {
  18795. return A.firefox() ? "DOMMouseScroll" : b("wheel") ? "wheel" : "mousewheel";
  18796. };
  18797. var Y = T;
  18798. /**
  18799. * Checks if an event is supported in the current execution environment.
  18800. *
  18801. * NOTE: This will not work correctly for non-generic events such as `change`,
  18802. * `reset`, `load`, `error`, and `select`.
  18803. *
  18804. * Borrows from Modernizr.
  18805. *
  18806. * @param {string} eventNameSuffix Event name, e.g. "click".
  18807. * @param {?boolean} capture Check if the capture phase is supported.
  18808. * @return {boolean} True if the event is supported.
  18809. * @internal
  18810. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  18811. */
  18812. //#endregion
  18813. //#region ../../packages/directives/mousewheel/index.ts
  18814. const SCOPE$5 = "_Mousewheel";
  18815. const mousewheel = function(element, callback) {
  18816. if (element && element.addEventListener) {
  18817. removeWheelHandler(element);
  18818. const fn = function(event) {
  18819. const normalized = Y(event);
  18820. callback && Reflect.apply(callback, this, [event, normalized]);
  18821. };
  18822. element[SCOPE$5] = { wheelHandler: fn };
  18823. element.addEventListener("wheel", fn, { passive: true });
  18824. }
  18825. };
  18826. const removeWheelHandler = (element) => {
  18827. if (element[SCOPE$5]?.wheelHandler) {
  18828. element.removeEventListener("wheel", element[SCOPE$5].wheelHandler);
  18829. element[SCOPE$5] = null;
  18830. }
  18831. };
  18832. const Mousewheel = {
  18833. beforeMount(el, binding) {
  18834. mousewheel(el, binding.value);
  18835. },
  18836. unmounted(el) {
  18837. removeWheelHandler(el);
  18838. },
  18839. updated(el, binding) {
  18840. if (binding.value !== binding.oldValue) mousewheel(el, binding.value);
  18841. }
  18842. };
  18843. //#endregion
  18844. //#region ../../packages/components/time-picker/src/props/basic-time-spinner.ts
  18845. const basicTimeSpinnerProps = buildProps({
  18846. role: {
  18847. type: String,
  18848. required: true
  18849. },
  18850. spinnerDate: {
  18851. type: definePropType(Object),
  18852. required: true
  18853. },
  18854. showSeconds: {
  18855. type: Boolean,
  18856. default: true
  18857. },
  18858. arrowControl: Boolean,
  18859. amPmMode: {
  18860. type: definePropType(String),
  18861. default: ""
  18862. },
  18863. ...disabledTimeListsProps
  18864. });
  18865. //#endregion
  18866. //#region ../../packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue?vue&type=script&setup=true&lang.ts
  18867. const _hoisted_1$70 = ["onClick"];
  18868. const _hoisted_2$39 = ["onMouseenter"];
  18869. var basic_time_spinner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  18870. __name: "basic-time-spinner",
  18871. props: basicTimeSpinnerProps,
  18872. emits: [
  18873. CHANGE_EVENT,
  18874. "select-range",
  18875. "set-option"
  18876. ],
  18877. setup(__props, { emit: __emit }) {
  18878. const props = __props;
  18879. const { isRange, format, saveOnBlur } = inject(PICKER_BASE_INJECTION_KEY).props;
  18880. const emit = __emit;
  18881. const ns = useNamespace("time");
  18882. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props.disabledHours, props.disabledMinutes, props.disabledSeconds);
  18883. let isScrolling = false;
  18884. const ignoreScroll = {
  18885. hours: false,
  18886. minutes: false,
  18887. seconds: false
  18888. };
  18889. const currentScrollbar = ref();
  18890. const listRefsMap = {
  18891. hours: ref(),
  18892. minutes: ref(),
  18893. seconds: ref()
  18894. };
  18895. const spinnerItems = computed(() => {
  18896. return props.showSeconds ? timeUnits : timeUnits.slice(0, 2);
  18897. });
  18898. const timePartials = computed(() => {
  18899. const { spinnerDate } = props;
  18900. return {
  18901. hours: spinnerDate.hour(),
  18902. minutes: spinnerDate.minute(),
  18903. seconds: spinnerDate.second()
  18904. };
  18905. });
  18906. const timeList = computed(() => {
  18907. const { hours, minutes } = unref(timePartials);
  18908. const { role, spinnerDate } = props;
  18909. const compare = !isRange ? spinnerDate : void 0;
  18910. return {
  18911. hours: getHoursList(role, compare),
  18912. minutes: getMinutesList(hours, role, compare),
  18913. seconds: getSecondsList(hours, minutes, role, compare)
  18914. };
  18915. });
  18916. const arrowControlTimeList = computed(() => {
  18917. const { hours, minutes, seconds } = unref(timePartials);
  18918. return {
  18919. hours: buildTimeList(hours, 23),
  18920. minutes: buildTimeList(minutes, 59),
  18921. seconds: buildTimeList(seconds, 59)
  18922. };
  18923. });
  18924. const debouncedResetScroll = debounce((type) => {
  18925. isScrolling = false;
  18926. adjustCurrentSpinner(type);
  18927. }, 200);
  18928. const getAmPmFlag = (hour) => {
  18929. if (!!!props.amPmMode) return "";
  18930. const isCapital = props.amPmMode === "A";
  18931. let content = hour < 12 ? " am" : " pm";
  18932. if (isCapital) content = content.toUpperCase();
  18933. return content;
  18934. };
  18935. const emitSelectRange = (type) => {
  18936. let range = [0, 0];
  18937. const actualFormat = format || DEFAULT_FORMATS_TIME;
  18938. const hourIndex = actualFormat.indexOf("HH");
  18939. const minuteIndex = actualFormat.indexOf("mm");
  18940. const secondIndex = actualFormat.indexOf("ss");
  18941. switch (type) {
  18942. case "hours":
  18943. if (hourIndex !== -1) range = [hourIndex, hourIndex + 2];
  18944. break;
  18945. case "minutes":
  18946. if (minuteIndex !== -1) range = [minuteIndex, minuteIndex + 2];
  18947. break;
  18948. case "seconds":
  18949. if (secondIndex !== -1) range = [secondIndex, secondIndex + 2];
  18950. break;
  18951. }
  18952. const [left, right] = range;
  18953. emit("select-range", left, right);
  18954. currentScrollbar.value = type;
  18955. };
  18956. const adjustCurrentSpinner = (type) => {
  18957. adjustSpinner(type, unref(timePartials)[type]);
  18958. };
  18959. const adjustSpinners = () => {
  18960. adjustCurrentSpinner("hours");
  18961. adjustCurrentSpinner("minutes");
  18962. adjustCurrentSpinner("seconds");
  18963. };
  18964. const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  18965. const adjustSpinner = (type, value) => {
  18966. if (props.arrowControl) return;
  18967. const scrollbar = unref(listRefsMap[type]);
  18968. if (scrollbar && scrollbar.$el) {
  18969. if (!saveOnBlur) {
  18970. ignoreScroll[type] = true;
  18971. rAF(() => {
  18972. ignoreScroll[type] = false;
  18973. });
  18974. }
  18975. getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type));
  18976. }
  18977. };
  18978. const typeItemHeight = (type) => {
  18979. const listItem = unref(listRefsMap[type])?.$el.querySelector("li");
  18980. if (listItem) return Number.parseFloat(getStyle(listItem, "height")) || 0;
  18981. return 0;
  18982. };
  18983. const onIncrement = () => {
  18984. scrollDown(1);
  18985. };
  18986. const onDecrement = () => {
  18987. scrollDown(-1);
  18988. };
  18989. const scrollDown = (step) => {
  18990. if (!currentScrollbar.value) emitSelectRange("hours");
  18991. const label = currentScrollbar.value;
  18992. const now = unref(timePartials)[label];
  18993. const next = findNextUnDisabled(label, now, step, currentScrollbar.value === "hours" ? 24 : 60);
  18994. modifyDateField(label, next);
  18995. adjustSpinner(label, next);
  18996. nextTick(() => emitSelectRange(label));
  18997. };
  18998. const findNextUnDisabled = (type, now, step, total) => {
  18999. let next = (now + step + total) % total;
  19000. const list = unref(timeList)[type];
  19001. while (list[next] && next !== now) next = (next + step + total) % total;
  19002. return next;
  19003. };
  19004. const modifyDateField = (type, value) => {
  19005. if (unref(timeList)[type][value]) return;
  19006. const { hours, minutes, seconds } = unref(timePartials);
  19007. let changeTo;
  19008. switch (type) {
  19009. case "hours":
  19010. changeTo = props.spinnerDate.hour(value).minute(minutes).second(seconds);
  19011. break;
  19012. case "minutes":
  19013. changeTo = props.spinnerDate.hour(hours).minute(value).second(seconds);
  19014. break;
  19015. case "seconds":
  19016. changeTo = props.spinnerDate.hour(hours).minute(minutes).second(value);
  19017. break;
  19018. }
  19019. emit(CHANGE_EVENT, changeTo);
  19020. };
  19021. const handleClick = (type, { value, disabled }) => {
  19022. if (!disabled) {
  19023. modifyDateField(type, value);
  19024. emitSelectRange(type);
  19025. adjustSpinner(type, value);
  19026. }
  19027. };
  19028. const handleScroll = (type) => {
  19029. if (!saveOnBlur && ignoreScroll[type]) return;
  19030. const scrollbar = unref(listRefsMap[type]);
  19031. if (!scrollbar) return;
  19032. isScrolling = true;
  19033. debouncedResetScroll(type);
  19034. modifyDateField(type, Math.min(Math.round((getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * .5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59));
  19035. };
  19036. const scrollBarHeight = (type) => {
  19037. return unref(listRefsMap[type]).$el.offsetHeight;
  19038. };
  19039. const bindScrollEvent = () => {
  19040. const bindFunction = (type) => {
  19041. const scrollbar = unref(listRefsMap[type]);
  19042. if (scrollbar && scrollbar.$el) getScrollbarElement(scrollbar.$el).onscroll = () => {
  19043. handleScroll(type);
  19044. };
  19045. };
  19046. bindFunction("hours");
  19047. bindFunction("minutes");
  19048. bindFunction("seconds");
  19049. };
  19050. onMounted(() => {
  19051. nextTick(() => {
  19052. !props.arrowControl && bindScrollEvent();
  19053. adjustSpinners();
  19054. if (props.role === "start") emitSelectRange("hours");
  19055. });
  19056. });
  19057. const setRef = (scrollbar, type) => {
  19058. listRefsMap[type].value = scrollbar ?? void 0;
  19059. };
  19060. emit("set-option", [`${props.role}_scrollDown`, scrollDown]);
  19061. emit("set-option", [`${props.role}_emitSelectRange`, emitSelectRange]);
  19062. watch(() => props.spinnerDate, () => {
  19063. if (isScrolling) return;
  19064. adjustSpinners();
  19065. });
  19066. return (_ctx, _cache) => {
  19067. return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }]) }, [!_ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(spinnerItems.value, (item) => {
  19068. return openBlock(), createBlock(unref(ElScrollbar), {
  19069. key: item,
  19070. ref_for: true,
  19071. ref: (scrollbar) => setRef(scrollbar, item),
  19072. class: normalizeClass(unref(ns).be("spinner", "wrapper")),
  19073. "wrap-style": "max-height: inherit;",
  19074. "view-class": unref(ns).be("spinner", "list"),
  19075. noresize: "",
  19076. tag: "ul",
  19077. onMouseenter: ($event) => emitSelectRange(item),
  19078. onMousemove: ($event) => adjustCurrentSpinner(item)
  19079. }, {
  19080. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(timeList.value[item], (disabled, key) => {
  19081. return openBlock(), createElementBlock("li", {
  19082. key,
  19083. class: normalizeClass([
  19084. unref(ns).be("spinner", "item"),
  19085. unref(ns).is("active", key === timePartials.value[item]),
  19086. unref(ns).is("disabled", disabled)
  19087. ]),
  19088. onClick: ($event) => handleClick(item, {
  19089. value: key,
  19090. disabled
  19091. })
  19092. }, [item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(("0" + key).slice(-2)), 1)], 64))], 10, _hoisted_1$70);
  19093. }), 128))]),
  19094. _: 2
  19095. }, 1032, [
  19096. "class",
  19097. "view-class",
  19098. "onMouseenter",
  19099. "onMousemove"
  19100. ]);
  19101. }), 128)) : createCommentVNode("v-if", true), _ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(spinnerItems.value, (item) => {
  19102. return openBlock(), createElementBlock("div", {
  19103. key: item,
  19104. class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]),
  19105. onMouseenter: ($event) => emitSelectRange(item)
  19106. }, [
  19107. withDirectives((openBlock(), createBlock(unref(ElIcon), { class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")]) }, {
  19108. default: withCtx(() => [createVNode(unref(arrow_up_default))]),
  19109. _: 1
  19110. }, 8, ["class"])), [[unref(vRepeatClick), onDecrement]]),
  19111. withDirectives((openBlock(), createBlock(unref(ElIcon), { class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")]) }, {
  19112. default: withCtx(() => [createVNode(unref(arrow_down_default))]),
  19113. _: 1
  19114. }, 8, ["class"])), [[unref(vRepeatClick), onIncrement]]),
  19115. createElementVNode("ul", { class: normalizeClass(unref(ns).be("spinner", "list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(arrowControlTimeList.value[item], (time, key) => {
  19116. return openBlock(), createElementBlock("li", {
  19117. key,
  19118. class: normalizeClass([
  19119. unref(ns).be("spinner", "item"),
  19120. unref(ns).is("active", time === timePartials.value[item]),
  19121. unref(ns).is("disabled", timeList.value[item][time])
  19122. ])
  19123. }, [unref(isNumber)(time) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + toDisplayString(getAmPmFlag(time)), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(("0" + time).slice(-2)), 1)], 64))], 64)) : createCommentVNode("v-if", true)], 2);
  19124. }), 128))], 2)
  19125. ], 42, _hoisted_2$39);
  19126. }), 128)) : createCommentVNode("v-if", true)], 2);
  19127. };
  19128. }
  19129. });
  19130. //#endregion
  19131. //#region ../../packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue
  19132. var basic_time_spinner_default = basic_time_spinner_vue_vue_type_script_setup_true_lang_default;
  19133. //#endregion
  19134. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-pick.vue?vue&type=script&setup=true&lang.ts
  19135. var panel_time_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  19136. __name: "panel-time-pick",
  19137. props: panelTimePickerProps,
  19138. emits: [
  19139. "pick",
  19140. "select-range",
  19141. "set-picker-option"
  19142. ],
  19143. setup(__props, { emit: __emit }) {
  19144. const props = __props;
  19145. const emit = __emit;
  19146. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  19147. const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props;
  19148. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds);
  19149. const ns = useNamespace("time");
  19150. const { t, lang } = useLocale();
  19151. const selectionRange = ref([0, 2]);
  19152. const oldValue = useOldValue(props, {
  19153. modelValue: computed(() => pickerBase.props.modelValue),
  19154. valueOnClear: computed(() => pickerBase?.emptyValues ? pickerBase.emptyValues.valueOnClear.value : null)
  19155. });
  19156. const transitionName = computed(() => {
  19157. return isUndefined(props.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : "";
  19158. });
  19159. const showSeconds = computed(() => {
  19160. return props.format.includes("ss");
  19161. });
  19162. const amPmMode = computed(() => {
  19163. if (props.format.includes("A")) return "A";
  19164. if (props.format.includes("a")) return "a";
  19165. return "";
  19166. });
  19167. const isValidValue = (_date) => {
  19168. const parsedDate = (0, import_dayjs_min.default)(_date).locale(lang.value);
  19169. const result = getRangeAvailableTime(parsedDate);
  19170. return parsedDate.isSame(result);
  19171. };
  19172. const handleCancel = () => {
  19173. const old = oldValue.value;
  19174. emit("pick", old, false);
  19175. nextTick(() => {
  19176. oldValue.value = old;
  19177. });
  19178. };
  19179. const handleConfirm = (visible = false, first = false) => {
  19180. if (first) return;
  19181. emit("pick", props.parsedValue, visible);
  19182. };
  19183. const handleChange = (_date) => {
  19184. if (!props.visible) return;
  19185. emit("pick", getRangeAvailableTime(_date).millisecond(0), true);
  19186. };
  19187. const setSelectionRange = (start, end) => {
  19188. emit("select-range", start, end);
  19189. selectionRange.value = [start, end];
  19190. };
  19191. const changeSelectionRange = (step) => {
  19192. const actualFormat = props.format;
  19193. const hourIndex = actualFormat.indexOf("HH");
  19194. const minuteIndex = actualFormat.indexOf("mm");
  19195. const secondIndex = actualFormat.indexOf("ss");
  19196. const list = [];
  19197. const mapping = [];
  19198. if (hourIndex !== -1) {
  19199. list.push(hourIndex);
  19200. mapping.push("hours");
  19201. }
  19202. if (minuteIndex !== -1) {
  19203. list.push(minuteIndex);
  19204. mapping.push("minutes");
  19205. }
  19206. if (secondIndex !== -1 && showSeconds.value) {
  19207. list.push(secondIndex);
  19208. mapping.push("seconds");
  19209. }
  19210. const next = (list.indexOf(selectionRange.value[0]) + step + list.length) % list.length;
  19211. timePickerOptions["start_emitSelectRange"](mapping[next]);
  19212. };
  19213. const handleKeydown = (event) => {
  19214. const code = getEventCode(event);
  19215. const { left, right, up, down } = EVENT_CODE;
  19216. if ([left, right].includes(code)) {
  19217. changeSelectionRange(code === left ? -1 : 1);
  19218. event.preventDefault();
  19219. return;
  19220. }
  19221. if ([up, down].includes(code)) {
  19222. const step = code === up ? -1 : 1;
  19223. timePickerOptions["start_scrollDown"](step);
  19224. event.preventDefault();
  19225. return;
  19226. }
  19227. };
  19228. const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({
  19229. getAvailableHours,
  19230. getAvailableMinutes,
  19231. getAvailableSeconds
  19232. });
  19233. const getRangeAvailableTime = (date) => {
  19234. return getAvailableTime(date, props.datetimeRole || "", true);
  19235. };
  19236. const parseUserInput = (value) => {
  19237. if (!value) return null;
  19238. return (0, import_dayjs_min.default)(value, props.format).locale(lang.value);
  19239. };
  19240. const getDefaultValue = () => {
  19241. return (0, import_dayjs_min.default)(defaultValue).locale(lang.value);
  19242. };
  19243. emit("set-picker-option", ["isValidValue", isValidValue]);
  19244. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  19245. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  19246. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  19247. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  19248. emit("set-picker-option", ["handleCancel", handleCancel]);
  19249. return (_ctx, _cache) => {
  19250. return openBlock(), createBlock(Transition, { name: transitionName.value }, {
  19251. default: withCtx(() => [_ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock("div", {
  19252. key: 0,
  19253. class: normalizeClass(unref(ns).b("panel"))
  19254. }, [createElementVNode("div", { class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": showSeconds.value }]) }, [createVNode(basic_time_spinner_default, {
  19255. ref: "spinner",
  19256. role: _ctx.datetimeRole || "start",
  19257. "arrow-control": unref(arrowControl),
  19258. "show-seconds": showSeconds.value,
  19259. "am-pm-mode": amPmMode.value,
  19260. "spinner-date": _ctx.parsedValue,
  19261. "disabled-hours": unref(disabledHours),
  19262. "disabled-minutes": unref(disabledMinutes),
  19263. "disabled-seconds": unref(disabledSeconds),
  19264. onChange: handleChange,
  19265. onSetOption: unref(onSetOption),
  19266. onSelectRange: setSelectionRange
  19267. }, null, 8, [
  19268. "role",
  19269. "arrow-control",
  19270. "show-seconds",
  19271. "am-pm-mode",
  19272. "spinner-date",
  19273. "disabled-hours",
  19274. "disabled-minutes",
  19275. "disabled-seconds",
  19276. "onSetOption"
  19277. ])], 2), createElementVNode("div", { class: normalizeClass(unref(ns).be("panel", "footer")) }, [createElementVNode("button", {
  19278. type: "button",
  19279. class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]),
  19280. onClick: handleCancel
  19281. }, toDisplayString(unref(t)("el.datepicker.cancel")), 3), createElementVNode("button", {
  19282. type: "button",
  19283. class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]),
  19284. onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm())
  19285. }, toDisplayString(unref(t)("el.datepicker.confirm")), 3)], 2)], 2)) : createCommentVNode("v-if", true)]),
  19286. _: 1
  19287. }, 8, ["name"]);
  19288. };
  19289. }
  19290. });
  19291. //#endregion
  19292. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-pick.vue
  19293. var panel_time_pick_default = panel_time_pick_vue_vue_type_script_setup_true_lang_default;
  19294. //#endregion
  19295. //#region ../../packages/components/time-picker/src/props/panel-time-range.ts
  19296. const panelTimeRangeProps = buildProps({
  19297. ...timePanelSharedProps,
  19298. parsedValue: { type: definePropType(Array) }
  19299. });
  19300. //#endregion
  19301. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-range.vue?vue&type=script&setup=true&lang.ts
  19302. const _hoisted_1$69 = ["disabled"];
  19303. var panel_time_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  19304. __name: "panel-time-range",
  19305. props: panelTimeRangeProps,
  19306. emits: [
  19307. "pick",
  19308. "select-range",
  19309. "set-picker-option"
  19310. ],
  19311. setup(__props, { emit: __emit }) {
  19312. const props = __props;
  19313. const emit = __emit;
  19314. const makeSelectRange = (start, end) => {
  19315. const result = [];
  19316. for (let i = start; i <= end; i++) result.push(i);
  19317. return result;
  19318. };
  19319. const { t, lang } = useLocale();
  19320. const nsTime = useNamespace("time");
  19321. const nsPicker = useNamespace("picker");
  19322. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  19323. const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props;
  19324. const startContainerKls = computed(() => [
  19325. nsTime.be("range-picker", "body"),
  19326. nsTime.be("panel", "content"),
  19327. nsTime.is("arrow", arrowControl),
  19328. showSeconds.value ? "has-seconds" : ""
  19329. ]);
  19330. const endContainerKls = computed(() => [
  19331. nsTime.be("range-picker", "body"),
  19332. nsTime.be("panel", "content"),
  19333. nsTime.is("arrow", arrowControl),
  19334. showSeconds.value ? "has-seconds" : ""
  19335. ]);
  19336. const startTime = computed(() => props.parsedValue[0]);
  19337. const endTime = computed(() => props.parsedValue[1]);
  19338. const oldValue = useOldValue(props, {
  19339. modelValue: computed(() => pickerBase.props.modelValue),
  19340. valueOnClear: computed(() => pickerBase?.emptyValues ? pickerBase.emptyValues.valueOnClear.value : null)
  19341. });
  19342. const handleCancel = () => {
  19343. const old = oldValue.value;
  19344. emit("pick", old, false);
  19345. nextTick(() => {
  19346. oldValue.value = old;
  19347. });
  19348. };
  19349. const showSeconds = computed(() => {
  19350. return props.format.includes("ss");
  19351. });
  19352. const amPmMode = computed(() => {
  19353. if (props.format.includes("A")) return "A";
  19354. if (props.format.includes("a")) return "a";
  19355. return "";
  19356. });
  19357. const handleConfirm = (visible = false) => {
  19358. emit("pick", [startTime.value, endTime.value], visible);
  19359. };
  19360. const handleMinChange = (date) => {
  19361. handleChange(date.millisecond(0), endTime.value);
  19362. };
  19363. const handleMaxChange = (date) => {
  19364. handleChange(startTime.value, date.millisecond(0));
  19365. };
  19366. const isValidValue = (_date) => {
  19367. const parsedDate = _date.map((_) => (0, import_dayjs_min.default)(_).locale(lang.value));
  19368. const result = getRangeAvailableTime(parsedDate);
  19369. return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]);
  19370. };
  19371. const handleChange = (start, end) => {
  19372. if (!props.visible) return;
  19373. emit("pick", [start, end], true);
  19374. };
  19375. const btnConfirmDisabled = computed(() => {
  19376. return startTime.value > endTime.value;
  19377. });
  19378. const selectionRange = ref([0, 2]);
  19379. const setMinSelectionRange = (start, end) => {
  19380. emit("select-range", start, end, "min");
  19381. selectionRange.value = [start, end];
  19382. };
  19383. const offset = computed(() => showSeconds.value ? 11 : 8);
  19384. const setMaxSelectionRange = (start, end) => {
  19385. emit("select-range", start, end, "max");
  19386. const _offset = unref(offset);
  19387. selectionRange.value = [start + _offset, end + _offset];
  19388. };
  19389. const changeSelectionRange = (step) => {
  19390. const list = showSeconds.value ? [
  19391. 0,
  19392. 3,
  19393. 6,
  19394. 11,
  19395. 14,
  19396. 17
  19397. ] : [
  19398. 0,
  19399. 3,
  19400. 8,
  19401. 11
  19402. ];
  19403. const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
  19404. const next = (list.indexOf(selectionRange.value[0]) + step + list.length) % list.length;
  19405. const half = list.length / 2;
  19406. if (next < half) timePickerOptions["start_emitSelectRange"](mapping[next]);
  19407. else timePickerOptions["end_emitSelectRange"](mapping[next - half]);
  19408. };
  19409. const handleKeydown = (event) => {
  19410. const code = getEventCode(event);
  19411. const { left, right, up, down } = EVENT_CODE;
  19412. if ([left, right].includes(code)) {
  19413. changeSelectionRange(code === left ? -1 : 1);
  19414. event.preventDefault();
  19415. return;
  19416. }
  19417. if ([up, down].includes(code)) {
  19418. const step = code === up ? -1 : 1;
  19419. timePickerOptions[`${selectionRange.value[0] < offset.value ? "start" : "end"}_scrollDown`](step);
  19420. event.preventDefault();
  19421. return;
  19422. }
  19423. };
  19424. const disabledHours_ = (role, compare) => {
  19425. const defaultDisable = disabledHours ? disabledHours(role) : [];
  19426. const isStart = role === "start";
  19427. const compareHour = (compare || (isStart ? endTime.value : startTime.value)).hour();
  19428. return union(defaultDisable, isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1));
  19429. };
  19430. const disabledMinutes_ = (hour, role, compare) => {
  19431. const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : [];
  19432. const isStart = role === "start";
  19433. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  19434. if (hour !== compareDate.hour()) return defaultDisable;
  19435. const compareMinute = compareDate.minute();
  19436. return union(defaultDisable, isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1));
  19437. };
  19438. const disabledSeconds_ = (hour, minute, role, compare) => {
  19439. const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : [];
  19440. const isStart = role === "start";
  19441. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  19442. const compareHour = compareDate.hour();
  19443. const compareMinute = compareDate.minute();
  19444. if (hour !== compareHour || minute !== compareMinute) return defaultDisable;
  19445. const compareSecond = compareDate.second();
  19446. return union(defaultDisable, isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1));
  19447. };
  19448. const getRangeAvailableTime = ([start, end]) => {
  19449. return [getAvailableTime(start, "start", true, end), getAvailableTime(end, "end", false, start)];
  19450. };
  19451. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours_, disabledMinutes_, disabledSeconds_);
  19452. const { timePickerOptions, getAvailableTime, onSetOption } = useTimePanel({
  19453. getAvailableHours,
  19454. getAvailableMinutes,
  19455. getAvailableSeconds
  19456. });
  19457. const parseUserInput = (days) => {
  19458. if (!days) return null;
  19459. if (isArray$1(days)) return days.map((d) => (0, import_dayjs_min.default)(d, props.format).locale(lang.value));
  19460. return (0, import_dayjs_min.default)(days, props.format).locale(lang.value);
  19461. };
  19462. const getDefaultValue = () => {
  19463. if (isArray$1(defaultValue)) return defaultValue.map((d) => (0, import_dayjs_min.default)(d).locale(lang.value));
  19464. const defaultDay = (0, import_dayjs_min.default)(defaultValue).locale(lang.value);
  19465. return [defaultDay, defaultDay.add(60, "m")];
  19466. };
  19467. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  19468. emit("set-picker-option", ["isValidValue", isValidValue]);
  19469. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  19470. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  19471. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  19472. emit("set-picker-option", ["handleCancel", handleCancel]);
  19473. return (_ctx, _cache) => {
  19474. return _ctx.actualVisible ? (openBlock(), createElementBlock("div", {
  19475. key: 0,
  19476. class: normalizeClass([unref(nsTime).b("range-picker"), unref(nsPicker).b("panel")])
  19477. }, [createElementVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "content")) }, [createElementVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "cell")) }, [createElementVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "header")) }, toDisplayString(unref(t)("el.datepicker.startTime")), 3), createElementVNode("div", { class: normalizeClass(startContainerKls.value) }, [createVNode(basic_time_spinner_default, {
  19478. ref: "minSpinner",
  19479. role: "start",
  19480. "show-seconds": showSeconds.value,
  19481. "am-pm-mode": amPmMode.value,
  19482. "arrow-control": unref(arrowControl),
  19483. "spinner-date": startTime.value,
  19484. "disabled-hours": disabledHours_,
  19485. "disabled-minutes": disabledMinutes_,
  19486. "disabled-seconds": disabledSeconds_,
  19487. onChange: handleMinChange,
  19488. onSetOption: unref(onSetOption),
  19489. onSelectRange: setMinSelectionRange
  19490. }, null, 8, [
  19491. "show-seconds",
  19492. "am-pm-mode",
  19493. "arrow-control",
  19494. "spinner-date",
  19495. "onSetOption"
  19496. ])], 2)], 2), createElementVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "cell")) }, [createElementVNode("div", { class: normalizeClass(unref(nsTime).be("range-picker", "header")) }, toDisplayString(unref(t)("el.datepicker.endTime")), 3), createElementVNode("div", { class: normalizeClass(endContainerKls.value) }, [createVNode(basic_time_spinner_default, {
  19497. ref: "maxSpinner",
  19498. role: "end",
  19499. "show-seconds": showSeconds.value,
  19500. "am-pm-mode": amPmMode.value,
  19501. "arrow-control": unref(arrowControl),
  19502. "spinner-date": endTime.value,
  19503. "disabled-hours": disabledHours_,
  19504. "disabled-minutes": disabledMinutes_,
  19505. "disabled-seconds": disabledSeconds_,
  19506. onChange: handleMaxChange,
  19507. onSetOption: unref(onSetOption),
  19508. onSelectRange: setMaxSelectionRange
  19509. }, null, 8, [
  19510. "show-seconds",
  19511. "am-pm-mode",
  19512. "arrow-control",
  19513. "spinner-date",
  19514. "onSetOption"
  19515. ])], 2)], 2)], 2), createElementVNode("div", { class: normalizeClass(unref(nsTime).be("panel", "footer")) }, [createElementVNode("button", {
  19516. type: "button",
  19517. class: normalizeClass([unref(nsTime).be("panel", "btn"), "cancel"]),
  19518. onClick: _cache[0] || (_cache[0] = ($event) => handleCancel())
  19519. }, toDisplayString(unref(t)("el.datepicker.cancel")), 3), createElementVNode("button", {
  19520. type: "button",
  19521. class: normalizeClass([unref(nsTime).be("panel", "btn"), "confirm"]),
  19522. disabled: btnConfirmDisabled.value,
  19523. onClick: _cache[1] || (_cache[1] = ($event) => handleConfirm())
  19524. }, toDisplayString(unref(t)("el.datepicker.confirm")), 11, _hoisted_1$69)], 2)], 2)) : createCommentVNode("v-if", true);
  19525. };
  19526. }
  19527. });
  19528. //#endregion
  19529. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-range.vue
  19530. var panel_time_range_default = panel_time_range_vue_vue_type_script_setup_true_lang_default;
  19531. //#endregion
  19532. //#region ../../packages/components/time-picker/src/time-picker.tsx
  19533. import_dayjs_min.default.extend(import_customParseFormat.default);
  19534. var time_picker_default = /* @__PURE__ */ defineComponent({
  19535. name: "ElTimePicker",
  19536. install: null,
  19537. props: {
  19538. ...timePickerDefaultProps,
  19539. isRange: Boolean
  19540. },
  19541. emits: [UPDATE_MODEL_EVENT],
  19542. setup(props, ctx) {
  19543. const commonPicker = ref();
  19544. const [type, Panel] = props.isRange ? ["timerange", panel_time_range_default] : ["time", panel_time_pick_default];
  19545. const modelUpdater = (value) => ctx.emit(UPDATE_MODEL_EVENT, value);
  19546. provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, props.popperOptions);
  19547. ctx.expose({
  19548. focus: () => {
  19549. commonPicker.value?.focus();
  19550. },
  19551. blur: () => {
  19552. commonPicker.value?.blur();
  19553. },
  19554. handleOpen: () => {
  19555. commonPicker.value?.handleOpen();
  19556. },
  19557. handleClose: () => {
  19558. commonPicker.value?.handleClose();
  19559. }
  19560. });
  19561. return () => {
  19562. const format = props.format ?? DEFAULT_FORMATS_TIME;
  19563. return createVNode(picker_default, mergeProps(props, {
  19564. "ref": commonPicker,
  19565. "type": type,
  19566. "format": format,
  19567. "onUpdate:modelValue": modelUpdater
  19568. }), { default: (props) => createVNode(Panel, props, null) });
  19569. };
  19570. }
  19571. });
  19572. //#endregion
  19573. //#region ../../packages/components/time-picker/index.ts
  19574. const ElTimePicker = withInstall(time_picker_default);
  19575. //#endregion
  19576. //#region ../../packages/components/calendar/src/date-table.ts
  19577. const getPrevMonthLastDays = (date, count) => {
  19578. const lastDay = date.subtract(1, "month").endOf("month").date();
  19579. return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
  19580. };
  19581. const getMonthDays = (date) => {
  19582. return rangeArr(date.daysInMonth()).map((_, index) => index + 1);
  19583. };
  19584. const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
  19585. const start = index * 7;
  19586. return days.slice(start, start + 7);
  19587. });
  19588. /**
  19589. * @deprecated Removed after 3.0.0, Use `DateTableProps` instead.
  19590. */
  19591. const dateTableProps = buildProps({
  19592. selectedDay: { type: definePropType(Object) },
  19593. range: { type: definePropType(Array) },
  19594. date: {
  19595. type: definePropType(Object),
  19596. required: true
  19597. },
  19598. hideHeader: { type: Boolean }
  19599. });
  19600. const dateTableEmits = { pick: (value) => isObject$1(value) };
  19601. //#endregion
  19602. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/localeData.js
  19603. var require_localeData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  19604. (function(n, e) {
  19605. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (n = "undefined" != typeof globalThis ? globalThis : n || self).dayjs_plugin_localeData = e();
  19606. })(exports, (function() {
  19607. "use strict";
  19608. return function(n, e, t) {
  19609. var r = e.prototype, o = function(n) {
  19610. return n && (n.indexOf ? n : n.s);
  19611. }, u = function(n, e, t, r, u) {
  19612. var i = n.name ? n : n.$locale(), a = o(i[e]), s = o(i[t]), f = a || s.map((function(n) {
  19613. return n.slice(0, r);
  19614. }));
  19615. if (!u) return f;
  19616. var d = i.weekStart;
  19617. return f.map((function(n, e) {
  19618. return f[(e + (d || 0)) % 7];
  19619. }));
  19620. }, i = function() {
  19621. return t.Ls[t.locale()];
  19622. }, a = function(n, e) {
  19623. return n.formats[e] || function(n) {
  19624. return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(n, e, t) {
  19625. return e || t.slice(1);
  19626. }));
  19627. }(n.formats[e.toUpperCase()]);
  19628. }, s = function() {
  19629. var n = this;
  19630. return {
  19631. months: function(e) {
  19632. return e ? e.format("MMMM") : u(n, "months");
  19633. },
  19634. monthsShort: function(e) {
  19635. return e ? e.format("MMM") : u(n, "monthsShort", "months", 3);
  19636. },
  19637. firstDayOfWeek: function() {
  19638. return n.$locale().weekStart || 0;
  19639. },
  19640. weekdays: function(e) {
  19641. return e ? e.format("dddd") : u(n, "weekdays");
  19642. },
  19643. weekdaysMin: function(e) {
  19644. return e ? e.format("dd") : u(n, "weekdaysMin", "weekdays", 2);
  19645. },
  19646. weekdaysShort: function(e) {
  19647. return e ? e.format("ddd") : u(n, "weekdaysShort", "weekdays", 3);
  19648. },
  19649. longDateFormat: function(e) {
  19650. return a(n.$locale(), e);
  19651. },
  19652. meridiem: this.$locale().meridiem,
  19653. ordinal: this.$locale().ordinal
  19654. };
  19655. };
  19656. r.localeData = function() {
  19657. return s.bind(this)();
  19658. }, t.localeData = function() {
  19659. var n = i();
  19660. return {
  19661. firstDayOfWeek: function() {
  19662. return n.weekStart || 0;
  19663. },
  19664. weekdays: function() {
  19665. return t.weekdays();
  19666. },
  19667. weekdaysShort: function() {
  19668. return t.weekdaysShort();
  19669. },
  19670. weekdaysMin: function() {
  19671. return t.weekdaysMin();
  19672. },
  19673. months: function() {
  19674. return t.months();
  19675. },
  19676. monthsShort: function() {
  19677. return t.monthsShort();
  19678. },
  19679. longDateFormat: function(e) {
  19680. return a(n, e);
  19681. },
  19682. meridiem: n.meridiem,
  19683. ordinal: n.ordinal
  19684. };
  19685. }, t.months = function() {
  19686. return u(i(), "months");
  19687. }, t.monthsShort = function() {
  19688. return u(i(), "monthsShort", "months", 3);
  19689. }, t.weekdays = function(n) {
  19690. return u(i(), "weekdays", null, null, n);
  19691. }, t.weekdaysShort = function(n) {
  19692. return u(i(), "weekdaysShort", "weekdays", 3, n);
  19693. }, t.weekdaysMin = function(n) {
  19694. return u(i(), "weekdaysMin", "weekdays", 2, n);
  19695. };
  19696. };
  19697. }));
  19698. }));
  19699. //#endregion
  19700. //#region ../../packages/components/calendar/src/use-date-table.ts
  19701. var import_localeData = /* @__PURE__ */ __toESM(require_localeData());
  19702. const useDateTable = (props, emit) => {
  19703. import_dayjs_min.default.extend(import_localeData.default);
  19704. const firstDayOfWeek = import_dayjs_min.default.localeData().firstDayOfWeek();
  19705. const { t, lang } = useLocale();
  19706. const now = (0, import_dayjs_min.default)().locale(lang.value);
  19707. const isInRange = computed(() => !!props.range && !!props.range.length);
  19708. const rows = computed(() => {
  19709. let days = [];
  19710. if (isInRange.value) {
  19711. const [start, end] = props.range;
  19712. const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
  19713. text: start.date() + index,
  19714. type: "current"
  19715. }));
  19716. let remaining = currentMonthRange.length % 7;
  19717. remaining = remaining === 0 ? 0 : 7 - remaining;
  19718. const nextMonthRange = rangeArr(remaining).map((_, index) => ({
  19719. text: index + 1,
  19720. type: "next"
  19721. }));
  19722. days = currentMonthRange.concat(nextMonthRange);
  19723. } else {
  19724. const firstDay = props.date.startOf("month").day();
  19725. const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
  19726. text: day,
  19727. type: "prev"
  19728. }));
  19729. const currentMonthDays = getMonthDays(props.date).map((day) => ({
  19730. text: day,
  19731. type: "current"
  19732. }));
  19733. days = [...prevMonthDays, ...currentMonthDays];
  19734. const nextMonthDays = rangeArr(7 - (days.length % 7 || 7)).map((_, index) => ({
  19735. text: index + 1,
  19736. type: "next"
  19737. }));
  19738. days = days.concat(nextMonthDays);
  19739. }
  19740. return toNestedArr(days);
  19741. });
  19742. const weekDays = computed(() => {
  19743. const start = firstDayOfWeek;
  19744. if (start === 0) return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
  19745. else return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
  19746. });
  19747. const getFormattedDate = (day, type) => {
  19748. switch (type) {
  19749. case "prev": return props.date.startOf("month").subtract(1, "month").date(day);
  19750. case "next": return props.date.startOf("month").add(1, "month").date(day);
  19751. case "current": return props.date.date(day);
  19752. }
  19753. };
  19754. const handlePickDay = ({ text, type }) => {
  19755. emit("pick", getFormattedDate(text, type));
  19756. };
  19757. const getSlotData = ({ text, type }) => {
  19758. const day = getFormattedDate(text, type);
  19759. return {
  19760. isSelected: day.isSame(props.selectedDay),
  19761. type: `${type}-month`,
  19762. day: day.format("YYYY-MM-DD"),
  19763. date: day.toDate()
  19764. };
  19765. };
  19766. return {
  19767. now,
  19768. isInRange,
  19769. rows,
  19770. weekDays,
  19771. getFormattedDate,
  19772. handlePickDay,
  19773. getSlotData
  19774. };
  19775. };
  19776. //#endregion
  19777. //#region ../../packages/components/calendar/src/date-table.vue?vue&type=script&setup=true&lang.ts
  19778. const _hoisted_1$68 = { key: 0 };
  19779. const _hoisted_2$38 = ["onClick"];
  19780. var date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  19781. name: "DateTable",
  19782. __name: "date-table",
  19783. props: dateTableProps,
  19784. emits: dateTableEmits,
  19785. setup(__props, { expose: __expose, emit: __emit }) {
  19786. const props = __props;
  19787. const { isInRange, now, rows, weekDays, getFormattedDate, handlePickDay, getSlotData } = useDateTable(props, __emit);
  19788. const nsTable = useNamespace("calendar-table");
  19789. const nsDay = useNamespace("calendar-day");
  19790. const getCellClass = ({ text, type }) => {
  19791. const classes = [type];
  19792. if (type === "current") {
  19793. const date = getFormattedDate(text, type);
  19794. if (date.isSame(props.selectedDay, "day")) classes.push(nsDay.is("selected"));
  19795. if (date.isSame(now, "day")) classes.push(nsDay.is("today"));
  19796. }
  19797. return classes;
  19798. };
  19799. __expose({ getFormattedDate });
  19800. return (_ctx, _cache) => {
  19801. return openBlock(), createElementBlock("table", {
  19802. class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
  19803. cellspacing: "0",
  19804. cellpadding: "0"
  19805. }, [!__props.hideHeader ? (openBlock(), createElementBlock("thead", _hoisted_1$68, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
  19806. return openBlock(), createElementBlock("th", {
  19807. key: day,
  19808. scope: "col"
  19809. }, toDisplayString(day), 1);
  19810. }), 128))])])) : createCommentVNode("v-if", true), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
  19811. return openBlock(), createElementBlock("tr", {
  19812. key: index,
  19813. class: normalizeClass({
  19814. [unref(nsTable).e("row")]: true,
  19815. [unref(nsTable).em("row", "hide-border")]: index === 0 && __props.hideHeader
  19816. })
  19817. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
  19818. return openBlock(), createElementBlock("td", {
  19819. key,
  19820. class: normalizeClass(getCellClass(cell)),
  19821. onClick: ($event) => unref(handlePickDay)(cell)
  19822. }, [createElementVNode("div", { class: normalizeClass(unref(nsDay).b()) }, [renderSlot(_ctx.$slots, "date-cell", { data: unref(getSlotData)(cell) }, () => [createElementVNode("span", null, toDisplayString(cell.text), 1)])], 2)], 10, _hoisted_2$38);
  19823. }), 128))], 2);
  19824. }), 128))])], 2);
  19825. };
  19826. }
  19827. });
  19828. //#endregion
  19829. //#region ../../packages/components/calendar/src/date-table.vue
  19830. var date_table_default = date_table_vue_vue_type_script_setup_true_lang_default;
  19831. //#endregion
  19832. //#region ../../packages/components/calendar/src/use-calendar.ts
  19833. const adjacentMonth = (start, end) => {
  19834. const firstMonthLastDay = start.endOf("month");
  19835. const lastMonthFirstDay = end.startOf("month");
  19836. const lastMonthStartDay = firstMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  19837. return [[start, firstMonthLastDay], [lastMonthStartDay.startOf("week"), end]];
  19838. };
  19839. const threeConsecutiveMonth = (start, end) => {
  19840. const firstMonthLastDay = start.endOf("month");
  19841. const secondMonthFirstDay = start.add(1, "month").startOf("month");
  19842. const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
  19843. const secondMonthLastDay = secondMonthStartDay.endOf("month");
  19844. const lastMonthFirstDay = end.startOf("month");
  19845. const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  19846. return [
  19847. [start, firstMonthLastDay],
  19848. [secondMonthStartDay.startOf("week"), secondMonthLastDay],
  19849. [lastMonthStartDay.startOf("week"), end]
  19850. ];
  19851. };
  19852. const useCalendar = (props, emit, componentName) => {
  19853. const { lang } = useLocale();
  19854. const selectedDay = ref();
  19855. const now = (0, import_dayjs_min.default)().locale(lang.value);
  19856. const realSelectedDay = computed({
  19857. get() {
  19858. if (!props.modelValue) return selectedDay.value;
  19859. return date.value;
  19860. },
  19861. set(val) {
  19862. if (!val) return;
  19863. selectedDay.value = val;
  19864. const result = val.toDate();
  19865. emit(INPUT_EVENT, result);
  19866. emit(UPDATE_MODEL_EVENT, result);
  19867. }
  19868. });
  19869. const validatedRange = computed(() => {
  19870. if (!props.range || !isArray$1(props.range) || props.range.length !== 2 || props.range.some((item) => !isDate(item))) return [];
  19871. const [startDayjs, endDayjs] = props.range.map((_) => (0, import_dayjs_min.default)(_).locale(lang.value));
  19872. if (startDayjs.isAfter(endDayjs)) {
  19873. /* @__PURE__ */ debugWarn(componentName, "end time should be greater than start time");
  19874. return [];
  19875. }
  19876. if (startDayjs.isSame(endDayjs, "month")) return calculateValidatedDateRange(startDayjs, endDayjs);
  19877. else {
  19878. if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
  19879. /* @__PURE__ */ debugWarn(componentName, "start time and end time interval must not exceed two months");
  19880. return [];
  19881. }
  19882. return calculateValidatedDateRange(startDayjs, endDayjs);
  19883. }
  19884. });
  19885. const date = computed(() => {
  19886. if (!props.modelValue) return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
  19887. else return (0, import_dayjs_min.default)(props.modelValue).locale(lang.value);
  19888. });
  19889. const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
  19890. const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
  19891. const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
  19892. const nextYearDayjs = computed(() => date.value.add(1, "year").date(1));
  19893. const calculateValidatedDateRange = (startDayjs, endDayjs) => {
  19894. const firstDay = startDayjs.startOf("week");
  19895. const lastDay = endDayjs.endOf("week");
  19896. const firstMonth = firstDay.get("month");
  19897. const lastMonth = lastDay.get("month");
  19898. if (firstMonth === lastMonth) return [[firstDay, lastDay]];
  19899. else if ((firstMonth + 1) % 12 === lastMonth) return adjacentMonth(firstDay, lastDay);
  19900. else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) return threeConsecutiveMonth(firstDay, lastDay);
  19901. else {
  19902. /* @__PURE__ */ debugWarn(componentName, "start time and end time interval must not exceed two months");
  19903. return [];
  19904. }
  19905. };
  19906. const pickDay = (day) => {
  19907. realSelectedDay.value = day;
  19908. };
  19909. const selectDate = (type) => {
  19910. const day = {
  19911. "prev-month": prevMonthDayjs.value,
  19912. "next-month": nextMonthDayjs.value,
  19913. "prev-year": prevYearDayjs.value,
  19914. "next-year": nextYearDayjs.value,
  19915. today: now
  19916. }[type];
  19917. if (!day.isSame(date.value, "day")) pickDay(day);
  19918. };
  19919. const handleDateChange = (date) => {
  19920. if (date === "today") selectDate("today");
  19921. else pickDay(date);
  19922. };
  19923. return {
  19924. calculateValidatedDateRange,
  19925. date,
  19926. realSelectedDay,
  19927. pickDay,
  19928. selectDate,
  19929. validatedRange,
  19930. handleDateChange
  19931. };
  19932. };
  19933. //#endregion
  19934. //#region ../../packages/components/calendar/src/select-controller.ts
  19935. /**
  19936. * @deprecated Removed after 3.0.0, Use `SelectControllerProps` instead.
  19937. */
  19938. const selectControllerProps = buildProps({
  19939. date: {
  19940. type: definePropType(Object),
  19941. required: true
  19942. },
  19943. formatter: { type: definePropType(Function) }
  19944. });
  19945. const selectControllerEmits = { "date-change": (date) => isObject$1(date) || isString(date) };
  19946. //#endregion
  19947. //#region ../../packages/components/tag/src/tag.ts
  19948. /**
  19949. * @deprecated Removed after 3.0.0, Use `TagProps` instead.
  19950. */
  19951. const tagProps = buildProps({
  19952. type: {
  19953. type: String,
  19954. values: [
  19955. "primary",
  19956. "success",
  19957. "info",
  19958. "warning",
  19959. "danger"
  19960. ],
  19961. default: "primary"
  19962. },
  19963. closable: Boolean,
  19964. disableTransitions: Boolean,
  19965. hit: Boolean,
  19966. color: String,
  19967. size: {
  19968. type: String,
  19969. values: componentSizes
  19970. },
  19971. effect: {
  19972. type: String,
  19973. values: [
  19974. "dark",
  19975. "light",
  19976. "plain"
  19977. ],
  19978. default: "light"
  19979. },
  19980. round: Boolean
  19981. });
  19982. const tagEmits = {
  19983. close: (evt) => evt instanceof MouseEvent,
  19984. click: (evt) => evt instanceof MouseEvent
  19985. };
  19986. //#endregion
  19987. //#region ../../packages/components/tag/src/tag.vue?vue&type=script&setup=true&lang.ts
  19988. const _hoisted_1$67 = ["aria-label"];
  19989. const _hoisted_2$37 = ["aria-label"];
  19990. var tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  19991. name: "ElTag",
  19992. __name: "tag",
  19993. props: tagProps,
  19994. emits: tagEmits,
  19995. setup(__props, { emit: __emit }) {
  19996. const props = __props;
  19997. const emit = __emit;
  19998. const tagSize = useFormSize();
  19999. const { t } = useLocale();
  20000. const ns = useNamespace("tag");
  20001. const containerKls = computed(() => {
  20002. const { type, hit, effect, closable, round } = props;
  20003. return [
  20004. ns.b(),
  20005. ns.is("closable", closable),
  20006. ns.m(type || "primary"),
  20007. ns.m(tagSize.value),
  20008. ns.m(effect),
  20009. ns.is("hit", hit),
  20010. ns.is("round", round)
  20011. ];
  20012. });
  20013. const handleClose = (event) => {
  20014. emit("close", event);
  20015. };
  20016. const handleClick = (event) => {
  20017. emit("click", event);
  20018. };
  20019. const handleVNodeMounted = (vnode) => {
  20020. if (vnode?.component?.subTree?.component?.bum) vnode.component.subTree.component.bum = null;
  20021. };
  20022. return (_ctx, _cache) => {
  20023. return __props.disableTransitions ? (openBlock(), createElementBlock("span", {
  20024. key: 0,
  20025. class: normalizeClass(containerKls.value),
  20026. style: normalizeStyle({ backgroundColor: __props.color }),
  20027. onClick: handleClick
  20028. }, [createElementVNode("span", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2), __props.closable ? (openBlock(), createElementBlock("button", {
  20029. key: 0,
  20030. "aria-label": unref(t)("el.tag.close"),
  20031. class: normalizeClass(unref(ns).e("close")),
  20032. type: "button",
  20033. onClick: withModifiers(handleClose, ["stop"])
  20034. }, [createVNode(unref(ElIcon), null, {
  20035. default: withCtx(() => [createVNode(unref(close_default))]),
  20036. _: 1
  20037. })], 10, _hoisted_1$67)) : createCommentVNode("v-if", true)], 6)) : (openBlock(), createBlock(Transition, {
  20038. key: 1,
  20039. name: `${unref(ns).namespace.value}-zoom-in-center`,
  20040. appear: "",
  20041. onVnodeMounted: handleVNodeMounted
  20042. }, {
  20043. default: withCtx(() => [createElementVNode("span", {
  20044. class: normalizeClass(containerKls.value),
  20045. style: normalizeStyle({ backgroundColor: __props.color }),
  20046. onClick: handleClick
  20047. }, [createElementVNode("span", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2), __props.closable ? (openBlock(), createElementBlock("button", {
  20048. key: 0,
  20049. "aria-label": unref(t)("el.tag.close"),
  20050. class: normalizeClass(unref(ns).e("close")),
  20051. type: "button",
  20052. onClick: withModifiers(handleClose, ["stop"])
  20053. }, [createVNode(unref(ElIcon), null, {
  20054. default: withCtx(() => [createVNode(unref(close_default))]),
  20055. _: 1
  20056. })], 10, _hoisted_2$37)) : createCommentVNode("v-if", true)], 6)]),
  20057. _: 3
  20058. }, 8, ["name"]));
  20059. };
  20060. }
  20061. });
  20062. //#endregion
  20063. //#region ../../packages/components/tag/src/tag.vue
  20064. var tag_default = tag_vue_vue_type_script_setup_true_lang_default;
  20065. //#endregion
  20066. //#region ../../packages/components/tag/index.ts
  20067. const ElTag = withInstall(tag_default);
  20068. //#endregion
  20069. //#region ../../packages/components/select-v2/src/useProps.ts
  20070. const defaultProps$2 = {
  20071. label: "label",
  20072. value: "value",
  20073. disabled: "disabled",
  20074. options: "options"
  20075. };
  20076. function useProps(props) {
  20077. const aliasProps = ref({
  20078. ...defaultProps$2,
  20079. ...props.props
  20080. });
  20081. let cache = { ...props.props };
  20082. watch(() => props.props, (val) => {
  20083. if (!isEqual$1(val, cache)) {
  20084. aliasProps.value = {
  20085. ...defaultProps$2,
  20086. ...val
  20087. };
  20088. cache = { ...val };
  20089. }
  20090. }, { deep: true });
  20091. const getLabel = (option) => get(option, aliasProps.value.label);
  20092. const getValue = (option) => get(option, aliasProps.value.value);
  20093. const getDisabled = (option) => get(option, aliasProps.value.disabled);
  20094. const getOptions = (option) => get(option, aliasProps.value.options);
  20095. return {
  20096. aliasProps,
  20097. getLabel,
  20098. getValue,
  20099. getDisabled,
  20100. getOptions
  20101. };
  20102. }
  20103. //#endregion
  20104. //#region ../../packages/components/select/src/token.ts
  20105. const selectGroupKey = Symbol("ElSelectGroup");
  20106. const selectKey = Symbol("ElSelect");
  20107. //#endregion
  20108. //#region ../../packages/components/select/src/option.ts
  20109. const COMPONENT_NAME$14 = "ElOption";
  20110. const optionProps = buildProps({
  20111. value: {
  20112. type: [
  20113. String,
  20114. Number,
  20115. Boolean,
  20116. Object
  20117. ],
  20118. required: true
  20119. },
  20120. label: { type: [String, Number] },
  20121. created: Boolean,
  20122. disabled: Boolean
  20123. });
  20124. //#endregion
  20125. //#region ../../packages/components/select/src/useOption.ts
  20126. function useOption$1(props, states) {
  20127. const select = inject(selectKey);
  20128. if (!select) throwError(COMPONENT_NAME$14, "usage: <el-select><el-option /></el-select/>");
  20129. const selectGroup = inject(selectGroupKey, { disabled: false });
  20130. const itemSelected = computed(() => {
  20131. return contains(castArray$1(select.props.modelValue), props.value);
  20132. });
  20133. const limitReached = computed(() => {
  20134. if (select.props.multiple) {
  20135. const modelValue = castArray$1(select.props.modelValue ?? []);
  20136. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  20137. } else return false;
  20138. });
  20139. const currentLabel = computed(() => {
  20140. return props.label ?? (isObject$1(props.value) ? "" : props.value);
  20141. });
  20142. const currentValue = computed(() => {
  20143. return props.value || props.label || "";
  20144. });
  20145. const isDisabled = computed(() => {
  20146. return props.disabled || states.groupDisabled || limitReached.value;
  20147. });
  20148. const instance = getCurrentInstance();
  20149. const contains = (arr = [], target) => {
  20150. if (!isObject$1(props.value)) return arr && arr.includes(target);
  20151. else {
  20152. const valueKey = select.props.valueKey;
  20153. return arr && arr.some((item) => {
  20154. return toRaw(get(item, valueKey)) === get(target, valueKey);
  20155. });
  20156. }
  20157. };
  20158. const hoverItem = () => {
  20159. if (!isDisabled.value) select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy);
  20160. };
  20161. const updateOption = (query) => {
  20162. states.visible = new RegExp(escapeStringRegexp(query), "i").test(String(currentLabel.value)) || props.created;
  20163. };
  20164. watch(() => currentLabel.value, () => {
  20165. if (!props.created && !select.props.remote) select.setSelected();
  20166. });
  20167. watch(() => props.value, (val, oldVal) => {
  20168. const { remote, valueKey } = select.props;
  20169. if (remote ? val !== oldVal : !isEqual$1(val, oldVal)) {
  20170. select.onOptionDestroy(oldVal, instance.proxy);
  20171. select.onOptionCreate(instance.proxy);
  20172. }
  20173. if (!props.created && !remote) {
  20174. if (valueKey && isObject$1(val) && isObject$1(oldVal) && val[valueKey] === oldVal[valueKey]) return;
  20175. select.setSelected();
  20176. }
  20177. });
  20178. watch(() => selectGroup.disabled, () => {
  20179. states.groupDisabled = selectGroup.disabled;
  20180. }, { immediate: true });
  20181. return {
  20182. select,
  20183. currentLabel,
  20184. currentValue,
  20185. itemSelected,
  20186. isDisabled,
  20187. hoverItem,
  20188. updateOption
  20189. };
  20190. }
  20191. //#endregion
  20192. //#region ../../packages/components/select/src/option.vue?vue&type=script&lang.ts
  20193. var option_vue_vue_type_script_lang_default = defineComponent({
  20194. name: COMPONENT_NAME$14,
  20195. componentName: COMPONENT_NAME$14,
  20196. props: optionProps,
  20197. setup(props) {
  20198. const ns = useNamespace("select");
  20199. const id = useId();
  20200. const containerKls = computed(() => [
  20201. ns.be("dropdown", "item"),
  20202. ns.is("disabled", unref(isDisabled)),
  20203. ns.is("selected", unref(itemSelected)),
  20204. ns.is("hovering", unref(hover))
  20205. ]);
  20206. const states = reactive({
  20207. index: -1,
  20208. groupDisabled: false,
  20209. visible: true,
  20210. hover: false
  20211. });
  20212. const { currentLabel, itemSelected, isDisabled, select, hoverItem, updateOption } = useOption$1(props, states);
  20213. const { visible, hover } = toRefs(states);
  20214. const vm = getCurrentInstance().proxy;
  20215. select.onOptionCreate(vm);
  20216. onBeforeUnmount(() => {
  20217. const key = vm.value;
  20218. nextTick(() => {
  20219. const { selected: selectedOptions } = select.states;
  20220. const doesSelected = selectedOptions.some((item) => {
  20221. return item.value === vm.value;
  20222. });
  20223. if (select.states.cachedOptions.get(key) === vm && !doesSelected) select.states.cachedOptions.delete(key);
  20224. });
  20225. select.onOptionDestroy(key, vm);
  20226. });
  20227. function selectOptionClick() {
  20228. if (!isDisabled.value) select.handleOptionSelect(vm);
  20229. }
  20230. return {
  20231. ns,
  20232. id,
  20233. containerKls,
  20234. currentLabel,
  20235. itemSelected,
  20236. isDisabled,
  20237. select,
  20238. visible,
  20239. hover,
  20240. states,
  20241. hoverItem,
  20242. updateOption,
  20243. selectOptionClick
  20244. };
  20245. }
  20246. });
  20247. //#endregion
  20248. //#region ../../packages/components/select/src/option.vue
  20249. const _hoisted_1$66 = [
  20250. "id",
  20251. "aria-disabled",
  20252. "aria-selected"
  20253. ];
  20254. function _sfc_render$20(_ctx, _cache, $props, $setup, $data, $options) {
  20255. return withDirectives((openBlock(), createElementBlock("li", {
  20256. id: _ctx.id,
  20257. class: normalizeClass(_ctx.containerKls),
  20258. role: "option",
  20259. "aria-disabled": _ctx.isDisabled || void 0,
  20260. "aria-selected": _ctx.itemSelected,
  20261. onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  20262. onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  20263. }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("span", null, toDisplayString(_ctx.currentLabel), 1)])], 42, _hoisted_1$66)), [[vShow, _ctx.visible]]);
  20264. }
  20265. var option_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_vue_vue_type_script_lang_default, [["render", _sfc_render$20]]);
  20266. //#endregion
  20267. //#region ../../packages/components/select/src/select-dropdown.vue?vue&type=script&lang.ts
  20268. var select_dropdown_vue_vue_type_script_lang_default = defineComponent({
  20269. name: "ElSelectDropdown",
  20270. componentName: "ElSelectDropdown",
  20271. setup() {
  20272. const select = inject(selectKey);
  20273. const ns = useNamespace("select");
  20274. const popperClass = computed(() => select.props.popperClass);
  20275. const isMultiple = computed(() => select.props.multiple);
  20276. const isFitInputWidth = computed(() => select.props.fitInputWidth);
  20277. const minWidth = ref("");
  20278. function updateMinWidth() {
  20279. const offsetWidth = select.selectRef?.offsetWidth;
  20280. if (offsetWidth) minWidth.value = `${offsetWidth - BORDER_HORIZONTAL_WIDTH}px`;
  20281. else minWidth.value = "";
  20282. }
  20283. onMounted(() => {
  20284. updateMinWidth();
  20285. useResizeObserver(select.selectRef, updateMinWidth);
  20286. });
  20287. return {
  20288. ns,
  20289. minWidth,
  20290. popperClass,
  20291. isMultiple,
  20292. isFitInputWidth
  20293. };
  20294. }
  20295. });
  20296. //#endregion
  20297. //#region ../../packages/components/select/src/select-dropdown.vue
  20298. function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) {
  20299. return openBlock(), createElementBlock("div", {
  20300. class: normalizeClass([
  20301. _ctx.ns.b("dropdown"),
  20302. _ctx.ns.is("multiple", _ctx.isMultiple),
  20303. _ctx.popperClass
  20304. ]),
  20305. style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  20306. }, [
  20307. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  20308. key: 0,
  20309. class: normalizeClass(_ctx.ns.be("dropdown", "header"))
  20310. }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true),
  20311. renderSlot(_ctx.$slots, "default"),
  20312. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  20313. key: 1,
  20314. class: normalizeClass(_ctx.ns.be("dropdown", "footer"))
  20315. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  20316. ], 6);
  20317. }
  20318. var select_dropdown_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$19]]);
  20319. //#endregion
  20320. //#region ../../packages/components/select/src/useSelect.ts
  20321. const useSelect$2 = (props, emit) => {
  20322. const { t } = useLocale();
  20323. const slots = useSlots();
  20324. const contentId = useId();
  20325. const nsSelect = useNamespace("select");
  20326. const nsInput = useNamespace("input");
  20327. const states = reactive({
  20328. inputValue: "",
  20329. options: /* @__PURE__ */ new Map(),
  20330. cachedOptions: /* @__PURE__ */ new Map(),
  20331. optionValues: [],
  20332. selected: [],
  20333. selectionWidth: 0,
  20334. collapseItemWidth: 0,
  20335. selectedLabel: "",
  20336. hoveringIndex: -1,
  20337. previousQuery: null,
  20338. inputHovering: false,
  20339. menuVisibleOnFocus: false,
  20340. isBeforeHide: false
  20341. });
  20342. const selectRef = ref();
  20343. const selectionRef = ref();
  20344. const tooltipRef = ref();
  20345. const tagTooltipRef = ref();
  20346. const inputRef = ref();
  20347. const prefixRef = ref();
  20348. const suffixRef = ref();
  20349. const menuRef = ref();
  20350. const tagMenuRef = ref();
  20351. const collapseItemRef = ref();
  20352. const scrollbarRef = ref();
  20353. const expanded = ref(false);
  20354. const hoverOption = ref();
  20355. const debouncing = ref(false);
  20356. const { form, formItem } = useFormItem();
  20357. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  20358. const { valueOnClear, isEmptyValue } = useEmptyValues(props);
  20359. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: (e) => onInput(e) });
  20360. const selectDisabled = useFormDisabled();
  20361. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  20362. disabled: selectDisabled,
  20363. afterFocus() {
  20364. if (props.automaticDropdown && !expanded.value) {
  20365. expanded.value = true;
  20366. states.menuVisibleOnFocus = true;
  20367. }
  20368. },
  20369. beforeBlur(event) {
  20370. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  20371. },
  20372. afterBlur() {
  20373. expanded.value = false;
  20374. states.menuVisibleOnFocus = false;
  20375. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  20376. }
  20377. });
  20378. const hasModelValue = computed(() => {
  20379. return isArray$1(props.modelValue) ? props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  20380. });
  20381. const needStatusIcon = computed(() => form?.statusIcon ?? false);
  20382. const showClearBtn = computed(() => {
  20383. return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
  20384. });
  20385. const iconComponent = computed(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  20386. const iconReverse = computed(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value)));
  20387. const validateState = computed(() => formItem?.validateState || "");
  20388. const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
  20389. const debounce = computed(() => props.remote ? props.debounce : 0);
  20390. const isRemoteSearchEmpty = computed(() => props.remote && !states.inputValue && states.options.size === 0);
  20391. const emptyText = computed(() => {
  20392. if (props.loading) return props.loadingText || t("el.select.loading");
  20393. else {
  20394. if (props.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) return props.noMatchText || t("el.select.noMatch");
  20395. if (states.options.size === 0) return props.noDataText || t("el.select.noData");
  20396. }
  20397. return null;
  20398. });
  20399. const filteredOptionsCount = computed(() => optionsArray.value.filter((option) => option.visible).length);
  20400. const optionsArray = computed(() => {
  20401. const list = Array.from(states.options.values());
  20402. const newList = [];
  20403. states.optionValues.forEach((item) => {
  20404. const index = list.findIndex((i) => i.value === item);
  20405. if (index > -1) newList.push(list[index]);
  20406. });
  20407. return newList.length >= list.length ? newList : list;
  20408. });
  20409. const cachedOptionsArray = computed(() => Array.from(states.cachedOptions.values()));
  20410. const showNewOption = computed(() => {
  20411. const hasExistingOption = optionsArray.value.filter((option) => {
  20412. return !option.created;
  20413. }).some((option) => {
  20414. return option.currentLabel === states.inputValue;
  20415. });
  20416. return props.filterable && props.allowCreate && states.inputValue !== "" && !hasExistingOption;
  20417. });
  20418. const updateOptions = () => {
  20419. if (props.filterable && isFunction$1(props.filterMethod)) return;
  20420. if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) return;
  20421. optionsArray.value.forEach((option) => {
  20422. option.updateOption?.(states.inputValue);
  20423. });
  20424. };
  20425. const selectSize = useFormSize();
  20426. const collapseTagSize = computed(() => ["small"].includes(selectSize.value) ? "small" : "default");
  20427. const dropdownMenuVisible = computed({
  20428. get() {
  20429. return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
  20430. },
  20431. set(val) {
  20432. expanded.value = val;
  20433. }
  20434. });
  20435. const shouldShowPlaceholder = computed(() => {
  20436. if (props.multiple && !isUndefined(props.modelValue)) return castArray$1(props.modelValue).length === 0 && !states.inputValue;
  20437. const value = isArray$1(props.modelValue) ? props.modelValue[0] : props.modelValue;
  20438. return props.filterable || isUndefined(value) ? !states.inputValue : true;
  20439. });
  20440. const currentPlaceholder = computed(() => {
  20441. const _placeholder = props.placeholder ?? t("el.select.placeholder");
  20442. return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  20443. });
  20444. const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter");
  20445. watch(() => props.modelValue, (val, oldVal) => {
  20446. if (props.multiple) {
  20447. if (props.filterable && !props.reserveKeyword) {
  20448. states.inputValue = "";
  20449. handleQueryChange("");
  20450. }
  20451. }
  20452. setSelected();
  20453. if (!isEqual$1(val, oldVal) && props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  20454. }, {
  20455. flush: "post",
  20456. deep: true
  20457. });
  20458. watch(() => expanded.value, (val) => {
  20459. if (val) handleQueryChange(states.inputValue);
  20460. else {
  20461. states.inputValue = "";
  20462. states.previousQuery = null;
  20463. states.isBeforeHide = true;
  20464. states.menuVisibleOnFocus = false;
  20465. }
  20466. });
  20467. watch(() => states.options.entries(), () => {
  20468. if (!isClient) return;
  20469. setSelected();
  20470. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) checkDefaultFirstOption();
  20471. }, { flush: "post" });
  20472. watch([() => states.hoveringIndex, optionsArray], ([val]) => {
  20473. if (isNumber(val) && val > -1) hoverOption.value = optionsArray.value[val] || {};
  20474. else hoverOption.value = {};
  20475. optionsArray.value.forEach((option) => {
  20476. option.hover = hoverOption.value === option;
  20477. });
  20478. });
  20479. watchEffect(() => {
  20480. if (states.isBeforeHide) return;
  20481. updateOptions();
  20482. });
  20483. const handleQueryChange = (val) => {
  20484. if (states.previousQuery === val || isComposing.value) return;
  20485. states.previousQuery = val;
  20486. if (props.filterable && isFunction$1(props.filterMethod)) props.filterMethod(val);
  20487. else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) props.remoteMethod(val);
  20488. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) nextTick(checkDefaultFirstOption);
  20489. else nextTick(updateHoveringIndex);
  20490. };
  20491. /**
  20492. * find and highlight first option as default selected
  20493. * @remark
  20494. * - if the first option in dropdown list is user-created,
  20495. * it would be at the end of the optionsArray
  20496. * so find it and set hover.
  20497. * (NOTE: there must be only one user-created option in dropdown list with query)
  20498. * - if there's no user-created option in list, just find the first one as usual
  20499. * (NOTE: exclude options that are disabled or in disabled-group)
  20500. */
  20501. const checkDefaultFirstOption = () => {
  20502. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  20503. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  20504. const firstOriginOption = optionsInDropdown[0];
  20505. states.hoveringIndex = getValueIndex(optionsArray.value.map((item) => item.value), userCreatedOption || firstOriginOption);
  20506. };
  20507. const setSelected = () => {
  20508. if (!props.multiple) {
  20509. const option = getOption(isArray$1(props.modelValue) ? props.modelValue[0] : props.modelValue);
  20510. states.selectedLabel = option.currentLabel;
  20511. states.selected = [option];
  20512. return;
  20513. } else states.selectedLabel = "";
  20514. const result = [];
  20515. if (!isUndefined(props.modelValue)) castArray$1(props.modelValue).forEach((value) => {
  20516. result.push(getOption(value));
  20517. });
  20518. states.selected = result;
  20519. };
  20520. const getOption = (value) => {
  20521. let option;
  20522. const isObjectValue = isPlainObject$1(value);
  20523. for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
  20524. const cachedOption = cachedOptionsArray.value[i];
  20525. if (isObjectValue ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey) : cachedOption.value === value) {
  20526. option = {
  20527. index: optionsArray.value.filter((opt) => !opt.created).indexOf(cachedOption),
  20528. value,
  20529. currentLabel: cachedOption.currentLabel,
  20530. get isDisabled() {
  20531. return cachedOption.isDisabled;
  20532. }
  20533. };
  20534. break;
  20535. }
  20536. }
  20537. if (option) return option;
  20538. return {
  20539. index: -1,
  20540. value,
  20541. currentLabel: isObjectValue ? value.label : value ?? ""
  20542. };
  20543. };
  20544. const updateHoveringIndex = () => {
  20545. const length = states.selected.length;
  20546. if (length > 0) {
  20547. const lastOption = states.selected[length - 1];
  20548. states.hoveringIndex = optionsArray.value.findIndex((item) => getValueKey(lastOption) === getValueKey(item));
  20549. } else states.hoveringIndex = -1;
  20550. };
  20551. const resetSelectionWidth = () => {
  20552. states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  20553. };
  20554. const resetCollapseItemWidth = () => {
  20555. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  20556. };
  20557. const updateTooltip = () => {
  20558. tooltipRef.value?.updatePopper?.();
  20559. };
  20560. const updateTagTooltip = () => {
  20561. tagTooltipRef.value?.updatePopper?.();
  20562. };
  20563. const onInputChange = () => {
  20564. if (states.inputValue.length > 0 && !expanded.value) expanded.value = true;
  20565. handleQueryChange(states.inputValue);
  20566. };
  20567. const onInput = (event) => {
  20568. states.inputValue = event.target.value;
  20569. if (props.remote) {
  20570. debouncing.value = true;
  20571. debouncedOnInputChange();
  20572. } else return onInputChange();
  20573. };
  20574. const debouncedOnInputChange = useDebounceFn(() => {
  20575. onInputChange();
  20576. debouncing.value = false;
  20577. }, debounce);
  20578. const emitChange = (val) => {
  20579. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  20580. };
  20581. const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => {
  20582. const option = states.cachedOptions.get(it);
  20583. return !option?.disabled && !option?.states.groupDisabled;
  20584. });
  20585. const deletePrevTag = (e) => {
  20586. const code = getEventCode(e);
  20587. if (!props.multiple) return;
  20588. if (code === EVENT_CODE.delete) return;
  20589. if (e.target.value.length <= 0) {
  20590. const value = castArray$1(props.modelValue).slice();
  20591. const lastNotDisabledIndex = getLastNotDisabledIndex(value);
  20592. if (lastNotDisabledIndex < 0) return;
  20593. const removeTagValue = value[lastNotDisabledIndex];
  20594. value.splice(lastNotDisabledIndex, 1);
  20595. emit(UPDATE_MODEL_EVENT, value);
  20596. emitChange(value);
  20597. emit("remove-tag", removeTagValue);
  20598. }
  20599. };
  20600. const deleteTag = (event, tag) => {
  20601. const index = states.selected.indexOf(tag);
  20602. if (index > -1 && !selectDisabled.value) {
  20603. const value = castArray$1(props.modelValue).slice();
  20604. value.splice(index, 1);
  20605. emit(UPDATE_MODEL_EVENT, value);
  20606. emitChange(value);
  20607. emit("remove-tag", tag.value);
  20608. }
  20609. event.stopPropagation();
  20610. focus();
  20611. };
  20612. const deleteSelected = (event) => {
  20613. event.stopPropagation();
  20614. const value = props.multiple ? [] : valueOnClear.value;
  20615. if (props.multiple) {
  20616. for (const item of states.selected) if (item.isDisabled) value.push(item.value);
  20617. }
  20618. emit(UPDATE_MODEL_EVENT, value);
  20619. emitChange(value);
  20620. states.hoveringIndex = -1;
  20621. expanded.value = false;
  20622. emit("clear");
  20623. focus();
  20624. };
  20625. const handleOptionSelect = (option) => {
  20626. if (props.multiple) {
  20627. const value = castArray$1(props.modelValue ?? []).slice();
  20628. const optionIndex = getValueIndex(value, option);
  20629. if (optionIndex > -1) value.splice(optionIndex, 1);
  20630. else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) value.push(option.value);
  20631. emit(UPDATE_MODEL_EVENT, value);
  20632. emitChange(value);
  20633. if (option.created) handleQueryChange("");
  20634. if (props.filterable && (option.created || !props.reserveKeyword)) states.inputValue = "";
  20635. } else {
  20636. !isEqual$1(props.modelValue, option.value) && emit(UPDATE_MODEL_EVENT, option.value);
  20637. emitChange(option.value);
  20638. expanded.value = false;
  20639. }
  20640. focus();
  20641. if (expanded.value) return;
  20642. nextTick(() => {
  20643. scrollToOption(option);
  20644. });
  20645. };
  20646. const getValueIndex = (arr, option) => {
  20647. if (isUndefined(option)) return -1;
  20648. if (!isObject$1(option.value)) return arr.indexOf(option.value);
  20649. return arr.findIndex((item) => {
  20650. return isEqual$1(get(item, props.valueKey), getValueKey(option));
  20651. });
  20652. };
  20653. const scrollToOption = (option) => {
  20654. const targetOption = isArray$1(option) ? option[option.length - 1] : option;
  20655. let target = null;
  20656. if (!isNil(targetOption?.value)) {
  20657. const options = optionsArray.value.filter((item) => item.value === targetOption.value);
  20658. if (options.length > 0) target = options[0].$el;
  20659. }
  20660. if (tooltipRef.value && target) {
  20661. const menu = tooltipRef.value?.popperRef?.contentRef?.querySelector?.(`.${nsSelect.be("dropdown", "wrap")}`);
  20662. if (menu) scrollIntoView(menu, target);
  20663. }
  20664. scrollbarRef.value?.handleScroll();
  20665. };
  20666. const onOptionCreate = (vm) => {
  20667. states.options.set(vm.value, vm);
  20668. states.cachedOptions.set(vm.value, vm);
  20669. };
  20670. const onOptionDestroy = (key, vm) => {
  20671. if (states.options.get(key) === vm) states.options.delete(key);
  20672. };
  20673. const popperRef = computed(() => {
  20674. return tooltipRef.value?.popperRef?.contentRef;
  20675. });
  20676. const handleMenuEnter = () => {
  20677. states.isBeforeHide = false;
  20678. nextTick(() => {
  20679. scrollbarRef.value?.update();
  20680. scrollToOption(states.selected);
  20681. });
  20682. };
  20683. const focus = () => {
  20684. inputRef.value?.focus();
  20685. };
  20686. const blur = () => {
  20687. if (expanded.value) {
  20688. expanded.value = false;
  20689. nextTick(() => inputRef.value?.blur());
  20690. return;
  20691. }
  20692. inputRef.value?.blur();
  20693. };
  20694. const handleClearClick = (event) => {
  20695. deleteSelected(event);
  20696. };
  20697. const handleClickOutside = (event) => {
  20698. expanded.value = false;
  20699. if (isFocused.value) {
  20700. const _event = new FocusEvent("blur", event);
  20701. nextTick(() => handleBlur(_event));
  20702. }
  20703. };
  20704. const handleEsc = () => {
  20705. if (states.inputValue.length > 0) states.inputValue = "";
  20706. else expanded.value = false;
  20707. };
  20708. const toggleMenu = (event) => {
  20709. if (selectDisabled.value || props.filterable && expanded.value && event && !suffixRef.value?.contains(event.target)) return;
  20710. if (isIOS) states.inputHovering = true;
  20711. if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false;
  20712. else expanded.value = !expanded.value;
  20713. };
  20714. const selectOption = () => {
  20715. if (!expanded.value) toggleMenu();
  20716. else {
  20717. const option = optionsArray.value[states.hoveringIndex];
  20718. if (option && !option.isDisabled) handleOptionSelect(option);
  20719. }
  20720. };
  20721. const getValueKey = (item) => {
  20722. return isObject$1(item.value) ? get(item.value, props.valueKey) : item.value;
  20723. };
  20724. const optionsAllDisabled = computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled));
  20725. const showTagList = computed(() => {
  20726. if (!props.multiple) return [];
  20727. return props.collapseTags ? states.selected.slice(0, props.maxCollapseTags) : states.selected;
  20728. });
  20729. const collapseTagList = computed(() => {
  20730. if (!props.multiple) return [];
  20731. return props.collapseTags ? states.selected.slice(props.maxCollapseTags) : [];
  20732. });
  20733. const navigateOptions = (direction) => {
  20734. if (!expanded.value) {
  20735. expanded.value = true;
  20736. return;
  20737. }
  20738. if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value) return;
  20739. if (!optionsAllDisabled.value) {
  20740. if (direction === "next") {
  20741. states.hoveringIndex++;
  20742. if (states.hoveringIndex === states.options.size) states.hoveringIndex = 0;
  20743. } else if (direction === "prev") {
  20744. states.hoveringIndex--;
  20745. if (states.hoveringIndex < 0) states.hoveringIndex = states.options.size - 1;
  20746. }
  20747. const option = optionsArray.value[states.hoveringIndex];
  20748. if (option.isDisabled || !option.visible) navigateOptions(direction);
  20749. nextTick(() => scrollToOption(hoverOption.value));
  20750. }
  20751. };
  20752. const findFocusableIndex = (arr, start, step, len) => {
  20753. for (let i = start; i >= 0 && i < len; i += step) {
  20754. const obj = arr[i];
  20755. if (!obj?.isDisabled && obj?.visible) return i;
  20756. }
  20757. return null;
  20758. };
  20759. const focusOption = (targetIndex, mode) => {
  20760. const len = states.options.size;
  20761. if (len === 0) return;
  20762. const start = clamp$1(targetIndex, 0, len - 1);
  20763. const options = optionsArray.value;
  20764. const direction = mode === "up" ? -1 : 1;
  20765. const newIndex = findFocusableIndex(options, start, direction, len) ?? findFocusableIndex(options, start - direction, -direction, len);
  20766. if (newIndex != null) {
  20767. states.hoveringIndex = newIndex;
  20768. nextTick(() => scrollToOption(hoverOption.value));
  20769. }
  20770. };
  20771. const handleKeydown = (e) => {
  20772. const code = getEventCode(e);
  20773. let isPreventDefault = true;
  20774. switch (code) {
  20775. case EVENT_CODE.up:
  20776. navigateOptions("prev");
  20777. break;
  20778. case EVENT_CODE.down:
  20779. navigateOptions("next");
  20780. break;
  20781. case EVENT_CODE.enter:
  20782. case EVENT_CODE.numpadEnter:
  20783. if (!isComposing.value) selectOption();
  20784. break;
  20785. case EVENT_CODE.esc:
  20786. handleEsc();
  20787. break;
  20788. case EVENT_CODE.backspace:
  20789. isPreventDefault = false;
  20790. deletePrevTag(e);
  20791. return;
  20792. case EVENT_CODE.home:
  20793. if (!expanded.value) return;
  20794. focusOption(0, "down");
  20795. break;
  20796. case EVENT_CODE.end:
  20797. if (!expanded.value) return;
  20798. focusOption(states.options.size - 1, "up");
  20799. break;
  20800. case EVENT_CODE.pageUp:
  20801. if (!expanded.value) return;
  20802. focusOption(states.hoveringIndex - 10, "up");
  20803. break;
  20804. case EVENT_CODE.pageDown:
  20805. if (!expanded.value) return;
  20806. focusOption(states.hoveringIndex + 10, "down");
  20807. break;
  20808. default:
  20809. isPreventDefault = false;
  20810. break;
  20811. }
  20812. if (isPreventDefault) {
  20813. e.preventDefault();
  20814. e.stopPropagation();
  20815. }
  20816. };
  20817. const getGapWidth = () => {
  20818. if (!selectionRef.value) return 0;
  20819. const style = window.getComputedStyle(selectionRef.value);
  20820. return Number.parseFloat(style.gap || "6px");
  20821. };
  20822. const tagStyle = computed(() => {
  20823. const gapWidth = getGapWidth();
  20824. const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
  20825. return { maxWidth: `${collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` };
  20826. });
  20827. const collapseTagStyle = computed(() => {
  20828. return { maxWidth: `${states.selectionWidth}px` };
  20829. });
  20830. const popupScroll = (data) => {
  20831. emit("popup-scroll", data);
  20832. };
  20833. useResizeObserver(selectionRef, resetSelectionWidth);
  20834. useResizeObserver(wrapperRef, updateTooltip);
  20835. useResizeObserver(tagMenuRef, updateTagTooltip);
  20836. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  20837. let stop;
  20838. watch(() => dropdownMenuVisible.value, (newVal) => {
  20839. if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop;
  20840. else {
  20841. stop?.();
  20842. stop = void 0;
  20843. }
  20844. emit("visible-change", newVal);
  20845. });
  20846. onMounted(() => {
  20847. setSelected();
  20848. });
  20849. return {
  20850. inputId,
  20851. contentId,
  20852. nsSelect,
  20853. nsInput,
  20854. states,
  20855. isFocused,
  20856. expanded,
  20857. optionsArray,
  20858. hoverOption,
  20859. selectSize,
  20860. filteredOptionsCount,
  20861. updateTooltip,
  20862. updateTagTooltip,
  20863. debouncedOnInputChange,
  20864. onInput,
  20865. deletePrevTag,
  20866. deleteTag,
  20867. deleteSelected,
  20868. handleOptionSelect,
  20869. scrollToOption,
  20870. hasModelValue,
  20871. shouldShowPlaceholder,
  20872. currentPlaceholder,
  20873. mouseEnterEventName,
  20874. needStatusIcon,
  20875. showClearBtn,
  20876. iconComponent,
  20877. iconReverse,
  20878. validateState,
  20879. validateIcon,
  20880. showNewOption,
  20881. updateOptions,
  20882. collapseTagSize,
  20883. setSelected,
  20884. selectDisabled,
  20885. emptyText,
  20886. handleCompositionStart,
  20887. handleCompositionUpdate,
  20888. handleCompositionEnd,
  20889. handleKeydown,
  20890. onOptionCreate,
  20891. onOptionDestroy,
  20892. handleMenuEnter,
  20893. focus,
  20894. blur,
  20895. handleClearClick,
  20896. handleClickOutside,
  20897. handleEsc,
  20898. toggleMenu,
  20899. selectOption,
  20900. getValueKey,
  20901. navigateOptions,
  20902. dropdownMenuVisible,
  20903. showTagList,
  20904. collapseTagList,
  20905. popupScroll,
  20906. getOption,
  20907. tagStyle,
  20908. collapseTagStyle,
  20909. popperRef,
  20910. inputRef,
  20911. tooltipRef,
  20912. tagTooltipRef,
  20913. prefixRef,
  20914. suffixRef,
  20915. selectRef,
  20916. wrapperRef,
  20917. selectionRef,
  20918. scrollbarRef,
  20919. menuRef,
  20920. tagMenuRef,
  20921. collapseItemRef
  20922. };
  20923. };
  20924. //#endregion
  20925. //#region ../../packages/components/select/src/options.ts
  20926. var options_default = defineComponent({
  20927. name: "ElOptions",
  20928. setup(_, { slots }) {
  20929. const select = inject(selectKey);
  20930. let cachedValueList = [];
  20931. return () => {
  20932. const children = slots.default?.();
  20933. const valueList = [];
  20934. function filterOptions(children) {
  20935. if (!isArray$1(children)) return;
  20936. children.forEach((item) => {
  20937. const name = (item?.type || {})?.name;
  20938. if (name === "ElOptionGroup") filterOptions(!isString(item.children) && !isArray$1(item.children) && isFunction$1(item.children?.default) ? item.children?.default() : item.children);
  20939. else if (name === "ElOption") valueList.push(item.props?.value);
  20940. else if (isArray$1(item.children)) filterOptions(item.children);
  20941. });
  20942. }
  20943. if (children.length) filterOptions(children[0]?.children);
  20944. if (!isEqual$1(valueList, cachedValueList)) {
  20945. cachedValueList = valueList;
  20946. if (select) select.states.optionValues = valueList;
  20947. }
  20948. return children;
  20949. };
  20950. }
  20951. });
  20952. //#endregion
  20953. //#region ../../packages/components/select/src/select.ts
  20954. const selectProps = buildProps({
  20955. name: String,
  20956. id: String,
  20957. modelValue: {
  20958. type: definePropType([
  20959. Array,
  20960. String,
  20961. Number,
  20962. Boolean,
  20963. Object
  20964. ]),
  20965. default: void 0
  20966. },
  20967. autocomplete: {
  20968. type: String,
  20969. default: "off"
  20970. },
  20971. automaticDropdown: Boolean,
  20972. size: useSizeProp,
  20973. effect: {
  20974. type: definePropType(String),
  20975. default: "light"
  20976. },
  20977. disabled: {
  20978. type: Boolean,
  20979. default: void 0
  20980. },
  20981. clearable: Boolean,
  20982. filterable: Boolean,
  20983. allowCreate: Boolean,
  20984. loading: Boolean,
  20985. popperClass: {
  20986. type: String,
  20987. default: ""
  20988. },
  20989. popperStyle: { type: definePropType([String, Object]) },
  20990. popperOptions: {
  20991. type: definePropType(Object),
  20992. default: () => ({})
  20993. },
  20994. remote: Boolean,
  20995. debounce: {
  20996. type: Number,
  20997. default: 300
  20998. },
  20999. loadingText: String,
  21000. noMatchText: String,
  21001. noDataText: String,
  21002. remoteMethod: { type: definePropType(Function) },
  21003. filterMethod: { type: definePropType(Function) },
  21004. multiple: Boolean,
  21005. multipleLimit: {
  21006. type: Number,
  21007. default: 0
  21008. },
  21009. placeholder: { type: String },
  21010. defaultFirstOption: Boolean,
  21011. reserveKeyword: {
  21012. type: Boolean,
  21013. default: true
  21014. },
  21015. valueKey: {
  21016. type: String,
  21017. default: "value"
  21018. },
  21019. collapseTags: Boolean,
  21020. collapseTagsTooltip: Boolean,
  21021. tagTooltip: {
  21022. type: definePropType(Object),
  21023. default: () => ({})
  21024. },
  21025. maxCollapseTags: {
  21026. type: Number,
  21027. default: 1
  21028. },
  21029. teleported: useTooltipContentProps.teleported,
  21030. persistent: {
  21031. type: Boolean,
  21032. default: true
  21033. },
  21034. clearIcon: {
  21035. type: iconPropType,
  21036. default: circle_close_default
  21037. },
  21038. fitInputWidth: Boolean,
  21039. suffixIcon: {
  21040. type: iconPropType,
  21041. default: arrow_down_default
  21042. },
  21043. tagType: {
  21044. ...tagProps.type,
  21045. default: "info"
  21046. },
  21047. tagEffect: {
  21048. ...tagProps.effect,
  21049. default: "light"
  21050. },
  21051. validateEvent: {
  21052. type: Boolean,
  21053. default: true
  21054. },
  21055. remoteShowSuffix: Boolean,
  21056. showArrow: {
  21057. type: Boolean,
  21058. default: true
  21059. },
  21060. offset: {
  21061. type: Number,
  21062. default: 12
  21063. },
  21064. placement: {
  21065. type: definePropType(String),
  21066. values: Ee,
  21067. default: "bottom-start"
  21068. },
  21069. fallbackPlacements: {
  21070. type: definePropType(Array),
  21071. default: [
  21072. "bottom-start",
  21073. "top-start",
  21074. "right",
  21075. "left"
  21076. ]
  21077. },
  21078. tabindex: {
  21079. type: [String, Number],
  21080. default: 0
  21081. },
  21082. appendTo: useTooltipContentProps.appendTo,
  21083. options: { type: definePropType(Array) },
  21084. props: {
  21085. type: definePropType(Object),
  21086. default: () => defaultProps$2
  21087. },
  21088. ...useEmptyValuesProps,
  21089. ...useAriaProps(["ariaLabel"])
  21090. });
  21091. const selectEmits = {
  21092. [UPDATE_MODEL_EVENT]: (val) => true,
  21093. [CHANGE_EVENT]: (val) => true,
  21094. "popup-scroll": scrollbarEmits.scroll,
  21095. "remove-tag": (val) => true,
  21096. "visible-change": (visible) => true,
  21097. focus: (evt) => evt instanceof FocusEvent,
  21098. blur: (evt) => evt instanceof FocusEvent,
  21099. clear: () => true
  21100. };
  21101. //#endregion
  21102. //#region ../../packages/components/select/src/option-group.vue?vue&type=script&lang.ts
  21103. var option_group_vue_vue_type_script_lang_default = defineComponent({
  21104. name: "ElOptionGroup",
  21105. componentName: "ElOptionGroup",
  21106. props: {
  21107. label: String,
  21108. disabled: Boolean
  21109. },
  21110. setup(props) {
  21111. const ns = useNamespace("select");
  21112. const groupRef = ref();
  21113. const instance = getCurrentInstance();
  21114. const children = ref([]);
  21115. provide(selectGroupKey, reactive({ ...toRefs(props) }));
  21116. const visible = computed(() => children.value.some((option) => option.visible === true));
  21117. const isOption = (node) => node.type.name === "ElOption" && !!node.component?.proxy;
  21118. const flattedChildren = (node) => {
  21119. const nodes = castArray$1(node);
  21120. const children = [];
  21121. nodes.forEach((child) => {
  21122. if (!isVNode(child)) return;
  21123. if (isOption(child)) children.push(child.component.proxy);
  21124. else if (isArray$1(child.children) && child.children.length) children.push(...flattedChildren(child.children));
  21125. else if (child.component?.subTree) children.push(...flattedChildren(child.component.subTree));
  21126. });
  21127. return children;
  21128. };
  21129. const updateChildren = () => {
  21130. children.value = flattedChildren(instance.subTree);
  21131. };
  21132. onMounted(() => {
  21133. updateChildren();
  21134. });
  21135. useMutationObserver(groupRef, updateChildren, {
  21136. attributes: true,
  21137. subtree: true,
  21138. childList: true
  21139. });
  21140. return {
  21141. groupRef,
  21142. visible,
  21143. ns
  21144. };
  21145. }
  21146. });
  21147. //#endregion
  21148. //#region ../../packages/components/select/src/option-group.vue
  21149. function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) {
  21150. return withDirectives((openBlock(), createElementBlock("ul", {
  21151. ref: "groupRef",
  21152. class: normalizeClass(_ctx.ns.be("group", "wrap"))
  21153. }, [createElementVNode("li", { class: normalizeClass(_ctx.ns.be("group", "title")) }, toDisplayString(_ctx.label), 3), createElementVNode("li", null, [createElementVNode("ul", { class: normalizeClass(_ctx.ns.b("group")) }, [renderSlot(_ctx.$slots, "default")], 2)])], 2)), [[vShow, _ctx.visible]]);
  21154. }
  21155. var option_group_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_group_vue_vue_type_script_lang_default, [["render", _sfc_render$18]]);
  21156. //#endregion
  21157. //#region ../../packages/components/select/src/select.vue?vue&type=script&lang.ts
  21158. const COMPONENT_NAME$13 = "ElSelect";
  21159. const warnHandlerMap = /* @__PURE__ */ new WeakMap();
  21160. const createSelectWarnHandler = (appContext) => {
  21161. return (...args) => {
  21162. const message = args[0];
  21163. if (!message || message.includes("Slot \"default\" invoked outside of the render function") && args[2]?.includes("ElTreeSelect")) return;
  21164. const original = warnHandlerMap.get(appContext)?.originalWarnHandler;
  21165. if (original) {
  21166. original(...args);
  21167. return;
  21168. }
  21169. console.warn(...args);
  21170. };
  21171. };
  21172. const getWarnHandlerRecord = (appContext) => {
  21173. let record = warnHandlerMap.get(appContext);
  21174. if (!record) {
  21175. record = {
  21176. originalWarnHandler: appContext.config.warnHandler,
  21177. handler: createSelectWarnHandler(appContext),
  21178. count: 0
  21179. };
  21180. warnHandlerMap.set(appContext, record);
  21181. }
  21182. return record;
  21183. };
  21184. var select_vue_vue_type_script_lang_default$1 = defineComponent({
  21185. name: COMPONENT_NAME$13,
  21186. componentName: COMPONENT_NAME$13,
  21187. components: {
  21188. ElSelectMenu: select_dropdown_default$1,
  21189. ElOption: option_default,
  21190. ElOptions: options_default,
  21191. ElOptionGroup: option_group_default,
  21192. ElTag,
  21193. ElScrollbar,
  21194. ElTooltip,
  21195. ElIcon
  21196. },
  21197. directives: { ClickOutside },
  21198. props: selectProps,
  21199. emits: [
  21200. UPDATE_MODEL_EVENT,
  21201. CHANGE_EVENT,
  21202. "remove-tag",
  21203. "clear",
  21204. "visible-change",
  21205. "focus",
  21206. "blur",
  21207. "popup-scroll"
  21208. ],
  21209. setup(props, { emit, slots }) {
  21210. const instance = getCurrentInstance();
  21211. const warnRecord = getWarnHandlerRecord(instance.appContext);
  21212. warnRecord.count += 1;
  21213. instance.appContext.config.warnHandler = warnRecord.handler;
  21214. const modelValue = computed(() => {
  21215. const { modelValue: rawModelValue, multiple } = props;
  21216. const fallback = multiple ? [] : void 0;
  21217. if (isArray$1(rawModelValue)) return multiple ? rawModelValue : fallback;
  21218. return multiple ? fallback : rawModelValue;
  21219. });
  21220. const _props = reactive({
  21221. ...toRefs(props),
  21222. modelValue
  21223. });
  21224. const API = useSelect$2(_props, emit);
  21225. const { calculatorRef, inputStyle } = useCalcInputWidth();
  21226. const { getLabel, getValue, getOptions, getDisabled } = useProps(props);
  21227. const getOptionProps = (option) => ({
  21228. label: getLabel(option),
  21229. value: getValue(option),
  21230. disabled: getDisabled(option)
  21231. });
  21232. const flatTreeSelectData = (data) => {
  21233. return data.reduce((acc, item) => {
  21234. acc.push(item);
  21235. if (item.children && item.children.length > 0) acc.push(...flatTreeSelectData(item.children));
  21236. return acc;
  21237. }, []);
  21238. };
  21239. const manuallyRenderSlots = (vnodes) => {
  21240. flattedChildren(vnodes || []).forEach((item) => {
  21241. if (isObject$1(item) && (item.type.name === "ElOption" || item.type.name === "ElTree")) {
  21242. const _name = item.type.name;
  21243. if (_name === "ElTree") flatTreeSelectData(item.props?.data || []).forEach((treeItem) => {
  21244. treeItem.currentLabel = treeItem.label || (isObject$1(treeItem.value) ? "" : treeItem.value);
  21245. API.onOptionCreate(treeItem);
  21246. });
  21247. else if (_name === "ElOption") {
  21248. const obj = { ...item.props };
  21249. obj.currentLabel = obj.label || (isObject$1(obj.value) ? "" : obj.value);
  21250. API.onOptionCreate(obj);
  21251. }
  21252. }
  21253. });
  21254. };
  21255. watch(() => [props.persistent || API.expanded.value || !slots.default ? void 0 : slots.default?.(), modelValue.value], () => {
  21256. if (props.persistent || API.expanded.value) return;
  21257. API.states.options.clear();
  21258. manuallyRenderSlots(slots.default?.());
  21259. }, { immediate: true });
  21260. provide(selectKey, reactive({
  21261. props: _props,
  21262. states: API.states,
  21263. selectRef: API.selectRef,
  21264. optionsArray: API.optionsArray,
  21265. setSelected: API.setSelected,
  21266. handleOptionSelect: API.handleOptionSelect,
  21267. onOptionCreate: API.onOptionCreate,
  21268. onOptionDestroy: API.onOptionDestroy
  21269. }));
  21270. const selectedLabel = computed(() => {
  21271. if (!props.multiple) return API.states.selectedLabel;
  21272. return API.states.selected.map((i) => i.currentLabel);
  21273. });
  21274. onBeforeUnmount(() => {
  21275. const record = warnHandlerMap.get(instance.appContext);
  21276. if (!record) return;
  21277. record.count -= 1;
  21278. if (record.count <= 0) {
  21279. instance.appContext.config.warnHandler = record.originalWarnHandler;
  21280. warnHandlerMap.delete(instance.appContext);
  21281. }
  21282. });
  21283. return {
  21284. ...API,
  21285. modelValue,
  21286. selectedLabel,
  21287. calculatorRef,
  21288. inputStyle,
  21289. getLabel,
  21290. getValue,
  21291. getOptions,
  21292. getDisabled,
  21293. getOptionProps
  21294. };
  21295. }
  21296. });
  21297. //#endregion
  21298. //#region ../../packages/components/select/src/select.vue
  21299. const _hoisted_1$65 = [
  21300. "id",
  21301. "value",
  21302. "name",
  21303. "disabled",
  21304. "autocomplete",
  21305. "tabindex",
  21306. "readonly",
  21307. "aria-activedescendant",
  21308. "aria-controls",
  21309. "aria-expanded",
  21310. "aria-label"
  21311. ];
  21312. const _hoisted_2$36 = ["textContent"];
  21313. const _hoisted_3$17 = { key: 1 };
  21314. function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
  21315. const _component_el_tag = resolveComponent("el-tag");
  21316. const _component_el_tooltip = resolveComponent("el-tooltip");
  21317. const _component_el_icon = resolveComponent("el-icon");
  21318. const _component_el_option = resolveComponent("el-option");
  21319. const _component_el_option_group = resolveComponent("el-option-group");
  21320. const _component_el_options = resolveComponent("el-options");
  21321. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  21322. const _component_el_select_menu = resolveComponent("el-select-menu");
  21323. const _directive_click_outside = resolveDirective("click-outside");
  21324. return withDirectives((openBlock(), createElementBlock("div", mergeProps({
  21325. ref: "selectRef",
  21326. class: [_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]
  21327. }, { [toHandlerKey(_ctx.mouseEnterEventName)]: _cache[11] || (_cache[11] = ($event) => _ctx.states.inputHovering = true) }, { onMouseleave: _cache[12] || (_cache[12] = ($event) => _ctx.states.inputHovering = false) }), [createVNode(_component_el_tooltip, {
  21328. ref: "tooltipRef",
  21329. visible: _ctx.dropdownMenuVisible,
  21330. placement: _ctx.placement,
  21331. teleported: _ctx.teleported,
  21332. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  21333. "popper-style": _ctx.popperStyle,
  21334. "popper-options": _ctx.popperOptions,
  21335. "fallback-placements": _ctx.fallbackPlacements,
  21336. effect: _ctx.effect,
  21337. pure: "",
  21338. trigger: "click",
  21339. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  21340. "stop-popper-mouse-event": false,
  21341. "gpu-acceleration": false,
  21342. persistent: _ctx.persistent,
  21343. "append-to": _ctx.appendTo,
  21344. "show-arrow": _ctx.showArrow,
  21345. offset: _ctx.offset,
  21346. onBeforeShow: _ctx.handleMenuEnter,
  21347. onHide: _cache[10] || (_cache[10] = ($event) => _ctx.states.isBeforeHide = false)
  21348. }, {
  21349. default: withCtx(() => [createElementVNode("div", {
  21350. ref: "wrapperRef",
  21351. class: normalizeClass([
  21352. _ctx.nsSelect.e("wrapper"),
  21353. _ctx.nsSelect.is("focused", _ctx.isFocused),
  21354. _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
  21355. _ctx.nsSelect.is("filterable", _ctx.filterable),
  21356. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  21357. ]),
  21358. onClick: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
  21359. }, [
  21360. _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
  21361. key: 0,
  21362. ref: "prefixRef",
  21363. class: normalizeClass(_ctx.nsSelect.e("prefix"))
  21364. }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true),
  21365. createElementVNode("div", {
  21366. ref: "selectionRef",
  21367. class: normalizeClass([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length)])
  21368. }, [
  21369. _ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
  21370. key: 0,
  21371. data: _ctx.states.selected,
  21372. deleteTag: _ctx.deleteTag,
  21373. selectDisabled: _ctx.selectDisabled
  21374. }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  21375. return openBlock(), createElementBlock("div", {
  21376. key: _ctx.getValueKey(item),
  21377. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  21378. }, [createVNode(_component_el_tag, {
  21379. closable: !_ctx.selectDisabled && !item.isDisabled,
  21380. size: _ctx.collapseTagSize,
  21381. type: _ctx.tagType,
  21382. effect: _ctx.tagEffect,
  21383. "disable-transitions": "",
  21384. style: normalizeStyle(_ctx.tagStyle),
  21385. onClose: ($event) => _ctx.deleteTag($event, item)
  21386. }, {
  21387. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", {
  21388. index: item.index,
  21389. label: item.currentLabel,
  21390. value: item.value
  21391. }, () => [createTextVNode(toDisplayString(item.currentLabel), 1)])], 2)]),
  21392. _: 2
  21393. }, 1032, [
  21394. "closable",
  21395. "size",
  21396. "type",
  21397. "effect",
  21398. "style",
  21399. "onClose"
  21400. ])], 2);
  21401. }), 128)), _ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
  21402. key: 0,
  21403. ref: "tagTooltipRef",
  21404. disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
  21405. "fallback-placements": _ctx.tagTooltip?.fallbackPlacements ?? [
  21406. "bottom",
  21407. "top",
  21408. "right",
  21409. "left"
  21410. ],
  21411. effect: _ctx.tagTooltip?.effect ?? _ctx.effect,
  21412. placement: _ctx.tagTooltip?.placement ?? "bottom",
  21413. "popper-class": _ctx.tagTooltip?.popperClass ?? _ctx.popperClass,
  21414. "popper-style": _ctx.tagTooltip?.popperStyle ?? _ctx.popperStyle,
  21415. teleported: _ctx.tagTooltip?.teleported ?? _ctx.teleported,
  21416. "append-to": _ctx.tagTooltip?.appendTo ?? _ctx.appendTo,
  21417. "popper-options": _ctx.tagTooltip?.popperOptions ?? _ctx.popperOptions,
  21418. transition: _ctx.tagTooltip?.transition,
  21419. "show-after": _ctx.tagTooltip?.showAfter,
  21420. "hide-after": _ctx.tagTooltip?.hideAfter,
  21421. "auto-close": _ctx.tagTooltip?.autoClose,
  21422. offset: _ctx.tagTooltip?.offset
  21423. }, {
  21424. default: withCtx(() => [createElementVNode("div", {
  21425. ref: "collapseItemRef",
  21426. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  21427. }, [createVNode(_component_el_tag, {
  21428. closable: false,
  21429. size: _ctx.collapseTagSize,
  21430. type: _ctx.tagType,
  21431. effect: _ctx.tagEffect,
  21432. "disable-transitions": "",
  21433. style: normalizeStyle(_ctx.collapseTagStyle)
  21434. }, {
  21435. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, " + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags), 3)]),
  21436. _: 1
  21437. }, 8, [
  21438. "size",
  21439. "type",
  21440. "effect",
  21441. "style"
  21442. ])], 2)]),
  21443. content: withCtx(() => [createElementVNode("div", {
  21444. ref: "tagMenuRef",
  21445. class: normalizeClass(_ctx.nsSelect.e("selection"))
  21446. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
  21447. return openBlock(), createElementBlock("div", {
  21448. key: _ctx.getValueKey(item),
  21449. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  21450. }, [createVNode(_component_el_tag, {
  21451. class: "in-tooltip",
  21452. closable: !_ctx.selectDisabled && !item.isDisabled,
  21453. size: _ctx.collapseTagSize,
  21454. type: _ctx.tagType,
  21455. effect: _ctx.tagEffect,
  21456. "disable-transitions": "",
  21457. onClose: ($event) => _ctx.deleteTag($event, item)
  21458. }, {
  21459. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", {
  21460. index: item.index,
  21461. label: item.currentLabel,
  21462. value: item.value
  21463. }, () => [createTextVNode(toDisplayString(item.currentLabel), 1)])], 2)]),
  21464. _: 2
  21465. }, 1032, [
  21466. "closable",
  21467. "size",
  21468. "type",
  21469. "effect",
  21470. "onClose"
  21471. ])], 2);
  21472. }), 128))], 2)]),
  21473. _: 3
  21474. }, 8, [
  21475. "disabled",
  21476. "fallback-placements",
  21477. "effect",
  21478. "placement",
  21479. "popper-class",
  21480. "popper-style",
  21481. "teleported",
  21482. "append-to",
  21483. "popper-options",
  21484. "transition",
  21485. "show-after",
  21486. "hide-after",
  21487. "auto-close",
  21488. "offset"
  21489. ])) : createCommentVNode("v-if", true)]) : createCommentVNode("v-if", true),
  21490. createElementVNode("div", { class: normalizeClass([
  21491. _ctx.nsSelect.e("selected-item"),
  21492. _ctx.nsSelect.e("input-wrapper"),
  21493. _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused)
  21494. ]) }, [createElementVNode("input", {
  21495. id: _ctx.inputId,
  21496. ref: "inputRef",
  21497. value: _ctx.states.inputValue,
  21498. type: "text",
  21499. name: _ctx.name,
  21500. class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  21501. disabled: _ctx.selectDisabled,
  21502. autocomplete: _ctx.autocomplete,
  21503. style: normalizeStyle(_ctx.inputStyle),
  21504. tabindex: _ctx.tabindex,
  21505. role: "combobox",
  21506. readonly: !_ctx.filterable,
  21507. spellcheck: "false",
  21508. "aria-activedescendant": _ctx.hoverOption?.id || "",
  21509. "aria-controls": _ctx.contentId,
  21510. "aria-expanded": _ctx.dropdownMenuVisible,
  21511. "aria-label": _ctx.ariaLabel,
  21512. "aria-autocomplete": "none",
  21513. "aria-haspopup": "listbox",
  21514. onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
  21515. onCompositionstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  21516. onCompositionupdate: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  21517. onCompositionend: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  21518. onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  21519. onChange: _cache[5] || (_cache[5] = withModifiers(() => {}, ["stop"])),
  21520. onClick: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  21521. }, null, 46, _hoisted_1$65), _ctx.filterable ? (openBlock(), createElementBlock("span", {
  21522. key: 0,
  21523. ref: "calculatorRef",
  21524. "aria-hidden": "true",
  21525. class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
  21526. textContent: toDisplayString(_ctx.states.inputValue)
  21527. }, null, 10, _hoisted_2$36)) : createCommentVNode("v-if", true)], 2),
  21528. _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
  21529. key: 1,
  21530. class: normalizeClass([
  21531. _ctx.nsSelect.e("selected-item"),
  21532. _ctx.nsSelect.e("placeholder"),
  21533. _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
  21534. ])
  21535. }, [_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
  21536. key: 0,
  21537. index: _ctx.getOption(_ctx.modelValue).index,
  21538. label: _ctx.currentPlaceholder,
  21539. value: _ctx.modelValue
  21540. }, () => [createElementVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)]) : (openBlock(), createElementBlock("span", _hoisted_3$17, toDisplayString(_ctx.currentPlaceholder), 1))], 2)) : createCommentVNode("v-if", true)
  21541. ], 2),
  21542. createElementVNode("div", {
  21543. ref: "suffixRef",
  21544. class: normalizeClass(_ctx.nsSelect.e("suffix"))
  21545. }, [
  21546. _ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, {
  21547. key: 0,
  21548. class: normalizeClass([
  21549. _ctx.nsSelect.e("caret"),
  21550. _ctx.nsSelect.e("icon"),
  21551. _ctx.iconReverse
  21552. ])
  21553. }, {
  21554. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]),
  21555. _: 1
  21556. }, 8, ["class"])) : createCommentVNode("v-if", true),
  21557. _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  21558. key: 1,
  21559. class: normalizeClass([
  21560. _ctx.nsSelect.e("caret"),
  21561. _ctx.nsSelect.e("icon"),
  21562. _ctx.nsSelect.e("clear")
  21563. ]),
  21564. onClick: _ctx.handleClearClick
  21565. }, {
  21566. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]),
  21567. _: 1
  21568. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
  21569. _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
  21570. key: 2,
  21571. class: normalizeClass([
  21572. _ctx.nsInput.e("icon"),
  21573. _ctx.nsInput.e("validateIcon"),
  21574. _ctx.nsInput.is("loading", _ctx.validateState === "validating")
  21575. ])
  21576. }, {
  21577. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))]),
  21578. _: 1
  21579. }, 8, ["class"])) : createCommentVNode("v-if", true)
  21580. ], 2)
  21581. ], 2)]),
  21582. content: withCtx(() => [createVNode(_component_el_select_menu, { ref: "menuRef" }, {
  21583. default: withCtx(() => [
  21584. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  21585. key: 0,
  21586. class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
  21587. onClick: _cache[8] || (_cache[8] = withModifiers(() => {}, ["stop"]))
  21588. }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true),
  21589. withDirectives(createVNode(_component_el_scrollbar, {
  21590. id: _ctx.contentId,
  21591. ref: "scrollbarRef",
  21592. tag: "ul",
  21593. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  21594. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  21595. class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
  21596. role: "listbox",
  21597. "aria-label": _ctx.ariaLabel,
  21598. "aria-orientation": "vertical",
  21599. onScroll: _ctx.popupScroll
  21600. }, {
  21601. default: withCtx(() => [_ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
  21602. key: 0,
  21603. value: _ctx.states.inputValue,
  21604. created: true
  21605. }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(_component_el_options, null, {
  21606. default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
  21607. return openBlock(), createElementBlock(Fragment, { key: index }, [_ctx.getOptions(option)?.length ? (openBlock(), createBlock(_component_el_option_group, {
  21608. key: 0,
  21609. label: _ctx.getLabel(option),
  21610. disabled: _ctx.getDisabled(option)
  21611. }, {
  21612. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getOptions(option), (item) => {
  21613. return openBlock(), createBlock(_component_el_option, mergeProps({ key: _ctx.getValue(item) }, { ref_for: true }, _ctx.getOptionProps(item)), null, 16);
  21614. }), 128))]),
  21615. _: 2
  21616. }, 1032, ["label", "disabled"])) : (openBlock(), createBlock(_component_el_option, mergeProps({
  21617. key: 1,
  21618. ref_for: true
  21619. }, _ctx.getOptionProps(option)), null, 16))], 64);
  21620. }), 128))])]),
  21621. _: 3
  21622. })]),
  21623. _: 3
  21624. }, 8, [
  21625. "id",
  21626. "wrap-class",
  21627. "view-class",
  21628. "class",
  21629. "aria-label",
  21630. "onScroll"
  21631. ]), [[vShow, _ctx.states.options.size > 0 && !_ctx.loading]]),
  21632. _ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock("div", {
  21633. key: 1,
  21634. class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
  21635. }, [renderSlot(_ctx.$slots, "loading")], 2)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", {
  21636. key: 2,
  21637. class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  21638. }, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("span", null, toDisplayString(_ctx.emptyText), 1)])], 2)) : createCommentVNode("v-if", true),
  21639. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  21640. key: 3,
  21641. class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
  21642. onClick: _cache[9] || (_cache[9] = withModifiers(() => {}, ["stop"]))
  21643. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  21644. ]),
  21645. _: 3
  21646. }, 512)]),
  21647. _: 3
  21648. }, 8, [
  21649. "visible",
  21650. "placement",
  21651. "teleported",
  21652. "popper-class",
  21653. "popper-style",
  21654. "popper-options",
  21655. "fallback-placements",
  21656. "effect",
  21657. "transition",
  21658. "persistent",
  21659. "append-to",
  21660. "show-arrow",
  21661. "offset",
  21662. "onBeforeShow"
  21663. ])], 16)), [[
  21664. _directive_click_outside,
  21665. _ctx.handleClickOutside,
  21666. _ctx.popperRef
  21667. ]]);
  21668. }
  21669. var select_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default$1, [["render", _sfc_render$17]]);
  21670. //#endregion
  21671. //#region ../../packages/components/select/index.ts
  21672. const ElSelect = withInstall(select_default$1, {
  21673. Option: option_default,
  21674. OptionGroup: option_group_default
  21675. });
  21676. const ElOption = withNoopInstall(option_default);
  21677. const ElOptionGroup = withNoopInstall(option_group_default);
  21678. //#endregion
  21679. //#region ../../packages/components/calendar/src/select-controller.vue?vue&type=script&setup=true&lang.ts
  21680. var select_controller_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  21681. name: "SelectController",
  21682. __name: "select-controller",
  21683. props: selectControllerProps,
  21684. emits: selectControllerEmits,
  21685. setup(__props, { emit: __emit }) {
  21686. const props = __props;
  21687. const emit = __emit;
  21688. const nsSelect = useNamespace("calendar-select");
  21689. const { t, lang } = useLocale();
  21690. const monthOptions = Array.from({ length: 12 }, (_, index) => {
  21691. const actualMonth = index + 1;
  21692. return {
  21693. value: actualMonth,
  21694. label: isFunction$1(props.formatter) ? props.formatter(actualMonth, "month") : actualMonth
  21695. };
  21696. });
  21697. const yearValue = computed(() => props.date.year());
  21698. const monthValue = computed(() => props.date.month() + 1);
  21699. const yearOptions = computed(() => {
  21700. const years = [];
  21701. for (let i = -10; i < 10; i++) {
  21702. const year = yearValue.value + i;
  21703. if (year > 0) {
  21704. const label = isFunction$1(props.formatter) ? props.formatter(year, "year") : year;
  21705. years.push({
  21706. value: year,
  21707. label
  21708. });
  21709. }
  21710. }
  21711. return years;
  21712. });
  21713. const handleYearChange = (year) => {
  21714. emit("date-change", (0, import_dayjs_min.default)(new Date(year, monthValue.value - 1, 1)).locale(lang.value));
  21715. };
  21716. const handleMonthChange = (month) => {
  21717. emit("date-change", (0, import_dayjs_min.default)(new Date(yearValue.value, month - 1, 1)).locale(lang.value));
  21718. };
  21719. const selectToday = () => {
  21720. emit("date-change", "today");
  21721. };
  21722. return (_ctx, _cache) => {
  21723. return openBlock(), createElementBlock(Fragment, null, [
  21724. createVNode(unref(ElSelect), {
  21725. "model-value": yearValue.value,
  21726. size: "small",
  21727. class: normalizeClass(unref(nsSelect).e("year")),
  21728. "validate-event": false,
  21729. options: yearOptions.value,
  21730. onChange: handleYearChange
  21731. }, null, 8, [
  21732. "model-value",
  21733. "class",
  21734. "options"
  21735. ]),
  21736. createVNode(unref(ElSelect), {
  21737. "model-value": monthValue.value,
  21738. size: "small",
  21739. class: normalizeClass(unref(nsSelect).e("month")),
  21740. "validate-event": false,
  21741. options: unref(monthOptions),
  21742. onChange: handleMonthChange
  21743. }, null, 8, [
  21744. "model-value",
  21745. "class",
  21746. "options"
  21747. ]),
  21748. createVNode(unref(ElButton), {
  21749. size: "small",
  21750. onClick: selectToday
  21751. }, {
  21752. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)]),
  21753. _: 1
  21754. })
  21755. ], 64);
  21756. };
  21757. }
  21758. });
  21759. //#endregion
  21760. //#region ../../packages/components/calendar/src/select-controller.vue
  21761. var select_controller_default = select_controller_vue_vue_type_script_setup_true_lang_default;
  21762. //#endregion
  21763. //#region ../../packages/components/calendar/src/calendar.vue?vue&type=script&setup=true&lang.ts
  21764. const COMPONENT_NAME$12 = "ElCalendar";
  21765. var calendar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  21766. name: COMPONENT_NAME$12,
  21767. __name: "calendar",
  21768. props: calendarProps,
  21769. emits: calendarEmits,
  21770. setup(__props, { expose: __expose, emit: __emit }) {
  21771. const ns = useNamespace("calendar");
  21772. const { calculateValidatedDateRange, date, pickDay, realSelectedDay, selectDate, validatedRange, handleDateChange } = useCalendar(__props, __emit, COMPONENT_NAME$12);
  21773. const { t } = useLocale();
  21774. const i18nDate = computed(() => {
  21775. const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
  21776. return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
  21777. });
  21778. __expose({
  21779. selectedDay: realSelectedDay,
  21780. pickDay,
  21781. selectDate,
  21782. calculateValidatedDateRange
  21783. });
  21784. return (_ctx, _cache) => {
  21785. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("header")) }, [renderSlot(_ctx.$slots, "header", { date: i18nDate.value }, () => [createElementVNode("div", { class: normalizeClass(unref(ns).e("title")) }, toDisplayString(i18nDate.value), 3), unref(validatedRange).length === 0 && __props.controllerType === "button" ? (openBlock(), createElementBlock("div", {
  21786. key: 0,
  21787. class: normalizeClass(unref(ns).e("button-group"))
  21788. }, [createVNode(unref(ElButtonGroup), null, {
  21789. default: withCtx(() => [
  21790. createVNode(unref(ElButton), {
  21791. size: "small",
  21792. onClick: _cache[0] || (_cache[0] = ($event) => unref(selectDate)("prev-month"))
  21793. }, {
  21794. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)]),
  21795. _: 1
  21796. }),
  21797. createVNode(unref(ElButton), {
  21798. size: "small",
  21799. onClick: _cache[1] || (_cache[1] = ($event) => unref(selectDate)("today"))
  21800. }, {
  21801. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)]),
  21802. _: 1
  21803. }),
  21804. createVNode(unref(ElButton), {
  21805. size: "small",
  21806. onClick: _cache[2] || (_cache[2] = ($event) => unref(selectDate)("next-month"))
  21807. }, {
  21808. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)]),
  21809. _: 1
  21810. })
  21811. ]),
  21812. _: 1
  21813. })], 2)) : unref(validatedRange).length === 0 && __props.controllerType === "select" ? (openBlock(), createElementBlock("div", {
  21814. key: 1,
  21815. class: normalizeClass(unref(ns).e("select-controller"))
  21816. }, [createVNode(select_controller_default, {
  21817. date: unref(date),
  21818. formatter: __props.formatter,
  21819. onDateChange: unref(handleDateChange)
  21820. }, null, 8, [
  21821. "date",
  21822. "formatter",
  21823. "onDateChange"
  21824. ])], 2)) : createCommentVNode("v-if", true)])], 2), unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
  21825. key: 0,
  21826. class: normalizeClass(unref(ns).e("body"))
  21827. }, [createVNode(date_table_default, {
  21828. date: unref(date),
  21829. "selected-day": unref(realSelectedDay),
  21830. onPick: unref(pickDay)
  21831. }, createSlots({ _: 2 }, [_ctx.$slots["date-cell"] ? {
  21832. name: "date-cell",
  21833. fn: withCtx((data) => [renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))]),
  21834. key: "0"
  21835. } : void 0]), 1032, [
  21836. "date",
  21837. "selected-day",
  21838. "onPick"
  21839. ])], 2)) : (openBlock(), createElementBlock("div", {
  21840. key: 1,
  21841. class: normalizeClass(unref(ns).e("body"))
  21842. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => {
  21843. return openBlock(), createBlock(date_table_default, {
  21844. key: index,
  21845. date: range_[0],
  21846. "selected-day": unref(realSelectedDay),
  21847. range: range_,
  21848. "hide-header": index !== 0,
  21849. onPick: unref(pickDay)
  21850. }, createSlots({ _: 2 }, [_ctx.$slots["date-cell"] ? {
  21851. name: "date-cell",
  21852. fn: withCtx((data) => [renderSlot(_ctx.$slots, "date-cell", mergeProps({ ref_for: true }, data))]),
  21853. key: "0"
  21854. } : void 0]), 1032, [
  21855. "date",
  21856. "selected-day",
  21857. "range",
  21858. "hide-header",
  21859. "onPick"
  21860. ]);
  21861. }), 128))], 2))], 2);
  21862. };
  21863. }
  21864. });
  21865. //#endregion
  21866. //#region ../../packages/components/calendar/src/calendar.vue
  21867. var calendar_default = calendar_vue_vue_type_script_setup_true_lang_default;
  21868. //#endregion
  21869. //#region ../../packages/components/calendar/index.ts
  21870. const ElCalendar = withInstall(calendar_default);
  21871. //#endregion
  21872. //#region ../../packages/components/card/src/card.ts
  21873. /**
  21874. * @deprecated Removed after 3.0.0, Use `CardProps` instead.
  21875. */
  21876. const cardProps = buildProps({
  21877. header: {
  21878. type: String,
  21879. default: ""
  21880. },
  21881. footer: {
  21882. type: String,
  21883. default: ""
  21884. },
  21885. bodyStyle: {
  21886. type: definePropType([
  21887. String,
  21888. Object,
  21889. Array
  21890. ]),
  21891. default: ""
  21892. },
  21893. headerClass: String,
  21894. bodyClass: String,
  21895. footerClass: String,
  21896. shadow: {
  21897. type: String,
  21898. values: [
  21899. "always",
  21900. "hover",
  21901. "never"
  21902. ],
  21903. default: void 0
  21904. }
  21905. });
  21906. const cardContextKey = Symbol("cardContextKey");
  21907. //#endregion
  21908. //#region ../../packages/components/card/src/card.vue?vue&type=script&setup=true&lang.ts
  21909. var card_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  21910. name: "ElCard",
  21911. __name: "card",
  21912. props: cardProps,
  21913. setup(__props) {
  21914. const globalConfig = useGlobalConfig("card");
  21915. const ns = useNamespace("card");
  21916. return (_ctx, _cache) => {
  21917. return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), unref(ns).is(`${__props.shadow || unref(globalConfig)?.shadow || "always"}-shadow`)]) }, [
  21918. _ctx.$slots.header || __props.header ? (openBlock(), createElementBlock("div", {
  21919. key: 0,
  21920. class: normalizeClass([unref(ns).e("header"), __props.headerClass])
  21921. }, [renderSlot(_ctx.$slots, "header", {}, () => [createTextVNode(toDisplayString(__props.header), 1)])], 2)) : createCommentVNode("v-if", true),
  21922. createElementVNode("div", {
  21923. class: normalizeClass([unref(ns).e("body"), __props.bodyClass]),
  21924. style: normalizeStyle(__props.bodyStyle)
  21925. }, [renderSlot(_ctx.$slots, "default")], 6),
  21926. _ctx.$slots.footer || __props.footer ? (openBlock(), createElementBlock("div", {
  21927. key: 1,
  21928. class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
  21929. }, [renderSlot(_ctx.$slots, "footer", {}, () => [createTextVNode(toDisplayString(__props.footer), 1)])], 2)) : createCommentVNode("v-if", true)
  21930. ], 2);
  21931. };
  21932. }
  21933. });
  21934. //#endregion
  21935. //#region ../../packages/components/card/src/card.vue
  21936. var card_default = card_vue_vue_type_script_setup_true_lang_default;
  21937. //#endregion
  21938. //#region ../../packages/components/card/index.ts
  21939. const ElCard = withInstall(card_default);
  21940. //#endregion
  21941. //#region ../../packages/components/carousel/src/carousel.ts
  21942. /**
  21943. * @deprecated Removed after 3.0.0, Use `CarouselProps` instead.
  21944. */
  21945. const carouselProps = buildProps({
  21946. initialIndex: {
  21947. type: Number,
  21948. default: 0
  21949. },
  21950. height: {
  21951. type: String,
  21952. default: ""
  21953. },
  21954. trigger: {
  21955. type: String,
  21956. values: ["hover", "click"],
  21957. default: "hover"
  21958. },
  21959. autoplay: {
  21960. type: Boolean,
  21961. default: true
  21962. },
  21963. interval: {
  21964. type: Number,
  21965. default: 3e3
  21966. },
  21967. indicatorPosition: {
  21968. type: String,
  21969. values: [
  21970. "",
  21971. "none",
  21972. "outside"
  21973. ],
  21974. default: ""
  21975. },
  21976. arrow: {
  21977. type: String,
  21978. values: [
  21979. "always",
  21980. "hover",
  21981. "never"
  21982. ],
  21983. default: "hover"
  21984. },
  21985. type: {
  21986. type: String,
  21987. values: ["", "card"],
  21988. default: ""
  21989. },
  21990. cardScale: {
  21991. type: Number,
  21992. default: .83
  21993. },
  21994. loop: {
  21995. type: Boolean,
  21996. default: true
  21997. },
  21998. direction: {
  21999. type: String,
  22000. values: ["horizontal", "vertical"],
  22001. default: "horizontal"
  22002. },
  22003. pauseOnHover: {
  22004. type: Boolean,
  22005. default: true
  22006. },
  22007. motionBlur: Boolean
  22008. });
  22009. const carouselEmits = { change: (current, prev) => [current, prev].every(isNumber) };
  22010. //#endregion
  22011. //#region ../../packages/components/carousel/src/constants.ts
  22012. const carouselContextKey = Symbol("carouselContextKey");
  22013. const CAROUSEL_ITEM_NAME = "ElCarouselItem";
  22014. //#endregion
  22015. //#region ../../packages/components/carousel/src/use-carousel.ts
  22016. const THROTTLE_TIME = 300;
  22017. const useCarousel = (props, emit, componentName) => {
  22018. const { children: items, addChild: addItem, removeChild: removeItem, ChildrenSorter: ItemsSorter } = useOrderedChildren(getCurrentInstance(), CAROUSEL_ITEM_NAME);
  22019. const slots = useSlots();
  22020. const activeIndex = ref(-1);
  22021. const timer = ref(null);
  22022. const hover = ref(false);
  22023. const root = ref();
  22024. const containerHeight = ref(0);
  22025. const isItemsTwoLength = ref(true);
  22026. const arrowDisplay = computed(() => props.arrow !== "never" && !unref(isVertical));
  22027. const hasLabel = computed(() => {
  22028. return items.value.some((item) => item.props.label.toString().length > 0);
  22029. });
  22030. const isCardType = computed(() => props.type === "card");
  22031. const isVertical = computed(() => props.direction === "vertical");
  22032. const containerStyle = computed(() => {
  22033. if (props.height !== "auto") return { height: props.height };
  22034. return {
  22035. height: `${containerHeight.value}px`,
  22036. overflow: "hidden"
  22037. };
  22038. });
  22039. const throttledArrowClick = throttle((index) => {
  22040. setActiveItem(index);
  22041. }, THROTTLE_TIME, { trailing: true });
  22042. const throttledIndicatorHover = throttle((index) => {
  22043. handleIndicatorHover(index);
  22044. }, THROTTLE_TIME);
  22045. const isTwoLengthShow = (index) => {
  22046. if (!isItemsTwoLength.value) return true;
  22047. return activeIndex.value <= 1 ? index <= 1 : index > 1;
  22048. };
  22049. function pauseTimer() {
  22050. if (timer.value) {
  22051. clearInterval(timer.value);
  22052. timer.value = null;
  22053. }
  22054. }
  22055. function startTimer() {
  22056. if (props.interval <= 0 || !props.autoplay || timer.value) return;
  22057. timer.value = setInterval(() => playSlides(), props.interval);
  22058. }
  22059. const playSlides = () => {
  22060. if (activeIndex.value < items.value.length - 1) activeIndex.value = activeIndex.value + 1;
  22061. else if (props.loop) activeIndex.value = 0;
  22062. };
  22063. function setActiveItem(index) {
  22064. if (isString(index)) {
  22065. const filteredItems = items.value.filter((item) => item.props.name === index);
  22066. if (filteredItems.length > 0) index = items.value.indexOf(filteredItems[0]);
  22067. }
  22068. index = Number(index);
  22069. if (Number.isNaN(index) || index !== Math.floor(index)) {
  22070. /* @__PURE__ */ debugWarn(componentName, "index must be integer.");
  22071. return;
  22072. }
  22073. const itemCount = items.value.length;
  22074. const oldIndex = activeIndex.value;
  22075. if (index < 0) activeIndex.value = props.loop ? itemCount - 1 : 0;
  22076. else if (index >= itemCount) activeIndex.value = props.loop ? 0 : itemCount - 1;
  22077. else activeIndex.value = index;
  22078. if (oldIndex === activeIndex.value) resetItemPosition(oldIndex);
  22079. resetTimer();
  22080. }
  22081. function resetItemPosition(oldIndex) {
  22082. items.value.forEach((item, index) => {
  22083. item.translateItem(index, activeIndex.value, oldIndex);
  22084. });
  22085. }
  22086. function itemInStage(item, index) {
  22087. const _items = unref(items);
  22088. const itemCount = _items.length;
  22089. if (itemCount === 0 || !item.states.inStage) return false;
  22090. const nextItemIndex = index + 1;
  22091. const prevItemIndex = index - 1;
  22092. const lastItemIndex = itemCount - 1;
  22093. const isLastItemActive = _items[lastItemIndex].states.active;
  22094. const isFirstItemActive = _items[0].states.active;
  22095. const isNextItemActive = _items[nextItemIndex]?.states?.active;
  22096. const isPrevItemActive = _items[prevItemIndex]?.states?.active;
  22097. if (index === lastItemIndex && isFirstItemActive || isNextItemActive) return "left";
  22098. else if (index === 0 && isLastItemActive || isPrevItemActive) return "right";
  22099. return false;
  22100. }
  22101. function handleMouseEnter() {
  22102. hover.value = true;
  22103. if (props.pauseOnHover) pauseTimer();
  22104. }
  22105. function handleMouseLeave() {
  22106. hover.value = false;
  22107. startTimer();
  22108. }
  22109. function handleButtonEnter(arrow) {
  22110. if (unref(isVertical)) return;
  22111. items.value.forEach((item, index) => {
  22112. if (arrow === itemInStage(item, index)) item.states.hover = true;
  22113. });
  22114. }
  22115. function handleButtonLeave() {
  22116. if (unref(isVertical)) return;
  22117. items.value.forEach((item) => {
  22118. item.states.hover = false;
  22119. });
  22120. }
  22121. function handleIndicatorClick(index) {
  22122. activeIndex.value = index;
  22123. }
  22124. function handleIndicatorHover(index) {
  22125. if (props.trigger === "hover" && index !== activeIndex.value) activeIndex.value = index;
  22126. }
  22127. function prev() {
  22128. setActiveItem(activeIndex.value - 1);
  22129. }
  22130. function next() {
  22131. setActiveItem(activeIndex.value + 1);
  22132. }
  22133. function resetTimer() {
  22134. pauseTimer();
  22135. if (!props.pauseOnHover || !hover.value) startTimer();
  22136. }
  22137. function setContainerHeight(height) {
  22138. if (props.height !== "auto") return;
  22139. containerHeight.value = height;
  22140. }
  22141. function PlaceholderItem() {
  22142. const defaultSlots = slots.default?.();
  22143. if (!defaultSlots) return null;
  22144. const normalizeSlots = flattedChildren(defaultSlots).filter((slot) => {
  22145. return isVNode(slot) && slot.type.name === CAROUSEL_ITEM_NAME;
  22146. });
  22147. if (normalizeSlots?.length === 2 && props.loop && !isCardType.value) {
  22148. isItemsTwoLength.value = true;
  22149. return normalizeSlots;
  22150. }
  22151. isItemsTwoLength.value = false;
  22152. return null;
  22153. }
  22154. watch(() => activeIndex.value, (current, prev) => {
  22155. resetItemPosition(prev);
  22156. if (isItemsTwoLength.value) {
  22157. current = current % 2;
  22158. prev = prev % 2;
  22159. }
  22160. if (prev > -1) emit(CHANGE_EVENT, current, prev);
  22161. });
  22162. const exposeActiveIndex = computed({
  22163. get: () => {
  22164. return isItemsTwoLength.value ? activeIndex.value % 2 : activeIndex.value;
  22165. },
  22166. set: (value) => activeIndex.value = value
  22167. });
  22168. watch(() => props.autoplay, (autoplay) => {
  22169. autoplay ? startTimer() : pauseTimer();
  22170. });
  22171. watch(() => props.loop, () => {
  22172. setActiveItem(activeIndex.value);
  22173. });
  22174. watch(() => props.interval, () => {
  22175. resetTimer();
  22176. });
  22177. const resizeObserver = shallowRef();
  22178. onMounted(() => {
  22179. watch(() => items.value, () => {
  22180. if (items.value.length > 0) setActiveItem(props.initialIndex);
  22181. }, { immediate: true });
  22182. resizeObserver.value = useResizeObserver(root.value, () => {
  22183. resetItemPosition();
  22184. });
  22185. startTimer();
  22186. });
  22187. onBeforeUnmount(() => {
  22188. pauseTimer();
  22189. if (root.value && resizeObserver.value) resizeObserver.value.stop();
  22190. });
  22191. provide(carouselContextKey, {
  22192. root,
  22193. isCardType,
  22194. isVertical,
  22195. items,
  22196. loop: props.loop,
  22197. cardScale: props.cardScale,
  22198. addItem,
  22199. removeItem,
  22200. setActiveItem,
  22201. setContainerHeight
  22202. });
  22203. return {
  22204. root,
  22205. activeIndex,
  22206. exposeActiveIndex,
  22207. arrowDisplay,
  22208. hasLabel,
  22209. hover,
  22210. isCardType,
  22211. items,
  22212. isVertical,
  22213. containerStyle,
  22214. isItemsTwoLength,
  22215. handleButtonEnter,
  22216. handleButtonLeave,
  22217. handleIndicatorClick,
  22218. handleMouseEnter,
  22219. handleMouseLeave,
  22220. setActiveItem,
  22221. prev,
  22222. next,
  22223. PlaceholderItem,
  22224. isTwoLengthShow,
  22225. ItemsSorter,
  22226. throttledArrowClick,
  22227. throttledIndicatorHover
  22228. };
  22229. };
  22230. //#endregion
  22231. //#region ../../packages/components/carousel/src/carousel.vue?vue&type=script&setup=true&lang.ts
  22232. const _hoisted_1$64 = ["aria-label"];
  22233. const _hoisted_2$35 = ["aria-label"];
  22234. const _hoisted_3$16 = ["onMouseenter", "onClick"];
  22235. const _hoisted_4$12 = ["aria-label"];
  22236. const _hoisted_5$9 = { key: 0 };
  22237. const _hoisted_6$4 = {
  22238. key: 2,
  22239. xmlns: "http://www.w3.org/2000/svg",
  22240. version: "1.1",
  22241. style: { "display": "none" }
  22242. };
  22243. const COMPONENT_NAME$11 = "ElCarousel";
  22244. var carousel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  22245. name: COMPONENT_NAME$11,
  22246. __name: "carousel",
  22247. props: carouselProps,
  22248. emits: carouselEmits,
  22249. setup(__props, { expose: __expose, emit: __emit }) {
  22250. const props = __props;
  22251. const { root, activeIndex, exposeActiveIndex, arrowDisplay, hasLabel, hover, isCardType, items, isVertical, containerStyle, handleButtonEnter, handleButtonLeave, handleIndicatorClick, handleMouseEnter, handleMouseLeave, setActiveItem, prev, next, PlaceholderItem, isTwoLengthShow, ItemsSorter, throttledArrowClick, throttledIndicatorHover } = useCarousel(props, __emit, COMPONENT_NAME$11);
  22252. const ns = useNamespace("carousel");
  22253. const { t } = useLocale();
  22254. const carouselClasses = computed(() => {
  22255. const classes = [ns.b(), ns.m(props.direction)];
  22256. if (unref(isCardType)) classes.push(ns.m("card"));
  22257. classes.push(ns.is("vertical-outside", unref(isVertical) && props.indicatorPosition === "outside"));
  22258. return classes;
  22259. });
  22260. const indicatorsClasses = computed(() => {
  22261. const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
  22262. if (unref(hasLabel)) classes.push(ns.em("indicators", "labels"));
  22263. if (props.indicatorPosition === "outside") classes.push(ns.em("indicators", "outside"));
  22264. if (unref(isVertical)) classes.push(ns.em("indicators", "right"));
  22265. return classes;
  22266. });
  22267. function handleTransitionStart(e) {
  22268. if (!props.motionBlur) return;
  22269. const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
  22270. e.currentTarget.classList.add(kls);
  22271. }
  22272. function handleTransitionEnd(e) {
  22273. if (!props.motionBlur) return;
  22274. const kls = unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
  22275. e.currentTarget.classList.remove(kls);
  22276. }
  22277. __expose({
  22278. activeIndex: exposeActiveIndex,
  22279. setActiveItem,
  22280. prev,
  22281. next
  22282. });
  22283. return (_ctx, _cache) => {
  22284. return openBlock(), createElementBlock("div", {
  22285. ref_key: "root",
  22286. ref: root,
  22287. class: normalizeClass(carouselClasses.value),
  22288. onMouseenter: _cache[6] || (_cache[6] = withModifiers((...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args), ["stop"])),
  22289. onMouseleave: _cache[7] || (_cache[7] = withModifiers((...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args), ["stop"]))
  22290. }, [
  22291. unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
  22292. key: 0,
  22293. name: "carousel-arrow-left",
  22294. persisted: ""
  22295. }, {
  22296. default: withCtx(() => [withDirectives(createElementVNode("button", {
  22297. type: "button",
  22298. class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")]),
  22299. "aria-label": unref(t)("el.carousel.leftArrow"),
  22300. onMouseenter: _cache[0] || (_cache[0] = ($event) => unref(handleButtonEnter)("left")),
  22301. onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)),
  22302. onClick: _cache[2] || (_cache[2] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) - 1), ["stop"]))
  22303. }, [createVNode(unref(ElIcon), null, {
  22304. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  22305. _: 1
  22306. })], 42, _hoisted_1$64), [[vShow, (__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) > 0)]])]),
  22307. _: 1
  22308. })) : createCommentVNode("v-if", true),
  22309. unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
  22310. key: 1,
  22311. name: "carousel-arrow-right",
  22312. persisted: ""
  22313. }, {
  22314. default: withCtx(() => [withDirectives(createElementVNode("button", {
  22315. type: "button",
  22316. class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")]),
  22317. "aria-label": unref(t)("el.carousel.rightArrow"),
  22318. onMouseenter: _cache[3] || (_cache[3] = ($event) => unref(handleButtonEnter)("right")),
  22319. onMouseleave: _cache[4] || (_cache[4] = (...args) => unref(handleButtonLeave) && unref(handleButtonLeave)(...args)),
  22320. onClick: _cache[5] || (_cache[5] = withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) + 1), ["stop"]))
  22321. }, [createVNode(unref(ElIcon), null, {
  22322. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  22323. _: 1
  22324. })], 42, _hoisted_2$35), [[vShow, (__props.arrow === "always" || unref(hover)) && (__props.loop || unref(activeIndex) < unref(items).length - 1)]])]),
  22325. _: 1
  22326. })) : createCommentVNode("v-if", true),
  22327. createElementVNode("div", {
  22328. class: normalizeClass(unref(ns).e("container")),
  22329. style: normalizeStyle(unref(containerStyle)),
  22330. onTransitionstart: handleTransitionStart,
  22331. onTransitionend: handleTransitionEnd
  22332. }, [createVNode(unref(PlaceholderItem)), renderSlot(_ctx.$slots, "default")], 38),
  22333. createVNode(unref(ItemsSorter), null, {
  22334. default: withCtx(() => [__props.indicatorPosition !== "none" ? (openBlock(), createElementBlock("ul", {
  22335. key: 0,
  22336. class: normalizeClass(indicatorsClasses.value)
  22337. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item, index) => {
  22338. return withDirectives((openBlock(), createElementBlock("li", {
  22339. key: index,
  22340. class: normalizeClass([
  22341. unref(ns).e("indicator"),
  22342. unref(ns).em("indicator", __props.direction),
  22343. unref(ns).is("active", index === unref(activeIndex))
  22344. ]),
  22345. onMouseenter: ($event) => unref(throttledIndicatorHover)(index),
  22346. onClick: withModifiers(($event) => unref(handleIndicatorClick)(index), ["stop"])
  22347. }, [createElementVNode("button", {
  22348. class: normalizeClass(unref(ns).e("button")),
  22349. "aria-label": unref(t)("el.carousel.indicator", { index: index + 1 })
  22350. }, [unref(hasLabel) ? (openBlock(), createElementBlock("span", _hoisted_5$9, toDisplayString(item.props.label), 1)) : createCommentVNode("v-if", true)], 10, _hoisted_4$12)], 42, _hoisted_3$16)), [[vShow, unref(isTwoLengthShow)(index)]]);
  22351. }), 128))], 2)) : createCommentVNode("v-if", true)]),
  22352. _: 1
  22353. }),
  22354. __props.motionBlur ? (openBlock(), createElementBlock("svg", _hoisted_6$4, [..._cache[8] || (_cache[8] = [createElementVNode("defs", null, [createElementVNode("filter", { id: "elCarouselHorizontal" }, [createElementVNode("feGaussianBlur", {
  22355. in: "SourceGraphic",
  22356. stdDeviation: "12,0"
  22357. })]), createElementVNode("filter", { id: "elCarouselVertical" }, [createElementVNode("feGaussianBlur", {
  22358. in: "SourceGraphic",
  22359. stdDeviation: "0,10"
  22360. })])], -1)])])) : createCommentVNode("v-if", true)
  22361. ], 34);
  22362. };
  22363. }
  22364. });
  22365. //#endregion
  22366. //#region ../../packages/components/carousel/src/carousel.vue
  22367. var carousel_default = carousel_vue_vue_type_script_setup_true_lang_default;
  22368. //#endregion
  22369. //#region ../../packages/components/carousel/src/carousel-item.ts
  22370. /**
  22371. * @deprecated Removed after 3.0.0, Use `CarouselItemProps` instead.
  22372. */
  22373. const carouselItemProps = buildProps({
  22374. name: {
  22375. type: String,
  22376. default: ""
  22377. },
  22378. label: {
  22379. type: [String, Number],
  22380. default: ""
  22381. }
  22382. });
  22383. //#endregion
  22384. //#region ../../packages/components/carousel/src/use-carousel-item.ts
  22385. const useCarouselItem = (props) => {
  22386. const carouselContext = inject(carouselContextKey);
  22387. const instance = getCurrentInstance();
  22388. if (!carouselContext) /* @__PURE__ */ debugWarn(CAROUSEL_ITEM_NAME, "usage: <el-carousel></el-carousel-item></el-carousel>");
  22389. if (!instance) /* @__PURE__ */ debugWarn(CAROUSEL_ITEM_NAME, "compositional hook can only be invoked inside setups");
  22390. const carouselItemRef = ref();
  22391. const hover = ref(false);
  22392. const translate = ref(0);
  22393. const scale = ref(1);
  22394. const active = ref(false);
  22395. const ready = ref(false);
  22396. const inStage = ref(false);
  22397. const animating = ref(false);
  22398. const { isCardType, isVertical, cardScale } = carouselContext;
  22399. function processIndex(index, activeIndex, length) {
  22400. const lastItemIndex = length - 1;
  22401. const prevItemIndex = activeIndex - 1;
  22402. const nextItemIndex = activeIndex + 1;
  22403. const halfItemIndex = length / 2;
  22404. if (activeIndex === 0 && index === lastItemIndex) return -1;
  22405. else if (activeIndex === lastItemIndex && index === 0) return length;
  22406. else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) return length + 1;
  22407. else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) return -2;
  22408. return index;
  22409. }
  22410. function calcCardTranslate(index, activeIndex) {
  22411. const parentWidth = unref(isVertical) ? carouselContext.root.value?.offsetHeight || 0 : carouselContext.root.value?.offsetWidth || 0;
  22412. if (inStage.value) return parentWidth * ((2 - cardScale) * (index - activeIndex) + 1) / 4;
  22413. else if (index < activeIndex) return -(1 + cardScale) * parentWidth / 4;
  22414. else return (3 + cardScale) * parentWidth / 4;
  22415. }
  22416. function calcTranslate(index, activeIndex, isVertical) {
  22417. const rootEl = carouselContext.root.value;
  22418. if (!rootEl) return 0;
  22419. return ((isVertical ? rootEl.offsetHeight : rootEl.offsetWidth) || 0) * (index - activeIndex);
  22420. }
  22421. const translateItem = (index, activeIndex, oldIndex) => {
  22422. const _isCardType = unref(isCardType);
  22423. const carouselItemLength = carouselContext.items.value.length ?? NaN;
  22424. const isActive = index === activeIndex;
  22425. if (!_isCardType && !isUndefined(oldIndex)) animating.value = isActive || index === oldIndex;
  22426. if (!isActive && carouselItemLength > 2 && carouselContext.loop) index = processIndex(index, activeIndex, carouselItemLength);
  22427. const _isVertical = unref(isVertical);
  22428. active.value = isActive;
  22429. if (_isCardType) {
  22430. inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1;
  22431. translate.value = calcCardTranslate(index, activeIndex);
  22432. scale.value = unref(active) ? 1 : cardScale;
  22433. } else translate.value = calcTranslate(index, activeIndex, _isVertical);
  22434. ready.value = true;
  22435. if (isActive && carouselItemRef.value) carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight);
  22436. };
  22437. function handleItemClick() {
  22438. if (carouselContext && unref(isCardType)) {
  22439. const index = carouselContext.items.value.findIndex(({ uid }) => uid === instance.uid);
  22440. carouselContext.setActiveItem(index);
  22441. }
  22442. }
  22443. const carouselItemContext = {
  22444. props,
  22445. states: reactive({
  22446. hover,
  22447. translate,
  22448. scale,
  22449. active,
  22450. ready,
  22451. inStage,
  22452. animating
  22453. }),
  22454. uid: instance.uid,
  22455. getVnode: () => instance.vnode,
  22456. translateItem
  22457. };
  22458. carouselContext.addItem(carouselItemContext);
  22459. onBeforeUnmount(() => {
  22460. carouselContext.removeItem(carouselItemContext);
  22461. });
  22462. return {
  22463. carouselItemRef,
  22464. active,
  22465. animating,
  22466. hover,
  22467. inStage,
  22468. isVertical,
  22469. translate,
  22470. isCardType,
  22471. scale,
  22472. ready,
  22473. handleItemClick
  22474. };
  22475. };
  22476. //#endregion
  22477. //#region ../../packages/components/carousel/src/carousel-item.vue?vue&type=script&setup=true&lang.ts
  22478. var carousel_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  22479. name: CAROUSEL_ITEM_NAME,
  22480. __name: "carousel-item",
  22481. props: carouselItemProps,
  22482. setup(__props) {
  22483. const props = __props;
  22484. const ns = useNamespace("carousel");
  22485. const { carouselItemRef, active, animating, hover, inStage, isVertical, translate, isCardType, scale, ready, handleItemClick } = useCarouselItem(props);
  22486. const itemKls = computed(() => [
  22487. ns.e("item"),
  22488. ns.is("active", active.value),
  22489. ns.is("in-stage", inStage.value),
  22490. ns.is("hover", hover.value),
  22491. ns.is("animating", animating.value),
  22492. {
  22493. [ns.em("item", "card")]: isCardType.value,
  22494. [ns.em("item", "card-vertical")]: isCardType.value && isVertical.value
  22495. }
  22496. ]);
  22497. const itemStyle = computed(() => {
  22498. return { transform: [`${`translate${unref(isVertical) ? "Y" : "X"}`}(${unref(translate)}px)`, `scale(${unref(scale)})`].join(" ") };
  22499. });
  22500. return (_ctx, _cache) => {
  22501. return withDirectives((openBlock(), createElementBlock("div", {
  22502. ref_key: "carouselItemRef",
  22503. ref: carouselItemRef,
  22504. class: normalizeClass(itemKls.value),
  22505. style: normalizeStyle(itemStyle.value),
  22506. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleItemClick) && unref(handleItemClick)(...args))
  22507. }, [unref(isCardType) ? withDirectives((openBlock(), createElementBlock("div", {
  22508. key: 0,
  22509. class: normalizeClass(unref(ns).e("mask"))
  22510. }, null, 2)), [[vShow, !unref(active)]]) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 6)), [[vShow, unref(ready)]]);
  22511. };
  22512. }
  22513. });
  22514. //#endregion
  22515. //#region ../../packages/components/carousel/src/carousel-item.vue
  22516. var carousel_item_default = carousel_item_vue_vue_type_script_setup_true_lang_default;
  22517. //#endregion
  22518. //#region ../../packages/components/carousel/index.ts
  22519. const ElCarousel = withInstall(carousel_default, { CarouselItem: carousel_item_default });
  22520. const ElCarouselItem = withNoopInstall(carousel_item_default);
  22521. //#endregion
  22522. //#region ../../packages/components/cascader-panel/src/config.ts
  22523. const CommonProps = buildProps({
  22524. modelValue: { type: definePropType([
  22525. Number,
  22526. String,
  22527. Array,
  22528. Object
  22529. ]) },
  22530. options: {
  22531. type: definePropType(Array),
  22532. default: () => []
  22533. },
  22534. props: {
  22535. type: definePropType(Object),
  22536. default: () => ({})
  22537. }
  22538. });
  22539. const DefaultProps = {
  22540. expandTrigger: "click",
  22541. multiple: false,
  22542. checkStrictly: false,
  22543. emitPath: true,
  22544. lazy: false,
  22545. lazyLoad: NOOP,
  22546. value: "value",
  22547. label: "label",
  22548. children: "children",
  22549. leaf: "leaf",
  22550. disabled: "disabled",
  22551. hoverThreshold: 500,
  22552. checkOnClickNode: false,
  22553. checkOnClickLeaf: true,
  22554. showPrefix: true
  22555. };
  22556. /**
  22557. * @deprecated Removed after 3.0.0, Use `CascaderPanelProps` instead.
  22558. */
  22559. const cascaderPanelProps = buildProps({
  22560. ...CommonProps,
  22561. border: {
  22562. type: Boolean,
  22563. default: true
  22564. },
  22565. renderLabel: { type: Function }
  22566. });
  22567. const emitChangeFn$2 = (value) => true;
  22568. const cascaderPanelEmits = {
  22569. [UPDATE_MODEL_EVENT]: emitChangeFn$2,
  22570. [CHANGE_EVENT]: emitChangeFn$2,
  22571. close: () => true,
  22572. "expand-change": (value) => value
  22573. };
  22574. const useCascaderConfig = (props) => {
  22575. return computed(() => ({
  22576. ...DefaultProps,
  22577. ...props.props
  22578. }));
  22579. };
  22580. //#endregion
  22581. //#region ../../packages/components/checkbox/src/checkbox.ts
  22582. /**
  22583. * @deprecated Removed after 3.0.0, Use `CheckboxProps` instead.
  22584. */
  22585. const checkboxProps = {
  22586. modelValue: {
  22587. type: [
  22588. Number,
  22589. String,
  22590. Boolean
  22591. ],
  22592. default: void 0
  22593. },
  22594. label: {
  22595. type: [
  22596. String,
  22597. Boolean,
  22598. Number,
  22599. Object
  22600. ],
  22601. default: void 0
  22602. },
  22603. value: {
  22604. type: [
  22605. String,
  22606. Boolean,
  22607. Number,
  22608. Object
  22609. ],
  22610. default: void 0
  22611. },
  22612. indeterminate: Boolean,
  22613. disabled: {
  22614. type: Boolean,
  22615. default: void 0
  22616. },
  22617. checked: Boolean,
  22618. name: {
  22619. type: String,
  22620. default: void 0
  22621. },
  22622. trueValue: {
  22623. type: [String, Number],
  22624. default: void 0
  22625. },
  22626. falseValue: {
  22627. type: [String, Number],
  22628. default: void 0
  22629. },
  22630. trueLabel: {
  22631. type: [String, Number],
  22632. default: void 0
  22633. },
  22634. falseLabel: {
  22635. type: [String, Number],
  22636. default: void 0
  22637. },
  22638. id: {
  22639. type: String,
  22640. default: void 0
  22641. },
  22642. border: Boolean,
  22643. size: useSizeProp,
  22644. tabindex: [String, Number],
  22645. validateEvent: {
  22646. type: Boolean,
  22647. default: true
  22648. },
  22649. ariaLabel: String,
  22650. ...useAriaProps(["ariaControls"])
  22651. };
  22652. const checkboxEmits = {
  22653. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  22654. change: (val) => isString(val) || isNumber(val) || isBoolean(val)
  22655. };
  22656. const checkboxPropsDefaults = {
  22657. modelValue: void 0,
  22658. label: void 0,
  22659. value: void 0,
  22660. disabled: void 0,
  22661. name: void 0,
  22662. trueValue: void 0,
  22663. falseValue: void 0,
  22664. trueLabel: void 0,
  22665. falseLabel: void 0,
  22666. id: void 0,
  22667. validateEvent: true
  22668. };
  22669. //#endregion
  22670. //#region ../../packages/components/checkbox/src/constants.ts
  22671. const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
  22672. //#endregion
  22673. //#region ../../packages/components/checkbox/src/composables/use-checkbox-disabled.ts
  22674. const useCheckboxDisabled = ({ model, isChecked }) => {
  22675. const checkboxGroup = inject(checkboxGroupContextKey, void 0);
  22676. const formContext = inject(formContextKey, void 0);
  22677. const isLimitDisabled = computed(() => {
  22678. const max = checkboxGroup?.max?.value;
  22679. const min = checkboxGroup?.min?.value;
  22680. return !isUndefined(max) && model.value.length >= max && !isChecked.value || !isUndefined(min) && model.value.length <= min && isChecked.value;
  22681. });
  22682. return {
  22683. isDisabled: useFormDisabled(computed(() => {
  22684. if (checkboxGroup === void 0) return formContext?.disabled ?? isLimitDisabled.value;
  22685. else return checkboxGroup.disabled?.value || isLimitDisabled.value;
  22686. })),
  22687. isLimitDisabled
  22688. };
  22689. };
  22690. //#endregion
  22691. //#region ../../packages/components/checkbox/src/composables/use-checkbox-event.ts
  22692. const useCheckboxEvent = (props, { model, isLimitExceeded, hasOwnLabel, isDisabled, isLabeledByFormItem }) => {
  22693. const checkboxGroup = inject(checkboxGroupContextKey, void 0);
  22694. const { formItem } = useFormItem();
  22695. const { emit } = getCurrentInstance();
  22696. function getLabeledValue(value) {
  22697. return [
  22698. true,
  22699. props.trueValue,
  22700. props.trueLabel
  22701. ].includes(value) ? props.trueValue ?? props.trueLabel ?? true : props.falseValue ?? props.falseLabel ?? false;
  22702. }
  22703. function emitChangeEvent(checked, e) {
  22704. emit(CHANGE_EVENT, getLabeledValue(checked), e);
  22705. }
  22706. function handleChange(e) {
  22707. if (isLimitExceeded.value) return;
  22708. const target = e.target;
  22709. emit(CHANGE_EVENT, getLabeledValue(target.checked), e);
  22710. }
  22711. async function onClickRoot(e) {
  22712. if (isLimitExceeded.value) return;
  22713. if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
  22714. if (!e.composedPath().some((item) => item.tagName === "LABEL")) {
  22715. model.value = getLabeledValue([
  22716. false,
  22717. props.falseValue,
  22718. props.falseLabel
  22719. ].includes(model.value));
  22720. await nextTick();
  22721. emitChangeEvent(model.value, e);
  22722. }
  22723. }
  22724. }
  22725. const validateEvent = computed(() => checkboxGroup?.validateEvent || props.validateEvent);
  22726. watch(() => props.modelValue, () => {
  22727. if (validateEvent.value) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  22728. });
  22729. return {
  22730. handleChange,
  22731. onClickRoot
  22732. };
  22733. };
  22734. //#endregion
  22735. //#region ../../packages/components/checkbox/src/composables/use-checkbox-model.ts
  22736. const useCheckboxModel = (props) => {
  22737. const selfModel = ref(false);
  22738. const { emit } = getCurrentInstance();
  22739. const checkboxGroup = inject(checkboxGroupContextKey, void 0);
  22740. const isGroup = computed(() => isUndefined(checkboxGroup) === false);
  22741. const isLimitExceeded = ref(false);
  22742. const model = computed({
  22743. get() {
  22744. return isGroup.value ? checkboxGroup?.modelValue?.value : props.modelValue ?? selfModel.value;
  22745. },
  22746. set(val) {
  22747. if (isGroup.value && isArray$1(val)) {
  22748. isLimitExceeded.value = checkboxGroup?.max?.value !== void 0 && val.length > checkboxGroup?.max.value && val.length > model.value.length;
  22749. isLimitExceeded.value === false && checkboxGroup?.changeEvent?.(val);
  22750. } else {
  22751. emit(UPDATE_MODEL_EVENT, val);
  22752. selfModel.value = val;
  22753. }
  22754. }
  22755. });
  22756. return {
  22757. model,
  22758. isGroup,
  22759. isLimitExceeded
  22760. };
  22761. };
  22762. //#endregion
  22763. //#region ../../packages/components/checkbox/src/composables/use-checkbox-status.ts
  22764. const useCheckboxStatus = (props, slots, { model }) => {
  22765. const checkboxGroup = inject(checkboxGroupContextKey, void 0);
  22766. const isFocused = ref(false);
  22767. const actualValue = computed(() => {
  22768. if (!isPropAbsent(props.value)) return props.value;
  22769. return props.label;
  22770. });
  22771. const isChecked = computed(() => {
  22772. const value = model.value;
  22773. if (isBoolean(value)) return value;
  22774. else if (isArray$1(value)) if (isObject$1(actualValue.value)) return value.map(toRaw).some((o) => isEqual$1(o, actualValue.value));
  22775. else return value.map(toRaw).includes(actualValue.value);
  22776. else if (value !== null && value !== void 0) return value === props.trueValue || value === props.trueLabel;
  22777. else return !!value;
  22778. });
  22779. return {
  22780. checkboxButtonSize: useFormSize(computed(() => checkboxGroup?.size?.value), { prop: true }),
  22781. isChecked,
  22782. isFocused,
  22783. checkboxSize: useFormSize(computed(() => checkboxGroup?.size?.value)),
  22784. hasOwnLabel: computed(() => {
  22785. return !!slots.default || !isPropAbsent(actualValue.value);
  22786. }),
  22787. actualValue
  22788. };
  22789. };
  22790. //#endregion
  22791. //#region ../../packages/components/checkbox/src/composables/use-checkbox.ts
  22792. const useCheckbox = (props, slots) => {
  22793. const { formItem: elFormItem } = useFormItem();
  22794. const { model, isGroup, isLimitExceeded } = useCheckboxModel(props);
  22795. const { isFocused, isChecked, checkboxButtonSize, checkboxSize, hasOwnLabel, actualValue } = useCheckboxStatus(props, slots, { model });
  22796. const { isDisabled } = useCheckboxDisabled({
  22797. model,
  22798. isChecked
  22799. });
  22800. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
  22801. formItemContext: elFormItem,
  22802. disableIdGeneration: hasOwnLabel,
  22803. disableIdManagement: isGroup
  22804. });
  22805. const { handleChange, onClickRoot } = useCheckboxEvent(props, {
  22806. model,
  22807. isLimitExceeded,
  22808. hasOwnLabel,
  22809. isDisabled,
  22810. isLabeledByFormItem
  22811. });
  22812. const setStoreValue = () => {
  22813. function addToStore() {
  22814. if (isArray$1(model.value) && !model.value.includes(actualValue.value)) model.value.push(actualValue.value);
  22815. else model.value = props.trueValue ?? props.trueLabel ?? true;
  22816. }
  22817. props.checked && addToStore();
  22818. };
  22819. setStoreValue();
  22820. useDeprecated({
  22821. from: "label act as value",
  22822. replacement: "value",
  22823. version: "3.0.0",
  22824. scope: "el-checkbox",
  22825. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22826. }, computed(() => isGroup.value && isPropAbsent(props.value)));
  22827. useDeprecated({
  22828. from: "true-label",
  22829. replacement: "true-value",
  22830. version: "3.0.0",
  22831. scope: "el-checkbox",
  22832. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22833. }, computed(() => !!props.trueLabel));
  22834. useDeprecated({
  22835. from: "false-label",
  22836. replacement: "false-value",
  22837. version: "3.0.0",
  22838. scope: "el-checkbox",
  22839. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22840. }, computed(() => !!props.falseLabel));
  22841. return {
  22842. inputId,
  22843. isLabeledByFormItem,
  22844. isChecked,
  22845. isDisabled,
  22846. isFocused,
  22847. checkboxButtonSize,
  22848. checkboxSize,
  22849. hasOwnLabel,
  22850. model,
  22851. actualValue,
  22852. handleChange,
  22853. onClickRoot
  22854. };
  22855. };
  22856. //#endregion
  22857. //#region ../../packages/components/checkbox/src/checkbox.vue?vue&type=script&setup=true&lang.ts
  22858. const _hoisted_1$63 = [
  22859. "id",
  22860. "indeterminate",
  22861. "name",
  22862. "tabindex",
  22863. "disabled"
  22864. ];
  22865. var checkbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  22866. name: "ElCheckbox",
  22867. __name: "checkbox",
  22868. props: checkboxProps,
  22869. emits: checkboxEmits,
  22870. setup(__props) {
  22871. const props = __props;
  22872. const { inputId, isLabeledByFormItem, isChecked, isDisabled, isFocused, checkboxSize, hasOwnLabel, model, actualValue, handleChange, onClickRoot } = useCheckbox(props, useSlots());
  22873. const inputBindings = computed(() => {
  22874. if (props.trueValue || props.falseValue || props.trueLabel || props.falseLabel) return {
  22875. "true-value": props.trueValue ?? props.trueLabel ?? true,
  22876. "false-value": props.falseValue ?? props.falseLabel ?? false
  22877. };
  22878. return { value: actualValue.value };
  22879. });
  22880. const ns = useNamespace("checkbox");
  22881. const compKls = computed(() => {
  22882. return [
  22883. ns.b(),
  22884. ns.m(checkboxSize.value),
  22885. ns.is("disabled", isDisabled.value),
  22886. ns.is("bordered", props.border),
  22887. ns.is("checked", isChecked.value)
  22888. ];
  22889. });
  22890. const spanKls = computed(() => {
  22891. return [
  22892. ns.e("input"),
  22893. ns.is("disabled", isDisabled.value),
  22894. ns.is("checked", isChecked.value),
  22895. ns.is("indeterminate", props.indeterminate),
  22896. ns.is("focus", isFocused.value)
  22897. ];
  22898. });
  22899. return (_ctx, _cache) => {
  22900. return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
  22901. for: !unref(hasOwnLabel) && unref(isLabeledByFormItem) ? null : unref(inputId),
  22902. class: normalizeClass(compKls.value),
  22903. "aria-controls": __props.indeterminate ? __props.ariaControls : null,
  22904. "aria-checked": __props.indeterminate ? "mixed" : void 0,
  22905. "aria-label": __props.ariaLabel,
  22906. onClick: unref(onClickRoot)
  22907. }, {
  22908. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(spanKls.value) }, [withDirectives(createElementVNode("input", mergeProps({
  22909. id: unref(inputId),
  22910. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
  22911. class: unref(ns).e("original"),
  22912. type: "checkbox",
  22913. indeterminate: __props.indeterminate,
  22914. name: __props.name,
  22915. tabindex: __props.tabindex,
  22916. disabled: unref(isDisabled)
  22917. }, inputBindings.value, {
  22918. onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
  22919. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  22920. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
  22921. onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
  22922. }), null, 16, _hoisted_1$63), [[vModelCheckbox, unref(model)]]), createElementVNode("span", { class: normalizeClass(unref(ns).e("inner")) }, null, 2)], 2), unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
  22923. key: 0,
  22924. class: normalizeClass(unref(ns).e("label"))
  22925. }, [renderSlot(_ctx.$slots, "default"), !_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(__props.label), 1)], 64)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)]),
  22926. _: 3
  22927. }, 8, [
  22928. "for",
  22929. "class",
  22930. "aria-controls",
  22931. "aria-checked",
  22932. "aria-label",
  22933. "onClick"
  22934. ]);
  22935. };
  22936. }
  22937. });
  22938. //#endregion
  22939. //#region ../../packages/components/checkbox/src/checkbox.vue
  22940. var checkbox_default = checkbox_vue_vue_type_script_setup_true_lang_default;
  22941. //#endregion
  22942. //#region ../../packages/components/checkbox/src/checkbox-button.vue?vue&type=script&setup=true&lang.ts
  22943. const _hoisted_1$62 = [
  22944. "name",
  22945. "tabindex",
  22946. "disabled"
  22947. ];
  22948. var checkbox_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  22949. name: "ElCheckboxButton",
  22950. __name: "checkbox-button",
  22951. props: checkboxProps,
  22952. emits: checkboxEmits,
  22953. setup(__props) {
  22954. const props = __props;
  22955. const { isFocused, isChecked, isDisabled, checkboxButtonSize, model, actualValue, handleChange } = useCheckbox(props, useSlots());
  22956. const inputBindings = computed(() => {
  22957. if (props.trueValue || props.falseValue || props.trueLabel || props.falseLabel) return {
  22958. "true-value": props.trueValue ?? props.trueLabel ?? true,
  22959. "false-value": props.falseValue ?? props.falseLabel ?? false
  22960. };
  22961. return { value: actualValue.value };
  22962. });
  22963. const checkboxGroup = inject(checkboxGroupContextKey, void 0);
  22964. const ns = useNamespace("checkbox");
  22965. const activeStyle = computed(() => {
  22966. const fillValue = checkboxGroup?.fill?.value ?? "";
  22967. return {
  22968. backgroundColor: fillValue,
  22969. borderColor: fillValue,
  22970. color: checkboxGroup?.textColor?.value ?? "",
  22971. boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
  22972. };
  22973. });
  22974. const labelKls = computed(() => {
  22975. return [
  22976. ns.b("button"),
  22977. ns.bm("button", checkboxButtonSize.value),
  22978. ns.is("disabled", isDisabled.value),
  22979. ns.is("checked", isChecked.value),
  22980. ns.is("focus", isFocused.value)
  22981. ];
  22982. });
  22983. return (_ctx, _cache) => {
  22984. return openBlock(), createElementBlock("label", { class: normalizeClass(labelKls.value) }, [withDirectives(createElementVNode("input", mergeProps({
  22985. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
  22986. class: unref(ns).be("button", "original"),
  22987. type: "checkbox",
  22988. name: __props.name,
  22989. tabindex: __props.tabindex,
  22990. disabled: unref(isDisabled)
  22991. }, inputBindings.value, {
  22992. onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
  22993. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  22994. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
  22995. onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
  22996. }), null, 16, _hoisted_1$62), [[vModelCheckbox, unref(model)]]), _ctx.$slots.default || __props.label ? (openBlock(), createElementBlock("span", {
  22997. key: 0,
  22998. class: normalizeClass(unref(ns).be("button", "inner")),
  22999. style: normalizeStyle(unref(isChecked) ? activeStyle.value : void 0)
  23000. }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 6)) : createCommentVNode("v-if", true)], 2);
  23001. };
  23002. }
  23003. });
  23004. //#endregion
  23005. //#region ../../packages/components/checkbox/src/checkbox-button.vue
  23006. var checkbox_button_default = checkbox_button_vue_vue_type_script_setup_true_lang_default;
  23007. //#endregion
  23008. //#region ../../packages/components/checkbox/src/checkbox-group.ts
  23009. /**
  23010. * @deprecated Removed after 3.0.0, Use `CheckboxGroupProps` instead.
  23011. */
  23012. const checkboxGroupProps = buildProps({
  23013. modelValue: {
  23014. type: definePropType(Array),
  23015. default: () => []
  23016. },
  23017. disabled: {
  23018. type: Boolean,
  23019. default: void 0
  23020. },
  23021. min: Number,
  23022. max: Number,
  23023. size: useSizeProp,
  23024. fill: String,
  23025. textColor: String,
  23026. tag: {
  23027. type: String,
  23028. default: "div"
  23029. },
  23030. validateEvent: {
  23031. type: Boolean,
  23032. default: true
  23033. },
  23034. options: { type: definePropType(Array) },
  23035. props: {
  23036. type: definePropType(Object),
  23037. default: () => checkboxDefaultProps
  23038. },
  23039. type: {
  23040. type: String,
  23041. values: ["checkbox", "button"],
  23042. default: "checkbox"
  23043. },
  23044. ...useAriaProps(["ariaLabel"])
  23045. });
  23046. const checkboxGroupEmits = {
  23047. [UPDATE_MODEL_EVENT]: (val) => isArray$1(val),
  23048. change: (val) => isArray$1(val)
  23049. };
  23050. const checkboxDefaultProps = {
  23051. label: "label",
  23052. value: "value",
  23053. disabled: "disabled"
  23054. };
  23055. //#endregion
  23056. //#region ../../packages/components/checkbox/src/checkbox-group.vue?vue&type=script&setup=true&lang.ts
  23057. var checkbox_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23058. name: "ElCheckboxGroup",
  23059. __name: "checkbox-group",
  23060. props: checkboxGroupProps,
  23061. emits: checkboxGroupEmits,
  23062. setup(__props, { emit: __emit }) {
  23063. const props = __props;
  23064. const emit = __emit;
  23065. const ns = useNamespace("checkbox");
  23066. const checkboxDisabled = useFormDisabled();
  23067. const { formItem } = useFormItem();
  23068. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  23069. const changeEvent = async (value) => {
  23070. emit(UPDATE_MODEL_EVENT, value);
  23071. await nextTick();
  23072. emit(CHANGE_EVENT, value);
  23073. };
  23074. const modelValue = computed({
  23075. get() {
  23076. return props.modelValue;
  23077. },
  23078. set(val) {
  23079. changeEvent(val);
  23080. }
  23081. });
  23082. const aliasProps = computed(() => ({
  23083. ...checkboxDefaultProps,
  23084. ...props.props
  23085. }));
  23086. const getOptionProps = (option) => {
  23087. const { label, value, disabled } = aliasProps.value;
  23088. const base = {
  23089. label: option[label],
  23090. value: option[value],
  23091. disabled: option[disabled]
  23092. };
  23093. return {
  23094. ...omit(option, [
  23095. label,
  23096. value,
  23097. disabled
  23098. ]),
  23099. ...base
  23100. };
  23101. };
  23102. const optionComponent = computed(() => props.type === "button" ? checkbox_button_default : checkbox_default);
  23103. provide(checkboxGroupContextKey, {
  23104. ...pick(toRefs(props), [
  23105. "size",
  23106. "min",
  23107. "max",
  23108. "validateEvent",
  23109. "fill",
  23110. "textColor"
  23111. ]),
  23112. disabled: checkboxDisabled,
  23113. modelValue,
  23114. changeEvent
  23115. });
  23116. watch(() => props.modelValue, (newVal, oldValue) => {
  23117. if (props.validateEvent && !isEqual$1(newVal, oldValue)) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  23118. });
  23119. return (_ctx, _cache) => {
  23120. return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
  23121. id: unref(groupId),
  23122. class: normalizeClass(unref(ns).b("group")),
  23123. role: "group",
  23124. "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "checkbox-group" : void 0,
  23125. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem)?.labelId : void 0
  23126. }, {
  23127. default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
  23128. return openBlock(), createBlock(resolveDynamicComponent(optionComponent.value), mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16);
  23129. }), 128))])]),
  23130. _: 3
  23131. }, 8, [
  23132. "id",
  23133. "class",
  23134. "aria-label",
  23135. "aria-labelledby"
  23136. ]);
  23137. };
  23138. }
  23139. });
  23140. //#endregion
  23141. //#region ../../packages/components/checkbox/src/checkbox-group.vue
  23142. var checkbox_group_default = checkbox_group_vue_vue_type_script_setup_true_lang_default;
  23143. //#endregion
  23144. //#region ../../packages/components/checkbox/index.ts
  23145. const ElCheckbox = withInstall(checkbox_default, {
  23146. CheckboxButton: checkbox_button_default,
  23147. CheckboxGroup: checkbox_group_default
  23148. });
  23149. const ElCheckboxButton = withNoopInstall(checkbox_button_default);
  23150. const ElCheckboxGroup = withNoopInstall(checkbox_group_default);
  23151. //#endregion
  23152. //#region ../../packages/components/radio/src/radio.ts
  23153. /**
  23154. * @deprecated Removed after 3.0.0, Use `RadioPropsBase` instead.
  23155. */
  23156. const radioPropsBase = buildProps({
  23157. modelValue: {
  23158. type: [
  23159. String,
  23160. Number,
  23161. Boolean
  23162. ],
  23163. default: void 0
  23164. },
  23165. size: useSizeProp,
  23166. disabled: {
  23167. type: Boolean,
  23168. default: void 0
  23169. },
  23170. label: {
  23171. type: [
  23172. String,
  23173. Number,
  23174. Boolean
  23175. ],
  23176. default: void 0
  23177. },
  23178. value: {
  23179. type: [
  23180. String,
  23181. Number,
  23182. Boolean
  23183. ],
  23184. default: void 0
  23185. },
  23186. name: {
  23187. type: String,
  23188. default: void 0
  23189. }
  23190. });
  23191. /**
  23192. * @deprecated Removed after 3.0.0, Use `RadioProps` instead.
  23193. */
  23194. const radioProps = buildProps({
  23195. ...radioPropsBase,
  23196. border: Boolean
  23197. });
  23198. const radioEmits = {
  23199. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  23200. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  23201. };
  23202. /**
  23203. * @description default values for RadioProps
  23204. */
  23205. const radioPropsDefaults = {
  23206. modelValue: void 0,
  23207. disabled: void 0,
  23208. label: void 0,
  23209. value: void 0,
  23210. name: void 0,
  23211. border: false
  23212. };
  23213. //#endregion
  23214. //#region ../../packages/components/radio/src/constants.ts
  23215. const radioGroupKey = Symbol("radioGroupKey");
  23216. //#endregion
  23217. //#region ../../packages/components/radio/src/use-radio.ts
  23218. const useRadio = (props, emit) => {
  23219. const radioRef = ref();
  23220. const radioGroup = inject(radioGroupKey, void 0);
  23221. const isGroup = computed(() => !!radioGroup);
  23222. const actualValue = computed(() => {
  23223. if (!isPropAbsent(props.value)) return props.value;
  23224. return props.label;
  23225. });
  23226. const modelValue = computed({
  23227. get() {
  23228. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  23229. },
  23230. set(val) {
  23231. if (isGroup.value) radioGroup.changeEvent(val);
  23232. else emit && emit(UPDATE_MODEL_EVENT, val);
  23233. radioRef.value.checked = props.modelValue === actualValue.value;
  23234. }
  23235. });
  23236. const size = useFormSize(computed(() => radioGroup?.size));
  23237. const disabled = useFormDisabled(computed(() => radioGroup?.disabled));
  23238. const focus = ref(false);
  23239. const tabIndex = computed(() => {
  23240. return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0;
  23241. });
  23242. useDeprecated({
  23243. from: "label act as value",
  23244. replacement: "value",
  23245. version: "3.0.0",
  23246. scope: "el-radio",
  23247. ref: "https://element-plus.org/en-US/component/radio.html"
  23248. }, computed(() => isGroup.value && isPropAbsent(props.value)));
  23249. return {
  23250. radioRef,
  23251. isGroup,
  23252. radioGroup,
  23253. focus,
  23254. size,
  23255. disabled,
  23256. tabIndex,
  23257. modelValue,
  23258. actualValue
  23259. };
  23260. };
  23261. //#endregion
  23262. //#region ../../packages/components/radio/src/radio.vue?vue&type=script&setup=true&lang.ts
  23263. const _hoisted_1$61 = [
  23264. "value",
  23265. "name",
  23266. "disabled",
  23267. "checked"
  23268. ];
  23269. var radio_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23270. name: "ElRadio",
  23271. __name: "radio",
  23272. props: radioProps,
  23273. emits: radioEmits,
  23274. setup(__props, { emit: __emit }) {
  23275. const props = __props;
  23276. const emit = __emit;
  23277. const ns = useNamespace("radio");
  23278. const { radioRef, radioGroup, focus, size, disabled, modelValue, actualValue } = useRadio(props, emit);
  23279. function handleChange() {
  23280. nextTick(() => emit(CHANGE_EVENT, modelValue.value));
  23281. }
  23282. return (_ctx, _cache) => {
  23283. return openBlock(), createElementBlock("label", { class: normalizeClass([
  23284. unref(ns).b(),
  23285. unref(ns).is("disabled", unref(disabled)),
  23286. unref(ns).is("focus", unref(focus)),
  23287. unref(ns).is("bordered", __props.border),
  23288. unref(ns).is("checked", unref(modelValue) === unref(actualValue)),
  23289. unref(ns).m(unref(size))
  23290. ]) }, [createElementVNode("span", { class: normalizeClass([
  23291. unref(ns).e("input"),
  23292. unref(ns).is("disabled", unref(disabled)),
  23293. unref(ns).is("checked", unref(modelValue) === unref(actualValue))
  23294. ]) }, [withDirectives(createElementVNode("input", {
  23295. ref_key: "radioRef",
  23296. ref: radioRef,
  23297. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  23298. class: normalizeClass(unref(ns).e("original")),
  23299. value: unref(actualValue),
  23300. name: __props.name || unref(radioGroup)?.name,
  23301. disabled: unref(disabled),
  23302. checked: unref(modelValue) === unref(actualValue),
  23303. type: "radio",
  23304. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  23305. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  23306. onChange: handleChange,
  23307. onClick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
  23308. }, null, 42, _hoisted_1$61), [[vModelRadio, unref(modelValue)]]), createElementVNode("span", { class: normalizeClass(unref(ns).e("inner")) }, null, 2)], 2), createElementVNode("span", {
  23309. class: normalizeClass(unref(ns).e("label")),
  23310. onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
  23311. }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 34)], 2);
  23312. };
  23313. }
  23314. });
  23315. //#endregion
  23316. //#region ../../packages/components/radio/src/radio.vue
  23317. var radio_default = radio_vue_vue_type_script_setup_true_lang_default;
  23318. //#endregion
  23319. //#region ../../packages/components/radio/src/radio-button.ts
  23320. /**
  23321. * @deprecated Removed after 3.0.0, Use `RadioButtonProps` instead.
  23322. */
  23323. const radioButtonProps = buildProps({ ...radioPropsBase });
  23324. /**
  23325. * @description default values for RadioButtonProps
  23326. */
  23327. const radioButtonPropsDefaults = {
  23328. modelValue: void 0,
  23329. disabled: void 0,
  23330. label: void 0,
  23331. value: void 0,
  23332. name: void 0
  23333. };
  23334. //#endregion
  23335. //#region ../../packages/components/radio/src/radio-button.vue?vue&type=script&setup=true&lang.ts
  23336. const _hoisted_1$60 = [
  23337. "value",
  23338. "name",
  23339. "disabled"
  23340. ];
  23341. var radio_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23342. name: "ElRadioButton",
  23343. __name: "radio-button",
  23344. props: radioButtonProps,
  23345. setup(__props) {
  23346. const props = __props;
  23347. const ns = useNamespace("radio");
  23348. const { radioRef, focus, size, disabled, modelValue, radioGroup, actualValue } = useRadio(props);
  23349. const activeStyle = computed(() => {
  23350. return {
  23351. backgroundColor: radioGroup?.fill || "",
  23352. borderColor: radioGroup?.fill || "",
  23353. boxShadow: radioGroup?.fill ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  23354. color: radioGroup?.textColor || ""
  23355. };
  23356. });
  23357. return (_ctx, _cache) => {
  23358. return openBlock(), createElementBlock("label", { class: normalizeClass([
  23359. unref(ns).b("button"),
  23360. unref(ns).is("active", unref(modelValue) === unref(actualValue)),
  23361. unref(ns).is("disabled", unref(disabled)),
  23362. unref(ns).is("focus", unref(focus)),
  23363. unref(ns).bm("button", unref(size))
  23364. ]) }, [withDirectives(createElementVNode("input", {
  23365. ref_key: "radioRef",
  23366. ref: radioRef,
  23367. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  23368. class: normalizeClass(unref(ns).be("button", "original-radio")),
  23369. value: unref(actualValue),
  23370. type: "radio",
  23371. name: __props.name || unref(radioGroup)?.name,
  23372. disabled: unref(disabled),
  23373. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  23374. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  23375. onClick: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"]))
  23376. }, null, 42, _hoisted_1$60), [[vModelRadio, unref(modelValue)]]), createElementVNode("span", {
  23377. class: normalizeClass(unref(ns).be("button", "inner")),
  23378. style: normalizeStyle(unref(modelValue) === unref(actualValue) ? activeStyle.value : {}),
  23379. onKeydown: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
  23380. }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.label), 1)])], 38)], 2);
  23381. };
  23382. }
  23383. });
  23384. //#endregion
  23385. //#region ../../packages/components/radio/src/radio-button.vue
  23386. var radio_button_default = radio_button_vue_vue_type_script_setup_true_lang_default;
  23387. //#endregion
  23388. //#region ../../packages/components/radio/src/radio-group.ts
  23389. const radioDefaultProps = {
  23390. label: "label",
  23391. value: "value",
  23392. disabled: "disabled"
  23393. };
  23394. /**
  23395. * @deprecated Removed after 3.0.0, Use `RadioGroupProps` instead.
  23396. */
  23397. const radioGroupProps = buildProps({
  23398. id: {
  23399. type: String,
  23400. default: void 0
  23401. },
  23402. size: useSizeProp,
  23403. disabled: {
  23404. type: Boolean,
  23405. default: void 0
  23406. },
  23407. modelValue: {
  23408. type: [
  23409. String,
  23410. Number,
  23411. Boolean
  23412. ],
  23413. default: void 0
  23414. },
  23415. fill: {
  23416. type: String,
  23417. default: ""
  23418. },
  23419. textColor: {
  23420. type: String,
  23421. default: ""
  23422. },
  23423. name: {
  23424. type: String,
  23425. default: void 0
  23426. },
  23427. validateEvent: {
  23428. type: Boolean,
  23429. default: true
  23430. },
  23431. options: { type: definePropType(Array) },
  23432. props: {
  23433. type: definePropType(Object),
  23434. default: () => radioDefaultProps
  23435. },
  23436. type: {
  23437. type: String,
  23438. values: ["radio", "button"],
  23439. default: "radio"
  23440. },
  23441. ...useAriaProps(["ariaLabel"])
  23442. });
  23443. const radioGroupEmits = radioEmits;
  23444. /**
  23445. * @description default values for RadioGroupProps
  23446. */
  23447. const radioGroupPropsDefaults = {
  23448. id: void 0,
  23449. disabled: void 0,
  23450. modelValue: void 0,
  23451. fill: "",
  23452. textColor: "",
  23453. name: void 0,
  23454. validateEvent: true,
  23455. props: () => radioDefaultProps,
  23456. type: "radio"
  23457. };
  23458. //#endregion
  23459. //#region ../../packages/components/radio/src/radio-group.vue?vue&type=script&setup=true&lang.ts
  23460. const _hoisted_1$59 = [
  23461. "id",
  23462. "aria-label",
  23463. "aria-labelledby"
  23464. ];
  23465. var radio_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23466. name: "ElRadioGroup",
  23467. __name: "radio-group",
  23468. props: radioGroupProps,
  23469. emits: radioGroupEmits,
  23470. setup(__props, { emit: __emit }) {
  23471. const props = __props;
  23472. const emit = __emit;
  23473. const ns = useNamespace("radio");
  23474. const radioId = useId();
  23475. const radioGroupRef = ref();
  23476. const { formItem } = useFormItem();
  23477. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  23478. const changeEvent = (value) => {
  23479. emit(UPDATE_MODEL_EVENT, value);
  23480. nextTick(() => emit(CHANGE_EVENT, value));
  23481. };
  23482. onMounted(() => {
  23483. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  23484. const firstLabel = radios[0];
  23485. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) firstLabel.tabIndex = 0;
  23486. });
  23487. const name = computed(() => {
  23488. return props.name || radioId.value;
  23489. });
  23490. const aliasProps = computed(() => ({
  23491. ...radioDefaultProps,
  23492. ...props.props
  23493. }));
  23494. const getOptionProps = (option) => {
  23495. const { label, value, disabled } = aliasProps.value;
  23496. const base = {
  23497. label: option[label],
  23498. value: option[value],
  23499. disabled: option[disabled]
  23500. };
  23501. return {
  23502. ...omit(option, [
  23503. label,
  23504. value,
  23505. disabled
  23506. ]),
  23507. ...base
  23508. };
  23509. };
  23510. const optionComponent = computed(() => props.type === "button" ? radio_button_default : radio_default);
  23511. provide(radioGroupKey, reactive({
  23512. ...toRefs(props),
  23513. changeEvent,
  23514. name
  23515. }));
  23516. watch(() => props.modelValue, (newVal, oldValue) => {
  23517. if (props.validateEvent && !isEqual$1(newVal, oldValue)) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  23518. });
  23519. return (_ctx, _cache) => {
  23520. return openBlock(), createElementBlock("div", {
  23521. id: unref(groupId),
  23522. ref_key: "radioGroupRef",
  23523. ref: radioGroupRef,
  23524. class: normalizeClass(unref(ns).b("group")),
  23525. role: "radiogroup",
  23526. "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "radio-group" : void 0,
  23527. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
  23528. }, [renderSlot(_ctx.$slots, "default", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
  23529. return openBlock(), createBlock(resolveDynamicComponent(optionComponent.value), mergeProps({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16);
  23530. }), 128))])], 10, _hoisted_1$59);
  23531. };
  23532. }
  23533. });
  23534. //#endregion
  23535. //#region ../../packages/components/radio/src/radio-group.vue
  23536. var radio_group_default = radio_group_vue_vue_type_script_setup_true_lang_default;
  23537. //#endregion
  23538. //#region ../../packages/components/radio/index.ts
  23539. const ElRadio = withInstall(radio_default, {
  23540. RadioButton: radio_button_default,
  23541. RadioGroup: radio_group_default
  23542. });
  23543. const ElRadioGroup = withNoopInstall(radio_group_default);
  23544. const ElRadioButton = withNoopInstall(radio_button_default);
  23545. //#endregion
  23546. //#region ../../packages/components/cascader-panel/src/types.ts
  23547. const CASCADER_PANEL_INJECTION_KEY = Symbol();
  23548. //#endregion
  23549. //#region ../../packages/components/cascader-panel/src/node-content.tsx
  23550. function isVNodeEmpty(vnodes) {
  23551. return !!(isArray$1(vnodes) ? vnodes.every(({ type }) => type === Comment) : vnodes?.type === Comment);
  23552. }
  23553. var node_content_default = /* @__PURE__ */ defineComponent({
  23554. name: "NodeContent",
  23555. props: { node: {
  23556. type: Object,
  23557. required: true
  23558. } },
  23559. setup(props) {
  23560. const ns = useNamespace("cascader-node");
  23561. const { renderLabelFn } = inject(CASCADER_PANEL_INJECTION_KEY);
  23562. const { node } = props;
  23563. const { data, label: nodeLabel } = node;
  23564. const label = () => {
  23565. const renderLabel = renderLabelFn?.({
  23566. node,
  23567. data
  23568. });
  23569. return isVNodeEmpty(renderLabel) ? nodeLabel : renderLabel ?? nodeLabel;
  23570. };
  23571. return () => createVNode("span", { "class": ns.e("label") }, [label()]);
  23572. }
  23573. });
  23574. //#endregion
  23575. //#region ../../packages/components/cascader-panel/src/node.vue?vue&type=script&setup=true&lang.ts
  23576. const _hoisted_1$58 = [
  23577. "id",
  23578. "aria-haspopup",
  23579. "aria-owns",
  23580. "aria-expanded",
  23581. "tabindex"
  23582. ];
  23583. var node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23584. name: "ElCascaderNode",
  23585. __name: "node",
  23586. props: {
  23587. node: {
  23588. type: Object,
  23589. required: true
  23590. },
  23591. menuId: String
  23592. },
  23593. emits: ["expand"],
  23594. setup(__props, { emit: __emit }) {
  23595. const props = __props;
  23596. const emit = __emit;
  23597. const panel = inject(CASCADER_PANEL_INJECTION_KEY);
  23598. const ns = useNamespace("cascader-node");
  23599. const isHoverMenu = computed(() => panel.isHoverMenu);
  23600. const multiple = computed(() => panel.config.multiple);
  23601. const checkStrictly = computed(() => panel.config.checkStrictly);
  23602. const showPrefix = computed(() => panel.config.showPrefix);
  23603. const checkedNodeId = computed(() => panel.checkedNodes[0]?.uid);
  23604. const isDisabled = computed(() => props.node.isDisabled);
  23605. const isLeaf = computed(() => props.node.isLeaf);
  23606. const expandable = computed(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
  23607. const inExpandingPath = computed(() => isInPath(panel.expandingNode));
  23608. const inCheckedPath = computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
  23609. const isInPath = (node) => {
  23610. const { level, uid } = props.node;
  23611. return node?.pathNodes[level - 1]?.uid === uid;
  23612. };
  23613. const doExpand = () => {
  23614. if (inExpandingPath.value) return;
  23615. panel.expandNode(props.node);
  23616. };
  23617. const doCheck = (checked) => {
  23618. const { node } = props;
  23619. if (checked === node.checked) return;
  23620. panel.handleCheckChange(node, checked);
  23621. };
  23622. const doLoad = () => {
  23623. panel.lazyLoad(props.node, () => {
  23624. if (!isLeaf.value) doExpand();
  23625. });
  23626. };
  23627. const handleHoverExpand = (e) => {
  23628. if (!isHoverMenu.value) return;
  23629. handleExpand();
  23630. !isLeaf.value && emit("expand", e);
  23631. };
  23632. const handleExpand = () => {
  23633. const { node } = props;
  23634. if (!expandable.value || node.loading) return;
  23635. node.loaded ? doExpand() : doLoad();
  23636. };
  23637. const handleClick = () => {
  23638. if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) handleCheck(true);
  23639. else if ((panel.config.checkOnClickNode && (multiple.value || checkStrictly.value) || isLeaf.value && panel.config.checkOnClickLeaf) && !isDisabled.value) handleSelectCheck(!props.node.checked);
  23640. else if (!isHoverMenu.value) handleExpand();
  23641. };
  23642. const handleSelectCheck = (checked) => {
  23643. if (checkStrictly.value) {
  23644. doCheck(checked);
  23645. if (props.node.loaded) doExpand();
  23646. } else handleCheck(checked);
  23647. };
  23648. const handleCheck = (checked) => {
  23649. if (!props.node.loaded) doLoad();
  23650. else {
  23651. doCheck(checked);
  23652. !checkStrictly.value && doExpand();
  23653. }
  23654. };
  23655. return (_ctx, _cache) => {
  23656. return openBlock(), createElementBlock("li", {
  23657. id: `${__props.menuId}-${__props.node.uid}`,
  23658. role: "menuitem",
  23659. "aria-haspopup": !isLeaf.value,
  23660. "aria-owns": isLeaf.value ? void 0 : __props.menuId,
  23661. "aria-expanded": inExpandingPath.value,
  23662. tabindex: expandable.value ? -1 : void 0,
  23663. class: normalizeClass([
  23664. unref(ns).b(),
  23665. unref(ns).is("selectable", checkStrictly.value),
  23666. unref(ns).is("active", __props.node.checked),
  23667. unref(ns).is("disabled", !expandable.value),
  23668. inExpandingPath.value && "in-active-path",
  23669. inCheckedPath.value && "in-checked-path"
  23670. ]),
  23671. onMouseenter: handleHoverExpand,
  23672. onFocus: handleHoverExpand,
  23673. onClick: handleClick
  23674. }, [
  23675. createCommentVNode(" prefix "),
  23676. multiple.value && showPrefix.value ? (openBlock(), createBlock(unref(ElCheckbox), {
  23677. key: 0,
  23678. "model-value": __props.node.checked,
  23679. indeterminate: __props.node.indeterminate,
  23680. disabled: isDisabled.value,
  23681. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
  23682. "onUpdate:modelValue": handleSelectCheck
  23683. }, null, 8, [
  23684. "model-value",
  23685. "indeterminate",
  23686. "disabled"
  23687. ])) : checkStrictly.value && showPrefix.value ? (openBlock(), createBlock(unref(ElRadio), {
  23688. key: 1,
  23689. "model-value": checkedNodeId.value,
  23690. label: __props.node.uid,
  23691. disabled: isDisabled.value,
  23692. "onUpdate:modelValue": handleSelectCheck,
  23693. onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
  23694. }, {
  23695. default: withCtx(() => [createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "), _cache[2] || (_cache[2] = createElementVNode("span", null, null, -1))]),
  23696. _: 1
  23697. }, 8, [
  23698. "model-value",
  23699. "label",
  23700. "disabled"
  23701. ])) : isLeaf.value && __props.node.checked ? (openBlock(), createBlock(unref(ElIcon), {
  23702. key: 2,
  23703. class: normalizeClass(unref(ns).e("prefix"))
  23704. }, {
  23705. default: withCtx(() => [createVNode(unref(check_default))]),
  23706. _: 1
  23707. }, 8, ["class"])) : createCommentVNode("v-if", true),
  23708. createCommentVNode(" content "),
  23709. createVNode(unref(node_content_default), { node: __props.node }, null, 8, ["node"]),
  23710. createCommentVNode(" postfix "),
  23711. !isLeaf.value ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [__props.node.loading ? (openBlock(), createBlock(unref(ElIcon), {
  23712. key: 0,
  23713. class: normalizeClass([unref(ns).is("loading"), unref(ns).e("postfix")])
  23714. }, {
  23715. default: withCtx(() => [createVNode(unref(loading_default))]),
  23716. _: 1
  23717. }, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), {
  23718. key: 1,
  23719. class: normalizeClass(["arrow-right", unref(ns).e("postfix")])
  23720. }, {
  23721. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  23722. _: 1
  23723. }, 8, ["class"]))], 64)) : createCommentVNode("v-if", true)
  23724. ], 42, _hoisted_1$58);
  23725. };
  23726. }
  23727. });
  23728. //#endregion
  23729. //#region ../../packages/components/cascader-panel/src/node.vue
  23730. var node_default = node_vue_vue_type_script_setup_true_lang_default;
  23731. //#endregion
  23732. //#region ../../packages/components/cascader-panel/src/menu.vue?vue&type=script&setup=true&lang.ts
  23733. var menu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  23734. name: "ElCascaderMenu",
  23735. __name: "menu",
  23736. props: {
  23737. nodes: {
  23738. type: Array,
  23739. required: true
  23740. },
  23741. index: {
  23742. type: Number,
  23743. required: true
  23744. }
  23745. },
  23746. setup(__props) {
  23747. const props = __props;
  23748. const instance = getCurrentInstance();
  23749. const ns = useNamespace("cascader-menu");
  23750. const { t } = useLocale();
  23751. const id = useId();
  23752. let activeNode;
  23753. let hoverTimer;
  23754. const panel = inject(CASCADER_PANEL_INJECTION_KEY);
  23755. const hoverZone = ref();
  23756. const isEmpty = computed(() => !props.nodes.length);
  23757. const isLoading = computed(() => !panel.initialLoaded);
  23758. const menuId = computed(() => `${id.value}-${props.index}`);
  23759. const handleExpand = (e) => {
  23760. activeNode = e.target;
  23761. };
  23762. const handleMouseMove = (e) => {
  23763. if (!panel.isHoverMenu || !activeNode || !hoverZone.value) return;
  23764. if (activeNode.contains(e.target)) {
  23765. clearHoverTimer();
  23766. const el = instance.vnode.el;
  23767. const { left } = el.getBoundingClientRect();
  23768. const { offsetWidth, offsetHeight } = el;
  23769. const startX = e.clientX - left;
  23770. const top = activeNode.offsetTop;
  23771. const bottom = top + activeNode.offsetHeight;
  23772. const scrollTop = el.querySelector(`.${ns.e("wrap")}`)?.scrollTop || 0;
  23773. hoverZone.value.innerHTML = `
  23774. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${top} L${offsetWidth} ${scrollTop} V${top} Z" />
  23775. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${bottom} L${offsetWidth} ${offsetHeight + scrollTop} V${bottom} Z" />
  23776. `;
  23777. } else if (!hoverTimer) hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
  23778. };
  23779. const clearHoverTimer = () => {
  23780. if (!hoverTimer) return;
  23781. clearTimeout(hoverTimer);
  23782. hoverTimer = void 0;
  23783. };
  23784. const clearHoverZone = () => {
  23785. if (!hoverZone.value) return;
  23786. hoverZone.value.innerHTML = "";
  23787. clearHoverTimer();
  23788. };
  23789. return (_ctx, _cache) => {
  23790. return openBlock(), createBlock(unref(ElScrollbar), {
  23791. key: menuId.value,
  23792. tag: "ul",
  23793. role: "menu",
  23794. class: normalizeClass(unref(ns).b()),
  23795. "wrap-class": unref(ns).e("wrap"),
  23796. "view-class": [unref(ns).e("list"), unref(ns).is("empty", isEmpty.value)],
  23797. onMousemove: handleMouseMove,
  23798. onMouseleave: clearHoverZone
  23799. }, {
  23800. default: withCtx(() => [
  23801. (openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes, (node) => {
  23802. return openBlock(), createBlock(node_default, {
  23803. key: node.uid,
  23804. node,
  23805. "menu-id": menuId.value,
  23806. onExpand: handleExpand
  23807. }, null, 8, ["node", "menu-id"]);
  23808. }), 128)),
  23809. isLoading.value ? (openBlock(), createElementBlock("div", {
  23810. key: 0,
  23811. class: normalizeClass(unref(ns).e("empty-text"))
  23812. }, [createVNode(unref(ElIcon), {
  23813. size: "14",
  23814. class: normalizeClass(unref(ns).is("loading"))
  23815. }, {
  23816. default: withCtx(() => [createVNode(unref(loading_default))]),
  23817. _: 1
  23818. }, 8, ["class"]), createTextVNode(" " + toDisplayString(unref(t)("el.cascader.loading")), 1)], 2)) : isEmpty.value ? (openBlock(), createElementBlock("div", {
  23819. key: 1,
  23820. class: normalizeClass(unref(ns).e("empty-text"))
  23821. }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(t)("el.cascader.noData")), 1)])], 2)) : unref(panel)?.isHoverMenu ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" eslint-disable vue/html-self-closing "), (openBlock(), createElementBlock("svg", {
  23822. ref_key: "hoverZone",
  23823. ref: hoverZone,
  23824. class: normalizeClass(unref(ns).e("hover-zone"))
  23825. }, null, 2))], 2112)) : createCommentVNode("v-if", true),
  23826. createCommentVNode(" eslint-enable vue/html-self-closing ")
  23827. ]),
  23828. _: 3
  23829. }, 8, [
  23830. "class",
  23831. "wrap-class",
  23832. "view-class"
  23833. ]);
  23834. };
  23835. }
  23836. });
  23837. //#endregion
  23838. //#region ../../packages/components/cascader-panel/src/menu.vue
  23839. var menu_default$1 = menu_vue_vue_type_script_setup_true_lang_default;
  23840. //#endregion
  23841. //#region ../../packages/components/cascader-panel/src/node.ts
  23842. let uid = 0;
  23843. const calculatePathNodes = (node) => {
  23844. const nodes = [node];
  23845. let { parent } = node;
  23846. while (parent) {
  23847. nodes.unshift(parent);
  23848. parent = parent.parent;
  23849. }
  23850. return nodes;
  23851. };
  23852. var Node$2 = class Node$2 {
  23853. constructor(data, config, parent, root = false) {
  23854. this.data = data;
  23855. this.config = config;
  23856. this.parent = parent;
  23857. this.root = root;
  23858. this.uid = uid++;
  23859. this.checked = false;
  23860. this.indeterminate = false;
  23861. this.loading = false;
  23862. const { value: valueKey, label: labelKey, children: childrenKey } = config;
  23863. const childrenData = data[childrenKey];
  23864. const pathNodes = calculatePathNodes(this);
  23865. this.level = root ? 0 : parent ? parent.level + 1 : 1;
  23866. this.value = data[valueKey];
  23867. this.label = data[labelKey];
  23868. this.pathNodes = pathNodes;
  23869. this.pathValues = pathNodes.map((node) => node.value);
  23870. this.pathLabels = pathNodes.map((node) => node.label);
  23871. this.childrenData = childrenData;
  23872. this.children = (childrenData || []).map((child) => new Node$2(child, config, this));
  23873. this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
  23874. this.text = "";
  23875. }
  23876. get isDisabled() {
  23877. const { data, parent, config } = this;
  23878. const { disabled, checkStrictly } = config;
  23879. return (isFunction$1(disabled) ? disabled(data, this) : !!data[disabled]) || !checkStrictly && !!parent?.isDisabled;
  23880. }
  23881. get isLeaf() {
  23882. const { data, config, childrenData, loaded } = this;
  23883. const { lazy, leaf } = config;
  23884. const isLeaf = isFunction$1(leaf) ? leaf(data, this) : data[leaf];
  23885. return isUndefined(isLeaf) ? lazy && !loaded ? false : !(isArray$1(childrenData) && childrenData.length) : !!isLeaf;
  23886. }
  23887. get valueByOption() {
  23888. return this.config.emitPath ? this.pathValues : this.value;
  23889. }
  23890. appendChild(childData) {
  23891. const { childrenData, children } = this;
  23892. const node = new Node$2(childData, this.config, this);
  23893. if (isArray$1(childrenData)) childrenData.push(childData);
  23894. else this.childrenData = [childData];
  23895. children.push(node);
  23896. return node;
  23897. }
  23898. calcText(allLevels, separator) {
  23899. const text = allLevels ? this.pathLabels.join(separator) : this.label;
  23900. this.text = text;
  23901. return text;
  23902. }
  23903. broadcast(checked) {
  23904. this.children.forEach((child) => {
  23905. if (child) {
  23906. child.broadcast(checked);
  23907. child.onParentCheck?.(checked);
  23908. }
  23909. });
  23910. }
  23911. emit() {
  23912. const { parent } = this;
  23913. if (parent) {
  23914. parent.onChildCheck?.();
  23915. parent.emit();
  23916. }
  23917. }
  23918. onParentCheck(checked) {
  23919. if (!this.isDisabled) this.setCheckState(checked);
  23920. }
  23921. onChildCheck() {
  23922. const { children } = this;
  23923. const validChildren = children.filter((child) => !child.isDisabled);
  23924. const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
  23925. this.setCheckState(checked);
  23926. }
  23927. setCheckState(checked) {
  23928. const totalNum = this.children.length;
  23929. const checkedNum = this.children.reduce((c, p) => {
  23930. return c + (p.checked ? 1 : p.indeterminate ? .5 : 0);
  23931. }, 0);
  23932. this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
  23933. this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
  23934. }
  23935. doCheck(checked) {
  23936. if (this.checked === checked) return;
  23937. const { checkStrictly, multiple } = this.config;
  23938. if (checkStrictly || !multiple) this.checked = checked;
  23939. else {
  23940. this.broadcast(checked);
  23941. this.setCheckState(checked);
  23942. this.emit();
  23943. }
  23944. }
  23945. };
  23946. //#endregion
  23947. //#region ../../packages/components/cascader-panel/src/store.ts
  23948. const flatNodes = (nodes, leafOnly) => {
  23949. return nodes.reduce((res, node) => {
  23950. if (node.isLeaf) res.push(node);
  23951. else {
  23952. !leafOnly && res.push(node);
  23953. res = res.concat(flatNodes(node.children, leafOnly));
  23954. }
  23955. return res;
  23956. }, []);
  23957. };
  23958. var Store = class {
  23959. constructor(data, config) {
  23960. this.config = config;
  23961. const nodes = (data || []).map((nodeData) => new Node$2(nodeData, this.config));
  23962. this.nodes = nodes;
  23963. this.allNodes = flatNodes(nodes, false);
  23964. this.leafNodes = flatNodes(nodes, true);
  23965. }
  23966. getNodes() {
  23967. return this.nodes;
  23968. }
  23969. getFlattedNodes(leafOnly) {
  23970. return leafOnly ? this.leafNodes : this.allNodes;
  23971. }
  23972. appendNode(nodeData, parentNode) {
  23973. const node = parentNode ? parentNode.appendChild(nodeData) : new Node$2(nodeData, this.config);
  23974. if (!parentNode) this.nodes.push(node);
  23975. this.appendAllNodesAndLeafNodes(node);
  23976. }
  23977. appendNodes(nodeDataList, parentNode) {
  23978. if (nodeDataList.length > 0) nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode));
  23979. else parentNode && parentNode.isLeaf && this.leafNodes.push(parentNode);
  23980. }
  23981. appendAllNodesAndLeafNodes(node) {
  23982. this.allNodes.push(node);
  23983. node.isLeaf && this.leafNodes.push(node);
  23984. if (node.children) node.children.forEach((subNode) => {
  23985. this.appendAllNodesAndLeafNodes(subNode);
  23986. });
  23987. }
  23988. getNodeByValue(value, leafOnly = false) {
  23989. if (isPropAbsent(value)) return null;
  23990. return this.getFlattedNodes(leafOnly).find((node) => isEqual$1(node.value, value) || isEqual$1(node.pathValues, value)) || null;
  23991. }
  23992. getSameNode(node) {
  23993. if (!node) return null;
  23994. return this.getFlattedNodes(false).find(({ value, level }) => isEqual$1(node.value, value) && node.level === level) || null;
  23995. }
  23996. };
  23997. //#endregion
  23998. //#region ../../packages/components/cascader-panel/src/utils.ts
  23999. const getMenuIndex = (el) => {
  24000. if (!el) return 0;
  24001. const pieces = el.id.split("-");
  24002. return Number(pieces[pieces.length - 2]);
  24003. };
  24004. const checkNode = (el) => {
  24005. if (!el) return;
  24006. const input = el.querySelector("input");
  24007. if (input) input.click();
  24008. else if (isLeaf(el)) el.click();
  24009. };
  24010. const sortByOriginalOrder = (oldNodes, newNodes) => {
  24011. const newNodesCopy = newNodes.slice(0);
  24012. const newIds = newNodesCopy.map((node) => node.uid);
  24013. const res = oldNodes.reduce((acc, item) => {
  24014. const index = newIds.indexOf(item.uid);
  24015. if (index > -1) {
  24016. acc.push(item);
  24017. newNodesCopy.splice(index, 1);
  24018. newIds.splice(index, 1);
  24019. }
  24020. return acc;
  24021. }, []);
  24022. res.push(...newNodesCopy);
  24023. return res;
  24024. };
  24025. //#endregion
  24026. //#region ../../packages/components/cascader-panel/src/index.vue?vue&type=script&setup=true&lang.ts
  24027. var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  24028. name: "ElCascaderPanel",
  24029. __name: "index",
  24030. props: cascaderPanelProps,
  24031. emits: cascaderPanelEmits,
  24032. setup(__props, { expose: __expose, emit: __emit }) {
  24033. const props = __props;
  24034. const emit = __emit;
  24035. let manualChecked = false;
  24036. const ns = useNamespace("cascader");
  24037. const config = useCascaderConfig(props);
  24038. const slots = useSlots();
  24039. let store;
  24040. const initialLoaded = ref(true);
  24041. const initialLoadedOnce = ref(false);
  24042. const menuList = ref([]);
  24043. const checkedValue = ref();
  24044. const menus = ref([]);
  24045. const expandingNode = ref();
  24046. const checkedNodes = ref([]);
  24047. const isHoverMenu = computed(() => config.value.expandTrigger === "hover");
  24048. const renderLabelFn = computed(() => props.renderLabel || slots.default);
  24049. const initStore = () => {
  24050. const { options } = props;
  24051. const cfg = config.value;
  24052. manualChecked = false;
  24053. store = new Store(options, cfg);
  24054. menus.value = [store.getNodes()];
  24055. if (cfg.lazy && isEmpty(props.options)) {
  24056. initialLoaded.value = false;
  24057. lazyLoad(void 0, (list) => {
  24058. if (list) {
  24059. store = new Store(list, cfg);
  24060. menus.value = [store.getNodes()];
  24061. }
  24062. initialLoaded.value = true;
  24063. syncCheckedValue(false, true);
  24064. });
  24065. } else syncCheckedValue(false, true);
  24066. };
  24067. const lazyLoad = (node, cb) => {
  24068. const cfg = config.value;
  24069. node = node || new Node$2({}, cfg, void 0, true);
  24070. node.loading = true;
  24071. const resolve = (dataList) => {
  24072. const _node = node;
  24073. const parent = _node.root ? null : _node;
  24074. _node.loading = false;
  24075. _node.loaded = true;
  24076. _node.childrenData = _node.childrenData || [];
  24077. dataList && store?.appendNodes(dataList, parent);
  24078. dataList && cb?.(dataList);
  24079. if (node.level === 0) initialLoadedOnce.value = true;
  24080. };
  24081. const reject = () => {
  24082. node.loading = false;
  24083. node.loaded = false;
  24084. if (node.level === 0) initialLoaded.value = true;
  24085. };
  24086. cfg.lazyLoad(node, resolve, reject);
  24087. };
  24088. const expandNode = (node, silent) => {
  24089. const { level } = node;
  24090. const newMenus = menus.value.slice(0, level);
  24091. let newExpandingNode;
  24092. if (node.isLeaf) newExpandingNode = node.pathNodes[level - 2];
  24093. else {
  24094. newExpandingNode = node;
  24095. newMenus.push(node.children);
  24096. }
  24097. if (expandingNode.value?.uid !== newExpandingNode?.uid) {
  24098. expandingNode.value = node;
  24099. menus.value = newMenus;
  24100. !silent && emit("expand-change", node?.pathValues || []);
  24101. }
  24102. };
  24103. const handleCheckChange = (node, checked, emitClose = true) => {
  24104. const { checkStrictly, multiple } = config.value;
  24105. const oldNode = checkedNodes.value[0];
  24106. manualChecked = true;
  24107. !multiple && oldNode?.doCheck(false);
  24108. node.doCheck(checked);
  24109. calculateCheckedValue();
  24110. emitClose && !multiple && !checkStrictly && emit("close");
  24111. !emitClose && !multiple && expandParentNode(node);
  24112. };
  24113. const expandParentNode = (node) => {
  24114. if (!node) return;
  24115. node = node.parent;
  24116. expandParentNode(node);
  24117. node && expandNode(node);
  24118. };
  24119. const getFlattedNodes = (leafOnly) => store?.getFlattedNodes(leafOnly);
  24120. const getCheckedNodes = (leafOnly) => {
  24121. return getFlattedNodes(leafOnly)?.filter(({ checked }) => checked !== false);
  24122. };
  24123. const clearCheckedNodes = () => {
  24124. checkedNodes.value.forEach((node) => node.doCheck(false));
  24125. calculateCheckedValue();
  24126. menus.value = menus.value.slice(0, 1);
  24127. expandingNode.value = void 0;
  24128. emit("expand-change", []);
  24129. };
  24130. const calculateCheckedValue = () => {
  24131. const { checkStrictly, multiple } = config.value;
  24132. const oldNodes = checkedNodes.value;
  24133. const nodes = sortByOriginalOrder(oldNodes, getCheckedNodes(!checkStrictly));
  24134. const values = nodes.map((node) => node.valueByOption);
  24135. checkedNodes.value = nodes;
  24136. checkedValue.value = multiple ? values : values[0] ?? null;
  24137. };
  24138. const syncCheckedValue = (loaded = false, forced = false) => {
  24139. const { modelValue } = props;
  24140. const { lazy, multiple, checkStrictly } = config.value;
  24141. const leafOnly = !checkStrictly;
  24142. if (!initialLoaded.value || manualChecked || !forced && isEqual$1(modelValue, checkedValue.value)) return;
  24143. if (lazy && !loaded) {
  24144. const nodes = unique(flattenDeep(castArray(modelValue))).map((val) => store?.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
  24145. if (nodes.length) nodes.forEach((node) => {
  24146. lazyLoad(node, () => syncCheckedValue(false, forced));
  24147. });
  24148. else syncCheckedValue(true, forced);
  24149. } else {
  24150. syncMenuState(unique((multiple ? castArray(modelValue) : [modelValue]).map((val) => store?.getNodeByValue(val, leafOnly))), forced);
  24151. checkedValue.value = cloneDeep(modelValue ?? void 0);
  24152. }
  24153. };
  24154. const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
  24155. const { checkStrictly } = config.value;
  24156. const oldNodes = checkedNodes.value;
  24157. const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf));
  24158. const oldExpandingNode = store?.getSameNode(expandingNode.value);
  24159. const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
  24160. if (newExpandingNode) newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
  24161. else expandingNode.value = void 0;
  24162. oldNodes.forEach((node) => node.doCheck(false));
  24163. reactive(newNodes).forEach((node) => node.doCheck(true));
  24164. checkedNodes.value = newNodes;
  24165. nextTick(scrollToExpandingNode);
  24166. };
  24167. const scrollToExpandingNode = () => {
  24168. if (!isClient) return;
  24169. menuList.value.forEach((menu) => {
  24170. const menuElement = menu?.$el;
  24171. if (menuElement) {
  24172. const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  24173. let activeNode = menuElement.querySelector(`.${ns.b("node")}.in-active-path`);
  24174. if (!activeNode) {
  24175. const activeElements = menuElement.querySelectorAll(`.${ns.b("node")}.${ns.is("active")}`);
  24176. activeNode = activeElements[activeElements.length - 1];
  24177. }
  24178. scrollIntoView(container, activeNode);
  24179. }
  24180. });
  24181. };
  24182. const handleKeyDown = (e) => {
  24183. const target = e.target;
  24184. const code = getEventCode(e);
  24185. switch (code) {
  24186. case EVENT_CODE.up:
  24187. case EVENT_CODE.down:
  24188. e.preventDefault();
  24189. focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${ns.b("node")}[tabindex="-1"]`));
  24190. break;
  24191. case EVENT_CODE.left: {
  24192. e.preventDefault();
  24193. const expandedNode = menuList.value[getMenuIndex(target) - 1]?.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
  24194. focusNode(expandedNode);
  24195. break;
  24196. }
  24197. case EVENT_CODE.right: {
  24198. e.preventDefault();
  24199. const firstNode = menuList.value[getMenuIndex(target) + 1]?.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
  24200. focusNode(firstNode);
  24201. break;
  24202. }
  24203. case EVENT_CODE.enter:
  24204. case EVENT_CODE.numpadEnter:
  24205. checkNode(target);
  24206. break;
  24207. }
  24208. };
  24209. provide(CASCADER_PANEL_INJECTION_KEY, reactive({
  24210. config,
  24211. expandingNode,
  24212. checkedNodes,
  24213. isHoverMenu,
  24214. initialLoaded,
  24215. renderLabelFn,
  24216. lazyLoad,
  24217. expandNode,
  24218. handleCheckChange
  24219. }));
  24220. watch(config, (newVal, oldVal) => {
  24221. if (isEqual$1(newVal, oldVal)) return;
  24222. initStore();
  24223. }, { immediate: true });
  24224. watch(() => props.options, initStore, { deep: true });
  24225. watch(() => props.modelValue, () => {
  24226. manualChecked = false;
  24227. syncCheckedValue();
  24228. }, { deep: true });
  24229. watch(() => checkedValue.value, (val) => {
  24230. if (!isEqual$1(val, props.modelValue)) {
  24231. emit(UPDATE_MODEL_EVENT, val);
  24232. emit(CHANGE_EVENT, val);
  24233. }
  24234. });
  24235. const loadLazyRootNodes = () => {
  24236. if (initialLoadedOnce.value) return;
  24237. initStore();
  24238. };
  24239. onBeforeUpdate(() => menuList.value = []);
  24240. onMounted(() => !isEmpty(props.modelValue) && syncCheckedValue());
  24241. __expose({
  24242. menuList,
  24243. menus,
  24244. checkedNodes,
  24245. handleKeyDown,
  24246. handleCheckChange,
  24247. getFlattedNodes,
  24248. getCheckedNodes,
  24249. clearCheckedNodes,
  24250. calculateCheckedValue,
  24251. scrollToExpandingNode,
  24252. loadLazyRootNodes
  24253. });
  24254. return (_ctx, _cache) => {
  24255. return openBlock(), createElementBlock("div", {
  24256. class: normalizeClass([unref(ns).b("panel"), unref(ns).is("bordered", __props.border)]),
  24257. onKeydown: handleKeyDown
  24258. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(menus.value, (menu, index) => {
  24259. return openBlock(), createBlock(menu_default$1, {
  24260. key: index,
  24261. ref_for: true,
  24262. ref: (item) => menuList.value[index] = item,
  24263. index,
  24264. nodes: [...menu]
  24265. }, {
  24266. empty: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
  24267. _: 3
  24268. }, 8, ["index", "nodes"]);
  24269. }), 128))], 34);
  24270. };
  24271. }
  24272. });
  24273. //#endregion
  24274. //#region ../../packages/components/cascader-panel/src/index.vue
  24275. var src_default$1 = index_vue_vue_type_script_setup_true_lang_default;
  24276. //#endregion
  24277. //#region ../../packages/components/cascader-panel/index.ts
  24278. const ElCascaderPanel = withInstall(src_default$1);
  24279. //#endregion
  24280. //#region ../../packages/components/cascader/src/cascader.ts
  24281. /**
  24282. * @deprecated Removed after 3.0.0, Use `CascaderComponentProps` instead.
  24283. */
  24284. const cascaderProps = buildProps({
  24285. ...CommonProps,
  24286. size: useSizeProp,
  24287. placeholder: String,
  24288. disabled: {
  24289. type: Boolean,
  24290. default: void 0
  24291. },
  24292. clearable: Boolean,
  24293. clearIcon: {
  24294. type: iconPropType,
  24295. default: circle_close_default
  24296. },
  24297. filterable: Boolean,
  24298. filterMethod: {
  24299. type: definePropType(Function),
  24300. default: (node, keyword) => node.text.includes(keyword)
  24301. },
  24302. separator: {
  24303. type: String,
  24304. default: " / "
  24305. },
  24306. showAllLevels: {
  24307. type: Boolean,
  24308. default: true
  24309. },
  24310. collapseTags: Boolean,
  24311. maxCollapseTags: {
  24312. type: Number,
  24313. default: 1
  24314. },
  24315. collapseTagsTooltip: Boolean,
  24316. maxCollapseTagsTooltipHeight: { type: [String, Number] },
  24317. debounce: {
  24318. type: Number,
  24319. default: 300
  24320. },
  24321. beforeFilter: {
  24322. type: definePropType(Function),
  24323. default: () => true
  24324. },
  24325. placement: {
  24326. type: definePropType(String),
  24327. values: Ee,
  24328. default: "bottom-start"
  24329. },
  24330. fallbackPlacements: {
  24331. type: definePropType(Array),
  24332. default: [
  24333. "bottom-start",
  24334. "bottom",
  24335. "top-start",
  24336. "top",
  24337. "right",
  24338. "left"
  24339. ]
  24340. },
  24341. popperClass: useTooltipContentProps.popperClass,
  24342. popperStyle: useTooltipContentProps.popperStyle,
  24343. teleported: useTooltipContentProps.teleported,
  24344. effect: {
  24345. type: definePropType(String),
  24346. default: "light"
  24347. },
  24348. tagType: {
  24349. ...tagProps.type,
  24350. default: "info"
  24351. },
  24352. tagEffect: {
  24353. ...tagProps.effect,
  24354. default: "light"
  24355. },
  24356. validateEvent: {
  24357. type: Boolean,
  24358. default: true
  24359. },
  24360. persistent: {
  24361. type: Boolean,
  24362. default: true
  24363. },
  24364. showCheckedStrategy: {
  24365. type: String,
  24366. values: ["parent", "child"],
  24367. default: "child"
  24368. },
  24369. checkOnClickNode: Boolean,
  24370. showPrefix: {
  24371. type: Boolean,
  24372. default: true
  24373. },
  24374. ...useEmptyValuesProps
  24375. });
  24376. const emitChangeFn$1 = (value) => true;
  24377. const cascaderEmits = {
  24378. [UPDATE_MODEL_EVENT]: emitChangeFn$1,
  24379. [CHANGE_EVENT]: emitChangeFn$1,
  24380. focus: (evt) => evt instanceof FocusEvent,
  24381. blur: (evt) => evt instanceof FocusEvent,
  24382. clear: () => true,
  24383. visibleChange: (val) => isBoolean(val),
  24384. expandChange: (val) => !!val,
  24385. removeTag: (val) => !!val
  24386. };
  24387. //#endregion
  24388. //#region ../../packages/components/cascader/src/cascader.vue?vue&type=script&setup=true&lang.ts
  24389. const _hoisted_1$57 = ["placeholder"];
  24390. const _hoisted_2$34 = ["onClick"];
  24391. var cascader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  24392. name: "ElCascader",
  24393. __name: "cascader",
  24394. props: cascaderProps,
  24395. emits: cascaderEmits,
  24396. setup(__props, { expose: __expose, emit: __emit }) {
  24397. const popperOptions = { modifiers: [{
  24398. name: "arrowPosition",
  24399. enabled: true,
  24400. phase: "main",
  24401. fn: ({ state }) => {
  24402. const { modifiersData, placement } = state;
  24403. if ([
  24404. "right",
  24405. "left",
  24406. "bottom",
  24407. "top"
  24408. ].includes(placement)) return;
  24409. if (modifiersData.arrow) modifiersData.arrow.x = 35;
  24410. },
  24411. requires: ["arrow"]
  24412. }] };
  24413. const props = __props;
  24414. const emit = __emit;
  24415. const attrs = useAttrs$1();
  24416. const slots = useSlots();
  24417. let inputInitialHeight = 0;
  24418. let pressDeleteCount = 0;
  24419. const nsCascader = useNamespace("cascader");
  24420. const nsInput = useNamespace("input");
  24421. const sizeMapPadding = {
  24422. small: 7,
  24423. default: 11,
  24424. large: 15
  24425. };
  24426. const { t } = useLocale();
  24427. const { formItem } = useFormItem();
  24428. const isDisabled = useFormDisabled();
  24429. const { valueOnClear } = useEmptyValues(props);
  24430. const { isComposing, handleComposition } = useComposition({ afterComposition(event) {
  24431. const text = event.target?.value;
  24432. handleInput(text);
  24433. } });
  24434. const tooltipRef = ref();
  24435. const tagTooltipRef = ref();
  24436. const inputRef = ref();
  24437. const tagWrapper = ref();
  24438. const cascaderPanelRef = ref();
  24439. const suggestionPanel = ref();
  24440. const popperVisible = ref(false);
  24441. const inputHover = ref(false);
  24442. const filtering = ref(false);
  24443. const inputValue = ref("");
  24444. const searchInputValue = ref("");
  24445. const tags = ref([]);
  24446. const suggestions = ref([]);
  24447. const showTagList = computed(() => {
  24448. if (!props.props.multiple) return [];
  24449. return props.collapseTags ? tags.value.slice(0, props.maxCollapseTags) : tags.value;
  24450. });
  24451. const collapseTagList = computed(() => {
  24452. if (!props.props.multiple) return [];
  24453. return props.collapseTags ? tags.value.slice(props.maxCollapseTags) : [];
  24454. });
  24455. const cascaderStyle = computed(() => {
  24456. return attrs.style;
  24457. });
  24458. const inputPlaceholder = computed(() => props.placeholder ?? t("el.cascader.placeholder"));
  24459. const currentPlaceholder = computed(() => searchInputValue.value || tags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value);
  24460. const realSize = useFormSize();
  24461. const tagSize = computed(() => realSize.value === "small" ? "small" : "default");
  24462. const multiple = computed(() => !!props.props.multiple);
  24463. const readonly = computed(() => !props.filterable || multiple.value);
  24464. const searchKeyword = computed(() => multiple.value ? searchInputValue.value : inputValue.value);
  24465. const checkedNodes = computed(() => cascaderPanelRef.value?.checkedNodes || []);
  24466. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  24467. disabled: isDisabled,
  24468. beforeBlur(event) {
  24469. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  24470. },
  24471. afterBlur() {
  24472. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  24473. }
  24474. });
  24475. const clearBtnVisible = computed(() => {
  24476. if (!props.clearable || isDisabled.value || filtering.value || !inputHover.value && !isFocused.value) return false;
  24477. return !!checkedNodes.value.length;
  24478. });
  24479. const presentText = computed(() => {
  24480. const { showAllLevels, separator } = props;
  24481. const nodes = checkedNodes.value;
  24482. return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
  24483. });
  24484. const validateState = computed(() => formItem?.validateState || "");
  24485. const checkedValue = computed({
  24486. get() {
  24487. return cloneDeep(props.modelValue);
  24488. },
  24489. set(val) {
  24490. const value = val ?? valueOnClear.value;
  24491. emit(UPDATE_MODEL_EVENT, value);
  24492. emit(CHANGE_EVENT, value);
  24493. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  24494. }
  24495. });
  24496. const cascaderKls = computed(() => {
  24497. return [
  24498. nsCascader.b(),
  24499. nsCascader.m(realSize.value),
  24500. nsCascader.is("disabled", isDisabled.value),
  24501. attrs.class
  24502. ];
  24503. });
  24504. const cascaderIconKls = computed(() => {
  24505. return [
  24506. nsInput.e("icon"),
  24507. "icon-arrow-down",
  24508. nsCascader.is("reverse", popperVisible.value)
  24509. ];
  24510. });
  24511. const inputClass = computed(() => nsCascader.is("focus", isFocused.value));
  24512. const contentRef = computed(() => {
  24513. return tooltipRef.value?.popperRef?.contentRef;
  24514. });
  24515. const handleClickOutside = (event) => {
  24516. if (isFocused.value) handleBlur(new FocusEvent("blur", event));
  24517. togglePopperVisible(false);
  24518. };
  24519. const togglePopperVisible = (visible) => {
  24520. if (isDisabled.value) return;
  24521. visible = visible ?? !popperVisible.value;
  24522. if (visible !== popperVisible.value) {
  24523. popperVisible.value = visible;
  24524. inputRef.value?.input?.setAttribute("aria-expanded", `${visible}`);
  24525. if (visible) {
  24526. updatePopperPosition();
  24527. cascaderPanelRef.value && nextTick(cascaderPanelRef.value.scrollToExpandingNode);
  24528. } else if (props.filterable) syncPresentTextValue();
  24529. emit("visibleChange", visible);
  24530. }
  24531. };
  24532. const updatePopperPosition = () => {
  24533. nextTick(() => {
  24534. tooltipRef.value?.updatePopper();
  24535. });
  24536. };
  24537. const hideSuggestionPanel = () => {
  24538. filtering.value = false;
  24539. };
  24540. const genTag = (node) => {
  24541. const { showAllLevels, separator } = props;
  24542. return {
  24543. node,
  24544. key: node.uid,
  24545. text: node.calcText(showAllLevels, separator),
  24546. hitState: false,
  24547. closable: !isDisabled.value && !node.isDisabled
  24548. };
  24549. };
  24550. const deleteTag = (tag) => {
  24551. const node = tag.node;
  24552. node.doCheck(false);
  24553. cascaderPanelRef.value?.calculateCheckedValue();
  24554. emit("removeTag", node.valueByOption);
  24555. };
  24556. const getStrategyCheckedNodes = () => {
  24557. switch (props.showCheckedStrategy) {
  24558. case "child": return checkedNodes.value;
  24559. case "parent": {
  24560. const clickedNodes = getCheckedNodes(false);
  24561. const clickedNodesValue = clickedNodes.map((o) => o.value);
  24562. return clickedNodes.filter((o) => !o.parent || !clickedNodesValue.includes(o.parent.value));
  24563. }
  24564. default: return [];
  24565. }
  24566. };
  24567. const calculatePresentTags = () => {
  24568. if (!multiple.value) return;
  24569. const nodes = getStrategyCheckedNodes();
  24570. const allTags = [];
  24571. nodes.forEach((node) => allTags.push(genTag(node)));
  24572. tags.value = allTags;
  24573. };
  24574. const calculateSuggestions = () => {
  24575. const { filterMethod, showAllLevels, separator } = props;
  24576. const res = cascaderPanelRef.value?.getFlattedNodes(!props.props.checkStrictly)?.filter((node) => {
  24577. if (node.isDisabled) return false;
  24578. node.calcText(showAllLevels, separator);
  24579. return filterMethod(node, searchKeyword.value);
  24580. });
  24581. if (multiple.value) tags.value.forEach((tag) => {
  24582. tag.hitState = false;
  24583. });
  24584. filtering.value = true;
  24585. suggestions.value = res;
  24586. updatePopperPosition();
  24587. };
  24588. const focusFirstNode = () => {
  24589. let firstNode;
  24590. if (filtering.value && suggestionPanel.value) firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
  24591. else firstNode = cascaderPanelRef.value?.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
  24592. if (firstNode) {
  24593. firstNode.focus();
  24594. !filtering.value && firstNode.click();
  24595. }
  24596. };
  24597. const updateStyle = () => {
  24598. const inputInner = inputRef.value?.input;
  24599. const tagWrapperEl = tagWrapper.value;
  24600. const suggestionPanelEl = suggestionPanel.value?.$el;
  24601. if (!isClient || !inputInner) return;
  24602. if (suggestionPanelEl) {
  24603. const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
  24604. suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
  24605. }
  24606. if (tagWrapperEl) {
  24607. const { offsetHeight } = tagWrapperEl;
  24608. const height = tags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`;
  24609. inputInner.style.height = height;
  24610. if (slots.prefix) {
  24611. const prefix = inputRef.value?.$el.querySelector(`.${nsInput.e("prefix")}`);
  24612. let left = 0;
  24613. if (prefix) {
  24614. left = prefix.offsetWidth;
  24615. if (left > 0) left += sizeMapPadding[realSize.value || "default"];
  24616. }
  24617. tagWrapperEl.style.left = `${left}px`;
  24618. } else tagWrapperEl.style.left = `0`;
  24619. updatePopperPosition();
  24620. }
  24621. };
  24622. const getCheckedNodes = (leafOnly) => {
  24623. return cascaderPanelRef.value?.getCheckedNodes(leafOnly);
  24624. };
  24625. const handleExpandChange = (value) => {
  24626. updatePopperPosition();
  24627. emit("expandChange", value);
  24628. };
  24629. const handleKeyDown = (e) => {
  24630. if (isComposing.value) return;
  24631. switch (getEventCode(e)) {
  24632. case EVENT_CODE.enter:
  24633. case EVENT_CODE.numpadEnter:
  24634. togglePopperVisible();
  24635. break;
  24636. case EVENT_CODE.down:
  24637. togglePopperVisible(true);
  24638. nextTick(focusFirstNode);
  24639. e.preventDefault();
  24640. break;
  24641. case EVENT_CODE.esc:
  24642. if (popperVisible.value === true) {
  24643. e.preventDefault();
  24644. e.stopPropagation();
  24645. togglePopperVisible(false);
  24646. }
  24647. break;
  24648. case EVENT_CODE.tab:
  24649. togglePopperVisible(false);
  24650. break;
  24651. }
  24652. };
  24653. const handleClear = () => {
  24654. cascaderPanelRef.value?.clearCheckedNodes();
  24655. if (!popperVisible.value && props.filterable) syncPresentTextValue();
  24656. togglePopperVisible(false);
  24657. emit("clear");
  24658. };
  24659. const syncPresentTextValue = () => {
  24660. const { value } = presentText;
  24661. inputValue.value = value;
  24662. searchInputValue.value = value;
  24663. };
  24664. const handleSuggestionClick = (node) => {
  24665. const { checked } = node;
  24666. if (multiple.value) cascaderPanelRef.value?.handleCheckChange(node, !checked, false);
  24667. else {
  24668. !checked && cascaderPanelRef.value?.handleCheckChange(node, true, false);
  24669. togglePopperVisible(false);
  24670. }
  24671. };
  24672. const handleSuggestionKeyDown = (e) => {
  24673. const target = e.target;
  24674. const code = getEventCode(e);
  24675. switch (code) {
  24676. case EVENT_CODE.up:
  24677. case EVENT_CODE.down:
  24678. e.preventDefault();
  24679. focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
  24680. break;
  24681. case EVENT_CODE.enter:
  24682. case EVENT_CODE.numpadEnter:
  24683. target.click();
  24684. break;
  24685. }
  24686. };
  24687. const handleDelete = () => {
  24688. const lastTag = tags.value[tags.value.length - 1];
  24689. pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
  24690. if (!lastTag || !pressDeleteCount || props.collapseTags && tags.value.length > 1) return;
  24691. if (lastTag.hitState) deleteTag(lastTag);
  24692. else lastTag.hitState = true;
  24693. };
  24694. const handleFilter = useDebounceFn(() => {
  24695. const { value } = searchKeyword;
  24696. if (!value) return;
  24697. const passed = props.beforeFilter(value);
  24698. if (isPromise(passed)) passed.then(calculateSuggestions).catch(() => {});
  24699. else if (passed !== false) calculateSuggestions();
  24700. else hideSuggestionPanel();
  24701. }, computed(() => props.debounce));
  24702. const handleInput = (val, e) => {
  24703. !popperVisible.value && togglePopperVisible(true);
  24704. if (e?.isComposing) return;
  24705. val ? handleFilter() : hideSuggestionPanel();
  24706. };
  24707. const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
  24708. const focus = () => {
  24709. inputRef.value?.focus();
  24710. };
  24711. const blur = () => {
  24712. inputRef.value?.blur();
  24713. };
  24714. watch(filtering, updatePopperPosition);
  24715. watch([
  24716. checkedNodes,
  24717. isDisabled,
  24718. () => props.collapseTags,
  24719. () => props.maxCollapseTags
  24720. ], calculatePresentTags);
  24721. watch(tags, () => {
  24722. nextTick(() => updateStyle());
  24723. });
  24724. watch(realSize, async () => {
  24725. await nextTick();
  24726. const inputInner = inputRef.value.input;
  24727. inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
  24728. updateStyle();
  24729. });
  24730. watch(presentText, syncPresentTextValue, { immediate: true });
  24731. watch(() => popperVisible.value, (val) => {
  24732. if (val && props.props.lazy && props.props.lazyLoad) cascaderPanelRef.value?.loadLazyRootNodes();
  24733. });
  24734. onMounted(() => {
  24735. const inputInner = inputRef.value.input;
  24736. const inputInnerHeight = getInputInnerHeight(inputInner);
  24737. inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
  24738. useResizeObserver(inputInner, updateStyle);
  24739. });
  24740. __expose({
  24741. getCheckedNodes,
  24742. cascaderPanelRef,
  24743. togglePopperVisible,
  24744. contentRef,
  24745. presentText,
  24746. focus,
  24747. blur
  24748. });
  24749. return (_ctx, _cache) => {
  24750. return openBlock(), createBlock(unref(ElTooltip), {
  24751. ref_key: "tooltipRef",
  24752. ref: tooltipRef,
  24753. visible: popperVisible.value,
  24754. teleported: __props.teleported,
  24755. "popper-class": [unref(nsCascader).e("dropdown"), __props.popperClass],
  24756. "popper-style": __props.popperStyle,
  24757. "popper-options": popperOptions,
  24758. "fallback-placements": __props.fallbackPlacements,
  24759. "stop-popper-mouse-event": false,
  24760. "gpu-acceleration": false,
  24761. placement: __props.placement,
  24762. transition: `${unref(nsCascader).namespace.value}-zoom-in-top`,
  24763. effect: __props.effect,
  24764. pure: "",
  24765. persistent: __props.persistent,
  24766. onHide: hideSuggestionPanel
  24767. }, {
  24768. default: withCtx(() => [withDirectives((openBlock(), createElementBlock("div", {
  24769. ref_key: "wrapperRef",
  24770. ref: wrapperRef,
  24771. class: normalizeClass(cascaderKls.value),
  24772. style: normalizeStyle(cascaderStyle.value),
  24773. onClick: _cache[8] || (_cache[8] = () => togglePopperVisible(readonly.value ? void 0 : true)),
  24774. onKeydown: handleKeyDown,
  24775. onMouseenter: _cache[9] || (_cache[9] = ($event) => inputHover.value = true),
  24776. onMouseleave: _cache[10] || (_cache[10] = ($event) => inputHover.value = false)
  24777. }, [createVNode(unref(ElInput), {
  24778. ref_key: "inputRef",
  24779. ref: inputRef,
  24780. modelValue: inputValue.value,
  24781. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
  24782. placeholder: currentPlaceholder.value,
  24783. readonly: readonly.value,
  24784. disabled: unref(isDisabled),
  24785. "validate-event": false,
  24786. size: unref(realSize),
  24787. class: normalizeClass(inputClass.value),
  24788. tabindex: multiple.value && __props.filterable && !unref(isDisabled) ? -1 : void 0,
  24789. onCompositionstart: unref(handleComposition),
  24790. onCompositionupdate: unref(handleComposition),
  24791. onCompositionend: unref(handleComposition),
  24792. onInput: handleInput
  24793. }, createSlots({
  24794. suffix: withCtx(() => [clearBtnVisible.value ? (openBlock(), createBlock(unref(ElIcon), {
  24795. key: "clear",
  24796. class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]),
  24797. onClick: withModifiers(handleClear, ["stop"])
  24798. }, {
  24799. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]),
  24800. _: 1
  24801. }, 8, ["class"])) : (openBlock(), createBlock(unref(ElIcon), {
  24802. key: "arrow-down",
  24803. class: normalizeClass(cascaderIconKls.value),
  24804. onClick: _cache[0] || (_cache[0] = withModifiers(($event) => togglePopperVisible(), ["stop"]))
  24805. }, {
  24806. default: withCtx(() => [createVNode(unref(arrow_down_default))]),
  24807. _: 1
  24808. }, 8, ["class"]))]),
  24809. _: 2
  24810. }, [_ctx.$slots.prefix ? {
  24811. name: "prefix",
  24812. fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
  24813. key: "0"
  24814. } : void 0]), 1032, [
  24815. "modelValue",
  24816. "placeholder",
  24817. "readonly",
  24818. "disabled",
  24819. "size",
  24820. "class",
  24821. "tabindex",
  24822. "onCompositionstart",
  24823. "onCompositionupdate",
  24824. "onCompositionend"
  24825. ]), multiple.value ? (openBlock(), createElementBlock("div", {
  24826. key: 0,
  24827. ref_key: "tagWrapper",
  24828. ref: tagWrapper,
  24829. class: normalizeClass([unref(nsCascader).e("tags"), unref(nsCascader).is("validate", Boolean(validateState.value))])
  24830. }, [
  24831. renderSlot(_ctx.$slots, "tag", {
  24832. data: tags.value,
  24833. deleteTag
  24834. }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(showTagList.value, (tag) => {
  24835. return openBlock(), createBlock(unref(ElTag), {
  24836. key: tag.key,
  24837. type: __props.tagType,
  24838. size: tagSize.value,
  24839. effect: __props.tagEffect,
  24840. hit: tag.hitState,
  24841. closable: tag.closable,
  24842. "disable-transitions": "",
  24843. onClose: ($event) => deleteTag(tag)
  24844. }, {
  24845. default: withCtx(() => [createElementVNode("span", null, toDisplayString(tag.text), 1)]),
  24846. _: 2
  24847. }, 1032, [
  24848. "type",
  24849. "size",
  24850. "effect",
  24851. "hit",
  24852. "closable",
  24853. "onClose"
  24854. ]);
  24855. }), 128))]),
  24856. __props.collapseTags && tags.value.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), {
  24857. key: 0,
  24858. ref_key: "tagTooltipRef",
  24859. ref: tagTooltipRef,
  24860. disabled: popperVisible.value || !__props.collapseTagsTooltip,
  24861. "fallback-placements": [
  24862. "bottom",
  24863. "top",
  24864. "right",
  24865. "left"
  24866. ],
  24867. placement: "bottom",
  24868. "popper-class": __props.popperClass,
  24869. "popper-style": __props.popperStyle,
  24870. effect: __props.effect,
  24871. persistent: __props.persistent
  24872. }, {
  24873. default: withCtx(() => [createVNode(unref(ElTag), {
  24874. closable: false,
  24875. size: tagSize.value,
  24876. type: __props.tagType,
  24877. effect: __props.tagEffect,
  24878. "disable-transitions": ""
  24879. }, {
  24880. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(unref(nsCascader).e("tags-text")) }, " + " + toDisplayString(tags.value.length - __props.maxCollapseTags), 3)]),
  24881. _: 1
  24882. }, 8, [
  24883. "size",
  24884. "type",
  24885. "effect"
  24886. ])]),
  24887. content: withCtx(() => [createVNode(unref(ElScrollbar), { "max-height": __props.maxCollapseTagsTooltipHeight }, {
  24888. default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(nsCascader).e("collapse-tags")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(collapseTagList.value, (tag, idx) => {
  24889. return openBlock(), createElementBlock("div", {
  24890. key: idx,
  24891. class: normalizeClass(unref(nsCascader).e("collapse-tag"))
  24892. }, [(openBlock(), createBlock(unref(ElTag), {
  24893. key: tag.key,
  24894. class: "in-tooltip",
  24895. type: __props.tagType,
  24896. size: tagSize.value,
  24897. effect: __props.tagEffect,
  24898. hit: tag.hitState,
  24899. closable: tag.closable,
  24900. "disable-transitions": "",
  24901. onClose: ($event) => deleteTag(tag)
  24902. }, {
  24903. default: withCtx(() => [createElementVNode("span", null, toDisplayString(tag.text), 1)]),
  24904. _: 2
  24905. }, 1032, [
  24906. "type",
  24907. "size",
  24908. "effect",
  24909. "hit",
  24910. "closable",
  24911. "onClose"
  24912. ]))], 2);
  24913. }), 128))], 2)]),
  24914. _: 1
  24915. }, 8, ["max-height"])]),
  24916. _: 1
  24917. }, 8, [
  24918. "disabled",
  24919. "popper-class",
  24920. "popper-style",
  24921. "effect",
  24922. "persistent"
  24923. ])) : createCommentVNode("v-if", true),
  24924. __props.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", {
  24925. key: 1,
  24926. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchInputValue.value = $event),
  24927. type: "text",
  24928. class: normalizeClass(unref(nsCascader).e("search-input")),
  24929. placeholder: presentText.value ? "" : inputPlaceholder.value,
  24930. onInput: _cache[3] || (_cache[3] = (e) => handleInput(searchInputValue.value, e)),
  24931. onClick: _cache[4] || (_cache[4] = withModifiers(($event) => togglePopperVisible(true), ["stop"])),
  24932. onKeydown: withKeys(handleDelete, ["delete"]),
  24933. onCompositionstart: _cache[5] || (_cache[5] = (...args) => unref(handleComposition) && unref(handleComposition)(...args)),
  24934. onCompositionupdate: _cache[6] || (_cache[6] = (...args) => unref(handleComposition) && unref(handleComposition)(...args)),
  24935. onCompositionend: _cache[7] || (_cache[7] = (...args) => unref(handleComposition) && unref(handleComposition)(...args))
  24936. }, null, 42, _hoisted_1$57)), [[vModelText, searchInputValue.value]]) : createCommentVNode("v-if", true)
  24937. ], 2)) : createCommentVNode("v-if", true)], 38)), [[
  24938. unref(ClickOutside),
  24939. handleClickOutside,
  24940. contentRef.value
  24941. ]])]),
  24942. content: withCtx(() => [
  24943. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  24944. key: 0,
  24945. class: normalizeClass(unref(nsCascader).e("header")),
  24946. onClick: _cache[11] || (_cache[11] = withModifiers(() => {}, ["stop"]))
  24947. }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true),
  24948. withDirectives(createVNode(unref(ElCascaderPanel), {
  24949. ref_key: "cascaderPanelRef",
  24950. ref: cascaderPanelRef,
  24951. modelValue: checkedValue.value,
  24952. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => checkedValue.value = $event),
  24953. options: __props.options,
  24954. props: props.props,
  24955. border: false,
  24956. "render-label": _ctx.$slots.default,
  24957. onExpandChange: handleExpandChange,
  24958. onClose: _cache[13] || (_cache[13] = ($event) => _ctx.$nextTick(() => togglePopperVisible(false)))
  24959. }, {
  24960. empty: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
  24961. _: 3
  24962. }, 8, [
  24963. "modelValue",
  24964. "options",
  24965. "props",
  24966. "render-label"
  24967. ]), [[vShow, !filtering.value]]),
  24968. __props.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
  24969. key: 1,
  24970. ref_key: "suggestionPanel",
  24971. ref: suggestionPanel,
  24972. tag: "ul",
  24973. class: normalizeClass(unref(nsCascader).e("suggestion-panel")),
  24974. "view-class": unref(nsCascader).e("suggestion-list"),
  24975. onKeydown: handleSuggestionKeyDown
  24976. }, {
  24977. default: withCtx(() => [suggestions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(suggestions.value, (item) => {
  24978. return openBlock(), createElementBlock("li", {
  24979. key: item.uid,
  24980. class: normalizeClass([unref(nsCascader).e("suggestion-item"), unref(nsCascader).is("checked", item.checked)]),
  24981. tabindex: -1,
  24982. onClick: ($event) => handleSuggestionClick(item)
  24983. }, [renderSlot(_ctx.$slots, "suggestion-item", { item }, () => [createElementVNode("span", null, toDisplayString(item.text), 1), item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  24984. default: withCtx(() => [createVNode(unref(check_default))]),
  24985. _: 1
  24986. })) : createCommentVNode("v-if", true)])], 10, _hoisted_2$34);
  24987. }), 128)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [createElementVNode("li", { class: normalizeClass(unref(nsCascader).e("empty-text")) }, toDisplayString(unref(t)("el.cascader.noMatch")), 3)])]),
  24988. _: 3
  24989. }, 8, ["class", "view-class"])), [[vShow, filtering.value]]) : createCommentVNode("v-if", true),
  24990. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  24991. key: 2,
  24992. class: normalizeClass(unref(nsCascader).e("footer")),
  24993. onClick: _cache[14] || (_cache[14] = withModifiers(() => {}, ["stop"]))
  24994. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  24995. ]),
  24996. _: 3
  24997. }, 8, [
  24998. "visible",
  24999. "teleported",
  25000. "popper-class",
  25001. "popper-style",
  25002. "fallback-placements",
  25003. "placement",
  25004. "transition",
  25005. "effect",
  25006. "persistent"
  25007. ]);
  25008. };
  25009. }
  25010. });
  25011. //#endregion
  25012. //#region ../../packages/components/cascader/src/cascader.vue
  25013. var cascader_default = cascader_vue_vue_type_script_setup_true_lang_default;
  25014. //#endregion
  25015. //#region ../../packages/components/cascader/index.ts
  25016. const ElCascader = withInstall(cascader_default);
  25017. //#endregion
  25018. //#region ../../packages/components/check-tag/src/check-tag.ts
  25019. /**
  25020. * @deprecated Removed after 3.0.0, Use `CheckTagProps` instead.
  25021. */
  25022. const checkTagProps = buildProps({
  25023. checked: Boolean,
  25024. disabled: Boolean,
  25025. type: {
  25026. type: String,
  25027. values: [
  25028. "primary",
  25029. "success",
  25030. "info",
  25031. "warning",
  25032. "danger"
  25033. ],
  25034. default: "primary"
  25035. }
  25036. });
  25037. const checkTagEmits = {
  25038. "update:checked": (value) => isBoolean(value),
  25039. [CHANGE_EVENT]: (value) => isBoolean(value)
  25040. };
  25041. //#endregion
  25042. //#region ../../packages/components/check-tag/src/check-tag.vue?vue&type=script&setup=true&lang.ts
  25043. var check_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25044. name: "ElCheckTag",
  25045. __name: "check-tag",
  25046. props: checkTagProps,
  25047. emits: checkTagEmits,
  25048. setup(__props, { emit: __emit }) {
  25049. const props = __props;
  25050. const emit = __emit;
  25051. const ns = useNamespace("check-tag");
  25052. const containerKls = computed(() => [
  25053. ns.b(),
  25054. ns.is("checked", props.checked),
  25055. ns.is("disabled", props.disabled),
  25056. ns.m(props.type || "primary")
  25057. ]);
  25058. const handleChange = () => {
  25059. if (props.disabled) return;
  25060. const checked = !props.checked;
  25061. emit(CHANGE_EVENT, checked);
  25062. emit("update:checked", checked);
  25063. };
  25064. return (_ctx, _cache) => {
  25065. return openBlock(), createElementBlock("span", {
  25066. class: normalizeClass(containerKls.value),
  25067. onClick: handleChange
  25068. }, [renderSlot(_ctx.$slots, "default")], 2);
  25069. };
  25070. }
  25071. });
  25072. //#endregion
  25073. //#region ../../packages/components/check-tag/src/check-tag.vue
  25074. var check_tag_default = check_tag_vue_vue_type_script_setup_true_lang_default;
  25075. //#endregion
  25076. //#region ../../packages/components/check-tag/index.ts
  25077. const ElCheckTag = withInstall(check_tag_default);
  25078. //#endregion
  25079. //#region ../../packages/components/col/src/col.ts
  25080. /**
  25081. * @deprecated Removed after 3.0.0, Use `ColProps` instead.
  25082. */
  25083. const colProps = buildProps({
  25084. tag: {
  25085. type: String,
  25086. default: "div"
  25087. },
  25088. span: {
  25089. type: Number,
  25090. default: 24
  25091. },
  25092. offset: {
  25093. type: Number,
  25094. default: 0
  25095. },
  25096. pull: {
  25097. type: Number,
  25098. default: 0
  25099. },
  25100. push: {
  25101. type: Number,
  25102. default: 0
  25103. },
  25104. xs: {
  25105. type: definePropType([Number, Object]),
  25106. default: () => mutable({})
  25107. },
  25108. sm: {
  25109. type: definePropType([Number, Object]),
  25110. default: () => mutable({})
  25111. },
  25112. md: {
  25113. type: definePropType([Number, Object]),
  25114. default: () => mutable({})
  25115. },
  25116. lg: {
  25117. type: definePropType([Number, Object]),
  25118. default: () => mutable({})
  25119. },
  25120. xl: {
  25121. type: definePropType([Number, Object]),
  25122. default: () => mutable({})
  25123. }
  25124. });
  25125. //#endregion
  25126. //#region ../../packages/components/row/src/row.ts
  25127. const RowJustify = [
  25128. "start",
  25129. "center",
  25130. "end",
  25131. "space-around",
  25132. "space-between",
  25133. "space-evenly"
  25134. ];
  25135. const RowAlign = [
  25136. "top",
  25137. "middle",
  25138. "bottom"
  25139. ];
  25140. /**
  25141. * @deprecated Removed after 3.0.0, Use `RowProps` instead.
  25142. */
  25143. const rowProps = buildProps({
  25144. tag: {
  25145. type: String,
  25146. default: "div"
  25147. },
  25148. gutter: {
  25149. type: Number,
  25150. default: 0
  25151. },
  25152. justify: {
  25153. type: String,
  25154. values: RowJustify,
  25155. default: "start"
  25156. },
  25157. align: {
  25158. type: String,
  25159. values: RowAlign
  25160. }
  25161. });
  25162. //#endregion
  25163. //#region ../../packages/components/row/src/constants.ts
  25164. const rowContextKey = Symbol("rowContextKey");
  25165. //#endregion
  25166. //#region ../../packages/components/row/src/row.vue?vue&type=script&setup=true&lang.ts
  25167. var row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25168. name: "ElRow",
  25169. __name: "row",
  25170. props: rowProps,
  25171. setup(__props) {
  25172. const props = __props;
  25173. const ns = useNamespace("row");
  25174. provide(rowContextKey, { gutter: computed(() => props.gutter) });
  25175. const style = computed(() => {
  25176. const styles = {};
  25177. if (!props.gutter) return styles;
  25178. styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
  25179. return styles;
  25180. });
  25181. const rowKls = computed(() => [
  25182. ns.b(),
  25183. ns.is(`justify-${props.justify}`, props.justify !== "start"),
  25184. ns.is(`align-${props.align}`, !!props.align)
  25185. ]);
  25186. return (_ctx, _cache) => {
  25187. return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
  25188. class: normalizeClass(rowKls.value),
  25189. style: normalizeStyle(style.value)
  25190. }, {
  25191. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  25192. _: 3
  25193. }, 8, ["class", "style"]);
  25194. };
  25195. }
  25196. });
  25197. //#endregion
  25198. //#region ../../packages/components/row/src/row.vue
  25199. var row_default = row_vue_vue_type_script_setup_true_lang_default;
  25200. //#endregion
  25201. //#region ../../packages/components/row/index.ts
  25202. const ElRow = withInstall(row_default);
  25203. //#endregion
  25204. //#region ../../packages/components/col/src/col.vue?vue&type=script&setup=true&lang.ts
  25205. var col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25206. name: "ElCol",
  25207. __name: "col",
  25208. props: colProps,
  25209. setup(__props) {
  25210. const props = __props;
  25211. const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) });
  25212. const ns = useNamespace("col");
  25213. const style = computed(() => {
  25214. const styles = {};
  25215. if (gutter.value) styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
  25216. return styles;
  25217. });
  25218. const colKls = computed(() => {
  25219. const classes = [];
  25220. [
  25221. "span",
  25222. "offset",
  25223. "pull",
  25224. "push"
  25225. ].forEach((prop) => {
  25226. const size = props[prop];
  25227. if (isNumber(size)) {
  25228. if (prop === "span") classes.push(ns.b(`${props[prop]}`));
  25229. else if (size > 0) classes.push(ns.b(`${prop}-${props[prop]}`));
  25230. }
  25231. });
  25232. [
  25233. "xs",
  25234. "sm",
  25235. "md",
  25236. "lg",
  25237. "xl"
  25238. ].forEach((size) => {
  25239. if (isNumber(props[size])) classes.push(ns.b(`${size}-${props[size]}`));
  25240. else if (isObject$1(props[size])) Object.entries(props[size]).forEach(([prop, sizeProp]) => {
  25241. classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
  25242. });
  25243. });
  25244. if (gutter.value) classes.push(ns.is("guttered"));
  25245. return [ns.b(), classes];
  25246. });
  25247. return (_ctx, _cache) => {
  25248. return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
  25249. class: normalizeClass(colKls.value),
  25250. style: normalizeStyle(style.value)
  25251. }, {
  25252. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  25253. _: 3
  25254. }, 8, ["class", "style"]);
  25255. };
  25256. }
  25257. });
  25258. //#endregion
  25259. //#region ../../packages/components/col/src/col.vue
  25260. var col_default = col_vue_vue_type_script_setup_true_lang_default;
  25261. //#endregion
  25262. //#region ../../packages/components/col/index.ts
  25263. const ElCol = withInstall(col_default);
  25264. //#endregion
  25265. //#region ../../packages/components/collapse/src/collapse.ts
  25266. const emitChangeFn = (value) => isNumber(value) || isString(value) || isArray$1(value);
  25267. /**
  25268. * @deprecated Removed after 3.0.0, Use `CollapseProps` instead.
  25269. */
  25270. const collapseProps = buildProps({
  25271. accordion: Boolean,
  25272. modelValue: {
  25273. type: definePropType([
  25274. Array,
  25275. String,
  25276. Number
  25277. ]),
  25278. default: () => mutable([])
  25279. },
  25280. expandIconPosition: {
  25281. type: definePropType([String]),
  25282. default: "right"
  25283. },
  25284. beforeCollapse: { type: definePropType(Function) }
  25285. });
  25286. const collapseEmits = {
  25287. [UPDATE_MODEL_EVENT]: emitChangeFn,
  25288. [CHANGE_EVENT]: emitChangeFn
  25289. };
  25290. //#endregion
  25291. //#region ../../packages/components/collapse/src/constants.ts
  25292. const collapseContextKey = Symbol("collapseContextKey");
  25293. //#endregion
  25294. //#region ../../packages/components/collapse/src/use-collapse.ts
  25295. const SCOPE$4 = "ElCollapse";
  25296. const useCollapse = (props, emit) => {
  25297. const activeNames = ref(castArray$1(props.modelValue));
  25298. const setActiveNames = (_activeNames) => {
  25299. activeNames.value = _activeNames;
  25300. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  25301. emit(UPDATE_MODEL_EVENT, value);
  25302. emit(CHANGE_EVENT, value);
  25303. };
  25304. const handleChange = (name) => {
  25305. if (props.accordion) setActiveNames([activeNames.value[0] === name ? "" : name]);
  25306. else {
  25307. const _activeNames = [...activeNames.value];
  25308. const index = _activeNames.indexOf(name);
  25309. if (index > -1) _activeNames.splice(index, 1);
  25310. else _activeNames.push(name);
  25311. setActiveNames(_activeNames);
  25312. }
  25313. };
  25314. const handleItemClick = async (name) => {
  25315. const { beforeCollapse } = props;
  25316. if (!beforeCollapse) {
  25317. handleChange(name);
  25318. return;
  25319. }
  25320. const shouldChange = beforeCollapse(name);
  25321. if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(SCOPE$4, "beforeCollapse must return type `Promise<boolean>` or `boolean`");
  25322. if (isPromise(shouldChange)) shouldChange.then((result) => {
  25323. if (result !== false) handleChange(name);
  25324. }).catch((e) => {
  25325. /* @__PURE__ */ debugWarn(SCOPE$4, `some error occurred: ${e}`);
  25326. });
  25327. else if (shouldChange) handleChange(name);
  25328. };
  25329. watch(() => props.modelValue, () => activeNames.value = castArray$1(props.modelValue), { deep: true });
  25330. provide(collapseContextKey, {
  25331. activeNames,
  25332. handleItemClick
  25333. });
  25334. return {
  25335. activeNames,
  25336. setActiveNames
  25337. };
  25338. };
  25339. const useCollapseDOM = (props) => {
  25340. const ns = useNamespace("collapse");
  25341. return { rootKls: computed(() => [ns.b(), ns.b(`icon-position-${props.expandIconPosition}`)]) };
  25342. };
  25343. //#endregion
  25344. //#region ../../packages/components/collapse/src/collapse.vue?vue&type=script&setup=true&lang.ts
  25345. var collapse_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25346. name: "ElCollapse",
  25347. __name: "collapse",
  25348. props: collapseProps,
  25349. emits: collapseEmits,
  25350. setup(__props, { expose: __expose, emit: __emit }) {
  25351. const props = __props;
  25352. const { activeNames, setActiveNames } = useCollapse(props, __emit);
  25353. const { rootKls } = useCollapseDOM(props);
  25354. __expose({
  25355. activeNames,
  25356. setActiveNames
  25357. });
  25358. return (_ctx, _cache) => {
  25359. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [renderSlot(_ctx.$slots, "default")], 2);
  25360. };
  25361. }
  25362. });
  25363. //#endregion
  25364. //#region ../../packages/components/collapse/src/collapse.vue
  25365. var collapse_default = collapse_vue_vue_type_script_setup_true_lang_default;
  25366. //#endregion
  25367. //#region ../../packages/components/collapse/src/collapse-item.ts
  25368. /**
  25369. * @deprecated Removed after 3.0.0, Use `CollapseItemProps` instead.
  25370. */
  25371. const collapseItemProps = buildProps({
  25372. title: {
  25373. type: String,
  25374. default: ""
  25375. },
  25376. name: {
  25377. type: definePropType([String, Number]),
  25378. default: void 0
  25379. },
  25380. icon: {
  25381. type: iconPropType,
  25382. default: arrow_right_default
  25383. },
  25384. disabled: Boolean
  25385. });
  25386. //#endregion
  25387. //#region ../../packages/components/collapse-transition/src/collapse-transition.vue?vue&type=script&setup=true&lang.ts
  25388. var collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25389. name: "ElCollapseTransition",
  25390. __name: "collapse-transition",
  25391. setup(__props) {
  25392. const ns = useNamespace("collapse-transition");
  25393. const reset = (el) => {
  25394. el.style.maxHeight = "";
  25395. el.style.overflow = el.dataset.oldOverflow;
  25396. el.style.paddingTop = el.dataset.oldPaddingTop;
  25397. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  25398. };
  25399. const on = {
  25400. beforeEnter(el) {
  25401. if (!el.dataset) el.dataset = {};
  25402. el.dataset.oldPaddingTop = el.style.paddingTop;
  25403. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  25404. if (el.style.height) el.dataset.elExistsHeight = el.style.height;
  25405. el.style.maxHeight = 0;
  25406. el.style.paddingTop = 0;
  25407. el.style.paddingBottom = 0;
  25408. },
  25409. enter(el) {
  25410. requestAnimationFrame(() => {
  25411. el.dataset.oldOverflow = el.style.overflow;
  25412. if (el.dataset.elExistsHeight) el.style.maxHeight = el.dataset.elExistsHeight;
  25413. else if (el.scrollHeight !== 0) el.style.maxHeight = `${el.scrollHeight}px`;
  25414. else el.style.maxHeight = 0;
  25415. el.style.paddingTop = el.dataset.oldPaddingTop;
  25416. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  25417. el.style.overflow = "hidden";
  25418. });
  25419. },
  25420. afterEnter(el) {
  25421. el.style.maxHeight = "";
  25422. el.style.overflow = el.dataset.oldOverflow;
  25423. },
  25424. enterCancelled(el) {
  25425. reset(el);
  25426. },
  25427. beforeLeave(el) {
  25428. if (!el.dataset) el.dataset = {};
  25429. el.dataset.oldPaddingTop = el.style.paddingTop;
  25430. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  25431. el.dataset.oldOverflow = el.style.overflow;
  25432. el.style.maxHeight = `${el.scrollHeight}px`;
  25433. el.style.overflow = "hidden";
  25434. },
  25435. leave(el) {
  25436. if (el.scrollHeight !== 0) {
  25437. el.style.maxHeight = 0;
  25438. el.style.paddingTop = 0;
  25439. el.style.paddingBottom = 0;
  25440. }
  25441. },
  25442. afterLeave(el) {
  25443. reset(el);
  25444. },
  25445. leaveCancelled(el) {
  25446. reset(el);
  25447. }
  25448. };
  25449. return (_ctx, _cache) => {
  25450. return openBlock(), createBlock(Transition, mergeProps({ name: unref(ns).b() }, toHandlers(on)), {
  25451. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  25452. _: 3
  25453. }, 16, ["name"]);
  25454. };
  25455. }
  25456. });
  25457. //#endregion
  25458. //#region ../../packages/components/collapse-transition/src/collapse-transition.vue
  25459. var collapse_transition_default = collapse_transition_vue_vue_type_script_setup_true_lang_default;
  25460. //#endregion
  25461. //#region ../../packages/components/collapse-transition/index.ts
  25462. const ElCollapseTransition = withInstall(collapse_transition_default);
  25463. //#endregion
  25464. //#region ../../packages/components/collapse/src/use-collapse-item.ts
  25465. const useCollapseItem = (props) => {
  25466. const collapse = inject(collapseContextKey);
  25467. const { namespace } = useNamespace("collapse");
  25468. const focusing = ref(false);
  25469. const isClick = ref(false);
  25470. const idInjection = useIdInjection();
  25471. const id = computed(() => idInjection.current++);
  25472. const name = computed(() => {
  25473. return props.name ?? `${namespace.value}-id-${idInjection.prefix}-${unref(id)}`;
  25474. });
  25475. const isActive = computed(() => collapse?.activeNames.value.includes(unref(name)));
  25476. const handleFocus = () => {
  25477. setTimeout(() => {
  25478. if (!isClick.value) focusing.value = true;
  25479. else isClick.value = false;
  25480. }, 50);
  25481. };
  25482. const handleHeaderClick = (e) => {
  25483. if (props.disabled) return;
  25484. if (e.target?.closest("input, textarea, select")) return;
  25485. collapse?.handleItemClick(unref(name));
  25486. focusing.value = false;
  25487. isClick.value = true;
  25488. };
  25489. const handleEnterClick = (e) => {
  25490. if (e.target?.closest("input, textarea, select")) return;
  25491. e.preventDefault();
  25492. collapse?.handleItemClick(unref(name));
  25493. };
  25494. return {
  25495. focusing,
  25496. id,
  25497. isActive,
  25498. handleFocus,
  25499. handleHeaderClick,
  25500. handleEnterClick
  25501. };
  25502. };
  25503. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  25504. const ns = useNamespace("collapse");
  25505. const rootKls = computed(() => [
  25506. ns.b("item"),
  25507. ns.is("active", unref(isActive)),
  25508. ns.is("disabled", props.disabled)
  25509. ]);
  25510. const headKls = computed(() => [
  25511. ns.be("item", "header"),
  25512. ns.is("active", unref(isActive)),
  25513. { focusing: unref(focusing) && !props.disabled }
  25514. ]);
  25515. const arrowKls = computed(() => [ns.be("item", "arrow"), ns.is("active", unref(isActive))]);
  25516. return {
  25517. itemTitleKls: computed(() => [ns.be("item", "title")]),
  25518. arrowKls,
  25519. headKls,
  25520. rootKls,
  25521. itemWrapperKls: computed(() => ns.be("item", "wrap")),
  25522. itemContentKls: computed(() => ns.be("item", "content")),
  25523. scopedContentId: computed(() => ns.b(`content-${unref(id)}`)),
  25524. scopedHeadId: computed(() => ns.b(`head-${unref(id)}`))
  25525. };
  25526. };
  25527. //#endregion
  25528. //#region ../../packages/components/collapse/src/collapse-item.vue?vue&type=script&setup=true&lang.ts
  25529. const _hoisted_1$56 = [
  25530. "id",
  25531. "aria-expanded",
  25532. "aria-controls",
  25533. "aria-describedby",
  25534. "tabindex",
  25535. "aria-disabled"
  25536. ];
  25537. const _hoisted_2$33 = [
  25538. "id",
  25539. "aria-hidden",
  25540. "aria-labelledby"
  25541. ];
  25542. var collapse_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25543. name: "ElCollapseItem",
  25544. __name: "collapse-item",
  25545. props: collapseItemProps,
  25546. setup(__props, { expose: __expose }) {
  25547. const props = __props;
  25548. const { focusing, id, isActive, handleFocus, handleHeaderClick, handleEnterClick } = useCollapseItem(props);
  25549. const { arrowKls, headKls, rootKls, itemTitleKls, itemWrapperKls, itemContentKls, scopedContentId, scopedHeadId } = useCollapseItemDOM(props, {
  25550. focusing,
  25551. isActive,
  25552. id
  25553. });
  25554. __expose({ isActive });
  25555. return (_ctx, _cache) => {
  25556. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createElementVNode("div", {
  25557. id: unref(scopedHeadId),
  25558. class: normalizeClass(unref(headKls)),
  25559. "aria-expanded": unref(isActive),
  25560. "aria-controls": unref(scopedContentId),
  25561. "aria-describedby": unref(scopedContentId),
  25562. tabindex: __props.disabled ? void 0 : 0,
  25563. "aria-disabled": __props.disabled,
  25564. role: "button",
  25565. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
  25566. onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop"]), ["space", "enter"])),
  25567. onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  25568. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  25569. }, [createElementVNode("span", { class: normalizeClass(unref(itemTitleKls)) }, [renderSlot(_ctx.$slots, "title", { isActive: unref(isActive) }, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), renderSlot(_ctx.$slots, "icon", { isActive: unref(isActive) }, () => [createVNode(unref(ElIcon), { class: normalizeClass(unref(arrowKls)) }, {
  25570. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  25571. _: 1
  25572. }, 8, ["class"])])], 42, _hoisted_1$56), createVNode(unref(ElCollapseTransition), null, {
  25573. default: withCtx(() => [withDirectives(createElementVNode("div", {
  25574. id: unref(scopedContentId),
  25575. role: "region",
  25576. class: normalizeClass(unref(itemWrapperKls)),
  25577. "aria-hidden": !unref(isActive),
  25578. "aria-labelledby": unref(scopedHeadId)
  25579. }, [createElementVNode("div", { class: normalizeClass(unref(itemContentKls)) }, [renderSlot(_ctx.$slots, "default")], 2)], 10, _hoisted_2$33), [[vShow, unref(isActive)]])]),
  25580. _: 3
  25581. })], 2);
  25582. };
  25583. }
  25584. });
  25585. //#endregion
  25586. //#region ../../packages/components/collapse/src/collapse-item.vue
  25587. var collapse_item_default = collapse_item_vue_vue_type_script_setup_true_lang_default;
  25588. //#endregion
  25589. //#region ../../packages/components/collapse/index.ts
  25590. const ElCollapse = withInstall(collapse_default, { CollapseItem: collapse_item_default });
  25591. const ElCollapseItem = withNoopInstall(collapse_item_default);
  25592. //#endregion
  25593. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.ts
  25594. /**
  25595. * @deprecated Removed after 3.0.0, Use `ColorPickerPanelProps` instead.
  25596. */
  25597. const colorPickerPanelProps = buildProps({
  25598. modelValue: {
  25599. type: definePropType(String),
  25600. default: void 0
  25601. },
  25602. border: {
  25603. type: Boolean,
  25604. default: true
  25605. },
  25606. showAlpha: Boolean,
  25607. colorFormat: { type: definePropType(String) },
  25608. disabled: Boolean,
  25609. predefine: { type: definePropType(Array) },
  25610. validateEvent: {
  25611. type: Boolean,
  25612. default: true
  25613. }
  25614. });
  25615. const colorPickerPanelEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val) };
  25616. const ROOT_COMMON_COLOR_INJECTION_KEY = Symbol("colorCommonPickerKey");
  25617. const colorPickerPanelContextKey = Symbol("colorPickerPanelContextKey");
  25618. //#endregion
  25619. //#region ../../packages/components/color-picker-panel/src/props/slider.ts
  25620. /**
  25621. * @deprecated Removed after 3.0.0, Use `AlphaSliderProps` instead.
  25622. */
  25623. const alphaSliderProps = buildProps({
  25624. color: {
  25625. type: definePropType(Object),
  25626. required: true
  25627. },
  25628. vertical: Boolean,
  25629. disabled: Boolean
  25630. });
  25631. /**
  25632. * @deprecated Removed after 3.0.0, Use `HueSliderProps` instead.
  25633. */
  25634. const hueSliderProps = alphaSliderProps;
  25635. //#endregion
  25636. //#region ../../packages/components/color-picker-panel/src/utils/draggable.ts
  25637. let isDragging = false;
  25638. function draggable(element, options) {
  25639. if (!isClient) return;
  25640. const moveFn = function(event) {
  25641. options.drag?.(event);
  25642. };
  25643. const upFn = function(event) {
  25644. document.removeEventListener("mousemove", moveFn);
  25645. document.removeEventListener("mouseup", upFn);
  25646. document.removeEventListener("touchmove", moveFn);
  25647. document.removeEventListener("touchend", upFn);
  25648. document.onselectstart = null;
  25649. document.ondragstart = null;
  25650. isDragging = false;
  25651. options.end?.(event);
  25652. };
  25653. const downFn = function(event) {
  25654. if (isDragging) return;
  25655. document.onselectstart = () => false;
  25656. document.ondragstart = () => false;
  25657. document.addEventListener("mousemove", moveFn);
  25658. document.addEventListener("mouseup", upFn);
  25659. document.addEventListener("touchmove", moveFn);
  25660. document.addEventListener("touchend", upFn);
  25661. isDragging = true;
  25662. options.start?.(event);
  25663. };
  25664. element.addEventListener("mousedown", downFn);
  25665. element.addEventListener("touchstart", downFn, { passive: false });
  25666. }
  25667. //#endregion
  25668. //#region ../../packages/components/color-picker-panel/src/composables/use-slider.ts
  25669. const useSlider = (props, { key, minValue, maxValue }) => {
  25670. const instance = getCurrentInstance();
  25671. const thumb = shallowRef();
  25672. const bar = shallowRef();
  25673. const currentValue = computed(() => props.color.get(key));
  25674. function handleClick(event) {
  25675. if (props.disabled) return;
  25676. if (event.target !== thumb.value) handleDrag(event);
  25677. thumb.value?.focus();
  25678. }
  25679. function handleDrag(event) {
  25680. if (!bar.value || !thumb.value || props.disabled) return;
  25681. const rect = instance.vnode.el.getBoundingClientRect();
  25682. const { clientX, clientY } = getClientXY(event);
  25683. let value;
  25684. if (!props.vertical) {
  25685. let left = clientX - rect.left;
  25686. left = Math.max(thumb.value.offsetWidth / 2, left);
  25687. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  25688. value = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * maxValue);
  25689. } else {
  25690. let top = clientY - rect.top;
  25691. top = Math.max(thumb.value.offsetHeight / 2, top);
  25692. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  25693. value = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * maxValue);
  25694. }
  25695. props.color.set(key, value);
  25696. }
  25697. function handleKeydown(event) {
  25698. if (props.disabled) return;
  25699. const { shiftKey } = event;
  25700. const code = getEventCode(event);
  25701. const step = shiftKey ? 10 : 1;
  25702. const reverse = key === "hue" ? -1 : 1;
  25703. let isPreventDefault = true;
  25704. switch (code) {
  25705. case EVENT_CODE.left:
  25706. case EVENT_CODE.down:
  25707. incrementPosition(-step * reverse);
  25708. break;
  25709. case EVENT_CODE.right:
  25710. case EVENT_CODE.up:
  25711. incrementPosition(step * reverse);
  25712. break;
  25713. case EVENT_CODE.home:
  25714. props.color.set(key, key === "hue" ? maxValue : minValue);
  25715. break;
  25716. case EVENT_CODE.end:
  25717. props.color.set(key, key === "hue" ? minValue : maxValue);
  25718. break;
  25719. case EVENT_CODE.pageDown:
  25720. incrementPosition(-4 * reverse);
  25721. break;
  25722. case EVENT_CODE.pageUp:
  25723. incrementPosition(4 * reverse);
  25724. break;
  25725. default:
  25726. isPreventDefault = false;
  25727. break;
  25728. }
  25729. isPreventDefault && event.preventDefault();
  25730. }
  25731. function incrementPosition(step) {
  25732. let next = currentValue.value + step;
  25733. next = next < minValue ? minValue : next > maxValue ? maxValue : next;
  25734. props.color.set(key, next);
  25735. }
  25736. return {
  25737. thumb,
  25738. bar,
  25739. currentValue,
  25740. handleDrag,
  25741. handleClick,
  25742. handleKeydown
  25743. };
  25744. };
  25745. const useSliderDOM = (props, { namespace, maxValue, bar, thumb, currentValue, handleDrag, getBackground }) => {
  25746. const instance = getCurrentInstance();
  25747. const ns = useNamespace(namespace);
  25748. const thumbLeft = ref(0);
  25749. const thumbTop = ref(0);
  25750. const background = ref();
  25751. function getThumbLeft() {
  25752. if (!thumb.value) return 0;
  25753. if (props.vertical) return 0;
  25754. const el = instance.vnode.el;
  25755. const value = currentValue.value;
  25756. if (!el) return 0;
  25757. return Math.round(value * (el.offsetWidth - thumb.value.offsetWidth / 2) / maxValue);
  25758. }
  25759. function getThumbTop() {
  25760. if (!thumb.value) return 0;
  25761. const el = instance.vnode.el;
  25762. if (!props.vertical) return 0;
  25763. const value = currentValue.value;
  25764. if (!el) return 0;
  25765. return Math.round(value * (el.offsetHeight - thumb.value.offsetHeight / 2) / maxValue);
  25766. }
  25767. function update() {
  25768. thumbLeft.value = getThumbLeft();
  25769. thumbTop.value = getThumbTop();
  25770. background.value = getBackground?.();
  25771. }
  25772. onMounted(() => {
  25773. if (!bar.value || !thumb.value) return;
  25774. const dragConfig = {
  25775. drag: (event) => {
  25776. handleDrag(event);
  25777. },
  25778. end: (event) => {
  25779. handleDrag(event);
  25780. }
  25781. };
  25782. draggable(bar.value, dragConfig);
  25783. draggable(thumb.value, dragConfig);
  25784. update();
  25785. });
  25786. watch(currentValue, () => update());
  25787. watch(() => props.color.value, () => update());
  25788. const rootKls = computed(() => [
  25789. ns.b(),
  25790. ns.is("vertical", props.vertical),
  25791. ns.is("disabled", props.disabled)
  25792. ]);
  25793. const barKls = computed(() => ns.e("bar"));
  25794. const thumbKls = computed(() => ns.e("thumb"));
  25795. return {
  25796. rootKls,
  25797. barKls,
  25798. barStyle: computed(() => ({ background: background.value })),
  25799. thumbKls,
  25800. thumbStyle: computed(() => ({
  25801. left: addUnit(thumbLeft.value),
  25802. top: addUnit(thumbTop.value)
  25803. })),
  25804. thumbLeft,
  25805. thumbTop,
  25806. update
  25807. };
  25808. };
  25809. //#endregion
  25810. //#region ../../packages/components/color-picker-panel/src/components/alpha-slider.vue?vue&type=script&setup=true&lang.ts
  25811. const _hoisted_1$55 = [
  25812. "aria-label",
  25813. "aria-valuenow",
  25814. "aria-valuetext",
  25815. "aria-orientation",
  25816. "tabindex",
  25817. "aria-disabled"
  25818. ];
  25819. const minValue$1 = 0;
  25820. const maxValue$1 = 100;
  25821. var alpha_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25822. name: "ElColorAlphaSlider",
  25823. __name: "alpha-slider",
  25824. props: alphaSliderProps,
  25825. setup(__props, { expose: __expose }) {
  25826. const props = __props;
  25827. const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props, {
  25828. key: "alpha",
  25829. minValue: minValue$1,
  25830. maxValue: maxValue$1
  25831. });
  25832. const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useSliderDOM(props, {
  25833. namespace: "color-alpha-slider",
  25834. maxValue: maxValue$1,
  25835. currentValue,
  25836. bar,
  25837. thumb,
  25838. handleDrag,
  25839. getBackground
  25840. });
  25841. const { t } = useLocale();
  25842. const ariaLabel = computed(() => t("el.colorpicker.alphaLabel"));
  25843. const ariaValuetext = computed(() => {
  25844. return t("el.colorpicker.alphaDescription", {
  25845. alpha: currentValue.value,
  25846. color: props.color.value
  25847. });
  25848. });
  25849. function getBackground() {
  25850. if (props.color && props.color.value) {
  25851. const { r, g, b } = props.color.toRgb();
  25852. return `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`;
  25853. }
  25854. return "";
  25855. }
  25856. __expose({
  25857. update,
  25858. bar,
  25859. thumb
  25860. });
  25861. return (_ctx, _cache) => {
  25862. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createElementVNode("div", {
  25863. ref_key: "bar",
  25864. ref: bar,
  25865. class: normalizeClass(unref(barKls)),
  25866. style: normalizeStyle(unref(barStyle)),
  25867. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  25868. }, null, 6), createElementVNode("div", {
  25869. ref_key: "thumb",
  25870. ref: thumb,
  25871. class: normalizeClass(unref(thumbKls)),
  25872. style: normalizeStyle(unref(thumbStyle)),
  25873. "aria-label": ariaLabel.value,
  25874. "aria-valuenow": unref(currentValue),
  25875. "aria-valuetext": ariaValuetext.value,
  25876. "aria-orientation": __props.vertical ? "vertical" : "horizontal",
  25877. "aria-valuemin": minValue$1,
  25878. "aria-valuemax": maxValue$1,
  25879. role: "slider",
  25880. tabindex: __props.disabled ? void 0 : 0,
  25881. "aria-disabled": __props.disabled,
  25882. onKeydown: _cache[1] || (_cache[1] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
  25883. }, null, 46, _hoisted_1$55)], 2);
  25884. };
  25885. }
  25886. });
  25887. //#endregion
  25888. //#region ../../packages/components/color-picker-panel/src/components/alpha-slider.vue
  25889. var alpha_slider_default = alpha_slider_vue_vue_type_script_setup_true_lang_default;
  25890. //#endregion
  25891. //#region ../../packages/components/color-picker-panel/src/components/hue-slider.vue?vue&type=script&setup=true&lang.ts
  25892. const _hoisted_1$54 = [
  25893. "aria-label",
  25894. "aria-valuenow",
  25895. "aria-valuetext",
  25896. "aria-orientation",
  25897. "tabindex",
  25898. "aria-disabled"
  25899. ];
  25900. const minValue = 0;
  25901. const maxValue = 360;
  25902. var hue_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  25903. name: "ElColorHueSlider",
  25904. __name: "hue-slider",
  25905. props: hueSliderProps,
  25906. setup(__props, { expose: __expose }) {
  25907. const props = __props;
  25908. const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props, {
  25909. key: "hue",
  25910. minValue,
  25911. maxValue
  25912. });
  25913. const { rootKls, barKls, thumbKls, thumbStyle, thumbTop, update } = useSliderDOM(props, {
  25914. namespace: "color-hue-slider",
  25915. maxValue,
  25916. currentValue,
  25917. bar,
  25918. thumb,
  25919. handleDrag
  25920. });
  25921. const { t } = useLocale();
  25922. const ariaLabel = computed(() => t("el.colorpicker.hueLabel"));
  25923. const ariaValuetext = computed(() => {
  25924. return t("el.colorpicker.hueDescription", {
  25925. hue: currentValue.value,
  25926. color: props.color.value
  25927. });
  25928. });
  25929. __expose({
  25930. bar,
  25931. thumb,
  25932. thumbTop,
  25933. update
  25934. });
  25935. return (_ctx, _cache) => {
  25936. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createElementVNode("div", {
  25937. ref_key: "bar",
  25938. ref: bar,
  25939. class: normalizeClass(unref(barKls)),
  25940. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  25941. }, null, 2), createElementVNode("div", {
  25942. ref_key: "thumb",
  25943. ref: thumb,
  25944. class: normalizeClass(unref(thumbKls)),
  25945. style: normalizeStyle(unref(thumbStyle)),
  25946. "aria-label": ariaLabel.value,
  25947. "aria-valuenow": unref(currentValue),
  25948. "aria-valuetext": ariaValuetext.value,
  25949. "aria-orientation": __props.vertical ? "vertical" : "horizontal",
  25950. "aria-valuemin": minValue,
  25951. "aria-valuemax": maxValue,
  25952. role: "slider",
  25953. tabindex: __props.disabled ? void 0 : 0,
  25954. "aria-disabled": __props.disabled,
  25955. onKeydown: _cache[1] || (_cache[1] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
  25956. }, null, 46, _hoisted_1$54)], 2);
  25957. };
  25958. }
  25959. });
  25960. //#endregion
  25961. //#region ../../packages/components/color-picker-panel/src/components/hue-slider.vue
  25962. var hue_slider_default = hue_slider_vue_vue_type_script_setup_true_lang_default;
  25963. //#endregion
  25964. //#region ../../packages/components/color-picker-panel/src/props/predefine.ts
  25965. /**
  25966. * @deprecated Removed after 3.0.0, Use `PredefineProps` instead.
  25967. */
  25968. const predefineProps = buildProps({
  25969. colors: {
  25970. type: definePropType(Array),
  25971. required: true
  25972. },
  25973. color: {
  25974. type: definePropType(Object),
  25975. required: true
  25976. },
  25977. enableAlpha: {
  25978. type: Boolean,
  25979. required: true
  25980. },
  25981. disabled: Boolean
  25982. });
  25983. //#endregion
  25984. //#region ../../packages/components/color-picker-panel/src/utils/color.ts
  25985. var Color = class {
  25986. constructor(options = {}) {
  25987. this._hue = 0;
  25988. this._saturation = 100;
  25989. this._value = 100;
  25990. this._alpha = 100;
  25991. this._tiny = new TinyColor();
  25992. this._isValid = false;
  25993. this.enableAlpha = false;
  25994. this.format = "";
  25995. this.value = "";
  25996. for (const option in options) if (hasOwn(options, option)) this[option] = options[option];
  25997. if (options.value) this.fromString(options.value);
  25998. else this.doOnChange();
  25999. }
  26000. set(prop, value) {
  26001. if (arguments.length === 1 && typeof prop === "object") {
  26002. for (const p in prop) if (hasOwn(prop, p)) this.set(p, prop[p]);
  26003. return;
  26004. }
  26005. this[`_${prop}`] = value;
  26006. this._isValid = true;
  26007. this.doOnChange();
  26008. }
  26009. get(prop) {
  26010. if ([
  26011. "hue",
  26012. "saturation",
  26013. "value",
  26014. "alpha"
  26015. ].includes(prop)) return Math.round(this[`_${prop}`]);
  26016. return this[`_${prop}`];
  26017. }
  26018. toRgb() {
  26019. return this._isValid ? this._tiny.toRgb() : {
  26020. r: 255,
  26021. g: 255,
  26022. b: 255,
  26023. a: 0
  26024. };
  26025. }
  26026. fromString(value) {
  26027. const color = new TinyColor(value);
  26028. this._isValid = color.isValid;
  26029. if (color.isValid) {
  26030. const { h, s, v, a } = color.toHsv();
  26031. this._hue = h;
  26032. this._saturation = s * 100;
  26033. this._value = v * 100;
  26034. this._alpha = a * 100;
  26035. } else {
  26036. this._hue = 0;
  26037. this._saturation = 100;
  26038. this._value = 100;
  26039. this._alpha = 100;
  26040. }
  26041. this.doOnChange();
  26042. }
  26043. clear() {
  26044. this._isValid = false;
  26045. this.value = "";
  26046. this._hue = 0;
  26047. this._saturation = 100;
  26048. this._value = 100;
  26049. this._alpha = 100;
  26050. }
  26051. compare(color) {
  26052. const compareColor = new TinyColor({
  26053. h: color._hue,
  26054. s: color._saturation / 100,
  26055. v: color._value / 100,
  26056. a: color._alpha / 100
  26057. });
  26058. return this._tiny.equals(compareColor);
  26059. }
  26060. doOnChange() {
  26061. const { _hue, _saturation, _value, _alpha, format, enableAlpha } = this;
  26062. let _format = format || (enableAlpha ? "rgb" : "hex");
  26063. if (format === "hex" && enableAlpha) _format = "hex8";
  26064. this._tiny = new TinyColor({
  26065. h: _hue,
  26066. s: _saturation / 100,
  26067. v: _value / 100,
  26068. a: _alpha / 100
  26069. });
  26070. this.value = this._isValid ? this._tiny.toString(_format) : "";
  26071. }
  26072. };
  26073. //#endregion
  26074. //#region ../../packages/components/color-picker-panel/src/composables/use-predefine.ts
  26075. const usePredefine = (props) => {
  26076. const { currentColor } = inject(colorPickerPanelContextKey);
  26077. const rgbaColors = ref(parseColors(props.colors, props.color));
  26078. watch(() => currentColor.value, (val) => {
  26079. const color = new Color({
  26080. value: val,
  26081. enableAlpha: props.enableAlpha
  26082. });
  26083. rgbaColors.value.forEach((item) => {
  26084. item.selected = color.compare(item);
  26085. });
  26086. });
  26087. watchEffect(() => {
  26088. rgbaColors.value = parseColors(props.colors, props.color);
  26089. });
  26090. function handleSelect(index) {
  26091. props.color.fromString(props.colors[index]);
  26092. }
  26093. function parseColors(colors, color) {
  26094. return colors.map((value) => {
  26095. const c = new Color({
  26096. value,
  26097. enableAlpha: props.enableAlpha
  26098. });
  26099. c.selected = c.compare(color);
  26100. return c;
  26101. });
  26102. }
  26103. return {
  26104. rgbaColors,
  26105. handleSelect
  26106. };
  26107. };
  26108. const usePredefineDOM = (props) => {
  26109. const ns = useNamespace("color-predefine");
  26110. const rootKls = computed(() => [ns.b(), ns.is("disabled", props.disabled)]);
  26111. const colorsKls = computed(() => ns.e("colors"));
  26112. function colorSelectorKls(item) {
  26113. return [
  26114. ns.e("color-selector"),
  26115. ns.is("alpha", item.get("alpha") < 100),
  26116. { selected: item.selected }
  26117. ];
  26118. }
  26119. return {
  26120. rootKls,
  26121. colorsKls,
  26122. colorSelectorKls
  26123. };
  26124. };
  26125. //#endregion
  26126. //#region ../../packages/components/color-picker-panel/src/components/predefine.vue?vue&type=script&setup=true&lang.ts
  26127. const _hoisted_1$53 = [
  26128. "disabled",
  26129. "aria-label",
  26130. "onClick"
  26131. ];
  26132. var predefine_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26133. name: "ElColorPredefine",
  26134. __name: "predefine",
  26135. props: predefineProps,
  26136. setup(__props) {
  26137. const props = __props;
  26138. const { rgbaColors, handleSelect } = usePredefine(props);
  26139. const { rootKls, colorsKls, colorSelectorKls } = usePredefineDOM(props);
  26140. const { t } = useLocale();
  26141. const ariaLabel = (value) => {
  26142. return t("el.colorpicker.predefineDescription", { value });
  26143. };
  26144. return (_ctx, _cache) => {
  26145. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(rootKls)) }, [createElementVNode("div", { class: normalizeClass(unref(colorsKls)) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rgbaColors), (item, index) => {
  26146. return openBlock(), createElementBlock("button", {
  26147. key: __props.colors[index],
  26148. type: "button",
  26149. disabled: __props.disabled,
  26150. "aria-label": ariaLabel(item.value),
  26151. class: normalizeClass(unref(colorSelectorKls)(item)),
  26152. onClick: ($event) => unref(handleSelect)(index)
  26153. }, [createElementVNode("div", { style: normalizeStyle({ backgroundColor: item.value }) }, null, 4)], 10, _hoisted_1$53);
  26154. }), 128))], 2)], 2);
  26155. };
  26156. }
  26157. });
  26158. //#endregion
  26159. //#region ../../packages/components/color-picker-panel/src/components/predefine.vue
  26160. var predefine_default = predefine_vue_vue_type_script_setup_true_lang_default;
  26161. //#endregion
  26162. //#region ../../packages/components/color-picker-panel/src/props/sv-panel.ts
  26163. /**
  26164. * @deprecated Removed after 3.0.0, Use `SvPanelProps` instead.
  26165. */
  26166. const svPanelProps = buildProps({
  26167. color: {
  26168. type: definePropType(Object),
  26169. required: true
  26170. },
  26171. disabled: Boolean
  26172. });
  26173. //#endregion
  26174. //#region ../../packages/components/color-picker-panel/src/composables/use-sv-panel.ts
  26175. const useSvPanel = (props) => {
  26176. const instance = getCurrentInstance();
  26177. const cursorRef = ref();
  26178. const cursorTop = ref(0);
  26179. const cursorLeft = ref(0);
  26180. const background = ref("hsl(0, 100%, 50%)");
  26181. const saturation = computed(() => props.color.get("saturation"));
  26182. const brightness = computed(() => props.color.get("value"));
  26183. const hue = computed(() => props.color.get("hue"));
  26184. function handleClick(event) {
  26185. if (props.disabled) return;
  26186. if (event.target !== cursorRef.value) handleDrag(event);
  26187. cursorRef.value?.focus({ preventScroll: true });
  26188. }
  26189. function handleDrag(event) {
  26190. if (props.disabled) return;
  26191. const rect = instance.vnode.el.getBoundingClientRect();
  26192. const { clientX, clientY } = getClientXY(event);
  26193. let left = clientX - rect.left;
  26194. let top = clientY - rect.top;
  26195. left = Math.max(0, left);
  26196. left = Math.min(left, rect.width);
  26197. top = Math.max(0, top);
  26198. top = Math.min(top, rect.height);
  26199. cursorLeft.value = left;
  26200. cursorTop.value = top;
  26201. props.color.set({
  26202. saturation: left / rect.width * 100,
  26203. value: 100 - top / rect.height * 100
  26204. });
  26205. }
  26206. function handleKeydown(event) {
  26207. if (props.disabled) return;
  26208. const { shiftKey } = event;
  26209. const code = getEventCode(event);
  26210. const step = shiftKey ? 10 : 1;
  26211. let isPreventDefault = true;
  26212. switch (code) {
  26213. case EVENT_CODE.left:
  26214. incrementSaturation(-step);
  26215. break;
  26216. case EVENT_CODE.right:
  26217. incrementSaturation(step);
  26218. break;
  26219. case EVENT_CODE.up:
  26220. incrementBrightness(step);
  26221. break;
  26222. case EVENT_CODE.down:
  26223. incrementBrightness(-step);
  26224. break;
  26225. default:
  26226. isPreventDefault = false;
  26227. break;
  26228. }
  26229. isPreventDefault && event.preventDefault();
  26230. }
  26231. function incrementSaturation(step) {
  26232. let next = saturation.value + step;
  26233. next = next < 0 ? 0 : next > 100 ? 100 : next;
  26234. props.color.set("saturation", next);
  26235. }
  26236. function incrementBrightness(step) {
  26237. let next = brightness.value + step;
  26238. next = next < 0 ? 0 : next > 100 ? 100 : next;
  26239. props.color.set("value", next);
  26240. }
  26241. return {
  26242. cursorRef,
  26243. cursorTop,
  26244. cursorLeft,
  26245. background,
  26246. saturation,
  26247. brightness,
  26248. hue,
  26249. handleClick,
  26250. handleDrag,
  26251. handleKeydown
  26252. };
  26253. };
  26254. const useSvPanelDOM = (props, { cursorTop, cursorLeft, background, handleDrag }) => {
  26255. const instance = getCurrentInstance();
  26256. const ns = useNamespace("color-svpanel");
  26257. function update() {
  26258. const saturation = props.color.get("saturation");
  26259. const brightness = props.color.get("value");
  26260. const { clientWidth: width, clientHeight: height } = instance.vnode.el;
  26261. cursorLeft.value = saturation * width / 100;
  26262. cursorTop.value = (100 - brightness) * height / 100;
  26263. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  26264. }
  26265. onMounted(() => {
  26266. draggable(instance.vnode.el, {
  26267. drag: (event) => {
  26268. handleDrag(event);
  26269. },
  26270. end: (event) => {
  26271. handleDrag(event);
  26272. }
  26273. });
  26274. update();
  26275. });
  26276. watch([
  26277. () => props.color.get("hue"),
  26278. () => props.color.get("value"),
  26279. () => props.color.value
  26280. ], () => update());
  26281. return {
  26282. rootKls: computed(() => ns.b()),
  26283. cursorKls: computed(() => ns.e("cursor")),
  26284. rootStyle: computed(() => ({ backgroundColor: background.value })),
  26285. cursorStyle: computed(() => ({
  26286. top: addUnit(cursorTop.value),
  26287. left: addUnit(cursorLeft.value)
  26288. })),
  26289. update
  26290. };
  26291. };
  26292. //#endregion
  26293. //#region ../../packages/components/color-picker-panel/src/components/sv-panel.vue?vue&type=script&setup=true&lang.ts
  26294. const _hoisted_1$52 = [
  26295. "tabindex",
  26296. "aria-disabled",
  26297. "aria-label",
  26298. "aria-valuenow",
  26299. "aria-valuetext"
  26300. ];
  26301. var sv_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26302. name: "ElSvPanel",
  26303. __name: "sv-panel",
  26304. props: svPanelProps,
  26305. setup(__props, { expose: __expose }) {
  26306. const props = __props;
  26307. const { cursorRef, cursorTop, cursorLeft, background, saturation, brightness, handleClick, handleDrag, handleKeydown } = useSvPanel(props);
  26308. const { rootKls, cursorKls, rootStyle, cursorStyle, update } = useSvPanelDOM(props, {
  26309. cursorTop,
  26310. cursorLeft,
  26311. background,
  26312. handleDrag
  26313. });
  26314. const { t } = useLocale();
  26315. const ariaLabel = computed(() => t("el.colorpicker.svLabel"));
  26316. const ariaValuetext = computed(() => {
  26317. return t("el.colorpicker.svDescription", {
  26318. saturation: saturation.value,
  26319. brightness: brightness.value,
  26320. color: props.color.value
  26321. });
  26322. });
  26323. __expose({ update });
  26324. return (_ctx, _cache) => {
  26325. return openBlock(), createElementBlock("div", {
  26326. class: normalizeClass(unref(rootKls)),
  26327. style: normalizeStyle(unref(rootStyle)),
  26328. onClick: _cache[1] || (_cache[1] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  26329. }, [createElementVNode("div", {
  26330. ref_key: "cursorRef",
  26331. ref: cursorRef,
  26332. class: normalizeClass(unref(cursorKls)),
  26333. style: normalizeStyle(unref(cursorStyle)),
  26334. tabindex: __props.disabled ? void 0 : 0,
  26335. "aria-disabled": __props.disabled,
  26336. role: "slider",
  26337. "aria-valuemin": "0,0",
  26338. "aria-valuemax": "100,100",
  26339. "aria-label": ariaLabel.value,
  26340. "aria-valuenow": `${unref(saturation)},${unref(brightness)}`,
  26341. "aria-valuetext": ariaValuetext.value,
  26342. onKeydown: _cache[0] || (_cache[0] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args))
  26343. }, null, 46, _hoisted_1$52)], 6);
  26344. };
  26345. }
  26346. });
  26347. //#endregion
  26348. //#region ../../packages/components/color-picker-panel/src/components/sv-panel.vue
  26349. var sv_panel_default = sv_panel_vue_vue_type_script_setup_true_lang_default;
  26350. //#endregion
  26351. //#region ../../packages/components/color-picker-panel/src/composables/use-common-color.ts
  26352. const useCommonColor = (props, emit) => {
  26353. const color = reactive(new Color({
  26354. enableAlpha: props.showAlpha,
  26355. format: props.colorFormat || "",
  26356. value: props.modelValue
  26357. }));
  26358. watch(() => [props.colorFormat, props.showAlpha], () => {
  26359. color.enableAlpha = props.showAlpha;
  26360. color.format = props.colorFormat || color.format;
  26361. color.doOnChange();
  26362. emit(UPDATE_MODEL_EVENT, color.value);
  26363. });
  26364. return { color };
  26365. };
  26366. //#endregion
  26367. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.vue?vue&type=script&setup=true&lang.ts
  26368. var color_picker_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26369. name: "ElColorPickerPanel",
  26370. __name: "color-picker-panel",
  26371. props: colorPickerPanelProps,
  26372. emits: colorPickerPanelEmits,
  26373. setup(__props, { expose: __expose, emit: __emit }) {
  26374. const props = __props;
  26375. const emit = __emit;
  26376. const ns = useNamespace("color-picker-panel");
  26377. const { formItem } = useFormItem();
  26378. const disabled = useFormDisabled();
  26379. const hueRef = ref();
  26380. const svRef = ref();
  26381. const alphaRef = ref();
  26382. const inputRef = ref();
  26383. const customInput = ref("");
  26384. const { color } = inject(ROOT_COMMON_COLOR_INJECTION_KEY, () => useCommonColor(props, emit), true);
  26385. function handleConfirm() {
  26386. color.fromString(customInput.value);
  26387. if (color.value !== customInput.value) customInput.value = color.value;
  26388. }
  26389. function handleFocusout() {
  26390. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  26391. }
  26392. function update() {
  26393. hueRef.value?.update();
  26394. svRef.value?.update();
  26395. alphaRef.value?.update();
  26396. }
  26397. onMounted(() => {
  26398. if (props.modelValue) customInput.value = color.value;
  26399. nextTick(update);
  26400. });
  26401. watch(() => props.modelValue, (newVal) => {
  26402. if (newVal !== color.value) newVal ? color.fromString(newVal) : color.clear();
  26403. });
  26404. watch(() => color.value, (val) => {
  26405. emit(UPDATE_MODEL_EVENT, val);
  26406. customInput.value = val;
  26407. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26408. });
  26409. provide(colorPickerPanelContextKey, { currentColor: computed(() => color.value) });
  26410. __expose({
  26411. color,
  26412. inputRef,
  26413. update
  26414. });
  26415. return (_ctx, _cache) => {
  26416. return openBlock(), createElementBlock("div", {
  26417. class: normalizeClass([
  26418. unref(ns).b(),
  26419. unref(ns).is("disabled", unref(disabled)),
  26420. unref(ns).is("border", __props.border)
  26421. ]),
  26422. onFocusout: handleFocusout
  26423. }, [
  26424. createElementVNode("div", { class: normalizeClass(unref(ns).e("wrapper")) }, [createVNode(hue_slider_default, {
  26425. ref_key: "hueRef",
  26426. ref: hueRef,
  26427. class: "hue-slider",
  26428. color: unref(color),
  26429. vertical: "",
  26430. disabled: unref(disabled)
  26431. }, null, 8, ["color", "disabled"]), createVNode(sv_panel_default, {
  26432. ref_key: "svRef",
  26433. ref: svRef,
  26434. color: unref(color),
  26435. disabled: unref(disabled)
  26436. }, null, 8, ["color", "disabled"])], 2),
  26437. __props.showAlpha ? (openBlock(), createBlock(alpha_slider_default, {
  26438. key: 0,
  26439. ref_key: "alphaRef",
  26440. ref: alphaRef,
  26441. color: unref(color),
  26442. disabled: unref(disabled)
  26443. }, null, 8, ["color", "disabled"])) : createCommentVNode("v-if", true),
  26444. __props.predefine ? (openBlock(), createBlock(predefine_default, {
  26445. key: 1,
  26446. ref: "predefine",
  26447. "enable-alpha": __props.showAlpha,
  26448. color: unref(color),
  26449. colors: __props.predefine,
  26450. disabled: unref(disabled)
  26451. }, null, 8, [
  26452. "enable-alpha",
  26453. "color",
  26454. "colors",
  26455. "disabled"
  26456. ])) : createCommentVNode("v-if", true),
  26457. createElementVNode("div", { class: normalizeClass(unref(ns).e("footer")) }, [createVNode(unref(ElInput), {
  26458. ref_key: "inputRef",
  26459. ref: inputRef,
  26460. modelValue: customInput.value,
  26461. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  26462. "validate-event": false,
  26463. size: "small",
  26464. disabled: unref(disabled),
  26465. onChange: handleConfirm
  26466. }, null, 8, ["modelValue", "disabled"]), renderSlot(_ctx.$slots, "footer")], 2)
  26467. ], 34);
  26468. };
  26469. }
  26470. });
  26471. //#endregion
  26472. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.vue
  26473. var color_picker_panel_default = color_picker_panel_vue_vue_type_script_setup_true_lang_default;
  26474. //#endregion
  26475. //#region ../../packages/components/color-picker-panel/index.ts
  26476. const ElColorPickerPanel = withInstall(color_picker_panel_default);
  26477. //#endregion
  26478. //#region ../../packages/components/color-picker/src/color-picker.ts
  26479. /**
  26480. * @deprecated Removed after 3.0.0, Use `ColorPickerProps` instead.
  26481. */
  26482. const colorPickerProps = buildProps({
  26483. persistent: {
  26484. type: Boolean,
  26485. default: true
  26486. },
  26487. modelValue: {
  26488. type: definePropType(String),
  26489. default: void 0
  26490. },
  26491. id: String,
  26492. showAlpha: Boolean,
  26493. colorFormat: { type: definePropType(String) },
  26494. disabled: {
  26495. type: Boolean,
  26496. default: void 0
  26497. },
  26498. clearable: {
  26499. type: Boolean,
  26500. default: true
  26501. },
  26502. size: useSizeProp,
  26503. popperClass: useTooltipContentProps.popperClass,
  26504. popperStyle: useTooltipContentProps.popperStyle,
  26505. tabindex: {
  26506. type: [String, Number],
  26507. default: 0
  26508. },
  26509. teleported: useTooltipContentProps.teleported,
  26510. appendTo: useTooltipContentProps.appendTo,
  26511. predefine: { type: definePropType(Array) },
  26512. validateEvent: {
  26513. type: Boolean,
  26514. default: true
  26515. },
  26516. ...useEmptyValuesProps,
  26517. ...useAriaProps(["ariaLabel"])
  26518. });
  26519. const colorPickerEmits = {
  26520. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  26521. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  26522. activeChange: (val) => isString(val) || isNil(val),
  26523. focus: (evt) => evt instanceof FocusEvent,
  26524. blur: (evt) => evt instanceof FocusEvent,
  26525. clear: () => true
  26526. };
  26527. /**
  26528. * @description default values for ColorPickerProps, used in components that extend ColorPickerProps
  26529. */
  26530. const colorPickerPropsDefaults = {
  26531. persistent: true,
  26532. modelValue: void 0,
  26533. disabled: void 0,
  26534. clearable: true,
  26535. popperStyle: void 0,
  26536. tabindex: 0,
  26537. teleported: true,
  26538. validateEvent: true,
  26539. valueOnClear: void 0
  26540. };
  26541. //#endregion
  26542. //#region ../../packages/components/color-picker/src/color-picker.vue?vue&type=script&setup=true&lang.ts
  26543. const _hoisted_1$51 = [
  26544. "id",
  26545. "aria-label",
  26546. "aria-labelledby",
  26547. "aria-description",
  26548. "aria-disabled",
  26549. "tabindex"
  26550. ];
  26551. var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26552. name: "ElColorPicker",
  26553. __name: "color-picker",
  26554. props: colorPickerProps,
  26555. emits: colorPickerEmits,
  26556. setup(__props, { expose: __expose, emit: __emit }) {
  26557. const props = __props;
  26558. const emit = __emit;
  26559. const { t } = useLocale();
  26560. const ns = useNamespace("color");
  26561. const { formItem } = useFormItem();
  26562. const colorSize = useFormSize();
  26563. const colorDisabled = useFormDisabled();
  26564. const { valueOnClear, isEmptyValue } = useEmptyValues(props, null);
  26565. const commonColor = useCommonColor(props, emit);
  26566. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  26567. const popper = ref();
  26568. const triggerRef = ref();
  26569. const pickerPanelRef = ref();
  26570. const showPicker = ref(false);
  26571. const showPanelColor = ref(false);
  26572. let shouldActiveChange = true;
  26573. const { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef, {
  26574. disabled: colorDisabled,
  26575. beforeBlur(event) {
  26576. return popper.value?.isFocusInsideContent(event);
  26577. },
  26578. afterBlur() {
  26579. setShowPicker(false);
  26580. resetColor();
  26581. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  26582. }
  26583. });
  26584. const color = reactiveComputed(() => pickerPanelRef.value?.color ?? commonColor.color);
  26585. const panelProps = computed(() => pick(props, Object.keys(colorPickerPanelProps)));
  26586. const displayedColor = computed(() => {
  26587. if (!props.modelValue && !showPanelColor.value) return "transparent";
  26588. return displayedRgb(color, props.showAlpha);
  26589. });
  26590. const currentColor = computed(() => {
  26591. return !props.modelValue && !showPanelColor.value ? "" : color.value;
  26592. });
  26593. const buttonAriaLabel = computed(() => {
  26594. return !isLabeledByFormItem.value ? props.ariaLabel || t("el.colorpicker.defaultLabel") : void 0;
  26595. });
  26596. const buttonAriaLabelledby = computed(() => {
  26597. return isLabeledByFormItem.value ? formItem?.labelId : void 0;
  26598. });
  26599. const btnKls = computed(() => {
  26600. return [
  26601. ns.b("picker"),
  26602. ns.is("disabled", colorDisabled.value),
  26603. ns.bm("picker", colorSize.value),
  26604. ns.is("focused", isFocused.value)
  26605. ];
  26606. });
  26607. function displayedRgb(color, showAlpha) {
  26608. const { r, g, b, a } = color.toRgb();
  26609. return showAlpha ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
  26610. }
  26611. function setShowPicker(value) {
  26612. showPicker.value = value;
  26613. }
  26614. const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true });
  26615. function show() {
  26616. if (colorDisabled.value) return;
  26617. setShowPicker(true);
  26618. }
  26619. function hide() {
  26620. debounceSetShowPicker(false);
  26621. resetColor();
  26622. }
  26623. function resetColor() {
  26624. nextTick(() => {
  26625. if (props.modelValue) color.fromString(props.modelValue);
  26626. else {
  26627. color.value = "";
  26628. nextTick(() => {
  26629. showPanelColor.value = false;
  26630. });
  26631. }
  26632. });
  26633. }
  26634. function handleTrigger() {
  26635. if (colorDisabled.value) return;
  26636. if (showPicker.value) resetColor();
  26637. debounceSetShowPicker(!showPicker.value);
  26638. }
  26639. function confirmValue() {
  26640. const value = isEmptyValue(color.value) ? valueOnClear.value : color.value;
  26641. emit(UPDATE_MODEL_EVENT, value);
  26642. emit(CHANGE_EVENT, value);
  26643. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26644. debounceSetShowPicker(false);
  26645. nextTick(() => {
  26646. const newColor = new Color({
  26647. enableAlpha: props.showAlpha,
  26648. format: props.colorFormat || "",
  26649. value: props.modelValue
  26650. });
  26651. if (!color.compare(newColor)) resetColor();
  26652. });
  26653. }
  26654. function clear() {
  26655. debounceSetShowPicker(false);
  26656. emit(UPDATE_MODEL_EVENT, valueOnClear.value);
  26657. emit(CHANGE_EVENT, valueOnClear.value);
  26658. if (props.modelValue !== valueOnClear.value && props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26659. resetColor();
  26660. emit("clear");
  26661. }
  26662. function handleShowTooltip() {
  26663. pickerPanelRef?.value?.inputRef?.focus();
  26664. }
  26665. function handleClickOutside() {
  26666. if (!showPicker.value) return;
  26667. hide();
  26668. isFocused.value && focus();
  26669. }
  26670. function handleEsc(event) {
  26671. event.preventDefault();
  26672. event.stopPropagation();
  26673. setShowPicker(false);
  26674. resetColor();
  26675. }
  26676. function handleKeyDown(event) {
  26677. switch (getEventCode(event)) {
  26678. case EVENT_CODE.enter:
  26679. case EVENT_CODE.numpadEnter:
  26680. case EVENT_CODE.space:
  26681. event.preventDefault();
  26682. event.stopPropagation();
  26683. show();
  26684. break;
  26685. case EVENT_CODE.esc:
  26686. handleEsc(event);
  26687. break;
  26688. }
  26689. }
  26690. function focus() {
  26691. triggerRef.value.focus();
  26692. }
  26693. function blur() {
  26694. triggerRef.value.blur();
  26695. }
  26696. watch(() => currentColor.value, (val) => {
  26697. shouldActiveChange && emit("activeChange", val);
  26698. shouldActiveChange = true;
  26699. });
  26700. watch(() => color.value, () => {
  26701. if (!props.modelValue && !showPanelColor.value) showPanelColor.value = true;
  26702. });
  26703. watch(() => props.modelValue, (newVal) => {
  26704. if (!newVal) showPanelColor.value = false;
  26705. else if (newVal && newVal !== color.value) {
  26706. shouldActiveChange = false;
  26707. color.fromString(newVal);
  26708. }
  26709. });
  26710. watch(() => showPicker.value, () => {
  26711. pickerPanelRef.value && nextTick(pickerPanelRef.value.update);
  26712. });
  26713. provide(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor);
  26714. __expose({
  26715. color,
  26716. show,
  26717. hide,
  26718. focus,
  26719. blur
  26720. });
  26721. return (_ctx, _cache) => {
  26722. return openBlock(), createBlock(unref(ElTooltip), {
  26723. ref_key: "popper",
  26724. ref: popper,
  26725. visible: showPicker.value,
  26726. "show-arrow": false,
  26727. "fallback-placements": [
  26728. "bottom",
  26729. "top",
  26730. "right",
  26731. "left"
  26732. ],
  26733. offset: 0,
  26734. "gpu-acceleration": false,
  26735. "popper-class": [unref(ns).be("picker", "panel"), __props.popperClass],
  26736. "popper-style": __props.popperStyle,
  26737. "stop-popper-mouse-event": false,
  26738. pure: "",
  26739. loop: "",
  26740. role: "dialog",
  26741. effect: "light",
  26742. trigger: "click",
  26743. teleported: __props.teleported,
  26744. transition: `${unref(ns).namespace.value}-zoom-in-top`,
  26745. persistent: __props.persistent,
  26746. "append-to": __props.appendTo,
  26747. onShow: handleShowTooltip,
  26748. onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
  26749. }, {
  26750. content: withCtx(() => [withDirectives((openBlock(), createBlock(unref(ElColorPickerPanel), mergeProps({
  26751. ref_key: "pickerPanelRef",
  26752. ref: pickerPanelRef
  26753. }, panelProps.value, {
  26754. border: false,
  26755. "validate-event": false,
  26756. onKeydown: withKeys(handleEsc, ["esc"])
  26757. }), {
  26758. footer: withCtx(() => [createElementVNode("div", null, [__props.clearable ? (openBlock(), createBlock(unref(ElButton), {
  26759. key: 0,
  26760. class: normalizeClass(unref(ns).be("footer", "link-btn")),
  26761. text: "",
  26762. size: "small",
  26763. onClick: clear
  26764. }, {
  26765. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.colorpicker.clear")), 1)]),
  26766. _: 1
  26767. }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(unref(ElButton), {
  26768. plain: "",
  26769. size: "small",
  26770. class: normalizeClass(unref(ns).be("footer", "btn")),
  26771. onClick: confirmValue
  26772. }, {
  26773. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.colorpicker.confirm")), 1)]),
  26774. _: 1
  26775. }, 8, ["class"])])]),
  26776. _: 1
  26777. }, 16)), [[
  26778. unref(ClickOutside),
  26779. handleClickOutside,
  26780. triggerRef.value
  26781. ]])]),
  26782. default: withCtx(() => [createElementVNode("div", mergeProps({
  26783. id: unref(buttonId),
  26784. ref_key: "triggerRef",
  26785. ref: triggerRef
  26786. }, _ctx.$attrs, {
  26787. class: btnKls.value,
  26788. role: "button",
  26789. "aria-label": buttonAriaLabel.value,
  26790. "aria-labelledby": buttonAriaLabelledby.value,
  26791. "aria-description": unref(t)("el.colorpicker.description", { color: __props.modelValue || "" }),
  26792. "aria-disabled": unref(colorDisabled),
  26793. tabindex: unref(colorDisabled) ? void 0 : __props.tabindex,
  26794. onKeydown: handleKeyDown,
  26795. onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  26796. onBlur: _cache[1] || (_cache[1] = (...args) => unref(handleBlur) && unref(handleBlur)(...args))
  26797. }), [createElementVNode("div", {
  26798. class: normalizeClass(unref(ns).be("picker", "trigger")),
  26799. onClick: handleTrigger
  26800. }, [createElementVNode("span", { class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", __props.showAlpha)]) }, [createElementVNode("span", {
  26801. class: normalizeClass(unref(ns).be("picker", "color-inner")),
  26802. style: normalizeStyle({ backgroundColor: displayedColor.value })
  26803. }, [withDirectives(createVNode(unref(ElIcon), { class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")]) }, {
  26804. default: withCtx(() => [createVNode(unref(arrow_down_default))]),
  26805. _: 1
  26806. }, 8, ["class"]), [[vShow, __props.modelValue || showPanelColor.value]]), withDirectives(createVNode(unref(ElIcon), { class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")]) }, {
  26807. default: withCtx(() => [createVNode(unref(close_default))]),
  26808. _: 1
  26809. }, 8, ["class"]), [[vShow, !__props.modelValue && !showPanelColor.value]])], 6)], 2)], 2)], 16, _hoisted_1$51)]),
  26810. _: 1
  26811. }, 8, [
  26812. "visible",
  26813. "popper-class",
  26814. "popper-style",
  26815. "teleported",
  26816. "transition",
  26817. "persistent",
  26818. "append-to"
  26819. ]);
  26820. };
  26821. }
  26822. });
  26823. //#endregion
  26824. //#region ../../packages/components/color-picker/src/color-picker.vue
  26825. var color_picker_default = color_picker_vue_vue_type_script_setup_true_lang_default;
  26826. //#endregion
  26827. //#region ../../packages/components/color-picker/index.ts
  26828. const ElColorPicker = withInstall(color_picker_default);
  26829. //#endregion
  26830. //#region ../../packages/components/container/src/container.vue?vue&type=script&setup=true&lang.ts
  26831. var container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26832. name: "ElContainer",
  26833. __name: "container",
  26834. props: { direction: {
  26835. type: String,
  26836. required: false
  26837. } },
  26838. setup(__props) {
  26839. const props = __props;
  26840. const slots = useSlots();
  26841. const ns = useNamespace("container");
  26842. const isVertical = computed(() => {
  26843. if (props.direction === "vertical") return true;
  26844. else if (props.direction === "horizontal") return false;
  26845. if (slots && slots.default) return slots.default().some((vNode) => {
  26846. const tag = vNode.type.name;
  26847. return tag === "ElHeader" || tag === "ElFooter";
  26848. });
  26849. else return false;
  26850. });
  26851. return (_ctx, _cache) => {
  26852. return openBlock(), createElementBlock("section", { class: normalizeClass([unref(ns).b(), unref(ns).is("vertical", isVertical.value)]) }, [renderSlot(_ctx.$slots, "default")], 2);
  26853. };
  26854. }
  26855. });
  26856. //#endregion
  26857. //#region ../../packages/components/container/src/container.vue
  26858. var container_default = container_vue_vue_type_script_setup_true_lang_default;
  26859. //#endregion
  26860. //#region ../../packages/components/container/src/aside.vue?vue&type=script&setup=true&lang.ts
  26861. var aside_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26862. name: "ElAside",
  26863. __name: "aside",
  26864. props: { width: {
  26865. type: [String, null],
  26866. required: false,
  26867. default: null
  26868. } },
  26869. setup(__props) {
  26870. const props = __props;
  26871. const ns = useNamespace("aside");
  26872. const style = computed(() => props.width ? ns.cssVarBlock({ width: props.width }) : {});
  26873. return (_ctx, _cache) => {
  26874. return openBlock(), createElementBlock("aside", {
  26875. class: normalizeClass(unref(ns).b()),
  26876. style: normalizeStyle(style.value)
  26877. }, [renderSlot(_ctx.$slots, "default")], 6);
  26878. };
  26879. }
  26880. });
  26881. //#endregion
  26882. //#region ../../packages/components/container/src/aside.vue
  26883. var aside_default = aside_vue_vue_type_script_setup_true_lang_default;
  26884. //#endregion
  26885. //#region ../../packages/components/container/src/footer.vue?vue&type=script&setup=true&lang.ts
  26886. var footer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26887. name: "ElFooter",
  26888. __name: "footer",
  26889. props: { height: {
  26890. type: [String, null],
  26891. required: false,
  26892. default: null
  26893. } },
  26894. setup(__props) {
  26895. const props = __props;
  26896. const ns = useNamespace("footer");
  26897. const style = computed(() => props.height ? ns.cssVarBlock({ height: props.height }) : {});
  26898. return (_ctx, _cache) => {
  26899. return openBlock(), createElementBlock("footer", {
  26900. class: normalizeClass(unref(ns).b()),
  26901. style: normalizeStyle(style.value)
  26902. }, [renderSlot(_ctx.$slots, "default")], 6);
  26903. };
  26904. }
  26905. });
  26906. //#endregion
  26907. //#region ../../packages/components/container/src/footer.vue
  26908. var footer_default = footer_vue_vue_type_script_setup_true_lang_default;
  26909. //#endregion
  26910. //#region ../../packages/components/container/src/header.vue?vue&type=script&setup=true&lang.ts
  26911. var header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26912. name: "ElHeader",
  26913. __name: "header",
  26914. props: { height: {
  26915. type: [String, null],
  26916. required: false,
  26917. default: null
  26918. } },
  26919. setup(__props) {
  26920. const props = __props;
  26921. const ns = useNamespace("header");
  26922. const style = computed(() => {
  26923. return props.height ? ns.cssVarBlock({ height: props.height }) : {};
  26924. });
  26925. return (_ctx, _cache) => {
  26926. return openBlock(), createElementBlock("header", {
  26927. class: normalizeClass(unref(ns).b()),
  26928. style: normalizeStyle(style.value)
  26929. }, [renderSlot(_ctx.$slots, "default")], 6);
  26930. };
  26931. }
  26932. });
  26933. //#endregion
  26934. //#region ../../packages/components/container/src/header.vue
  26935. var header_default = header_vue_vue_type_script_setup_true_lang_default;
  26936. //#endregion
  26937. //#region ../../packages/components/container/src/main.vue?vue&type=script&setup=true&lang.ts
  26938. var main_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  26939. name: "ElMain",
  26940. __name: "main",
  26941. setup(__props) {
  26942. const ns = useNamespace("main");
  26943. return (_ctx, _cache) => {
  26944. return openBlock(), createElementBlock("main", { class: normalizeClass(unref(ns).b()) }, [renderSlot(_ctx.$slots, "default")], 2);
  26945. };
  26946. }
  26947. });
  26948. //#endregion
  26949. //#region ../../packages/components/container/src/main.vue
  26950. var main_default = main_vue_vue_type_script_setup_true_lang_default;
  26951. //#endregion
  26952. //#region ../../packages/components/container/index.ts
  26953. const ElContainer = withInstall(container_default, {
  26954. Aside: aside_default,
  26955. Footer: footer_default,
  26956. Header: header_default,
  26957. Main: main_default
  26958. });
  26959. const ElAside = withNoopInstall(aside_default);
  26960. const ElFooter = withNoopInstall(footer_default);
  26961. const ElHeader = withNoopInstall(header_default);
  26962. const ElMain = withNoopInstall(main_default);
  26963. //#endregion
  26964. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
  26965. var require_advancedFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  26966. (function(e, t) {
  26967. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
  26968. })(exports, (function() {
  26969. "use strict";
  26970. return function(e, t) {
  26971. var r = t.prototype, n = r.format;
  26972. r.format = function(e) {
  26973. var t = this, r = this.$locale();
  26974. if (!this.isValid()) return n.bind(this)(e);
  26975. var s = this.$utils(), a = (e || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e) {
  26976. switch (e) {
  26977. case "Q": return Math.ceil((t.$M + 1) / 3);
  26978. case "Do": return r.ordinal(t.$D);
  26979. case "gggg": return t.weekYear();
  26980. case "GGGG": return t.isoWeekYear();
  26981. case "wo": return r.ordinal(t.week(), "W");
  26982. case "w":
  26983. case "ww": return s.s(t.week(), "w" === e ? 1 : 2, "0");
  26984. case "W":
  26985. case "WW": return s.s(t.isoWeek(), "W" === e ? 1 : 2, "0");
  26986. case "k":
  26987. case "kk": return s.s(String(0 === t.$H ? 24 : t.$H), "k" === e ? 1 : 2, "0");
  26988. case "X": return Math.floor(t.$d.getTime() / 1e3);
  26989. case "x": return t.$d.getTime();
  26990. case "z": return "[" + t.offsetName() + "]";
  26991. case "zzz": return "[" + t.offsetName("long") + "]";
  26992. default: return e;
  26993. }
  26994. }));
  26995. return n.bind(this)(a);
  26996. };
  26997. };
  26998. }));
  26999. }));
  27000. //#endregion
  27001. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekOfYear.js
  27002. var require_weekOfYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27003. (function(e, t) {
  27004. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekOfYear = t();
  27005. })(exports, (function() {
  27006. "use strict";
  27007. var e = "week", t = "year";
  27008. return function(i, n, r) {
  27009. var f = n.prototype;
  27010. f.week = function(i) {
  27011. if (void 0 === i && (i = null), null !== i) return this.add(7 * (i - this.week()), "day");
  27012. var n = this.$locale().yearStart || 1;
  27013. if (11 === this.month() && this.date() > 25) {
  27014. var f = r(this).startOf(t).add(1, t).date(n), s = r(this).endOf(e);
  27015. if (f.isBefore(s)) return 1;
  27016. }
  27017. var a = r(this).startOf(t).date(n).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, !0);
  27018. return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
  27019. }, f.weeks = function(e) {
  27020. return void 0 === e && (e = null), this.week(e);
  27021. };
  27022. };
  27023. }));
  27024. }));
  27025. //#endregion
  27026. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekYear.js
  27027. var require_weekYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27028. (function(e, t) {
  27029. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekYear = t();
  27030. })(exports, (function() {
  27031. "use strict";
  27032. return function(e, t) {
  27033. t.prototype.weekYear = function() {
  27034. var e = this.month(), t = this.week(), n = this.year();
  27035. return 1 === t && 11 === e ? n + 1 : 0 === e && t >= 52 ? n - 1 : n;
  27036. };
  27037. };
  27038. }));
  27039. }));
  27040. //#endregion
  27041. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/dayOfYear.js
  27042. var require_dayOfYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27043. (function(e, t) {
  27044. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_dayOfYear = t();
  27045. })(exports, (function() {
  27046. "use strict";
  27047. return function(e, t, n) {
  27048. t.prototype.dayOfYear = function(e) {
  27049. var t = Math.round((n(this).startOf("day") - n(this).startOf("year")) / 864e5) + 1;
  27050. return null == e ? t : this.add(e - t, "day");
  27051. };
  27052. };
  27053. }));
  27054. }));
  27055. //#endregion
  27056. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrAfter.js
  27057. var require_isSameOrAfter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27058. (function(e, t) {
  27059. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrAfter = t();
  27060. })(exports, (function() {
  27061. "use strict";
  27062. return function(e, t) {
  27063. t.prototype.isSameOrAfter = function(e, t) {
  27064. return this.isSame(e, t) || this.isAfter(e, t);
  27065. };
  27066. };
  27067. }));
  27068. }));
  27069. //#endregion
  27070. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrBefore.js
  27071. var require_isSameOrBefore = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27072. (function(e, i) {
  27073. "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrBefore = i();
  27074. })(exports, (function() {
  27075. "use strict";
  27076. return function(e, i) {
  27077. i.prototype.isSameOrBefore = function(e, i) {
  27078. return this.isSame(e, i) || this.isBefore(e, i);
  27079. };
  27080. };
  27081. }));
  27082. }));
  27083. //#endregion
  27084. //#region ../../packages/components/date-picker-panel/src/props/date-picker-panel.ts
  27085. var import_isSameOrBefore = /* @__PURE__ */ __toESM(require_isSameOrBefore());
  27086. var import_isSameOrAfter = /* @__PURE__ */ __toESM(require_isSameOrAfter());
  27087. var import_dayOfYear = /* @__PURE__ */ __toESM(require_dayOfYear());
  27088. var import_weekYear = /* @__PURE__ */ __toESM(require_weekYear());
  27089. var import_weekOfYear = /* @__PURE__ */ __toESM(require_weekOfYear());
  27090. var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
  27091. const datePickerPanelProps = buildProps({
  27092. valueFormat: String,
  27093. dateFormat: String,
  27094. timeFormat: String,
  27095. disabled: {
  27096. type: Boolean,
  27097. default: void 0
  27098. },
  27099. modelValue: {
  27100. type: definePropType([
  27101. Date,
  27102. Array,
  27103. String,
  27104. Number
  27105. ]),
  27106. default: ""
  27107. },
  27108. defaultValue: { type: definePropType([Date, Array]) },
  27109. defaultTime: { type: definePropType([Date, Array]) },
  27110. isRange: Boolean,
  27111. ...disabledTimeListsProps,
  27112. disabledDate: { type: Function },
  27113. cellClassName: { type: Function },
  27114. shortcuts: {
  27115. type: Array,
  27116. default: () => []
  27117. },
  27118. arrowControl: Boolean,
  27119. unlinkPanels: Boolean,
  27120. showNow: {
  27121. type: Boolean,
  27122. default: true
  27123. },
  27124. showConfirm: Boolean,
  27125. showFooter: Boolean,
  27126. showWeekNumber: Boolean,
  27127. type: {
  27128. type: definePropType(String),
  27129. default: "date"
  27130. },
  27131. clearable: {
  27132. type: Boolean,
  27133. default: true
  27134. },
  27135. border: {
  27136. type: Boolean,
  27137. default: true
  27138. },
  27139. editable: {
  27140. type: Boolean,
  27141. default: true
  27142. }
  27143. });
  27144. //#endregion
  27145. //#region ../../packages/components/date-picker-panel/src/constants.ts
  27146. const ROOT_PICKER_INJECTION_KEY = Symbol("rootPickerContextKey");
  27147. const ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY = "ElIsDefaultFormat";
  27148. //#endregion
  27149. //#region ../../packages/components/date-picker-panel/src/props/shared.ts
  27150. const selectionModes = [
  27151. "date",
  27152. "dates",
  27153. "year",
  27154. "years",
  27155. "month",
  27156. "months",
  27157. "week",
  27158. "range"
  27159. ];
  27160. const datePickerSharedProps = buildProps({
  27161. cellClassName: { type: definePropType(Function) },
  27162. disabledDate: { type: definePropType(Function) },
  27163. date: {
  27164. type: definePropType(Object),
  27165. required: true
  27166. },
  27167. minDate: { type: definePropType(Object) },
  27168. maxDate: { type: definePropType(Object) },
  27169. parsedValue: { type: definePropType([Object, Array]) },
  27170. rangeState: {
  27171. type: definePropType(Object),
  27172. default: () => ({
  27173. endDate: null,
  27174. selecting: false
  27175. })
  27176. },
  27177. disabled: Boolean
  27178. });
  27179. const panelSharedProps = buildProps({
  27180. type: {
  27181. type: definePropType(String),
  27182. required: true,
  27183. values: datePickTypes
  27184. },
  27185. dateFormat: String,
  27186. timeFormat: String,
  27187. showNow: {
  27188. type: Boolean,
  27189. default: true
  27190. },
  27191. showConfirm: Boolean,
  27192. showFooter: {
  27193. type: Boolean,
  27194. default: true
  27195. },
  27196. showWeekNumber: Boolean,
  27197. border: Boolean,
  27198. disabled: Boolean,
  27199. editable: {
  27200. type: Boolean,
  27201. default: true
  27202. }
  27203. });
  27204. const panelRangeSharedProps = buildProps({
  27205. unlinkPanels: Boolean,
  27206. visible: {
  27207. type: Boolean,
  27208. default: true
  27209. },
  27210. showConfirm: Boolean,
  27211. showFooter: {
  27212. type: Boolean,
  27213. default: true
  27214. },
  27215. border: Boolean,
  27216. disabled: Boolean,
  27217. parsedValue: { type: definePropType(Array) }
  27218. });
  27219. const selectionModeWithDefault = (mode) => {
  27220. return {
  27221. type: String,
  27222. values: selectionModes,
  27223. default: mode
  27224. };
  27225. };
  27226. //#endregion
  27227. //#region ../../packages/components/date-picker-panel/src/props/panel-date-pick.ts
  27228. const panelDatePickProps = buildProps({
  27229. ...panelSharedProps,
  27230. parsedValue: { type: definePropType([Object, Array]) },
  27231. visible: {
  27232. type: Boolean,
  27233. default: true
  27234. },
  27235. format: {
  27236. type: String,
  27237. default: ""
  27238. }
  27239. });
  27240. //#endregion
  27241. //#region ../../packages/components/date-picker-panel/src/utils.ts
  27242. const isValidRange = (range) => {
  27243. if (!isArray$1(range)) return false;
  27244. const [left, right] = range;
  27245. return import_dayjs_min.default.isDayjs(left) && import_dayjs_min.default.isDayjs(right) && (0, import_dayjs_min.default)(left).isValid() && (0, import_dayjs_min.default)(right).isValid() && left.isSameOrBefore(right);
  27246. };
  27247. const getDefaultValue = (defaultValue, { lang, step = 1, unit, unlinkPanels }) => {
  27248. let start;
  27249. if (isArray$1(defaultValue)) {
  27250. let [left, right] = defaultValue.map((d) => (0, import_dayjs_min.default)(d).locale(lang));
  27251. if (!unlinkPanels) right = left.add(step, unit);
  27252. return [left, right];
  27253. } else if (defaultValue) start = (0, import_dayjs_min.default)(defaultValue);
  27254. else start = (0, import_dayjs_min.default)();
  27255. start = start.locale(lang);
  27256. return [start, start.add(step, unit)];
  27257. };
  27258. const buildPickerTable = (dimension, rows, { columnIndexOffset, startDate, nextEndDate, now, unit, relativeDateGetter, setCellMetadata, setRowMetadata }) => {
  27259. for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {
  27260. const row = rows[rowIndex];
  27261. for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {
  27262. let cell = row[columnIndex + columnIndexOffset];
  27263. if (!cell) cell = {
  27264. row: rowIndex,
  27265. column: columnIndex,
  27266. type: "normal",
  27267. inRange: false,
  27268. start: false,
  27269. end: false
  27270. };
  27271. const nextStartDate = relativeDateGetter(rowIndex * dimension.column + columnIndex);
  27272. cell.dayjs = nextStartDate;
  27273. cell.date = nextStartDate.toDate();
  27274. cell.timestamp = nextStartDate.valueOf();
  27275. cell.type = "normal";
  27276. cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit));
  27277. if (startDate?.isSameOrAfter(nextEndDate)) {
  27278. cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  27279. cell.end = startDate && nextStartDate.isSame(startDate, unit);
  27280. } else {
  27281. cell.start = !!startDate && nextStartDate.isSame(startDate, unit);
  27282. cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  27283. }
  27284. if (nextStartDate.isSame(now, unit)) cell.type = "today";
  27285. setCellMetadata?.(cell, {
  27286. rowIndex,
  27287. columnIndex
  27288. });
  27289. row[columnIndex + columnIndexOffset] = cell;
  27290. }
  27291. setRowMetadata?.(row);
  27292. }
  27293. };
  27294. const datesInMonth = (date, year, month, lang) => {
  27295. const firstDay = (0, import_dayjs_min.default)().locale(lang).startOf("month").month(month).year(year).hour(date.hour()).minute(date.minute()).second(date.second());
  27296. return rangeArr(firstDay.daysInMonth()).map((n) => firstDay.add(n, "day").toDate());
  27297. };
  27298. const getValidDateOfMonth = (date, year, month, lang, disabledDate) => {
  27299. const _value = (0, import_dayjs_min.default)().year(year).month(month).startOf("month").hour(date.hour()).minute(date.minute()).second(date.second());
  27300. const _date = datesInMonth(date, year, month, lang).find((date) => {
  27301. return !disabledDate?.(date);
  27302. });
  27303. if (_date) return (0, import_dayjs_min.default)(_date).locale(lang);
  27304. return _value.locale(lang);
  27305. };
  27306. const getValidDateOfYear = (value, lang, disabledDate) => {
  27307. const year = value.year();
  27308. if (!disabledDate?.(value.toDate())) return value.locale(lang);
  27309. const month = value.month();
  27310. if (!datesInMonth(value, year, month, lang).every(disabledDate)) return getValidDateOfMonth(value, year, month, lang, disabledDate);
  27311. for (let i = 0; i < 12; i++) if (!datesInMonth(value, year, i, lang).every(disabledDate)) return getValidDateOfMonth(value, year, i, lang, disabledDate);
  27312. return value;
  27313. };
  27314. const correctlyParseUserInput = (value, format, lang, defaultFormat) => {
  27315. if (isArray$1(value)) return value.map((v) => correctlyParseUserInput(v, format, lang, defaultFormat));
  27316. if (isString(value)) {
  27317. const dayjsValue = defaultFormat?.value ? (0, import_dayjs_min.default)(value) : (0, import_dayjs_min.default)(value, format);
  27318. if (!dayjsValue.isValid()) return dayjsValue;
  27319. }
  27320. return (0, import_dayjs_min.default)(value, format).locale(lang);
  27321. };
  27322. //#endregion
  27323. //#region ../../packages/components/date-picker-panel/src/props/basic-date-table.ts
  27324. const basicDateTableProps = buildProps({
  27325. ...datePickerSharedProps,
  27326. showWeekNumber: Boolean,
  27327. selectionMode: selectionModeWithDefault("date")
  27328. });
  27329. const basicDateTableEmits = [
  27330. "changerange",
  27331. "pick",
  27332. "select"
  27333. ];
  27334. //#endregion
  27335. //#region ../../packages/components/date-picker-panel/src/composables/use-basic-date-table.ts
  27336. const isNormalDay = (type = "") => {
  27337. return ["normal", "today"].includes(type);
  27338. };
  27339. const useBasicDateTable = (props, emit) => {
  27340. const { lang } = useLocale();
  27341. const tbodyRef = ref();
  27342. const currentCellRef = ref();
  27343. const lastRow = ref();
  27344. const lastColumn = ref();
  27345. const tableRows = ref([
  27346. [],
  27347. [],
  27348. [],
  27349. [],
  27350. [],
  27351. []
  27352. ]);
  27353. let focusWithClick = false;
  27354. const firstDayOfWeek = props.date.$locale().weekStart || 7;
  27355. const WEEKS_CONSTANT = props.date.locale("en").localeData().weekdaysShort().map((_) => _.toLowerCase());
  27356. const offsetDay = computed(() => {
  27357. return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek;
  27358. });
  27359. const startDate = computed(() => {
  27360. const startDayOfMonth = props.date.startOf("month");
  27361. return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
  27362. });
  27363. const WEEKS = computed(() => {
  27364. return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7);
  27365. });
  27366. const hasCurrent = computed(() => {
  27367. return flatten(unref(rows)).some((row) => {
  27368. return row.isCurrent;
  27369. });
  27370. });
  27371. const days = computed(() => {
  27372. const startOfMonth = props.date.startOf("month");
  27373. return {
  27374. startOfMonthDay: startOfMonth.day() || 7,
  27375. dateCountOfMonth: startOfMonth.daysInMonth(),
  27376. dateCountOfLastMonth: startOfMonth.subtract(1, "month").daysInMonth()
  27377. };
  27378. });
  27379. const selectedDate = computed(() => {
  27380. return props.selectionMode === "dates" ? castArray(props.parsedValue) : [];
  27381. });
  27382. const setDateText = (cell, { count, rowIndex, columnIndex }) => {
  27383. const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = unref(days);
  27384. const offset = unref(offsetDay);
  27385. if (rowIndex >= 0 && rowIndex <= 1) {
  27386. const numberOfDaysFromPreviousMonth = startOfMonthDay + offset < 0 ? 7 + startOfMonthDay + offset : startOfMonthDay + offset;
  27387. if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) {
  27388. cell.text = count;
  27389. return true;
  27390. } else {
  27391. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7;
  27392. cell.type = "prev-month";
  27393. }
  27394. } else {
  27395. if (count <= dateCountOfMonth) cell.text = count;
  27396. else {
  27397. cell.text = count - dateCountOfMonth;
  27398. cell.type = "next-month";
  27399. }
  27400. return true;
  27401. }
  27402. return false;
  27403. };
  27404. const setCellMetadata = (cell, { columnIndex, rowIndex }, count) => {
  27405. const { disabledDate, cellClassName } = props;
  27406. const _selectedDate = unref(selectedDate);
  27407. const shouldIncrement = setDateText(cell, {
  27408. count,
  27409. rowIndex,
  27410. columnIndex
  27411. });
  27412. const cellDate = cell.dayjs.toDate();
  27413. cell.selected = _selectedDate.find((d) => d.isSame(cell.dayjs, "day"));
  27414. cell.isSelected = !!cell.selected;
  27415. cell.isCurrent = isCurrent(cell);
  27416. cell.disabled = disabledDate?.(cellDate);
  27417. cell.customClass = cellClassName?.(cellDate);
  27418. return shouldIncrement;
  27419. };
  27420. const setRowMetadata = (row) => {
  27421. if (props.selectionMode === "week") {
  27422. const [start, end] = props.showWeekNumber ? [1, 7] : [0, 6];
  27423. const isActive = isWeekActive(row[start + 1]);
  27424. row[start].inRange = isActive;
  27425. row[start].start = isActive;
  27426. row[end].inRange = isActive;
  27427. row[end].end = isActive;
  27428. }
  27429. };
  27430. const rows = computed(() => {
  27431. const { minDate, maxDate, rangeState, showWeekNumber } = props;
  27432. const offset = unref(offsetDay);
  27433. const rows_ = unref(tableRows);
  27434. const dateUnit = "day";
  27435. let count = 1;
  27436. buildPickerTable({
  27437. row: 6,
  27438. column: 7
  27439. }, rows_, {
  27440. startDate: minDate,
  27441. columnIndexOffset: showWeekNumber ? 1 : 0,
  27442. nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null,
  27443. now: (0, import_dayjs_min.default)().locale(unref(lang)).startOf(dateUnit),
  27444. unit: dateUnit,
  27445. relativeDateGetter: (idx) => unref(startDate).add(idx - offset, dateUnit),
  27446. setCellMetadata: (...args) => {
  27447. if (setCellMetadata(...args, count)) count += 1;
  27448. },
  27449. setRowMetadata
  27450. });
  27451. if (showWeekNumber) {
  27452. for (let rowIndex = 0; rowIndex < 6; rowIndex++) if (rows_[rowIndex][1].dayjs) rows_[rowIndex][0] = {
  27453. type: "week",
  27454. text: rows_[rowIndex][1].dayjs.week()
  27455. };
  27456. }
  27457. return rows_;
  27458. });
  27459. watch(() => props.date, async () => {
  27460. if (unref(tbodyRef)?.contains(document.activeElement)) {
  27461. await nextTick();
  27462. await focus();
  27463. }
  27464. });
  27465. const focus = async () => unref(currentCellRef)?.focus();
  27466. const isCurrent = (cell) => {
  27467. return props.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props.parsedValue);
  27468. };
  27469. const cellMatchesDate = (cell, date) => {
  27470. if (!date) return false;
  27471. return (0, import_dayjs_min.default)(date).locale(unref(lang)).isSame(props.date.date(Number(cell.text)), "day");
  27472. };
  27473. const getDateOfCell = (row, column) => {
  27474. const startOfMonthDay = unref(days).startOfMonthDay;
  27475. const offset = unref(offsetDay);
  27476. const numberOfDaysFromPreviousMonth = startOfMonthDay + offset < 0 ? 7 + startOfMonthDay + offset : startOfMonthDay + offset;
  27477. const offsetFromStart = row * 7 + (column - (props.showWeekNumber ? 1 : 0));
  27478. return props.date.startOf("month").subtract(numberOfDaysFromPreviousMonth, "day").add(offsetFromStart, "day");
  27479. };
  27480. const handleMouseMove = (event) => {
  27481. if (!props.rangeState.selecting) return;
  27482. let target = event.target;
  27483. if (target.tagName === "SPAN") target = target.parentNode?.parentNode;
  27484. if (target.tagName === "DIV") target = target.parentNode;
  27485. if (target.tagName !== "TD") return;
  27486. const row = target.parentNode.rowIndex - 1;
  27487. const column = target.cellIndex;
  27488. if (unref(rows)[row][column].disabled) return;
  27489. if (row !== unref(lastRow) || column !== unref(lastColumn)) {
  27490. lastRow.value = row;
  27491. lastColumn.value = column;
  27492. emit("changerange", {
  27493. selecting: true,
  27494. endDate: getDateOfCell(row, column)
  27495. });
  27496. }
  27497. };
  27498. const isSelectedCell = (cell) => {
  27499. return !unref(hasCurrent) && cell?.text === 1 && isNormalDay(cell.type) || cell.isCurrent;
  27500. };
  27501. const handleFocus = (event) => {
  27502. if (focusWithClick || unref(hasCurrent) || props.selectionMode !== "date") return;
  27503. handlePickDate(event, true);
  27504. };
  27505. const handleMouseDown = (event) => {
  27506. if (!event.target.closest("td")) return;
  27507. focusWithClick = true;
  27508. };
  27509. const handleMouseUp = (event) => {
  27510. if (!event.target.closest("td")) return;
  27511. focusWithClick = false;
  27512. };
  27513. const handleRangePick = (newDate) => {
  27514. if (!props.rangeState.selecting || !props.minDate) {
  27515. emit("pick", {
  27516. minDate: newDate,
  27517. maxDate: null
  27518. });
  27519. emit("select", true);
  27520. } else {
  27521. if (newDate >= props.minDate) emit("pick", {
  27522. minDate: props.minDate,
  27523. maxDate: newDate
  27524. });
  27525. else emit("pick", {
  27526. minDate: newDate,
  27527. maxDate: props.minDate
  27528. });
  27529. emit("select", false);
  27530. }
  27531. };
  27532. const handleWeekPick = (newDate) => {
  27533. const weekNumber = newDate.week();
  27534. const value = `${newDate.year()}w${weekNumber}`;
  27535. emit("pick", {
  27536. year: newDate.year(),
  27537. week: weekNumber,
  27538. value,
  27539. date: newDate.startOf("week")
  27540. });
  27541. };
  27542. const handleDatesPick = (newDate, selected) => {
  27543. emit("pick", selected ? castArray(props.parsedValue).filter((d) => d?.valueOf() !== newDate.valueOf()) : castArray(props.parsedValue).concat([newDate]));
  27544. };
  27545. const handlePickDate = (event, isKeyboardMovement = false) => {
  27546. if (props.disabled) return;
  27547. const target = event.target.closest("td");
  27548. if (!target) return;
  27549. const row = target.parentNode.rowIndex - 1;
  27550. const column = target.cellIndex;
  27551. const cell = unref(rows)[row][column];
  27552. if (cell.disabled || cell.type === "week") return;
  27553. const newDate = getDateOfCell(row, column);
  27554. switch (props.selectionMode) {
  27555. case "range":
  27556. handleRangePick(newDate);
  27557. break;
  27558. case "date":
  27559. emit("pick", newDate, isKeyboardMovement);
  27560. break;
  27561. case "week":
  27562. handleWeekPick(newDate);
  27563. break;
  27564. case "dates":
  27565. handleDatesPick(newDate, !!cell.selected);
  27566. break;
  27567. default: break;
  27568. }
  27569. };
  27570. const isWeekActive = (cell) => {
  27571. if (props.selectionMode !== "week") return false;
  27572. let newDate = props.date.startOf("day");
  27573. if (cell.type === "prev-month") newDate = newDate.subtract(1, "month");
  27574. if (cell.type === "next-month") newDate = newDate.add(1, "month");
  27575. newDate = newDate.date(Number.parseInt(cell.text, 10));
  27576. if (props.parsedValue && !isArray$1(props.parsedValue)) {
  27577. const dayOffset = (props.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
  27578. return props.parsedValue.subtract(dayOffset, "day").isSame(newDate, "day");
  27579. }
  27580. return false;
  27581. };
  27582. return {
  27583. WEEKS,
  27584. rows,
  27585. tbodyRef,
  27586. currentCellRef,
  27587. focus,
  27588. isCurrent,
  27589. isWeekActive,
  27590. isSelectedCell,
  27591. handlePickDate,
  27592. handleMouseUp,
  27593. handleMouseDown,
  27594. handleMouseMove,
  27595. handleFocus
  27596. };
  27597. };
  27598. const useBasicDateTableDOM = (props, { isCurrent, isWeekActive }) => {
  27599. const ns = useNamespace("date-table");
  27600. const { t } = useLocale();
  27601. const tableKls = computed(() => [ns.b(), ns.is("week-mode", props.selectionMode === "week" && !props.disabled)]);
  27602. const tableLabel = computed(() => t("el.datepicker.dateTablePrompt"));
  27603. const getCellClasses = (cell) => {
  27604. const classes = [];
  27605. if (isNormalDay(cell.type) && !cell.disabled) {
  27606. classes.push("available");
  27607. if (cell.type === "today") classes.push("today");
  27608. } else classes.push(cell.type);
  27609. if (isCurrent(cell)) classes.push("current");
  27610. if (cell.inRange && (isNormalDay(cell.type) || props.selectionMode === "week")) {
  27611. classes.push("in-range");
  27612. if (cell.start) classes.push("start-date");
  27613. if (cell.end) classes.push("end-date");
  27614. }
  27615. if (cell.disabled || props.disabled) classes.push("disabled");
  27616. if (cell.selected) classes.push("selected");
  27617. if (cell.customClass) classes.push(cell.customClass);
  27618. return classes.join(" ");
  27619. };
  27620. const getRowKls = (cell) => [ns.e("row"), { current: isWeekActive(cell) }];
  27621. return {
  27622. tableKls,
  27623. tableLabel,
  27624. weekHeaderClass: ns.e("week-header"),
  27625. getCellClasses,
  27626. getRowKls,
  27627. t
  27628. };
  27629. };
  27630. //#endregion
  27631. //#region ../../packages/components/date-picker-panel/src/props/basic-cell.ts
  27632. const basicCellProps = buildProps({ cell: { type: definePropType(Object) } });
  27633. //#endregion
  27634. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-cell-render.tsx
  27635. var basic_cell_render_default = /* @__PURE__ */ defineComponent({
  27636. name: "ElDatePickerCell",
  27637. props: basicCellProps,
  27638. setup(props) {
  27639. const ns = useNamespace("date-table-cell");
  27640. const { slots } = inject(ROOT_PICKER_INJECTION_KEY);
  27641. return () => {
  27642. const { cell } = props;
  27643. return renderSlot(slots, "default", { ...cell }, () => [createVNode("div", { "class": ns.b() }, [createVNode("span", { "class": ns.e("text") }, [cell?.renderText ?? cell?.text])])]);
  27644. };
  27645. }
  27646. });
  27647. //#endregion
  27648. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-date-table.vue?vue&type=script&setup=true&lang.ts
  27649. const _hoisted_1$50 = ["aria-label"];
  27650. const _hoisted_2$32 = ["aria-label"];
  27651. const _hoisted_3$15 = [
  27652. "aria-current",
  27653. "aria-selected",
  27654. "tabindex",
  27655. "aria-disabled"
  27656. ];
  27657. var basic_date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  27658. __name: "basic-date-table",
  27659. props: basicDateTableProps,
  27660. emits: basicDateTableEmits,
  27661. setup(__props, { expose: __expose, emit: __emit }) {
  27662. const props = __props;
  27663. const { WEEKS, rows, tbodyRef, currentCellRef, focus, isCurrent, isWeekActive, isSelectedCell, handlePickDate, handleMouseUp, handleMouseDown, handleMouseMove, handleFocus } = useBasicDateTable(props, __emit);
  27664. const { tableLabel, tableKls, getCellClasses, getRowKls, weekHeaderClass, t } = useBasicDateTableDOM(props, {
  27665. isCurrent,
  27666. isWeekActive
  27667. });
  27668. let isUnmounting = false;
  27669. onBeforeUnmount(() => {
  27670. isUnmounting = true;
  27671. });
  27672. __expose({ focus });
  27673. return (_ctx, _cache) => {
  27674. return openBlock(), createElementBlock("table", {
  27675. "aria-label": unref(tableLabel),
  27676. class: normalizeClass(unref(tableKls)),
  27677. cellspacing: "0",
  27678. cellpadding: "0",
  27679. role: "grid",
  27680. onClick: _cache[1] || (_cache[1] = (...args) => unref(handlePickDate) && unref(handlePickDate)(...args)),
  27681. onMousemove: _cache[2] || (_cache[2] = (...args) => unref(handleMouseMove) && unref(handleMouseMove)(...args)),
  27682. onMousedown: _cache[3] || (_cache[3] = (...args) => unref(handleMouseDown) && unref(handleMouseDown)(...args)),
  27683. onMouseup: _cache[4] || (_cache[4] = (...args) => unref(handleMouseUp) && unref(handleMouseUp)(...args))
  27684. }, [createElementVNode("tbody", {
  27685. ref_key: "tbodyRef",
  27686. ref: tbodyRef
  27687. }, [createElementVNode("tr", null, [_ctx.showWeekNumber ? (openBlock(), createElementBlock("th", {
  27688. key: 0,
  27689. scope: "col",
  27690. class: normalizeClass(unref(weekHeaderClass))
  27691. }, null, 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEKS), (week, key) => {
  27692. return openBlock(), createElementBlock("th", {
  27693. key,
  27694. "aria-label": unref(t)("el.datepicker.weeksFull." + week),
  27695. scope: "col"
  27696. }, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, _hoisted_2$32);
  27697. }), 128))]), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey) => {
  27698. return openBlock(), createElementBlock("tr", {
  27699. key: rowKey,
  27700. class: normalizeClass(unref(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1]))
  27701. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, columnKey) => {
  27702. return openBlock(), createElementBlock("td", {
  27703. key: `${rowKey}.${columnKey}`,
  27704. ref_for: true,
  27705. ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el),
  27706. class: normalizeClass(unref(getCellClasses)(cell)),
  27707. "aria-current": cell.isCurrent ? "date" : void 0,
  27708. "aria-selected": cell.isCurrent,
  27709. tabindex: _ctx.disabled ? void 0 : unref(isSelectedCell)(cell) ? 0 : -1,
  27710. "aria-disabled": _ctx.disabled,
  27711. onFocus: _cache[0] || (_cache[0] = (...args) => unref(handleFocus) && unref(handleFocus)(...args))
  27712. }, [createVNode(unref(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_3$15);
  27713. }), 128))], 2);
  27714. }), 128))], 512)], 42, _hoisted_1$50);
  27715. };
  27716. }
  27717. });
  27718. //#endregion
  27719. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-date-table.vue
  27720. var basic_date_table_default = basic_date_table_vue_vue_type_script_setup_true_lang_default;
  27721. //#endregion
  27722. //#region ../../packages/components/date-picker-panel/src/props/basic-month-table.ts
  27723. const basicMonthTableProps = buildProps({
  27724. ...datePickerSharedProps,
  27725. selectionMode: selectionModeWithDefault("month")
  27726. });
  27727. //#endregion
  27728. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-month-table.vue?vue&type=script&setup=true&lang.ts
  27729. const _hoisted_1$49 = ["aria-label"];
  27730. const _hoisted_2$31 = [
  27731. "aria-selected",
  27732. "aria-label",
  27733. "tabindex",
  27734. "onKeydown"
  27735. ];
  27736. var basic_month_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  27737. __name: "basic-month-table",
  27738. props: basicMonthTableProps,
  27739. emits: [
  27740. "changerange",
  27741. "pick",
  27742. "select"
  27743. ],
  27744. setup(__props, { expose: __expose, emit: __emit }) {
  27745. const props = __props;
  27746. const emit = __emit;
  27747. const ns = useNamespace("month-table");
  27748. const { t, lang } = useLocale();
  27749. const tbodyRef = ref();
  27750. const currentCellRef = ref();
  27751. const months = ref(props.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase()));
  27752. const tableRows = ref([
  27753. [],
  27754. [],
  27755. []
  27756. ]);
  27757. const lastRow = ref();
  27758. const lastColumn = ref();
  27759. const rows = computed(() => {
  27760. const rows = tableRows.value;
  27761. const now = (0, import_dayjs_min.default)().locale(lang.value).startOf("month");
  27762. for (let i = 0; i < 3; i++) {
  27763. const row = rows[i];
  27764. for (let j = 0; j < 4; j++) {
  27765. const cell = row[j] ||= {
  27766. row: i,
  27767. column: j,
  27768. type: "normal",
  27769. inRange: false,
  27770. start: false,
  27771. end: false,
  27772. text: -1,
  27773. disabled: false,
  27774. isSelected: false,
  27775. customClass: void 0,
  27776. date: void 0,
  27777. dayjs: void 0,
  27778. isCurrent: void 0,
  27779. selected: void 0,
  27780. renderText: void 0,
  27781. timestamp: void 0
  27782. };
  27783. cell.type = "normal";
  27784. const index = i * 4 + j;
  27785. const calTime = props.date.startOf("year").month(index);
  27786. const calEndDate = props.rangeState.endDate || props.maxDate || props.rangeState.selecting && props.minDate || null;
  27787. cell.inRange = !!(props.minDate && calTime.isSameOrAfter(props.minDate, "month") && calEndDate && calTime.isSameOrBefore(calEndDate, "month")) || !!(props.minDate && calTime.isSameOrBefore(props.minDate, "month") && calEndDate && calTime.isSameOrAfter(calEndDate, "month"));
  27788. if (props.minDate?.isSameOrAfter(calEndDate)) {
  27789. cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  27790. cell.end = props.minDate && calTime.isSame(props.minDate, "month");
  27791. } else {
  27792. cell.start = !!(props.minDate && calTime.isSame(props.minDate, "month"));
  27793. cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  27794. }
  27795. if (now.isSame(calTime)) cell.type = "today";
  27796. const cellDate = calTime.toDate();
  27797. cell.text = index;
  27798. cell.disabled = props.disabledDate?.(cellDate) || false;
  27799. cell.date = cellDate;
  27800. cell.customClass = props.cellClassName?.(cellDate);
  27801. cell.dayjs = calTime;
  27802. cell.timestamp = calTime.valueOf();
  27803. cell.isSelected = isSelectedCell(cell);
  27804. }
  27805. }
  27806. return rows;
  27807. });
  27808. const focus = () => {
  27809. currentCellRef.value?.focus();
  27810. };
  27811. const getCellStyle = (cell) => {
  27812. const style = {};
  27813. const year = props.date.year();
  27814. const today = /* @__PURE__ */ new Date();
  27815. const month = cell.text;
  27816. style.disabled = props.disabled || (props.disabledDate ? datesInMonth(props.date, year, month, lang.value).every(props.disabledDate) : false);
  27817. style.current = castArray(props.parsedValue).some((date) => import_dayjs_min.default.isDayjs(date) && date.year() === year && date.month() === month);
  27818. style.today = today.getFullYear() === year && today.getMonth() === month;
  27819. if (cell.customClass) style[cell.customClass] = true;
  27820. if (cell.inRange) {
  27821. style["in-range"] = true;
  27822. if (cell.start) style["start-date"] = true;
  27823. if (cell.end) style["end-date"] = true;
  27824. }
  27825. return style;
  27826. };
  27827. const isSelectedCell = (cell) => {
  27828. const year = props.date.year();
  27829. const month = cell.text;
  27830. return castArray(props.date).some((date) => date.year() === year && date.month() === month);
  27831. };
  27832. const handleMouseMove = (event) => {
  27833. if (!props.rangeState.selecting) return;
  27834. let target = event.target;
  27835. if (target.tagName === "SPAN") target = target.parentNode?.parentNode;
  27836. if (target.tagName === "DIV") target = target.parentNode;
  27837. if (target.tagName !== "TD") return;
  27838. const row = target.parentNode.rowIndex;
  27839. const column = target.cellIndex;
  27840. if (rows.value[row][column].disabled) return;
  27841. if (row !== lastRow.value || column !== lastColumn.value) {
  27842. lastRow.value = row;
  27843. lastColumn.value = column;
  27844. emit("changerange", {
  27845. selecting: true,
  27846. endDate: props.date.startOf("year").month(row * 4 + column)
  27847. });
  27848. }
  27849. };
  27850. const handleMonthTableClick = (event) => {
  27851. if (props.disabled) return;
  27852. const target = event.target?.closest("td");
  27853. if (target?.tagName !== "TD") return;
  27854. if (hasClass(target, "disabled")) return;
  27855. const column = target.cellIndex;
  27856. const month = target.parentNode.rowIndex * 4 + column;
  27857. const newDate = props.date.startOf("year").month(month);
  27858. if (props.selectionMode === "months") {
  27859. if (event.type === "keydown") {
  27860. emit("pick", castArray(props.parsedValue), false);
  27861. return;
  27862. }
  27863. const newMonth = getValidDateOfMonth(props.date, props.date.year(), month, lang.value, props.disabledDate);
  27864. emit("pick", hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => d?.year() !== newMonth.year() || d?.month() !== newMonth.month()) : castArray(props.parsedValue).concat([(0, import_dayjs_min.default)(newMonth)]));
  27865. } else if (props.selectionMode === "range") if (!props.rangeState.selecting) {
  27866. emit("pick", {
  27867. minDate: newDate,
  27868. maxDate: null
  27869. });
  27870. emit("select", true);
  27871. } else {
  27872. if (props.minDate && newDate >= props.minDate) emit("pick", {
  27873. minDate: props.minDate,
  27874. maxDate: newDate
  27875. });
  27876. else emit("pick", {
  27877. minDate: newDate,
  27878. maxDate: props.minDate
  27879. });
  27880. emit("select", false);
  27881. }
  27882. else emit("pick", month);
  27883. };
  27884. watch(() => props.date, async () => {
  27885. if (tbodyRef.value?.contains(document.activeElement)) {
  27886. await nextTick();
  27887. currentCellRef.value?.focus();
  27888. }
  27889. });
  27890. __expose({ focus });
  27891. return (_ctx, _cache) => {
  27892. return openBlock(), createElementBlock("table", {
  27893. role: "grid",
  27894. "aria-label": unref(t)("el.datepicker.monthTablePrompt"),
  27895. class: normalizeClass(unref(ns).b()),
  27896. onClick: handleMonthTableClick,
  27897. onMousemove: handleMouseMove
  27898. }, [createElementVNode("tbody", {
  27899. ref_key: "tbodyRef",
  27900. ref: tbodyRef
  27901. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, key) => {
  27902. return openBlock(), createElementBlock("tr", { key }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key_) => {
  27903. return openBlock(), createElementBlock("td", {
  27904. key: key_,
  27905. ref_for: true,
  27906. ref: (el) => cell.isSelected && (currentCellRef.value = el),
  27907. class: normalizeClass(getCellStyle(cell)),
  27908. "aria-selected": !!cell.isSelected,
  27909. "aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`),
  27910. tabindex: cell.isSelected ? 0 : -1,
  27911. onKeydown: [withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]), withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])]
  27912. }, [createVNode(unref(basic_cell_render_default), { cell: {
  27913. ...cell,
  27914. renderText: unref(t)("el.datepicker.months." + months.value[cell.text])
  27915. } }, null, 8, ["cell"])], 42, _hoisted_2$31);
  27916. }), 128))]);
  27917. }), 128))], 512)], 42, _hoisted_1$49);
  27918. };
  27919. }
  27920. });
  27921. //#endregion
  27922. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-month-table.vue
  27923. var basic_month_table_default = basic_month_table_vue_vue_type_script_setup_true_lang_default;
  27924. //#endregion
  27925. //#region ../../packages/components/date-picker-panel/src/props/basic-year-table.ts
  27926. const basicYearTableProps = buildProps({
  27927. ...datePickerSharedProps,
  27928. selectionMode: selectionModeWithDefault("year")
  27929. });
  27930. //#endregion
  27931. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-year-table.vue?vue&type=script&setup=true&lang.ts
  27932. const _hoisted_1$48 = ["aria-label"];
  27933. const _hoisted_2$30 = [
  27934. "aria-selected",
  27935. "aria-label",
  27936. "tabindex",
  27937. "onKeydown"
  27938. ];
  27939. var basic_year_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  27940. __name: "basic-year-table",
  27941. props: basicYearTableProps,
  27942. emits: [
  27943. "changerange",
  27944. "pick",
  27945. "select"
  27946. ],
  27947. setup(__props, { expose: __expose, emit: __emit }) {
  27948. const datesInYear = (year, lang) => {
  27949. const firstDay = (0, import_dayjs_min.default)(String(year)).locale(lang).startOf("year");
  27950. return rangeArr(firstDay.endOf("year").dayOfYear()).map((n) => firstDay.add(n, "day").toDate());
  27951. };
  27952. const props = __props;
  27953. const emit = __emit;
  27954. const ns = useNamespace("year-table");
  27955. const { t, lang } = useLocale();
  27956. const tbodyRef = ref();
  27957. const currentCellRef = ref();
  27958. const startYear = computed(() => {
  27959. return Math.floor(props.date.year() / 10) * 10;
  27960. });
  27961. const tableRows = ref([
  27962. [],
  27963. [],
  27964. []
  27965. ]);
  27966. const lastRow = ref();
  27967. const lastColumn = ref();
  27968. const rows = computed(() => {
  27969. const rows = tableRows.value;
  27970. const now = (0, import_dayjs_min.default)().locale(lang.value).startOf("year");
  27971. for (let i = 0; i < 3; i++) {
  27972. const row = rows[i];
  27973. for (let j = 0; j < 4; j++) {
  27974. if (i * 4 + j >= 10) break;
  27975. let cell = row[j];
  27976. if (!cell) cell = {
  27977. row: i,
  27978. column: j,
  27979. type: "normal",
  27980. inRange: false,
  27981. start: false,
  27982. end: false,
  27983. text: -1,
  27984. disabled: false,
  27985. isSelected: false,
  27986. customClass: void 0,
  27987. date: void 0,
  27988. dayjs: void 0,
  27989. isCurrent: void 0,
  27990. selected: void 0,
  27991. renderText: void 0,
  27992. timestamp: void 0
  27993. };
  27994. cell.type = "normal";
  27995. const index = i * 4 + j + startYear.value;
  27996. const calTime = (0, import_dayjs_min.default)().year(index);
  27997. const calEndDate = props.rangeState.endDate || props.maxDate || props.rangeState.selecting && props.minDate || null;
  27998. cell.inRange = !!(props.minDate && calTime.isSameOrAfter(props.minDate, "year") && calEndDate && calTime.isSameOrBefore(calEndDate, "year")) || !!(props.minDate && calTime.isSameOrBefore(props.minDate, "year") && calEndDate && calTime.isSameOrAfter(calEndDate, "year"));
  27999. if (props.minDate?.isSameOrAfter(calEndDate)) {
  28000. cell.start = !!(calEndDate && calTime.isSame(calEndDate, "year"));
  28001. cell.end = !!(props.minDate && calTime.isSame(props.minDate, "year"));
  28002. } else {
  28003. cell.start = !!(props.minDate && calTime.isSame(props.minDate, "year"));
  28004. cell.end = !!(calEndDate && calTime.isSame(calEndDate, "year"));
  28005. }
  28006. if (now.isSame(calTime)) cell.type = "today";
  28007. cell.text = index;
  28008. const cellDate = calTime.toDate();
  28009. cell.disabled = props.disabledDate?.(cellDate) || false;
  28010. cell.date = cellDate;
  28011. cell.customClass = props.cellClassName?.(cellDate);
  28012. cell.dayjs = calTime;
  28013. cell.timestamp = calTime.valueOf();
  28014. cell.isSelected = isSelectedCell(cell);
  28015. row[j] = cell;
  28016. }
  28017. }
  28018. return rows;
  28019. });
  28020. const focus = () => {
  28021. currentCellRef.value?.focus();
  28022. };
  28023. const getCellKls = (cell) => {
  28024. const kls = {};
  28025. const today = (0, import_dayjs_min.default)().locale(lang.value);
  28026. const year = cell.text;
  28027. kls.disabled = props.disabled || (props.disabledDate ? datesInYear(year, lang.value).every(props.disabledDate) : false);
  28028. kls.today = today.year() === year;
  28029. kls.current = castArray(props.parsedValue).some((d) => d.year() === year);
  28030. if (cell.customClass) kls[cell.customClass] = true;
  28031. if (cell.inRange) {
  28032. kls["in-range"] = true;
  28033. if (cell.start) kls["start-date"] = true;
  28034. if (cell.end) kls["end-date"] = true;
  28035. }
  28036. return kls;
  28037. };
  28038. const isSelectedCell = (cell) => {
  28039. const year = cell.text;
  28040. return castArray(props.date).some((date) => date.year() === year);
  28041. };
  28042. const handleYearTableClick = (event) => {
  28043. if (props.disabled) return;
  28044. const target = event.target?.closest("td");
  28045. if (!target || !target.textContent || hasClass(target, "disabled")) return;
  28046. const column = target.cellIndex;
  28047. const selectedYear = target.parentNode.rowIndex * 4 + column + startYear.value;
  28048. const newDate = (0, import_dayjs_min.default)().year(selectedYear);
  28049. if (props.selectionMode === "range") if (!props.rangeState.selecting) {
  28050. emit("pick", {
  28051. minDate: newDate,
  28052. maxDate: null
  28053. });
  28054. emit("select", true);
  28055. } else {
  28056. if (props.minDate && newDate >= props.minDate) emit("pick", {
  28057. minDate: props.minDate,
  28058. maxDate: newDate
  28059. });
  28060. else emit("pick", {
  28061. minDate: newDate,
  28062. maxDate: props.minDate
  28063. });
  28064. emit("select", false);
  28065. }
  28066. else if (props.selectionMode === "years") {
  28067. if (event.type === "keydown") {
  28068. emit("pick", castArray(props.parsedValue), false);
  28069. return;
  28070. }
  28071. const vaildYear = getValidDateOfYear(newDate.startOf("year"), lang.value, props.disabledDate);
  28072. emit("pick", hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => d?.year() !== selectedYear) : castArray(props.parsedValue).concat([vaildYear]));
  28073. } else emit("pick", selectedYear);
  28074. };
  28075. const handleMouseMove = (event) => {
  28076. if (!props.rangeState.selecting) return;
  28077. const target = event.target?.closest("td");
  28078. if (!target) return;
  28079. const row = target.parentNode.rowIndex;
  28080. const column = target.cellIndex;
  28081. if (rows.value[row][column].disabled) return;
  28082. if (row !== lastRow.value || column !== lastColumn.value) {
  28083. lastRow.value = row;
  28084. lastColumn.value = column;
  28085. emit("changerange", {
  28086. selecting: true,
  28087. endDate: (0, import_dayjs_min.default)().year(startYear.value).add(row * 4 + column, "year")
  28088. });
  28089. }
  28090. };
  28091. watch(() => props.date, async () => {
  28092. if (tbodyRef.value?.contains(document.activeElement)) {
  28093. await nextTick();
  28094. currentCellRef.value?.focus();
  28095. }
  28096. });
  28097. __expose({ focus });
  28098. return (_ctx, _cache) => {
  28099. return openBlock(), createElementBlock("table", {
  28100. role: "grid",
  28101. "aria-label": unref(t)("el.datepicker.yearTablePrompt"),
  28102. class: normalizeClass(unref(ns).b()),
  28103. onClick: handleYearTableClick,
  28104. onMousemove: handleMouseMove
  28105. }, [createElementVNode("tbody", {
  28106. ref_key: "tbodyRef",
  28107. ref: tbodyRef
  28108. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, rowKey) => {
  28109. return openBlock(), createElementBlock("tr", { key: rowKey }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellKey) => {
  28110. return openBlock(), createElementBlock("td", {
  28111. key: `${rowKey}_${cellKey}`,
  28112. ref_for: true,
  28113. ref: (el) => cell.isSelected && (currentCellRef.value = el),
  28114. class: normalizeClass(["available", getCellKls(cell)]),
  28115. "aria-selected": cell.isSelected,
  28116. "aria-label": String(cell.text),
  28117. tabindex: cell.isSelected ? 0 : -1,
  28118. onKeydown: [withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]), withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])]
  28119. }, [createVNode(unref(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_2$30);
  28120. }), 128))]);
  28121. }), 128))], 512)], 42, _hoisted_1$48);
  28122. };
  28123. }
  28124. });
  28125. //#endregion
  28126. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-year-table.vue
  28127. var basic_year_table_default = basic_year_table_vue_vue_type_script_setup_true_lang_default;
  28128. //#endregion
  28129. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue?vue&type=script&setup=true&lang.ts
  28130. const _hoisted_1$47 = ["disabled", "onClick"];
  28131. const _hoisted_2$29 = ["aria-label", "disabled"];
  28132. const _hoisted_3$14 = ["aria-label", "disabled"];
  28133. const _hoisted_4$11 = ["tabindex", "aria-disabled"];
  28134. const _hoisted_5$8 = ["tabindex", "aria-disabled"];
  28135. const _hoisted_6$3 = ["aria-label", "disabled"];
  28136. const _hoisted_7$2 = ["aria-label", "disabled"];
  28137. var panel_date_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  28138. __name: "panel-date-pick",
  28139. props: panelDatePickProps,
  28140. emits: [
  28141. "pick",
  28142. "set-picker-option",
  28143. "panel-change"
  28144. ],
  28145. setup(__props, { emit: __emit }) {
  28146. const timeWithinRange = (_, __, ___) => true;
  28147. const props = __props;
  28148. const contextEmit = __emit;
  28149. const ppNs = useNamespace("picker-panel");
  28150. const dpNs = useNamespace("date-picker");
  28151. const attrs = useAttrs$1();
  28152. const slots = useSlots();
  28153. const { t, lang } = useLocale();
  28154. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  28155. const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  28156. const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
  28157. const defaultValue = toRef(pickerBase.props, "defaultValue");
  28158. const currentViewRef = ref();
  28159. const innerDate = ref((0, import_dayjs_min.default)().locale(lang.value));
  28160. const isChangeToNow = ref(false);
  28161. let isShortcut = false;
  28162. const defaultTimeD = computed(() => {
  28163. return (0, import_dayjs_min.default)(defaultTime).locale(lang.value);
  28164. });
  28165. const month = computed(() => {
  28166. return innerDate.value.month();
  28167. });
  28168. const year = computed(() => {
  28169. return innerDate.value.year();
  28170. });
  28171. const selectableRange = ref([]);
  28172. const userInputDate = ref(null);
  28173. const userInputTime = ref(null);
  28174. const checkDateWithinRange = (date) => {
  28175. return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || "HH:mm:ss") : true;
  28176. };
  28177. const formatEmit = (emitDayjs) => {
  28178. if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  28179. if (showTime.value) return emitDayjs.millisecond(0);
  28180. return emitDayjs.startOf("day");
  28181. };
  28182. const emit = (value, ...args) => {
  28183. if (!value) contextEmit("pick", value, ...args);
  28184. else if (isArray$1(value)) contextEmit("pick", value.map(formatEmit), ...args);
  28185. else contextEmit("pick", formatEmit(value), ...args);
  28186. userInputDate.value = null;
  28187. userInputTime.value = null;
  28188. isChangeToNow.value = false;
  28189. isShortcut = false;
  28190. };
  28191. const handleDatePick = async (value, keepOpen) => {
  28192. if (selectionMode.value === "date" && import_dayjs_min.default.isDayjs(value)) {
  28193. const parsedDateValue = extractFirst(props.parsedValue);
  28194. let newDate = parsedDateValue ? parsedDateValue.year(value.year()).month(value.month()).date(value.date()) : value;
  28195. if (!checkDateWithinRange(newDate)) newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
  28196. innerDate.value = newDate;
  28197. emit(newDate, showTime.value || keepOpen);
  28198. } else if (selectionMode.value === "week") emit(value.date);
  28199. else if (selectionMode.value === "dates") emit(value, true);
  28200. };
  28201. const moveByMonth = (forward) => {
  28202. const action = forward ? "add" : "subtract";
  28203. innerDate.value = innerDate.value[action](1, "month");
  28204. handlePanelChange("month");
  28205. };
  28206. const moveByYear = (forward) => {
  28207. const currentDate = innerDate.value;
  28208. const action = forward ? "add" : "subtract";
  28209. innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
  28210. handlePanelChange("year");
  28211. };
  28212. const currentView = ref("date");
  28213. const yearLabel = computed(() => {
  28214. const yearTranslation = t("el.datepicker.year");
  28215. if (currentView.value === "year") {
  28216. const startYear = Math.floor(year.value / 10) * 10;
  28217. if (yearTranslation) return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
  28218. return `${startYear} - ${startYear + 9}`;
  28219. }
  28220. return `${year.value} ${yearTranslation}`;
  28221. });
  28222. const handleShortcutClick = (shortcut) => {
  28223. const shortcutValue = isFunction$1(shortcut.value) ? shortcut.value() : shortcut.value;
  28224. if (shortcutValue) {
  28225. isShortcut = true;
  28226. emit((0, import_dayjs_min.default)(shortcutValue).locale(lang.value));
  28227. return;
  28228. }
  28229. if (shortcut.onClick) shortcut.onClick({
  28230. attrs,
  28231. slots,
  28232. emit: contextEmit
  28233. });
  28234. };
  28235. const selectionMode = computed(() => {
  28236. const { type } = props;
  28237. if ([
  28238. "week",
  28239. "month",
  28240. "months",
  28241. "year",
  28242. "years",
  28243. "dates"
  28244. ].includes(type)) return type;
  28245. return "date";
  28246. });
  28247. const isMultipleType = computed(() => {
  28248. return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years";
  28249. });
  28250. const keyboardMode = computed(() => {
  28251. return selectionMode.value === "date" ? currentView.value : selectionMode.value;
  28252. });
  28253. const hasShortcuts = computed(() => !!shortcuts.length);
  28254. const handleMonthPick = async (month, keepOpen) => {
  28255. if (selectionMode.value === "month") {
  28256. innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month, lang.value, disabledDate);
  28257. emit(innerDate.value, false);
  28258. } else if (selectionMode.value === "months") emit(month, keepOpen ?? true);
  28259. else {
  28260. innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month, lang.value, disabledDate);
  28261. currentView.value = "date";
  28262. if ([
  28263. "month",
  28264. "year",
  28265. "date",
  28266. "week"
  28267. ].includes(selectionMode.value)) {
  28268. emit(innerDate.value, true);
  28269. await nextTick();
  28270. handleFocusPicker();
  28271. }
  28272. }
  28273. handlePanelChange("month");
  28274. };
  28275. const handleYearPick = async (year, keepOpen) => {
  28276. if (selectionMode.value === "year") {
  28277. innerDate.value = getValidDateOfYear(innerDate.value.startOf("year").year(year), lang.value, disabledDate);
  28278. emit(innerDate.value, false);
  28279. } else if (selectionMode.value === "years") emit(year, keepOpen ?? true);
  28280. else {
  28281. innerDate.value = getValidDateOfYear(innerDate.value.year(year), lang.value, disabledDate);
  28282. currentView.value = "month";
  28283. if ([
  28284. "month",
  28285. "year",
  28286. "date",
  28287. "week"
  28288. ].includes(selectionMode.value)) {
  28289. emit(innerDate.value, true);
  28290. await nextTick();
  28291. handleFocusPicker();
  28292. }
  28293. }
  28294. handlePanelChange("year");
  28295. };
  28296. const dateDisabled = useFormDisabled();
  28297. const showPicker = async (view) => {
  28298. if (dateDisabled.value) return;
  28299. currentView.value = view;
  28300. await nextTick();
  28301. handleFocusPicker();
  28302. };
  28303. const showTime = computed(() => props.type === "datetime" || props.type === "datetimerange");
  28304. const footerVisible = computed(() => {
  28305. const showDateFooter = showTime.value || selectionMode.value === "dates";
  28306. const showYearFooter = selectionMode.value === "years";
  28307. const showMonthFooter = selectionMode.value === "months";
  28308. const isDateView = currentView.value === "date";
  28309. const isYearView = currentView.value === "year";
  28310. const isMonthView = currentView.value === "month";
  28311. return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
  28312. });
  28313. const footerFilled = computed(() => !isMultipleType.value && props.showNow || props.showConfirm);
  28314. const disabledConfirm = computed(() => {
  28315. if (!disabledDate) return false;
  28316. if (!props.parsedValue) return true;
  28317. if (isArray$1(props.parsedValue)) return disabledDate(props.parsedValue[0].toDate());
  28318. return disabledDate(props.parsedValue.toDate());
  28319. });
  28320. const onConfirm = () => {
  28321. if (isMultipleType.value) emit(props.parsedValue);
  28322. else {
  28323. let result = extractFirst(props.parsedValue);
  28324. if (!result) {
  28325. const defaultTimeD = (0, import_dayjs_min.default)(defaultTime).locale(lang.value);
  28326. const defaultValueD = getDefaultValue();
  28327. result = defaultTimeD.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
  28328. }
  28329. innerDate.value = result;
  28330. emit(result);
  28331. }
  28332. };
  28333. const disabledNow = computed(() => {
  28334. if (!disabledDate) return false;
  28335. return disabledDate((0, import_dayjs_min.default)().locale(lang.value).toDate());
  28336. });
  28337. const changeToNow = () => {
  28338. const nowDate = (0, import_dayjs_min.default)().locale(lang.value).toDate();
  28339. isChangeToNow.value = true;
  28340. if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
  28341. innerDate.value = (0, import_dayjs_min.default)().locale(lang.value);
  28342. emit(innerDate.value);
  28343. }
  28344. };
  28345. const timeFormat = computed(() => {
  28346. return props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME;
  28347. });
  28348. const dateFormat = computed(() => {
  28349. return props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE;
  28350. });
  28351. const visibleTime = computed(() => {
  28352. if (userInputTime.value) return userInputTime.value;
  28353. if (!props.parsedValue && !defaultValue.value) return;
  28354. return (extractFirst(props.parsedValue) || innerDate.value).format(timeFormat.value);
  28355. });
  28356. const visibleDate = computed(() => {
  28357. if (userInputDate.value) return userInputDate.value;
  28358. if (!props.parsedValue && !defaultValue.value) return;
  28359. return (extractFirst(props.parsedValue) || innerDate.value).format(dateFormat.value);
  28360. });
  28361. const timePickerVisible = ref(false);
  28362. const onTimePickerInputFocus = () => {
  28363. timePickerVisible.value = true;
  28364. };
  28365. const handleTimePickClose = () => {
  28366. timePickerVisible.value = false;
  28367. };
  28368. const getUnits = (date) => {
  28369. return {
  28370. hour: date.hour(),
  28371. minute: date.minute(),
  28372. second: date.second(),
  28373. year: date.year(),
  28374. month: date.month(),
  28375. date: date.date()
  28376. };
  28377. };
  28378. const handleTimePick = (value, visible, first) => {
  28379. const { hour, minute, second } = getUnits(value);
  28380. const parsedDateValue = extractFirst(props.parsedValue);
  28381. innerDate.value = parsedDateValue ? parsedDateValue.hour(hour).minute(minute).second(second) : value;
  28382. emit(innerDate.value, true);
  28383. if (!first) timePickerVisible.value = visible;
  28384. };
  28385. const handleVisibleTimeChange = (value) => {
  28386. const newDate = (0, import_dayjs_min.default)(value, timeFormat.value).locale(lang.value);
  28387. if (newDate.isValid() && checkDateWithinRange(newDate)) {
  28388. const { year, month, date } = getUnits(innerDate.value);
  28389. innerDate.value = newDate.year(year).month(month).date(date);
  28390. userInputTime.value = null;
  28391. timePickerVisible.value = false;
  28392. emit(innerDate.value, true);
  28393. }
  28394. };
  28395. const handleVisibleDateChange = (value) => {
  28396. const newDate = correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat);
  28397. if (newDate.isValid()) {
  28398. if (disabledDate && disabledDate(newDate.toDate())) return;
  28399. const { hour, minute, second } = getUnits(innerDate.value);
  28400. innerDate.value = newDate.hour(hour).minute(minute).second(second);
  28401. userInputDate.value = null;
  28402. emit(innerDate.value, true);
  28403. }
  28404. };
  28405. const isValidValue = (date) => {
  28406. return import_dayjs_min.default.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
  28407. };
  28408. const parseUserInput = (value) => {
  28409. return correctlyParseUserInput(value, props.format, lang.value, isDefaultFormat);
  28410. };
  28411. const getDefaultValue = () => {
  28412. const parseDate = (0, import_dayjs_min.default)(defaultValue.value).locale(lang.value);
  28413. if (!defaultValue.value) {
  28414. const defaultTimeDValue = defaultTimeD.value;
  28415. return (0, import_dayjs_min.default)().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
  28416. }
  28417. return parseDate;
  28418. };
  28419. const handleFocusPicker = () => {
  28420. if ([
  28421. "week",
  28422. "month",
  28423. "year",
  28424. "date"
  28425. ].includes(selectionMode.value)) currentViewRef.value?.focus();
  28426. };
  28427. const _handleFocusPicker = () => {
  28428. handleFocusPicker();
  28429. if (selectionMode.value === "week") handleKeyControl(EVENT_CODE.down);
  28430. };
  28431. const handleKeydownTable = (event) => {
  28432. const code = getEventCode(event);
  28433. if ([
  28434. EVENT_CODE.up,
  28435. EVENT_CODE.down,
  28436. EVENT_CODE.left,
  28437. EVENT_CODE.right,
  28438. EVENT_CODE.home,
  28439. EVENT_CODE.end,
  28440. EVENT_CODE.pageUp,
  28441. EVENT_CODE.pageDown
  28442. ].includes(code)) {
  28443. handleKeyControl(code);
  28444. event.stopPropagation();
  28445. event.preventDefault();
  28446. }
  28447. if ([
  28448. EVENT_CODE.enter,
  28449. EVENT_CODE.space,
  28450. EVENT_CODE.numpadEnter
  28451. ].includes(code) && userInputDate.value === null && userInputTime.value === null) {
  28452. event.preventDefault();
  28453. emit(innerDate.value, false);
  28454. }
  28455. };
  28456. const handleKeyControl = (code) => {
  28457. const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE;
  28458. const mapping = {
  28459. year: {
  28460. [up]: -4,
  28461. [down]: 4,
  28462. [left]: -1,
  28463. [right]: 1,
  28464. offset: (date, step) => date.setFullYear(date.getFullYear() + step)
  28465. },
  28466. month: {
  28467. [up]: -4,
  28468. [down]: 4,
  28469. [left]: -1,
  28470. [right]: 1,
  28471. offset: (date, step) => date.setMonth(date.getMonth() + step)
  28472. },
  28473. week: {
  28474. [up]: -1,
  28475. [down]: 1,
  28476. [left]: -1,
  28477. [right]: 1,
  28478. offset: (date, step) => date.setDate(date.getDate() + step * 7)
  28479. },
  28480. date: {
  28481. [up]: -7,
  28482. [down]: 7,
  28483. [left]: -1,
  28484. [right]: 1,
  28485. [home]: (date) => -date.getDay(),
  28486. [end]: (date) => -date.getDay() + 6,
  28487. [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
  28488. [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
  28489. offset: (date, step) => date.setDate(date.getDate() + step)
  28490. }
  28491. };
  28492. const newDate = innerDate.value.toDate();
  28493. while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
  28494. const map = mapping[keyboardMode.value];
  28495. if (!map) return;
  28496. map.offset(newDate, isFunction$1(map[code]) ? map[code](newDate) : map[code] ?? 0);
  28497. if (disabledDate && disabledDate(newDate)) break;
  28498. const result = (0, import_dayjs_min.default)(newDate).locale(lang.value);
  28499. innerDate.value = result;
  28500. contextEmit("pick", result, true);
  28501. break;
  28502. }
  28503. };
  28504. const handlePanelChange = (mode) => {
  28505. contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
  28506. };
  28507. watch(() => selectionMode.value, (val) => {
  28508. if (["month", "year"].includes(val)) {
  28509. currentView.value = val;
  28510. return;
  28511. } else if (val === "years") {
  28512. currentView.value = "year";
  28513. return;
  28514. } else if (val === "months") {
  28515. currentView.value = "month";
  28516. return;
  28517. }
  28518. currentView.value = "date";
  28519. }, { immediate: true });
  28520. watch(() => defaultValue.value, (val) => {
  28521. if (val) innerDate.value = getDefaultValue();
  28522. }, { immediate: true });
  28523. watch(() => props.parsedValue, (val) => {
  28524. if (val) {
  28525. if (isMultipleType.value) return;
  28526. if (isArray$1(val)) return;
  28527. innerDate.value = val;
  28528. } else innerDate.value = getDefaultValue();
  28529. }, { immediate: true });
  28530. contextEmit("set-picker-option", ["isValidValue", isValidValue]);
  28531. contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
  28532. contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
  28533. return (_ctx, _cache) => {
  28534. return openBlock(), createElementBlock("div", { class: normalizeClass([
  28535. unref(ppNs).b(),
  28536. unref(dpNs).b(),
  28537. unref(ppNs).is("border", _ctx.border),
  28538. unref(ppNs).is("disabled", unref(dateDisabled)),
  28539. {
  28540. "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
  28541. "has-time": showTime.value
  28542. }
  28543. ]) }, [createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [
  28544. renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }),
  28545. hasShortcuts.value ? (openBlock(), createElementBlock("div", {
  28546. key: 0,
  28547. class: normalizeClass(unref(ppNs).e("sidebar"))
  28548. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
  28549. return openBlock(), createElementBlock("button", {
  28550. key,
  28551. type: "button",
  28552. disabled: unref(dateDisabled),
  28553. class: normalizeClass(unref(ppNs).e("shortcut")),
  28554. onClick: ($event) => handleShortcutClick(shortcut)
  28555. }, toDisplayString(shortcut.text), 11, _hoisted_1$47);
  28556. }), 128))], 2)) : createCommentVNode("v-if", true),
  28557. createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [
  28558. showTime.value ? (openBlock(), createElementBlock("div", {
  28559. key: 0,
  28560. class: normalizeClass(unref(dpNs).e("time-header"))
  28561. }, [createElementVNode("span", { class: normalizeClass(unref(dpNs).e("editor-wrap")) }, [createVNode(unref(ElInput), {
  28562. placeholder: unref(t)("el.datepicker.selectDate"),
  28563. "model-value": visibleDate.value,
  28564. size: "small",
  28565. "validate-event": false,
  28566. disabled: unref(dateDisabled),
  28567. readonly: !_ctx.editable,
  28568. onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
  28569. onChange: handleVisibleDateChange
  28570. }, null, 8, [
  28571. "placeholder",
  28572. "model-value",
  28573. "disabled",
  28574. "readonly"
  28575. ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(dpNs).e("editor-wrap")) }, [createVNode(unref(ElInput), {
  28576. placeholder: unref(t)("el.datepicker.selectTime"),
  28577. "model-value": visibleTime.value,
  28578. size: "small",
  28579. "validate-event": false,
  28580. disabled: unref(dateDisabled),
  28581. readonly: !_ctx.editable,
  28582. onFocus: onTimePickerInputFocus,
  28583. onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
  28584. onChange: handleVisibleTimeChange
  28585. }, null, 8, [
  28586. "placeholder",
  28587. "model-value",
  28588. "disabled",
  28589. "readonly"
  28590. ]), createVNode(unref(panel_time_pick_default), {
  28591. visible: timePickerVisible.value,
  28592. format: timeFormat.value,
  28593. "parsed-value": innerDate.value,
  28594. onPick: handleTimePick
  28595. }, null, 8, [
  28596. "visible",
  28597. "format",
  28598. "parsed-value"
  28599. ])], 2)), [[unref(ClickOutside), handleTimePickClose]])], 2)) : createCommentVNode("v-if", true),
  28600. withDirectives(createElementVNode("div", { class: normalizeClass([unref(dpNs).e("header"), (currentView.value === "year" || currentView.value === "month") && unref(dpNs).em("header", "bordered")]) }, [
  28601. createElementVNode("span", { class: normalizeClass(unref(dpNs).e("prev-btn")) }, [createElementVNode("button", {
  28602. type: "button",
  28603. "aria-label": unref(t)(`el.datepicker.prevYear`),
  28604. class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]),
  28605. disabled: unref(dateDisabled),
  28606. onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
  28607. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  28608. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  28609. _: 1
  28610. })])], 10, _hoisted_2$29), withDirectives(createElementVNode("button", {
  28611. type: "button",
  28612. "aria-label": unref(t)(`el.datepicker.prevMonth`),
  28613. class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
  28614. disabled: unref(dateDisabled),
  28615. onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
  28616. }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, {
  28617. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  28618. _: 1
  28619. })])], 10, _hoisted_3$14), [[vShow, currentView.value === "date"]])], 2),
  28620. createElementVNode("span", {
  28621. role: "button",
  28622. class: normalizeClass(unref(dpNs).e("header-label")),
  28623. "aria-live": "polite",
  28624. tabindex: _ctx.disabled ? void 0 : 0,
  28625. "aria-disabled": _ctx.disabled,
  28626. onKeydown: _cache[4] || (_cache[4] = withKeys(($event) => showPicker("year"), ["enter"])),
  28627. onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
  28628. }, toDisplayString(yearLabel.value), 43, _hoisted_4$11),
  28629. withDirectives(createElementVNode("span", {
  28630. role: "button",
  28631. "aria-live": "polite",
  28632. tabindex: _ctx.disabled ? void 0 : 0,
  28633. "aria-disabled": _ctx.disabled,
  28634. class: normalizeClass([unref(dpNs).e("header-label"), { active: currentView.value === "month" }]),
  28635. onKeydown: _cache[6] || (_cache[6] = withKeys(($event) => showPicker("month"), ["enter"])),
  28636. onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
  28637. }, toDisplayString(unref(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_5$8), [[vShow, currentView.value === "date"]]),
  28638. createElementVNode("span", { class: normalizeClass(unref(dpNs).e("next-btn")) }, [withDirectives(createElementVNode("button", {
  28639. type: "button",
  28640. "aria-label": unref(t)(`el.datepicker.nextMonth`),
  28641. class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
  28642. disabled: unref(dateDisabled),
  28643. onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
  28644. }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, {
  28645. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  28646. _: 1
  28647. })])], 10, _hoisted_6$3), [[vShow, currentView.value === "date"]]), createElementVNode("button", {
  28648. type: "button",
  28649. "aria-label": unref(t)(`el.datepicker.nextYear`),
  28650. class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  28651. disabled: unref(dateDisabled),
  28652. onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
  28653. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  28654. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  28655. _: 1
  28656. })])], 10, _hoisted_7$2)], 2)
  28657. ], 2), [[vShow, currentView.value !== "time"]]),
  28658. createElementVNode("div", {
  28659. class: normalizeClass(unref(ppNs).e("content")),
  28660. onKeydown: handleKeydownTable
  28661. }, [
  28662. currentView.value === "date" ? (openBlock(), createBlock(basic_date_table_default, {
  28663. key: 0,
  28664. ref_key: "currentViewRef",
  28665. ref: currentViewRef,
  28666. "selection-mode": selectionMode.value,
  28667. date: innerDate.value,
  28668. "parsed-value": _ctx.parsedValue,
  28669. "disabled-date": unref(disabledDate),
  28670. disabled: unref(dateDisabled),
  28671. "cell-class-name": unref(cellClassName),
  28672. "show-week-number": _ctx.showWeekNumber,
  28673. onPick: handleDatePick
  28674. }, null, 8, [
  28675. "selection-mode",
  28676. "date",
  28677. "parsed-value",
  28678. "disabled-date",
  28679. "disabled",
  28680. "cell-class-name",
  28681. "show-week-number"
  28682. ])) : createCommentVNode("v-if", true),
  28683. currentView.value === "year" ? (openBlock(), createBlock(basic_year_table_default, {
  28684. key: 1,
  28685. ref_key: "currentViewRef",
  28686. ref: currentViewRef,
  28687. "selection-mode": selectionMode.value,
  28688. date: innerDate.value,
  28689. "disabled-date": unref(disabledDate),
  28690. disabled: unref(dateDisabled),
  28691. "parsed-value": _ctx.parsedValue,
  28692. "cell-class-name": unref(cellClassName),
  28693. onPick: handleYearPick
  28694. }, null, 8, [
  28695. "selection-mode",
  28696. "date",
  28697. "disabled-date",
  28698. "disabled",
  28699. "parsed-value",
  28700. "cell-class-name"
  28701. ])) : createCommentVNode("v-if", true),
  28702. currentView.value === "month" ? (openBlock(), createBlock(basic_month_table_default, {
  28703. key: 2,
  28704. ref_key: "currentViewRef",
  28705. ref: currentViewRef,
  28706. "selection-mode": selectionMode.value,
  28707. date: innerDate.value,
  28708. "parsed-value": _ctx.parsedValue,
  28709. "disabled-date": unref(disabledDate),
  28710. disabled: unref(dateDisabled),
  28711. "cell-class-name": unref(cellClassName),
  28712. onPick: handleMonthPick
  28713. }, null, 8, [
  28714. "selection-mode",
  28715. "date",
  28716. "parsed-value",
  28717. "disabled-date",
  28718. "disabled",
  28719. "cell-class-name"
  28720. ])) : createCommentVNode("v-if", true)
  28721. ], 34)
  28722. ], 2)
  28723. ], 2), _ctx.showFooter && footerVisible.value && footerFilled.value ? (openBlock(), createElementBlock("div", {
  28724. key: 0,
  28725. class: normalizeClass(unref(ppNs).e("footer"))
  28726. }, [withDirectives(createVNode(unref(ElButton), {
  28727. text: "",
  28728. size: "small",
  28729. class: normalizeClass(unref(ppNs).e("link-btn")),
  28730. disabled: disabledNow.value,
  28731. onClick: changeToNow
  28732. }, {
  28733. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.now")), 1)]),
  28734. _: 1
  28735. }, 8, ["class", "disabled"]), [[vShow, !isMultipleType.value && _ctx.showNow]]), _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
  28736. key: 0,
  28737. plain: "",
  28738. size: "small",
  28739. class: normalizeClass(unref(ppNs).e("link-btn")),
  28740. disabled: disabledConfirm.value,
  28741. onClick: onConfirm
  28742. }, {
  28743. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)]),
  28744. _: 1
  28745. }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)], 2);
  28746. };
  28747. }
  28748. });
  28749. //#endregion
  28750. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue
  28751. var panel_date_pick_default = panel_date_pick_vue_vue_type_script_setup_true_lang_default;
  28752. //#endregion
  28753. //#region ../../packages/components/date-picker-panel/src/props/panel-date-range.ts
  28754. const panelDateRangeProps = buildProps({
  28755. ...panelSharedProps,
  28756. ...panelRangeSharedProps
  28757. });
  28758. //#endregion
  28759. //#region ../../packages/components/date-picker-panel/src/composables/use-shortcut.ts
  28760. const useShortcut = (lang) => {
  28761. const { emit } = getCurrentInstance();
  28762. const attrs = useAttrs$1();
  28763. const slots = useSlots();
  28764. const handleShortcutClick = (shortcut) => {
  28765. const shortcutValues = isFunction$1(shortcut.value) ? shortcut.value() : shortcut.value;
  28766. if (shortcutValues) {
  28767. emit("pick", [(0, import_dayjs_min.default)(shortcutValues[0]).locale(lang.value), (0, import_dayjs_min.default)(shortcutValues[1]).locale(lang.value)]);
  28768. return;
  28769. }
  28770. if (shortcut.onClick) shortcut.onClick({
  28771. attrs,
  28772. slots,
  28773. emit
  28774. });
  28775. };
  28776. return handleShortcutClick;
  28777. };
  28778. //#endregion
  28779. //#region ../../packages/components/date-picker-panel/src/composables/use-range-picker.ts
  28780. const useRangePicker = (props, { defaultValue, defaultTime, leftDate, rightDate, step, unit, sortDates }) => {
  28781. const { emit } = getCurrentInstance();
  28782. const { pickerNs } = inject(ROOT_PICKER_INJECTION_KEY);
  28783. const drpNs = useNamespace("date-range-picker");
  28784. const { t, lang } = useLocale();
  28785. const handleShortcutClick = useShortcut(lang);
  28786. const minDate = ref();
  28787. const maxDate = ref();
  28788. const rangeState = ref({
  28789. endDate: null,
  28790. selecting: false
  28791. });
  28792. const handleChangeRange = (val) => {
  28793. rangeState.value = val;
  28794. };
  28795. const handleRangeConfirm = (visible = false) => {
  28796. const _minDate = unref(minDate);
  28797. const _maxDate = unref(maxDate);
  28798. if (isValidRange([_minDate, _maxDate])) emit("pick", [_minDate, _maxDate], visible);
  28799. };
  28800. const onSelect = (selecting) => {
  28801. rangeState.value.selecting = selecting;
  28802. if (!selecting) rangeState.value.endDate = null;
  28803. };
  28804. const parseValue = (parsedValue) => {
  28805. if (isArray$1(parsedValue) && parsedValue.length === 2) {
  28806. const [start, end] = parsedValue;
  28807. minDate.value = start;
  28808. leftDate.value = start;
  28809. maxDate.value = end;
  28810. sortDates(unref(minDate), unref(maxDate));
  28811. } else restoreDefault();
  28812. };
  28813. const restoreDefault = () => {
  28814. let [start, end] = getDefaultValue(unref(defaultValue), {
  28815. lang: unref(lang),
  28816. step,
  28817. unit,
  28818. unlinkPanels: props.unlinkPanels
  28819. });
  28820. const getShift = (day) => {
  28821. return day.diff(day.startOf("d"), "ms");
  28822. };
  28823. const maybeTimes = unref(defaultTime);
  28824. if (maybeTimes) {
  28825. let leftShift = 0;
  28826. let rightShift = 0;
  28827. if (isArray$1(maybeTimes)) {
  28828. const [timeStart, timeEnd] = maybeTimes.map(import_dayjs_min.default);
  28829. leftShift = getShift(timeStart);
  28830. rightShift = getShift(timeEnd);
  28831. } else {
  28832. const shift = getShift((0, import_dayjs_min.default)(maybeTimes));
  28833. leftShift = shift;
  28834. rightShift = shift;
  28835. }
  28836. start = start.startOf("d").add(leftShift, "ms");
  28837. end = end.startOf("d").add(rightShift, "ms");
  28838. }
  28839. minDate.value = void 0;
  28840. maxDate.value = void 0;
  28841. leftDate.value = start;
  28842. rightDate.value = end;
  28843. };
  28844. watch(defaultValue, (val) => {
  28845. if (val) restoreDefault();
  28846. }, { immediate: true });
  28847. watch(() => props.parsedValue, (parsedValue) => {
  28848. if (!parsedValue?.length || !isEqual$1(parsedValue, [minDate.value, maxDate.value])) parseValue(parsedValue);
  28849. }, { immediate: true });
  28850. watch(() => props.visible, () => {
  28851. if (props.visible) parseValue(props.parsedValue);
  28852. }, { immediate: true });
  28853. return {
  28854. minDate,
  28855. maxDate,
  28856. rangeState,
  28857. lang,
  28858. ppNs: pickerNs,
  28859. drpNs,
  28860. handleChangeRange,
  28861. handleRangeConfirm,
  28862. handleShortcutClick,
  28863. onSelect,
  28864. parseValue,
  28865. t
  28866. };
  28867. };
  28868. //#endregion
  28869. //#region ../../packages/components/date-picker-panel/src/composables/use-panel-date-range.ts
  28870. const usePanelDateRange = (props, emit, leftDate, rightDate) => {
  28871. const leftCurrentView = ref("date");
  28872. const leftCurrentViewRef = ref();
  28873. const rightCurrentView = ref("date");
  28874. const rightCurrentViewRef = ref();
  28875. const { disabledDate } = inject(PICKER_BASE_INJECTION_KEY).props;
  28876. const { t, lang } = useLocale();
  28877. const leftYear = computed(() => {
  28878. return leftDate.value.year();
  28879. });
  28880. const leftMonth = computed(() => {
  28881. return leftDate.value.month();
  28882. });
  28883. const rightYear = computed(() => {
  28884. return rightDate.value.year();
  28885. });
  28886. const rightMonth = computed(() => {
  28887. return rightDate.value.month();
  28888. });
  28889. function computedYearLabel(currentView, yearValue) {
  28890. const yearTranslation = t("el.datepicker.year");
  28891. if (currentView.value === "year") {
  28892. const startYear = Math.floor(yearValue.value / 10) * 10;
  28893. return yearTranslation ? `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}` : `${startYear} - ${startYear + 9}`;
  28894. }
  28895. return `${yearValue.value} ${yearTranslation}`;
  28896. }
  28897. function focusPicker(currentViewRef) {
  28898. currentViewRef?.focus();
  28899. }
  28900. async function showPicker(pickerType, view) {
  28901. if (props.disabled) return;
  28902. const currentView = pickerType === "left" ? leftCurrentView : rightCurrentView;
  28903. const currentViewRef = pickerType === "left" ? leftCurrentViewRef : rightCurrentViewRef;
  28904. currentView.value = view;
  28905. await nextTick();
  28906. focusPicker(currentViewRef.value);
  28907. }
  28908. async function handlePick(mode, pickerType, value) {
  28909. if (props.disabled) return;
  28910. const isLeftPicker = pickerType === "left";
  28911. const startDate = isLeftPicker ? leftDate : rightDate;
  28912. const endDate = isLeftPicker ? rightDate : leftDate;
  28913. const currentView = isLeftPicker ? leftCurrentView : rightCurrentView;
  28914. const currentViewRef = isLeftPicker ? leftCurrentViewRef : rightCurrentViewRef;
  28915. if (mode === "year") startDate.value = getValidDateOfYear(startDate.value.year(value), lang.value, disabledDate);
  28916. if (mode === "month") startDate.value = getValidDateOfMonth(startDate.value, startDate.value.year(), value, lang.value, disabledDate);
  28917. if (!props.unlinkPanels) endDate.value = pickerType === "left" ? startDate.value.add(1, "month") : startDate.value.subtract(1, "month");
  28918. currentView.value = mode === "year" ? "month" : "date";
  28919. await nextTick();
  28920. focusPicker(currentViewRef.value);
  28921. handlePanelChange(mode);
  28922. }
  28923. function handlePanelChange(mode) {
  28924. emit("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode);
  28925. }
  28926. function adjustDateByView(currentView, date, forward) {
  28927. const action = forward ? "add" : "subtract";
  28928. return currentView === "year" ? date[action](10, "year") : date[action](1, "year");
  28929. }
  28930. return {
  28931. leftCurrentView,
  28932. rightCurrentView,
  28933. leftCurrentViewRef,
  28934. rightCurrentViewRef,
  28935. leftYear,
  28936. rightYear,
  28937. leftMonth,
  28938. rightMonth,
  28939. leftYearLabel: computed(() => computedYearLabel(leftCurrentView, leftYear)),
  28940. rightYearLabel: computed(() => computedYearLabel(rightCurrentView, rightYear)),
  28941. showLeftPicker: (view) => showPicker("left", view),
  28942. showRightPicker: (view) => showPicker("right", view),
  28943. handleLeftYearPick: (year) => handlePick("year", "left", year),
  28944. handleRightYearPick: (year) => handlePick("year", "right", year),
  28945. handleLeftMonthPick: (month) => handlePick("month", "left", month),
  28946. handleRightMonthPick: (month) => handlePick("month", "right", month),
  28947. handlePanelChange,
  28948. adjustDateByView
  28949. };
  28950. };
  28951. //#endregion
  28952. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue?vue&type=script&setup=true&lang.ts
  28953. const _hoisted_1$46 = ["disabled", "onClick"];
  28954. const _hoisted_2$28 = ["aria-label", "disabled"];
  28955. const _hoisted_3$13 = ["aria-label", "disabled"];
  28956. const _hoisted_4$10 = ["disabled", "aria-label"];
  28957. const _hoisted_5$7 = ["disabled", "aria-label"];
  28958. const _hoisted_6$2 = ["tabindex", "aria-disabled"];
  28959. const _hoisted_7$1 = ["tabindex", "aria-disabled"];
  28960. const _hoisted_8$1 = ["disabled", "aria-label"];
  28961. const _hoisted_9$1 = ["disabled", "aria-label"];
  28962. const _hoisted_10$1 = ["aria-label", "disabled"];
  28963. const _hoisted_11$1 = ["disabled", "aria-label"];
  28964. const _hoisted_12$1 = ["tabindex", "aria-disabled"];
  28965. const _hoisted_13$1 = ["tabindex", "aria-disabled"];
  28966. const unit$2 = "month";
  28967. var panel_date_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  28968. __name: "panel-date-range",
  28969. props: panelDateRangeProps,
  28970. emits: [
  28971. "pick",
  28972. "set-picker-option",
  28973. "calendar-change",
  28974. "panel-change",
  28975. "clear"
  28976. ],
  28977. setup(__props, { emit: __emit }) {
  28978. const props = __props;
  28979. const emit = __emit;
  28980. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  28981. const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  28982. const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props;
  28983. const format = toRef(pickerBase.props, "format");
  28984. const shortcuts = toRef(pickerBase.props, "shortcuts");
  28985. const defaultValue = toRef(pickerBase.props, "defaultValue");
  28986. const { lang } = useLocale();
  28987. const leftDate = ref((0, import_dayjs_min.default)().locale(lang.value));
  28988. const rightDate = ref((0, import_dayjs_min.default)().locale(lang.value).add(1, unit$2));
  28989. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue, t } = useRangePicker(props, {
  28990. defaultValue,
  28991. defaultTime,
  28992. leftDate,
  28993. rightDate,
  28994. unit: unit$2,
  28995. sortDates
  28996. });
  28997. watch(() => props.visible, (visible) => {
  28998. if (!visible && rangeState.value.selecting) {
  28999. parseValue(props.parsedValue);
  29000. onSelect(false);
  29001. }
  29002. });
  29003. const dateUserInput = ref({
  29004. min: null,
  29005. max: null
  29006. });
  29007. const timeUserInput = ref({
  29008. min: null,
  29009. max: null
  29010. });
  29011. const { leftCurrentView, rightCurrentView, leftCurrentViewRef, rightCurrentViewRef, leftYear, rightYear, leftMonth, rightMonth, leftYearLabel, rightYearLabel, showLeftPicker, showRightPicker, handleLeftYearPick, handleRightYearPick, handleLeftMonthPick, handleRightMonthPick, handlePanelChange, adjustDateByView } = usePanelDateRange(props, emit, leftDate, rightDate);
  29012. const hasShortcuts = computed(() => !!shortcuts.value.length);
  29013. const minVisibleDate = computed(() => {
  29014. if (dateUserInput.value.min !== null) return dateUserInput.value.min;
  29015. if (minDate.value) return minDate.value.format(dateFormat.value);
  29016. return "";
  29017. });
  29018. const maxVisibleDate = computed(() => {
  29019. if (dateUserInput.value.max !== null) return dateUserInput.value.max;
  29020. if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(dateFormat.value);
  29021. return "";
  29022. });
  29023. const minVisibleTime = computed(() => {
  29024. if (timeUserInput.value.min !== null) return timeUserInput.value.min;
  29025. if (minDate.value) return minDate.value.format(timeFormat.value);
  29026. return "";
  29027. });
  29028. const maxVisibleTime = computed(() => {
  29029. if (timeUserInput.value.max !== null) return timeUserInput.value.max;
  29030. if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(timeFormat.value);
  29031. return "";
  29032. });
  29033. const timeFormat = computed(() => {
  29034. return props.timeFormat || extractTimeFormat(format.value || "") || DEFAULT_FORMATS_TIME;
  29035. });
  29036. const dateFormat = computed(() => {
  29037. return props.dateFormat || extractDateFormat(format.value || "") || DEFAULT_FORMATS_DATE;
  29038. });
  29039. const isValidValue = (date) => {
  29040. return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
  29041. };
  29042. const leftPrevYear = () => {
  29043. leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, false);
  29044. if (!props.unlinkPanels) rightDate.value = leftDate.value.add(1, "month");
  29045. handlePanelChange("year");
  29046. };
  29047. const leftPrevMonth = () => {
  29048. leftDate.value = leftDate.value.subtract(1, "month");
  29049. if (!props.unlinkPanels) rightDate.value = leftDate.value.add(1, "month");
  29050. handlePanelChange("month");
  29051. };
  29052. const rightNextYear = () => {
  29053. if (!props.unlinkPanels) {
  29054. leftDate.value = adjustDateByView(rightCurrentView.value, leftDate.value, true);
  29055. rightDate.value = leftDate.value.add(1, "month");
  29056. } else rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, true);
  29057. handlePanelChange("year");
  29058. };
  29059. const rightNextMonth = () => {
  29060. if (!props.unlinkPanels) {
  29061. leftDate.value = leftDate.value.add(1, "month");
  29062. rightDate.value = leftDate.value.add(1, "month");
  29063. } else rightDate.value = rightDate.value.add(1, "month");
  29064. handlePanelChange("month");
  29065. };
  29066. const leftNextYear = () => {
  29067. leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, true);
  29068. handlePanelChange("year");
  29069. };
  29070. const leftNextMonth = () => {
  29071. leftDate.value = leftDate.value.add(1, "month");
  29072. handlePanelChange("month");
  29073. };
  29074. const rightPrevYear = () => {
  29075. rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, false);
  29076. handlePanelChange("year");
  29077. };
  29078. const rightPrevMonth = () => {
  29079. rightDate.value = rightDate.value.subtract(1, "month");
  29080. handlePanelChange("month");
  29081. };
  29082. const enableMonthArrow = computed(() => {
  29083. const nextMonth = (leftMonth.value + 1) % 12;
  29084. const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0;
  29085. return props.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value);
  29086. });
  29087. const enableYearArrow = computed(() => {
  29088. return props.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12;
  29089. });
  29090. const dateRangeDisabled = useFormDisabled();
  29091. const btnDisabled = computed(() => {
  29092. return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]) && !dateRangeDisabled.value);
  29093. });
  29094. const showTime = computed(() => props.type === "datetime" || props.type === "datetimerange");
  29095. const formatEmit = (emitDayjs, index) => {
  29096. if (!emitDayjs) return;
  29097. if (defaultTime) return (0, import_dayjs_min.default)(defaultTime[index] || defaultTime).locale(lang.value).year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  29098. return emitDayjs;
  29099. };
  29100. const handleRangePick = (val, close = true) => {
  29101. const min_ = val.minDate;
  29102. const max_ = val.maxDate;
  29103. const minDate_ = formatEmit(min_, 0);
  29104. const maxDate_ = formatEmit(max_, 1);
  29105. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  29106. emit("calendar-change", [min_.toDate(), max_ && max_.toDate()]);
  29107. maxDate.value = maxDate_;
  29108. minDate.value = minDate_;
  29109. if (!showTime.value && close) close = !minDate_ || !maxDate_;
  29110. handleRangeConfirm(close);
  29111. };
  29112. const minTimePickerVisible = ref(false);
  29113. const maxTimePickerVisible = ref(false);
  29114. const handleMinTimeClose = () => {
  29115. minTimePickerVisible.value = false;
  29116. };
  29117. const handleMaxTimeClose = () => {
  29118. maxTimePickerVisible.value = false;
  29119. };
  29120. const handleDateInput = (value, type) => {
  29121. dateUserInput.value[type] = value;
  29122. const parsedValueD = (0, import_dayjs_min.default)(value, dateFormat.value).locale(lang.value);
  29123. if (parsedValueD.isValid()) {
  29124. if (disabledDate && disabledDate(parsedValueD.toDate())) return;
  29125. if (type === "min") {
  29126. leftDate.value = parsedValueD;
  29127. minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  29128. if (!props.unlinkPanels && (!maxDate.value || maxDate.value.isBefore(minDate.value))) {
  29129. rightDate.value = parsedValueD.add(1, "month");
  29130. maxDate.value = minDate.value.add(1, "month");
  29131. }
  29132. } else {
  29133. rightDate.value = parsedValueD;
  29134. maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  29135. if (!props.unlinkPanels && (!minDate.value || minDate.value.isAfter(maxDate.value))) {
  29136. leftDate.value = parsedValueD.subtract(1, "month");
  29137. minDate.value = maxDate.value.subtract(1, "month");
  29138. }
  29139. }
  29140. sortDates(minDate.value, maxDate.value);
  29141. handleRangeConfirm(true);
  29142. }
  29143. };
  29144. const handleDateChange = (_, type) => {
  29145. dateUserInput.value[type] = null;
  29146. };
  29147. const handleTimeInput = (value, type) => {
  29148. timeUserInput.value[type] = value;
  29149. const parsedValueD = (0, import_dayjs_min.default)(value, timeFormat.value).locale(lang.value);
  29150. if (parsedValueD.isValid()) if (type === "min") {
  29151. minTimePickerVisible.value = true;
  29152. minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  29153. leftDate.value = minDate.value;
  29154. } else {
  29155. maxTimePickerVisible.value = true;
  29156. maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  29157. rightDate.value = maxDate.value;
  29158. }
  29159. };
  29160. const handleTimeChange = (_value, type) => {
  29161. timeUserInput.value[type] = null;
  29162. if (type === "min") {
  29163. leftDate.value = minDate.value;
  29164. minTimePickerVisible.value = false;
  29165. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) maxDate.value = minDate.value;
  29166. } else {
  29167. rightDate.value = maxDate.value;
  29168. maxTimePickerVisible.value = false;
  29169. if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value;
  29170. }
  29171. handleRangeConfirm(true);
  29172. };
  29173. const handleMinTimePick = (value, visible, first) => {
  29174. if (timeUserInput.value.min) return;
  29175. if (value) minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  29176. if (!first) minTimePickerVisible.value = visible;
  29177. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
  29178. maxDate.value = minDate.value;
  29179. rightDate.value = value;
  29180. nextTick(() => {
  29181. parseValue(props.parsedValue);
  29182. });
  29183. }
  29184. handleRangeConfirm(true);
  29185. };
  29186. const handleMaxTimePick = (value, visible, first) => {
  29187. if (timeUserInput.value.max) return;
  29188. if (value) maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  29189. if (!first) maxTimePickerVisible.value = visible;
  29190. if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value;
  29191. handleRangeConfirm(true);
  29192. };
  29193. const onClear = () => {
  29194. handleClear();
  29195. emit("clear");
  29196. };
  29197. const handleClear = () => {
  29198. let valueOnClear = null;
  29199. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  29200. leftDate.value = getDefaultValue(unref(defaultValue), {
  29201. lang: unref(lang),
  29202. unit: "month",
  29203. unlinkPanels: props.unlinkPanels
  29204. })[0];
  29205. rightDate.value = leftDate.value.add(1, "month");
  29206. maxDate.value = void 0;
  29207. minDate.value = void 0;
  29208. handleRangeConfirm(true);
  29209. emit("pick", valueOnClear);
  29210. };
  29211. const parseUserInput = (value) => {
  29212. return correctlyParseUserInput(value, format.value || "", lang.value, isDefaultFormat);
  29213. };
  29214. function sortDates(minDate, maxDate) {
  29215. if (props.unlinkPanels && maxDate) {
  29216. const minDateYear = minDate?.year() || 0;
  29217. const minDateMonth = minDate?.month() || 0;
  29218. const maxDateYear = maxDate.year();
  29219. const maxDateMonth = maxDate.month();
  29220. rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate.add(1, unit$2) : maxDate;
  29221. } else {
  29222. rightDate.value = leftDate.value.add(1, unit$2);
  29223. if (maxDate) rightDate.value = rightDate.value.hour(maxDate.hour()).minute(maxDate.minute()).second(maxDate.second());
  29224. }
  29225. }
  29226. emit("set-picker-option", ["isValidValue", isValidValue]);
  29227. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  29228. emit("set-picker-option", ["handleClear", handleClear]);
  29229. return (_ctx, _cache) => {
  29230. return openBlock(), createElementBlock("div", { class: normalizeClass([
  29231. unref(ppNs).b(),
  29232. unref(drpNs).b(),
  29233. unref(ppNs).is("border", _ctx.border),
  29234. unref(ppNs).is("disabled", unref(dateRangeDisabled)),
  29235. {
  29236. "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
  29237. "has-time": showTime.value
  29238. }
  29239. ]) }, [createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [
  29240. renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }),
  29241. hasShortcuts.value ? (openBlock(), createElementBlock("div", {
  29242. key: 0,
  29243. class: normalizeClass(unref(ppNs).e("sidebar"))
  29244. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(shortcuts.value, (shortcut, key) => {
  29245. return openBlock(), createElementBlock("button", {
  29246. key,
  29247. type: "button",
  29248. disabled: unref(dateRangeDisabled),
  29249. class: normalizeClass(unref(ppNs).e("shortcut")),
  29250. onClick: ($event) => unref(handleShortcutClick)(shortcut)
  29251. }, toDisplayString(shortcut.text), 11, _hoisted_1$46);
  29252. }), 128))], 2)) : createCommentVNode("v-if", true),
  29253. createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [
  29254. showTime.value ? (openBlock(), createElementBlock("div", {
  29255. key: 0,
  29256. class: normalizeClass(unref(drpNs).e("time-header"))
  29257. }, [
  29258. createElementVNode("span", { class: normalizeClass(unref(drpNs).e("editors-wrap")) }, [createElementVNode("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), {
  29259. size: "small",
  29260. disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
  29261. placeholder: unref(t)("el.datepicker.startDate"),
  29262. class: normalizeClass(unref(drpNs).e("editor")),
  29263. "model-value": minVisibleDate.value,
  29264. "validate-event": false,
  29265. readonly: !_ctx.editable,
  29266. onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")),
  29267. onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min"))
  29268. }, null, 8, [
  29269. "disabled",
  29270. "placeholder",
  29271. "class",
  29272. "model-value",
  29273. "readonly"
  29274. ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), {
  29275. size: "small",
  29276. class: normalizeClass(unref(drpNs).e("editor")),
  29277. disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
  29278. placeholder: unref(t)("el.datepicker.startTime"),
  29279. "model-value": minVisibleTime.value,
  29280. "validate-event": false,
  29281. readonly: !_ctx.editable,
  29282. onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true),
  29283. onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")),
  29284. onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min"))
  29285. }, null, 8, [
  29286. "class",
  29287. "disabled",
  29288. "placeholder",
  29289. "model-value",
  29290. "readonly"
  29291. ]), createVNode(unref(panel_time_pick_default), {
  29292. visible: minTimePickerVisible.value,
  29293. format: timeFormat.value,
  29294. "datetime-role": "start",
  29295. "parsed-value": unref(minDate) || leftDate.value,
  29296. onPick: handleMinTimePick
  29297. }, null, 8, [
  29298. "visible",
  29299. "format",
  29300. "parsed-value"
  29301. ])], 2)), [[unref(ClickOutside), handleMinTimeClose]])], 2),
  29302. createElementVNode("span", null, [createVNode(unref(ElIcon), null, {
  29303. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  29304. _: 1
  29305. })]),
  29306. createElementVNode("span", { class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"]) }, [createElementVNode("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), {
  29307. size: "small",
  29308. class: normalizeClass(unref(drpNs).e("editor")),
  29309. disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
  29310. placeholder: unref(t)("el.datepicker.endDate"),
  29311. "model-value": maxVisibleDate.value,
  29312. readonly: !unref(minDate) || !_ctx.editable,
  29313. "validate-event": false,
  29314. onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")),
  29315. onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max"))
  29316. }, null, 8, [
  29317. "class",
  29318. "disabled",
  29319. "placeholder",
  29320. "model-value",
  29321. "readonly"
  29322. ])], 2), withDirectives((openBlock(), createElementBlock("span", { class: normalizeClass(unref(drpNs).e("time-picker-wrap")) }, [createVNode(unref(ElInput), {
  29323. size: "small",
  29324. class: normalizeClass(unref(drpNs).e("editor")),
  29325. disabled: unref(rangeState).selecting || unref(dateRangeDisabled),
  29326. placeholder: unref(t)("el.datepicker.endTime"),
  29327. "model-value": maxVisibleTime.value,
  29328. readonly: !unref(minDate) || !_ctx.editable,
  29329. "validate-event": false,
  29330. onFocus: _cache[7] || (_cache[7] = ($event) => unref(minDate) && (maxTimePickerVisible.value = true)),
  29331. onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")),
  29332. onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max"))
  29333. }, null, 8, [
  29334. "class",
  29335. "disabled",
  29336. "placeholder",
  29337. "model-value",
  29338. "readonly"
  29339. ]), createVNode(unref(panel_time_pick_default), {
  29340. "datetime-role": "end",
  29341. visible: maxTimePickerVisible.value,
  29342. format: timeFormat.value,
  29343. "parsed-value": unref(maxDate) || rightDate.value,
  29344. onPick: handleMaxTimePick
  29345. }, null, 8, [
  29346. "visible",
  29347. "format",
  29348. "parsed-value"
  29349. ])], 2)), [[unref(ClickOutside), handleMaxTimeClose]])], 2)
  29350. ], 2)) : createCommentVNode("v-if", true),
  29351. createElementVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"]) }, [
  29352. createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  29353. createElementVNode("button", {
  29354. type: "button",
  29355. class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
  29356. "aria-label": unref(t)(`el.datepicker.prevYear`),
  29357. disabled: unref(dateRangeDisabled),
  29358. onClick: leftPrevYear
  29359. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  29360. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  29361. _: 1
  29362. })])], 10, _hoisted_2$28),
  29363. withDirectives(createElementVNode("button", {
  29364. type: "button",
  29365. class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
  29366. "aria-label": unref(t)(`el.datepicker.prevMonth`),
  29367. disabled: unref(dateRangeDisabled),
  29368. onClick: leftPrevMonth
  29369. }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, {
  29370. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  29371. _: 1
  29372. })])], 10, _hoisted_3$13), [[vShow, unref(leftCurrentView) === "date"]]),
  29373. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  29374. key: 0,
  29375. type: "button",
  29376. disabled: !enableYearArrow.value || unref(dateRangeDisabled),
  29377. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))], "d-arrow-right"]),
  29378. "aria-label": unref(t)(`el.datepicker.nextYear`),
  29379. onClick: leftNextYear
  29380. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  29381. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  29382. _: 1
  29383. })])], 10, _hoisted_4$10)) : createCommentVNode("v-if", true),
  29384. _ctx.unlinkPanels && unref(leftCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
  29385. key: 1,
  29386. type: "button",
  29387. disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
  29388. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))], "arrow-right"]),
  29389. "aria-label": unref(t)(`el.datepicker.nextMonth`),
  29390. onClick: leftNextMonth
  29391. }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, {
  29392. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  29393. _: 1
  29394. })])], 10, _hoisted_5$7)) : createCommentVNode("v-if", true),
  29395. createElementVNode("div", null, [createElementVNode("span", {
  29396. role: "button",
  29397. class: normalizeClass(unref(drpNs).e("header-label")),
  29398. "aria-live": "polite",
  29399. tabindex: _ctx.disabled ? void 0 : 0,
  29400. "aria-disabled": _ctx.disabled,
  29401. onKeydown: _cache[10] || (_cache[10] = withKeys(($event) => unref(showLeftPicker)("year"), ["enter"])),
  29402. onClick: _cache[11] || (_cache[11] = ($event) => unref(showLeftPicker)("year"))
  29403. }, toDisplayString(unref(leftYearLabel)), 43, _hoisted_6$2), withDirectives(createElementVNode("span", {
  29404. role: "button",
  29405. "aria-live": "polite",
  29406. tabindex: _ctx.disabled ? void 0 : 0,
  29407. "aria-disabled": _ctx.disabled,
  29408. class: normalizeClass([unref(drpNs).e("header-label"), { active: unref(leftCurrentView) === "month" }]),
  29409. onKeydown: _cache[12] || (_cache[12] = withKeys(($event) => unref(showLeftPicker)("month"), ["enter"])),
  29410. onClick: _cache[13] || (_cache[13] = ($event) => unref(showLeftPicker)("month"))
  29411. }, toDisplayString(unref(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, _hoisted_7$1), [[vShow, unref(leftCurrentView) === "date"]])])
  29412. ], 2),
  29413. unref(leftCurrentView) === "date" ? (openBlock(), createBlock(basic_date_table_default, {
  29414. key: 0,
  29415. ref_key: "leftCurrentViewRef",
  29416. ref: leftCurrentViewRef,
  29417. "selection-mode": "range",
  29418. date: leftDate.value,
  29419. "min-date": unref(minDate),
  29420. "max-date": unref(maxDate),
  29421. "range-state": unref(rangeState),
  29422. "disabled-date": unref(disabledDate),
  29423. "cell-class-name": unref(cellClassName),
  29424. "show-week-number": _ctx.showWeekNumber,
  29425. disabled: unref(dateRangeDisabled),
  29426. onChangerange: unref(handleChangeRange),
  29427. onPick: handleRangePick,
  29428. onSelect: unref(onSelect)
  29429. }, null, 8, [
  29430. "date",
  29431. "min-date",
  29432. "max-date",
  29433. "range-state",
  29434. "disabled-date",
  29435. "cell-class-name",
  29436. "show-week-number",
  29437. "disabled",
  29438. "onChangerange",
  29439. "onSelect"
  29440. ])) : createCommentVNode("v-if", true),
  29441. unref(leftCurrentView) === "year" ? (openBlock(), createBlock(basic_year_table_default, {
  29442. key: 1,
  29443. ref_key: "leftCurrentViewRef",
  29444. ref: leftCurrentViewRef,
  29445. "selection-mode": "year",
  29446. date: leftDate.value,
  29447. "disabled-date": unref(disabledDate),
  29448. "parsed-value": _ctx.parsedValue,
  29449. disabled: unref(dateRangeDisabled),
  29450. onPick: unref(handleLeftYearPick)
  29451. }, null, 8, [
  29452. "date",
  29453. "disabled-date",
  29454. "parsed-value",
  29455. "disabled",
  29456. "onPick"
  29457. ])) : createCommentVNode("v-if", true),
  29458. unref(leftCurrentView) === "month" ? (openBlock(), createBlock(basic_month_table_default, {
  29459. key: 2,
  29460. ref_key: "leftCurrentViewRef",
  29461. ref: leftCurrentViewRef,
  29462. "selection-mode": "month",
  29463. date: leftDate.value,
  29464. "parsed-value": _ctx.parsedValue,
  29465. "disabled-date": unref(disabledDate),
  29466. disabled: unref(dateRangeDisabled),
  29467. onPick: unref(handleLeftMonthPick)
  29468. }, null, 8, [
  29469. "date",
  29470. "parsed-value",
  29471. "disabled-date",
  29472. "disabled",
  29473. "onPick"
  29474. ])) : createCommentVNode("v-if", true)
  29475. ], 2),
  29476. createElementVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"]) }, [
  29477. createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  29478. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  29479. key: 0,
  29480. type: "button",
  29481. disabled: !enableYearArrow.value || unref(dateRangeDisabled),
  29482. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(dateRangeDisabled))], "d-arrow-left"]),
  29483. "aria-label": unref(t)(`el.datepicker.prevYear`),
  29484. onClick: rightPrevYear
  29485. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  29486. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  29487. _: 1
  29488. })])], 10, _hoisted_8$1)) : createCommentVNode("v-if", true),
  29489. _ctx.unlinkPanels && unref(rightCurrentView) === "date" ? (openBlock(), createElementBlock("button", {
  29490. key: 1,
  29491. type: "button",
  29492. disabled: !enableMonthArrow.value || unref(dateRangeDisabled),
  29493. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableMonthArrow.value || unref(dateRangeDisabled))], "arrow-left"]),
  29494. "aria-label": unref(t)(`el.datepicker.prevMonth`),
  29495. onClick: rightPrevMonth
  29496. }, [renderSlot(_ctx.$slots, "prev-month", {}, () => [createVNode(unref(ElIcon), null, {
  29497. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  29498. _: 1
  29499. })])], 10, _hoisted_9$1)) : createCommentVNode("v-if", true),
  29500. createElementVNode("button", {
  29501. type: "button",
  29502. "aria-label": unref(t)(`el.datepicker.nextYear`),
  29503. class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  29504. disabled: unref(dateRangeDisabled),
  29505. onClick: rightNextYear
  29506. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  29507. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  29508. _: 1
  29509. })])], 10, _hoisted_10$1),
  29510. withDirectives(createElementVNode("button", {
  29511. type: "button",
  29512. class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
  29513. disabled: unref(dateRangeDisabled),
  29514. "aria-label": unref(t)(`el.datepicker.nextMonth`),
  29515. onClick: rightNextMonth
  29516. }, [renderSlot(_ctx.$slots, "next-month", {}, () => [createVNode(unref(ElIcon), null, {
  29517. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  29518. _: 1
  29519. })])], 10, _hoisted_11$1), [[vShow, unref(rightCurrentView) === "date"]]),
  29520. createElementVNode("div", null, [createElementVNode("span", {
  29521. role: "button",
  29522. class: normalizeClass(unref(drpNs).e("header-label")),
  29523. "aria-live": "polite",
  29524. tabindex: _ctx.disabled ? void 0 : 0,
  29525. "aria-disabled": _ctx.disabled,
  29526. onKeydown: _cache[14] || (_cache[14] = withKeys(($event) => unref(showRightPicker)("year"), ["enter"])),
  29527. onClick: _cache[15] || (_cache[15] = ($event) => unref(showRightPicker)("year"))
  29528. }, toDisplayString(unref(rightYearLabel)), 43, _hoisted_12$1), withDirectives(createElementVNode("span", {
  29529. role: "button",
  29530. "aria-live": "polite",
  29531. tabindex: _ctx.disabled ? void 0 : 0,
  29532. "aria-disabled": _ctx.disabled,
  29533. class: normalizeClass([unref(drpNs).e("header-label"), { active: unref(rightCurrentView) === "month" }]),
  29534. onKeydown: _cache[16] || (_cache[16] = withKeys(($event) => unref(showRightPicker)("month"), ["enter"])),
  29535. onClick: _cache[17] || (_cache[17] = ($event) => unref(showRightPicker)("month"))
  29536. }, toDisplayString(unref(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, _hoisted_13$1), [[vShow, unref(rightCurrentView) === "date"]])])
  29537. ], 2),
  29538. unref(rightCurrentView) === "date" ? (openBlock(), createBlock(basic_date_table_default, {
  29539. key: 0,
  29540. ref_key: "rightCurrentViewRef",
  29541. ref: rightCurrentViewRef,
  29542. "selection-mode": "range",
  29543. date: rightDate.value,
  29544. "min-date": unref(minDate),
  29545. "max-date": unref(maxDate),
  29546. "range-state": unref(rangeState),
  29547. "disabled-date": unref(disabledDate),
  29548. "cell-class-name": unref(cellClassName),
  29549. "show-week-number": _ctx.showWeekNumber,
  29550. disabled: unref(dateRangeDisabled),
  29551. onChangerange: unref(handleChangeRange),
  29552. onPick: handleRangePick,
  29553. onSelect: unref(onSelect)
  29554. }, null, 8, [
  29555. "date",
  29556. "min-date",
  29557. "max-date",
  29558. "range-state",
  29559. "disabled-date",
  29560. "cell-class-name",
  29561. "show-week-number",
  29562. "disabled",
  29563. "onChangerange",
  29564. "onSelect"
  29565. ])) : createCommentVNode("v-if", true),
  29566. unref(rightCurrentView) === "year" ? (openBlock(), createBlock(basic_year_table_default, {
  29567. key: 1,
  29568. ref_key: "rightCurrentViewRef",
  29569. ref: rightCurrentViewRef,
  29570. "selection-mode": "year",
  29571. date: rightDate.value,
  29572. "disabled-date": unref(disabledDate),
  29573. "parsed-value": _ctx.parsedValue,
  29574. disabled: unref(dateRangeDisabled),
  29575. onPick: unref(handleRightYearPick)
  29576. }, null, 8, [
  29577. "date",
  29578. "disabled-date",
  29579. "parsed-value",
  29580. "disabled",
  29581. "onPick"
  29582. ])) : createCommentVNode("v-if", true),
  29583. unref(rightCurrentView) === "month" ? (openBlock(), createBlock(basic_month_table_default, {
  29584. key: 2,
  29585. ref_key: "rightCurrentViewRef",
  29586. ref: rightCurrentViewRef,
  29587. "selection-mode": "month",
  29588. date: rightDate.value,
  29589. "parsed-value": _ctx.parsedValue,
  29590. "disabled-date": unref(disabledDate),
  29591. disabled: unref(dateRangeDisabled),
  29592. onPick: unref(handleRightMonthPick)
  29593. }, null, 8, [
  29594. "date",
  29595. "parsed-value",
  29596. "disabled-date",
  29597. "disabled",
  29598. "onPick"
  29599. ])) : createCommentVNode("v-if", true)
  29600. ], 2)
  29601. ], 2)
  29602. ], 2), _ctx.showFooter && showTime.value && (_ctx.showConfirm || unref(clearable)) ? (openBlock(), createElementBlock("div", {
  29603. key: 0,
  29604. class: normalizeClass(unref(ppNs).e("footer"))
  29605. }, [unref(clearable) ? (openBlock(), createBlock(unref(ElButton), {
  29606. key: 0,
  29607. text: "",
  29608. size: "small",
  29609. class: normalizeClass(unref(ppNs).e("link-btn")),
  29610. onClick: onClear
  29611. }, {
  29612. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.clear")), 1)]),
  29613. _: 1
  29614. }, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
  29615. key: 1,
  29616. plain: "",
  29617. size: "small",
  29618. class: normalizeClass(unref(ppNs).e("link-btn")),
  29619. disabled: btnDisabled.value,
  29620. onClick: _cache[18] || (_cache[18] = ($event) => unref(handleRangeConfirm)(false))
  29621. }, {
  29622. default: withCtx(() => [createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)]),
  29623. _: 1
  29624. }, 8, ["class", "disabled"])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)], 2);
  29625. };
  29626. }
  29627. });
  29628. //#endregion
  29629. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue
  29630. var panel_date_range_default = panel_date_range_vue_vue_type_script_setup_true_lang_default;
  29631. //#endregion
  29632. //#region ../../packages/components/date-picker-panel/src/props/panel-month-range.ts
  29633. const panelMonthRangeProps = buildProps({ ...panelRangeSharedProps });
  29634. const panelMonthRangeEmits = [
  29635. "pick",
  29636. "set-picker-option",
  29637. "calendar-change"
  29638. ];
  29639. //#endregion
  29640. //#region ../../packages/components/date-picker-panel/src/composables/use-month-range-header.ts
  29641. const useMonthRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => {
  29642. const { t } = useLocale();
  29643. const leftPrevYear = () => {
  29644. leftDate.value = leftDate.value.subtract(1, "year");
  29645. if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(1, "year");
  29646. };
  29647. const rightNextYear = () => {
  29648. if (!unlinkPanels.value) leftDate.value = leftDate.value.add(1, "year");
  29649. rightDate.value = rightDate.value.add(1, "year");
  29650. };
  29651. const leftNextYear = () => {
  29652. leftDate.value = leftDate.value.add(1, "year");
  29653. };
  29654. const rightPrevYear = () => {
  29655. rightDate.value = rightDate.value.subtract(1, "year");
  29656. };
  29657. return {
  29658. leftPrevYear,
  29659. rightNextYear,
  29660. leftNextYear,
  29661. rightPrevYear,
  29662. leftLabel: computed(() => {
  29663. return `${leftDate.value.year()} ${t("el.datepicker.year")}`;
  29664. }),
  29665. rightLabel: computed(() => {
  29666. return `${rightDate.value.year()} ${t("el.datepicker.year")}`;
  29667. }),
  29668. leftYear: computed(() => {
  29669. return leftDate.value.year();
  29670. }),
  29671. rightYear: computed(() => {
  29672. return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year();
  29673. })
  29674. };
  29675. };
  29676. //#endregion
  29677. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-month-range.vue?vue&type=script&setup=true&lang.ts
  29678. const _hoisted_1$45 = ["disabled", "onClick"];
  29679. const _hoisted_2$27 = ["disabled"];
  29680. const _hoisted_3$12 = ["disabled"];
  29681. const _hoisted_4$9 = ["disabled"];
  29682. const _hoisted_5$6 = ["disabled"];
  29683. const unit$1 = "year";
  29684. var panel_month_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  29685. name: "DatePickerMonthRange",
  29686. __name: "panel-month-range",
  29687. props: panelMonthRangeProps,
  29688. emits: panelMonthRangeEmits,
  29689. setup(__props, { emit: __emit }) {
  29690. const props = __props;
  29691. const emit = __emit;
  29692. const { lang } = useLocale();
  29693. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  29694. const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  29695. const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
  29696. const format = toRef(pickerBase.props, "format");
  29697. const defaultValue = toRef(pickerBase.props, "defaultValue");
  29698. const leftDate = ref((0, import_dayjs_min.default)().locale(lang.value));
  29699. const rightDate = ref((0, import_dayjs_min.default)().locale(lang.value).add(1, unit$1));
  29700. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props, {
  29701. defaultValue,
  29702. leftDate,
  29703. rightDate,
  29704. unit: unit$1,
  29705. sortDates
  29706. });
  29707. const hasShortcuts = computed(() => !!shortcuts.length);
  29708. const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useMonthRangeHeader({
  29709. unlinkPanels: toRef(props, "unlinkPanels"),
  29710. leftDate,
  29711. rightDate
  29712. });
  29713. const enableYearArrow = computed(() => {
  29714. return props.unlinkPanels && rightYear.value > leftYear.value + 1;
  29715. });
  29716. const handleRangePick = (val, close = true) => {
  29717. const minDate_ = val.minDate;
  29718. const maxDate_ = val.maxDate;
  29719. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  29720. emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
  29721. maxDate.value = maxDate_;
  29722. minDate.value = minDate_;
  29723. if (!close) return;
  29724. handleRangeConfirm();
  29725. };
  29726. const handleClear = () => {
  29727. let valueOnClear = null;
  29728. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  29729. leftDate.value = getDefaultValue(unref(defaultValue), {
  29730. lang: unref(lang),
  29731. unit: "year",
  29732. unlinkPanels: props.unlinkPanels
  29733. })[0];
  29734. rightDate.value = leftDate.value.add(1, "year");
  29735. emit("pick", valueOnClear);
  29736. };
  29737. const parseUserInput = (value) => {
  29738. return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
  29739. };
  29740. function sortDates(minDate, maxDate) {
  29741. if (props.unlinkPanels && maxDate) rightDate.value = (minDate?.year() || 0) === maxDate.year() ? maxDate.add(1, unit$1) : maxDate;
  29742. else rightDate.value = leftDate.value.add(1, unit$1);
  29743. }
  29744. const monthRangeDisabled = useFormDisabled();
  29745. watch(() => props.visible, (visible) => {
  29746. if (!visible && rangeState.value.selecting) {
  29747. parseValue(props.parsedValue);
  29748. onSelect(false);
  29749. }
  29750. });
  29751. emit("set-picker-option", ["isValidValue", isValidRange]);
  29752. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  29753. emit("set-picker-option", ["handleClear", handleClear]);
  29754. return (_ctx, _cache) => {
  29755. return openBlock(), createElementBlock("div", { class: normalizeClass([
  29756. unref(ppNs).b(),
  29757. unref(drpNs).b(),
  29758. unref(ppNs).is("border", _ctx.border),
  29759. unref(ppNs).is("disabled", unref(monthRangeDisabled)),
  29760. { "has-sidebar": Boolean(_ctx.$slots.sidebar) || hasShortcuts.value }
  29761. ]) }, [createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [
  29762. renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }),
  29763. hasShortcuts.value ? (openBlock(), createElementBlock("div", {
  29764. key: 0,
  29765. class: normalizeClass(unref(ppNs).e("sidebar"))
  29766. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
  29767. return openBlock(), createElementBlock("button", {
  29768. key,
  29769. type: "button",
  29770. class: normalizeClass(unref(ppNs).e("shortcut")),
  29771. disabled: unref(monthRangeDisabled),
  29772. onClick: ($event) => unref(handleShortcutClick)(shortcut)
  29773. }, toDisplayString(shortcut.text), 11, _hoisted_1$45);
  29774. }), 128))], 2)) : createCommentVNode("v-if", true),
  29775. createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [createElementVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"]) }, [createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  29776. createElementVNode("button", {
  29777. type: "button",
  29778. class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
  29779. disabled: unref(monthRangeDisabled),
  29780. onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
  29781. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  29782. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  29783. _: 1
  29784. })])], 10, _hoisted_2$27),
  29785. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  29786. key: 0,
  29787. type: "button",
  29788. disabled: !enableYearArrow.value || unref(monthRangeDisabled),
  29789. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))], "d-arrow-right"]),
  29790. onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
  29791. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  29792. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  29793. _: 1
  29794. })])], 10, _hoisted_3$12)) : createCommentVNode("v-if", true),
  29795. createElementVNode("div", null, toDisplayString(unref(leftLabel)), 1)
  29796. ], 2), createVNode(basic_month_table_default, {
  29797. "selection-mode": "range",
  29798. date: leftDate.value,
  29799. "min-date": unref(minDate),
  29800. "max-date": unref(maxDate),
  29801. "range-state": unref(rangeState),
  29802. "disabled-date": unref(disabledDate),
  29803. disabled: unref(monthRangeDisabled),
  29804. "cell-class-name": unref(cellClassName),
  29805. onChangerange: unref(handleChangeRange),
  29806. onPick: handleRangePick,
  29807. onSelect: unref(onSelect)
  29808. }, null, 8, [
  29809. "date",
  29810. "min-date",
  29811. "max-date",
  29812. "range-state",
  29813. "disabled-date",
  29814. "disabled",
  29815. "cell-class-name",
  29816. "onChangerange",
  29817. "onSelect"
  29818. ])], 2), createElementVNode("div", { class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"]) }, [createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  29819. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  29820. key: 0,
  29821. type: "button",
  29822. disabled: !enableYearArrow.value || unref(monthRangeDisabled),
  29823. class: normalizeClass([[unref(ppNs).e("icon-btn"), unref(ppNs).is("disabled", !enableYearArrow.value || unref(monthRangeDisabled))], "d-arrow-left"]),
  29824. onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
  29825. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  29826. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  29827. _: 1
  29828. })])], 10, _hoisted_4$9)) : createCommentVNode("v-if", true),
  29829. createElementVNode("button", {
  29830. type: "button",
  29831. class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  29832. disabled: unref(monthRangeDisabled),
  29833. onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
  29834. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  29835. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  29836. _: 1
  29837. })])], 10, _hoisted_5$6),
  29838. createElementVNode("div", null, toDisplayString(unref(rightLabel)), 1)
  29839. ], 2), createVNode(basic_month_table_default, {
  29840. "selection-mode": "range",
  29841. date: rightDate.value,
  29842. "min-date": unref(minDate),
  29843. "max-date": unref(maxDate),
  29844. "range-state": unref(rangeState),
  29845. "disabled-date": unref(disabledDate),
  29846. disabled: unref(monthRangeDisabled),
  29847. "cell-class-name": unref(cellClassName),
  29848. onChangerange: unref(handleChangeRange),
  29849. onPick: handleRangePick,
  29850. onSelect: unref(onSelect)
  29851. }, null, 8, [
  29852. "date",
  29853. "min-date",
  29854. "max-date",
  29855. "range-state",
  29856. "disabled-date",
  29857. "disabled",
  29858. "cell-class-name",
  29859. "onChangerange",
  29860. "onSelect"
  29861. ])], 2)], 2)
  29862. ], 2)], 2);
  29863. };
  29864. }
  29865. });
  29866. //#endregion
  29867. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-month-range.vue
  29868. var panel_month_range_default = panel_month_range_vue_vue_type_script_setup_true_lang_default;
  29869. //#endregion
  29870. //#region ../../packages/components/date-picker-panel/src/props/panel-year-range.ts
  29871. const panelYearRangeProps = buildProps({ ...panelRangeSharedProps });
  29872. const panelYearRangeEmits = [
  29873. "pick",
  29874. "set-picker-option",
  29875. "calendar-change"
  29876. ];
  29877. //#endregion
  29878. //#region ../../packages/components/date-picker-panel/src/composables/use-year-range-header.ts
  29879. const useYearRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => {
  29880. const leftPrevYear = () => {
  29881. leftDate.value = leftDate.value.subtract(10, "year");
  29882. if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(10, "year");
  29883. };
  29884. const rightNextYear = () => {
  29885. if (!unlinkPanels.value) leftDate.value = leftDate.value.add(10, "year");
  29886. rightDate.value = rightDate.value.add(10, "year");
  29887. };
  29888. const leftNextYear = () => {
  29889. leftDate.value = leftDate.value.add(10, "year");
  29890. };
  29891. const rightPrevYear = () => {
  29892. rightDate.value = rightDate.value.subtract(10, "year");
  29893. };
  29894. return {
  29895. leftPrevYear,
  29896. rightNextYear,
  29897. leftNextYear,
  29898. rightPrevYear,
  29899. leftLabel: computed(() => {
  29900. const leftStartDate = Math.floor(leftDate.value.year() / 10) * 10;
  29901. return `${leftStartDate}-${leftStartDate + 9}`;
  29902. }),
  29903. rightLabel: computed(() => {
  29904. const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
  29905. return `${rightStartDate}-${rightStartDate + 9}`;
  29906. }),
  29907. leftYear: computed(() => {
  29908. return Math.floor(leftDate.value.year() / 10) * 10 + 9;
  29909. }),
  29910. rightYear: computed(() => {
  29911. return Math.floor(rightDate.value.year() / 10) * 10;
  29912. })
  29913. };
  29914. };
  29915. //#endregion
  29916. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-year-range.vue?vue&type=script&setup=true&lang.ts
  29917. const _hoisted_1$44 = ["disabled", "onClick"];
  29918. const _hoisted_2$26 = ["disabled"];
  29919. const _hoisted_3$11 = ["disabled"];
  29920. const _hoisted_4$8 = ["disabled"];
  29921. const _hoisted_5$5 = ["disabled"];
  29922. const step = 10;
  29923. const unit = "year";
  29924. var panel_year_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  29925. name: "DatePickerYearRange",
  29926. __name: "panel-year-range",
  29927. props: panelYearRangeProps,
  29928. emits: panelYearRangeEmits,
  29929. setup(__props, { emit: __emit }) {
  29930. const props = __props;
  29931. const emit = __emit;
  29932. const { lang } = useLocale();
  29933. const leftDate = ref((0, import_dayjs_min.default)().locale(lang.value));
  29934. const rightDate = ref((0, import_dayjs_min.default)().locale(lang.value).add(step, unit));
  29935. const isDefaultFormat = inject(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  29936. const pickerBase = inject(PICKER_BASE_INJECTION_KEY);
  29937. const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
  29938. const format = toRef(pickerBase.props, "format");
  29939. const defaultValue = toRef(pickerBase.props, "defaultValue");
  29940. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props, {
  29941. defaultValue,
  29942. leftDate,
  29943. rightDate,
  29944. step,
  29945. unit,
  29946. sortDates
  29947. });
  29948. const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useYearRangeHeader({
  29949. unlinkPanels: toRef(props, "unlinkPanels"),
  29950. leftDate,
  29951. rightDate
  29952. });
  29953. const yearRangeDisabled = useFormDisabled();
  29954. const hasShortcuts = computed(() => !!shortcuts.length);
  29955. const panelKls = computed(() => [
  29956. ppNs.b(),
  29957. drpNs.b(),
  29958. ppNs.is("border", props.border),
  29959. ppNs.is("disabled", yearRangeDisabled.value),
  29960. { "has-sidebar": Boolean(useSlots().sidebar) || hasShortcuts.value }
  29961. ]);
  29962. const leftPanelKls = computed(() => {
  29963. return {
  29964. content: [
  29965. ppNs.e("content"),
  29966. drpNs.e("content"),
  29967. "is-left"
  29968. ],
  29969. arrowLeftBtn: [ppNs.e("icon-btn"), "d-arrow-left"],
  29970. arrowRightBtn: [
  29971. ppNs.e("icon-btn"),
  29972. ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
  29973. "d-arrow-right"
  29974. ]
  29975. };
  29976. });
  29977. const rightPanelKls = computed(() => {
  29978. return {
  29979. content: [
  29980. ppNs.e("content"),
  29981. drpNs.e("content"),
  29982. "is-right"
  29983. ],
  29984. arrowLeftBtn: [
  29985. ppNs.e("icon-btn"),
  29986. ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
  29987. "d-arrow-left"
  29988. ],
  29989. arrowRightBtn: [ppNs.e("icon-btn"), "d-arrow-right"]
  29990. };
  29991. });
  29992. const enableYearArrow = computed(() => {
  29993. return props.unlinkPanels && rightYear.value > leftYear.value + 1;
  29994. });
  29995. const handleRangePick = (val, close = true) => {
  29996. const minDate_ = val.minDate;
  29997. const maxDate_ = val.maxDate;
  29998. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  29999. emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
  30000. maxDate.value = maxDate_;
  30001. minDate.value = minDate_;
  30002. if (!close) return;
  30003. handleRangeConfirm();
  30004. };
  30005. const parseUserInput = (value) => {
  30006. return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
  30007. };
  30008. const isValidValue = (date) => {
  30009. return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
  30010. };
  30011. const handleClear = () => {
  30012. let valueOnClear = null;
  30013. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  30014. const defaultArr = getDefaultValue(unref(defaultValue), {
  30015. lang: unref(lang),
  30016. step,
  30017. unit,
  30018. unlinkPanels: props.unlinkPanels
  30019. });
  30020. leftDate.value = defaultArr[0];
  30021. rightDate.value = defaultArr[1];
  30022. emit("pick", valueOnClear);
  30023. };
  30024. function sortDates(minDate, maxDate) {
  30025. if (props.unlinkPanels && maxDate) {
  30026. const minDateYear = minDate?.year() || 0;
  30027. const maxDateYear = maxDate.year();
  30028. rightDate.value = minDateYear + step > maxDateYear ? maxDate.add(step, unit) : maxDate;
  30029. } else rightDate.value = leftDate.value.add(step, unit);
  30030. }
  30031. watch(() => props.visible, (visible) => {
  30032. if (!visible && rangeState.value.selecting) {
  30033. parseValue(props.parsedValue);
  30034. onSelect(false);
  30035. }
  30036. });
  30037. emit("set-picker-option", ["isValidValue", isValidValue]);
  30038. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  30039. emit("set-picker-option", ["handleClear", handleClear]);
  30040. return (_ctx, _cache) => {
  30041. return openBlock(), createElementBlock("div", { class: normalizeClass(panelKls.value) }, [createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body-wrapper")) }, [
  30042. renderSlot(_ctx.$slots, "sidebar", { class: normalizeClass(unref(ppNs).e("sidebar")) }),
  30043. hasShortcuts.value ? (openBlock(), createElementBlock("div", {
  30044. key: 0,
  30045. class: normalizeClass(unref(ppNs).e("sidebar"))
  30046. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
  30047. return openBlock(), createElementBlock("button", {
  30048. key,
  30049. type: "button",
  30050. class: normalizeClass(unref(ppNs).e("shortcut")),
  30051. disabled: unref(yearRangeDisabled),
  30052. onClick: ($event) => unref(handleShortcutClick)(shortcut)
  30053. }, toDisplayString(shortcut.text), 11, _hoisted_1$44);
  30054. }), 128))], 2)) : createCommentVNode("v-if", true),
  30055. createElementVNode("div", { class: normalizeClass(unref(ppNs).e("body")) }, [createElementVNode("div", { class: normalizeClass(leftPanelKls.value.content) }, [createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  30056. createElementVNode("button", {
  30057. type: "button",
  30058. class: normalizeClass(leftPanelKls.value.arrowLeftBtn),
  30059. disabled: unref(yearRangeDisabled),
  30060. onClick: _cache[0] || (_cache[0] = (...args) => unref(leftPrevYear) && unref(leftPrevYear)(...args))
  30061. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  30062. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  30063. _: 1
  30064. })])], 10, _hoisted_2$26),
  30065. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  30066. key: 0,
  30067. type: "button",
  30068. disabled: !enableYearArrow.value || unref(yearRangeDisabled),
  30069. class: normalizeClass(leftPanelKls.value.arrowRightBtn),
  30070. onClick: _cache[1] || (_cache[1] = (...args) => unref(leftNextYear) && unref(leftNextYear)(...args))
  30071. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  30072. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  30073. _: 1
  30074. })])], 10, _hoisted_3$11)) : createCommentVNode("v-if", true),
  30075. createElementVNode("div", null, toDisplayString(unref(leftLabel)), 1)
  30076. ], 2), createVNode(basic_year_table_default, {
  30077. "selection-mode": "range",
  30078. date: leftDate.value,
  30079. "min-date": unref(minDate),
  30080. "max-date": unref(maxDate),
  30081. "range-state": unref(rangeState),
  30082. "disabled-date": unref(disabledDate),
  30083. disabled: unref(yearRangeDisabled),
  30084. "cell-class-name": unref(cellClassName),
  30085. onChangerange: unref(handleChangeRange),
  30086. onPick: handleRangePick,
  30087. onSelect: unref(onSelect)
  30088. }, null, 8, [
  30089. "date",
  30090. "min-date",
  30091. "max-date",
  30092. "range-state",
  30093. "disabled-date",
  30094. "disabled",
  30095. "cell-class-name",
  30096. "onChangerange",
  30097. "onSelect"
  30098. ])], 2), createElementVNode("div", { class: normalizeClass(rightPanelKls.value.content) }, [createElementVNode("div", { class: normalizeClass(unref(drpNs).e("header")) }, [
  30099. _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
  30100. key: 0,
  30101. type: "button",
  30102. disabled: !enableYearArrow.value || unref(yearRangeDisabled),
  30103. class: normalizeClass(rightPanelKls.value.arrowLeftBtn),
  30104. onClick: _cache[2] || (_cache[2] = (...args) => unref(rightPrevYear) && unref(rightPrevYear)(...args))
  30105. }, [renderSlot(_ctx.$slots, "prev-year", {}, () => [createVNode(unref(ElIcon), null, {
  30106. default: withCtx(() => [createVNode(unref(d_arrow_left_default))]),
  30107. _: 1
  30108. })])], 10, _hoisted_4$8)) : createCommentVNode("v-if", true),
  30109. createElementVNode("button", {
  30110. type: "button",
  30111. class: normalizeClass(rightPanelKls.value.arrowRightBtn),
  30112. disabled: unref(yearRangeDisabled),
  30113. onClick: _cache[3] || (_cache[3] = (...args) => unref(rightNextYear) && unref(rightNextYear)(...args))
  30114. }, [renderSlot(_ctx.$slots, "next-year", {}, () => [createVNode(unref(ElIcon), null, {
  30115. default: withCtx(() => [createVNode(unref(d_arrow_right_default))]),
  30116. _: 1
  30117. })])], 10, _hoisted_5$5),
  30118. createElementVNode("div", null, toDisplayString(unref(rightLabel)), 1)
  30119. ], 2), createVNode(basic_year_table_default, {
  30120. "selection-mode": "range",
  30121. date: rightDate.value,
  30122. "min-date": unref(minDate),
  30123. "max-date": unref(maxDate),
  30124. "range-state": unref(rangeState),
  30125. "disabled-date": unref(disabledDate),
  30126. disabled: unref(yearRangeDisabled),
  30127. "cell-class-name": unref(cellClassName),
  30128. onChangerange: unref(handleChangeRange),
  30129. onPick: handleRangePick,
  30130. onSelect: unref(onSelect)
  30131. }, null, 8, [
  30132. "date",
  30133. "min-date",
  30134. "max-date",
  30135. "range-state",
  30136. "disabled-date",
  30137. "disabled",
  30138. "cell-class-name",
  30139. "onChangerange",
  30140. "onSelect"
  30141. ])], 2)], 2)
  30142. ], 2)], 2);
  30143. };
  30144. }
  30145. });
  30146. //#endregion
  30147. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-year-range.vue
  30148. var panel_year_range_default = panel_year_range_vue_vue_type_script_setup_true_lang_default;
  30149. //#endregion
  30150. //#region ../../packages/components/date-picker-panel/src/panel-utils.ts
  30151. const getPanel = function(type) {
  30152. switch (type) {
  30153. case "daterange":
  30154. case "datetimerange": return panel_date_range_default;
  30155. case "monthrange": return panel_month_range_default;
  30156. case "yearrange": return panel_year_range_default;
  30157. default: return panel_date_pick_default;
  30158. }
  30159. };
  30160. //#endregion
  30161. //#region ../../packages/components/date-picker-panel/src/date-picker-panel.tsx
  30162. function _isSlot$7(s) {
  30163. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  30164. }
  30165. import_dayjs_min.default.extend(import_localeData.default);
  30166. import_dayjs_min.default.extend(import_advancedFormat.default);
  30167. import_dayjs_min.default.extend(import_customParseFormat.default);
  30168. import_dayjs_min.default.extend(import_weekOfYear.default);
  30169. import_dayjs_min.default.extend(import_weekYear.default);
  30170. import_dayjs_min.default.extend(import_dayOfYear.default);
  30171. import_dayjs_min.default.extend(import_isSameOrAfter.default);
  30172. import_dayjs_min.default.extend(import_isSameOrBefore.default);
  30173. var date_picker_panel_default = /* @__PURE__ */ defineComponent({
  30174. name: "ElDatePickerPanel",
  30175. install: null,
  30176. inheritAttrs: false,
  30177. props: datePickerPanelProps,
  30178. emits: [
  30179. UPDATE_MODEL_EVENT,
  30180. "calendar-change",
  30181. "panel-change",
  30182. "visible-change",
  30183. "clear"
  30184. ],
  30185. setup(props, { slots, emit, attrs }) {
  30186. const ns = useNamespace("picker-panel");
  30187. if (isUndefined(inject(PICKER_BASE_INJECTION_KEY, void 0))) provide(PICKER_BASE_INJECTION_KEY, { props: reactive({ ...toRefs(props) }) });
  30188. provide(ROOT_PICKER_INJECTION_KEY, {
  30189. slots,
  30190. pickerNs: ns
  30191. });
  30192. const { parsedValue, onCalendarChange, onPanelChange, onSetPickerOption, onPick } = inject(ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker(props, emit), true);
  30193. return () => {
  30194. return createVNode(getPanel(props.type), mergeProps(omit(attrs, "onPick"), props, {
  30195. "parsedValue": parsedValue.value,
  30196. "onSet-picker-option": onSetPickerOption,
  30197. "onCalendar-change": onCalendarChange,
  30198. "onPanel-change": onPanelChange,
  30199. "onClear": () => emit("clear"),
  30200. "onPick": onPick
  30201. }), _isSlot$7(slots) ? slots : { default: () => [slots] });
  30202. };
  30203. }
  30204. });
  30205. //#endregion
  30206. //#region ../../packages/components/date-picker-panel/index.ts
  30207. const ElDatePickerPanel = withInstall(date_picker_panel_default);
  30208. //#endregion
  30209. //#region ../../packages/components/date-picker/src/props.ts
  30210. const datePickerProps = buildProps({
  30211. ...timePickerDefaultProps,
  30212. type: {
  30213. type: definePropType(String),
  30214. default: "date"
  30215. }
  30216. });
  30217. //#endregion
  30218. //#region ../../packages/components/date-picker/src/date-picker.tsx
  30219. function _isSlot$6(s) {
  30220. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  30221. }
  30222. var date_picker_default = /* @__PURE__ */ defineComponent({
  30223. name: "ElDatePicker",
  30224. install: null,
  30225. props: datePickerProps,
  30226. emits: [UPDATE_MODEL_EVENT],
  30227. setup(props, { expose, emit, slots }) {
  30228. provide(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, computed(() => {
  30229. return !props.format;
  30230. }));
  30231. provide(PICKER_POPPER_OPTIONS_INJECTION_KEY, reactive(toRef(props, "popperOptions")));
  30232. const commonPicker = ref();
  30233. expose({
  30234. focus: () => {
  30235. commonPicker.value?.focus();
  30236. },
  30237. blur: () => {
  30238. commonPicker.value?.blur();
  30239. },
  30240. handleOpen: () => {
  30241. commonPicker.value?.handleOpen();
  30242. },
  30243. handleClose: () => {
  30244. commonPicker.value?.handleClose();
  30245. }
  30246. });
  30247. const onModelValueUpdated = (val) => {
  30248. emit(UPDATE_MODEL_EVENT, val);
  30249. };
  30250. return () => {
  30251. const format = props.format ?? (DEFAULT_FORMATS_DATEPICKER[props.type] || DEFAULT_FORMATS_DATE);
  30252. return createVNode(picker_default, mergeProps(props, {
  30253. "format": format,
  30254. "type": props.type,
  30255. "ref": commonPicker,
  30256. "onUpdate:modelValue": onModelValueUpdated
  30257. }), {
  30258. default: (scopedProps) => createVNode(ElDatePickerPanel, mergeProps({
  30259. "disabled": props.disabled,
  30260. "editable": props.editable,
  30261. "border": false
  30262. }, scopedProps), _isSlot$6(slots) ? slots : { default: () => [slots] }),
  30263. "range-separator": slots["range-separator"]
  30264. });
  30265. };
  30266. }
  30267. });
  30268. //#endregion
  30269. //#region ../../packages/components/date-picker/index.ts
  30270. const ElDatePicker = withInstall(date_picker_default);
  30271. //#endregion
  30272. //#region ../../packages/components/descriptions/src/description.ts
  30273. /**
  30274. * @deprecated Removed after 3.0.0, Use `DescriptionProps` instead.
  30275. */
  30276. const descriptionProps = buildProps({
  30277. border: Boolean,
  30278. column: {
  30279. type: Number,
  30280. default: 3
  30281. },
  30282. direction: {
  30283. type: String,
  30284. values: ["horizontal", "vertical"],
  30285. default: "horizontal"
  30286. },
  30287. size: useSizeProp,
  30288. title: {
  30289. type: String,
  30290. default: ""
  30291. },
  30292. extra: {
  30293. type: String,
  30294. default: ""
  30295. },
  30296. labelWidth: { type: [String, Number] }
  30297. });
  30298. //#endregion
  30299. //#region ../../packages/components/descriptions/src/descriptions-row.ts
  30300. /**
  30301. * @deprecated Removed after 3.0.0, Use `DescriptionsRowProps` instead.
  30302. */
  30303. const descriptionsRowProps = buildProps({ row: {
  30304. type: definePropType(Array),
  30305. default: () => []
  30306. } });
  30307. //#endregion
  30308. //#region ../../packages/components/descriptions/src/token.ts
  30309. const descriptionsKey = Symbol("elDescriptions");
  30310. //#endregion
  30311. //#region ../../packages/components/descriptions/src/descriptions-cell.ts
  30312. var descriptions_cell_default = defineComponent({
  30313. name: "ElDescriptionsCell",
  30314. props: {
  30315. cell: { type: Object },
  30316. tag: {
  30317. type: String,
  30318. default: "td"
  30319. },
  30320. type: { type: String }
  30321. },
  30322. setup() {
  30323. return { descriptions: inject(descriptionsKey, {}) };
  30324. },
  30325. render() {
  30326. const item = getNormalizedProps(this.cell);
  30327. const directives = (this.cell?.dirs || []).map((dire) => {
  30328. const { dir, arg, modifiers, value } = dire;
  30329. return [
  30330. dir,
  30331. value,
  30332. arg,
  30333. modifiers
  30334. ];
  30335. });
  30336. const { border, direction } = this.descriptions;
  30337. const isVertical = direction === "vertical";
  30338. const renderLabel = () => this.cell?.children?.label?.() || item.label;
  30339. const renderContent = () => this.cell?.children?.default?.();
  30340. const span = item.span;
  30341. const rowspan = item.rowspan;
  30342. const align = item.align ? `is-${item.align}` : "";
  30343. const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
  30344. const className = item.className;
  30345. const labelClassName = item.labelClassName;
  30346. const style = {
  30347. width: addUnit(this.type === "label" ? item.labelWidth ?? this.descriptions.labelWidth ?? item.width : item.width),
  30348. minWidth: addUnit(item.minWidth)
  30349. };
  30350. const ns = useNamespace("descriptions");
  30351. switch (this.type) {
  30352. case "label": return withDirectives(h(this.tag, {
  30353. style,
  30354. class: [
  30355. ns.e("cell"),
  30356. ns.e("label"),
  30357. ns.is("bordered-label", border),
  30358. ns.is("vertical-label", isVertical),
  30359. labelAlign,
  30360. labelClassName
  30361. ],
  30362. colSpan: isVertical ? span : 1,
  30363. rowspan: isVertical ? 1 : rowspan
  30364. }, renderLabel()), directives);
  30365. case "content": return withDirectives(h(this.tag, {
  30366. style,
  30367. class: [
  30368. ns.e("cell"),
  30369. ns.e("content"),
  30370. ns.is("bordered-content", border),
  30371. ns.is("vertical-content", isVertical),
  30372. align,
  30373. className
  30374. ],
  30375. colSpan: isVertical ? span : span * 2 - 1,
  30376. rowspan: isVertical ? rowspan * 2 - 1 : rowspan
  30377. }, renderContent()), directives);
  30378. default: {
  30379. const label = renderLabel();
  30380. const labelStyle = {};
  30381. const width = addUnit(item.labelWidth ?? this.descriptions.labelWidth);
  30382. if (width) {
  30383. labelStyle.width = width;
  30384. labelStyle.display = "inline-block";
  30385. }
  30386. return withDirectives(h("td", {
  30387. style,
  30388. class: [ns.e("cell"), align],
  30389. colSpan: span,
  30390. rowspan
  30391. }, [!isNil(label) ? h("span", {
  30392. style: labelStyle,
  30393. class: [ns.e("label"), labelClassName]
  30394. }, label) : void 0, h("span", { class: [ns.e("content"), className] }, renderContent())]), directives);
  30395. }
  30396. }
  30397. }
  30398. });
  30399. //#endregion
  30400. //#region ../../packages/components/descriptions/src/descriptions-row.vue?vue&type=script&setup=true&lang.ts
  30401. const _hoisted_1$43 = { key: 1 };
  30402. var descriptions_row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  30403. name: "ElDescriptionsRow",
  30404. __name: "descriptions-row",
  30405. props: descriptionsRowProps,
  30406. setup(__props) {
  30407. const descriptions = inject(descriptionsKey, {});
  30408. return (_ctx, _cache) => {
  30409. return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => {
  30410. return openBlock(), createBlock(unref(descriptions_cell_default), {
  30411. key: `tr1-${_index}`,
  30412. cell,
  30413. tag: "th",
  30414. type: "label"
  30415. }, null, 8, ["cell"]);
  30416. }), 128))]), createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => {
  30417. return openBlock(), createBlock(unref(descriptions_cell_default), {
  30418. key: `tr2-${_index}`,
  30419. cell,
  30420. tag: "td",
  30421. type: "content"
  30422. }, null, 8, ["cell"]);
  30423. }), 128))])], 64)) : (openBlock(), createElementBlock("tr", _hoisted_1$43, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row, (cell, _index) => {
  30424. return openBlock(), createElementBlock(Fragment, { key: `tr3-${_index}` }, [unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(descriptions_cell_default), {
  30425. cell,
  30426. tag: "td",
  30427. type: "label"
  30428. }, null, 8, ["cell"]), createVNode(unref(descriptions_cell_default), {
  30429. cell,
  30430. tag: "td",
  30431. type: "content"
  30432. }, null, 8, ["cell"])], 64)) : (openBlock(), createBlock(unref(descriptions_cell_default), {
  30433. key: 1,
  30434. cell,
  30435. tag: "td",
  30436. type: "both"
  30437. }, null, 8, ["cell"]))], 64);
  30438. }), 128))]));
  30439. };
  30440. }
  30441. });
  30442. //#endregion
  30443. //#region ../../packages/components/descriptions/src/descriptions-row.vue
  30444. var descriptions_row_default = descriptions_row_vue_vue_type_script_setup_true_lang_default;
  30445. //#endregion
  30446. //#region ../../packages/components/descriptions/src/constants.ts
  30447. const COMPONENT_NAME$10 = "ElDescriptionsItem";
  30448. //#endregion
  30449. //#region ../../packages/components/descriptions/src/description.vue?vue&type=script&setup=true&lang.ts
  30450. var description_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  30451. name: "ElDescriptions",
  30452. __name: "description",
  30453. props: descriptionProps,
  30454. setup(__props) {
  30455. const props = __props;
  30456. const ns = useNamespace("descriptions");
  30457. const descriptionsSize = useFormSize();
  30458. const slots = useSlots();
  30459. provide(descriptionsKey, props);
  30460. const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
  30461. const filledNode = (node, span, count, isLast = false) => {
  30462. if (!node.props) node.props = {};
  30463. if (span > count) node.props.span = count;
  30464. if (isLast) node.props.span = span;
  30465. return node;
  30466. };
  30467. const getRows = () => {
  30468. if (!slots.default) return [];
  30469. const children = flattedChildren(slots.default()).filter((node) => node?.type?.name === COMPONENT_NAME$10);
  30470. const rows = [];
  30471. let temp = [];
  30472. let count = props.column;
  30473. let totalSpan = 0;
  30474. const rowspanTemp = [];
  30475. children.forEach((node, index) => {
  30476. const span = node.props?.span || 1;
  30477. const rowspan = node.props?.rowspan || 1;
  30478. const rowNo = rows.length;
  30479. rowspanTemp[rowNo] ||= 0;
  30480. if (rowspan > 1) for (let i = 1; i < rowspan; i++) {
  30481. rowspanTemp[rowNo + i] ||= 0;
  30482. rowspanTemp[rowNo + i]++;
  30483. totalSpan++;
  30484. }
  30485. if (rowspanTemp[rowNo] > 0) {
  30486. count -= rowspanTemp[rowNo];
  30487. rowspanTemp[rowNo] = 0;
  30488. }
  30489. if (index < children.length - 1) totalSpan += span > count ? count : span;
  30490. if (index === children.length - 1) {
  30491. const lastSpan = props.column - totalSpan % props.column;
  30492. temp.push(filledNode(node, lastSpan, count, true));
  30493. rows.push(temp);
  30494. return;
  30495. }
  30496. if (span < count) {
  30497. count -= span;
  30498. temp.push(node);
  30499. } else {
  30500. temp.push(filledNode(node, span, count));
  30501. rows.push(temp);
  30502. count = props.column;
  30503. temp = [];
  30504. }
  30505. });
  30506. return rows;
  30507. };
  30508. return (_ctx, _cache) => {
  30509. return openBlock(), createElementBlock("div", { class: normalizeClass(descriptionKls.value) }, [__props.title || __props.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
  30510. key: 0,
  30511. class: normalizeClass(unref(ns).e("header"))
  30512. }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), createElementVNode("div", { class: normalizeClass(unref(ns).e("extra")) }, [renderSlot(_ctx.$slots, "extra", {}, () => [createTextVNode(toDisplayString(__props.extra), 1)])], 2)], 2)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("body")) }, [createElementVNode("table", { class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", __props.border)]) }, [createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => {
  30513. return openBlock(), createBlock(descriptions_row_default, {
  30514. key: _index,
  30515. row
  30516. }, null, 8, ["row"]);
  30517. }), 128))])], 2)], 2)], 2);
  30518. };
  30519. }
  30520. });
  30521. //#endregion
  30522. //#region ../../packages/components/descriptions/src/description.vue
  30523. var description_default = description_vue_vue_type_script_setup_true_lang_default;
  30524. //#endregion
  30525. //#region ../../packages/components/descriptions/src/description-item.ts
  30526. const descriptionItemProps = buildProps({
  30527. label: {
  30528. type: String,
  30529. default: ""
  30530. },
  30531. span: {
  30532. type: Number,
  30533. default: 1
  30534. },
  30535. rowspan: {
  30536. type: Number,
  30537. default: 1
  30538. },
  30539. width: {
  30540. type: [String, Number],
  30541. default: ""
  30542. },
  30543. minWidth: {
  30544. type: [String, Number],
  30545. default: ""
  30546. },
  30547. labelWidth: { type: [String, Number] },
  30548. align: {
  30549. type: String,
  30550. values: columnAlignment,
  30551. default: "left"
  30552. },
  30553. labelAlign: {
  30554. type: String,
  30555. values: columnAlignment
  30556. },
  30557. className: {
  30558. type: String,
  30559. default: ""
  30560. },
  30561. labelClassName: {
  30562. type: String,
  30563. default: ""
  30564. }
  30565. });
  30566. const DescriptionItem = defineComponent({
  30567. name: COMPONENT_NAME$10,
  30568. props: descriptionItemProps
  30569. });
  30570. //#endregion
  30571. //#region ../../packages/components/descriptions/index.ts
  30572. const ElDescriptions = withInstall(description_default, { DescriptionsItem: DescriptionItem });
  30573. const ElDescriptionsItem = withNoopInstall(DescriptionItem);
  30574. //#endregion
  30575. //#region ../../packages/components/dialog/src/dialog-content.ts
  30576. /**
  30577. * @deprecated Removed after 3.0.0, Use `DialogContentProps` instead.
  30578. */
  30579. const dialogContentProps = buildProps({
  30580. center: Boolean,
  30581. alignCenter: {
  30582. type: Boolean,
  30583. default: void 0
  30584. },
  30585. closeIcon: { type: iconPropType },
  30586. draggable: {
  30587. type: Boolean,
  30588. default: void 0
  30589. },
  30590. overflow: {
  30591. type: Boolean,
  30592. default: void 0
  30593. },
  30594. fullscreen: Boolean,
  30595. headerClass: String,
  30596. bodyClass: String,
  30597. footerClass: String,
  30598. showClose: {
  30599. type: Boolean,
  30600. default: true
  30601. },
  30602. title: {
  30603. type: String,
  30604. default: ""
  30605. },
  30606. ariaLevel: {
  30607. type: String,
  30608. default: "2"
  30609. }
  30610. });
  30611. const dialogContentEmits = { close: () => true };
  30612. const dialogContentPropsDefaults = {
  30613. alignCenter: void 0,
  30614. draggable: void 0,
  30615. overflow: void 0,
  30616. showClose: true,
  30617. title: "",
  30618. ariaLevel: "2"
  30619. };
  30620. //#endregion
  30621. //#region ../../packages/components/dialog/src/dialog.ts
  30622. /**
  30623. * @deprecated Removed after 3.0.0, Use `DialogProps` instead.
  30624. */
  30625. const dialogProps = buildProps({
  30626. ...dialogContentProps,
  30627. appendToBody: Boolean,
  30628. appendTo: {
  30629. type: teleportProps.to.type,
  30630. default: "body"
  30631. },
  30632. beforeClose: { type: definePropType(Function) },
  30633. destroyOnClose: Boolean,
  30634. closeOnClickModal: {
  30635. type: Boolean,
  30636. default: true
  30637. },
  30638. closeOnPressEscape: {
  30639. type: Boolean,
  30640. default: true
  30641. },
  30642. lockScroll: {
  30643. type: Boolean,
  30644. default: true
  30645. },
  30646. modal: {
  30647. type: Boolean,
  30648. default: true
  30649. },
  30650. modalPenetrable: Boolean,
  30651. openDelay: {
  30652. type: Number,
  30653. default: 0
  30654. },
  30655. closeDelay: {
  30656. type: Number,
  30657. default: 0
  30658. },
  30659. top: { type: String },
  30660. modelValue: Boolean,
  30661. modalClass: String,
  30662. headerClass: String,
  30663. bodyClass: String,
  30664. footerClass: String,
  30665. width: { type: [String, Number] },
  30666. zIndex: { type: Number },
  30667. trapFocus: Boolean,
  30668. headerAriaLevel: {
  30669. type: String,
  30670. default: "2"
  30671. },
  30672. transition: {
  30673. type: definePropType([String, Object]),
  30674. default: void 0
  30675. }
  30676. });
  30677. const dialogEmits = {
  30678. open: () => true,
  30679. opened: () => true,
  30680. close: () => true,
  30681. closed: () => true,
  30682. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  30683. openAutoFocus: () => true,
  30684. closeAutoFocus: () => true
  30685. };
  30686. const dialogContextKey = Symbol("dialogContextKey");
  30687. const dialogPropsDefaults = {
  30688. ...dialogContentPropsDefaults,
  30689. appendTo: "body",
  30690. closeOnClickModal: true,
  30691. closeOnPressEscape: true,
  30692. lockScroll: true,
  30693. modal: true,
  30694. openDelay: 0,
  30695. closeDelay: 0,
  30696. headerAriaLevel: "2",
  30697. transition: void 0
  30698. };
  30699. //#endregion
  30700. //#region ../../packages/components/overlay/src/overlay.ts
  30701. const overlayProps = buildProps({
  30702. mask: {
  30703. type: Boolean,
  30704. default: true
  30705. },
  30706. customMaskEvent: Boolean,
  30707. overlayClass: { type: definePropType([
  30708. String,
  30709. Array,
  30710. Object
  30711. ]) },
  30712. zIndex: { type: definePropType([String, Number]) }
  30713. });
  30714. const overlayEmits = { click: (evt) => evt instanceof MouseEvent };
  30715. const BLOCK = "overlay";
  30716. var overlay_default = defineComponent({
  30717. name: "ElOverlay",
  30718. props: overlayProps,
  30719. emits: overlayEmits,
  30720. setup(props, { slots, emit }) {
  30721. const ns = useNamespace(BLOCK);
  30722. const onMaskClick = (e) => {
  30723. emit("click", e);
  30724. };
  30725. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  30726. return () => {
  30727. return props.mask ? createVNode("div", {
  30728. class: [ns.b(), props.overlayClass],
  30729. style: { zIndex: props.zIndex },
  30730. onClick,
  30731. onMousedown,
  30732. onMouseup
  30733. }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, [
  30734. "onClick",
  30735. "onMouseup",
  30736. "onMousedown"
  30737. ]) : h("div", {
  30738. class: props.overlayClass,
  30739. style: {
  30740. zIndex: props.zIndex,
  30741. position: "fixed",
  30742. top: "0px",
  30743. right: "0px",
  30744. bottom: "0px",
  30745. left: "0px"
  30746. }
  30747. }, [renderSlot(slots, "default")]);
  30748. };
  30749. }
  30750. });
  30751. //#endregion
  30752. //#region ../../packages/components/overlay/index.ts
  30753. const ElOverlay = overlay_default;
  30754. //#endregion
  30755. //#region ../../packages/components/dialog/src/constants.ts
  30756. const dialogInjectionKey = Symbol("dialogInjectionKey");
  30757. const DEFAULT_DIALOG_TRANSITION = "dialog-fade";
  30758. //#endregion
  30759. //#region ../../packages/components/dialog/src/dialog-content.vue?vue&type=script&setup=true&lang.ts
  30760. const _hoisted_1$42 = ["aria-level"];
  30761. const _hoisted_2$25 = ["aria-label"];
  30762. const _hoisted_3$10 = ["id"];
  30763. var dialog_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  30764. name: "ElDialogContent",
  30765. __name: "dialog-content",
  30766. props: dialogContentProps,
  30767. emits: dialogContentEmits,
  30768. setup(__props, { expose: __expose }) {
  30769. const { t } = useLocale();
  30770. const { Close } = CloseComponents;
  30771. const props = __props;
  30772. const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
  30773. const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
  30774. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  30775. const draggable = computed(() => !!props.draggable);
  30776. const { resetPosition, updatePosition, isDragging } = useDraggable(dialogRef, headerRef, draggable, computed(() => !!props.overflow));
  30777. const dialogKls = computed(() => [
  30778. ns.b(),
  30779. ns.is("fullscreen", props.fullscreen),
  30780. ns.is("draggable", draggable.value),
  30781. ns.is("dragging", isDragging.value),
  30782. ns.is("align-center", !!props.alignCenter),
  30783. { [ns.m("center")]: props.center }
  30784. ]);
  30785. __expose({
  30786. resetPosition,
  30787. updatePosition
  30788. });
  30789. return (_ctx, _cache) => {
  30790. return openBlock(), createElementBlock("div", {
  30791. ref: unref(composedDialogRef),
  30792. class: normalizeClass(dialogKls.value),
  30793. style: normalizeStyle(unref(style)),
  30794. tabindex: "-1"
  30795. }, [
  30796. createElementVNode("header", {
  30797. ref_key: "headerRef",
  30798. ref: headerRef,
  30799. class: normalizeClass([
  30800. unref(ns).e("header"),
  30801. __props.headerClass,
  30802. { "show-close": __props.showClose }
  30803. ])
  30804. }, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("span", {
  30805. role: "heading",
  30806. "aria-level": __props.ariaLevel,
  30807. class: normalizeClass(unref(ns).e("title"))
  30808. }, toDisplayString(__props.title), 11, _hoisted_1$42)]), __props.showClose ? (openBlock(), createElementBlock("button", {
  30809. key: 0,
  30810. "aria-label": unref(t)("el.dialog.close"),
  30811. class: normalizeClass(unref(ns).e("headerbtn")),
  30812. type: "button",
  30813. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  30814. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, {
  30815. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.closeIcon || unref(Close))))]),
  30816. _: 1
  30817. }, 8, ["class"])], 10, _hoisted_2$25)) : createCommentVNode("v-if", true)], 2),
  30818. createElementVNode("div", {
  30819. id: unref(bodyId),
  30820. class: normalizeClass([unref(ns).e("body"), __props.bodyClass])
  30821. }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3$10),
  30822. _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
  30823. key: 0,
  30824. class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
  30825. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  30826. ], 6);
  30827. };
  30828. }
  30829. });
  30830. //#endregion
  30831. //#region ../../packages/components/dialog/src/dialog-content.vue
  30832. var dialog_content_default = dialog_content_vue_vue_type_script_setup_true_lang_default;
  30833. //#endregion
  30834. //#region ../../packages/components/dialog/src/use-dialog.ts
  30835. const COMPONENT_NAME$9 = "ElDialog";
  30836. const useDialog = (props, targetRef) => {
  30837. const emit = getCurrentInstance().emit;
  30838. const { nextZIndex } = useZIndex();
  30839. let lastPosition = "";
  30840. const titleId = useId();
  30841. const bodyId = useId();
  30842. const visible = ref(false);
  30843. const closed = ref(false);
  30844. const rendered = ref(false);
  30845. const zIndex = ref(props.zIndex ?? nextZIndex());
  30846. const closing = ref(false);
  30847. let openTimer = void 0;
  30848. let closeTimer = void 0;
  30849. const config = useGlobalConfig();
  30850. const namespace = computed(() => config.value?.namespace ?? defaultNamespace);
  30851. const globalConfig = computed(() => config.value?.dialog);
  30852. const style = computed(() => {
  30853. const style = {};
  30854. const varPrefix = `--${namespace.value}-dialog`;
  30855. if (!props.fullscreen) {
  30856. if (props.top) style[`${varPrefix}-margin-top`] = props.top;
  30857. const width = addUnit(props.width);
  30858. if (width) style[`${varPrefix}-width`] = width;
  30859. }
  30860. return style;
  30861. });
  30862. const _draggable = computed(() => (props.draggable ?? globalConfig.value?.draggable ?? false) && !props.fullscreen);
  30863. const _alignCenter = computed(() => props.alignCenter ?? globalConfig.value?.alignCenter ?? false);
  30864. const _overflow = computed(() => props.overflow ?? globalConfig.value?.overflow ?? false);
  30865. const overlayDialogStyle = computed(() => {
  30866. if (_alignCenter.value) return { display: "flex" };
  30867. return {};
  30868. });
  30869. const transitionConfig = computed(() => {
  30870. const transition = props.transition ?? globalConfig.value?.transition ?? DEFAULT_DIALOG_TRANSITION;
  30871. const baseConfig = {
  30872. name: transition,
  30873. onAfterEnter: afterEnter,
  30874. onBeforeLeave: beforeLeave,
  30875. onAfterLeave: afterLeave
  30876. };
  30877. if (isObject$1(transition)) {
  30878. const config = { ...transition };
  30879. const _mergeHook = (userHook, defaultHook) => {
  30880. return (el) => {
  30881. if (isArray$1(userHook)) userHook.forEach((fn) => {
  30882. if (isFunction$1(fn)) fn(el);
  30883. });
  30884. else if (isFunction$1(userHook)) userHook(el);
  30885. defaultHook();
  30886. };
  30887. };
  30888. config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter);
  30889. config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave);
  30890. config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave);
  30891. if (!config.name) {
  30892. config.name = DEFAULT_DIALOG_TRANSITION;
  30893. /* @__PURE__ */ debugWarn(COMPONENT_NAME$9, `transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`);
  30894. }
  30895. return config;
  30896. }
  30897. return baseConfig;
  30898. });
  30899. function afterEnter() {
  30900. emit("opened");
  30901. }
  30902. function afterLeave() {
  30903. emit("closed");
  30904. emit(UPDATE_MODEL_EVENT, false);
  30905. if (props.destroyOnClose) rendered.value = false;
  30906. closing.value = false;
  30907. }
  30908. function beforeLeave() {
  30909. closing.value = true;
  30910. emit("close");
  30911. }
  30912. function open() {
  30913. closeTimer?.();
  30914. openTimer?.();
  30915. if (props.openDelay && props.openDelay > 0) ({stop: openTimer} = useTimeoutFn(() => doOpen(), props.openDelay));
  30916. else doOpen();
  30917. }
  30918. function close() {
  30919. openTimer?.();
  30920. closeTimer?.();
  30921. if (props.closeDelay && props.closeDelay > 0) ({stop: closeTimer} = useTimeoutFn(() => doClose(), props.closeDelay));
  30922. else doClose();
  30923. }
  30924. function handleClose() {
  30925. function hide(shouldCancel) {
  30926. if (shouldCancel) return;
  30927. closed.value = true;
  30928. visible.value = false;
  30929. }
  30930. if (props.beforeClose) props.beforeClose(hide);
  30931. else close();
  30932. }
  30933. function onModalClick() {
  30934. if (props.closeOnClickModal) handleClose();
  30935. }
  30936. function doOpen() {
  30937. if (!isClient) return;
  30938. visible.value = true;
  30939. }
  30940. function doClose() {
  30941. visible.value = false;
  30942. }
  30943. function onOpenAutoFocus() {
  30944. emit("openAutoFocus");
  30945. }
  30946. function onCloseAutoFocus() {
  30947. emit("closeAutoFocus");
  30948. }
  30949. function onFocusoutPrevented(event) {
  30950. if (event.detail?.focusReason === "pointer") event.preventDefault();
  30951. }
  30952. if (props.lockScroll) useLockscreen(visible);
  30953. function onCloseRequested() {
  30954. if (props.closeOnPressEscape) handleClose();
  30955. }
  30956. watch(() => props.zIndex, () => {
  30957. zIndex.value = props.zIndex ?? nextZIndex();
  30958. });
  30959. watch(() => props.modelValue, (val) => {
  30960. if (val) {
  30961. closed.value = false;
  30962. closing.value = false;
  30963. open();
  30964. rendered.value = true;
  30965. zIndex.value = props.zIndex ?? nextZIndex();
  30966. nextTick(() => {
  30967. emit("open");
  30968. if (targetRef.value) {
  30969. targetRef.value.parentElement.scrollTop = 0;
  30970. targetRef.value.parentElement.scrollLeft = 0;
  30971. targetRef.value.scrollTop = 0;
  30972. }
  30973. });
  30974. } else if (visible.value) close();
  30975. });
  30976. watch(() => props.fullscreen, (val) => {
  30977. if (!targetRef.value) return;
  30978. if (val) {
  30979. lastPosition = targetRef.value.style.transform;
  30980. targetRef.value.style.transform = "";
  30981. } else targetRef.value.style.transform = lastPosition;
  30982. });
  30983. onMounted(() => {
  30984. if (props.modelValue) {
  30985. visible.value = true;
  30986. rendered.value = true;
  30987. open();
  30988. }
  30989. });
  30990. return {
  30991. afterEnter,
  30992. afterLeave,
  30993. beforeLeave,
  30994. handleClose,
  30995. onModalClick,
  30996. close,
  30997. doClose,
  30998. onOpenAutoFocus,
  30999. onCloseAutoFocus,
  31000. onCloseRequested,
  31001. onFocusoutPrevented,
  31002. titleId,
  31003. bodyId,
  31004. closed,
  31005. style,
  31006. overlayDialogStyle,
  31007. rendered,
  31008. visible,
  31009. zIndex,
  31010. transitionConfig,
  31011. _draggable,
  31012. _alignCenter,
  31013. _overflow,
  31014. closing
  31015. };
  31016. };
  31017. //#endregion
  31018. //#region ../../packages/components/dialog/src/dialog.vue?vue&type=script&setup=true&lang.ts
  31019. const _hoisted_1$41 = [
  31020. "aria-label",
  31021. "aria-labelledby",
  31022. "aria-describedby"
  31023. ];
  31024. var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  31025. name: "ElDialog",
  31026. inheritAttrs: false,
  31027. __name: "dialog",
  31028. props: dialogProps,
  31029. emits: dialogEmits,
  31030. setup(__props, { expose: __expose }) {
  31031. const props = __props;
  31032. const slots = useSlots();
  31033. useDeprecated({
  31034. scope: "el-dialog",
  31035. from: "the title slot",
  31036. replacement: "the header slot",
  31037. version: "3.0.0",
  31038. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  31039. }, computed(() => !!slots.title));
  31040. const ns = useNamespace("dialog");
  31041. const dialogRef = ref();
  31042. const headerRef = ref();
  31043. const dialogContentRef = ref();
  31044. const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, transitionConfig, zIndex, _draggable, _alignCenter, _overflow, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, closing } = useDialog(props, dialogRef);
  31045. provide(dialogInjectionKey, {
  31046. dialogRef,
  31047. headerRef,
  31048. bodyId,
  31049. ns,
  31050. rendered,
  31051. style
  31052. });
  31053. const overlayEvent = useSameTarget(onModalClick);
  31054. const penetrable = computed(() => props.modalPenetrable && !props.modal && !props.fullscreen);
  31055. const resetPosition = () => {
  31056. dialogContentRef.value?.resetPosition();
  31057. };
  31058. __expose({
  31059. visible,
  31060. dialogContentRef,
  31061. resetPosition,
  31062. handleClose
  31063. });
  31064. return (_ctx, _cache) => {
  31065. return openBlock(), createBlock(unref(ElTeleport), {
  31066. to: __props.appendTo,
  31067. disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
  31068. }, {
  31069. default: withCtx(() => [createVNode(Transition, mergeProps(unref(transitionConfig), { persisted: "" }), {
  31070. default: withCtx(() => [withDirectives(createVNode(unref(ElOverlay), {
  31071. "custom-mask-event": "",
  31072. mask: __props.modal,
  31073. "overlay-class": [
  31074. __props.modalClass ?? "",
  31075. `${unref(ns).namespace.value}-modal-dialog`,
  31076. unref(ns).is("penetrable", penetrable.value)
  31077. ],
  31078. "z-index": unref(zIndex)
  31079. }, {
  31080. default: withCtx(() => [createElementVNode("div", {
  31081. role: "dialog",
  31082. "aria-modal": "true",
  31083. "aria-label": __props.title || void 0,
  31084. "aria-labelledby": !__props.title ? unref(titleId) : void 0,
  31085. "aria-describedby": unref(bodyId),
  31086. class: normalizeClass([`${unref(ns).namespace.value}-overlay-dialog`, unref(ns).is("closing", unref(closing))]),
  31087. style: normalizeStyle(unref(overlayDialogStyle)),
  31088. onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
  31089. onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
  31090. onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
  31091. }, [createVNode(unref(focus_trap_default), {
  31092. loop: "",
  31093. trapped: unref(visible),
  31094. "focus-start-el": "container",
  31095. onFocusAfterTrapped: unref(onOpenAutoFocus),
  31096. onFocusAfterReleased: unref(onCloseAutoFocus),
  31097. onFocusoutPrevented: unref(onFocusoutPrevented),
  31098. onReleaseRequested: unref(onCloseRequested)
  31099. }, {
  31100. default: withCtx(() => [unref(rendered) ? (openBlock(), createBlock(dialog_content_default, mergeProps({
  31101. key: 0,
  31102. ref_key: "dialogContentRef",
  31103. ref: dialogContentRef
  31104. }, _ctx.$attrs, {
  31105. center: __props.center,
  31106. "align-center": unref(_alignCenter),
  31107. "close-icon": __props.closeIcon,
  31108. draggable: unref(_draggable),
  31109. overflow: unref(_overflow),
  31110. fullscreen: __props.fullscreen,
  31111. "header-class": __props.headerClass,
  31112. "body-class": __props.bodyClass,
  31113. "footer-class": __props.footerClass,
  31114. "show-close": __props.showClose,
  31115. title: __props.title,
  31116. "aria-level": __props.headerAriaLevel,
  31117. onClose: unref(handleClose)
  31118. }), createSlots({
  31119. header: withCtx(() => [!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
  31120. key: 0,
  31121. close: unref(handleClose),
  31122. titleId: unref(titleId),
  31123. titleClass: unref(ns).e("title")
  31124. }) : renderSlot(_ctx.$slots, "title", { key: 1 })]),
  31125. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  31126. _: 2
  31127. }, [_ctx.$slots.footer ? {
  31128. name: "footer",
  31129. fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")]),
  31130. key: "0"
  31131. } : void 0]), 1040, [
  31132. "center",
  31133. "align-center",
  31134. "close-icon",
  31135. "draggable",
  31136. "overflow",
  31137. "fullscreen",
  31138. "header-class",
  31139. "body-class",
  31140. "footer-class",
  31141. "show-close",
  31142. "title",
  31143. "aria-level",
  31144. "onClose"
  31145. ])) : createCommentVNode("v-if", true)]),
  31146. _: 3
  31147. }, 8, [
  31148. "trapped",
  31149. "onFocusAfterTrapped",
  31150. "onFocusAfterReleased",
  31151. "onFocusoutPrevented",
  31152. "onReleaseRequested"
  31153. ])], 46, _hoisted_1$41)]),
  31154. _: 3
  31155. }, 8, [
  31156. "mask",
  31157. "overlay-class",
  31158. "z-index"
  31159. ]), [[vShow, unref(visible)]])]),
  31160. _: 3
  31161. }, 16)]),
  31162. _: 3
  31163. }, 8, ["to", "disabled"]);
  31164. };
  31165. }
  31166. });
  31167. //#endregion
  31168. //#region ../../packages/components/dialog/src/dialog.vue
  31169. var dialog_default = dialog_vue_vue_type_script_setup_true_lang_default;
  31170. //#endregion
  31171. //#region ../../packages/components/dialog/index.ts
  31172. const ElDialog = withInstall(dialog_default);
  31173. //#endregion
  31174. //#region ../../packages/components/divider/src/divider.ts
  31175. /**
  31176. * @deprecated Removed after 3.0.0, Use `DividerProps` instead.
  31177. */
  31178. const dividerProps = buildProps({
  31179. direction: {
  31180. type: String,
  31181. values: ["horizontal", "vertical"],
  31182. default: "horizontal"
  31183. },
  31184. contentPosition: {
  31185. type: String,
  31186. values: [
  31187. "left",
  31188. "center",
  31189. "right"
  31190. ],
  31191. default: "center"
  31192. },
  31193. borderStyle: {
  31194. type: definePropType(String),
  31195. default: "solid"
  31196. }
  31197. });
  31198. //#endregion
  31199. //#region ../../packages/components/divider/src/divider.vue?vue&type=script&setup=true&lang.ts
  31200. var divider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  31201. name: "ElDivider",
  31202. __name: "divider",
  31203. props: dividerProps,
  31204. setup(__props) {
  31205. const props = __props;
  31206. const ns = useNamespace("divider");
  31207. const dividerStyle = computed(() => {
  31208. return ns.cssVar({ "border-style": props.borderStyle });
  31209. });
  31210. return (_ctx, _cache) => {
  31211. return openBlock(), createElementBlock("div", {
  31212. class: normalizeClass([unref(ns).b(), unref(ns).m(__props.direction)]),
  31213. style: normalizeStyle(dividerStyle.value),
  31214. role: "separator"
  31215. }, [_ctx.$slots.default && __props.direction !== "vertical" ? (openBlock(), createElementBlock("div", {
  31216. key: 0,
  31217. class: normalizeClass([unref(ns).e("text"), unref(ns).is(__props.contentPosition)])
  31218. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)], 6);
  31219. };
  31220. }
  31221. });
  31222. //#endregion
  31223. //#region ../../packages/components/divider/src/divider.vue
  31224. var divider_default = divider_vue_vue_type_script_setup_true_lang_default;
  31225. //#endregion
  31226. //#region ../../packages/components/divider/index.ts
  31227. const ElDivider = withInstall(divider_default);
  31228. //#endregion
  31229. //#region ../../packages/components/drawer/src/drawer.ts
  31230. /**
  31231. * @deprecated Removed after 3.0.0, Use `DrawerProps` instead.
  31232. */
  31233. const drawerProps = buildProps({
  31234. ...dialogProps,
  31235. direction: {
  31236. type: String,
  31237. default: "rtl",
  31238. values: [
  31239. "ltr",
  31240. "rtl",
  31241. "ttb",
  31242. "btt"
  31243. ]
  31244. },
  31245. resizable: Boolean,
  31246. size: {
  31247. type: [String, Number],
  31248. default: "30%"
  31249. },
  31250. withHeader: {
  31251. type: Boolean,
  31252. default: true
  31253. },
  31254. modalFade: {
  31255. type: Boolean,
  31256. default: true
  31257. },
  31258. headerAriaLevel: {
  31259. type: String,
  31260. default: "2"
  31261. }
  31262. });
  31263. const drawerEmits = {
  31264. ...dialogEmits,
  31265. "resize-start": (evt, size) => evt instanceof MouseEvent && typeof size === "number",
  31266. resize: (evt, size) => evt instanceof MouseEvent && typeof size === "number",
  31267. "resize-end": (evt, size) => evt instanceof MouseEvent && typeof size === "number"
  31268. };
  31269. //#endregion
  31270. //#region ../../packages/components/drawer/src/composables/useResizable.ts
  31271. function useResizable(props, target, emit) {
  31272. const { width, height } = useWindowSize();
  31273. const isHorizontal = computed(() => ["ltr", "rtl"].includes(props.direction));
  31274. const sign = computed(() => ["ltr", "ttb"].includes(props.direction) ? 1 : -1);
  31275. const windowSize = computed(() => isHorizontal.value ? width.value : height.value);
  31276. const getSize = computed(() => {
  31277. return clamp$2(startSize.value + sign.value * offset.value, 4, windowSize.value);
  31278. });
  31279. const startSize = ref(0);
  31280. const offset = ref(0);
  31281. const isResizing = ref(false);
  31282. const hasStartedDragging = ref(false);
  31283. let startPos = [];
  31284. let cleanups = [];
  31285. const getActualSize = () => {
  31286. const drawerEl = target.value?.closest("[aria-modal=\"true\"]");
  31287. if (drawerEl) return isHorizontal.value ? drawerEl.offsetWidth : drawerEl.offsetHeight;
  31288. return 100;
  31289. };
  31290. watch(() => [props.size, props.resizable], () => {
  31291. hasStartedDragging.value = false;
  31292. startSize.value = 0;
  31293. offset.value = 0;
  31294. onMouseUp();
  31295. });
  31296. const onMousedown = (e) => {
  31297. if (!props.resizable) return;
  31298. if (!hasStartedDragging.value) {
  31299. startSize.value = getActualSize();
  31300. hasStartedDragging.value = true;
  31301. }
  31302. startPos = [e.pageX, e.pageY];
  31303. isResizing.value = true;
  31304. emit("resize-start", e, startSize.value);
  31305. cleanups.push(useEventListener(window, "mouseup", onMouseUp), useEventListener(window, "mousemove", onMouseMove));
  31306. };
  31307. const onMouseMove = (e) => {
  31308. const { pageX, pageY } = e;
  31309. const offsetX = pageX - startPos[0];
  31310. const offsetY = pageY - startPos[1];
  31311. offset.value = isHorizontal.value ? offsetX : offsetY;
  31312. emit("resize", e, getSize.value);
  31313. };
  31314. const onMouseUp = (e) => {
  31315. if (!isResizing.value) return;
  31316. startPos = [];
  31317. startSize.value = getSize.value;
  31318. offset.value = 0;
  31319. isResizing.value = false;
  31320. cleanups.forEach((cleanup) => cleanup?.());
  31321. cleanups = [];
  31322. if (e) emit("resize-end", e, startSize.value);
  31323. };
  31324. const cleanup = useEventListener(target, "mousedown", onMousedown);
  31325. onBeforeUnmount(() => {
  31326. cleanup();
  31327. onMouseUp();
  31328. });
  31329. return {
  31330. size: computed(() => {
  31331. return hasStartedDragging.value ? `${getSize.value}px` : addUnit(props.size);
  31332. }),
  31333. isResizing,
  31334. isHorizontal
  31335. };
  31336. }
  31337. //#endregion
  31338. //#region ../../packages/components/drawer/src/drawer.vue?vue&type=script&setup=true&lang.ts
  31339. const _hoisted_1$40 = [
  31340. "aria-label",
  31341. "aria-labelledby",
  31342. "aria-describedby"
  31343. ];
  31344. const _hoisted_2$24 = ["id", "aria-level"];
  31345. const _hoisted_3$9 = ["aria-label"];
  31346. const _hoisted_4$7 = ["id"];
  31347. var drawer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  31348. name: "ElDrawer",
  31349. inheritAttrs: false,
  31350. __name: "drawer",
  31351. props: drawerProps,
  31352. emits: drawerEmits,
  31353. setup(__props, { expose: __expose, emit: __emit }) {
  31354. const props = __props;
  31355. const emit = __emit;
  31356. const slots = useSlots();
  31357. useDeprecated({
  31358. scope: "el-drawer",
  31359. from: "the title slot",
  31360. replacement: "the header slot",
  31361. version: "3.0.0",
  31362. ref: "https://element-plus.org/en-US/component/drawer.html#slots"
  31363. }, computed(() => !!slots.title));
  31364. const drawerRef = ref();
  31365. const focusStartRef = ref();
  31366. const draggerRef = ref();
  31367. const ns = useNamespace("drawer");
  31368. const { t } = useLocale();
  31369. const { afterEnter, afterLeave, beforeLeave, visible, rendered, titleId, bodyId, zIndex, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onFocusoutPrevented, onCloseRequested, handleClose } = useDialog(props, drawerRef);
  31370. const { isHorizontal, size, isResizing } = useResizable(props, draggerRef, emit);
  31371. const penetrable = computed(() => props.modalPenetrable && !props.modal);
  31372. __expose({
  31373. handleClose,
  31374. afterEnter,
  31375. afterLeave
  31376. });
  31377. return (_ctx, _cache) => {
  31378. return openBlock(), createBlock(unref(ElTeleport), {
  31379. to: __props.appendTo,
  31380. disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
  31381. }, {
  31382. default: withCtx(() => [createVNode(Transition, {
  31383. name: unref(ns).b("fade"),
  31384. onAfterEnter: unref(afterEnter),
  31385. onAfterLeave: unref(afterLeave),
  31386. onBeforeLeave: unref(beforeLeave),
  31387. persisted: ""
  31388. }, {
  31389. default: withCtx(() => [withDirectives(createVNode(unref(ElOverlay), {
  31390. mask: __props.modal,
  31391. "overlay-class": [
  31392. unref(ns).is("drawer"),
  31393. __props.modalClass ?? "",
  31394. `${unref(ns).namespace.value}-modal-drawer`,
  31395. unref(ns).is("penetrable", penetrable.value)
  31396. ],
  31397. "z-index": unref(zIndex),
  31398. onClick: unref(onModalClick)
  31399. }, {
  31400. default: withCtx(() => [createVNode(unref(focus_trap_default), {
  31401. loop: "",
  31402. trapped: unref(visible),
  31403. "focus-trap-el": drawerRef.value,
  31404. "focus-start-el": focusStartRef.value,
  31405. onFocusAfterTrapped: unref(onOpenAutoFocus),
  31406. onFocusAfterReleased: unref(onCloseAutoFocus),
  31407. onFocusoutPrevented: unref(onFocusoutPrevented),
  31408. onReleaseRequested: unref(onCloseRequested)
  31409. }, {
  31410. default: withCtx(() => [createElementVNode("div", mergeProps({
  31411. ref_key: "drawerRef",
  31412. ref: drawerRef,
  31413. "aria-modal": "true",
  31414. "aria-label": __props.title || void 0,
  31415. "aria-labelledby": !__props.title ? unref(titleId) : void 0,
  31416. "aria-describedby": unref(bodyId)
  31417. }, _ctx.$attrs, {
  31418. class: [
  31419. unref(ns).b(),
  31420. __props.direction,
  31421. unref(visible) && "open",
  31422. unref(ns).is("dragging", unref(isResizing))
  31423. ],
  31424. style: { [unref(isHorizontal) ? "width" : "height"]: unref(size) },
  31425. role: "dialog",
  31426. onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
  31427. }), [
  31428. createElementVNode("span", {
  31429. ref_key: "focusStartRef",
  31430. ref: focusStartRef,
  31431. class: normalizeClass(unref(ns).e("sr-focus")),
  31432. tabindex: "-1"
  31433. }, null, 2),
  31434. __props.withHeader ? (openBlock(), createElementBlock("header", {
  31435. key: 0,
  31436. class: normalizeClass([unref(ns).e("header"), __props.headerClass])
  31437. }, [!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
  31438. key: 0,
  31439. close: unref(handleClose),
  31440. titleId: unref(titleId),
  31441. titleClass: unref(ns).e("title")
  31442. }, () => [createElementVNode("span", {
  31443. id: unref(titleId),
  31444. role: "heading",
  31445. "aria-level": __props.headerAriaLevel,
  31446. class: normalizeClass(unref(ns).e("title"))
  31447. }, toDisplayString(__props.title), 11, _hoisted_2$24)]) : renderSlot(_ctx.$slots, "title", { key: 1 }, () => [createCommentVNode(" DEPRECATED SLOT ")]), __props.showClose ? (openBlock(), createElementBlock("button", {
  31448. key: 2,
  31449. "aria-label": unref(t)("el.drawer.close"),
  31450. class: normalizeClass(unref(ns).e("close-btn")),
  31451. type: "button",
  31452. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClose) && unref(handleClose)(...args))
  31453. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, {
  31454. default: withCtx(() => [createVNode(unref(close_default))]),
  31455. _: 1
  31456. }, 8, ["class"])], 10, _hoisted_3$9)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true),
  31457. unref(rendered) ? (openBlock(), createElementBlock("div", {
  31458. key: 1,
  31459. id: unref(bodyId),
  31460. class: normalizeClass([unref(ns).e("body"), __props.bodyClass])
  31461. }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_4$7)) : createCommentVNode("v-if", true),
  31462. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  31463. key: 2,
  31464. class: normalizeClass([unref(ns).e("footer"), __props.footerClass])
  31465. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true),
  31466. __props.resizable ? (openBlock(), createElementBlock("div", {
  31467. key: 3,
  31468. ref_key: "draggerRef",
  31469. ref: draggerRef,
  31470. style: normalizeStyle({ zIndex: unref(zIndex) }),
  31471. class: normalizeClass(unref(ns).e("dragger"))
  31472. }, null, 6)) : createCommentVNode("v-if", true)
  31473. ], 16, _hoisted_1$40)]),
  31474. _: 3
  31475. }, 8, [
  31476. "trapped",
  31477. "focus-trap-el",
  31478. "focus-start-el",
  31479. "onFocusAfterTrapped",
  31480. "onFocusAfterReleased",
  31481. "onFocusoutPrevented",
  31482. "onReleaseRequested"
  31483. ])]),
  31484. _: 3
  31485. }, 8, [
  31486. "mask",
  31487. "overlay-class",
  31488. "z-index",
  31489. "onClick"
  31490. ]), [[vShow, unref(visible)]])]),
  31491. _: 3
  31492. }, 8, [
  31493. "name",
  31494. "onAfterEnter",
  31495. "onAfterLeave",
  31496. "onBeforeLeave"
  31497. ])]),
  31498. _: 3
  31499. }, 8, ["to", "disabled"]);
  31500. };
  31501. }
  31502. });
  31503. //#endregion
  31504. //#region ../../packages/components/drawer/src/drawer.vue
  31505. var drawer_default = drawer_vue_vue_type_script_setup_true_lang_default;
  31506. //#endregion
  31507. //#region ../../packages/components/drawer/index.ts
  31508. const ElDrawer = withInstall(drawer_default);
  31509. //#endregion
  31510. //#region ../../packages/components/collection/src/collection.vue?vue&type=script&lang.ts
  31511. var collection_vue_vue_type_script_lang_default = defineComponent({ inheritAttrs: false });
  31512. //#endregion
  31513. //#region ../../packages/components/collection/src/collection.vue
  31514. function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
  31515. return renderSlot(_ctx.$slots, "default");
  31516. }
  31517. var collection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_vue_vue_type_script_lang_default, [["render", _sfc_render$16]]);
  31518. //#endregion
  31519. //#region ../../packages/components/collection/src/collection-item.vue?vue&type=script&lang.ts
  31520. var collection_item_vue_vue_type_script_lang_default = defineComponent({
  31521. name: "ElCollectionItem",
  31522. inheritAttrs: false
  31523. });
  31524. //#endregion
  31525. //#region ../../packages/components/collection/src/collection-item.vue
  31526. function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) {
  31527. return renderSlot(_ctx.$slots, "default");
  31528. }
  31529. var collection_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_item_vue_vue_type_script_lang_default, [["render", _sfc_render$15]]);
  31530. //#endregion
  31531. //#region ../../packages/components/collection/src/collection.ts
  31532. const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
  31533. const createCollectionWithScope = (name) => {
  31534. const COLLECTION_NAME = `El${name}Collection`;
  31535. const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
  31536. const COLLECTION_INJECTION_KEY = Symbol(COLLECTION_NAME);
  31537. const COLLECTION_ITEM_INJECTION_KEY = Symbol(COLLECTION_ITEM_NAME);
  31538. return {
  31539. COLLECTION_INJECTION_KEY,
  31540. COLLECTION_ITEM_INJECTION_KEY,
  31541. ElCollection: Object.assign({}, collection_default, {
  31542. name: COLLECTION_NAME,
  31543. setup() {
  31544. const collectionRef = ref();
  31545. const itemMap = /* @__PURE__ */ new Map();
  31546. const getItems = (() => {
  31547. const collectionEl = unref(collectionRef);
  31548. if (!collectionEl) return [];
  31549. const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
  31550. return [...itemMap.values()].sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
  31551. });
  31552. provide(COLLECTION_INJECTION_KEY, {
  31553. itemMap,
  31554. getItems,
  31555. collectionRef
  31556. });
  31557. }
  31558. }),
  31559. ElCollectionItem: Object.assign({}, collection_item_default, {
  31560. name: COLLECTION_ITEM_NAME,
  31561. setup(_, { attrs }) {
  31562. const collectionItemRef = ref();
  31563. const collectionInjection = inject(COLLECTION_INJECTION_KEY, void 0);
  31564. provide(COLLECTION_ITEM_INJECTION_KEY, { collectionItemRef });
  31565. onMounted(() => {
  31566. const collectionItemEl = unref(collectionItemRef);
  31567. if (collectionItemEl) collectionInjection.itemMap.set(collectionItemEl, {
  31568. ref: collectionItemEl,
  31569. ...attrs
  31570. });
  31571. });
  31572. onBeforeUnmount(() => {
  31573. const collectionItemEl = unref(collectionItemRef);
  31574. collectionInjection.itemMap.delete(collectionItemEl);
  31575. });
  31576. }
  31577. })
  31578. };
  31579. };
  31580. //#endregion
  31581. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.ts
  31582. const rovingFocusGroupProps = buildProps({
  31583. style: { type: definePropType([
  31584. String,
  31585. Array,
  31586. Object
  31587. ]) },
  31588. currentTabId: { type: definePropType(String) },
  31589. defaultCurrentTabId: String,
  31590. loop: Boolean,
  31591. dir: {
  31592. type: String,
  31593. values: ["ltr", "rtl"],
  31594. default: "ltr"
  31595. },
  31596. orientation: { type: definePropType(String) },
  31597. onBlur: Function,
  31598. onFocus: Function,
  31599. onMousedown: Function
  31600. });
  31601. const { ElCollection, ElCollectionItem, COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY } = createCollectionWithScope("RovingFocusGroup");
  31602. //#endregion
  31603. //#region ../../packages/components/roving-focus-group/src/tokens.ts
  31604. const ROVING_FOCUS_GROUP_INJECTION_KEY = Symbol("elRovingFocusGroup");
  31605. const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = Symbol("elRovingFocusGroupItem");
  31606. //#endregion
  31607. //#region ../../packages/components/roving-focus-group/src/utils.ts
  31608. const MAP_KEY_TO_FOCUS_INTENT = {
  31609. ArrowLeft: "prev",
  31610. ArrowUp: "prev",
  31611. ArrowRight: "next",
  31612. ArrowDown: "next",
  31613. PageUp: "first",
  31614. Home: "first",
  31615. PageDown: "last",
  31616. End: "last"
  31617. };
  31618. const getDirectionAwareKey = (key, dir) => {
  31619. if (dir !== "rtl") return key;
  31620. switch (key) {
  31621. case EVENT_CODE.right: return EVENT_CODE.left;
  31622. case EVENT_CODE.left: return EVENT_CODE.right;
  31623. default: return key;
  31624. }
  31625. };
  31626. const getFocusIntent = (event, orientation, dir) => {
  31627. const key = getDirectionAwareKey(getEventCode(event), dir);
  31628. if (orientation === "vertical" && [EVENT_CODE.left, EVENT_CODE.right].includes(key)) return void 0;
  31629. if (orientation === "horizontal" && [EVENT_CODE.up, EVENT_CODE.down].includes(key)) return void 0;
  31630. return MAP_KEY_TO_FOCUS_INTENT[key];
  31631. };
  31632. const reorderArray = (array, atIdx) => {
  31633. return array.map((_, idx) => array[(idx + atIdx) % array.length]);
  31634. };
  31635. const focusFirst = (elements) => {
  31636. const { activeElement: prevActive } = document;
  31637. for (const element of elements) {
  31638. if (element === prevActive) return;
  31639. element.focus();
  31640. if (prevActive !== document.activeElement) return;
  31641. }
  31642. };
  31643. //#endregion
  31644. //#region ../../packages/components/roving-focus-group/src/roving-focus-group-impl.vue?vue&type=script&lang.ts
  31645. const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
  31646. const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
  31647. const EVT_OPTS = {
  31648. bubbles: false,
  31649. cancelable: true
  31650. };
  31651. var roving_focus_group_impl_vue_vue_type_script_lang_default = defineComponent({
  31652. name: "ElRovingFocusGroupImpl",
  31653. inheritAttrs: false,
  31654. props: rovingFocusGroupProps,
  31655. emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"],
  31656. setup(props, { emit }) {
  31657. const currentTabbedId = ref((props.currentTabId || props.defaultCurrentTabId) ?? null);
  31658. const isBackingOut = ref(false);
  31659. const isClickFocus = ref(false);
  31660. const rovingFocusGroupRef = ref();
  31661. const { getItems } = inject(COLLECTION_INJECTION_KEY, void 0);
  31662. const rovingFocusGroupRootStyle = computed(() => {
  31663. return [{ outline: "none" }, props.style];
  31664. });
  31665. const onItemFocus = (tabbedId) => {
  31666. emit(CURRENT_TAB_ID_CHANGE_EVT, tabbedId);
  31667. };
  31668. const onItemShiftTab = () => {
  31669. isBackingOut.value = true;
  31670. };
  31671. const onMousedown = composeEventHandlers((e) => {
  31672. props.onMousedown?.(e);
  31673. }, () => {
  31674. isClickFocus.value = true;
  31675. });
  31676. const onFocus = composeEventHandlers((e) => {
  31677. props.onFocus?.(e);
  31678. }, (e) => {
  31679. const isKeyboardFocus = !unref(isClickFocus);
  31680. const { target, currentTarget } = e;
  31681. if (target === currentTarget && isKeyboardFocus && !unref(isBackingOut)) {
  31682. const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS);
  31683. currentTarget?.dispatchEvent(entryFocusEvt);
  31684. if (!entryFocusEvt.defaultPrevented) {
  31685. const items = getItems().filter((item) => item.focusable);
  31686. focusFirst([
  31687. items.find((item) => item.active),
  31688. items.find((item) => item.id === unref(currentTabbedId)),
  31689. ...items
  31690. ].filter(Boolean).map((item) => item.ref));
  31691. }
  31692. }
  31693. isClickFocus.value = false;
  31694. });
  31695. const onBlur = composeEventHandlers((e) => {
  31696. props.onBlur?.(e);
  31697. }, () => {
  31698. isBackingOut.value = false;
  31699. });
  31700. const handleEntryFocus = (...args) => {
  31701. emit("entryFocus", ...args);
  31702. };
  31703. const onKeydown = (e) => {
  31704. const focusIntent = getFocusIntent(e);
  31705. if (focusIntent) {
  31706. e.preventDefault();
  31707. let elements = getItems().filter((item) => item.focusable).map((item) => item.ref);
  31708. switch (focusIntent) {
  31709. case "last":
  31710. elements.reverse();
  31711. break;
  31712. case "prev":
  31713. case "next": {
  31714. if (focusIntent === "prev") elements.reverse();
  31715. const currentIdx = elements.indexOf(e.currentTarget);
  31716. elements = props.loop ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1);
  31717. break;
  31718. }
  31719. default: break;
  31720. }
  31721. nextTick(() => {
  31722. focusFirst(elements);
  31723. });
  31724. }
  31725. };
  31726. provide(ROVING_FOCUS_GROUP_INJECTION_KEY, {
  31727. currentTabbedId: readonly(currentTabbedId),
  31728. loop: toRef(props, "loop"),
  31729. tabIndex: computed(() => {
  31730. return unref(isBackingOut) ? -1 : 0;
  31731. }),
  31732. rovingFocusGroupRef,
  31733. rovingFocusGroupRootStyle,
  31734. orientation: toRef(props, "orientation"),
  31735. dir: toRef(props, "dir"),
  31736. onItemFocus,
  31737. onItemShiftTab,
  31738. onBlur,
  31739. onFocus,
  31740. onMousedown,
  31741. onKeydown
  31742. });
  31743. watch(() => props.currentTabId, (val) => {
  31744. currentTabbedId.value = val ?? null;
  31745. });
  31746. useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
  31747. }
  31748. });
  31749. //#endregion
  31750. //#region ../../packages/components/roving-focus-group/src/roving-focus-group-impl.vue
  31751. function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) {
  31752. return renderSlot(_ctx.$slots, "default");
  31753. }
  31754. var roving_focus_group_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$14]]);
  31755. //#endregion
  31756. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.vue?vue&type=script&lang.ts
  31757. var roving_focus_group_vue_vue_type_script_lang_default = defineComponent({
  31758. name: "ElRovingFocusGroup",
  31759. components: {
  31760. ElFocusGroupCollection: ElCollection,
  31761. ElRovingFocusGroupImpl: roving_focus_group_impl_default
  31762. }
  31763. });
  31764. //#endregion
  31765. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.vue
  31766. function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) {
  31767. const _component_el_roving_focus_group_impl = resolveComponent("el-roving-focus-group-impl");
  31768. const _component_el_focus_group_collection = resolveComponent("el-focus-group-collection");
  31769. return openBlock(), createBlock(_component_el_focus_group_collection, null, {
  31770. default: withCtx(() => [createVNode(_component_el_roving_focus_group_impl, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
  31771. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  31772. _: 3
  31773. }, 16)]),
  31774. _: 3
  31775. });
  31776. }
  31777. var roving_focus_group_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_vue_vue_type_script_lang_default, [["render", _sfc_render$13]]);
  31778. //#endregion
  31779. //#region ../../packages/components/roving-focus-group/src/roving-focus-item.vue?vue&type=script&lang.ts
  31780. var roving_focus_item_vue_vue_type_script_lang_default = defineComponent({
  31781. components: { ElRovingFocusCollectionItem: ElCollectionItem },
  31782. props: {
  31783. focusable: {
  31784. type: Boolean,
  31785. default: true
  31786. },
  31787. active: Boolean
  31788. },
  31789. emits: [
  31790. "mousedown",
  31791. "focus",
  31792. "keydown"
  31793. ],
  31794. setup(props, { emit }) {
  31795. const { currentTabbedId, onItemFocus, onItemShiftTab, onKeydown } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  31796. const id = useId();
  31797. const rovingFocusGroupItemRef = ref();
  31798. const handleMousedown = composeEventHandlers((e) => {
  31799. emit("mousedown", e);
  31800. }, (e) => {
  31801. if (!props.focusable) e.preventDefault();
  31802. else onItemFocus(unref(id));
  31803. });
  31804. const handleFocus = composeEventHandlers((e) => {
  31805. emit("focus", e);
  31806. }, () => {
  31807. onItemFocus(unref(id));
  31808. });
  31809. const handleKeydown = composeEventHandlers((e) => {
  31810. emit("keydown", e);
  31811. }, (e) => {
  31812. const { shiftKey, target, currentTarget } = e;
  31813. if (getEventCode(e) === EVENT_CODE.tab && shiftKey) {
  31814. onItemShiftTab();
  31815. return;
  31816. }
  31817. if (target !== currentTarget) return;
  31818. onKeydown(e);
  31819. });
  31820. const isCurrentTab = computed(() => currentTabbedId.value === unref(id));
  31821. provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
  31822. rovingFocusGroupItemRef,
  31823. tabIndex: computed(() => unref(isCurrentTab) ? 0 : -1),
  31824. handleMousedown,
  31825. handleFocus,
  31826. handleKeydown
  31827. });
  31828. return {
  31829. id,
  31830. handleKeydown,
  31831. handleFocus,
  31832. handleMousedown
  31833. };
  31834. }
  31835. });
  31836. //#endregion
  31837. //#region ../../packages/components/roving-focus-group/src/roving-focus-item.vue
  31838. function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
  31839. const _component_el_roving_focus_collection_item = resolveComponent("el-roving-focus-collection-item");
  31840. return openBlock(), createBlock(_component_el_roving_focus_collection_item, {
  31841. id: _ctx.id,
  31842. focusable: _ctx.focusable,
  31843. active: _ctx.active
  31844. }, {
  31845. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  31846. _: 3
  31847. }, 8, [
  31848. "id",
  31849. "focusable",
  31850. "active"
  31851. ]);
  31852. }
  31853. var roving_focus_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_item_vue_vue_type_script_lang_default, [["render", _sfc_render$12]]);
  31854. //#endregion
  31855. //#region ../../packages/components/roving-focus-group/index.ts
  31856. var roving_focus_group_default = roving_focus_group_default$1;
  31857. //#endregion
  31858. //#region ../../packages/components/dropdown/src/dropdown.ts
  31859. const dropdownProps = buildProps({
  31860. trigger: {
  31861. ...useTooltipTriggerProps.trigger,
  31862. type: definePropType([String, Array])
  31863. },
  31864. triggerKeys: {
  31865. type: definePropType(Array),
  31866. default: () => [
  31867. EVENT_CODE.enter,
  31868. EVENT_CODE.numpadEnter,
  31869. EVENT_CODE.space,
  31870. EVENT_CODE.down
  31871. ]
  31872. },
  31873. virtualTriggering: useTooltipTriggerProps.virtualTriggering,
  31874. virtualRef: useTooltipTriggerProps.virtualRef,
  31875. effect: {
  31876. ...useTooltipContentProps.effect,
  31877. default: "light"
  31878. },
  31879. type: { type: definePropType(String) },
  31880. placement: {
  31881. type: definePropType(String),
  31882. default: "bottom"
  31883. },
  31884. popperOptions: {
  31885. type: definePropType(Object),
  31886. default: () => ({})
  31887. },
  31888. id: String,
  31889. size: {
  31890. type: String,
  31891. default: ""
  31892. },
  31893. splitButton: Boolean,
  31894. hideOnClick: {
  31895. type: Boolean,
  31896. default: true
  31897. },
  31898. loop: {
  31899. type: Boolean,
  31900. default: true
  31901. },
  31902. showArrow: {
  31903. type: Boolean,
  31904. default: true
  31905. },
  31906. showTimeout: {
  31907. type: Number,
  31908. default: 150
  31909. },
  31910. hideTimeout: {
  31911. type: Number,
  31912. default: 150
  31913. },
  31914. tabindex: {
  31915. type: definePropType([Number, String]),
  31916. default: 0
  31917. },
  31918. maxHeight: {
  31919. type: definePropType([Number, String]),
  31920. default: ""
  31921. },
  31922. popperClass: useTooltipContentProps.popperClass,
  31923. popperStyle: useTooltipContentProps.popperStyle,
  31924. disabled: Boolean,
  31925. role: {
  31926. type: String,
  31927. values: roleTypes,
  31928. default: "menu"
  31929. },
  31930. buttonProps: { type: definePropType(Object) },
  31931. teleported: useTooltipContentProps.teleported,
  31932. appendTo: useTooltipContentProps.appendTo,
  31933. persistent: {
  31934. type: Boolean,
  31935. default: true
  31936. }
  31937. });
  31938. const dropdownItemProps = buildProps({
  31939. command: {
  31940. type: [
  31941. Object,
  31942. String,
  31943. Number
  31944. ],
  31945. default: () => ({})
  31946. },
  31947. disabled: Boolean,
  31948. divided: Boolean,
  31949. textValue: String,
  31950. icon: { type: iconPropType }
  31951. });
  31952. const dropdownMenuProps = buildProps({ onKeydown: { type: definePropType(Function) } });
  31953. const FIRST_KEYS = [
  31954. EVENT_CODE.down,
  31955. EVENT_CODE.pageDown,
  31956. EVENT_CODE.home
  31957. ];
  31958. const LAST_KEYS = [
  31959. EVENT_CODE.up,
  31960. EVENT_CODE.pageUp,
  31961. EVENT_CODE.end
  31962. ];
  31963. const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
  31964. //#endregion
  31965. //#region ../../packages/components/dropdown/src/tokens.ts
  31966. const DROPDOWN_INJECTION_KEY = Symbol("elDropdown");
  31967. const DROPDOWN_INSTANCE_INJECTION_KEY = "elDropdown";
  31968. //#endregion
  31969. //#region ../../packages/components/dropdown/src/dropdown.vue?vue&type=script&lang.ts
  31970. const { ButtonGroup: ElButtonGroup$1 } = ElButton;
  31971. var dropdown_vue_vue_type_script_lang_default = defineComponent({
  31972. name: "ElDropdown",
  31973. components: {
  31974. ElButton,
  31975. ElButtonGroup: ElButtonGroup$1,
  31976. ElScrollbar,
  31977. ElTooltip,
  31978. ElRovingFocusGroup: roving_focus_group_default,
  31979. ElOnlyChild: OnlyChild,
  31980. ElIcon,
  31981. ArrowDown: arrow_down_default
  31982. },
  31983. props: dropdownProps,
  31984. emits: [
  31985. "visible-change",
  31986. "click",
  31987. "command"
  31988. ],
  31989. setup(props, { emit }) {
  31990. const _instance = getCurrentInstance();
  31991. const ns = useNamespace("dropdown");
  31992. const { t } = useLocale();
  31993. const triggeringElementRef = ref();
  31994. const referenceElementRef = ref();
  31995. const popperRef = ref();
  31996. const contentRef = ref();
  31997. const scrollbar = ref(null);
  31998. const currentTabId = ref(null);
  31999. const isUsingKeyboard = ref(false);
  32000. const wrapStyle = computed(() => ({ maxHeight: addUnit(props.maxHeight) }));
  32001. const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)]);
  32002. const trigger = computed(() => castArray$1(props.trigger));
  32003. const defaultTriggerId = useId().value;
  32004. const triggerId = computed(() => props.id || defaultTriggerId);
  32005. function handleClick() {
  32006. popperRef.value?.onClose(void 0, 0);
  32007. }
  32008. function handleClose() {
  32009. popperRef.value?.onClose();
  32010. }
  32011. function handleOpen() {
  32012. popperRef.value?.onOpen();
  32013. }
  32014. const dropdownSize = useFormSize();
  32015. function commandHandler(...args) {
  32016. emit("command", ...args);
  32017. }
  32018. function onItemEnter() {}
  32019. function onItemLeave() {
  32020. const contentEl = unref(contentRef);
  32021. trigger.value.includes("hover") && contentEl?.focus({ preventScroll: true });
  32022. currentTabId.value = null;
  32023. }
  32024. function handleCurrentTabIdChange(id) {
  32025. currentTabId.value = id;
  32026. }
  32027. function handleBeforeShowTooltip() {
  32028. emit("visible-change", true);
  32029. }
  32030. function handleShowTooltip(event) {
  32031. isUsingKeyboard.value = event?.type === "keydown";
  32032. contentRef.value?.focus();
  32033. }
  32034. function handleBeforeHideTooltip() {
  32035. emit("visible-change", false);
  32036. }
  32037. provide(DROPDOWN_INJECTION_KEY, {
  32038. contentRef,
  32039. role: computed(() => props.role),
  32040. triggerId,
  32041. isUsingKeyboard,
  32042. onItemEnter,
  32043. onItemLeave,
  32044. handleClose
  32045. });
  32046. provide(DROPDOWN_INSTANCE_INJECTION_KEY, {
  32047. instance: _instance,
  32048. dropdownSize,
  32049. handleClick,
  32050. commandHandler,
  32051. trigger: toRef(props, "trigger"),
  32052. hideOnClick: toRef(props, "hideOnClick")
  32053. });
  32054. const handlerMainButtonClick = (event) => {
  32055. emit("click", event);
  32056. };
  32057. return {
  32058. t,
  32059. ns,
  32060. scrollbar,
  32061. wrapStyle,
  32062. dropdownTriggerKls,
  32063. dropdownSize,
  32064. triggerId,
  32065. currentTabId,
  32066. handleCurrentTabIdChange,
  32067. handlerMainButtonClick,
  32068. handleClose,
  32069. handleOpen,
  32070. handleBeforeShowTooltip,
  32071. handleShowTooltip,
  32072. handleBeforeHideTooltip,
  32073. popperRef,
  32074. contentRef,
  32075. triggeringElementRef,
  32076. referenceElementRef
  32077. };
  32078. }
  32079. });
  32080. //#endregion
  32081. //#region ../../packages/components/dropdown/src/dropdown.vue
  32082. function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
  32083. const _component_el_roving_focus_group = resolveComponent("el-roving-focus-group");
  32084. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  32085. const _component_el_only_child = resolveComponent("el-only-child");
  32086. const _component_el_tooltip = resolveComponent("el-tooltip");
  32087. const _component_el_button = resolveComponent("el-button");
  32088. const _component_arrow_down = resolveComponent("arrow-down");
  32089. const _component_el_icon = resolveComponent("el-icon");
  32090. const _component_el_button_group = resolveComponent("el-button-group");
  32091. return openBlock(), createElementBlock("div", { class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)]) }, [createVNode(_component_el_tooltip, {
  32092. ref: "popperRef",
  32093. role: _ctx.role,
  32094. effect: _ctx.effect,
  32095. "fallback-placements": ["bottom", "top"],
  32096. "popper-options": _ctx.popperOptions,
  32097. "gpu-acceleration": false,
  32098. placement: _ctx.placement,
  32099. "popper-class": [_ctx.ns.e("popper"), _ctx.popperClass],
  32100. "popper-style": _ctx.popperStyle,
  32101. trigger: _ctx.trigger,
  32102. "trigger-keys": _ctx.triggerKeys,
  32103. "trigger-target-el": _ctx.contentRef,
  32104. "show-arrow": _ctx.showArrow,
  32105. "show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0,
  32106. "hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0,
  32107. "virtual-ref": _ctx.virtualRef ?? _ctx.triggeringElementRef,
  32108. "virtual-triggering": _ctx.virtualTriggering || _ctx.splitButton,
  32109. disabled: _ctx.disabled,
  32110. transition: `${_ctx.ns.namespace.value}-zoom-in-top`,
  32111. teleported: _ctx.teleported,
  32112. "append-to": _ctx.appendTo,
  32113. pure: "",
  32114. "focus-on-target": "",
  32115. persistent: _ctx.persistent,
  32116. onBeforeShow: _ctx.handleBeforeShowTooltip,
  32117. onShow: _ctx.handleShowTooltip,
  32118. onBeforeHide: _ctx.handleBeforeHideTooltip
  32119. }, createSlots({
  32120. content: withCtx(() => [createVNode(_component_el_scrollbar, {
  32121. ref: "scrollbar",
  32122. "wrap-style": _ctx.wrapStyle,
  32123. tag: "div",
  32124. "view-class": _ctx.ns.e("list")
  32125. }, {
  32126. default: withCtx(() => [createVNode(_component_el_roving_focus_group, {
  32127. loop: _ctx.loop,
  32128. "current-tab-id": _ctx.currentTabId,
  32129. orientation: "horizontal",
  32130. onCurrentTabIdChange: _ctx.handleCurrentTabIdChange
  32131. }, {
  32132. default: withCtx(() => [renderSlot(_ctx.$slots, "dropdown")]),
  32133. _: 3
  32134. }, 8, [
  32135. "loop",
  32136. "current-tab-id",
  32137. "onCurrentTabIdChange"
  32138. ])]),
  32139. _: 3
  32140. }, 8, ["wrap-style", "view-class"])]),
  32141. _: 2
  32142. }, [!_ctx.splitButton ? {
  32143. name: "default",
  32144. fn: withCtx(() => [createVNode(_component_el_only_child, {
  32145. id: _ctx.triggerId,
  32146. ref: "triggeringElementRef",
  32147. role: "button",
  32148. tabindex: _ctx.tabindex
  32149. }, {
  32150. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  32151. _: 3
  32152. }, 8, ["id", "tabindex"])]),
  32153. key: "0"
  32154. } : void 0]), 1032, [
  32155. "role",
  32156. "effect",
  32157. "popper-options",
  32158. "placement",
  32159. "popper-class",
  32160. "popper-style",
  32161. "trigger",
  32162. "trigger-keys",
  32163. "trigger-target-el",
  32164. "show-arrow",
  32165. "show-after",
  32166. "hide-after",
  32167. "virtual-ref",
  32168. "virtual-triggering",
  32169. "disabled",
  32170. "transition",
  32171. "teleported",
  32172. "append-to",
  32173. "persistent",
  32174. "onBeforeShow",
  32175. "onShow",
  32176. "onBeforeHide"
  32177. ]), _ctx.splitButton ? (openBlock(), createBlock(_component_el_button_group, { key: 0 }, {
  32178. default: withCtx(() => [createVNode(_component_el_button, mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, {
  32179. size: _ctx.dropdownSize,
  32180. type: _ctx.type,
  32181. disabled: _ctx.disabled,
  32182. tabindex: _ctx.tabindex,
  32183. onClick: _ctx.handlerMainButtonClick
  32184. }), {
  32185. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  32186. _: 3
  32187. }, 16, [
  32188. "size",
  32189. "type",
  32190. "disabled",
  32191. "tabindex",
  32192. "onClick"
  32193. ]), createVNode(_component_el_button, mergeProps({
  32194. id: _ctx.triggerId,
  32195. ref: "triggeringElementRef"
  32196. }, _ctx.buttonProps, {
  32197. role: "button",
  32198. size: _ctx.dropdownSize,
  32199. type: _ctx.type,
  32200. class: _ctx.ns.e("caret-button"),
  32201. disabled: _ctx.disabled,
  32202. tabindex: _ctx.tabindex,
  32203. "aria-label": _ctx.t("el.dropdown.toggleDropdown")
  32204. }), {
  32205. default: withCtx(() => [createVNode(_component_el_icon, { class: normalizeClass(_ctx.ns.e("icon")) }, {
  32206. default: withCtx(() => [createVNode(_component_arrow_down)]),
  32207. _: 1
  32208. }, 8, ["class"])]),
  32209. _: 1
  32210. }, 16, [
  32211. "id",
  32212. "size",
  32213. "type",
  32214. "class",
  32215. "disabled",
  32216. "tabindex",
  32217. "aria-label"
  32218. ])]),
  32219. _: 3
  32220. })) : createCommentVNode("v-if", true)], 2);
  32221. }
  32222. var dropdown_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$11]]);
  32223. //#endregion
  32224. //#region ../../packages/components/dropdown/src/dropdown-item-impl.vue?vue&type=script&lang.ts
  32225. var dropdown_item_impl_vue_vue_type_script_lang_default = defineComponent({
  32226. name: "DropdownItemImpl",
  32227. components: { ElIcon },
  32228. props: dropdownItemProps,
  32229. emits: [
  32230. "pointermove",
  32231. "pointerleave",
  32232. "click",
  32233. "clickimpl"
  32234. ],
  32235. setup(_, { emit }) {
  32236. const ns = useNamespace("dropdown");
  32237. const { role: menuRole } = inject(DROPDOWN_INJECTION_KEY, void 0);
  32238. const { collectionItemRef: rovingFocusCollectionItemRef } = inject(COLLECTION_ITEM_INJECTION_KEY, void 0);
  32239. const { rovingFocusGroupItemRef, tabIndex, handleFocus, handleKeydown: handleItemKeydown, handleMousedown } = inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0);
  32240. const itemRef = composeRefs(rovingFocusCollectionItemRef, rovingFocusGroupItemRef);
  32241. const role = computed(() => {
  32242. if (menuRole.value === "menu") return "menuitem";
  32243. else if (menuRole.value === "navigation") return "link";
  32244. return "button";
  32245. });
  32246. const handleKeydown = composeEventHandlers((e) => {
  32247. const code = getEventCode(e);
  32248. if ([
  32249. EVENT_CODE.enter,
  32250. EVENT_CODE.numpadEnter,
  32251. EVENT_CODE.space
  32252. ].includes(code)) {
  32253. e.preventDefault();
  32254. e.stopImmediatePropagation();
  32255. emit("clickimpl", e);
  32256. return true;
  32257. }
  32258. }, handleItemKeydown);
  32259. return {
  32260. ns,
  32261. itemRef,
  32262. dataset: { [COLLECTION_ITEM_SIGN]: "" },
  32263. role,
  32264. tabIndex,
  32265. handleFocus,
  32266. handleKeydown,
  32267. handleMousedown
  32268. };
  32269. }
  32270. });
  32271. //#endregion
  32272. //#region ../../packages/components/dropdown/src/dropdown-item-impl.vue
  32273. const _hoisted_1$39 = [
  32274. "aria-disabled",
  32275. "tabindex",
  32276. "role"
  32277. ];
  32278. function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
  32279. const _component_el_icon = resolveComponent("el-icon");
  32280. return openBlock(), createElementBlock(Fragment, null, [_ctx.divided ? (openBlock(), createElementBlock("li", {
  32281. key: 0,
  32282. role: "separator",
  32283. class: normalizeClass(_ctx.ns.bem("menu", "item", "divided"))
  32284. }, null, 2)) : createCommentVNode("v-if", true), createElementVNode("li", mergeProps({ ref: _ctx.itemRef }, {
  32285. ..._ctx.dataset,
  32286. ..._ctx.$attrs
  32287. }, {
  32288. "aria-disabled": _ctx.disabled,
  32289. class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)],
  32290. tabindex: _ctx.tabIndex,
  32291. role: _ctx.role,
  32292. onClick: _cache[0] || (_cache[0] = (e) => _ctx.$emit("clickimpl", e)),
  32293. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  32294. onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
  32295. onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)),
  32296. onPointermove: _cache[4] || (_cache[4] = (e) => _ctx.$emit("pointermove", e)),
  32297. onPointerleave: _cache[5] || (_cache[5] = (e) => _ctx.$emit("pointerleave", e))
  32298. }), [_ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
  32299. default: withCtx(() => [renderSlot(_ctx.$slots, "icon", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))])]),
  32300. _: 3
  32301. })) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 16, _hoisted_1$39)], 64);
  32302. }
  32303. var dropdown_item_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$10]]);
  32304. //#endregion
  32305. //#region ../../packages/components/dropdown/src/useDropdown.ts
  32306. const useDropdown = () => {
  32307. const elDropdown = inject(DROPDOWN_INSTANCE_INJECTION_KEY, {});
  32308. return {
  32309. elDropdown,
  32310. _elDropdownSize: computed(() => elDropdown?.dropdownSize)
  32311. };
  32312. };
  32313. //#endregion
  32314. //#region ../../packages/components/dropdown/src/dropdown-item.vue?vue&type=script&lang.ts
  32315. var dropdown_item_vue_vue_type_script_lang_default = defineComponent({
  32316. name: "ElDropdownItem",
  32317. components: {
  32318. ElRovingFocusItem: roving_focus_item_default,
  32319. ElDropdownItemImpl: dropdown_item_impl_default
  32320. },
  32321. inheritAttrs: false,
  32322. props: dropdownItemProps,
  32323. emits: [
  32324. "pointermove",
  32325. "pointerleave",
  32326. "click"
  32327. ],
  32328. setup(props, { emit, attrs }) {
  32329. const { elDropdown } = useDropdown();
  32330. const _instance = getCurrentInstance();
  32331. const { onItemEnter, onItemLeave } = inject(DROPDOWN_INJECTION_KEY, void 0);
  32332. const handlePointerMove = composeEventHandlers((e) => {
  32333. emit("pointermove", e);
  32334. return e.defaultPrevented;
  32335. }, whenMouse((e) => {
  32336. if (props.disabled) {
  32337. onItemLeave(e);
  32338. return;
  32339. }
  32340. const target = e.currentTarget;
  32341. /**
  32342. * This handles the following scenario:
  32343. * when the item contains a form element such as input element
  32344. * when the mouse is moving over the element itself which is contained by
  32345. * the item, the default focusing logic should be prevented so that
  32346. * it won't cause weird action.
  32347. */
  32348. if (target === document.activeElement || target.contains(document.activeElement)) return;
  32349. onItemEnter(e);
  32350. if (!e.defaultPrevented) target?.focus({ preventScroll: true });
  32351. }));
  32352. const handlePointerLeave = composeEventHandlers((e) => {
  32353. emit("pointerleave", e);
  32354. return e.defaultPrevented;
  32355. }, whenMouse(onItemLeave));
  32356. return {
  32357. handleClick: composeEventHandlers((e) => {
  32358. if (props.disabled) return;
  32359. emit("click", e);
  32360. return e.type !== "keydown" && e.defaultPrevented;
  32361. }, (e) => {
  32362. if (props.disabled) {
  32363. e.stopImmediatePropagation();
  32364. return;
  32365. }
  32366. if (elDropdown?.hideOnClick?.value) elDropdown.handleClick?.();
  32367. elDropdown.commandHandler?.(props.command, _instance, e);
  32368. }),
  32369. handlePointerMove,
  32370. handlePointerLeave,
  32371. propsAndAttrs: computed(() => ({
  32372. ...props,
  32373. ...attrs
  32374. }))
  32375. };
  32376. }
  32377. });
  32378. //#endregion
  32379. //#region ../../packages/components/dropdown/src/dropdown-item.vue
  32380. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  32381. const _component_el_dropdown_item_impl = resolveComponent("el-dropdown-item-impl");
  32382. const _component_el_roving_focus_item = resolveComponent("el-roving-focus-item");
  32383. return openBlock(), createBlock(_component_el_roving_focus_item, { focusable: !_ctx.disabled }, {
  32384. default: withCtx(() => [createVNode(_component_el_dropdown_item_impl, mergeProps(_ctx.propsAndAttrs, {
  32385. onPointerleave: _ctx.handlePointerLeave,
  32386. onPointermove: _ctx.handlePointerMove,
  32387. onClickimpl: _ctx.handleClick
  32388. }), createSlots({
  32389. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  32390. _: 2
  32391. }, [_ctx.$slots.icon ? {
  32392. name: "icon",
  32393. fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
  32394. key: "0"
  32395. } : void 0]), 1040, [
  32396. "onPointerleave",
  32397. "onPointermove",
  32398. "onClickimpl"
  32399. ])]),
  32400. _: 3
  32401. }, 8, ["focusable"]);
  32402. }
  32403. var dropdown_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_vue_vue_type_script_lang_default, [["render", _sfc_render$9]]);
  32404. //#endregion
  32405. //#region ../../packages/components/dropdown/src/dropdown-menu.vue?vue&type=script&lang.ts
  32406. var dropdown_menu_vue_vue_type_script_lang_default = defineComponent({
  32407. name: "ElDropdownMenu",
  32408. props: dropdownMenuProps,
  32409. setup(props) {
  32410. const ns = useNamespace("dropdown");
  32411. const { _elDropdownSize } = useDropdown();
  32412. const size = _elDropdownSize.value;
  32413. const { contentRef, role, triggerId, isUsingKeyboard, handleClose } = inject(DROPDOWN_INJECTION_KEY, void 0);
  32414. const { rovingFocusGroupRef, rovingFocusGroupRootStyle, onBlur, onFocus, onKeydown, onMousedown } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  32415. const { collectionRef: rovingFocusGroupCollectionRef } = inject(COLLECTION_INJECTION_KEY, void 0);
  32416. const dropdownKls = computed(() => {
  32417. return [ns.b("menu"), ns.bm("menu", size?.value)];
  32418. });
  32419. const dropdownListWrapperRef = composeRefs(contentRef, rovingFocusGroupRef, rovingFocusGroupCollectionRef);
  32420. const handleKeydown = composeEventHandlers((e) => {
  32421. props.onKeydown?.(e);
  32422. }, (e) => {
  32423. const { currentTarget, target } = e;
  32424. const code = getEventCode(e);
  32425. if (currentTarget.contains(target)) {}
  32426. if (EVENT_CODE.tab === code) return handleClose();
  32427. onKeydown(e);
  32428. });
  32429. function handleFocus(e) {
  32430. isUsingKeyboard.value && onFocus(e);
  32431. }
  32432. return {
  32433. size,
  32434. rovingFocusGroupRootStyle,
  32435. dropdownKls,
  32436. role,
  32437. triggerId,
  32438. dropdownListWrapperRef,
  32439. handleKeydown,
  32440. onBlur,
  32441. handleFocus,
  32442. onMousedown
  32443. };
  32444. }
  32445. });
  32446. //#endregion
  32447. //#region ../../packages/components/dropdown/src/dropdown-menu.vue
  32448. const _hoisted_1$38 = ["role", "aria-labelledby"];
  32449. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  32450. return openBlock(), createElementBlock("ul", {
  32451. ref: _ctx.dropdownListWrapperRef,
  32452. class: normalizeClass(_ctx.dropdownKls),
  32453. style: normalizeStyle(_ctx.rovingFocusGroupRootStyle),
  32454. tabindex: -1,
  32455. role: _ctx.role,
  32456. "aria-labelledby": _ctx.triggerId,
  32457. onFocusin: _cache[0] || (_cache[0] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  32458. onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
  32459. onKeydown: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
  32460. onMousedown: _cache[3] || (_cache[3] = withModifiers((...args) => _ctx.onMousedown && _ctx.onMousedown(...args), ["self"]))
  32461. }, [renderSlot(_ctx.$slots, "default")], 46, _hoisted_1$38);
  32462. }
  32463. var dropdown_menu_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_menu_vue_vue_type_script_lang_default, [["render", _sfc_render$8]]);
  32464. //#endregion
  32465. //#region ../../packages/components/dropdown/index.ts
  32466. const ElDropdown = withInstall(dropdown_default, {
  32467. DropdownItem: dropdown_item_default,
  32468. DropdownMenu: dropdown_menu_default
  32469. });
  32470. const ElDropdownItem = withNoopInstall(dropdown_item_default);
  32471. const ElDropdownMenu = withNoopInstall(dropdown_menu_default);
  32472. //#endregion
  32473. //#region ../../packages/components/empty/src/empty.ts
  32474. /**
  32475. * @deprecated Removed after 3.0.0, Use `EmptyProps` instead.
  32476. */
  32477. const emptyProps = buildProps({
  32478. image: {
  32479. type: String,
  32480. default: ""
  32481. },
  32482. imageSize: Number,
  32483. description: {
  32484. type: String,
  32485. default: ""
  32486. }
  32487. });
  32488. //#endregion
  32489. //#region ../../packages/components/empty/src/img-empty.vue?vue&type=script&setup=true&lang.ts
  32490. const _hoisted_1$37 = {
  32491. viewBox: "0 0 79 86",
  32492. version: "1.1",
  32493. xmlns: "http://www.w3.org/2000/svg",
  32494. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  32495. };
  32496. const _hoisted_2$23 = ["id"];
  32497. const _hoisted_3$8 = ["stop-color"];
  32498. const _hoisted_4$6 = ["stop-color"];
  32499. const _hoisted_5$4 = ["id"];
  32500. const _hoisted_6$1 = ["stop-color"];
  32501. const _hoisted_7 = ["stop-color"];
  32502. const _hoisted_8 = ["id"];
  32503. const _hoisted_9 = {
  32504. stroke: "none",
  32505. "stroke-width": "1",
  32506. fill: "none",
  32507. "fill-rule": "evenodd"
  32508. };
  32509. const _hoisted_10 = { transform: "translate(-1268.000000, -535.000000)" };
  32510. const _hoisted_11 = { transform: "translate(1268.000000, 535.000000)" };
  32511. const _hoisted_12 = ["fill"];
  32512. const _hoisted_13 = ["fill"];
  32513. const _hoisted_14 = { transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)" };
  32514. const _hoisted_15 = ["fill"];
  32515. const _hoisted_16 = ["fill"];
  32516. const _hoisted_17 = ["fill"];
  32517. const _hoisted_18 = ["fill"];
  32518. const _hoisted_19 = ["fill"];
  32519. const _hoisted_20 = { transform: "translate(53.000000, 45.000000)" };
  32520. const _hoisted_21 = ["fill", "xlink:href"];
  32521. const _hoisted_22 = ["fill", "mask"];
  32522. const _hoisted_23 = ["fill"];
  32523. var img_empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  32524. name: "ImgEmpty",
  32525. __name: "img-empty",
  32526. setup(__props) {
  32527. const ns = useNamespace("empty");
  32528. const id = useId();
  32529. return (_ctx, _cache) => {
  32530. return openBlock(), createElementBlock("svg", _hoisted_1$37, [createElementVNode("defs", null, [
  32531. createElementVNode("linearGradient", {
  32532. id: `linearGradient-1-${unref(id)}`,
  32533. x1: "38.8503086%",
  32534. y1: "0%",
  32535. x2: "61.1496914%",
  32536. y2: "100%"
  32537. }, [createElementVNode("stop", {
  32538. "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
  32539. offset: "0%"
  32540. }, null, 8, _hoisted_3$8), createElementVNode("stop", {
  32541. "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-4")})`,
  32542. offset: "100%"
  32543. }, null, 8, _hoisted_4$6)], 8, _hoisted_2$23),
  32544. createElementVNode("linearGradient", {
  32545. id: `linearGradient-2-${unref(id)}`,
  32546. x1: "0%",
  32547. y1: "9.5%",
  32548. x2: "100%",
  32549. y2: "90.5%"
  32550. }, [createElementVNode("stop", {
  32551. "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
  32552. offset: "0%"
  32553. }, null, 8, _hoisted_6$1), createElementVNode("stop", {
  32554. "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-6")})`,
  32555. offset: "100%"
  32556. }, null, 8, _hoisted_7)], 8, _hoisted_5$4),
  32557. createElementVNode("rect", {
  32558. id: `path-3-${unref(id)}`,
  32559. x: "0",
  32560. y: "0",
  32561. width: "17",
  32562. height: "36"
  32563. }, null, 8, _hoisted_8)
  32564. ]), createElementVNode("g", _hoisted_9, [createElementVNode("g", _hoisted_10, [createElementVNode("g", _hoisted_11, [
  32565. createElementVNode("path", {
  32566. d: "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",
  32567. fill: `var(${unref(ns).cssVarBlockName("fill-color-3")})`
  32568. }, null, 8, _hoisted_12),
  32569. createElementVNode("polygon", {
  32570. fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
  32571. transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  32572. points: "13 58 53 58 42 45 2 45"
  32573. }, null, 8, _hoisted_13),
  32574. createElementVNode("g", _hoisted_14, [
  32575. createElementVNode("polygon", {
  32576. fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
  32577. transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  32578. points: "2.84078316e-14 3 18 3 23 7 5 7"
  32579. }, null, 8, _hoisted_15),
  32580. createElementVNode("polygon", {
  32581. fill: `var(${unref(ns).cssVarBlockName("fill-color-5")})`,
  32582. points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  32583. }, null, 8, _hoisted_16),
  32584. createElementVNode("rect", {
  32585. fill: `url(#linearGradient-1-${unref(id)})`,
  32586. transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  32587. x: "38",
  32588. y: "7",
  32589. width: "17",
  32590. height: "36"
  32591. }, null, 8, _hoisted_17),
  32592. createElementVNode("polygon", {
  32593. fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
  32594. transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  32595. points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  32596. }, null, 8, _hoisted_18)
  32597. ]),
  32598. createElementVNode("rect", {
  32599. fill: `url(#linearGradient-2-${unref(id)})`,
  32600. x: "13",
  32601. y: "45",
  32602. width: "40",
  32603. height: "36"
  32604. }, null, 8, _hoisted_19),
  32605. createElementVNode("g", _hoisted_20, [createElementVNode("use", {
  32606. fill: `var(${unref(ns).cssVarBlockName("fill-color-8")})`,
  32607. transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  32608. "xlink:href": `#path-3-${unref(id)}`
  32609. }, null, 8, _hoisted_21), createElementVNode("polygon", {
  32610. fill: `var(${unref(ns).cssVarBlockName("fill-color-9")})`,
  32611. mask: `url(#mask-4-${unref(id)})`,
  32612. transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  32613. points: "7 0 24 0 20 18 7 16.5"
  32614. }, null, 8, _hoisted_22)]),
  32615. createElementVNode("polygon", {
  32616. fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
  32617. transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  32618. points: "62 45 79 45 70 58 53 58"
  32619. }, null, 8, _hoisted_23)
  32620. ])])])]);
  32621. };
  32622. }
  32623. });
  32624. //#endregion
  32625. //#region ../../packages/components/empty/src/img-empty.vue
  32626. var img_empty_default = img_empty_vue_vue_type_script_setup_true_lang_default;
  32627. //#endregion
  32628. //#region ../../packages/components/empty/src/empty.vue?vue&type=script&setup=true&lang.ts
  32629. const _hoisted_1$36 = ["src"];
  32630. const _hoisted_2$22 = { key: 1 };
  32631. var empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  32632. name: "ElEmpty",
  32633. __name: "empty",
  32634. props: emptyProps,
  32635. setup(__props) {
  32636. const props = __props;
  32637. const { t } = useLocale();
  32638. const ns = useNamespace("empty");
  32639. const emptyDescription = computed(() => props.description || t("el.table.emptyText"));
  32640. const imageStyle = computed(() => ({ width: addUnit(props.imageSize) }));
  32641. return (_ctx, _cache) => {
  32642. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [
  32643. createElementVNode("div", {
  32644. class: normalizeClass(unref(ns).e("image")),
  32645. style: normalizeStyle(imageStyle.value)
  32646. }, [__props.image ? (openBlock(), createElementBlock("img", {
  32647. key: 0,
  32648. src: __props.image,
  32649. ondragstart: "return false"
  32650. }, null, 8, _hoisted_1$36)) : renderSlot(_ctx.$slots, "image", { key: 1 }, () => [createVNode(img_empty_default)])], 6),
  32651. createElementVNode("div", { class: normalizeClass(unref(ns).e("description")) }, [_ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("p", _hoisted_2$22, toDisplayString(emptyDescription.value), 1))], 2),
  32652. _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
  32653. key: 0,
  32654. class: normalizeClass(unref(ns).e("bottom"))
  32655. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)
  32656. ], 2);
  32657. };
  32658. }
  32659. });
  32660. //#endregion
  32661. //#region ../../packages/components/empty/src/empty.vue
  32662. var empty_default = empty_vue_vue_type_script_setup_true_lang_default;
  32663. //#endregion
  32664. //#region ../../packages/components/empty/index.ts
  32665. const ElEmpty = withInstall(empty_default);
  32666. //#endregion
  32667. //#region ../../packages/components/image/src/image.ts
  32668. /**
  32669. * @deprecated Removed after 3.0.0, Use `ImageProps` instead.
  32670. */
  32671. const imageProps = buildProps({
  32672. hideOnClickModal: Boolean,
  32673. src: {
  32674. type: String,
  32675. default: ""
  32676. },
  32677. fit: {
  32678. type: String,
  32679. values: [
  32680. "",
  32681. "contain",
  32682. "cover",
  32683. "fill",
  32684. "none",
  32685. "scale-down"
  32686. ],
  32687. default: ""
  32688. },
  32689. loading: {
  32690. type: String,
  32691. values: ["eager", "lazy"]
  32692. },
  32693. lazy: Boolean,
  32694. scrollContainer: { type: definePropType([String, Object]) },
  32695. previewSrcList: {
  32696. type: definePropType(Array),
  32697. default: () => mutable([])
  32698. },
  32699. previewTeleported: Boolean,
  32700. zIndex: { type: Number },
  32701. initialIndex: {
  32702. type: Number,
  32703. default: 0
  32704. },
  32705. infinite: {
  32706. type: Boolean,
  32707. default: true
  32708. },
  32709. closeOnPressEscape: {
  32710. type: Boolean,
  32711. default: true
  32712. },
  32713. zoomRate: {
  32714. type: Number,
  32715. default: 1.2
  32716. },
  32717. scale: {
  32718. type: Number,
  32719. default: 1
  32720. },
  32721. minScale: {
  32722. type: Number,
  32723. default: .2
  32724. },
  32725. maxScale: {
  32726. type: Number,
  32727. default: 7
  32728. },
  32729. showProgress: Boolean,
  32730. crossorigin: { type: definePropType(String) }
  32731. });
  32732. const imageEmits = {
  32733. load: (evt) => evt instanceof Event,
  32734. error: (evt) => evt instanceof Event,
  32735. switch: (val) => isNumber(val),
  32736. close: () => true,
  32737. show: () => true
  32738. };
  32739. //#endregion
  32740. //#region ../../packages/components/image-viewer/src/image-viewer.ts
  32741. /**
  32742. * @deprecated Removed after 3.0.0, Use `ImageViewerProps` instead.
  32743. */
  32744. const imageViewerProps = buildProps({
  32745. urlList: {
  32746. type: definePropType(Array),
  32747. default: () => mutable([])
  32748. },
  32749. zIndex: { type: Number },
  32750. initialIndex: {
  32751. type: Number,
  32752. default: 0
  32753. },
  32754. infinite: {
  32755. type: Boolean,
  32756. default: true
  32757. },
  32758. hideOnClickModal: Boolean,
  32759. teleported: Boolean,
  32760. closeOnPressEscape: {
  32761. type: Boolean,
  32762. default: true
  32763. },
  32764. zoomRate: {
  32765. type: Number,
  32766. default: 1.2
  32767. },
  32768. scale: {
  32769. type: Number,
  32770. default: 1
  32771. },
  32772. minScale: {
  32773. type: Number,
  32774. default: .2
  32775. },
  32776. maxScale: {
  32777. type: Number,
  32778. default: 7
  32779. },
  32780. showProgress: Boolean,
  32781. crossorigin: { type: definePropType(String) }
  32782. });
  32783. const imageViewerEmits = {
  32784. close: () => true,
  32785. error: (evt) => evt instanceof Event,
  32786. switch: (index) => isNumber(index),
  32787. rotate: (deg) => isNumber(deg)
  32788. };
  32789. //#endregion
  32790. //#region ../../packages/components/image-viewer/src/image-viewer.vue?vue&type=script&setup=true&lang.ts
  32791. const _hoisted_1$35 = ["src", "crossorigin"];
  32792. var image_viewer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  32793. name: "ElImageViewer",
  32794. __name: "image-viewer",
  32795. props: imageViewerProps,
  32796. emits: imageViewerEmits,
  32797. setup(__props, { expose: __expose, emit: __emit }) {
  32798. const modes = {
  32799. CONTAIN: {
  32800. name: "contain",
  32801. icon: markRaw(full_screen_default)
  32802. },
  32803. ORIGINAL: {
  32804. name: "original",
  32805. icon: markRaw(scale_to_original_default)
  32806. }
  32807. };
  32808. const props = __props;
  32809. const emit = __emit;
  32810. let stopWheelListener;
  32811. const { t } = useLocale();
  32812. const ns = useNamespace("image-viewer");
  32813. const { nextZIndex } = useZIndex();
  32814. const wrapper = ref();
  32815. const imgRef = ref();
  32816. const scopeEventListener = effectScope();
  32817. const scaleClamped = computed(() => {
  32818. const { scale, minScale, maxScale } = props;
  32819. return clamp$2(scale, minScale, maxScale);
  32820. });
  32821. const loading = ref(true);
  32822. const loadError = ref(false);
  32823. const visible = ref(false);
  32824. const activeIndex = ref(props.initialIndex);
  32825. const mode = shallowRef(modes.CONTAIN);
  32826. const transform = ref({
  32827. scale: scaleClamped.value,
  32828. deg: 0,
  32829. offsetX: 0,
  32830. offsetY: 0,
  32831. enableTransition: false
  32832. });
  32833. const zIndex = ref(props.zIndex ?? nextZIndex());
  32834. useLockscreen(visible, { ns });
  32835. const isSingle = computed(() => {
  32836. const { urlList } = props;
  32837. return urlList.length <= 1;
  32838. });
  32839. const isFirst = computed(() => activeIndex.value === 0);
  32840. const isLast = computed(() => activeIndex.value === props.urlList.length - 1);
  32841. const currentImg = computed(() => props.urlList[activeIndex.value]);
  32842. const arrowPrevKls = computed(() => [
  32843. ns.e("btn"),
  32844. ns.e("prev"),
  32845. ns.is("disabled", !props.infinite && isFirst.value)
  32846. ]);
  32847. const arrowNextKls = computed(() => [
  32848. ns.e("btn"),
  32849. ns.e("next"),
  32850. ns.is("disabled", !props.infinite && isLast.value)
  32851. ]);
  32852. const imgStyle = computed(() => {
  32853. const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
  32854. let translateX = offsetX / scale;
  32855. let translateY = offsetY / scale;
  32856. const radian = deg * Math.PI / 180;
  32857. const cosRadian = Math.cos(radian);
  32858. const sinRadian = Math.sin(radian);
  32859. translateX = translateX * cosRadian + translateY * sinRadian;
  32860. translateY = translateY * cosRadian - offsetX / scale * sinRadian;
  32861. const style = {
  32862. transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
  32863. transition: enableTransition ? "transform .3s" : ""
  32864. };
  32865. if (mode.value.name === modes.CONTAIN.name) style.maxWidth = style.maxHeight = "100%";
  32866. return style;
  32867. });
  32868. const progress = computed(() => `${activeIndex.value + 1} / ${props.urlList.length}`);
  32869. function hide() {
  32870. unregisterEventListener();
  32871. stopWheelListener?.();
  32872. visible.value = false;
  32873. emit("close");
  32874. }
  32875. function registerEventListener() {
  32876. const keydownHandler = throttle((e) => {
  32877. switch (getEventCode(e)) {
  32878. case EVENT_CODE.esc:
  32879. props.closeOnPressEscape && hide();
  32880. break;
  32881. case EVENT_CODE.space:
  32882. toggleMode();
  32883. break;
  32884. case EVENT_CODE.left:
  32885. prev();
  32886. break;
  32887. case EVENT_CODE.up:
  32888. handleActions("zoomIn");
  32889. break;
  32890. case EVENT_CODE.right:
  32891. next();
  32892. break;
  32893. case EVENT_CODE.down:
  32894. handleActions("zoomOut");
  32895. break;
  32896. }
  32897. });
  32898. const mousewheelHandler = throttle((e) => {
  32899. handleActions((e.deltaY || e.deltaX) < 0 ? "zoomIn" : "zoomOut", {
  32900. zoomRate: props.zoomRate,
  32901. enableTransition: false
  32902. });
  32903. });
  32904. scopeEventListener.run(() => {
  32905. useEventListener(document, "keydown", keydownHandler);
  32906. useEventListener(wrapper, "wheel", mousewheelHandler);
  32907. });
  32908. }
  32909. function unregisterEventListener() {
  32910. scopeEventListener.stop();
  32911. }
  32912. function handleImgLoad() {
  32913. loading.value = false;
  32914. }
  32915. function handleImgError(e) {
  32916. loadError.value = true;
  32917. loading.value = false;
  32918. emit("error", e);
  32919. e.target.alt = t("el.image.error");
  32920. }
  32921. function handleMouseDown(e) {
  32922. if (loading.value || e.button !== 0 || !wrapper.value) return;
  32923. transform.value.enableTransition = false;
  32924. const { offsetX, offsetY } = transform.value;
  32925. const startX = e.pageX;
  32926. const startY = e.pageY;
  32927. const dragHandler = throttle((ev) => {
  32928. transform.value = {
  32929. ...transform.value,
  32930. offsetX: offsetX + ev.pageX - startX,
  32931. offsetY: offsetY + ev.pageY - startY
  32932. };
  32933. });
  32934. const removeMousemove = useEventListener(document, "mousemove", dragHandler);
  32935. const removeMouseup = useEventListener(document, "mouseup", () => {
  32936. removeMousemove();
  32937. removeMouseup();
  32938. });
  32939. e.preventDefault();
  32940. }
  32941. function handleTouchStart(e) {
  32942. if (loading.value || !wrapper.value || e.touches.length !== 1) return;
  32943. transform.value.enableTransition = false;
  32944. const { offsetX, offsetY } = transform.value;
  32945. const { pageX: startX, pageY: startY } = e.touches[0];
  32946. const dragHandler = throttle((ev) => {
  32947. const targetTouch = ev.touches[0];
  32948. transform.value = {
  32949. ...transform.value,
  32950. offsetX: offsetX + targetTouch.pageX - startX,
  32951. offsetY: offsetY + targetTouch.pageY - startY
  32952. };
  32953. });
  32954. const removeTouchmove = useEventListener(document, "touchmove", dragHandler);
  32955. const removeTouchend = useEventListener(document, "touchend", () => {
  32956. removeTouchmove();
  32957. removeTouchend();
  32958. });
  32959. e.preventDefault();
  32960. }
  32961. function reset() {
  32962. transform.value = {
  32963. scale: scaleClamped.value,
  32964. deg: 0,
  32965. offsetX: 0,
  32966. offsetY: 0,
  32967. enableTransition: false
  32968. };
  32969. }
  32970. function toggleMode() {
  32971. if (loading.value || loadError.value) return;
  32972. const modeNames = keysOf(modes);
  32973. const modeValues = Object.values(modes);
  32974. const currentMode = mode.value.name;
  32975. mode.value = modes[modeNames[(modeValues.findIndex((i) => i.name === currentMode) + 1) % modeNames.length]];
  32976. reset();
  32977. }
  32978. function setActiveItem(index) {
  32979. loadError.value = false;
  32980. const len = props.urlList.length;
  32981. activeIndex.value = (index + len) % len;
  32982. }
  32983. function prev() {
  32984. if (isFirst.value && !props.infinite) return;
  32985. setActiveItem(activeIndex.value - 1);
  32986. }
  32987. function next() {
  32988. if (isLast.value && !props.infinite) return;
  32989. setActiveItem(activeIndex.value + 1);
  32990. }
  32991. function handleActions(action, options = {}) {
  32992. if (loading.value || loadError.value) return;
  32993. const { minScale, maxScale } = props;
  32994. const { zoomRate, rotateDeg, enableTransition } = {
  32995. zoomRate: props.zoomRate,
  32996. rotateDeg: 90,
  32997. enableTransition: true,
  32998. ...options
  32999. };
  33000. switch (action) {
  33001. case "zoomOut":
  33002. if (transform.value.scale > minScale) transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3));
  33003. break;
  33004. case "zoomIn":
  33005. if (transform.value.scale < maxScale) transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3));
  33006. break;
  33007. case "clockwise":
  33008. transform.value.deg += rotateDeg;
  33009. emit("rotate", transform.value.deg);
  33010. break;
  33011. case "anticlockwise":
  33012. transform.value.deg -= rotateDeg;
  33013. emit("rotate", transform.value.deg);
  33014. break;
  33015. }
  33016. transform.value.enableTransition = enableTransition;
  33017. }
  33018. function onFocusoutPrevented(event) {
  33019. if (event.detail?.focusReason === "pointer") event.preventDefault();
  33020. }
  33021. function onCloseRequested() {
  33022. if (props.closeOnPressEscape) hide();
  33023. }
  33024. function wheelHandler(e) {
  33025. if (!e.ctrlKey) return;
  33026. if (e.deltaY < 0) {
  33027. e.preventDefault();
  33028. return false;
  33029. } else if (e.deltaY > 0) {
  33030. e.preventDefault();
  33031. return false;
  33032. }
  33033. }
  33034. watch(() => scaleClamped.value, (val) => {
  33035. transform.value.scale = val;
  33036. });
  33037. watch(currentImg, () => {
  33038. nextTick(() => {
  33039. if (!imgRef.value?.complete) loading.value = true;
  33040. });
  33041. });
  33042. watch(activeIndex, (val) => {
  33043. reset();
  33044. emit("switch", val);
  33045. });
  33046. onMounted(() => {
  33047. visible.value = true;
  33048. registerEventListener();
  33049. stopWheelListener = useEventListener("wheel", wheelHandler, { passive: false });
  33050. });
  33051. __expose({ setActiveItem });
  33052. return (_ctx, _cache) => {
  33053. return openBlock(), createBlock(unref(ElTeleport), {
  33054. to: "body",
  33055. disabled: !__props.teleported
  33056. }, {
  33057. default: withCtx(() => [createVNode(Transition, {
  33058. name: "viewer-fade",
  33059. appear: ""
  33060. }, {
  33061. default: withCtx(() => [createElementVNode("div", {
  33062. ref_key: "wrapper",
  33063. ref: wrapper,
  33064. tabindex: -1,
  33065. class: normalizeClass(unref(ns).e("wrapper")),
  33066. style: normalizeStyle({ zIndex: zIndex.value })
  33067. }, [createVNode(unref(focus_trap_default), {
  33068. loop: "",
  33069. trapped: "",
  33070. "focus-trap-el": wrapper.value,
  33071. "focus-start-el": "container",
  33072. onFocusoutPrevented,
  33073. onReleaseRequested: onCloseRequested
  33074. }, {
  33075. default: withCtx(() => [
  33076. createElementVNode("div", {
  33077. class: normalizeClass(unref(ns).e("mask")),
  33078. onClick: _cache[0] || (_cache[0] = withModifiers(($event) => __props.hideOnClickModal && hide(), ["self"]))
  33079. }, null, 2),
  33080. createCommentVNode(" CLOSE "),
  33081. createElementVNode("span", {
  33082. class: normalizeClass([unref(ns).e("btn"), unref(ns).e("close")]),
  33083. onClick: hide
  33084. }, [createVNode(unref(ElIcon), null, {
  33085. default: withCtx(() => [createVNode(unref(close_default))]),
  33086. _: 1
  33087. })], 2),
  33088. createCommentVNode(" ARROW "),
  33089. !isSingle.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", {
  33090. class: normalizeClass(arrowPrevKls.value),
  33091. onClick: prev
  33092. }, [createVNode(unref(ElIcon), null, {
  33093. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  33094. _: 1
  33095. })], 2), createElementVNode("span", {
  33096. class: normalizeClass(arrowNextKls.value),
  33097. onClick: next
  33098. }, [createVNode(unref(ElIcon), null, {
  33099. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  33100. _: 1
  33101. })], 2)], 64)) : createCommentVNode("v-if", true),
  33102. _ctx.$slots.progress || __props.showProgress ? (openBlock(), createElementBlock("div", {
  33103. key: 1,
  33104. class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")])
  33105. }, [renderSlot(_ctx.$slots, "progress", {
  33106. activeIndex: activeIndex.value,
  33107. total: __props.urlList.length
  33108. }, () => [createTextVNode(toDisplayString(progress.value), 1)])], 2)) : createCommentVNode("v-if", true),
  33109. createCommentVNode(" ACTIONS "),
  33110. createElementVNode("div", { class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")]) }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("actions__inner")) }, [renderSlot(_ctx.$slots, "toolbar", {
  33111. actions: handleActions,
  33112. prev,
  33113. next,
  33114. reset: toggleMode,
  33115. activeIndex: activeIndex.value,
  33116. setActiveItem
  33117. }, () => [
  33118. createVNode(unref(ElIcon), { onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut")) }, {
  33119. default: withCtx(() => [createVNode(unref(zoom_out_default))]),
  33120. _: 1
  33121. }),
  33122. createVNode(unref(ElIcon), { onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn")) }, {
  33123. default: withCtx(() => [createVNode(unref(zoom_in_default))]),
  33124. _: 1
  33125. }),
  33126. createElementVNode("i", { class: normalizeClass(unref(ns).e("actions__divider")) }, null, 2),
  33127. createVNode(unref(ElIcon), { onClick: toggleMode }, {
  33128. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(mode.value.icon)))]),
  33129. _: 1
  33130. }),
  33131. createElementVNode("i", { class: normalizeClass(unref(ns).e("actions__divider")) }, null, 2),
  33132. createVNode(unref(ElIcon), { onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise")) }, {
  33133. default: withCtx(() => [createVNode(unref(refresh_left_default))]),
  33134. _: 1
  33135. }),
  33136. createVNode(unref(ElIcon), { onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise")) }, {
  33137. default: withCtx(() => [createVNode(unref(refresh_right_default))]),
  33138. _: 1
  33139. })
  33140. ])], 2)], 2),
  33141. createCommentVNode(" CANVAS "),
  33142. createElementVNode("div", { class: normalizeClass(unref(ns).e("canvas")) }, [loadError.value && _ctx.$slots["viewer-error"] ? renderSlot(_ctx.$slots, "viewer-error", {
  33143. key: 0,
  33144. activeIndex: activeIndex.value,
  33145. src: currentImg.value
  33146. }) : (openBlock(), createElementBlock("img", {
  33147. ref_key: "imgRef",
  33148. ref: imgRef,
  33149. key: currentImg.value,
  33150. src: currentImg.value,
  33151. style: normalizeStyle(imgStyle.value),
  33152. class: normalizeClass(unref(ns).e("img")),
  33153. crossorigin: __props.crossorigin,
  33154. onLoad: handleImgLoad,
  33155. onError: handleImgError,
  33156. onMousedown: handleMouseDown,
  33157. onTouchstart: handleTouchStart
  33158. }, null, 46, _hoisted_1$35))], 2),
  33159. renderSlot(_ctx.$slots, "default")
  33160. ]),
  33161. _: 3
  33162. }, 8, ["focus-trap-el"])], 6)]),
  33163. _: 3
  33164. })]),
  33165. _: 3
  33166. }, 8, ["disabled"]);
  33167. };
  33168. }
  33169. });
  33170. //#endregion
  33171. //#region ../../packages/components/image-viewer/src/image-viewer.vue
  33172. var image_viewer_default = image_viewer_vue_vue_type_script_setup_true_lang_default;
  33173. //#endregion
  33174. //#region ../../packages/components/image-viewer/index.ts
  33175. const ElImageViewer = withInstall(image_viewer_default);
  33176. //#endregion
  33177. //#region ../../packages/components/image/src/image.vue?vue&type=script&setup=true&lang.ts
  33178. const _hoisted_1$34 = [
  33179. "src",
  33180. "loading",
  33181. "crossorigin"
  33182. ];
  33183. const _hoisted_2$21 = { key: 0 };
  33184. var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  33185. name: "ElImage",
  33186. inheritAttrs: false,
  33187. __name: "image",
  33188. props: imageProps,
  33189. emits: imageEmits,
  33190. setup(__props, { expose: __expose, emit: __emit }) {
  33191. const props = __props;
  33192. const emit = __emit;
  33193. const { t } = useLocale();
  33194. const ns = useNamespace("image");
  33195. const rawAttrs = useAttrs$1();
  33196. const containerAttrs = computed(() => {
  33197. return fromPairs(Object.entries(rawAttrs).filter(([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)));
  33198. });
  33199. const imgAttrs = useAttrs({
  33200. excludeListeners: true,
  33201. excludeKeys: computed(() => {
  33202. return Object.keys(containerAttrs.value);
  33203. })
  33204. });
  33205. const imageSrc = ref();
  33206. const hasLoadError = ref(false);
  33207. const isLoading = ref(true);
  33208. const showViewer = ref(false);
  33209. const container = ref();
  33210. const _scrollContainer = ref();
  33211. const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
  33212. let stopScrollListener;
  33213. const imageKls = computed(() => [
  33214. ns.e("inner"),
  33215. preview.value && ns.e("preview"),
  33216. isLoading.value && ns.is("loading")
  33217. ]);
  33218. const imageStyle = computed(() => {
  33219. const { fit } = props;
  33220. if (isClient && fit) return { objectFit: fit };
  33221. return {};
  33222. });
  33223. const preview = computed(() => {
  33224. const { previewSrcList } = props;
  33225. return isArray$1(previewSrcList) && previewSrcList.length > 0;
  33226. });
  33227. const imageIndex = computed(() => {
  33228. const { previewSrcList, initialIndex } = props;
  33229. let previewIndex = initialIndex;
  33230. if (initialIndex > previewSrcList.length - 1) previewIndex = 0;
  33231. return previewIndex;
  33232. });
  33233. const isManual = computed(() => {
  33234. if (props.loading === "eager") return false;
  33235. return !supportLoading && props.loading === "lazy" || props.lazy;
  33236. });
  33237. const loadImage = () => {
  33238. if (!isClient) return;
  33239. isLoading.value = true;
  33240. hasLoadError.value = false;
  33241. imageSrc.value = props.src;
  33242. };
  33243. function handleLoad(event) {
  33244. isLoading.value = false;
  33245. hasLoadError.value = false;
  33246. emit("load", event);
  33247. }
  33248. function handleError(event) {
  33249. isLoading.value = false;
  33250. hasLoadError.value = true;
  33251. emit("error", event);
  33252. }
  33253. function handleLazyLoad(isIntersecting) {
  33254. if (isIntersecting) {
  33255. loadImage();
  33256. removeLazyLoadListener();
  33257. }
  33258. }
  33259. const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true);
  33260. async function addLazyLoadListener() {
  33261. if (!isClient) return;
  33262. await nextTick();
  33263. const { scrollContainer } = props;
  33264. if (isElement$1(scrollContainer)) _scrollContainer.value = scrollContainer;
  33265. else if (isString(scrollContainer) && scrollContainer !== "") _scrollContainer.value = document.querySelector(scrollContainer) ?? void 0;
  33266. else if (container.value) {
  33267. const scrollContainer = getScrollContainer(container.value);
  33268. _scrollContainer.value = isWindow(scrollContainer) ? void 0 : scrollContainer;
  33269. }
  33270. const { stop } = useIntersectionObserver(container, ([entry]) => {
  33271. lazyLoadHandler(entry.isIntersecting);
  33272. }, { root: _scrollContainer });
  33273. stopScrollListener = stop;
  33274. }
  33275. function removeLazyLoadListener() {
  33276. if (!isClient || !lazyLoadHandler) return;
  33277. stopScrollListener?.();
  33278. _scrollContainer.value = void 0;
  33279. stopScrollListener = void 0;
  33280. }
  33281. function clickHandler() {
  33282. if (!preview.value) return;
  33283. showViewer.value = true;
  33284. emit("show");
  33285. }
  33286. function closeViewer() {
  33287. showViewer.value = false;
  33288. emit("close");
  33289. }
  33290. function switchViewer(val) {
  33291. emit("switch", val);
  33292. }
  33293. watch(() => props.src, () => {
  33294. if (isManual.value) {
  33295. isLoading.value = true;
  33296. hasLoadError.value = false;
  33297. removeLazyLoadListener();
  33298. addLazyLoadListener();
  33299. } else loadImage();
  33300. });
  33301. onMounted(() => {
  33302. if (isManual.value) addLazyLoadListener();
  33303. else loadImage();
  33304. });
  33305. __expose({ showPreview: clickHandler });
  33306. return (_ctx, _cache) => {
  33307. return openBlock(), createElementBlock("div", mergeProps({
  33308. ref_key: "container",
  33309. ref: container
  33310. }, containerAttrs.value, { class: [unref(ns).b(), _ctx.$attrs.class] }), [hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [createElementVNode("div", { class: normalizeClass(unref(ns).e("error")) }, toDisplayString(unref(t)("el.image.error")), 3)]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(imgAttrs), {
  33311. src: imageSrc.value,
  33312. loading: __props.loading,
  33313. style: imageStyle.value,
  33314. class: imageKls.value,
  33315. crossorigin: __props.crossorigin,
  33316. onClick: clickHandler,
  33317. onLoad: handleLoad,
  33318. onError: handleError
  33319. }), null, 16, _hoisted_1$34)) : createCommentVNode("v-if", true), isLoading.value ? (openBlock(), createElementBlock("div", {
  33320. key: 1,
  33321. class: normalizeClass(unref(ns).e("wrapper"))
  33322. }, [renderSlot(_ctx.$slots, "placeholder", {}, () => [createElementVNode("div", { class: normalizeClass(unref(ns).e("placeholder")) }, null, 2)])], 2)) : createCommentVNode("v-if", true)], 64)), preview.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), {
  33323. key: 0,
  33324. "z-index": __props.zIndex,
  33325. "initial-index": imageIndex.value,
  33326. infinite: __props.infinite,
  33327. "zoom-rate": __props.zoomRate,
  33328. "min-scale": __props.minScale,
  33329. "max-scale": __props.maxScale,
  33330. "show-progress": __props.showProgress,
  33331. "url-list": __props.previewSrcList,
  33332. scale: __props.scale,
  33333. crossorigin: __props.crossorigin,
  33334. "hide-on-click-modal": __props.hideOnClickModal,
  33335. teleported: __props.previewTeleported,
  33336. "close-on-press-escape": __props.closeOnPressEscape,
  33337. onClose: closeViewer,
  33338. onSwitch: switchViewer
  33339. }, createSlots({
  33340. toolbar: withCtx((toolbar) => [renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(toolbar)))]),
  33341. default: withCtx(() => [_ctx.$slots.viewer ? (openBlock(), createElementBlock("div", _hoisted_2$21, [renderSlot(_ctx.$slots, "viewer")])) : createCommentVNode("v-if", true)]),
  33342. _: 2
  33343. }, [_ctx.$slots.progress ? {
  33344. name: "progress",
  33345. fn: withCtx((progress) => [renderSlot(_ctx.$slots, "progress", normalizeProps(guardReactiveProps(progress)))]),
  33346. key: "0"
  33347. } : void 0, _ctx.$slots["viewer-error"] ? {
  33348. name: "viewer-error",
  33349. fn: withCtx((viewerError) => [renderSlot(_ctx.$slots, "viewer-error", normalizeProps(guardReactiveProps(viewerError)))]),
  33350. key: "1"
  33351. } : void 0]), 1032, [
  33352. "z-index",
  33353. "initial-index",
  33354. "infinite",
  33355. "zoom-rate",
  33356. "min-scale",
  33357. "max-scale",
  33358. "show-progress",
  33359. "url-list",
  33360. "scale",
  33361. "crossorigin",
  33362. "hide-on-click-modal",
  33363. "teleported",
  33364. "close-on-press-escape"
  33365. ])) : createCommentVNode("v-if", true)], 64)) : createCommentVNode("v-if", true)], 16);
  33366. };
  33367. }
  33368. });
  33369. //#endregion
  33370. //#region ../../packages/components/image/src/image.vue
  33371. var image_default = image_vue_vue_type_script_setup_true_lang_default;
  33372. //#endregion
  33373. //#region ../../packages/components/image/index.ts
  33374. const ElImage = withInstall(image_default);
  33375. //#endregion
  33376. //#region ../../packages/components/input-number/src/input-number.ts
  33377. /**
  33378. * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
  33379. */
  33380. const inputNumberProps = buildProps({
  33381. id: {
  33382. type: String,
  33383. default: void 0
  33384. },
  33385. step: {
  33386. type: Number,
  33387. default: 1
  33388. },
  33389. stepStrictly: Boolean,
  33390. max: {
  33391. type: Number,
  33392. default: Number.MAX_SAFE_INTEGER
  33393. },
  33394. min: {
  33395. type: Number,
  33396. default: Number.MIN_SAFE_INTEGER
  33397. },
  33398. modelValue: { type: [Number, null] },
  33399. readonly: Boolean,
  33400. disabled: {
  33401. type: Boolean,
  33402. default: void 0
  33403. },
  33404. size: useSizeProp,
  33405. controls: {
  33406. type: Boolean,
  33407. default: true
  33408. },
  33409. controlsPosition: {
  33410. type: String,
  33411. default: "",
  33412. values: ["", "right"]
  33413. },
  33414. valueOnClear: {
  33415. type: definePropType([
  33416. String,
  33417. Number,
  33418. null
  33419. ]),
  33420. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  33421. default: null
  33422. },
  33423. name: String,
  33424. placeholder: String,
  33425. precision: {
  33426. type: Number,
  33427. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  33428. },
  33429. validateEvent: {
  33430. type: Boolean,
  33431. default: true
  33432. },
  33433. ...useAriaProps(["ariaLabel"]),
  33434. inputmode: {
  33435. type: definePropType(String),
  33436. default: void 0
  33437. },
  33438. align: {
  33439. type: definePropType(String),
  33440. default: "center"
  33441. },
  33442. disabledScientific: Boolean
  33443. });
  33444. const inputNumberEmits = {
  33445. [CHANGE_EVENT]: (cur, prev) => prev !== cur,
  33446. blur: (e) => e instanceof FocusEvent,
  33447. focus: (e) => e instanceof FocusEvent,
  33448. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  33449. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  33450. };
  33451. //#endregion
  33452. //#region ../../packages/components/input-number/src/input-number.vue?vue&type=script&setup=true&lang.ts
  33453. const _hoisted_1$33 = ["aria-label"];
  33454. const _hoisted_2$20 = ["aria-label"];
  33455. var input_number_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  33456. name: "ElInputNumber",
  33457. __name: "input-number",
  33458. props: inputNumberProps,
  33459. emits: inputNumberEmits,
  33460. setup(__props, { expose: __expose, emit: __emit }) {
  33461. const props = __props;
  33462. const emit = __emit;
  33463. const { t } = useLocale();
  33464. const ns = useNamespace("input-number");
  33465. const input = ref();
  33466. const data = reactive({
  33467. currentValue: props.modelValue,
  33468. userInput: null
  33469. });
  33470. const { formItem } = useFormItem();
  33471. const minDisabled = computed(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  33472. const maxDisabled = computed(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  33473. const numPrecision = computed(() => {
  33474. const stepPrecision = getPrecision(props.step);
  33475. if (!isUndefined(props.precision)) {
  33476. if (stepPrecision > props.precision) /* @__PURE__ */ debugWarn("InputNumber", "precision should not be less than the decimal places of step");
  33477. return props.precision;
  33478. } else return Math.max(getPrecision(props.modelValue), stepPrecision);
  33479. });
  33480. const controlsAtRight = computed(() => {
  33481. return props.controls && props.controlsPosition === "right";
  33482. });
  33483. const inputNumberSize = useFormSize();
  33484. const inputNumberDisabled = useFormDisabled();
  33485. const displayValue = computed(() => {
  33486. if (data.userInput !== null) return data.userInput;
  33487. let currentValue = data.currentValue;
  33488. if (isNil(currentValue)) return "";
  33489. if (isNumber(currentValue)) {
  33490. if (Number.isNaN(currentValue)) return "";
  33491. if (!isUndefined(props.precision)) currentValue = currentValue.toFixed(props.precision);
  33492. }
  33493. return currentValue;
  33494. });
  33495. const toPrecision = (num, pre) => {
  33496. if (isUndefined(pre)) pre = numPrecision.value;
  33497. if (pre === 0) return Math.round(num);
  33498. let snum = String(num);
  33499. const pointPos = snum.indexOf(".");
  33500. if (pointPos === -1) return num;
  33501. if (!snum.replace(".", "").split("")[pointPos + pre]) return num;
  33502. const length = snum.length;
  33503. if (snum.charAt(length - 1) === "5") snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  33504. return Number.parseFloat(Number(snum).toFixed(pre));
  33505. };
  33506. const getPrecision = (value) => {
  33507. if (isNil(value)) return 0;
  33508. const valueString = value.toString();
  33509. const dotPosition = valueString.indexOf(".");
  33510. let precision = 0;
  33511. if (dotPosition !== -1) precision = valueString.length - dotPosition - 1;
  33512. return precision;
  33513. };
  33514. const ensurePrecision = (val, coefficient = 1) => {
  33515. if (!isNumber(val)) return data.currentValue;
  33516. if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {
  33517. /* @__PURE__ */ debugWarn("InputNumber", "The value has reached the maximum safe integer limit.");
  33518. return val;
  33519. } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {
  33520. /* @__PURE__ */ debugWarn("InputNumber", "The value has reached the minimum safe integer limit.");
  33521. return val;
  33522. }
  33523. return toPrecision(val + props.step * coefficient);
  33524. };
  33525. const handleKeydown = (event) => {
  33526. const code = getEventCode(event);
  33527. const key = getEventKey(event);
  33528. if (props.disabledScientific && ["e", "E"].includes(key)) {
  33529. event.preventDefault();
  33530. return;
  33531. }
  33532. switch (code) {
  33533. case EVENT_CODE.up:
  33534. event.preventDefault();
  33535. increase();
  33536. break;
  33537. case EVENT_CODE.down:
  33538. event.preventDefault();
  33539. decrease();
  33540. break;
  33541. }
  33542. };
  33543. const increase = () => {
  33544. if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return;
  33545. setCurrentValue(ensurePrecision(Number(displayValue.value) || 0));
  33546. emit(INPUT_EVENT, data.currentValue);
  33547. setCurrentValueToModelValue();
  33548. };
  33549. const decrease = () => {
  33550. if (props.readonly || inputNumberDisabled.value || minDisabled.value) return;
  33551. setCurrentValue(ensurePrecision(Number(displayValue.value) || 0, -1));
  33552. emit(INPUT_EVENT, data.currentValue);
  33553. setCurrentValueToModelValue();
  33554. };
  33555. const verifyValue = (value, update) => {
  33556. const { max, min, step, precision, stepStrictly, valueOnClear } = props;
  33557. if (max < min) throwError("InputNumber", "min should not be greater than max.");
  33558. let newVal = Number(value);
  33559. if (isNil(value) || Number.isNaN(newVal)) return null;
  33560. if (value === "") {
  33561. if (valueOnClear === null) return null;
  33562. newVal = isString(valueOnClear) ? {
  33563. min,
  33564. max
  33565. }[valueOnClear] : valueOnClear;
  33566. }
  33567. if (stepStrictly) {
  33568. newVal = toPrecision(Math.round(toPrecision(newVal / step)) * step, precision);
  33569. if (newVal !== value) update && emit(UPDATE_MODEL_EVENT, newVal);
  33570. }
  33571. if (!isUndefined(precision)) newVal = toPrecision(newVal, precision);
  33572. if (newVal > max || newVal < min) {
  33573. newVal = newVal > max ? max : min;
  33574. update && emit(UPDATE_MODEL_EVENT, newVal);
  33575. }
  33576. return newVal;
  33577. };
  33578. const setCurrentValue = (value, emitChange = true) => {
  33579. const oldVal = data.currentValue;
  33580. const newVal = verifyValue(value);
  33581. if (!emitChange) {
  33582. emit(UPDATE_MODEL_EVENT, newVal);
  33583. return;
  33584. }
  33585. data.userInput = null;
  33586. if (oldVal === newVal && value) return;
  33587. emit(UPDATE_MODEL_EVENT, newVal);
  33588. if (oldVal !== newVal) emit(CHANGE_EVENT, newVal, oldVal);
  33589. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  33590. data.currentValue = newVal;
  33591. };
  33592. const handleInput = (value) => {
  33593. data.userInput = value;
  33594. const newVal = value === "" ? null : Number(value);
  33595. emit(INPUT_EVENT, newVal);
  33596. setCurrentValue(newVal, false);
  33597. };
  33598. const handleInputChange = (value) => {
  33599. const newVal = value !== "" ? Number(value) : "";
  33600. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") setCurrentValue(newVal);
  33601. setCurrentValueToModelValue();
  33602. data.userInput = null;
  33603. };
  33604. const focus = () => {
  33605. input.value?.focus?.();
  33606. };
  33607. const blur = () => {
  33608. input.value?.blur?.();
  33609. };
  33610. const handleFocus = (event) => {
  33611. emit("focus", event);
  33612. };
  33613. const handleBlur = (event) => {
  33614. data.userInput = null;
  33615. if (data.currentValue === null && input.value?.input) input.value.input.value = "";
  33616. emit("blur", event);
  33617. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  33618. };
  33619. const setCurrentValueToModelValue = () => {
  33620. if (data.currentValue !== props.modelValue) data.currentValue = props.modelValue;
  33621. };
  33622. const handleWheel = (e) => {
  33623. if (document.activeElement === e.target) e.preventDefault();
  33624. };
  33625. watch(() => props.modelValue, (value, oldValue) => {
  33626. const newValue = verifyValue(value, true);
  33627. if (data.userInput === null && newValue !== oldValue) data.currentValue = newValue;
  33628. }, { immediate: true });
  33629. watch(() => props.precision, () => {
  33630. data.currentValue = verifyValue(props.modelValue);
  33631. });
  33632. onMounted(() => {
  33633. const { min, max, modelValue } = props;
  33634. const innerInput = input.value?.input;
  33635. innerInput.setAttribute("role", "spinbutton");
  33636. if (Number.isFinite(max)) innerInput.setAttribute("aria-valuemax", String(max));
  33637. else innerInput.removeAttribute("aria-valuemax");
  33638. if (Number.isFinite(min)) innerInput.setAttribute("aria-valuemin", String(min));
  33639. else innerInput.removeAttribute("aria-valuemin");
  33640. innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
  33641. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  33642. if (!isNumber(modelValue) && modelValue != null) {
  33643. let val = Number(modelValue);
  33644. if (Number.isNaN(val)) val = null;
  33645. emit(UPDATE_MODEL_EVENT, val);
  33646. }
  33647. innerInput.addEventListener("wheel", handleWheel, { passive: false });
  33648. });
  33649. onUpdated(() => {
  33650. (input.value?.input)?.setAttribute("aria-valuenow", `${data.currentValue ?? ""}`);
  33651. });
  33652. __expose({
  33653. focus,
  33654. blur
  33655. });
  33656. return (_ctx, _cache) => {
  33657. return openBlock(), createElementBlock("div", {
  33658. class: normalizeClass([
  33659. unref(ns).b(),
  33660. unref(ns).m(unref(inputNumberSize)),
  33661. unref(ns).is("disabled", unref(inputNumberDisabled)),
  33662. unref(ns).is("without-controls", !__props.controls),
  33663. unref(ns).is("controls-right", controlsAtRight.value),
  33664. unref(ns).is(__props.align, !!__props.align)
  33665. ]),
  33666. onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
  33667. }, [
  33668. __props.controls ? withDirectives((openBlock(), createElementBlock("span", {
  33669. key: 0,
  33670. role: "button",
  33671. "aria-label": unref(t)("el.inputNumber.decrease"),
  33672. class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", minDisabled.value)]),
  33673. onKeydown: withKeys(decrease, ["enter"])
  33674. }, [renderSlot(_ctx.$slots, "decrease-icon", {}, () => [createVNode(unref(ElIcon), null, {
  33675. default: withCtx(() => [controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))]),
  33676. _: 1
  33677. })])], 42, _hoisted_1$33)), [[unref(vRepeatClick), decrease]]) : createCommentVNode("v-if", true),
  33678. __props.controls ? withDirectives((openBlock(), createElementBlock("span", {
  33679. key: 1,
  33680. role: "button",
  33681. "aria-label": unref(t)("el.inputNumber.increase"),
  33682. class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", maxDisabled.value)]),
  33683. onKeydown: withKeys(increase, ["enter"])
  33684. }, [renderSlot(_ctx.$slots, "increase-icon", {}, () => [createVNode(unref(ElIcon), null, {
  33685. default: withCtx(() => [controlsAtRight.value ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))]),
  33686. _: 1
  33687. })])], 42, _hoisted_2$20)), [[unref(vRepeatClick), increase]]) : createCommentVNode("v-if", true),
  33688. createVNode(unref(ElInput), {
  33689. id: __props.id,
  33690. ref_key: "input",
  33691. ref: input,
  33692. type: "number",
  33693. step: __props.step,
  33694. "model-value": displayValue.value,
  33695. placeholder: __props.placeholder,
  33696. readonly: __props.readonly,
  33697. disabled: unref(inputNumberDisabled),
  33698. size: unref(inputNumberSize),
  33699. max: __props.max,
  33700. min: __props.min,
  33701. name: __props.name,
  33702. "aria-label": __props.ariaLabel,
  33703. "validate-event": false,
  33704. inputmode: __props.inputmode,
  33705. onKeydown: handleKeydown,
  33706. onBlur: handleBlur,
  33707. onFocus: handleFocus,
  33708. onInput: handleInput,
  33709. onChange: handleInputChange
  33710. }, createSlots({ _: 2 }, [_ctx.$slots.prefix ? {
  33711. name: "prefix",
  33712. fn: withCtx(() => [renderSlot(_ctx.$slots, "prefix")]),
  33713. key: "0"
  33714. } : void 0, _ctx.$slots.suffix ? {
  33715. name: "suffix",
  33716. fn: withCtx(() => [renderSlot(_ctx.$slots, "suffix")]),
  33717. key: "1"
  33718. } : void 0]), 1032, [
  33719. "id",
  33720. "step",
  33721. "model-value",
  33722. "placeholder",
  33723. "readonly",
  33724. "disabled",
  33725. "size",
  33726. "max",
  33727. "min",
  33728. "name",
  33729. "aria-label",
  33730. "inputmode"
  33731. ])
  33732. ], 34);
  33733. };
  33734. }
  33735. });
  33736. //#endregion
  33737. //#region ../../packages/components/input-number/src/input-number.vue
  33738. var input_number_default = input_number_vue_vue_type_script_setup_true_lang_default;
  33739. //#endregion
  33740. //#region ../../packages/components/input-number/index.ts
  33741. const ElInputNumber = withInstall(input_number_default);
  33742. //#endregion
  33743. //#region ../../packages/components/input-tag/src/input-tag.ts
  33744. /**
  33745. * @deprecated Removed after 3.0.0, Use `InputTagProps` instead.
  33746. */
  33747. const inputTagProps = buildProps({
  33748. modelValue: { type: definePropType(Array) },
  33749. max: Number,
  33750. tagType: {
  33751. ...tagProps.type,
  33752. default: "info"
  33753. },
  33754. tagEffect: tagProps.effect,
  33755. effect: {
  33756. type: definePropType(String),
  33757. default: "light"
  33758. },
  33759. trigger: {
  33760. type: definePropType(String),
  33761. default: EVENT_CODE.enter
  33762. },
  33763. draggable: Boolean,
  33764. delimiter: {
  33765. type: [String, RegExp],
  33766. default: ""
  33767. },
  33768. size: useSizeProp,
  33769. clearable: Boolean,
  33770. clearIcon: {
  33771. type: iconPropType,
  33772. default: circle_close_default
  33773. },
  33774. disabled: {
  33775. type: Boolean,
  33776. default: void 0
  33777. },
  33778. validateEvent: {
  33779. type: Boolean,
  33780. default: true
  33781. },
  33782. readonly: Boolean,
  33783. autofocus: Boolean,
  33784. id: {
  33785. type: String,
  33786. default: void 0
  33787. },
  33788. tabindex: {
  33789. type: [String, Number],
  33790. default: 0
  33791. },
  33792. maxlength: { type: [String, Number] },
  33793. minlength: { type: [String, Number] },
  33794. placeholder: String,
  33795. autocomplete: {
  33796. type: definePropType(String),
  33797. default: "off"
  33798. },
  33799. saveOnBlur: {
  33800. type: Boolean,
  33801. default: true
  33802. },
  33803. collapseTags: Boolean,
  33804. collapseTagsTooltip: Boolean,
  33805. maxCollapseTags: {
  33806. type: Number,
  33807. default: 1
  33808. },
  33809. ariaLabel: String
  33810. });
  33811. const inputTagEmits = {
  33812. [UPDATE_MODEL_EVENT]: (value) => isArray$1(value) || isUndefined(value),
  33813. [CHANGE_EVENT]: (value) => isArray$1(value) || isUndefined(value),
  33814. [INPUT_EVENT]: (value) => isString(value),
  33815. "add-tag": (value) => isString(value) || isArray$1(value),
  33816. "remove-tag": (value, index) => isString(value) && isNumber(index),
  33817. "drag-tag": (oldIndex, newIndex, value) => isNumber(oldIndex) && isNumber(newIndex) && isString(value),
  33818. focus: (evt) => evt instanceof FocusEvent,
  33819. blur: (evt) => evt instanceof FocusEvent,
  33820. clear: () => true
  33821. };
  33822. //#endregion
  33823. //#region ../../packages/components/input-tag/src/composables/use-drag-tag.ts
  33824. function useDragTag({ wrapperRef, handleDragged, afterDragged }) {
  33825. const ns = useNamespace("input-tag");
  33826. const dropIndicatorRef = shallowRef();
  33827. const showDropIndicator = ref(false);
  33828. let draggingIndex;
  33829. let draggingTag;
  33830. let dropIndex;
  33831. let dropType;
  33832. function getTagClassName(index) {
  33833. return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
  33834. }
  33835. function handleDragStart(event, index) {
  33836. draggingIndex = index;
  33837. draggingTag = wrapperRef.value.querySelector(getTagClassName(index));
  33838. if (draggingTag) draggingTag.style.opacity = "0.5";
  33839. event.dataTransfer.effectAllowed = "move";
  33840. }
  33841. function handleDragOver(event, index) {
  33842. dropIndex = index;
  33843. event.preventDefault();
  33844. event.dataTransfer.dropEffect = "move";
  33845. if (isUndefined(draggingIndex) || draggingIndex === index) {
  33846. showDropIndicator.value = false;
  33847. return;
  33848. }
  33849. const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
  33850. const dropPrev = !(draggingIndex + 1 === index);
  33851. const dropNext = !(draggingIndex - 1 === index);
  33852. const distance = event.clientX - dropPosition.left;
  33853. const prevPercent = dropPrev ? dropNext ? .5 : 1 : -1;
  33854. const nextPercent = dropNext ? dropPrev ? .5 : 0 : 1;
  33855. if (distance <= dropPosition.width * prevPercent) dropType = "before";
  33856. else if (distance > dropPosition.width * nextPercent) dropType = "after";
  33857. else dropType = void 0;
  33858. const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`);
  33859. const innerPosition = innerEl.getBoundingClientRect();
  33860. const gap = Number.parseFloat(getStyle(innerEl, "gap")) / 2;
  33861. const indicatorTop = dropPosition.top - innerPosition.top;
  33862. let indicatorLeft = -9999;
  33863. if (dropType === "before") indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2));
  33864. else if (dropType === "after") {
  33865. const left = dropPosition.right - innerPosition.left;
  33866. indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
  33867. }
  33868. setStyle(dropIndicatorRef.value, {
  33869. top: `${indicatorTop}px`,
  33870. left: `${indicatorLeft}px`
  33871. });
  33872. showDropIndicator.value = !!dropType;
  33873. }
  33874. function handleDragEnd(event) {
  33875. event.preventDefault();
  33876. if (draggingTag) draggingTag.style.opacity = "";
  33877. if (dropType && !isUndefined(draggingIndex) && !isUndefined(dropIndex) && draggingIndex !== dropIndex) handleDragged(draggingIndex, dropIndex, dropType);
  33878. showDropIndicator.value = false;
  33879. draggingIndex = void 0;
  33880. draggingTag = null;
  33881. dropIndex = void 0;
  33882. dropType = void 0;
  33883. afterDragged?.();
  33884. }
  33885. return {
  33886. dropIndicatorRef,
  33887. showDropIndicator,
  33888. handleDragStart,
  33889. handleDragOver,
  33890. handleDragEnd
  33891. };
  33892. }
  33893. //#endregion
  33894. //#region ../../packages/components/input-tag/src/composables/use-hovering.ts
  33895. function useHovering() {
  33896. const hovering = ref(false);
  33897. const handleMouseEnter = () => {
  33898. hovering.value = true;
  33899. };
  33900. const handleMouseLeave = () => {
  33901. hovering.value = false;
  33902. };
  33903. return {
  33904. hovering,
  33905. handleMouseEnter,
  33906. handleMouseLeave
  33907. };
  33908. }
  33909. //#endregion
  33910. //#region ../../packages/components/input-tag/src/composables/use-input-tag.ts
  33911. function useInputTag({ props, emit, formItem }) {
  33912. const disabled = useFormDisabled();
  33913. const size = useFormSize();
  33914. const inputRef = shallowRef();
  33915. const inputValue = ref();
  33916. const tagTooltipRef = ref();
  33917. const tagSize = computed(() => {
  33918. return ["small"].includes(size.value) ? "small" : "default";
  33919. });
  33920. const placeholder = computed(() => {
  33921. return props.modelValue?.length ? void 0 : props.placeholder;
  33922. });
  33923. const closable = computed(() => !(props.readonly || disabled.value));
  33924. const inputLimit = computed(() => {
  33925. return isUndefined(props.max) ? false : (props.modelValue?.length ?? 0) >= props.max;
  33926. });
  33927. const showTagList = computed(() => {
  33928. return props.collapseTags ? props.modelValue?.slice(0, props.maxCollapseTags) : props.modelValue;
  33929. });
  33930. const collapseTagList = computed(() => {
  33931. return props.collapseTags ? props.modelValue?.slice(props.maxCollapseTags) : [];
  33932. });
  33933. const addTagsEmit = (value) => {
  33934. const list = [...props.modelValue ?? [], ...castArray$1(value)];
  33935. emit(UPDATE_MODEL_EVENT, list);
  33936. emit(CHANGE_EVENT, list);
  33937. emit("add-tag", value);
  33938. inputValue.value = void 0;
  33939. };
  33940. const getDelimitedTags = (input) => {
  33941. const parts = input.split(props.delimiter);
  33942. const tags = parts.length > 1 ? parts.map((val) => val.trim()).filter(Boolean) : [];
  33943. if (props.max) {
  33944. const maxInsert = props.max - (props.modelValue?.length ?? 0);
  33945. tags.splice(maxInsert);
  33946. }
  33947. return tags.length === 1 ? tags[0] : tags;
  33948. };
  33949. const handlePaste = (event) => {
  33950. const pasted = event.clipboardData?.getData("text");
  33951. if (props.readonly || inputLimit.value || !props.delimiter || !pasted) return;
  33952. const { selectionStart = 0, selectionEnd = 0, value } = event.target;
  33953. const nextValue = value.slice(0, selectionStart) + pasted + value.slice(selectionEnd);
  33954. const tags = getDelimitedTags(nextValue);
  33955. if (tags.length) {
  33956. addTagsEmit(tags);
  33957. emit(INPUT_EVENT, nextValue);
  33958. event.preventDefault();
  33959. }
  33960. };
  33961. const handleInput = (event) => {
  33962. if (inputLimit.value) {
  33963. inputValue.value = void 0;
  33964. return;
  33965. }
  33966. if (isComposing.value) return;
  33967. if (props.delimiter && inputValue.value) {
  33968. const tags = getDelimitedTags(inputValue.value);
  33969. if (tags.length) addTagsEmit(tags);
  33970. }
  33971. emit(INPUT_EVENT, event.target.value);
  33972. };
  33973. const handleKeydown = (event) => {
  33974. if (isComposing.value) return;
  33975. switch (getEventCode(event)) {
  33976. case props.trigger:
  33977. event.preventDefault();
  33978. event.stopPropagation();
  33979. handleAddTag();
  33980. break;
  33981. case EVENT_CODE.numpadEnter:
  33982. if (props.trigger === EVENT_CODE.enter) {
  33983. event.preventDefault();
  33984. event.stopPropagation();
  33985. handleAddTag();
  33986. }
  33987. break;
  33988. case EVENT_CODE.backspace:
  33989. if (!inputValue.value && props.modelValue?.length) {
  33990. event.preventDefault();
  33991. event.stopPropagation();
  33992. handleRemoveTag(props.modelValue.length - 1);
  33993. }
  33994. break;
  33995. }
  33996. };
  33997. const handleKeyup = (event) => {
  33998. if (isComposing.value || !isAndroid()) return;
  33999. switch (getEventCode(event)) {
  34000. case EVENT_CODE.space:
  34001. if (props.trigger === EVENT_CODE.space) {
  34002. event.preventDefault();
  34003. event.stopPropagation();
  34004. handleAddTag();
  34005. }
  34006. break;
  34007. }
  34008. };
  34009. const handleAddTag = () => {
  34010. const value = inputValue.value?.trim();
  34011. if (!value || inputLimit.value) return;
  34012. addTagsEmit(value);
  34013. };
  34014. const handleRemoveTag = (index) => {
  34015. const value = (props.modelValue ?? []).slice();
  34016. const [item] = value.splice(index, 1);
  34017. emit(UPDATE_MODEL_EVENT, value);
  34018. emit(CHANGE_EVENT, value);
  34019. emit("remove-tag", item, index);
  34020. };
  34021. const handleClear = () => {
  34022. inputValue.value = void 0;
  34023. emit(UPDATE_MODEL_EVENT, void 0);
  34024. emit(CHANGE_EVENT, void 0);
  34025. emit("clear");
  34026. };
  34027. const handleDragged = (draggingIndex, dropIndex, type) => {
  34028. const value = (props.modelValue ?? []).slice();
  34029. const [draggedItem] = value.splice(draggingIndex, 1);
  34030. const step = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0;
  34031. value.splice(dropIndex + step, 0, draggedItem);
  34032. emit(UPDATE_MODEL_EVENT, value);
  34033. emit(CHANGE_EVENT, value);
  34034. emit("drag-tag", draggingIndex, dropIndex + step, draggedItem);
  34035. };
  34036. const focus = () => {
  34037. inputRef.value?.focus();
  34038. };
  34039. const blur = () => {
  34040. inputRef.value?.blur();
  34041. };
  34042. const { wrapperRef, isFocused } = useFocusController(inputRef, {
  34043. disabled,
  34044. beforeBlur(event) {
  34045. return tagTooltipRef.value?.isFocusInsideContent(event);
  34046. },
  34047. afterBlur() {
  34048. if (props.saveOnBlur) handleAddTag();
  34049. else inputValue.value = void 0;
  34050. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  34051. }
  34052. });
  34053. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: handleInput });
  34054. watch(() => props.modelValue, () => {
  34055. if (props.validateEvent) formItem?.validate?.(CHANGE_EVENT).catch((err) => /* @__PURE__ */ debugWarn(err));
  34056. });
  34057. return {
  34058. inputRef,
  34059. wrapperRef,
  34060. tagTooltipRef,
  34061. isFocused,
  34062. isComposing,
  34063. inputValue,
  34064. size,
  34065. tagSize,
  34066. placeholder,
  34067. closable,
  34068. disabled,
  34069. inputLimit,
  34070. showTagList,
  34071. collapseTagList,
  34072. handleDragged,
  34073. handlePaste,
  34074. handleInput,
  34075. handleKeydown,
  34076. handleKeyup,
  34077. handleAddTag,
  34078. handleRemoveTag,
  34079. handleClear,
  34080. handleCompositionStart,
  34081. handleCompositionUpdate,
  34082. handleCompositionEnd,
  34083. focus,
  34084. blur
  34085. };
  34086. }
  34087. //#endregion
  34088. //#region ../../packages/components/input-tag/src/composables/use-input-tag-dom.ts
  34089. function useInputTagDom({ props, isFocused, hovering, disabled, inputValue, size, validateState, validateIcon, needStatusIcon }) {
  34090. const attrs = useAttrs$1();
  34091. const slots = useSlots();
  34092. const ns = useNamespace("input-tag");
  34093. const nsInput = useNamespace("input");
  34094. const collapseItemRef = ref();
  34095. const innerRef = ref();
  34096. const containerKls = computed(() => [
  34097. ns.b(),
  34098. ns.is("focused", isFocused.value),
  34099. ns.is("hovering", hovering.value),
  34100. ns.is("disabled", disabled.value),
  34101. ns.m(size.value),
  34102. ns.e("wrapper"),
  34103. attrs.class
  34104. ]);
  34105. const containerStyle = computed(() => [attrs.style]);
  34106. const innerKls = computed(() => [
  34107. ns.e("inner"),
  34108. ns.is("draggable", props.draggable),
  34109. ns.is("left-space", !props.modelValue?.length && !slots.prefix),
  34110. ns.is("right-space", !props.modelValue?.length && !showSuffix.value)
  34111. ]);
  34112. const showClear = computed(() => {
  34113. return props.clearable && !disabled.value && !props.readonly && (props.modelValue?.length || inputValue.value) && (isFocused.value || hovering.value);
  34114. });
  34115. const showSuffix = computed(() => {
  34116. return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
  34117. });
  34118. const states = reactive({
  34119. innerWidth: 0,
  34120. collapseItemWidth: 0
  34121. });
  34122. const getGapWidth = () => {
  34123. if (!innerRef.value) return 0;
  34124. const style = window.getComputedStyle(innerRef.value);
  34125. return Number.parseFloat(style.gap || "6px");
  34126. };
  34127. const resetInnerWidth = () => {
  34128. states.innerWidth = Number.parseFloat(window.getComputedStyle(innerRef.value).width);
  34129. };
  34130. const resetCollapseItemWidth = () => {
  34131. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  34132. };
  34133. const tagStyle = computed(() => {
  34134. if (!props.collapseTags) return {};
  34135. const gapWidth = getGapWidth();
  34136. const inputSlotWidth = gapWidth + MINIMUM_INPUT_WIDTH;
  34137. const maxWidth = collapseItemRef.value && props.maxCollapseTags === 1 ? states.innerWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.innerWidth - inputSlotWidth;
  34138. return { maxWidth: `${Math.max(maxWidth, 0)}px` };
  34139. });
  34140. useResizeObserver(innerRef, resetInnerWidth);
  34141. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  34142. return {
  34143. ns,
  34144. nsInput,
  34145. containerKls,
  34146. containerStyle,
  34147. innerKls,
  34148. showClear,
  34149. showSuffix,
  34150. tagStyle,
  34151. collapseItemRef,
  34152. innerRef
  34153. };
  34154. }
  34155. //#endregion
  34156. //#region ../../packages/components/input-tag/src/input-tag.vue?vue&type=script&setup=true&lang.ts
  34157. const _hoisted_1$32 = [
  34158. "id",
  34159. "minlength",
  34160. "maxlength",
  34161. "disabled",
  34162. "readonly",
  34163. "autocomplete",
  34164. "tabindex",
  34165. "placeholder",
  34166. "autofocus",
  34167. "ariaLabel"
  34168. ];
  34169. const _hoisted_2$19 = ["textContent"];
  34170. var input_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  34171. name: "ElInputTag",
  34172. inheritAttrs: false,
  34173. __name: "input-tag",
  34174. props: inputTagProps,
  34175. emits: inputTagEmits,
  34176. setup(__props, { expose: __expose, emit: __emit }) {
  34177. const props = __props;
  34178. const emit = __emit;
  34179. const attrs = useAttrs();
  34180. const slots = useSlots();
  34181. const { form, formItem } = useFormItem();
  34182. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  34183. const needStatusIcon = computed(() => form?.statusIcon ?? false);
  34184. const validateState = computed(() => formItem?.validateState || "");
  34185. const validateIcon = computed(() => {
  34186. return validateState.value && ValidateComponentsMap[validateState.value];
  34187. });
  34188. const { inputRef, wrapperRef, tagTooltipRef, isFocused, inputValue, size, tagSize, placeholder, closable, disabled, showTagList, collapseTagList, handleDragged, handlePaste, handleInput, handleKeydown, handleKeyup, handleRemoveTag, handleClear, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd, focus, blur } = useInputTag({
  34189. props,
  34190. emit,
  34191. formItem
  34192. });
  34193. const { hovering, handleMouseEnter, handleMouseLeave } = useHovering();
  34194. const { calculatorRef, inputStyle } = useCalcInputWidth();
  34195. const { dropIndicatorRef, showDropIndicator, handleDragStart, handleDragOver, handleDragEnd } = useDragTag({
  34196. wrapperRef,
  34197. handleDragged,
  34198. afterDragged: focus
  34199. });
  34200. const { ns, nsInput, containerKls, containerStyle, innerKls, showClear, showSuffix, tagStyle, collapseItemRef, innerRef } = useInputTagDom({
  34201. props,
  34202. hovering,
  34203. isFocused,
  34204. inputValue,
  34205. disabled,
  34206. size,
  34207. validateState,
  34208. validateIcon,
  34209. needStatusIcon
  34210. });
  34211. __expose({
  34212. focus,
  34213. blur
  34214. });
  34215. return (_ctx, _cache) => {
  34216. return openBlock(), createElementBlock("div", {
  34217. ref_key: "wrapperRef",
  34218. ref: wrapperRef,
  34219. class: normalizeClass(unref(containerKls)),
  34220. style: normalizeStyle(unref(containerStyle)),
  34221. onMouseenter: _cache[9] || (_cache[9] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
  34222. onMouseleave: _cache[10] || (_cache[10] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args))
  34223. }, [
  34224. unref(slots).prefix ? (openBlock(), createElementBlock("div", {
  34225. key: 0,
  34226. class: normalizeClass(unref(ns).e("prefix"))
  34227. }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true),
  34228. createElementVNode("div", {
  34229. ref_key: "innerRef",
  34230. ref: innerRef,
  34231. class: normalizeClass(unref(innerKls))
  34232. }, [
  34233. (openBlock(true), createElementBlock(Fragment, null, renderList(unref(showTagList), (item, index) => {
  34234. return openBlock(), createBlock(unref(ElTag), {
  34235. key: index,
  34236. size: unref(tagSize),
  34237. closable: unref(closable),
  34238. type: __props.tagType,
  34239. effect: __props.tagEffect,
  34240. draggable: unref(closable) && __props.draggable,
  34241. style: normalizeStyle(unref(tagStyle)),
  34242. "disable-transitions": "",
  34243. onClose: ($event) => unref(handleRemoveTag)(index),
  34244. onDragstart: (event) => unref(handleDragStart)(event, index),
  34245. onDragover: (event) => unref(handleDragOver)(event, index),
  34246. onDragend: unref(handleDragEnd),
  34247. onDrop: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  34248. }, {
  34249. default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
  34250. value: item,
  34251. index
  34252. }, () => [createTextVNode(toDisplayString(item), 1)])]),
  34253. _: 2
  34254. }, 1032, [
  34255. "size",
  34256. "closable",
  34257. "type",
  34258. "effect",
  34259. "draggable",
  34260. "style",
  34261. "onClose",
  34262. "onDragstart",
  34263. "onDragover",
  34264. "onDragend"
  34265. ]);
  34266. }), 128)),
  34267. __props.collapseTags && __props.modelValue && __props.modelValue.length > __props.maxCollapseTags ? (openBlock(), createBlock(unref(ElTooltip), {
  34268. key: 0,
  34269. ref_key: "tagTooltipRef",
  34270. ref: tagTooltipRef,
  34271. disabled: !__props.collapseTagsTooltip,
  34272. "fallback-placements": [
  34273. "bottom",
  34274. "top",
  34275. "right",
  34276. "left"
  34277. ],
  34278. effect: __props.effect,
  34279. placement: "bottom"
  34280. }, {
  34281. default: withCtx(() => [createElementVNode("div", {
  34282. ref_key: "collapseItemRef",
  34283. ref: collapseItemRef,
  34284. class: normalizeClass(unref(ns).e("collapse-tag"))
  34285. }, [createVNode(unref(ElTag), {
  34286. closable: false,
  34287. size: unref(tagSize),
  34288. type: __props.tagType,
  34289. effect: __props.tagEffect,
  34290. "disable-transitions": ""
  34291. }, {
  34292. default: withCtx(() => [createTextVNode(" + " + toDisplayString(__props.modelValue.length - __props.maxCollapseTags), 1)]),
  34293. _: 1
  34294. }, 8, [
  34295. "size",
  34296. "type",
  34297. "effect"
  34298. ])], 2)]),
  34299. content: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(ns).e("input-tag-list")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(collapseTagList), (item, index) => {
  34300. return openBlock(), createBlock(unref(ElTag), {
  34301. key: index,
  34302. size: unref(tagSize),
  34303. closable: unref(closable),
  34304. type: __props.tagType,
  34305. effect: __props.tagEffect,
  34306. "disable-transitions": "",
  34307. onClose: ($event) => unref(handleRemoveTag)(index + __props.maxCollapseTags)
  34308. }, {
  34309. default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
  34310. value: item,
  34311. index: index + __props.maxCollapseTags
  34312. }, () => [createTextVNode(toDisplayString(item), 1)])]),
  34313. _: 2
  34314. }, 1032, [
  34315. "size",
  34316. "closable",
  34317. "type",
  34318. "effect",
  34319. "onClose"
  34320. ]);
  34321. }), 128))], 2)]),
  34322. _: 3
  34323. }, 8, ["disabled", "effect"])) : createCommentVNode("v-if", true),
  34324. createElementVNode("div", { class: normalizeClass(unref(ns).e("input-wrapper")) }, [withDirectives(createElementVNode("input", mergeProps({
  34325. id: unref(inputId),
  34326. ref_key: "inputRef",
  34327. ref: inputRef,
  34328. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(inputValue) ? inputValue.value = $event : null)
  34329. }, unref(attrs), {
  34330. type: "text",
  34331. minlength: __props.minlength,
  34332. maxlength: __props.maxlength,
  34333. disabled: unref(disabled),
  34334. readonly: __props.readonly,
  34335. autocomplete: __props.autocomplete,
  34336. tabindex: __props.tabindex,
  34337. placeholder: unref(placeholder),
  34338. autofocus: __props.autofocus,
  34339. ariaLabel: __props.ariaLabel,
  34340. class: unref(ns).e("input"),
  34341. style: unref(inputStyle),
  34342. onCompositionstart: _cache[2] || (_cache[2] = (...args) => unref(handleCompositionStart) && unref(handleCompositionStart)(...args)),
  34343. onCompositionupdate: _cache[3] || (_cache[3] = (...args) => unref(handleCompositionUpdate) && unref(handleCompositionUpdate)(...args)),
  34344. onCompositionend: _cache[4] || (_cache[4] = (...args) => unref(handleCompositionEnd) && unref(handleCompositionEnd)(...args)),
  34345. onPaste: _cache[5] || (_cache[5] = (...args) => unref(handlePaste) && unref(handlePaste)(...args)),
  34346. onInput: _cache[6] || (_cache[6] = (...args) => unref(handleInput) && unref(handleInput)(...args)),
  34347. onKeydown: _cache[7] || (_cache[7] = (...args) => unref(handleKeydown) && unref(handleKeydown)(...args)),
  34348. onKeyup: _cache[8] || (_cache[8] = (...args) => unref(handleKeyup) && unref(handleKeyup)(...args))
  34349. }), null, 16, _hoisted_1$32), [[vModelText, unref(inputValue)]]), createElementVNode("span", {
  34350. ref_key: "calculatorRef",
  34351. ref: calculatorRef,
  34352. "aria-hidden": "true",
  34353. class: normalizeClass(unref(ns).e("input-calculator")),
  34354. textContent: toDisplayString(unref(inputValue))
  34355. }, null, 10, _hoisted_2$19)], 2),
  34356. withDirectives(createElementVNode("div", {
  34357. ref_key: "dropIndicatorRef",
  34358. ref: dropIndicatorRef,
  34359. class: normalizeClass(unref(ns).e("drop-indicator"))
  34360. }, null, 2), [[vShow, unref(showDropIndicator)]])
  34361. ], 2),
  34362. unref(showSuffix) ? (openBlock(), createElementBlock("div", {
  34363. key: 1,
  34364. class: normalizeClass(unref(ns).e("suffix"))
  34365. }, [
  34366. renderSlot(_ctx.$slots, "suffix"),
  34367. unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
  34368. key: 0,
  34369. class: normalizeClass([unref(ns).e("icon"), unref(ns).e("clear")]),
  34370. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  34371. onClick: unref(handleClear)
  34372. }, {
  34373. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.clearIcon)))]),
  34374. _: 1
  34375. }, 8, [
  34376. "class",
  34377. "onMousedown",
  34378. "onClick"
  34379. ])) : createCommentVNode("v-if", true),
  34380. validateState.value && validateIcon.value && needStatusIcon.value ? (openBlock(), createBlock(unref(ElIcon), {
  34381. key: 1,
  34382. class: normalizeClass([
  34383. unref(nsInput).e("icon"),
  34384. unref(nsInput).e("validateIcon"),
  34385. unref(nsInput).is("loading", validateState.value === "validating")
  34386. ])
  34387. }, {
  34388. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(validateIcon.value)))]),
  34389. _: 1
  34390. }, 8, ["class"])) : createCommentVNode("v-if", true)
  34391. ], 2)) : createCommentVNode("v-if", true)
  34392. ], 38);
  34393. };
  34394. }
  34395. });
  34396. //#endregion
  34397. //#region ../../packages/components/input-tag/src/input-tag.vue
  34398. var input_tag_default = input_tag_vue_vue_type_script_setup_true_lang_default;
  34399. //#endregion
  34400. //#region ../../packages/components/input-tag/index.ts
  34401. const ElInputTag = withInstall(input_tag_default);
  34402. //#endregion
  34403. //#region ../../packages/components/link/src/link.ts
  34404. /**
  34405. * @deprecated Removed after 3.0.0, Use `LinkProps` instead.
  34406. */
  34407. const linkProps = buildProps({
  34408. type: {
  34409. type: String,
  34410. values: [
  34411. "primary",
  34412. "success",
  34413. "warning",
  34414. "info",
  34415. "danger",
  34416. "default"
  34417. ],
  34418. default: void 0
  34419. },
  34420. underline: {
  34421. type: [Boolean, String],
  34422. values: [
  34423. true,
  34424. false,
  34425. "always",
  34426. "never",
  34427. "hover"
  34428. ],
  34429. default: void 0
  34430. },
  34431. disabled: Boolean,
  34432. href: {
  34433. type: String,
  34434. default: ""
  34435. },
  34436. target: {
  34437. type: String,
  34438. default: "_self"
  34439. },
  34440. icon: { type: iconPropType }
  34441. });
  34442. const linkEmits = { click: (evt) => evt instanceof MouseEvent };
  34443. //#endregion
  34444. //#region ../../packages/components/link/src/link.vue?vue&type=script&setup=true&lang.ts
  34445. const _hoisted_1$31 = ["href", "target"];
  34446. var link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  34447. name: "ElLink",
  34448. __name: "link",
  34449. props: linkProps,
  34450. emits: linkEmits,
  34451. setup(__props, { emit: __emit }) {
  34452. const props = __props;
  34453. const emit = __emit;
  34454. const globalConfig = useGlobalConfig("link");
  34455. useDeprecated({
  34456. scope: "el-link",
  34457. from: "The underline option (boolean)",
  34458. replacement: "'always' | 'hover' | 'never'",
  34459. version: "3.0.0",
  34460. ref: "https://element-plus.org/en-US/component/link.html#underline"
  34461. }, computed(() => isBoolean(props.underline)));
  34462. const ns = useNamespace("link");
  34463. const linkKls = computed(() => [
  34464. ns.b(),
  34465. ns.m(props.type ?? globalConfig.value?.type ?? "default"),
  34466. ns.is("disabled", props.disabled),
  34467. ns.is("underline", underline.value === "always"),
  34468. ns.is("hover-underline", underline.value === "hover" && !props.disabled)
  34469. ]);
  34470. const underline = computed(() => {
  34471. if (isBoolean(props.underline)) return props.underline ? "hover" : "never";
  34472. else return props.underline ?? globalConfig.value?.underline ?? "hover";
  34473. });
  34474. function handleClick(event) {
  34475. if (!props.disabled) emit("click", event);
  34476. }
  34477. return (_ctx, _cache) => {
  34478. return openBlock(), createElementBlock("a", {
  34479. class: normalizeClass(linkKls.value),
  34480. href: __props.disabled || !__props.href ? void 0 : __props.href,
  34481. target: __props.disabled || !__props.href ? void 0 : __props.target,
  34482. onClick: handleClick
  34483. }, [
  34484. __props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  34485. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  34486. _: 1
  34487. })) : createCommentVNode("v-if", true),
  34488. _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
  34489. key: 1,
  34490. class: normalizeClass(unref(ns).e("inner"))
  34491. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true),
  34492. _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true)
  34493. ], 10, _hoisted_1$31);
  34494. };
  34495. }
  34496. });
  34497. //#endregion
  34498. //#region ../../packages/components/link/src/link.vue
  34499. var link_default = link_vue_vue_type_script_setup_true_lang_default;
  34500. //#endregion
  34501. //#region ../../packages/components/link/index.ts
  34502. const ElLink = withInstall(link_default);
  34503. //#endregion
  34504. //#region ../../packages/components/menu/src/utils/submenu.ts
  34505. var SubMenu = class {
  34506. constructor(parent, domNode) {
  34507. this.parent = parent;
  34508. this.domNode = domNode;
  34509. this.subIndex = 0;
  34510. this.subIndex = 0;
  34511. this.init();
  34512. }
  34513. init() {
  34514. this.subMenuItems = this.domNode.querySelectorAll("li");
  34515. this.addListeners();
  34516. }
  34517. gotoSubIndex(idx) {
  34518. if (idx === this.subMenuItems.length) idx = 0;
  34519. else if (idx < 0) idx = this.subMenuItems.length - 1;
  34520. this.subMenuItems[idx].focus();
  34521. this.subIndex = idx;
  34522. }
  34523. addListeners() {
  34524. const parentNode = this.parent.domNode;
  34525. Array.prototype.forEach.call(this.subMenuItems, (el) => {
  34526. el.addEventListener("keydown", (event) => {
  34527. const code = getEventCode(event);
  34528. let prevDef = false;
  34529. switch (code) {
  34530. case EVENT_CODE.down:
  34531. this.gotoSubIndex(this.subIndex + 1);
  34532. prevDef = true;
  34533. break;
  34534. case EVENT_CODE.up:
  34535. this.gotoSubIndex(this.subIndex - 1);
  34536. prevDef = true;
  34537. break;
  34538. case EVENT_CODE.tab:
  34539. triggerEvent(parentNode, "mouseleave");
  34540. break;
  34541. case EVENT_CODE.enter:
  34542. case EVENT_CODE.numpadEnter:
  34543. case EVENT_CODE.space:
  34544. prevDef = true;
  34545. event.currentTarget.click();
  34546. break;
  34547. }
  34548. if (prevDef) {
  34549. event.preventDefault();
  34550. event.stopPropagation();
  34551. }
  34552. return false;
  34553. });
  34554. });
  34555. }
  34556. };
  34557. //#endregion
  34558. //#region ../../packages/components/menu/src/utils/menu-item.ts
  34559. var MenuItem = class {
  34560. constructor(domNode, namespace) {
  34561. this.domNode = domNode;
  34562. this.submenu = null;
  34563. this.submenu = null;
  34564. this.init(namespace);
  34565. }
  34566. init(namespace) {
  34567. this.domNode.setAttribute("tabindex", "0");
  34568. const menuChild = this.domNode.querySelector(`.${namespace}-menu`);
  34569. if (menuChild) this.submenu = new SubMenu(this, menuChild);
  34570. this.addListeners();
  34571. }
  34572. addListeners() {
  34573. this.domNode.addEventListener("keydown", (event) => {
  34574. const code = getEventCode(event);
  34575. let prevDef = false;
  34576. switch (code) {
  34577. case EVENT_CODE.down:
  34578. triggerEvent(event.currentTarget, "mouseenter");
  34579. this.submenu && this.submenu.gotoSubIndex(0);
  34580. prevDef = true;
  34581. break;
  34582. case EVENT_CODE.up:
  34583. triggerEvent(event.currentTarget, "mouseenter");
  34584. this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
  34585. prevDef = true;
  34586. break;
  34587. case EVENT_CODE.tab:
  34588. triggerEvent(event.currentTarget, "mouseleave");
  34589. break;
  34590. case EVENT_CODE.enter:
  34591. case EVENT_CODE.numpadEnter:
  34592. case EVENT_CODE.space:
  34593. prevDef = true;
  34594. event.currentTarget.click();
  34595. break;
  34596. }
  34597. if (prevDef) event.preventDefault();
  34598. });
  34599. }
  34600. };
  34601. //#endregion
  34602. //#region ../../packages/components/menu/src/utils/menu-bar.ts
  34603. var Menu = class {
  34604. constructor(domNode, namespace) {
  34605. this.domNode = domNode;
  34606. this.init(namespace);
  34607. }
  34608. init(namespace) {
  34609. const menuChildren = this.domNode.childNodes;
  34610. Array.from(menuChildren).forEach((child) => {
  34611. if (child.nodeType === 1) new MenuItem(child, namespace);
  34612. });
  34613. }
  34614. };
  34615. //#endregion
  34616. //#region ../../packages/components/menu/src/menu-collapse-transition.vue?vue&type=script&setup=true&lang.ts
  34617. var menu_collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  34618. name: "ElMenuCollapseTransition",
  34619. __name: "menu-collapse-transition",
  34620. setup(__props) {
  34621. const ns = useNamespace("menu");
  34622. const listeners = {
  34623. onBeforeEnter: (el) => el.style.opacity = "0.2",
  34624. onEnter(el, done) {
  34625. addClass(el, `${ns.namespace.value}-opacity-transition`);
  34626. el.style.opacity = "1";
  34627. done();
  34628. },
  34629. onAfterEnter(el) {
  34630. removeClass(el, `${ns.namespace.value}-opacity-transition`);
  34631. el.style.opacity = "";
  34632. },
  34633. onBeforeLeave(el) {
  34634. if (!el.dataset) el.dataset = {};
  34635. if (hasClass(el, ns.m("collapse"))) {
  34636. removeClass(el, ns.m("collapse"));
  34637. el.dataset.oldOverflow = el.style.overflow;
  34638. el.dataset.scrollWidth = el.clientWidth.toString();
  34639. addClass(el, ns.m("collapse"));
  34640. } else {
  34641. addClass(el, ns.m("collapse"));
  34642. el.dataset.oldOverflow = el.style.overflow;
  34643. el.dataset.scrollWidth = el.clientWidth.toString();
  34644. removeClass(el, ns.m("collapse"));
  34645. }
  34646. el.style.width = `${el.scrollWidth}px`;
  34647. el.style.overflow = "hidden";
  34648. },
  34649. onLeave(el) {
  34650. addClass(el, "horizontal-collapse-transition");
  34651. el.style.width = `${el.dataset.scrollWidth}px`;
  34652. }
  34653. };
  34654. return (_ctx, _cache) => {
  34655. return openBlock(), createBlock(Transition, mergeProps({ mode: "out-in" }, listeners), {
  34656. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  34657. _: 3
  34658. }, 16);
  34659. };
  34660. }
  34661. });
  34662. //#endregion
  34663. //#region ../../packages/components/menu/src/menu-collapse-transition.vue
  34664. var menu_collapse_transition_default = menu_collapse_transition_vue_vue_type_script_setup_true_lang_default;
  34665. //#endregion
  34666. //#region ../../packages/components/menu/src/use-menu.ts
  34667. function useMenu(instance, currentIndex) {
  34668. const indexPath = computed(() => {
  34669. let parent = instance.parent;
  34670. const path = [currentIndex.value];
  34671. while (parent.type.name !== "ElMenu") {
  34672. if (parent.props.index) path.unshift(parent.props.index);
  34673. parent = parent.parent;
  34674. }
  34675. return path;
  34676. });
  34677. return {
  34678. parentMenu: computed(() => {
  34679. let parent = instance.parent;
  34680. while (parent && !["ElMenu", "ElSubMenu"].includes(parent.type.name)) parent = parent.parent;
  34681. return parent;
  34682. }),
  34683. indexPath
  34684. };
  34685. }
  34686. //#endregion
  34687. //#region ../../packages/components/menu/src/use-menu-color.ts
  34688. function useMenuColor(props) {
  34689. return computed(() => {
  34690. const color = props.backgroundColor;
  34691. return color ? new TinyColor(color).shade(20).toString() : "";
  34692. });
  34693. }
  34694. //#endregion
  34695. //#region ../../packages/components/menu/src/use-menu-css-var.ts
  34696. const useMenuCssVar = (props, level) => {
  34697. const ns = useNamespace("menu");
  34698. return computed(() => ns.cssVarBlock({
  34699. "text-color": props.textColor || "",
  34700. "hover-text-color": props.textColor || "",
  34701. "bg-color": props.backgroundColor || "",
  34702. "hover-bg-color": useMenuColor(props).value || "",
  34703. "active-color": props.activeTextColor || "",
  34704. level: `${level}`
  34705. }));
  34706. };
  34707. //#endregion
  34708. //#region ../../packages/components/menu/src/tokens.ts
  34709. const MENU_INJECTION_KEY = "rootMenu";
  34710. const SUB_MENU_INJECTION_KEY = "subMenu:";
  34711. //#endregion
  34712. //#region ../../packages/components/menu/src/sub-menu.ts
  34713. const subMenuProps = buildProps({
  34714. index: {
  34715. type: String,
  34716. required: true
  34717. },
  34718. showTimeout: Number,
  34719. hideTimeout: Number,
  34720. popperClass: String,
  34721. popperStyle: { type: definePropType([String, Object]) },
  34722. disabled: Boolean,
  34723. teleported: {
  34724. type: Boolean,
  34725. default: void 0
  34726. },
  34727. popperOffset: Number,
  34728. expandCloseIcon: { type: iconPropType },
  34729. expandOpenIcon: { type: iconPropType },
  34730. collapseCloseIcon: { type: iconPropType },
  34731. collapseOpenIcon: { type: iconPropType }
  34732. });
  34733. const COMPONENT_NAME$8 = "ElSubMenu";
  34734. var sub_menu_default = defineComponent({
  34735. name: COMPONENT_NAME$8,
  34736. props: subMenuProps,
  34737. setup(props, { slots, expose }) {
  34738. const instance = getCurrentInstance();
  34739. const { indexPath, parentMenu } = useMenu(instance, computed(() => props.index));
  34740. const nsMenu = useNamespace("menu");
  34741. const nsSubMenu = useNamespace("sub-menu");
  34742. const rootMenu = inject(MENU_INJECTION_KEY);
  34743. if (!rootMenu) throwError(COMPONENT_NAME$8, "can not inject root menu");
  34744. const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
  34745. if (!subMenu) throwError(COMPONENT_NAME$8, "can not inject sub menu");
  34746. const items = ref({});
  34747. const subMenus = ref({});
  34748. let timeout;
  34749. const mouseInChild = ref(false);
  34750. const verticalTitleRef = ref();
  34751. const vPopper = ref();
  34752. const isFirstLevel = computed(() => subMenu.level === 0);
  34753. const currentPlacement = computed(() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start");
  34754. const subMenuTitleIcon = computed(() => {
  34755. if (mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse) {
  34756. if (props.expandCloseIcon && props.expandOpenIcon) return opened.value ? props.expandOpenIcon : props.expandCloseIcon;
  34757. return arrow_down_default;
  34758. } else {
  34759. if (props.collapseCloseIcon && props.collapseOpenIcon) return opened.value ? props.collapseOpenIcon : props.collapseCloseIcon;
  34760. return arrow_right_default;
  34761. }
  34762. });
  34763. const appendToBody = computed(() => {
  34764. const value = props.teleported;
  34765. return isUndefined(value) ? isFirstLevel.value : value;
  34766. });
  34767. const menuTransitionName = computed(() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`);
  34768. const fallbackPlacements = computed(() => mode.value === "horizontal" && isFirstLevel.value ? [
  34769. "bottom-start",
  34770. "bottom-end",
  34771. "top-start",
  34772. "top-end",
  34773. "right-start",
  34774. "left-start"
  34775. ] : [
  34776. "right-start",
  34777. "right",
  34778. "right-end",
  34779. "left-start",
  34780. "bottom-start",
  34781. "bottom-end",
  34782. "top-start",
  34783. "top-end"
  34784. ]);
  34785. const opened = computed(() => rootMenu.openedMenus.includes(props.index));
  34786. const active = computed(() => [...Object.values(items.value), ...Object.values(subMenus.value)].some(({ active }) => active));
  34787. const mode = computed(() => rootMenu.props.mode);
  34788. const persistent = computed(() => rootMenu.props.persistent);
  34789. const item = reactive({
  34790. index: props.index,
  34791. indexPath,
  34792. active
  34793. });
  34794. const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1);
  34795. const subMenuPopperOffset = computed(() => props.popperOffset ?? rootMenu.props.popperOffset);
  34796. const subMenuPopperClass = computed(() => props.popperClass ?? rootMenu.props.popperClass);
  34797. const subMenuPopperStyle = computed(() => props.popperStyle ?? rootMenu.props.popperStyle);
  34798. const subMenuShowTimeout = computed(() => props.showTimeout ?? rootMenu.props.showTimeout);
  34799. const subMenuHideTimeout = computed(() => props.hideTimeout ?? rootMenu.props.hideTimeout);
  34800. const doDestroy = () => vPopper.value?.popperRef?.popperInstanceRef?.destroy();
  34801. const handleCollapseToggle = (value) => {
  34802. if (!value) doDestroy();
  34803. };
  34804. const handleClick = () => {
  34805. if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled) return;
  34806. rootMenu.handleSubMenuClick({
  34807. index: props.index,
  34808. indexPath: indexPath.value,
  34809. active: active.value
  34810. });
  34811. };
  34812. const handleMouseenter = (event, showTimeout = subMenuShowTimeout.value) => {
  34813. if (event.type === "focus") return;
  34814. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled) {
  34815. subMenu.mouseInChild.value = true;
  34816. return;
  34817. }
  34818. subMenu.mouseInChild.value = true;
  34819. timeout?.();
  34820. ({stop: timeout} = useTimeoutFn(() => {
  34821. rootMenu.openMenu(props.index, indexPath.value);
  34822. }, showTimeout));
  34823. if (appendToBody.value) parentMenu.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter"));
  34824. if (event.type === "mouseenter" && event.target) nextTick(() => {
  34825. focusElement(event.target, { preventScroll: true });
  34826. });
  34827. };
  34828. const handleMouseleave = (deepDispatch = false) => {
  34829. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") {
  34830. subMenu.mouseInChild.value = false;
  34831. return;
  34832. }
  34833. timeout?.();
  34834. subMenu.mouseInChild.value = false;
  34835. ({stop: timeout} = useTimeoutFn(() => !mouseInChild.value && rootMenu.closeMenu(props.index, indexPath.value), subMenuHideTimeout.value));
  34836. if (appendToBody.value && deepDispatch) subMenu.handleMouseleave?.(true);
  34837. };
  34838. watch(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value)));
  34839. {
  34840. const addSubMenu = (item) => {
  34841. subMenus.value[item.index] = item;
  34842. };
  34843. const removeSubMenu = (item) => {
  34844. delete subMenus.value[item.index];
  34845. };
  34846. provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
  34847. addSubMenu,
  34848. removeSubMenu,
  34849. handleMouseleave,
  34850. mouseInChild,
  34851. level: subMenu.level + 1
  34852. });
  34853. }
  34854. expose({ opened });
  34855. onMounted(() => {
  34856. rootMenu.addSubMenu(item);
  34857. subMenu.addSubMenu(item);
  34858. });
  34859. onBeforeUnmount(() => {
  34860. subMenu.removeSubMenu(item);
  34861. rootMenu.removeSubMenu(item);
  34862. });
  34863. return () => {
  34864. const titleTag = [slots.title?.(), h(ElIcon, {
  34865. class: nsSubMenu.e("icon-arrow"),
  34866. style: { transform: opened.value ? props.expandCloseIcon && props.expandOpenIcon || props.collapseCloseIcon && props.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none" }
  34867. }, { default: () => isString(subMenuTitleIcon.value) ? h(instance.appContext.components[subMenuTitleIcon.value]) : h(subMenuTitleIcon.value) })];
  34868. const child = rootMenu.isMenuPopup ? h(ElTooltip, {
  34869. ref: vPopper,
  34870. visible: opened.value,
  34871. effect: "light",
  34872. pure: true,
  34873. offset: subMenuPopperOffset.value,
  34874. showArrow: false,
  34875. persistent: persistent.value,
  34876. popperClass: subMenuPopperClass.value,
  34877. popperStyle: subMenuPopperStyle.value,
  34878. placement: currentPlacement.value,
  34879. teleported: appendToBody.value,
  34880. fallbackPlacements: fallbackPlacements.value,
  34881. transition: menuTransitionName.value,
  34882. gpuAcceleration: false
  34883. }, {
  34884. content: () => h("div", {
  34885. class: [
  34886. nsMenu.m(mode.value),
  34887. nsMenu.m("popup-container"),
  34888. subMenuPopperClass.value
  34889. ],
  34890. onMouseenter: (evt) => handleMouseenter(evt, 100),
  34891. onMouseleave: () => handleMouseleave(true),
  34892. onFocus: (evt) => handleMouseenter(evt, 100)
  34893. }, [h("ul", {
  34894. class: [
  34895. nsMenu.b(),
  34896. nsMenu.m("popup"),
  34897. nsMenu.m(`popup-${currentPlacement.value}`)
  34898. ],
  34899. style: ulStyle.value
  34900. }, [slots.default?.()])]),
  34901. default: () => h("div", {
  34902. class: nsSubMenu.e("title"),
  34903. onClick: handleClick
  34904. }, titleTag)
  34905. }) : h(Fragment, {}, [h("div", {
  34906. class: nsSubMenu.e("title"),
  34907. ref: verticalTitleRef,
  34908. onClick: handleClick
  34909. }, titleTag), h(ElCollapseTransition, {}, { default: () => withDirectives(h("ul", {
  34910. role: "menu",
  34911. class: [nsMenu.b(), nsMenu.m("inline")],
  34912. style: ulStyle.value
  34913. }, [slots.default?.()]), [[vShow, opened.value]]) })]);
  34914. return h("li", {
  34915. class: [
  34916. nsSubMenu.b(),
  34917. nsSubMenu.is("active", active.value),
  34918. nsSubMenu.is("opened", opened.value),
  34919. nsSubMenu.is("disabled", props.disabled)
  34920. ],
  34921. role: "menuitem",
  34922. ariaHaspopup: true,
  34923. ariaExpanded: opened.value,
  34924. onMouseenter: handleMouseenter,
  34925. onMouseleave: () => handleMouseleave(),
  34926. onFocus: handleMouseenter
  34927. }, [child]);
  34928. };
  34929. }
  34930. });
  34931. //#endregion
  34932. //#region ../../packages/components/menu/src/menu.ts
  34933. const menuProps = buildProps({
  34934. mode: {
  34935. type: String,
  34936. values: ["horizontal", "vertical"],
  34937. default: "vertical"
  34938. },
  34939. defaultActive: {
  34940. type: String,
  34941. default: ""
  34942. },
  34943. defaultOpeneds: {
  34944. type: definePropType(Array),
  34945. default: () => mutable([])
  34946. },
  34947. uniqueOpened: Boolean,
  34948. router: Boolean,
  34949. menuTrigger: {
  34950. type: String,
  34951. values: ["hover", "click"],
  34952. default: "hover"
  34953. },
  34954. collapse: Boolean,
  34955. backgroundColor: String,
  34956. textColor: String,
  34957. activeTextColor: String,
  34958. closeOnClickOutside: Boolean,
  34959. collapseTransition: {
  34960. type: Boolean,
  34961. default: true
  34962. },
  34963. ellipsis: {
  34964. type: Boolean,
  34965. default: true
  34966. },
  34967. popperOffset: {
  34968. type: Number,
  34969. default: 6
  34970. },
  34971. ellipsisIcon: {
  34972. type: iconPropType,
  34973. default: () => more_default
  34974. },
  34975. popperEffect: {
  34976. type: definePropType(String),
  34977. default: "dark"
  34978. },
  34979. popperClass: String,
  34980. popperStyle: { type: definePropType([String, Object]) },
  34981. showTimeout: {
  34982. type: Number,
  34983. default: 300
  34984. },
  34985. hideTimeout: {
  34986. type: Number,
  34987. default: 300
  34988. },
  34989. persistent: {
  34990. type: Boolean,
  34991. default: true
  34992. }
  34993. });
  34994. const checkIndexPath = (indexPath) => isArray$1(indexPath) && indexPath.every((path) => isString(path));
  34995. const menuEmits = {
  34996. close: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  34997. open: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  34998. select: (index, indexPath, item, routerResult) => isString(index) && checkIndexPath(indexPath) && isObject$1(item) && (isUndefined(routerResult) || routerResult instanceof Promise)
  34999. };
  35000. const DEFAULT_MORE_ITEM_WIDTH = 64;
  35001. var menu_default = defineComponent({
  35002. name: "ElMenu",
  35003. props: menuProps,
  35004. emits: menuEmits,
  35005. setup(props, { emit, slots, expose }) {
  35006. const instance = getCurrentInstance();
  35007. const router = instance.appContext.config.globalProperties.$router;
  35008. const menu = ref();
  35009. const subMenu = ref();
  35010. const nsMenu = useNamespace("menu");
  35011. const nsSubMenu = useNamespace("sub-menu");
  35012. let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH;
  35013. const sliceIndex = ref(-1);
  35014. const openedMenus = ref(props.defaultOpeneds && !props.collapse ? props.defaultOpeneds.slice(0) : []);
  35015. const activeIndex = ref(props.defaultActive);
  35016. const items = ref({});
  35017. const subMenus = ref({});
  35018. const isMenuPopup = computed(() => props.mode === "horizontal" || props.mode === "vertical" && props.collapse);
  35019. const initMenu = () => {
  35020. const activeItem = activeIndex.value && items.value[activeIndex.value];
  35021. if (!activeItem || props.mode === "horizontal" || props.collapse) return;
  35022. activeItem.indexPath.forEach((index) => {
  35023. const subMenu = subMenus.value[index];
  35024. subMenu && openMenu(index, subMenu.indexPath);
  35025. });
  35026. };
  35027. const openMenu = (index, indexPath) => {
  35028. if (openedMenus.value.includes(index)) return;
  35029. if (props.uniqueOpened) openedMenus.value = openedMenus.value.filter((index) => indexPath.includes(index));
  35030. openedMenus.value.push(index);
  35031. emit("open", index, indexPath);
  35032. };
  35033. const close = (index) => {
  35034. const i = openedMenus.value.indexOf(index);
  35035. if (i !== -1) openedMenus.value.splice(i, 1);
  35036. };
  35037. const closeMenu = (index, indexPath) => {
  35038. close(index);
  35039. emit("close", index, indexPath);
  35040. };
  35041. const handleSubMenuClick = ({ index, indexPath }) => {
  35042. openedMenus.value.includes(index) ? closeMenu(index, indexPath) : openMenu(index, indexPath);
  35043. };
  35044. const handleMenuItemClick = (menuItem) => {
  35045. if (props.mode === "horizontal" || props.collapse) openedMenus.value = [];
  35046. const { index, indexPath } = menuItem;
  35047. if (isNil(index) || isNil(indexPath)) return;
  35048. if (props.router && router) {
  35049. const route = menuItem.route || index;
  35050. const routerResult = router.push(route).then((res) => {
  35051. if (!res) activeIndex.value = index;
  35052. return res;
  35053. });
  35054. emit("select", index, indexPath, {
  35055. index,
  35056. indexPath,
  35057. route
  35058. }, routerResult);
  35059. } else {
  35060. activeIndex.value = index;
  35061. emit("select", index, indexPath, {
  35062. index,
  35063. indexPath
  35064. });
  35065. }
  35066. };
  35067. const updateActiveIndex = (val) => {
  35068. const itemsInData = items.value;
  35069. activeIndex.value = (itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props.defaultActive])?.index ?? val;
  35070. };
  35071. const calcMenuItemWidth = (menuItem) => {
  35072. const computedStyle = getComputedStyle(menuItem);
  35073. const marginLeft = Number.parseInt(computedStyle.marginLeft, 10);
  35074. const marginRight = Number.parseInt(computedStyle.marginRight, 10);
  35075. return menuItem.offsetWidth + marginLeft + marginRight || 0;
  35076. };
  35077. const calcSliceIndex = () => {
  35078. if (!menu.value) return -1;
  35079. const items = Array.from(menu.value.childNodes).filter((item) => item.nodeName !== "#comment" && (item.nodeName !== "#text" || item.nodeValue));
  35080. const computedMenuStyle = getComputedStyle(menu.value);
  35081. const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10);
  35082. const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10);
  35083. const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight;
  35084. let calcWidth = 0;
  35085. let sliceIndex = 0;
  35086. items.forEach((item, index) => {
  35087. calcWidth += calcMenuItemWidth(item);
  35088. if (calcWidth <= menuWidth - moreItemWidth) sliceIndex = index + 1;
  35089. });
  35090. return sliceIndex === items.length ? -1 : sliceIndex;
  35091. };
  35092. const getIndexPath = (index) => subMenus.value[index].indexPath;
  35093. const debounce = (fn, wait = 33.34) => {
  35094. let timer;
  35095. return () => {
  35096. timer && clearTimeout(timer);
  35097. timer = setTimeout(() => {
  35098. fn();
  35099. }, wait);
  35100. };
  35101. };
  35102. let isFirstTimeRender = true;
  35103. const handleResize = () => {
  35104. const el = unrefElement(subMenu);
  35105. if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH;
  35106. if (sliceIndex.value === calcSliceIndex()) return;
  35107. const callback = () => {
  35108. sliceIndex.value = -1;
  35109. nextTick(() => {
  35110. sliceIndex.value = calcSliceIndex();
  35111. });
  35112. };
  35113. isFirstTimeRender ? callback() : debounce(callback)();
  35114. isFirstTimeRender = false;
  35115. };
  35116. watch(() => props.defaultActive, (currentActive) => {
  35117. if (!items.value[currentActive]) activeIndex.value = "";
  35118. updateActiveIndex(currentActive);
  35119. });
  35120. watch(() => props.collapse, (value) => {
  35121. if (value) openedMenus.value = [];
  35122. });
  35123. watch(items.value, initMenu);
  35124. let resizeStopper;
  35125. watchEffect(() => {
  35126. if (props.mode === "horizontal" && props.ellipsis) resizeStopper = useResizeObserver(menu, handleResize).stop;
  35127. else resizeStopper?.();
  35128. });
  35129. const mouseInChild = ref(false);
  35130. {
  35131. const addSubMenu = (item) => {
  35132. subMenus.value[item.index] = item;
  35133. };
  35134. const removeSubMenu = (item) => {
  35135. delete subMenus.value[item.index];
  35136. };
  35137. const addMenuItem = (item) => {
  35138. items.value[item.index] = item;
  35139. };
  35140. const removeMenuItem = (item) => {
  35141. delete items.value[item.index];
  35142. };
  35143. provide(MENU_INJECTION_KEY, reactive({
  35144. props,
  35145. openedMenus,
  35146. items,
  35147. subMenus,
  35148. activeIndex,
  35149. isMenuPopup,
  35150. addMenuItem,
  35151. removeMenuItem,
  35152. addSubMenu,
  35153. removeSubMenu,
  35154. openMenu,
  35155. closeMenu,
  35156. handleMenuItemClick,
  35157. handleSubMenuClick
  35158. }));
  35159. provide(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
  35160. addSubMenu,
  35161. removeSubMenu,
  35162. mouseInChild,
  35163. level: 0
  35164. });
  35165. }
  35166. onMounted(() => {
  35167. if (props.mode === "horizontal") new Menu(instance.vnode.el, nsMenu.namespace.value);
  35168. });
  35169. {
  35170. const open = (index) => {
  35171. const { indexPath } = subMenus.value[index];
  35172. indexPath.forEach((i) => openMenu(i, indexPath));
  35173. };
  35174. expose({
  35175. open,
  35176. close,
  35177. updateActiveIndex,
  35178. handleResize
  35179. });
  35180. }
  35181. const ulStyle = useMenuCssVar(props, 0);
  35182. return () => {
  35183. let slot = slots.default?.() ?? [];
  35184. const vShowMore = [];
  35185. if (props.mode === "horizontal" && menu.value) {
  35186. const originalSlot = flattedChildren(slot).filter((vnode) => {
  35187. return vnode?.shapeFlag !== 8;
  35188. });
  35189. const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value);
  35190. const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value);
  35191. if (slotMore?.length && props.ellipsis) {
  35192. slot = slotDefault;
  35193. vShowMore.push(h(sub_menu_default, {
  35194. ref: subMenu,
  35195. index: "sub-menu-more",
  35196. class: nsSubMenu.e("hide-arrow"),
  35197. popperOffset: props.popperOffset
  35198. }, {
  35199. title: () => h(ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => h(props.ellipsisIcon) }),
  35200. default: () => slotMore
  35201. }));
  35202. }
  35203. }
  35204. const directives = props.closeOnClickOutside ? [[ClickOutside, () => {
  35205. if (!openedMenus.value.length) return;
  35206. if (!mouseInChild.value) {
  35207. openedMenus.value.forEach((openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu)));
  35208. openedMenus.value = [];
  35209. }
  35210. }]] : [];
  35211. const vMenu = withDirectives(h("ul", {
  35212. key: String(props.collapse),
  35213. role: "menubar",
  35214. ref: menu,
  35215. style: ulStyle.value,
  35216. class: {
  35217. [nsMenu.b()]: true,
  35218. [nsMenu.m(props.mode)]: true,
  35219. [nsMenu.m("collapse")]: props.collapse
  35220. }
  35221. }, [...slot, ...vShowMore]), directives);
  35222. if (props.collapseTransition && props.mode === "vertical") return h(menu_collapse_transition_default, () => vMenu);
  35223. return vMenu;
  35224. };
  35225. }
  35226. });
  35227. //#endregion
  35228. //#region ../../packages/components/menu/src/menu-item.ts
  35229. /**
  35230. * @deprecated Removed after 3.0.0, Use `MenuItemProps` instead.
  35231. */
  35232. const menuItemProps = buildProps({
  35233. index: {
  35234. type: definePropType([String, null]),
  35235. default: null
  35236. },
  35237. route: { type: definePropType([String, Object]) },
  35238. disabled: Boolean
  35239. });
  35240. const menuItemEmits = { click: (item) => isString(item.index) && isArray$1(item.indexPath) };
  35241. //#endregion
  35242. //#region ../../packages/components/menu/src/menu-item.vue?vue&type=script&setup=true&lang.ts
  35243. const COMPONENT_NAME$7 = "ElMenuItem";
  35244. var menu_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35245. name: COMPONENT_NAME$7,
  35246. __name: "menu-item",
  35247. props: menuItemProps,
  35248. emits: menuItemEmits,
  35249. setup(__props, { expose: __expose, emit: __emit }) {
  35250. const props = __props;
  35251. const emit = __emit;
  35252. isPropAbsent(props.index) && /* @__PURE__ */ debugWarn(COMPONENT_NAME$7, "Missing required prop: \"index\"");
  35253. const instance = getCurrentInstance();
  35254. const rootMenu = inject(MENU_INJECTION_KEY);
  35255. const nsMenu = useNamespace("menu");
  35256. const nsMenuItem = useNamespace("menu-item");
  35257. if (!rootMenu) throwError(COMPONENT_NAME$7, "can not inject root menu");
  35258. const { parentMenu, indexPath } = useMenu(instance, toRef(props, "index"));
  35259. const subMenu = inject(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
  35260. if (!subMenu) throwError(COMPONENT_NAME$7, "can not inject sub menu");
  35261. const active = computed(() => props.index === rootMenu.activeIndex);
  35262. const item = reactive({
  35263. index: props.index,
  35264. indexPath,
  35265. active
  35266. });
  35267. const handleClick = () => {
  35268. if (!props.disabled) {
  35269. rootMenu.handleMenuItemClick({
  35270. index: props.index,
  35271. indexPath: indexPath.value,
  35272. route: props.route
  35273. });
  35274. emit("click", item);
  35275. }
  35276. };
  35277. onMounted(() => {
  35278. subMenu.addSubMenu(item);
  35279. rootMenu.addMenuItem(item);
  35280. });
  35281. onBeforeUnmount(() => {
  35282. subMenu.removeSubMenu(item);
  35283. rootMenu.removeMenuItem(item);
  35284. });
  35285. __expose({
  35286. parentMenu,
  35287. rootMenu,
  35288. active,
  35289. nsMenu,
  35290. nsMenuItem,
  35291. handleClick
  35292. });
  35293. return (_ctx, _cache) => {
  35294. return openBlock(), createElementBlock("li", {
  35295. class: normalizeClass([
  35296. unref(nsMenuItem).b(),
  35297. unref(nsMenuItem).is("active", active.value),
  35298. unref(nsMenuItem).is("disabled", __props.disabled)
  35299. ]),
  35300. role: "menuitem",
  35301. tabindex: "-1",
  35302. onClick: handleClick
  35303. }, [unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), {
  35304. key: 0,
  35305. effect: unref(rootMenu).props.popperEffect,
  35306. placement: "right",
  35307. "fallback-placements": ["left"],
  35308. "popper-class": unref(rootMenu).props.popperClass,
  35309. "popper-style": unref(rootMenu).props.popperStyle,
  35310. persistent: unref(rootMenu).props.persistent,
  35311. "focus-on-target": ""
  35312. }, {
  35313. content: withCtx(() => [renderSlot(_ctx.$slots, "title")]),
  35314. default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(nsMenu).be("tooltip", "trigger")) }, [renderSlot(_ctx.$slots, "default")], 2)]),
  35315. _: 3
  35316. }, 8, [
  35317. "effect",
  35318. "popper-class",
  35319. "popper-style",
  35320. "persistent"
  35321. ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [renderSlot(_ctx.$slots, "default"), renderSlot(_ctx.$slots, "title")], 64))], 2);
  35322. };
  35323. }
  35324. });
  35325. //#endregion
  35326. //#region ../../packages/components/menu/src/menu-item.vue
  35327. var menu_item_default = menu_item_vue_vue_type_script_setup_true_lang_default;
  35328. //#endregion
  35329. //#region ../../packages/components/menu/src/menu-item-group.ts
  35330. /**
  35331. * @deprecated Removed after 3.0.0, Use `MenuItemGroupProps` instead.
  35332. */
  35333. const menuItemGroupProps = { title: String };
  35334. //#endregion
  35335. //#region ../../packages/components/menu/src/menu-item-group.vue?vue&type=script&setup=true&lang.ts
  35336. var menu_item_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35337. name: "ElMenuItemGroup",
  35338. __name: "menu-item-group",
  35339. props: menuItemGroupProps,
  35340. setup(__props) {
  35341. const ns = useNamespace("menu-item-group");
  35342. return (_ctx, _cache) => {
  35343. return openBlock(), createElementBlock("li", { class: normalizeClass(unref(ns).b()) }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [!_ctx.$slots.title ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(__props.title), 1)], 64)) : renderSlot(_ctx.$slots, "title", { key: 1 })], 2), createElementVNode("ul", null, [renderSlot(_ctx.$slots, "default")])], 2);
  35344. };
  35345. }
  35346. });
  35347. //#endregion
  35348. //#region ../../packages/components/menu/src/menu-item-group.vue
  35349. var menu_item_group_default = menu_item_group_vue_vue_type_script_setup_true_lang_default;
  35350. //#endregion
  35351. //#region ../../packages/components/menu/index.ts
  35352. const ElMenu = withInstall(menu_default, {
  35353. MenuItem: menu_item_default,
  35354. MenuItemGroup: menu_item_group_default,
  35355. SubMenu: sub_menu_default
  35356. });
  35357. const ElMenuItem = withNoopInstall(menu_item_default);
  35358. const ElMenuItemGroup = withNoopInstall(menu_item_group_default);
  35359. const ElSubMenu = withNoopInstall(sub_menu_default);
  35360. //#endregion
  35361. //#region ../../packages/components/page-header/src/page-header.ts
  35362. /**
  35363. * @deprecated Removed after 3.0.0, Use `PageHeaderProps` instead.
  35364. */
  35365. const pageHeaderProps = buildProps({
  35366. icon: {
  35367. type: iconPropType,
  35368. default: () => back_default
  35369. },
  35370. title: String,
  35371. content: {
  35372. type: String,
  35373. default: ""
  35374. }
  35375. });
  35376. const pageHeaderEmits = { back: () => true };
  35377. //#endregion
  35378. //#region ../../packages/components/page-header/src/page-header.vue?vue&type=script&setup=true&lang.ts
  35379. const _hoisted_1$30 = ["aria-label"];
  35380. var page_header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35381. name: "ElPageHeader",
  35382. __name: "page-header",
  35383. props: pageHeaderProps,
  35384. emits: pageHeaderEmits,
  35385. setup(__props, { emit: __emit }) {
  35386. const emit = __emit;
  35387. const { t } = useLocale();
  35388. const ns = useNamespace("page-header");
  35389. function handleClick() {
  35390. emit("back");
  35391. }
  35392. return (_ctx, _cache) => {
  35393. return openBlock(), createElementBlock("div", { class: normalizeClass([
  35394. unref(ns).b(),
  35395. unref(ns).is("contentful", !!_ctx.$slots.default),
  35396. {
  35397. [unref(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb,
  35398. [unref(ns).m("has-extra")]: !!_ctx.$slots.extra
  35399. }
  35400. ]) }, [
  35401. _ctx.$slots.breadcrumb ? (openBlock(), createElementBlock("div", {
  35402. key: 0,
  35403. class: normalizeClass(unref(ns).e("breadcrumb"))
  35404. }, [renderSlot(_ctx.$slots, "breadcrumb")], 2)) : createCommentVNode("v-if", true),
  35405. createElementVNode("div", { class: normalizeClass(unref(ns).e("header")) }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("left")) }, [
  35406. createElementVNode("div", {
  35407. class: normalizeClass(unref(ns).e("back")),
  35408. role: "button",
  35409. tabindex: "0",
  35410. onClick: handleClick
  35411. }, [__props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
  35412. key: 0,
  35413. "aria-label": __props.title || unref(t)("el.pageHeader.title"),
  35414. class: normalizeClass(unref(ns).e("icon"))
  35415. }, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  35416. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  35417. _: 1
  35418. })) : createCommentVNode("v-if", true)])], 10, _hoisted_1$30)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("title")) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title || unref(t)("el.pageHeader.title")), 1)])], 2)], 2),
  35419. createVNode(unref(ElDivider), { direction: "vertical" }),
  35420. createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "content", {}, () => [createTextVNode(toDisplayString(__props.content), 1)])], 2)
  35421. ], 2), _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
  35422. key: 0,
  35423. class: normalizeClass(unref(ns).e("extra"))
  35424. }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true)], 2),
  35425. _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
  35426. key: 1,
  35427. class: normalizeClass(unref(ns).e("main"))
  35428. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)
  35429. ], 2);
  35430. };
  35431. }
  35432. });
  35433. //#endregion
  35434. //#region ../../packages/components/page-header/src/page-header.vue
  35435. var page_header_default = page_header_vue_vue_type_script_setup_true_lang_default;
  35436. //#endregion
  35437. //#region ../../packages/components/page-header/index.ts
  35438. const ElPageHeader = withInstall(page_header_default);
  35439. //#endregion
  35440. //#region ../../packages/components/pagination/src/constants.ts
  35441. const elPaginationKey = Symbol("elPaginationKey");
  35442. //#endregion
  35443. //#region ../../packages/components/pagination/src/components/prev.ts
  35444. const paginationPrevProps = buildProps({
  35445. disabled: Boolean,
  35446. currentPage: {
  35447. type: Number,
  35448. default: 1
  35449. },
  35450. prevText: { type: String },
  35451. prevIcon: { type: iconPropType }
  35452. });
  35453. const paginationPrevEmits = { click: (evt) => evt instanceof MouseEvent };
  35454. //#endregion
  35455. //#region ../../packages/components/pagination/src/components/prev.vue?vue&type=script&setup=true&lang.ts
  35456. const _hoisted_1$29 = [
  35457. "disabled",
  35458. "aria-label",
  35459. "aria-disabled"
  35460. ];
  35461. const _hoisted_2$18 = { key: 0 };
  35462. var prev_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35463. name: "ElPaginationPrev",
  35464. __name: "prev",
  35465. props: paginationPrevProps,
  35466. emits: paginationPrevEmits,
  35467. setup(__props) {
  35468. const props = __props;
  35469. const { t } = useLocale();
  35470. const internalDisabled = computed(() => props.disabled || props.currentPage <= 1);
  35471. return (_ctx, _cache) => {
  35472. return openBlock(), createElementBlock("button", {
  35473. type: "button",
  35474. class: "btn-prev",
  35475. disabled: internalDisabled.value,
  35476. "aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
  35477. "aria-disabled": internalDisabled.value,
  35478. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  35479. }, [_ctx.prevText ? (openBlock(), createElementBlock("span", _hoisted_2$18, toDisplayString(_ctx.prevText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  35480. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))]),
  35481. _: 1
  35482. }))], 8, _hoisted_1$29);
  35483. };
  35484. }
  35485. });
  35486. //#endregion
  35487. //#region ../../packages/components/pagination/src/components/prev.vue
  35488. var prev_default = prev_vue_vue_type_script_setup_true_lang_default;
  35489. //#endregion
  35490. //#region ../../packages/components/pagination/src/components/next.ts
  35491. const paginationNextProps = buildProps({
  35492. disabled: Boolean,
  35493. currentPage: {
  35494. type: Number,
  35495. default: 1
  35496. },
  35497. pageCount: {
  35498. type: Number,
  35499. default: 50
  35500. },
  35501. nextText: { type: String },
  35502. nextIcon: { type: iconPropType }
  35503. });
  35504. //#endregion
  35505. //#region ../../packages/components/pagination/src/components/next.vue?vue&type=script&setup=true&lang.ts
  35506. const _hoisted_1$28 = [
  35507. "disabled",
  35508. "aria-label",
  35509. "aria-disabled"
  35510. ];
  35511. const _hoisted_2$17 = { key: 0 };
  35512. var next_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35513. name: "ElPaginationNext",
  35514. __name: "next",
  35515. props: paginationNextProps,
  35516. emits: ["click"],
  35517. setup(__props) {
  35518. const props = __props;
  35519. const { t } = useLocale();
  35520. const internalDisabled = computed(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
  35521. return (_ctx, _cache) => {
  35522. return openBlock(), createElementBlock("button", {
  35523. type: "button",
  35524. class: "btn-next",
  35525. disabled: internalDisabled.value,
  35526. "aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
  35527. "aria-disabled": internalDisabled.value,
  35528. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  35529. }, [_ctx.nextText ? (openBlock(), createElementBlock("span", _hoisted_2$17, toDisplayString(_ctx.nextText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  35530. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))]),
  35531. _: 1
  35532. }))], 8, _hoisted_1$28);
  35533. };
  35534. }
  35535. });
  35536. //#endregion
  35537. //#region ../../packages/components/pagination/src/components/next.vue
  35538. var next_default = next_vue_vue_type_script_setup_true_lang_default;
  35539. //#endregion
  35540. //#region ../../packages/components/pagination/src/usePagination.ts
  35541. const usePagination = () => inject(elPaginationKey, {});
  35542. //#endregion
  35543. //#region ../../packages/components/pagination/src/components/sizes.ts
  35544. const paginationSizesProps = buildProps({
  35545. pageSize: {
  35546. type: Number,
  35547. required: true
  35548. },
  35549. pageSizes: {
  35550. type: definePropType(Array),
  35551. default: () => mutable([
  35552. 10,
  35553. 20,
  35554. 30,
  35555. 40,
  35556. 50,
  35557. 100
  35558. ])
  35559. },
  35560. popperClass: { type: String },
  35561. popperStyle: { type: definePropType([String, Object]) },
  35562. disabled: Boolean,
  35563. teleported: Boolean,
  35564. size: {
  35565. type: String,
  35566. values: componentSizes
  35567. },
  35568. appendSizeTo: String
  35569. });
  35570. //#endregion
  35571. //#region ../../packages/components/pagination/src/components/sizes.vue?vue&type=script&setup=true&lang.ts
  35572. var sizes_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35573. name: "ElPaginationSizes",
  35574. __name: "sizes",
  35575. props: paginationSizesProps,
  35576. emits: ["page-size-change"],
  35577. setup(__props, { emit: __emit }) {
  35578. const props = __props;
  35579. const emit = __emit;
  35580. const { t } = useLocale();
  35581. const ns = useNamespace("pagination");
  35582. const pagination = usePagination();
  35583. const innerPageSize = ref(props.pageSize);
  35584. watch(() => props.pageSizes, (newVal, oldVal) => {
  35585. if (isEqual$1(newVal, oldVal)) return;
  35586. if (isArray$1(newVal)) emit("page-size-change", newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0]);
  35587. });
  35588. watch(() => props.pageSize, (newVal) => {
  35589. innerPageSize.value = newVal;
  35590. });
  35591. const innerPageSizes = computed(() => props.pageSizes);
  35592. function handleChange(val) {
  35593. if (val !== innerPageSize.value) {
  35594. innerPageSize.value = val;
  35595. pagination.handleSizeChange?.(Number(val));
  35596. }
  35597. }
  35598. return (_ctx, _cache) => {
  35599. return openBlock(), createElementBlock("span", { class: normalizeClass(unref(ns).e("sizes")) }, [createVNode(unref(ElSelect), {
  35600. "model-value": innerPageSize.value,
  35601. disabled: _ctx.disabled,
  35602. "popper-class": _ctx.popperClass,
  35603. "popper-style": _ctx.popperStyle,
  35604. size: _ctx.size,
  35605. teleported: _ctx.teleported,
  35606. "validate-event": false,
  35607. "append-to": _ctx.appendSizeTo,
  35608. onChange: handleChange
  35609. }, {
  35610. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(innerPageSizes.value, (item) => {
  35611. return openBlock(), createBlock(unref(ElOption), {
  35612. key: item,
  35613. value: item,
  35614. label: item + unref(t)("el.pagination.pagesize")
  35615. }, null, 8, ["value", "label"]);
  35616. }), 128))]),
  35617. _: 1
  35618. }, 8, [
  35619. "model-value",
  35620. "disabled",
  35621. "popper-class",
  35622. "popper-style",
  35623. "size",
  35624. "teleported",
  35625. "append-to"
  35626. ])], 2);
  35627. };
  35628. }
  35629. });
  35630. //#endregion
  35631. //#region ../../packages/components/pagination/src/components/sizes.vue
  35632. var sizes_default = sizes_vue_vue_type_script_setup_true_lang_default;
  35633. //#endregion
  35634. //#region ../../packages/components/pagination/src/components/jumper.ts
  35635. const paginationJumperProps = buildProps({ size: {
  35636. type: String,
  35637. values: componentSizes
  35638. } });
  35639. //#endregion
  35640. //#region ../../packages/components/pagination/src/components/jumper.vue?vue&type=script&setup=true&lang.ts
  35641. const _hoisted_1$27 = ["disabled"];
  35642. var jumper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35643. name: "ElPaginationJumper",
  35644. __name: "jumper",
  35645. props: paginationJumperProps,
  35646. setup(__props) {
  35647. const { t } = useLocale();
  35648. const ns = useNamespace("pagination");
  35649. const { pageCount, disabled, currentPage, changeEvent } = usePagination();
  35650. const userInput = ref();
  35651. const innerValue = computed(() => userInput.value ?? currentPage?.value);
  35652. function handleInput(val) {
  35653. userInput.value = val ? +val : "";
  35654. }
  35655. function handleChange(val) {
  35656. val = Math.trunc(+val);
  35657. changeEvent?.(val);
  35658. userInput.value = void 0;
  35659. }
  35660. return (_ctx, _cache) => {
  35661. return openBlock(), createElementBlock("span", {
  35662. class: normalizeClass(unref(ns).e("jump")),
  35663. disabled: unref(disabled)
  35664. }, [
  35665. createElementVNode("span", { class: normalizeClass([unref(ns).e("goto")]) }, toDisplayString(unref(t)("el.pagination.goto")), 3),
  35666. createVNode(unref(ElInput), {
  35667. size: _ctx.size,
  35668. class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
  35669. min: 1,
  35670. max: unref(pageCount),
  35671. disabled: unref(disabled),
  35672. "model-value": innerValue.value,
  35673. "validate-event": false,
  35674. "aria-label": unref(t)("el.pagination.page"),
  35675. type: "number",
  35676. "onUpdate:modelValue": handleInput,
  35677. onChange: handleChange
  35678. }, null, 8, [
  35679. "size",
  35680. "class",
  35681. "max",
  35682. "disabled",
  35683. "model-value",
  35684. "aria-label"
  35685. ]),
  35686. createElementVNode("span", { class: normalizeClass([unref(ns).e("classifier")]) }, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3)
  35687. ], 10, _hoisted_1$27);
  35688. };
  35689. }
  35690. });
  35691. //#endregion
  35692. //#region ../../packages/components/pagination/src/components/jumper.vue
  35693. var jumper_default = jumper_vue_vue_type_script_setup_true_lang_default;
  35694. //#endregion
  35695. //#region ../../packages/components/pagination/src/components/total.ts
  35696. const paginationTotalProps = buildProps({ total: {
  35697. type: Number,
  35698. default: 1e3
  35699. } });
  35700. //#endregion
  35701. //#region ../../packages/components/pagination/src/components/total.vue?vue&type=script&setup=true&lang.ts
  35702. const _hoisted_1$26 = ["disabled"];
  35703. var total_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35704. name: "ElPaginationTotal",
  35705. __name: "total",
  35706. props: paginationTotalProps,
  35707. setup(__props) {
  35708. const { t } = useLocale();
  35709. const ns = useNamespace("pagination");
  35710. const { disabled } = usePagination();
  35711. return (_ctx, _cache) => {
  35712. return openBlock(), createElementBlock("span", {
  35713. class: normalizeClass(unref(ns).e("total")),
  35714. disabled: unref(disabled)
  35715. }, toDisplayString(unref(t)("el.pagination.total", { total: _ctx.total })), 11, _hoisted_1$26);
  35716. };
  35717. }
  35718. });
  35719. //#endregion
  35720. //#region ../../packages/components/pagination/src/components/total.vue
  35721. var total_default = total_vue_vue_type_script_setup_true_lang_default;
  35722. //#endregion
  35723. //#region ../../packages/components/pagination/src/components/pager.ts
  35724. const paginationPagerProps = buildProps({
  35725. currentPage: {
  35726. type: Number,
  35727. default: 1
  35728. },
  35729. pageCount: {
  35730. type: Number,
  35731. required: true
  35732. },
  35733. pagerCount: {
  35734. type: Number,
  35735. default: 7
  35736. },
  35737. disabled: Boolean
  35738. });
  35739. //#endregion
  35740. //#region ../../packages/components/pagination/src/components/pager.vue?vue&type=script&setup=true&lang.ts
  35741. const _hoisted_1$25 = [
  35742. "aria-current",
  35743. "aria-label",
  35744. "tabindex"
  35745. ];
  35746. const _hoisted_2$16 = ["tabindex", "aria-label"];
  35747. const _hoisted_3$7 = [
  35748. "aria-current",
  35749. "aria-label",
  35750. "tabindex"
  35751. ];
  35752. const _hoisted_4$5 = ["tabindex", "aria-label"];
  35753. const _hoisted_5$3 = [
  35754. "aria-current",
  35755. "aria-label",
  35756. "tabindex"
  35757. ];
  35758. var pager_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  35759. name: "ElPaginationPager",
  35760. __name: "pager",
  35761. props: paginationPagerProps,
  35762. emits: [CHANGE_EVENT],
  35763. setup(__props, { emit: __emit }) {
  35764. const props = __props;
  35765. const emit = __emit;
  35766. const nsPager = useNamespace("pager");
  35767. const nsIcon = useNamespace("icon");
  35768. const { t } = useLocale();
  35769. const showPrevMore = ref(false);
  35770. const showNextMore = ref(false);
  35771. const quickPrevHover = ref(false);
  35772. const quickNextHover = ref(false);
  35773. const quickPrevFocus = ref(false);
  35774. const quickNextFocus = ref(false);
  35775. const pagers = computed(() => {
  35776. const pagerCount = props.pagerCount;
  35777. const halfPagerCount = (pagerCount - 1) / 2;
  35778. const currentPage = Number(props.currentPage);
  35779. const pageCount = Number(props.pageCount);
  35780. let showPrevMore = false;
  35781. let showNextMore = false;
  35782. if (pageCount > pagerCount) {
  35783. if (currentPage > pagerCount - halfPagerCount) showPrevMore = true;
  35784. if (currentPage < pageCount - halfPagerCount) showNextMore = true;
  35785. }
  35786. const array = [];
  35787. if (showPrevMore && !showNextMore) {
  35788. const startPage = pageCount - (pagerCount - 2);
  35789. for (let i = startPage; i < pageCount; i++) array.push(i);
  35790. } else if (!showPrevMore && showNextMore) for (let i = 2; i < pagerCount; i++) array.push(i);
  35791. else if (showPrevMore && showNextMore) {
  35792. const offset = Math.floor(pagerCount / 2) - 1;
  35793. for (let i = currentPage - offset; i <= currentPage + offset; i++) array.push(i);
  35794. } else for (let i = 2; i < pageCount; i++) array.push(i);
  35795. return array;
  35796. });
  35797. const prevMoreKls = computed(() => [
  35798. "more",
  35799. "btn-quickprev",
  35800. nsIcon.b(),
  35801. nsPager.is("disabled", props.disabled)
  35802. ]);
  35803. const nextMoreKls = computed(() => [
  35804. "more",
  35805. "btn-quicknext",
  35806. nsIcon.b(),
  35807. nsPager.is("disabled", props.disabled)
  35808. ]);
  35809. const tabindex = computed(() => props.disabled ? -1 : 0);
  35810. watch(() => [
  35811. props.pageCount,
  35812. props.pagerCount,
  35813. props.currentPage
  35814. ], ([pageCount, pagerCount, currentPage]) => {
  35815. const halfPagerCount = (pagerCount - 1) / 2;
  35816. let showPrev = false;
  35817. let showNext = false;
  35818. if (pageCount > pagerCount) {
  35819. showPrev = currentPage > pagerCount - halfPagerCount;
  35820. showNext = currentPage < pageCount - halfPagerCount;
  35821. }
  35822. quickPrevHover.value &&= showPrev;
  35823. quickNextHover.value &&= showNext;
  35824. showPrevMore.value = showPrev;
  35825. showNextMore.value = showNext;
  35826. }, { immediate: true });
  35827. function onMouseEnter(forward = false) {
  35828. if (props.disabled) return;
  35829. if (forward) quickPrevHover.value = true;
  35830. else quickNextHover.value = true;
  35831. }
  35832. function onFocus(forward = false) {
  35833. if (forward) quickPrevFocus.value = true;
  35834. else quickNextFocus.value = true;
  35835. }
  35836. function onEnter(e) {
  35837. const target = e.target;
  35838. if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
  35839. const newPage = Number(target.textContent);
  35840. if (newPage !== props.currentPage) emit(CHANGE_EVENT, newPage);
  35841. } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) onPagerClick(e);
  35842. }
  35843. function onPagerClick(event) {
  35844. const target = event.target;
  35845. if (target.tagName.toLowerCase() === "ul" || props.disabled) return;
  35846. let newPage = Number(target.textContent);
  35847. const pageCount = props.pageCount;
  35848. const currentPage = props.currentPage;
  35849. const pagerCountOffset = props.pagerCount - 2;
  35850. if (target.className.includes("more")) {
  35851. if (target.className.includes("quickprev")) newPage = currentPage - pagerCountOffset;
  35852. else if (target.className.includes("quicknext")) newPage = currentPage + pagerCountOffset;
  35853. }
  35854. if (!Number.isNaN(+newPage)) {
  35855. if (newPage < 1) newPage = 1;
  35856. if (newPage > pageCount) newPage = pageCount;
  35857. }
  35858. if (newPage !== currentPage) emit(CHANGE_EVENT, newPage);
  35859. }
  35860. return (_ctx, _cache) => {
  35861. return openBlock(), createElementBlock("ul", {
  35862. class: normalizeClass(unref(nsPager).b()),
  35863. onClick: onPagerClick,
  35864. onKeyup: withKeys(onEnter, ["enter"])
  35865. }, [
  35866. _ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", {
  35867. key: 0,
  35868. class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === 1), unref(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35869. "aria-current": _ctx.currentPage === 1,
  35870. "aria-label": unref(t)("el.pagination.currentPage", { pager: 1 }),
  35871. tabindex: tabindex.value
  35872. }, " 1 ", 10, _hoisted_1$25)) : createCommentVNode("v-if", true),
  35873. showPrevMore.value ? (openBlock(), createElementBlock("li", {
  35874. key: 1,
  35875. class: normalizeClass(prevMoreKls.value),
  35876. tabindex: tabindex.value,
  35877. "aria-label": unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
  35878. onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
  35879. onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
  35880. onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
  35881. onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
  35882. }, [(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_left_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))], 42, _hoisted_2$16)) : createCommentVNode("v-if", true),
  35883. (openBlock(true), createElementBlock(Fragment, null, renderList(pagers.value, (pager) => {
  35884. return openBlock(), createElementBlock("li", {
  35885. key: pager,
  35886. class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === pager), unref(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35887. "aria-current": _ctx.currentPage === pager,
  35888. "aria-label": unref(t)("el.pagination.currentPage", { pager }),
  35889. tabindex: tabindex.value
  35890. }, toDisplayString(pager), 11, _hoisted_3$7);
  35891. }), 128)),
  35892. showNextMore.value ? (openBlock(), createElementBlock("li", {
  35893. key: 2,
  35894. class: normalizeClass(nextMoreKls.value),
  35895. tabindex: tabindex.value,
  35896. "aria-label": unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
  35897. onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
  35898. onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
  35899. onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
  35900. onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
  35901. }, [(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_right_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))], 42, _hoisted_4$5)) : createCommentVNode("v-if", true),
  35902. _ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", {
  35903. key: 3,
  35904. class: normalizeClass([[unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount), unref(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35905. "aria-current": _ctx.currentPage === _ctx.pageCount,
  35906. "aria-label": unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
  35907. tabindex: tabindex.value
  35908. }, toDisplayString(_ctx.pageCount), 11, _hoisted_5$3)) : createCommentVNode("v-if", true)
  35909. ], 34);
  35910. };
  35911. }
  35912. });
  35913. //#endregion
  35914. //#region ../../packages/components/pagination/src/components/pager.vue
  35915. var pager_default = pager_vue_vue_type_script_setup_true_lang_default;
  35916. //#endregion
  35917. //#region ../../packages/components/pagination/src/pagination.ts
  35918. /**
  35919. * It it user's responsibility to guarantee that the value of props.total... is number
  35920. * (same as pageSize, defaultPageSize, currentPage, defaultCurrentPage, pageCount)
  35921. * Otherwise we can reasonable infer that the corresponding field is absent
  35922. */
  35923. const isAbsent = (v) => typeof v !== "number";
  35924. const paginationProps = buildProps({
  35925. pageSize: Number,
  35926. defaultPageSize: Number,
  35927. total: Number,
  35928. pageCount: Number,
  35929. pagerCount: {
  35930. type: Number,
  35931. validator: (value) => {
  35932. return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
  35933. },
  35934. default: 7
  35935. },
  35936. currentPage: Number,
  35937. defaultCurrentPage: Number,
  35938. layout: {
  35939. type: String,
  35940. default: [
  35941. "prev",
  35942. "pager",
  35943. "next",
  35944. "jumper",
  35945. "->",
  35946. "total"
  35947. ].join(", ")
  35948. },
  35949. pageSizes: {
  35950. type: definePropType(Array),
  35951. default: () => mutable([
  35952. 10,
  35953. 20,
  35954. 30,
  35955. 40,
  35956. 50,
  35957. 100
  35958. ])
  35959. },
  35960. popperClass: {
  35961. type: String,
  35962. default: ""
  35963. },
  35964. popperStyle: { type: definePropType([String, Object]) },
  35965. prevText: {
  35966. type: String,
  35967. default: ""
  35968. },
  35969. prevIcon: {
  35970. type: iconPropType,
  35971. default: () => arrow_left_default
  35972. },
  35973. nextText: {
  35974. type: String,
  35975. default: ""
  35976. },
  35977. nextIcon: {
  35978. type: iconPropType,
  35979. default: () => arrow_right_default
  35980. },
  35981. teleported: {
  35982. type: Boolean,
  35983. default: true
  35984. },
  35985. small: Boolean,
  35986. size: useSizeProp,
  35987. background: Boolean,
  35988. disabled: Boolean,
  35989. hideOnSinglePage: Boolean,
  35990. appendSizeTo: String
  35991. });
  35992. const paginationEmits = {
  35993. "update:current-page": (val) => isNumber(val),
  35994. "update:page-size": (val) => isNumber(val),
  35995. "size-change": (val) => isNumber(val),
  35996. change: (currentPage, pageSize) => isNumber(currentPage) && isNumber(pageSize),
  35997. "current-change": (val) => isNumber(val),
  35998. "prev-click": (val) => isNumber(val),
  35999. "next-click": (val) => isNumber(val)
  36000. };
  36001. const componentName = "ElPagination";
  36002. var pagination_default = defineComponent({
  36003. name: componentName,
  36004. props: paginationProps,
  36005. emits: paginationEmits,
  36006. setup(props, { emit, slots }) {
  36007. const { t } = useLocale();
  36008. const ns = useNamespace("pagination");
  36009. const vnodeProps = getCurrentInstance().vnode.props || {};
  36010. const _globalSize = useGlobalSize();
  36011. const _size = computed(() => props.small ? "small" : props.size ?? _globalSize.value);
  36012. useDeprecated({
  36013. from: "small",
  36014. replacement: "size",
  36015. version: "3.0.0",
  36016. scope: "el-pagination",
  36017. ref: "https://element-plus.org/zh-CN/component/pagination.html"
  36018. }, computed(() => !!props.small));
  36019. const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
  36020. const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
  36021. const assertValidUsage = computed(() => {
  36022. if (isAbsent(props.total) && isAbsent(props.pageCount)) return false;
  36023. if (!isAbsent(props.currentPage) && !hasCurrentPageListener) return false;
  36024. if (props.layout.includes("sizes")) {
  36025. if (!isAbsent(props.pageCount)) {
  36026. if (!hasPageSizeListener) return false;
  36027. } else if (!isAbsent(props.total)) {
  36028. if (!isAbsent(props.pageSize)) {
  36029. if (!hasPageSizeListener) return false;
  36030. }
  36031. }
  36032. }
  36033. return true;
  36034. });
  36035. const innerPageSize = ref(isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize);
  36036. const innerCurrentPage = ref(isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage);
  36037. const pageSizeBridge = computed({
  36038. get() {
  36039. return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize;
  36040. },
  36041. set(v) {
  36042. if (isAbsent(props.pageSize)) innerPageSize.value = v;
  36043. if (hasPageSizeListener) {
  36044. emit("update:page-size", v);
  36045. emit("size-change", v);
  36046. }
  36047. }
  36048. });
  36049. const pageCountBridge = computed(() => {
  36050. let pageCount = 0;
  36051. if (!isAbsent(props.pageCount)) pageCount = props.pageCount;
  36052. else if (!isAbsent(props.total)) pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value));
  36053. return pageCount;
  36054. });
  36055. const currentPageBridge = computed({
  36056. get() {
  36057. return isAbsent(props.currentPage) ? innerCurrentPage.value : props.currentPage;
  36058. },
  36059. set(v) {
  36060. let newCurrentPage = v;
  36061. if (v < 1) newCurrentPage = 1;
  36062. else if (v > pageCountBridge.value) newCurrentPage = pageCountBridge.value;
  36063. if (isAbsent(props.currentPage)) innerCurrentPage.value = newCurrentPage;
  36064. if (hasCurrentPageListener) {
  36065. emit("update:current-page", newCurrentPage);
  36066. emit("current-change", newCurrentPage);
  36067. }
  36068. }
  36069. });
  36070. watch(pageCountBridge, (val) => {
  36071. if (currentPageBridge.value > val) currentPageBridge.value = val;
  36072. });
  36073. watch([currentPageBridge, pageSizeBridge], (value) => {
  36074. emit(CHANGE_EVENT, ...value);
  36075. }, { flush: "post" });
  36076. function handleCurrentChange(val) {
  36077. currentPageBridge.value = val;
  36078. }
  36079. function handleSizeChange(val) {
  36080. pageSizeBridge.value = val;
  36081. const newPageCount = pageCountBridge.value;
  36082. if (currentPageBridge.value > newPageCount) currentPageBridge.value = newPageCount;
  36083. }
  36084. function prev() {
  36085. if (props.disabled) return;
  36086. currentPageBridge.value -= 1;
  36087. emit("prev-click", currentPageBridge.value);
  36088. }
  36089. function next() {
  36090. if (props.disabled) return;
  36091. currentPageBridge.value += 1;
  36092. emit("next-click", currentPageBridge.value);
  36093. }
  36094. function addClass(element, cls) {
  36095. if (element) {
  36096. if (!element.props) element.props = {};
  36097. element.props.class = [element.props.class, cls].join(" ");
  36098. }
  36099. }
  36100. provide(elPaginationKey, {
  36101. pageCount: pageCountBridge,
  36102. disabled: computed(() => props.disabled),
  36103. currentPage: currentPageBridge,
  36104. changeEvent: handleCurrentChange,
  36105. handleSizeChange
  36106. });
  36107. return () => {
  36108. if (!assertValidUsage.value) {
  36109. /* @__PURE__ */ debugWarn(componentName, t("el.pagination.deprecationWarning"));
  36110. return null;
  36111. }
  36112. if (!props.layout) return null;
  36113. if (props.hideOnSinglePage && pageCountBridge.value <= 1) return null;
  36114. const rootChildren = [];
  36115. const rightWrapperChildren = [];
  36116. const rightWrapperRoot = h("div", { class: ns.e("rightwrapper") }, rightWrapperChildren);
  36117. const TEMPLATE_MAP = {
  36118. prev: h(prev_default, {
  36119. disabled: props.disabled,
  36120. currentPage: currentPageBridge.value,
  36121. prevText: props.prevText,
  36122. prevIcon: props.prevIcon,
  36123. onClick: prev
  36124. }),
  36125. jumper: h(jumper_default, { size: _size.value }),
  36126. pager: h(pager_default, {
  36127. currentPage: currentPageBridge.value,
  36128. pageCount: pageCountBridge.value,
  36129. pagerCount: props.pagerCount,
  36130. onChange: handleCurrentChange,
  36131. disabled: props.disabled
  36132. }),
  36133. next: h(next_default, {
  36134. disabled: props.disabled,
  36135. currentPage: currentPageBridge.value,
  36136. pageCount: pageCountBridge.value,
  36137. nextText: props.nextText,
  36138. nextIcon: props.nextIcon,
  36139. onClick: next
  36140. }),
  36141. sizes: h(sizes_default, {
  36142. pageSize: pageSizeBridge.value,
  36143. pageSizes: props.pageSizes,
  36144. popperClass: props.popperClass,
  36145. popperStyle: props.popperStyle,
  36146. disabled: props.disabled,
  36147. teleported: props.teleported,
  36148. size: _size.value,
  36149. appendSizeTo: props.appendSizeTo
  36150. }),
  36151. slot: slots?.default?.() ?? null,
  36152. total: h(total_default, { total: isAbsent(props.total) ? 0 : props.total })
  36153. };
  36154. const components = props.layout.split(",").map((item) => item.trim());
  36155. let haveRightWrapper = false;
  36156. components.forEach((c) => {
  36157. if (c === "->") {
  36158. haveRightWrapper = true;
  36159. return;
  36160. }
  36161. if (!haveRightWrapper) rootChildren.push(TEMPLATE_MAP[c]);
  36162. else rightWrapperChildren.push(TEMPLATE_MAP[c]);
  36163. });
  36164. addClass(rootChildren[0], ns.is("first"));
  36165. addClass(rootChildren[rootChildren.length - 1], ns.is("last"));
  36166. if (haveRightWrapper && rightWrapperChildren.length > 0) {
  36167. addClass(rightWrapperChildren[0], ns.is("first"));
  36168. addClass(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last"));
  36169. rootChildren.push(rightWrapperRoot);
  36170. }
  36171. return h("div", { class: [
  36172. ns.b(),
  36173. ns.is("background", props.background),
  36174. ns.m(_size.value)
  36175. ] }, rootChildren);
  36176. };
  36177. }
  36178. });
  36179. //#endregion
  36180. //#region ../../packages/components/pagination/index.ts
  36181. const ElPagination = withInstall(pagination_default);
  36182. //#endregion
  36183. //#region ../../packages/components/popconfirm/src/popconfirm.ts
  36184. /**
  36185. * @deprecated Removed after 3.0.0, Use `PopconfirmProps` instead.
  36186. */
  36187. const popconfirmProps = buildProps({
  36188. title: String,
  36189. confirmButtonText: String,
  36190. cancelButtonText: String,
  36191. confirmButtonType: {
  36192. type: String,
  36193. values: buttonTypes,
  36194. default: "primary"
  36195. },
  36196. cancelButtonType: {
  36197. type: String,
  36198. values: buttonTypes,
  36199. default: "text"
  36200. },
  36201. icon: {
  36202. type: iconPropType,
  36203. default: () => question_filled_default
  36204. },
  36205. iconColor: {
  36206. type: String,
  36207. default: "#f90"
  36208. },
  36209. hideIcon: Boolean,
  36210. hideAfter: {
  36211. type: Number,
  36212. default: 200
  36213. },
  36214. effect: {
  36215. ...useTooltipContentProps.effect,
  36216. default: "light"
  36217. },
  36218. teleported: useTooltipContentProps.teleported,
  36219. persistent: useTooltipContentProps.persistent,
  36220. width: {
  36221. type: [String, Number],
  36222. default: 150
  36223. },
  36224. virtualTriggering: useTooltipTriggerProps.virtualTriggering,
  36225. virtualRef: useTooltipTriggerProps.virtualRef
  36226. });
  36227. const popconfirmEmits = {
  36228. confirm: (e) => e instanceof MouseEvent,
  36229. cancel: (e) => e instanceof MouseEvent
  36230. };
  36231. //#endregion
  36232. //#region ../../packages/components/popconfirm/src/popconfirm.vue?vue&type=script&setup=true&lang.ts
  36233. var popconfirm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  36234. name: "ElPopconfirm",
  36235. __name: "popconfirm",
  36236. props: popconfirmProps,
  36237. emits: popconfirmEmits,
  36238. setup(__props, { expose: __expose, emit: __emit }) {
  36239. const props = __props;
  36240. const emit = __emit;
  36241. const { t } = useLocale();
  36242. const ns = useNamespace("popconfirm");
  36243. const tooltipRef = ref();
  36244. const rootRef = ref();
  36245. const popperRef = computed(() => {
  36246. return unref(tooltipRef)?.popperRef;
  36247. });
  36248. const showPopper = () => {
  36249. rootRef.value?.focus?.();
  36250. };
  36251. const hidePopper = () => {
  36252. tooltipRef.value?.onClose?.();
  36253. };
  36254. const style = computed(() => {
  36255. return { width: addUnit(props.width) };
  36256. });
  36257. const confirm = (e) => {
  36258. emit("confirm", e);
  36259. hidePopper();
  36260. };
  36261. const cancel = (e) => {
  36262. emit("cancel", e);
  36263. hidePopper();
  36264. };
  36265. const finalConfirmButtonText = computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
  36266. const finalCancelButtonText = computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
  36267. __expose({
  36268. popperRef,
  36269. hide: hidePopper
  36270. });
  36271. return (_ctx, _cache) => {
  36272. return openBlock(), createBlock(unref(ElTooltip), mergeProps({
  36273. ref_key: "tooltipRef",
  36274. ref: tooltipRef,
  36275. trigger: "click",
  36276. effect: __props.effect
  36277. }, _ctx.$attrs, {
  36278. "virtual-triggering": __props.virtualTriggering,
  36279. "virtual-ref": __props.virtualRef,
  36280. "popper-class": `${unref(ns).namespace.value}-popover`,
  36281. "popper-style": style.value,
  36282. teleported: __props.teleported,
  36283. "fallback-placements": [
  36284. "bottom",
  36285. "top",
  36286. "right",
  36287. "left"
  36288. ],
  36289. "hide-after": __props.hideAfter,
  36290. persistent: __props.persistent,
  36291. loop: "",
  36292. onShow: showPopper
  36293. }), {
  36294. content: withCtx(() => [createElementVNode("div", {
  36295. ref_key: "rootRef",
  36296. ref: rootRef,
  36297. tabindex: "-1",
  36298. class: normalizeClass(unref(ns).b())
  36299. }, [createElementVNode("div", { class: normalizeClass(unref(ns).e("main")) }, [!__props.hideIcon && __props.icon ? (openBlock(), createBlock(unref(ElIcon), {
  36300. key: 0,
  36301. class: normalizeClass(unref(ns).e("icon")),
  36302. style: normalizeStyle({ color: __props.iconColor })
  36303. }, {
  36304. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  36305. _: 1
  36306. }, 8, ["class", "style"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(__props.title), 1)], 2), createElementVNode("div", { class: normalizeClass(unref(ns).e("action")) }, [renderSlot(_ctx.$slots, "actions", {
  36307. confirm,
  36308. cancel
  36309. }, () => [createVNode(unref(ElButton), {
  36310. size: "small",
  36311. type: __props.cancelButtonType === "text" ? "" : __props.cancelButtonType,
  36312. text: __props.cancelButtonType === "text",
  36313. onClick: cancel
  36314. }, {
  36315. default: withCtx(() => [createTextVNode(toDisplayString(finalCancelButtonText.value), 1)]),
  36316. _: 1
  36317. }, 8, ["type", "text"]), createVNode(unref(ElButton), {
  36318. size: "small",
  36319. type: __props.confirmButtonType === "text" ? "" : __props.confirmButtonType,
  36320. text: __props.confirmButtonType === "text",
  36321. onClick: confirm
  36322. }, {
  36323. default: withCtx(() => [createTextVNode(toDisplayString(finalConfirmButtonText.value), 1)]),
  36324. _: 1
  36325. }, 8, ["type", "text"])])], 2)], 2)]),
  36326. default: withCtx(() => [_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)]),
  36327. _: 3
  36328. }, 16, [
  36329. "effect",
  36330. "virtual-triggering",
  36331. "virtual-ref",
  36332. "popper-class",
  36333. "popper-style",
  36334. "teleported",
  36335. "hide-after",
  36336. "persistent"
  36337. ]);
  36338. };
  36339. }
  36340. });
  36341. //#endregion
  36342. //#region ../../packages/components/popconfirm/src/popconfirm.vue
  36343. var popconfirm_default = popconfirm_vue_vue_type_script_setup_true_lang_default;
  36344. //#endregion
  36345. //#region ../../packages/components/popconfirm/index.ts
  36346. const ElPopconfirm = withInstall(popconfirm_default);
  36347. //#endregion
  36348. //#region ../../packages/components/popover/src/popover.ts
  36349. /**
  36350. * @deprecated Removed after 3.0.0, Use `PopoverProps` instead.
  36351. */
  36352. const popoverProps = buildProps({
  36353. trigger: useTooltipTriggerProps.trigger,
  36354. triggerKeys: useTooltipTriggerProps.triggerKeys,
  36355. placement: dropdownProps.placement,
  36356. disabled: useTooltipTriggerProps.disabled,
  36357. visible: useTooltipContentProps.visible,
  36358. transition: useTooltipContentProps.transition,
  36359. popperOptions: dropdownProps.popperOptions,
  36360. tabindex: dropdownProps.tabindex,
  36361. content: useTooltipContentProps.content,
  36362. popperStyle: useTooltipContentProps.popperStyle,
  36363. popperClass: useTooltipContentProps.popperClass,
  36364. enterable: {
  36365. ...useTooltipContentProps.enterable,
  36366. default: true
  36367. },
  36368. effect: {
  36369. ...useTooltipContentProps.effect,
  36370. default: "light"
  36371. },
  36372. teleported: useTooltipContentProps.teleported,
  36373. appendTo: useTooltipContentProps.appendTo,
  36374. title: String,
  36375. width: {
  36376. type: [String, Number],
  36377. default: 150
  36378. },
  36379. offset: {
  36380. type: Number,
  36381. default: void 0
  36382. },
  36383. showAfter: {
  36384. type: Number,
  36385. default: 0
  36386. },
  36387. hideAfter: {
  36388. type: Number,
  36389. default: 200
  36390. },
  36391. autoClose: {
  36392. type: Number,
  36393. default: 0
  36394. },
  36395. showArrow: {
  36396. type: Boolean,
  36397. default: true
  36398. },
  36399. persistent: {
  36400. type: Boolean,
  36401. default: true
  36402. },
  36403. "onUpdate:visible": { type: Function }
  36404. });
  36405. const popoverEmits = {
  36406. "update:visible": (value) => isBoolean(value),
  36407. "before-enter": () => true,
  36408. "before-leave": () => true,
  36409. "after-enter": () => true,
  36410. "after-leave": () => true
  36411. };
  36412. /**
  36413. * @description default values for PopoverProps
  36414. */
  36415. const popoverPropsDefaults = {
  36416. trigger: "hover",
  36417. triggerKeys: () => [
  36418. EVENT_CODE.enter,
  36419. EVENT_CODE.numpadEnter,
  36420. EVENT_CODE.space
  36421. ],
  36422. placement: "bottom",
  36423. visible: null,
  36424. popperOptions: () => ({}),
  36425. tabindex: 0,
  36426. content: "",
  36427. popperStyle: void 0,
  36428. enterable: true,
  36429. effect: "light",
  36430. teleported: true,
  36431. width: 150,
  36432. offset: void 0,
  36433. showAfter: 0,
  36434. hideAfter: 200,
  36435. autoClose: 0,
  36436. showArrow: true,
  36437. persistent: true
  36438. };
  36439. //#endregion
  36440. //#region ../../packages/components/popover/src/popover.vue?vue&type=script&setup=true&lang.ts
  36441. const updateEventKeyRaw = `onUpdate:visible`;
  36442. var popover_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  36443. name: "ElPopover",
  36444. __name: "popover",
  36445. props: popoverProps,
  36446. emits: popoverEmits,
  36447. setup(__props, { expose: __expose, emit: __emit }) {
  36448. const props = __props;
  36449. const emit = __emit;
  36450. const onUpdateVisible = computed(() => {
  36451. return props[updateEventKeyRaw];
  36452. });
  36453. const ns = useNamespace("popover");
  36454. const tooltipRef = ref();
  36455. const popperRef = computed(() => {
  36456. return unref(tooltipRef)?.popperRef;
  36457. });
  36458. const style = computed(() => {
  36459. return [{ width: addUnit(props.width) }, props.popperStyle];
  36460. });
  36461. const kls = computed(() => {
  36462. return [
  36463. ns.b(),
  36464. props.popperClass,
  36465. { [ns.m("plain")]: !!props.content }
  36466. ];
  36467. });
  36468. const gpuAcceleration = computed(() => {
  36469. return props.transition === `${ns.namespace.value}-fade-in-linear`;
  36470. });
  36471. const hide = () => {
  36472. tooltipRef.value?.hide();
  36473. };
  36474. const beforeEnter = () => {
  36475. emit("before-enter");
  36476. };
  36477. const beforeLeave = () => {
  36478. emit("before-leave");
  36479. };
  36480. const afterEnter = () => {
  36481. emit("after-enter");
  36482. };
  36483. const afterLeave = () => {
  36484. emit("update:visible", false);
  36485. emit("after-leave");
  36486. };
  36487. __expose({
  36488. popperRef,
  36489. hide
  36490. });
  36491. return (_ctx, _cache) => {
  36492. return openBlock(), createBlock(unref(ElTooltip), mergeProps({
  36493. ref_key: "tooltipRef",
  36494. ref: tooltipRef
  36495. }, _ctx.$attrs, {
  36496. trigger: __props.trigger,
  36497. "trigger-keys": __props.triggerKeys,
  36498. placement: __props.placement,
  36499. disabled: __props.disabled,
  36500. visible: __props.visible,
  36501. transition: __props.transition,
  36502. "popper-options": __props.popperOptions,
  36503. tabindex: __props.tabindex,
  36504. content: __props.content,
  36505. offset: __props.offset,
  36506. "show-after": __props.showAfter,
  36507. "hide-after": __props.hideAfter,
  36508. "auto-close": __props.autoClose,
  36509. "show-arrow": __props.showArrow,
  36510. "aria-label": __props.title,
  36511. effect: __props.effect,
  36512. enterable: __props.enterable,
  36513. "popper-class": kls.value,
  36514. "popper-style": style.value,
  36515. teleported: __props.teleported,
  36516. "append-to": __props.appendTo,
  36517. persistent: __props.persistent,
  36518. "gpu-acceleration": gpuAcceleration.value,
  36519. "onUpdate:visible": onUpdateVisible.value,
  36520. onBeforeShow: beforeEnter,
  36521. onBeforeHide: beforeLeave,
  36522. onShow: afterEnter,
  36523. onHide: afterLeave
  36524. }), {
  36525. content: withCtx(() => [__props.title ? (openBlock(), createElementBlock("div", {
  36526. key: 0,
  36527. class: normalizeClass(unref(ns).e("title")),
  36528. role: "title"
  36529. }, toDisplayString(__props.title), 3)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default", { hide }, () => [createTextVNode(toDisplayString(__props.content), 1)])]),
  36530. default: withCtx(() => [_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)]),
  36531. _: 3
  36532. }, 16, [
  36533. "trigger",
  36534. "trigger-keys",
  36535. "placement",
  36536. "disabled",
  36537. "visible",
  36538. "transition",
  36539. "popper-options",
  36540. "tabindex",
  36541. "content",
  36542. "offset",
  36543. "show-after",
  36544. "hide-after",
  36545. "auto-close",
  36546. "show-arrow",
  36547. "aria-label",
  36548. "effect",
  36549. "enterable",
  36550. "popper-class",
  36551. "popper-style",
  36552. "teleported",
  36553. "append-to",
  36554. "persistent",
  36555. "gpu-acceleration",
  36556. "onUpdate:visible"
  36557. ]);
  36558. };
  36559. }
  36560. });
  36561. //#endregion
  36562. //#region ../../packages/components/popover/src/popover.vue
  36563. var popover_default = popover_vue_vue_type_script_setup_true_lang_default;
  36564. //#endregion
  36565. //#region ../../packages/components/popover/src/directive.ts
  36566. const attachEvents = (el, binding) => {
  36567. const popover = (binding.arg || binding.value)?.popperRef;
  36568. if (popover) popover.triggerRef = el;
  36569. };
  36570. var directive_default = {
  36571. mounted(el, binding) {
  36572. attachEvents(el, binding);
  36573. },
  36574. updated(el, binding) {
  36575. attachEvents(el, binding);
  36576. }
  36577. };
  36578. const VPopover = "popover";
  36579. //#endregion
  36580. //#region ../../packages/components/popover/index.ts
  36581. const ElPopoverDirective = withInstallDirective(directive_default, VPopover);
  36582. const ElPopover = withInstall(popover_default, { directive: ElPopoverDirective });
  36583. //#endregion
  36584. //#region ../../packages/components/progress/src/progress.ts
  36585. /**
  36586. * @deprecated Removed after 3.0.0, Use `ProgressProps` instead.
  36587. */
  36588. const progressProps = buildProps({
  36589. type: {
  36590. type: String,
  36591. default: "line",
  36592. values: [
  36593. "line",
  36594. "circle",
  36595. "dashboard"
  36596. ]
  36597. },
  36598. percentage: {
  36599. type: Number,
  36600. default: 0,
  36601. validator: (val) => val >= 0 && val <= 100
  36602. },
  36603. status: {
  36604. type: String,
  36605. default: "",
  36606. values: [
  36607. "",
  36608. "success",
  36609. "exception",
  36610. "warning"
  36611. ]
  36612. },
  36613. indeterminate: Boolean,
  36614. duration: {
  36615. type: Number,
  36616. default: 3
  36617. },
  36618. strokeWidth: {
  36619. type: Number,
  36620. default: 6
  36621. },
  36622. strokeLinecap: {
  36623. type: definePropType(String),
  36624. default: "round"
  36625. },
  36626. textInside: Boolean,
  36627. width: {
  36628. type: Number,
  36629. default: 126
  36630. },
  36631. showText: {
  36632. type: Boolean,
  36633. default: true
  36634. },
  36635. color: {
  36636. type: definePropType([
  36637. String,
  36638. Array,
  36639. Function
  36640. ]),
  36641. default: ""
  36642. },
  36643. striped: Boolean,
  36644. stripedFlow: Boolean,
  36645. format: {
  36646. type: definePropType(Function),
  36647. default: (percentage) => `${percentage}%`
  36648. }
  36649. });
  36650. //#endregion
  36651. //#region ../../packages/components/progress/src/progress.vue?vue&type=script&setup=true&lang.ts
  36652. const _hoisted_1$24 = ["aria-valuenow"];
  36653. const _hoisted_2$15 = { viewBox: "0 0 100 100" };
  36654. const _hoisted_3$6 = [
  36655. "d",
  36656. "stroke",
  36657. "stroke-linecap",
  36658. "stroke-width"
  36659. ];
  36660. const _hoisted_4$4 = [
  36661. "d",
  36662. "stroke",
  36663. "opacity",
  36664. "stroke-linecap",
  36665. "stroke-width"
  36666. ];
  36667. const _hoisted_5$2 = { key: 0 };
  36668. var progress_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  36669. name: "ElProgress",
  36670. __name: "progress",
  36671. props: progressProps,
  36672. setup(__props) {
  36673. const STATUS_COLOR_MAP = {
  36674. success: "#13ce66",
  36675. exception: "#ff4949",
  36676. warning: "#e6a23c",
  36677. default: "#20a0ff"
  36678. };
  36679. const props = __props;
  36680. const ns = useNamespace("progress");
  36681. const barStyle = computed(() => {
  36682. const barStyle = {
  36683. width: `${props.percentage}%`,
  36684. animationDuration: `${props.duration}s`
  36685. };
  36686. const color = getCurrentColor(props.percentage);
  36687. if (color.includes("gradient")) barStyle.background = color;
  36688. else barStyle.backgroundColor = color;
  36689. return barStyle;
  36690. });
  36691. const relativeStrokeWidth = computed(() => (props.strokeWidth / props.width * 100).toFixed(1));
  36692. const radius = computed(() => {
  36693. if (["circle", "dashboard"].includes(props.type)) return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10);
  36694. return 0;
  36695. });
  36696. const trackPath = computed(() => {
  36697. const r = radius.value;
  36698. const isDashboard = props.type === "dashboard";
  36699. return `
  36700. M 50 50
  36701. m 0 ${isDashboard ? "" : "-"}${r}
  36702. a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
  36703. a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
  36704. `;
  36705. });
  36706. const perimeter = computed(() => 2 * Math.PI * radius.value);
  36707. const rate = computed(() => props.type === "dashboard" ? .75 : 1);
  36708. const strokeDashoffset = computed(() => {
  36709. return `${-1 * perimeter.value * (1 - rate.value) / 2}px`;
  36710. });
  36711. const trailPathStyle = computed(() => ({
  36712. strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
  36713. strokeDashoffset: strokeDashoffset.value
  36714. }));
  36715. const circlePathStyle = computed(() => ({
  36716. strokeDasharray: `${perimeter.value * rate.value * (props.percentage / 100)}px, ${perimeter.value}px`,
  36717. strokeDashoffset: strokeDashoffset.value,
  36718. transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
  36719. }));
  36720. const stroke = computed(() => {
  36721. let ret;
  36722. if (props.color) ret = getCurrentColor(props.percentage);
  36723. else ret = STATUS_COLOR_MAP[props.status] || STATUS_COLOR_MAP.default;
  36724. return ret;
  36725. });
  36726. const statusIcon = computed(() => {
  36727. if (props.status === "warning") return warning_filled_default;
  36728. if (props.type === "line") return props.status === "success" ? circle_check_default : circle_close_default;
  36729. else return props.status === "success" ? check_default : close_default;
  36730. });
  36731. const progressTextSize = computed(() => {
  36732. return props.type === "line" ? 12 + props.strokeWidth * .4 : props.width * .111111 + 2;
  36733. });
  36734. const content = computed(() => props.format(props.percentage));
  36735. function getColors(color) {
  36736. const span = 100 / color.length;
  36737. return color.map((seriesColor, index) => {
  36738. if (isString(seriesColor)) return {
  36739. color: seriesColor,
  36740. percentage: (index + 1) * span
  36741. };
  36742. return seriesColor;
  36743. }).sort((a, b) => a.percentage - b.percentage);
  36744. }
  36745. const getCurrentColor = (percentage) => {
  36746. const { color } = props;
  36747. if (isFunction$1(color)) return color(percentage);
  36748. else if (isString(color)) return color;
  36749. else {
  36750. const colors = getColors(color);
  36751. for (const color of colors) if (color.percentage > percentage) return color.color;
  36752. return colors[colors.length - 1]?.color;
  36753. }
  36754. };
  36755. return (_ctx, _cache) => {
  36756. return openBlock(), createElementBlock("div", {
  36757. class: normalizeClass([
  36758. unref(ns).b(),
  36759. unref(ns).m(__props.type),
  36760. unref(ns).is(__props.status),
  36761. {
  36762. [unref(ns).m("without-text")]: !__props.showText,
  36763. [unref(ns).m("text-inside")]: __props.textInside
  36764. }
  36765. ]),
  36766. role: "progressbar",
  36767. "aria-valuenow": __props.percentage,
  36768. "aria-valuemin": "0",
  36769. "aria-valuemax": "100"
  36770. }, [__props.type === "line" ? (openBlock(), createElementBlock("div", {
  36771. key: 0,
  36772. class: normalizeClass(unref(ns).b("bar"))
  36773. }, [createElementVNode("div", {
  36774. class: normalizeClass(unref(ns).be("bar", "outer")),
  36775. style: normalizeStyle({ height: `${__props.strokeWidth}px` })
  36776. }, [createElementVNode("div", {
  36777. class: normalizeClass([
  36778. unref(ns).be("bar", "inner"),
  36779. { [unref(ns).bem("bar", "inner", "indeterminate")]: __props.indeterminate },
  36780. { [unref(ns).bem("bar", "inner", "striped")]: __props.striped },
  36781. { [unref(ns).bem("bar", "inner", "striped-flow")]: __props.stripedFlow }
  36782. ]),
  36783. style: normalizeStyle(barStyle.value)
  36784. }, [(__props.showText || _ctx.$slots.default) && __props.textInside ? (openBlock(), createElementBlock("div", {
  36785. key: 0,
  36786. class: normalizeClass(unref(ns).be("bar", "innerText"))
  36787. }, [renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [createElementVNode("span", null, toDisplayString(content.value), 1)])], 2)) : createCommentVNode("v-if", true)], 6)], 6)], 2)) : (openBlock(), createElementBlock("div", {
  36788. key: 1,
  36789. class: normalizeClass(unref(ns).b("circle")),
  36790. style: normalizeStyle({
  36791. height: `${__props.width}px`,
  36792. width: `${__props.width}px`
  36793. })
  36794. }, [(openBlock(), createElementBlock("svg", _hoisted_2$15, [createElementVNode("path", {
  36795. class: normalizeClass(unref(ns).be("circle", "track")),
  36796. d: trackPath.value,
  36797. stroke: `var(${unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
  36798. "stroke-linecap": __props.strokeLinecap,
  36799. "stroke-width": relativeStrokeWidth.value,
  36800. fill: "none",
  36801. style: normalizeStyle(trailPathStyle.value)
  36802. }, null, 14, _hoisted_3$6), createElementVNode("path", {
  36803. class: normalizeClass(unref(ns).be("circle", "path")),
  36804. d: trackPath.value,
  36805. stroke: stroke.value,
  36806. fill: "none",
  36807. opacity: __props.percentage ? 1 : 0,
  36808. "stroke-linecap": __props.strokeLinecap,
  36809. "stroke-width": relativeStrokeWidth.value,
  36810. style: normalizeStyle(circlePathStyle.value)
  36811. }, null, 14, _hoisted_4$4)]))], 6)), (__props.showText || _ctx.$slots.default) && !__props.textInside ? (openBlock(), createElementBlock("div", {
  36812. key: 2,
  36813. class: normalizeClass(unref(ns).e("text")),
  36814. style: normalizeStyle({ fontSize: `${progressTextSize.value}px` })
  36815. }, [renderSlot(_ctx.$slots, "default", { percentage: __props.percentage }, () => [!__props.status ? (openBlock(), createElementBlock("span", _hoisted_5$2, toDisplayString(content.value), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  36816. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(statusIcon.value)))]),
  36817. _: 1
  36818. }))])], 6)) : createCommentVNode("v-if", true)], 10, _hoisted_1$24);
  36819. };
  36820. }
  36821. });
  36822. //#endregion
  36823. //#region ../../packages/components/progress/src/progress.vue
  36824. var progress_default = progress_vue_vue_type_script_setup_true_lang_default;
  36825. //#endregion
  36826. //#region ../../packages/components/progress/index.ts
  36827. const ElProgress = withInstall(progress_default);
  36828. //#endregion
  36829. //#region ../../packages/components/rate/src/rate.ts
  36830. /**
  36831. * @deprecated Removed after 3.0.0, Use `RateProps` instead.
  36832. */
  36833. const rateProps = buildProps({
  36834. modelValue: {
  36835. type: Number,
  36836. default: 0
  36837. },
  36838. id: {
  36839. type: String,
  36840. default: void 0
  36841. },
  36842. lowThreshold: {
  36843. type: Number,
  36844. default: 2
  36845. },
  36846. highThreshold: {
  36847. type: Number,
  36848. default: 4
  36849. },
  36850. max: {
  36851. type: Number,
  36852. default: 5
  36853. },
  36854. colors: {
  36855. type: definePropType([Array, Object]),
  36856. default: () => mutable([
  36857. "",
  36858. "",
  36859. ""
  36860. ])
  36861. },
  36862. voidColor: {
  36863. type: String,
  36864. default: ""
  36865. },
  36866. disabledVoidColor: {
  36867. type: String,
  36868. default: ""
  36869. },
  36870. icons: {
  36871. type: definePropType([Array, Object]),
  36872. default: () => [
  36873. star_filled_default,
  36874. star_filled_default,
  36875. star_filled_default
  36876. ]
  36877. },
  36878. voidIcon: {
  36879. type: iconPropType,
  36880. default: () => star_default
  36881. },
  36882. disabledVoidIcon: {
  36883. type: iconPropType,
  36884. default: () => star_filled_default
  36885. },
  36886. disabled: {
  36887. type: Boolean,
  36888. default: void 0
  36889. },
  36890. allowHalf: Boolean,
  36891. showText: Boolean,
  36892. showScore: Boolean,
  36893. textColor: {
  36894. type: String,
  36895. default: ""
  36896. },
  36897. texts: {
  36898. type: definePropType(Array),
  36899. default: () => mutable([
  36900. "Extremely bad",
  36901. "Disappointed",
  36902. "Fair",
  36903. "Satisfied",
  36904. "Surprise"
  36905. ])
  36906. },
  36907. scoreTemplate: {
  36908. type: String,
  36909. default: "{value}"
  36910. },
  36911. size: useSizeProp,
  36912. clearable: Boolean,
  36913. ...useAriaProps(["ariaLabel"])
  36914. });
  36915. const rateEmits = {
  36916. [CHANGE_EVENT]: (value) => isNumber(value),
  36917. [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
  36918. };
  36919. //#endregion
  36920. //#region ../../packages/components/rate/src/rate.vue?vue&type=script&setup=true&lang.ts
  36921. const _hoisted_1$23 = [
  36922. "id",
  36923. "aria-label",
  36924. "aria-labelledby",
  36925. "aria-valuenow",
  36926. "aria-valuetext",
  36927. "aria-valuemax",
  36928. "tabindex",
  36929. "aria-disabled"
  36930. ];
  36931. const _hoisted_2$14 = ["onMousemove", "onClick"];
  36932. var rate_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  36933. name: "ElRate",
  36934. __name: "rate",
  36935. props: rateProps,
  36936. emits: rateEmits,
  36937. setup(__props, { expose: __expose, emit: __emit }) {
  36938. function getValueFromMap(value, map) {
  36939. const isExcludedObject = (val) => isObject$1(val);
  36940. const matchedValue = map[Object.keys(map).map((key) => +key).filter((key) => {
  36941. const val = map[key];
  36942. return (isExcludedObject(val) ? val.excluded : false) ? value < key : value <= key;
  36943. }).sort((a, b) => a - b)[0]];
  36944. return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
  36945. }
  36946. const props = __props;
  36947. const emit = __emit;
  36948. const formItemContext = inject(formItemContextKey, void 0);
  36949. const rateSize = useFormSize();
  36950. const ns = useNamespace("rate");
  36951. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext });
  36952. const currentValue = ref(clamp$1(props.modelValue, 0, props.max));
  36953. const hoverIndex = ref(-1);
  36954. const pointerAtLeftHalf = ref(true);
  36955. const iconRefs = ref([]);
  36956. const iconClientWidths = computed(() => iconRefs.value.map((icon) => icon.$el.clientWidth));
  36957. const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]);
  36958. const rateDisabled = useFormDisabled();
  36959. const rateStyles = computed(() => {
  36960. return ns.cssVarBlock({
  36961. "void-color": props.voidColor,
  36962. "disabled-void-color": props.disabledVoidColor,
  36963. "fill-color": activeColor.value
  36964. });
  36965. });
  36966. const text = computed(() => {
  36967. let result = "";
  36968. if (props.showScore) result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
  36969. else if (props.showText) result = props.texts[Math.ceil(currentValue.value) - 1];
  36970. return result;
  36971. });
  36972. const valueDecimal = computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
  36973. const colorMap = computed(() => isArray$1(props.colors) ? {
  36974. [props.lowThreshold]: props.colors[0],
  36975. [props.highThreshold]: {
  36976. value: props.colors[1],
  36977. excluded: true
  36978. },
  36979. [props.max]: props.colors[2]
  36980. } : props.colors);
  36981. const activeColor = computed(() => {
  36982. const color = getValueFromMap(currentValue.value, colorMap.value);
  36983. return isObject$1(color) ? "" : color;
  36984. });
  36985. const decimalStyle = computed(() => {
  36986. let width = "";
  36987. if (rateDisabled.value) width = `${valueDecimal.value}%`;
  36988. else if (props.allowHalf) width = "50%";
  36989. return {
  36990. color: activeColor.value,
  36991. width
  36992. };
  36993. });
  36994. const componentMap = computed(() => {
  36995. let icons = isArray$1(props.icons) ? [...props.icons] : { ...props.icons };
  36996. icons = markRaw(icons);
  36997. return isArray$1(icons) ? {
  36998. [props.lowThreshold]: icons[0],
  36999. [props.highThreshold]: {
  37000. value: icons[1],
  37001. excluded: true
  37002. },
  37003. [props.max]: icons[2]
  37004. } : icons;
  37005. });
  37006. const decimalIconComponent = computed(() => getValueFromMap(props.modelValue, componentMap.value));
  37007. const voidComponent = computed(() => rateDisabled.value ? isString(props.disabledVoidIcon) ? props.disabledVoidIcon : markRaw(props.disabledVoidIcon) : isString(props.voidIcon) ? props.voidIcon : markRaw(props.voidIcon));
  37008. const activeComponent = computed(() => getValueFromMap(currentValue.value, componentMap.value));
  37009. function showDecimalIcon(item) {
  37010. const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
  37011. const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - .5 <= currentValue.value && item > currentValue.value;
  37012. return showWhenDisabled || showWhenAllowHalf;
  37013. }
  37014. function emitValue(value) {
  37015. if (props.clearable && value === props.modelValue) value = 0;
  37016. emit(UPDATE_MODEL_EVENT, value);
  37017. if (props.modelValue !== value) emit(CHANGE_EVENT, value);
  37018. }
  37019. function selectValue(value) {
  37020. if (rateDisabled.value) return;
  37021. if (props.allowHalf && pointerAtLeftHalf.value) emitValue(currentValue.value);
  37022. else emitValue(value);
  37023. }
  37024. function handleKey(e) {
  37025. if (rateDisabled.value) return;
  37026. const code = getEventCode(e);
  37027. const step = props.allowHalf ? .5 : 1;
  37028. let _currentValue = currentValue.value;
  37029. switch (code) {
  37030. case EVENT_CODE.up:
  37031. case EVENT_CODE.right:
  37032. _currentValue += step;
  37033. break;
  37034. case EVENT_CODE.left:
  37035. case EVENT_CODE.down:
  37036. _currentValue -= step;
  37037. break;
  37038. }
  37039. _currentValue = clamp$1(_currentValue, 0, props.max);
  37040. if (_currentValue === currentValue.value) return;
  37041. e.stopPropagation();
  37042. e.preventDefault();
  37043. emit(UPDATE_MODEL_EVENT, _currentValue);
  37044. emit(CHANGE_EVENT, _currentValue);
  37045. return _currentValue;
  37046. }
  37047. function setCurrentValue(value, event) {
  37048. if (rateDisabled.value) return;
  37049. if (props.allowHalf && event) {
  37050. pointerAtLeftHalf.value = event.offsetX * 2 <= iconClientWidths.value[value - 1];
  37051. currentValue.value = pointerAtLeftHalf.value ? value - .5 : value;
  37052. } else currentValue.value = value;
  37053. hoverIndex.value = value;
  37054. }
  37055. function resetCurrentValue() {
  37056. if (rateDisabled.value) return;
  37057. if (props.allowHalf) pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  37058. currentValue.value = clamp$1(props.modelValue, 0, props.max);
  37059. hoverIndex.value = -1;
  37060. }
  37061. watch(() => props.modelValue, (val) => {
  37062. currentValue.value = clamp$1(val, 0, props.max);
  37063. pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  37064. });
  37065. if (!props.modelValue) emit(UPDATE_MODEL_EVENT, 0);
  37066. __expose({
  37067. setCurrentValue,
  37068. resetCurrentValue
  37069. });
  37070. return (_ctx, _cache) => {
  37071. return openBlock(), createElementBlock("div", {
  37072. id: unref(inputId),
  37073. class: normalizeClass([rateClasses.value, unref(ns).is("disabled", unref(rateDisabled))]),
  37074. role: "slider",
  37075. "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "rating" : void 0,
  37076. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItemContext)?.labelId : void 0,
  37077. "aria-valuenow": currentValue.value,
  37078. "aria-valuetext": text.value || void 0,
  37079. "aria-valuemin": "0",
  37080. "aria-valuemax": __props.max,
  37081. style: normalizeStyle(rateStyles.value),
  37082. tabindex: unref(rateDisabled) ? void 0 : 0,
  37083. "aria-disabled": unref(rateDisabled),
  37084. onKeydown: handleKey
  37085. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.max, (item, key) => {
  37086. return openBlock(), createElementBlock("span", {
  37087. key,
  37088. class: normalizeClass(unref(ns).e("item")),
  37089. onMousemove: ($event) => setCurrentValue(item, $event),
  37090. onMouseleave: resetCurrentValue,
  37091. onClick: ($event) => selectValue(item)
  37092. }, [createVNode(unref(ElIcon), {
  37093. ref_for: true,
  37094. ref_key: "iconRefs",
  37095. ref: iconRefs,
  37096. class: normalizeClass([
  37097. unref(ns).e("icon"),
  37098. { hover: hoverIndex.value === item },
  37099. unref(ns).is("active", item <= currentValue.value),
  37100. unref(ns).is("focus-visible", item === Math.ceil(currentValue.value || 1))
  37101. ])
  37102. }, {
  37103. default: withCtx(() => [
  37104. withDirectives((openBlock(), createBlock(resolveDynamicComponent(activeComponent.value), null, null, 512)), [[vShow, !showDecimalIcon(item) && item <= currentValue.value]]),
  37105. withDirectives((openBlock(), createBlock(resolveDynamicComponent(voidComponent.value), null, null, 512)), [[vShow, !showDecimalIcon(item) && item > currentValue.value]]),
  37106. withDirectives((openBlock(), createBlock(resolveDynamicComponent(voidComponent.value), { class: normalizeClass([unref(ns).em("decimal", "box")]) }, null, 8, ["class"])), [[vShow, showDecimalIcon(item)]]),
  37107. withDirectives(createVNode(unref(ElIcon), {
  37108. style: normalizeStyle(decimalStyle.value),
  37109. class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")])
  37110. }, {
  37111. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(decimalIconComponent.value)))]),
  37112. _: 1
  37113. }, 8, ["style", "class"]), [[vShow, showDecimalIcon(item)]])
  37114. ]),
  37115. _: 2
  37116. }, 1032, ["class"])], 42, _hoisted_2$14);
  37117. }), 128)), __props.showText || __props.showScore ? (openBlock(), createElementBlock("span", {
  37118. key: 0,
  37119. class: normalizeClass(unref(ns).e("text")),
  37120. style: normalizeStyle({ color: __props.textColor })
  37121. }, toDisplayString(text.value), 7)) : createCommentVNode("v-if", true)], 46, _hoisted_1$23);
  37122. };
  37123. }
  37124. });
  37125. //#endregion
  37126. //#region ../../packages/components/rate/src/rate.vue
  37127. var rate_default = rate_vue_vue_type_script_setup_true_lang_default;
  37128. //#endregion
  37129. //#region ../../packages/components/rate/index.ts
  37130. const ElRate = withInstall(rate_default);
  37131. //#endregion
  37132. //#region ../../packages/components/result/src/result.ts
  37133. const IconMap = {
  37134. primary: "icon-primary",
  37135. success: "icon-success",
  37136. warning: "icon-warning",
  37137. error: "icon-error",
  37138. info: "icon-info"
  37139. };
  37140. const IconComponentMap = {
  37141. [IconMap.primary]: info_filled_default,
  37142. [IconMap.success]: circle_check_filled_default,
  37143. [IconMap.warning]: warning_filled_default,
  37144. [IconMap.error]: circle_close_filled_default,
  37145. [IconMap.info]: info_filled_default
  37146. };
  37147. /**
  37148. * @deprecated Removed after 3.0.0, Use `ResultProps` instead.
  37149. */
  37150. const resultProps = buildProps({
  37151. title: {
  37152. type: String,
  37153. default: ""
  37154. },
  37155. subTitle: {
  37156. type: String,
  37157. default: ""
  37158. },
  37159. icon: {
  37160. type: String,
  37161. values: [
  37162. "primary",
  37163. "success",
  37164. "warning",
  37165. "info",
  37166. "error"
  37167. ],
  37168. default: "info"
  37169. }
  37170. });
  37171. //#endregion
  37172. //#region ../../packages/components/result/src/result.vue?vue&type=script&setup=true&lang.ts
  37173. var result_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  37174. name: "ElResult",
  37175. __name: "result",
  37176. props: resultProps,
  37177. setup(__props) {
  37178. const props = __props;
  37179. const ns = useNamespace("result");
  37180. const resultIcon = computed(() => {
  37181. const icon = props.icon;
  37182. const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
  37183. return {
  37184. class: iconClass,
  37185. component: IconComponentMap[iconClass] || IconComponentMap["icon-info"]
  37186. };
  37187. });
  37188. return (_ctx, _cache) => {
  37189. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [
  37190. createElementVNode("div", { class: normalizeClass(unref(ns).e("icon")) }, [renderSlot(_ctx.$slots, "icon", {}, () => [resultIcon.value.component ? (openBlock(), createBlock(resolveDynamicComponent(resultIcon.value.component), {
  37191. key: 0,
  37192. class: normalizeClass(resultIcon.value.class)
  37193. }, null, 8, ["class"])) : createCommentVNode("v-if", true)])], 2),
  37194. __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
  37195. key: 0,
  37196. class: normalizeClass(unref(ns).e("title"))
  37197. }, [renderSlot(_ctx.$slots, "title", {}, () => [createElementVNode("p", null, toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true),
  37198. __props.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
  37199. key: 1,
  37200. class: normalizeClass(unref(ns).e("subtitle"))
  37201. }, [renderSlot(_ctx.$slots, "sub-title", {}, () => [createElementVNode("p", null, toDisplayString(__props.subTitle), 1)])], 2)) : createCommentVNode("v-if", true),
  37202. _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
  37203. key: 2,
  37204. class: normalizeClass(unref(ns).e("extra"))
  37205. }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true)
  37206. ], 2);
  37207. };
  37208. }
  37209. });
  37210. //#endregion
  37211. //#region ../../packages/components/result/src/result.vue
  37212. var result_default = result_vue_vue_type_script_setup_true_lang_default;
  37213. //#endregion
  37214. //#region ../../packages/components/result/index.ts
  37215. const ElResult = withInstall(result_default);
  37216. //#endregion
  37217. //#region ../../node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js
  37218. var safeIsNaN = Number.isNaN || function ponyfill(value) {
  37219. return typeof value === "number" && value !== value;
  37220. };
  37221. function isEqual(first, second) {
  37222. if (first === second) return true;
  37223. if (safeIsNaN(first) && safeIsNaN(second)) return true;
  37224. return false;
  37225. }
  37226. function areInputsEqual(newInputs, lastInputs) {
  37227. if (newInputs.length !== lastInputs.length) return false;
  37228. for (var i = 0; i < newInputs.length; i++) if (!isEqual(newInputs[i], lastInputs[i])) return false;
  37229. return true;
  37230. }
  37231. function memoizeOne(resultFn, isEqual) {
  37232. if (isEqual === void 0) isEqual = areInputsEqual;
  37233. var cache = null;
  37234. function memoized() {
  37235. var newArgs = [];
  37236. for (var _i = 0; _i < arguments.length; _i++) newArgs[_i] = arguments[_i];
  37237. if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) return cache.lastResult;
  37238. var lastResult = resultFn.apply(this, newArgs);
  37239. cache = {
  37240. lastResult,
  37241. lastArgs: newArgs,
  37242. lastThis: this
  37243. };
  37244. return lastResult;
  37245. }
  37246. memoized.clear = function clear() {
  37247. cache = null;
  37248. };
  37249. return memoized;
  37250. }
  37251. //#endregion
  37252. //#region ../../packages/components/virtual-list/src/hooks/use-cache.ts
  37253. const useCache = () => {
  37254. const props = getCurrentInstance().proxy.$props;
  37255. return computed(() => {
  37256. const _getItemStyleCache = (_, __, ___) => ({});
  37257. return props.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
  37258. });
  37259. };
  37260. //#endregion
  37261. //#region ../../packages/components/virtual-list/src/defaults.ts
  37262. const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
  37263. const ITEM_RENDER_EVT = "itemRendered";
  37264. const SCROLL_EVT = "scroll";
  37265. const FORWARD = "forward";
  37266. const BACKWARD = "backward";
  37267. const AUTO_ALIGNMENT = "auto";
  37268. const SMART_ALIGNMENT = "smart";
  37269. const START_ALIGNMENT = "start";
  37270. const CENTERED_ALIGNMENT = "center";
  37271. const END_ALIGNMENT = "end";
  37272. const HORIZONTAL = "horizontal";
  37273. const VERTICAL = "vertical";
  37274. const LTR = "ltr";
  37275. const RTL = "rtl";
  37276. const RTL_OFFSET_NAG = "negative";
  37277. const RTL_OFFSET_POS_ASC = "positive-ascending";
  37278. const RTL_OFFSET_POS_DESC = "positive-descending";
  37279. const ScrollbarSizeKey = {
  37280. [HORIZONTAL]: "height",
  37281. [VERTICAL]: "width"
  37282. };
  37283. const ScrollbarDirKey = {
  37284. [HORIZONTAL]: "left",
  37285. [VERTICAL]: "top"
  37286. };
  37287. const SCROLLBAR_MIN_SIZE = 20;
  37288. //#endregion
  37289. //#region ../../packages/components/virtual-list/src/hooks/use-wheel.ts
  37290. const useWheel = ({ atEndEdge, atStartEdge, layout }, onWheelDelta) => {
  37291. let frameHandle;
  37292. let offset = 0;
  37293. const hasReachedEdge = (offset) => {
  37294. return offset < 0 && atStartEdge.value || offset > 0 && atEndEdge.value;
  37295. };
  37296. const onWheel = (e) => {
  37297. cAF(frameHandle);
  37298. let { deltaX, deltaY } = e;
  37299. if (e.shiftKey && deltaY !== 0) {
  37300. deltaX = deltaY;
  37301. deltaY = 0;
  37302. }
  37303. const newOffset = layout.value === HORIZONTAL ? deltaX : deltaY;
  37304. if (hasReachedEdge(newOffset)) return;
  37305. offset += newOffset;
  37306. if (!isFirefox() && newOffset !== 0) e.preventDefault();
  37307. frameHandle = rAF(() => {
  37308. onWheelDelta(offset);
  37309. offset = 0;
  37310. });
  37311. };
  37312. return {
  37313. hasReachedEdge,
  37314. onWheel
  37315. };
  37316. };
  37317. //#endregion
  37318. //#region ../../packages/components/virtual-list/src/props.ts
  37319. const itemSize$1 = buildProp({
  37320. type: definePropType([Number, Function]),
  37321. required: true
  37322. });
  37323. const estimatedItemSize = buildProp({ type: Number });
  37324. const cache = buildProp({
  37325. type: Number,
  37326. default: 2
  37327. });
  37328. const direction = buildProp({
  37329. type: String,
  37330. values: ["ltr", "rtl"],
  37331. default: "ltr"
  37332. });
  37333. const initScrollOffset = buildProp({
  37334. type: Number,
  37335. default: 0
  37336. });
  37337. const total = buildProp({
  37338. type: Number,
  37339. required: true
  37340. });
  37341. const layout = buildProp({
  37342. type: String,
  37343. values: ["horizontal", "vertical"],
  37344. default: VERTICAL
  37345. });
  37346. const virtualizedProps = buildProps({
  37347. className: {
  37348. type: String,
  37349. default: ""
  37350. },
  37351. containerElement: {
  37352. type: definePropType([String, Object]),
  37353. default: "div"
  37354. },
  37355. data: {
  37356. type: definePropType(Array),
  37357. default: () => mutable([])
  37358. },
  37359. direction,
  37360. height: {
  37361. type: [String, Number],
  37362. required: true
  37363. },
  37364. innerElement: {
  37365. type: [String, Object],
  37366. default: "div"
  37367. },
  37368. innerProps: {
  37369. type: definePropType(Object),
  37370. default: () => ({})
  37371. },
  37372. style: { type: definePropType([
  37373. Object,
  37374. String,
  37375. Array
  37376. ]) },
  37377. useIsScrolling: Boolean,
  37378. width: {
  37379. type: [Number, String],
  37380. required: false
  37381. },
  37382. perfMode: {
  37383. type: Boolean,
  37384. default: true
  37385. },
  37386. scrollbarAlwaysOn: Boolean
  37387. });
  37388. const virtualizedListProps = buildProps({
  37389. cache,
  37390. estimatedItemSize,
  37391. layout,
  37392. initScrollOffset,
  37393. total,
  37394. itemSize: itemSize$1,
  37395. ...virtualizedProps
  37396. });
  37397. const scrollbarSize = {
  37398. type: Number,
  37399. default: 6
  37400. };
  37401. const startGap = {
  37402. type: Number,
  37403. default: 0
  37404. };
  37405. const endGap = {
  37406. type: Number,
  37407. default: 2
  37408. };
  37409. const virtualizedGridProps = buildProps({
  37410. columnCache: cache,
  37411. columnWidth: itemSize$1,
  37412. estimatedColumnWidth: estimatedItemSize,
  37413. estimatedRowHeight: estimatedItemSize,
  37414. initScrollLeft: initScrollOffset,
  37415. initScrollTop: initScrollOffset,
  37416. itemKey: {
  37417. type: definePropType(Function),
  37418. default: ({ columnIndex, rowIndex }) => `${rowIndex}:${columnIndex}`
  37419. },
  37420. rowCache: cache,
  37421. rowHeight: itemSize$1,
  37422. totalColumn: total,
  37423. totalRow: total,
  37424. hScrollbarSize: scrollbarSize,
  37425. vScrollbarSize: scrollbarSize,
  37426. scrollbarStartGap: startGap,
  37427. scrollbarEndGap: endGap,
  37428. role: String,
  37429. ...virtualizedProps
  37430. });
  37431. const virtualizedScrollbarProps = buildProps({
  37432. alwaysOn: Boolean,
  37433. class: String,
  37434. layout,
  37435. total,
  37436. ratio: {
  37437. type: Number,
  37438. required: true
  37439. },
  37440. clientSize: {
  37441. type: Number,
  37442. required: true
  37443. },
  37444. scrollFrom: {
  37445. type: Number,
  37446. required: true
  37447. },
  37448. scrollbarSize,
  37449. startGap,
  37450. endGap,
  37451. visible: Boolean
  37452. });
  37453. //#endregion
  37454. //#region ../../packages/components/virtual-list/src/utils.ts
  37455. const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
  37456. const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
  37457. const isRTL = (dir) => dir === RTL;
  37458. let cachedRTLResult = null;
  37459. function getRTLOffsetType(recalculate = false) {
  37460. if (cachedRTLResult === null || recalculate) {
  37461. const outerDiv = document.createElement("div");
  37462. const outerStyle = outerDiv.style;
  37463. outerStyle.width = "50px";
  37464. outerStyle.height = "50px";
  37465. outerStyle.overflow = "scroll";
  37466. outerStyle.direction = "rtl";
  37467. const innerDiv = document.createElement("div");
  37468. const innerStyle = innerDiv.style;
  37469. innerStyle.width = "100px";
  37470. innerStyle.height = "100px";
  37471. outerDiv.appendChild(innerDiv);
  37472. document.body.appendChild(outerDiv);
  37473. if (outerDiv.scrollLeft > 0) cachedRTLResult = RTL_OFFSET_POS_DESC;
  37474. else {
  37475. outerDiv.scrollLeft = 1;
  37476. if (outerDiv.scrollLeft === 0) cachedRTLResult = RTL_OFFSET_NAG;
  37477. else cachedRTLResult = RTL_OFFSET_POS_ASC;
  37478. }
  37479. document.body.removeChild(outerDiv);
  37480. return cachedRTLResult;
  37481. }
  37482. return cachedRTLResult;
  37483. }
  37484. function renderThumbStyle$1({ move, size, bar }, layout) {
  37485. const style = {};
  37486. const translate = `translate${bar.axis}(${move}px)`;
  37487. style[bar.size] = size;
  37488. style.transform = translate;
  37489. if (layout === "horizontal") style.height = "100%";
  37490. else style.width = "100%";
  37491. return style;
  37492. }
  37493. //#endregion
  37494. //#region ../../packages/components/virtual-list/src/components/scrollbar.ts
  37495. const ScrollBar = defineComponent({
  37496. name: "ElVirtualScrollBar",
  37497. props: virtualizedScrollbarProps,
  37498. emits: [
  37499. "scroll",
  37500. "start-move",
  37501. "stop-move"
  37502. ],
  37503. setup(props, { emit }) {
  37504. const GAP = computed(() => props.startGap + props.endGap);
  37505. const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
  37506. const nsScrollbar = useNamespace("scrollbar");
  37507. const trackRef = ref();
  37508. const thumbRef = ref();
  37509. let frameHandle = null;
  37510. let onselectstartStore = null;
  37511. const state = reactive({
  37512. isDragging: false,
  37513. traveled: 0
  37514. });
  37515. const bar = computed(() => BAR_MAP[props.layout]);
  37516. const trackSize = computed(() => props.clientSize - unref(GAP));
  37517. const trackStyle = computed(() => ({
  37518. position: "absolute",
  37519. width: `${HORIZONTAL === props.layout ? trackSize.value : props.scrollbarSize}px`,
  37520. height: `${HORIZONTAL === props.layout ? props.scrollbarSize : trackSize.value}px`,
  37521. [ScrollbarDirKey[props.layout]]: "2px",
  37522. right: "2px",
  37523. bottom: "2px",
  37524. borderRadius: "4px"
  37525. }));
  37526. const thumbSize = computed(() => {
  37527. const ratio = props.ratio;
  37528. if (ratio >= 100) return Number.POSITIVE_INFINITY;
  37529. if (ratio >= 50) return ratio * trackSize.value / 100;
  37530. const SCROLLBAR_MAX_SIZE = trackSize.value / 3;
  37531. return Math.floor(Math.min(Math.max(ratio * trackSize.value / 100, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
  37532. });
  37533. const thumbStyle = computed(() => {
  37534. if (!Number.isFinite(thumbSize.value)) return { display: "none" };
  37535. const thumb = `${thumbSize.value}px`;
  37536. return renderThumbStyle$1({
  37537. bar: bar.value,
  37538. size: thumb,
  37539. move: state.traveled
  37540. }, props.layout);
  37541. });
  37542. const totalSteps = computed(() => Math.ceil(props.clientSize - thumbSize.value - unref(GAP)));
  37543. const attachEvents = () => {
  37544. window.addEventListener("mousemove", onMouseMove);
  37545. window.addEventListener("mouseup", onMouseUp);
  37546. const thumbEl = unref(thumbRef);
  37547. if (!thumbEl) return;
  37548. onselectstartStore = document.onselectstart;
  37549. document.onselectstart = () => false;
  37550. thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
  37551. thumbEl.addEventListener("touchend", onMouseUp);
  37552. };
  37553. const detachEvents = () => {
  37554. window.removeEventListener("mousemove", onMouseMove);
  37555. window.removeEventListener("mouseup", onMouseUp);
  37556. document.onselectstart = onselectstartStore;
  37557. onselectstartStore = null;
  37558. const thumbEl = unref(thumbRef);
  37559. if (!thumbEl) return;
  37560. thumbEl.removeEventListener("touchmove", onMouseMove);
  37561. thumbEl.removeEventListener("touchend", onMouseUp);
  37562. };
  37563. const onThumbMouseDown = (e) => {
  37564. e.stopImmediatePropagation();
  37565. if (e.ctrlKey || [1, 2].includes(e.button)) return;
  37566. state.isDragging = true;
  37567. state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
  37568. emit("start-move");
  37569. attachEvents();
  37570. };
  37571. const onMouseUp = () => {
  37572. state.isDragging = false;
  37573. state[bar.value.axis] = 0;
  37574. emit("stop-move");
  37575. detachEvents();
  37576. };
  37577. const onMouseMove = (e) => {
  37578. const { isDragging } = state;
  37579. if (!isDragging) return;
  37580. if (!thumbRef.value || !trackRef.value) return;
  37581. const prevPage = state[bar.value.axis];
  37582. if (!prevPage) return;
  37583. cAF(frameHandle);
  37584. /**
  37585. * +--------------+ +--------------+
  37586. * | - <--------- thumb.offsetTop | |
  37587. * | |+| <--+ | |
  37588. * | - | | |
  37589. * | Content | | | |
  37590. * | | | | |
  37591. * | | | | |
  37592. * | | | | -
  37593. * | | +--> | |+|
  37594. * | | | -
  37595. * +--------------+ +--------------+
  37596. */
  37597. const distance = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumbRef.value[bar.value.offset] - prevPage);
  37598. frameHandle = rAF(() => {
  37599. state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
  37600. emit("scroll", distance, totalSteps.value);
  37601. });
  37602. };
  37603. const clickTrackHandler = (e) => {
  37604. const distance = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumbRef.value[bar.value.offset] / 2;
  37605. state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
  37606. emit("scroll", distance, totalSteps.value);
  37607. };
  37608. watch(() => props.scrollFrom, (v) => {
  37609. if (state.isDragging) return;
  37610. /**
  37611. * this is simply mapping the current scrollbar offset
  37612. *
  37613. * formula 1:
  37614. * v = scrollOffset / (estimatedTotalSize - clientSize)
  37615. * traveled = v * (clientSize - thumbSize - GAP) --> v * totalSteps
  37616. *
  37617. * formula 2:
  37618. * traveled = (v * clientSize) / (clientSize / totalSteps) --> (v * clientSize) * (totalSteps / clientSize) --> v * totalSteps
  37619. */
  37620. state.traveled = Math.ceil(v * totalSteps.value);
  37621. });
  37622. onBeforeUnmount(() => {
  37623. detachEvents();
  37624. });
  37625. return () => {
  37626. return h("div", {
  37627. role: "presentation",
  37628. ref: trackRef,
  37629. class: [
  37630. nsVirtualScrollbar.b(),
  37631. props.class,
  37632. (props.alwaysOn || state.isDragging) && "always-on"
  37633. ],
  37634. style: trackStyle.value,
  37635. onMousedown: withModifiers(clickTrackHandler, ["stop", "prevent"]),
  37636. onTouchstartPrevent: onThumbMouseDown
  37637. }, h("div", {
  37638. ref: thumbRef,
  37639. class: nsScrollbar.e("thumb"),
  37640. style: thumbStyle.value,
  37641. onMousedown: onThumbMouseDown
  37642. }, []));
  37643. };
  37644. }
  37645. });
  37646. //#endregion
  37647. //#region ../../packages/components/virtual-list/src/builders/build-list.ts
  37648. const createList = ({ name, getOffset, getItemSize, getItemOffset, getEstimatedTotalSize, getStartIndexForOffset, getStopIndexForStartIndex, initCache, clearCache, validateProps }) => {
  37649. return defineComponent({
  37650. name: name ?? "ElVirtualList",
  37651. props: virtualizedListProps,
  37652. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  37653. setup(props, { emit, expose }) {
  37654. validateProps(props);
  37655. const instance = getCurrentInstance();
  37656. const ns = useNamespace("vl");
  37657. const dynamicSizeCache = ref(initCache(props, instance));
  37658. const getItemStyleCache = useCache();
  37659. const windowRef = ref();
  37660. const innerRef = ref();
  37661. const scrollbarRef = ref();
  37662. const states = ref({
  37663. isScrolling: false,
  37664. scrollDir: "forward",
  37665. scrollOffset: isNumber(props.initScrollOffset) ? props.initScrollOffset : 0,
  37666. updateRequested: false,
  37667. isScrollbarDragging: false,
  37668. scrollbarAlwaysOn: props.scrollbarAlwaysOn
  37669. });
  37670. const itemsToRender = computed(() => {
  37671. const { total, cache } = props;
  37672. const { isScrolling, scrollDir, scrollOffset } = unref(states);
  37673. if (total === 0) return [
  37674. 0,
  37675. 0,
  37676. 0,
  37677. 0
  37678. ];
  37679. const startIndex = getStartIndexForOffset(props, scrollOffset, unref(dynamicSizeCache));
  37680. const stopIndex = getStopIndexForStartIndex(props, startIndex, scrollOffset, unref(dynamicSizeCache));
  37681. const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache) : 1;
  37682. const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache) : 1;
  37683. return [
  37684. Math.max(0, startIndex - cacheBackward),
  37685. Math.max(0, Math.min(total - 1, stopIndex + cacheForward)),
  37686. startIndex,
  37687. stopIndex
  37688. ];
  37689. });
  37690. const estimatedTotalSize = computed(() => getEstimatedTotalSize(props, unref(dynamicSizeCache)));
  37691. const _isHorizontal = computed(() => isHorizontal(props.layout));
  37692. const windowStyle = computed(() => [
  37693. {
  37694. position: "relative",
  37695. [`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
  37696. WebkitOverflowScrolling: "touch",
  37697. willChange: "transform"
  37698. },
  37699. {
  37700. direction: props.direction,
  37701. height: isNumber(props.height) ? `${props.height}px` : props.height,
  37702. width: isNumber(props.width) ? `${props.width}px` : props.width
  37703. },
  37704. props.style
  37705. ]);
  37706. const innerStyle = computed(() => {
  37707. const size = unref(estimatedTotalSize);
  37708. const horizontal = unref(_isHorizontal);
  37709. return {
  37710. height: horizontal ? "100%" : `${size}px`,
  37711. pointerEvents: unref(states).isScrolling ? "none" : void 0,
  37712. width: horizontal ? `${size}px` : "100%",
  37713. margin: 0,
  37714. boxSizing: "border-box"
  37715. };
  37716. });
  37717. const clientSize = computed(() => _isHorizontal.value ? props.width : props.height);
  37718. const { onWheel } = useWheel({
  37719. atStartEdge: computed(() => states.value.scrollOffset <= 0),
  37720. atEndEdge: computed(() => states.value.scrollOffset >= estimatedTotalSize.value),
  37721. layout: computed(() => props.layout)
  37722. }, (offset) => {
  37723. scrollbarRef.value.onMouseUp?.();
  37724. scrollTo(Math.min(states.value.scrollOffset + offset, estimatedTotalSize.value - clientSize.value));
  37725. });
  37726. useEventListener(windowRef, "wheel", onWheel, { passive: false });
  37727. const emitEvents = () => {
  37728. const { total } = props;
  37729. if (total > 0) {
  37730. const [cacheStart, cacheEnd, visibleStart, visibleEnd] = unref(itemsToRender);
  37731. emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
  37732. }
  37733. const { scrollDir, scrollOffset, updateRequested } = unref(states);
  37734. emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
  37735. };
  37736. const scrollVertically = (e) => {
  37737. const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
  37738. const _states = unref(states);
  37739. if (_states.scrollOffset === scrollTop) return;
  37740. const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
  37741. states.value = {
  37742. ..._states,
  37743. isScrolling: true,
  37744. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  37745. scrollOffset,
  37746. updateRequested: false
  37747. };
  37748. nextTick(resetIsScrolling);
  37749. };
  37750. const scrollHorizontally = (e) => {
  37751. const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
  37752. const _states = unref(states);
  37753. if (_states.scrollOffset === scrollLeft) return;
  37754. const { direction } = props;
  37755. let scrollOffset = scrollLeft;
  37756. if (direction === RTL) switch (getRTLOffsetType()) {
  37757. case RTL_OFFSET_NAG:
  37758. scrollOffset = -scrollLeft;
  37759. break;
  37760. case RTL_OFFSET_POS_DESC:
  37761. scrollOffset = scrollWidth - clientWidth - scrollLeft;
  37762. break;
  37763. }
  37764. scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
  37765. states.value = {
  37766. ..._states,
  37767. isScrolling: true,
  37768. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  37769. scrollOffset,
  37770. updateRequested: false
  37771. };
  37772. nextTick(resetIsScrolling);
  37773. };
  37774. const onScroll = (e) => {
  37775. unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
  37776. emitEvents();
  37777. };
  37778. const onScrollbarScroll = (distanceToGo, totalSteps) => {
  37779. const offset = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
  37780. scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset));
  37781. };
  37782. const scrollTo = (offset) => {
  37783. offset = Math.max(offset, 0);
  37784. if (offset === unref(states).scrollOffset) return;
  37785. states.value = {
  37786. ...unref(states),
  37787. scrollOffset: offset,
  37788. scrollDir: getScrollDir(unref(states).scrollOffset, offset),
  37789. updateRequested: true
  37790. };
  37791. nextTick(resetIsScrolling);
  37792. };
  37793. const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
  37794. const { scrollOffset } = unref(states);
  37795. idx = Math.max(0, Math.min(idx, props.total - 1));
  37796. scrollTo(getOffset(props, idx, alignment, scrollOffset, unref(dynamicSizeCache)));
  37797. };
  37798. const getItemStyle = (idx) => {
  37799. const { direction, itemSize, layout } = props;
  37800. const itemStyleCache = getItemStyleCache.value(clearCache && itemSize, clearCache && layout, clearCache && direction);
  37801. let style;
  37802. if (hasOwn(itemStyleCache, String(idx))) style = itemStyleCache[idx];
  37803. else {
  37804. const offset = getItemOffset(props, idx, unref(dynamicSizeCache));
  37805. const size = getItemSize(props, idx, unref(dynamicSizeCache));
  37806. const horizontal = unref(_isHorizontal);
  37807. const isRtl = direction === RTL;
  37808. const offsetHorizontal = horizontal ? offset : 0;
  37809. itemStyleCache[idx] = style = {
  37810. position: "absolute",
  37811. left: isRtl ? void 0 : `${offsetHorizontal}px`,
  37812. right: isRtl ? `${offsetHorizontal}px` : void 0,
  37813. top: !horizontal ? `${offset}px` : 0,
  37814. height: !horizontal ? `${size}px` : "100%",
  37815. width: horizontal ? `${size}px` : "100%"
  37816. };
  37817. }
  37818. return style;
  37819. };
  37820. const resetIsScrolling = () => {
  37821. states.value.isScrolling = false;
  37822. nextTick(() => {
  37823. getItemStyleCache.value(-1, null, null);
  37824. });
  37825. };
  37826. const resetScrollTop = () => {
  37827. const window = windowRef.value;
  37828. if (window) window.scrollTop = 0;
  37829. };
  37830. onMounted(() => {
  37831. if (!isClient) return;
  37832. const { initScrollOffset } = props;
  37833. const windowElement = unref(windowRef);
  37834. if (isNumber(initScrollOffset) && windowElement) if (unref(_isHorizontal)) windowElement.scrollLeft = initScrollOffset;
  37835. else windowElement.scrollTop = initScrollOffset;
  37836. emitEvents();
  37837. });
  37838. onUpdated(() => {
  37839. const { direction, layout } = props;
  37840. const { scrollOffset, updateRequested } = unref(states);
  37841. const windowElement = unref(windowRef);
  37842. if (updateRequested && windowElement) if (layout === HORIZONTAL) if (direction === RTL) switch (getRTLOffsetType()) {
  37843. case RTL_OFFSET_NAG:
  37844. windowElement.scrollLeft = -scrollOffset;
  37845. break;
  37846. case RTL_OFFSET_POS_ASC:
  37847. windowElement.scrollLeft = scrollOffset;
  37848. break;
  37849. default: {
  37850. const { clientWidth, scrollWidth } = windowElement;
  37851. windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
  37852. break;
  37853. }
  37854. }
  37855. else windowElement.scrollLeft = scrollOffset;
  37856. else windowElement.scrollTop = scrollOffset;
  37857. });
  37858. onActivated(() => {
  37859. unref(windowRef).scrollTop = unref(states).scrollOffset;
  37860. });
  37861. const api = {
  37862. ns,
  37863. clientSize,
  37864. estimatedTotalSize,
  37865. windowStyle,
  37866. windowRef,
  37867. innerRef,
  37868. innerStyle,
  37869. itemsToRender,
  37870. scrollbarRef,
  37871. states,
  37872. getItemStyle,
  37873. onScroll,
  37874. onScrollbarScroll,
  37875. onWheel,
  37876. scrollTo,
  37877. scrollToItem,
  37878. resetScrollTop
  37879. };
  37880. expose({
  37881. windowRef,
  37882. innerRef,
  37883. getItemStyleCache,
  37884. scrollTo,
  37885. scrollToItem,
  37886. resetScrollTop,
  37887. states
  37888. });
  37889. return api;
  37890. },
  37891. render(ctx) {
  37892. const { $slots, className, clientSize, containerElement, data, getItemStyle, innerElement, itemsToRender, innerStyle, layout, total, onScroll, onScrollbarScroll, states, useIsScrolling, windowStyle, ns } = ctx;
  37893. const [start, end] = itemsToRender;
  37894. const Container = resolveDynamicComponent(containerElement);
  37895. const Inner = resolveDynamicComponent(innerElement);
  37896. const children = [];
  37897. if (total > 0) for (let i = start; i <= end; i++) children.push(h(Fragment, { key: i }, $slots.default?.({
  37898. data,
  37899. index: i,
  37900. isScrolling: useIsScrolling ? states.isScrolling : void 0,
  37901. style: getItemStyle(i)
  37902. })));
  37903. const InnerNode = [h(Inner, mergeProps(ctx.innerProps, {
  37904. style: innerStyle,
  37905. ref: "innerRef"
  37906. }), !isString(Inner) ? { default: () => children } : children)];
  37907. const scrollbar = h(ScrollBar, {
  37908. ref: "scrollbarRef",
  37909. clientSize,
  37910. layout,
  37911. onScroll: onScrollbarScroll,
  37912. ratio: clientSize * 100 / this.estimatedTotalSize,
  37913. scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
  37914. total,
  37915. alwaysOn: states.scrollbarAlwaysOn
  37916. });
  37917. const listContainer = h(Container, {
  37918. class: [ns.e("window"), className],
  37919. style: windowStyle,
  37920. onScroll,
  37921. ref: "windowRef",
  37922. key: 0
  37923. }, !isString(Container) ? { default: () => [InnerNode] } : [InnerNode]);
  37924. return h("div", {
  37925. key: 0,
  37926. class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
  37927. }, [listContainer, scrollbar]);
  37928. }
  37929. });
  37930. };
  37931. //#endregion
  37932. //#region ../../packages/components/virtual-list/src/components/fixed-size-list.ts
  37933. const FixedSizeList = createList({
  37934. name: "ElFixedSizeList",
  37935. getItemOffset: ({ itemSize }, index) => index * itemSize,
  37936. getItemSize: ({ itemSize }) => itemSize,
  37937. getEstimatedTotalSize: ({ total, itemSize }) => itemSize * total,
  37938. getOffset: ({ height, total, itemSize, layout, width }, index, alignment, scrollOffset) => {
  37939. const size = isHorizontal(layout) ? width : height;
  37940. const lastItemOffset = Math.max(0, total * itemSize - size);
  37941. const maxOffset = Math.min(lastItemOffset, index * itemSize);
  37942. const minOffset = Math.max(0, (index + 1) * itemSize - size);
  37943. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  37944. else alignment = CENTERED_ALIGNMENT;
  37945. switch (alignment) {
  37946. case START_ALIGNMENT: return maxOffset;
  37947. case END_ALIGNMENT: return minOffset;
  37948. case CENTERED_ALIGNMENT: {
  37949. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  37950. if (middleOffset < Math.ceil(size / 2)) return 0;
  37951. else if (middleOffset > lastItemOffset + Math.floor(size / 2)) return lastItemOffset;
  37952. else return middleOffset;
  37953. }
  37954. case AUTO_ALIGNMENT:
  37955. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  37956. else if (scrollOffset < minOffset) return minOffset;
  37957. else return maxOffset;
  37958. }
  37959. },
  37960. getStartIndexForOffset: ({ total, itemSize }, offset) => Math.max(0, Math.min(total - 1, Math.floor(offset / itemSize))),
  37961. getStopIndexForStartIndex: ({ height, total, itemSize, layout, width }, startIndex, scrollOffset) => {
  37962. const offset = startIndex * itemSize;
  37963. const size = isHorizontal(layout) ? width : height;
  37964. const numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
  37965. return Math.max(0, Math.min(total - 1, startIndex + numVisibleItems - 1));
  37966. },
  37967. initCache() {},
  37968. clearCache: true,
  37969. validateProps() {}
  37970. });
  37971. //#endregion
  37972. //#region ../../packages/components/virtual-list/src/components/dynamic-size-list.ts
  37973. const getItemFromCache$1 = (props, index, listCache) => {
  37974. const { itemSize } = props;
  37975. const { items, lastVisitedIndex } = listCache;
  37976. if (index > lastVisitedIndex) {
  37977. let offset = 0;
  37978. if (lastVisitedIndex >= 0) {
  37979. const item = items[lastVisitedIndex];
  37980. offset = item.offset + item.size;
  37981. }
  37982. for (let i = lastVisitedIndex + 1; i <= index; i++) {
  37983. const size = itemSize(i);
  37984. items[i] = {
  37985. offset,
  37986. size
  37987. };
  37988. offset += size;
  37989. }
  37990. listCache.lastVisitedIndex = index;
  37991. }
  37992. return items[index];
  37993. };
  37994. const findItem$1 = (props, listCache, offset) => {
  37995. const { items, lastVisitedIndex } = listCache;
  37996. if ((lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0) >= offset) return bs$1(props, listCache, 0, lastVisitedIndex, offset);
  37997. return es$1(props, listCache, Math.max(0, lastVisitedIndex), offset);
  37998. };
  37999. const bs$1 = (props, listCache, low, high, offset) => {
  38000. while (low <= high) {
  38001. const mid = low + Math.floor((high - low) / 2);
  38002. const currentOffset = getItemFromCache$1(props, mid, listCache).offset;
  38003. if (currentOffset === offset) return mid;
  38004. else if (currentOffset < offset) low = mid + 1;
  38005. else if (currentOffset > offset) high = mid - 1;
  38006. }
  38007. return Math.max(0, low - 1);
  38008. };
  38009. const es$1 = (props, listCache, index, offset) => {
  38010. const { total } = props;
  38011. let exponent = 1;
  38012. while (index < total && getItemFromCache$1(props, index, listCache).offset < offset) {
  38013. index += exponent;
  38014. exponent *= 2;
  38015. }
  38016. return bs$1(props, listCache, Math.floor(index / 2), Math.min(index, total - 1), offset);
  38017. };
  38018. const getEstimatedTotalSize = ({ total }, { items, estimatedItemSize, lastVisitedIndex }) => {
  38019. let totalSizeOfMeasuredItems = 0;
  38020. if (lastVisitedIndex >= total) lastVisitedIndex = total - 1;
  38021. if (lastVisitedIndex >= 0) {
  38022. const item = items[lastVisitedIndex];
  38023. totalSizeOfMeasuredItems = item.offset + item.size;
  38024. }
  38025. const totalSizeOfUnmeasuredItems = (total - lastVisitedIndex - 1) * estimatedItemSize;
  38026. return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
  38027. };
  38028. const DynamicSizeList = createList({
  38029. name: "ElDynamicSizeList",
  38030. getItemOffset: (props, index, listCache) => getItemFromCache$1(props, index, listCache).offset,
  38031. getItemSize: (_, index, { items }) => items[index].size,
  38032. getEstimatedTotalSize,
  38033. getOffset: (props, index, alignment, scrollOffset, listCache) => {
  38034. const { height, layout, width } = props;
  38035. const size = isHorizontal(layout) ? width : height;
  38036. const item = getItemFromCache$1(props, index, listCache);
  38037. const estimatedTotalSize = getEstimatedTotalSize(props, listCache);
  38038. const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
  38039. const minOffset = Math.max(0, item.offset - size + item.size);
  38040. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  38041. else alignment = CENTERED_ALIGNMENT;
  38042. switch (alignment) {
  38043. case START_ALIGNMENT: return maxOffset;
  38044. case END_ALIGNMENT: return minOffset;
  38045. case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2);
  38046. case AUTO_ALIGNMENT:
  38047. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  38048. else if (scrollOffset < minOffset) return minOffset;
  38049. else return maxOffset;
  38050. }
  38051. },
  38052. getStartIndexForOffset: (props, offset, listCache) => findItem$1(props, listCache, offset),
  38053. getStopIndexForStartIndex: (props, startIndex, scrollOffset, listCache) => {
  38054. const { height, total, layout, width } = props;
  38055. const size = isHorizontal(layout) ? width : height;
  38056. const item = getItemFromCache$1(props, startIndex, listCache);
  38057. const maxOffset = scrollOffset + size;
  38058. let offset = item.offset + item.size;
  38059. let stopIndex = startIndex;
  38060. while (stopIndex < total - 1 && offset < maxOffset) {
  38061. stopIndex++;
  38062. offset += getItemFromCache$1(props, stopIndex, listCache).size;
  38063. }
  38064. return stopIndex;
  38065. },
  38066. initCache({ estimatedItemSize = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
  38067. const cache = {
  38068. items: {},
  38069. estimatedItemSize,
  38070. lastVisitedIndex: -1
  38071. };
  38072. cache.clearCacheAfterIndex = (index, forceUpdate = true) => {
  38073. cache.lastVisitedIndex = Math.min(cache.lastVisitedIndex, index - 1);
  38074. instance.exposed?.getItemStyleCache(-1);
  38075. if (forceUpdate) instance.proxy?.$forceUpdate();
  38076. };
  38077. return cache;
  38078. },
  38079. clearCache: false,
  38080. validateProps: ({ itemSize }) => {}
  38081. });
  38082. //#endregion
  38083. //#region ../../packages/components/virtual-list/src/hooks/use-grid-wheel.ts
  38084. const useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => {
  38085. let frameHandle = null;
  38086. let xOffset = 0;
  38087. let yOffset = 0;
  38088. const hasReachedEdge = (x, y) => {
  38089. const xEdgeReached = x < 0 && atXStartEdge.value || x > 0 && atXEndEdge.value;
  38090. const yEdgeReached = y < 0 && atYStartEdge.value || y > 0 && atYEndEdge.value;
  38091. return xEdgeReached || yEdgeReached;
  38092. };
  38093. const onWheel = (e) => {
  38094. cAF(frameHandle);
  38095. let x = e.deltaX;
  38096. let y = e.deltaY;
  38097. if (Math.abs(x) > Math.abs(y)) y = 0;
  38098. else x = 0;
  38099. if (e.shiftKey && y !== 0) {
  38100. x = y;
  38101. y = 0;
  38102. }
  38103. if (hasReachedEdge(x, y)) {
  38104. if (e.deltaX !== 0 && x === 0) e.preventDefault();
  38105. return;
  38106. }
  38107. xOffset += x;
  38108. yOffset += y;
  38109. e.preventDefault();
  38110. frameHandle = rAF(() => {
  38111. onWheelDelta(xOffset, yOffset);
  38112. xOffset = 0;
  38113. yOffset = 0;
  38114. });
  38115. };
  38116. return {
  38117. hasReachedEdge,
  38118. onWheel
  38119. };
  38120. };
  38121. //#endregion
  38122. //#region ../../packages/components/virtual-list/src/hooks/use-grid-touch.ts
  38123. const useGridTouch = (windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight) => {
  38124. const touchStartX = ref(0);
  38125. const touchStartY = ref(0);
  38126. let frameHandle;
  38127. let deltaX = 0;
  38128. let deltaY = 0;
  38129. const handleTouchStart = (event) => {
  38130. cAF(frameHandle);
  38131. touchStartX.value = event.touches[0].clientX;
  38132. touchStartY.value = event.touches[0].clientY;
  38133. deltaX = 0;
  38134. deltaY = 0;
  38135. };
  38136. const handleTouchMove = (event) => {
  38137. event.preventDefault();
  38138. cAF(frameHandle);
  38139. deltaX += touchStartX.value - event.touches[0].clientX;
  38140. deltaY += touchStartY.value - event.touches[0].clientY;
  38141. touchStartX.value = event.touches[0].clientX;
  38142. touchStartY.value = event.touches[0].clientY;
  38143. frameHandle = rAF(() => {
  38144. const maxScrollLeft = estimatedTotalWidth.value - unref(parsedWidth);
  38145. const maxScrollTop = estimatedTotalHeight.value - unref(parsedHeight);
  38146. scrollTo({
  38147. scrollLeft: Math.min(states.value.scrollLeft + deltaX, maxScrollLeft),
  38148. scrollTop: Math.min(states.value.scrollTop + deltaY, maxScrollTop)
  38149. });
  38150. deltaX = 0;
  38151. deltaY = 0;
  38152. });
  38153. };
  38154. useEventListener(windowRef, "touchstart", handleTouchStart, { passive: true });
  38155. useEventListener(windowRef, "touchmove", handleTouchMove, { passive: false });
  38156. return {
  38157. touchStartX,
  38158. touchStartY,
  38159. handleTouchStart,
  38160. handleTouchMove
  38161. };
  38162. };
  38163. //#endregion
  38164. //#region ../../packages/components/virtual-list/src/builders/build-grid.ts
  38165. const createGrid = ({ name, clearCache, getColumnPosition, getColumnStartIndexForOffset, getColumnStopIndexForStartIndex, getEstimatedTotalHeight, getEstimatedTotalWidth, getColumnOffset, getRowOffset, getRowPosition, getRowStartIndexForOffset, getRowStopIndexForStartIndex, initCache, injectToInstance, validateProps }) => {
  38166. return defineComponent({
  38167. name: name ?? "ElVirtualList",
  38168. props: virtualizedGridProps,
  38169. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  38170. setup(props, { emit, expose, slots }) {
  38171. const ns = useNamespace("vl");
  38172. validateProps(props);
  38173. const instance = getCurrentInstance();
  38174. const cache = ref(initCache(props, instance));
  38175. injectToInstance?.(instance, cache);
  38176. const windowRef = ref();
  38177. const hScrollbar = ref();
  38178. const vScrollbar = ref();
  38179. const innerRef = ref();
  38180. const states = ref({
  38181. isScrolling: false,
  38182. scrollLeft: isNumber(props.initScrollLeft) ? props.initScrollLeft : 0,
  38183. scrollTop: isNumber(props.initScrollTop) ? props.initScrollTop : 0,
  38184. updateRequested: false,
  38185. xAxisScrollDir: FORWARD,
  38186. yAxisScrollDir: FORWARD
  38187. });
  38188. const getItemStyleCache = useCache();
  38189. const parsedHeight = computed(() => Number.parseInt(`${props.height}`, 10));
  38190. const parsedWidth = computed(() => Number.parseInt(`${props.width}`, 10));
  38191. const columnsToRender = computed(() => {
  38192. const { totalColumn, totalRow, columnCache } = props;
  38193. const { isScrolling, xAxisScrollDir, scrollLeft } = unref(states);
  38194. if (totalColumn === 0 || totalRow === 0) return [
  38195. 0,
  38196. 0,
  38197. 0,
  38198. 0
  38199. ];
  38200. const startIndex = getColumnStartIndexForOffset(props, scrollLeft, unref(cache));
  38201. const stopIndex = getColumnStopIndexForStartIndex(props, startIndex, scrollLeft, unref(cache));
  38202. const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1;
  38203. const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1;
  38204. return [
  38205. Math.max(0, startIndex - cacheBackward),
  38206. Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)),
  38207. startIndex,
  38208. stopIndex
  38209. ];
  38210. });
  38211. const rowsToRender = computed(() => {
  38212. const { totalColumn, totalRow, rowCache } = props;
  38213. const { isScrolling, yAxisScrollDir, scrollTop } = unref(states);
  38214. if (totalColumn === 0 || totalRow === 0) return [
  38215. 0,
  38216. 0,
  38217. 0,
  38218. 0
  38219. ];
  38220. const startIndex = getRowStartIndexForOffset(props, scrollTop, unref(cache));
  38221. const stopIndex = getRowStopIndexForStartIndex(props, startIndex, scrollTop, unref(cache));
  38222. const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1;
  38223. const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1;
  38224. return [
  38225. Math.max(0, startIndex - cacheBackward),
  38226. Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)),
  38227. startIndex,
  38228. stopIndex
  38229. ];
  38230. });
  38231. const estimatedTotalHeight = computed(() => getEstimatedTotalHeight(props, unref(cache)));
  38232. const estimatedTotalWidth = computed(() => getEstimatedTotalWidth(props, unref(cache)));
  38233. const windowStyle = computed(() => [
  38234. {
  38235. position: "relative",
  38236. overflow: "hidden",
  38237. WebkitOverflowScrolling: "touch",
  38238. willChange: "transform"
  38239. },
  38240. {
  38241. direction: props.direction,
  38242. height: isNumber(props.height) ? `${props.height}px` : props.height,
  38243. width: isNumber(props.width) ? `${props.width}px` : props.width
  38244. },
  38245. props.style ?? {}
  38246. ]);
  38247. const innerStyle = computed(() => {
  38248. const width = `${unref(estimatedTotalWidth)}px`;
  38249. return {
  38250. height: `${unref(estimatedTotalHeight)}px`,
  38251. pointerEvents: unref(states).isScrolling ? "none" : void 0,
  38252. width,
  38253. margin: 0,
  38254. boxSizing: "border-box"
  38255. };
  38256. });
  38257. const emitEvents = () => {
  38258. const { totalColumn, totalRow } = props;
  38259. if (totalColumn > 0 && totalRow > 0) {
  38260. const [columnCacheStart, columnCacheEnd, columnVisibleStart, columnVisibleEnd] = unref(columnsToRender);
  38261. const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = unref(rowsToRender);
  38262. emit(ITEM_RENDER_EVT, {
  38263. columnCacheStart,
  38264. columnCacheEnd,
  38265. rowCacheStart,
  38266. rowCacheEnd,
  38267. columnVisibleStart,
  38268. columnVisibleEnd,
  38269. rowVisibleStart,
  38270. rowVisibleEnd
  38271. });
  38272. }
  38273. const { scrollLeft, scrollTop, updateRequested, xAxisScrollDir, yAxisScrollDir } = unref(states);
  38274. emit(SCROLL_EVT, {
  38275. xAxisScrollDir,
  38276. scrollLeft,
  38277. yAxisScrollDir,
  38278. scrollTop,
  38279. updateRequested
  38280. });
  38281. };
  38282. const onScroll = (e) => {
  38283. const { clientHeight, clientWidth, scrollHeight, scrollLeft, scrollTop, scrollWidth } = e.currentTarget;
  38284. const _states = unref(states);
  38285. if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) return;
  38286. let _scrollLeft = scrollLeft;
  38287. if (isRTL(props.direction)) switch (getRTLOffsetType()) {
  38288. case RTL_OFFSET_NAG:
  38289. _scrollLeft = -scrollLeft;
  38290. break;
  38291. case RTL_OFFSET_POS_DESC:
  38292. _scrollLeft = scrollWidth - clientWidth - scrollLeft;
  38293. break;
  38294. }
  38295. states.value = {
  38296. ..._states,
  38297. isScrolling: true,
  38298. scrollLeft: _scrollLeft,
  38299. scrollTop: Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)),
  38300. updateRequested: true,
  38301. xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft),
  38302. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop)
  38303. };
  38304. nextTick(() => resetIsScrolling());
  38305. onUpdated();
  38306. emitEvents();
  38307. };
  38308. const onVerticalScroll = (distance, totalSteps) => {
  38309. const height = unref(parsedHeight);
  38310. const offset = (estimatedTotalHeight.value - height) / totalSteps * distance;
  38311. scrollTo({ scrollTop: Math.min(estimatedTotalHeight.value - height, offset) });
  38312. };
  38313. const onHorizontalScroll = (distance, totalSteps) => {
  38314. const width = unref(parsedWidth);
  38315. const offset = (estimatedTotalWidth.value - width) / totalSteps * distance;
  38316. scrollTo({ scrollLeft: Math.min(estimatedTotalWidth.value - width, offset) });
  38317. };
  38318. const { onWheel } = useGridWheel({
  38319. atXStartEdge: computed(() => states.value.scrollLeft <= 0),
  38320. atXEndEdge: computed(() => states.value.scrollLeft >= estimatedTotalWidth.value - unref(parsedWidth)),
  38321. atYStartEdge: computed(() => states.value.scrollTop <= 0),
  38322. atYEndEdge: computed(() => states.value.scrollTop >= estimatedTotalHeight.value - unref(parsedHeight))
  38323. }, (x, y) => {
  38324. hScrollbar.value?.onMouseUp?.();
  38325. vScrollbar.value?.onMouseUp?.();
  38326. const width = unref(parsedWidth);
  38327. const height = unref(parsedHeight);
  38328. scrollTo({
  38329. scrollLeft: Math.min(states.value.scrollLeft + x, estimatedTotalWidth.value - width),
  38330. scrollTop: Math.min(states.value.scrollTop + y, estimatedTotalHeight.value - height)
  38331. });
  38332. });
  38333. useEventListener(windowRef, "wheel", onWheel, { passive: false });
  38334. const scrollTo = ({ scrollLeft = states.value.scrollLeft, scrollTop = states.value.scrollTop }) => {
  38335. scrollLeft = Math.max(scrollLeft, 0);
  38336. scrollTop = Math.max(scrollTop, 0);
  38337. const _states = unref(states);
  38338. if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) return;
  38339. states.value = {
  38340. ..._states,
  38341. xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft),
  38342. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop),
  38343. scrollLeft,
  38344. scrollTop,
  38345. updateRequested: true
  38346. };
  38347. nextTick(() => resetIsScrolling());
  38348. onUpdated();
  38349. emitEvents();
  38350. };
  38351. const { touchStartX, touchStartY, handleTouchStart, handleTouchMove } = useGridTouch(windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight);
  38352. const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => {
  38353. const _states = unref(states);
  38354. columnIdx = Math.max(0, Math.min(columnIdx, props.totalColumn - 1));
  38355. rowIndex = Math.max(0, Math.min(rowIndex, props.totalRow - 1));
  38356. const scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  38357. const _cache = unref(cache);
  38358. const estimatedHeight = getEstimatedTotalHeight(props, _cache);
  38359. const estimatedWidth = getEstimatedTotalWidth(props, _cache);
  38360. scrollTo({
  38361. scrollLeft: getColumnOffset(props, columnIdx, alignment, _states.scrollLeft, _cache, estimatedWidth > props.width ? scrollBarWidth : 0),
  38362. scrollTop: getRowOffset(props, rowIndex, alignment, _states.scrollTop, _cache, estimatedHeight > props.height ? scrollBarWidth : 0)
  38363. });
  38364. };
  38365. const getItemStyle = (rowIndex, columnIndex) => {
  38366. const { columnWidth, direction, rowHeight } = props;
  38367. const itemStyleCache = getItemStyleCache.value(clearCache && columnWidth, clearCache && rowHeight, clearCache && direction);
  38368. const key = `${rowIndex},${columnIndex}`;
  38369. if (hasOwn(itemStyleCache, key)) return itemStyleCache[key];
  38370. else {
  38371. const [, left] = getColumnPosition(props, columnIndex, unref(cache));
  38372. const _cache = unref(cache);
  38373. const rtl = isRTL(direction);
  38374. const [height, top] = getRowPosition(props, rowIndex, _cache);
  38375. const [width] = getColumnPosition(props, columnIndex, _cache);
  38376. itemStyleCache[key] = {
  38377. position: "absolute",
  38378. left: rtl ? void 0 : `${left}px`,
  38379. right: rtl ? `${left}px` : void 0,
  38380. top: `${top}px`,
  38381. height: `${height}px`,
  38382. width: `${width}px`
  38383. };
  38384. return itemStyleCache[key];
  38385. }
  38386. };
  38387. const resetIsScrolling = () => {
  38388. states.value.isScrolling = false;
  38389. nextTick(() => {
  38390. getItemStyleCache.value(-1, null, null);
  38391. });
  38392. };
  38393. onMounted(() => {
  38394. if (!isClient) return;
  38395. const { initScrollLeft, initScrollTop } = props;
  38396. const windowElement = unref(windowRef);
  38397. if (windowElement) {
  38398. if (isNumber(initScrollLeft)) windowElement.scrollLeft = initScrollLeft;
  38399. if (isNumber(initScrollTop)) windowElement.scrollTop = initScrollTop;
  38400. }
  38401. emitEvents();
  38402. });
  38403. const onUpdated = () => {
  38404. const { direction } = props;
  38405. const { scrollLeft, scrollTop, updateRequested } = unref(states);
  38406. const windowElement = unref(windowRef);
  38407. if (updateRequested && windowElement) {
  38408. if (direction === RTL) switch (getRTLOffsetType()) {
  38409. case RTL_OFFSET_NAG:
  38410. windowElement.scrollLeft = -scrollLeft;
  38411. break;
  38412. case RTL_OFFSET_POS_ASC:
  38413. windowElement.scrollLeft = scrollLeft;
  38414. break;
  38415. default: {
  38416. const { clientWidth, scrollWidth } = windowElement;
  38417. windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft;
  38418. break;
  38419. }
  38420. }
  38421. else windowElement.scrollLeft = Math.max(0, scrollLeft);
  38422. windowElement.scrollTop = Math.max(0, scrollTop);
  38423. }
  38424. };
  38425. const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy;
  38426. expose({
  38427. windowRef,
  38428. innerRef,
  38429. getItemStyleCache,
  38430. touchStartX,
  38431. touchStartY,
  38432. handleTouchStart,
  38433. handleTouchMove,
  38434. scrollTo,
  38435. scrollToItem,
  38436. states,
  38437. resetAfterColumnIndex,
  38438. resetAfterRowIndex,
  38439. resetAfter
  38440. });
  38441. const renderScrollbars = () => {
  38442. const { scrollbarAlwaysOn, scrollbarStartGap, scrollbarEndGap, totalColumn, totalRow } = props;
  38443. const width = unref(parsedWidth);
  38444. const height = unref(parsedHeight);
  38445. const estimatedWidth = unref(estimatedTotalWidth);
  38446. const estimatedHeight = unref(estimatedTotalHeight);
  38447. const { scrollLeft, scrollTop } = unref(states);
  38448. return {
  38449. horizontalScrollbar: h(ScrollBar, {
  38450. ref: hScrollbar,
  38451. alwaysOn: scrollbarAlwaysOn,
  38452. startGap: scrollbarStartGap,
  38453. endGap: scrollbarEndGap,
  38454. class: ns.e("horizontal"),
  38455. clientSize: width,
  38456. layout: "horizontal",
  38457. onScroll: onHorizontalScroll,
  38458. ratio: width * 100 / estimatedWidth,
  38459. scrollFrom: scrollLeft / (estimatedWidth - width),
  38460. total: totalRow,
  38461. visible: true
  38462. }),
  38463. verticalScrollbar: h(ScrollBar, {
  38464. ref: vScrollbar,
  38465. alwaysOn: scrollbarAlwaysOn,
  38466. startGap: scrollbarStartGap,
  38467. endGap: scrollbarEndGap,
  38468. class: ns.e("vertical"),
  38469. clientSize: height,
  38470. layout: "vertical",
  38471. onScroll: onVerticalScroll,
  38472. ratio: height * 100 / estimatedHeight,
  38473. scrollFrom: scrollTop / (estimatedHeight - height),
  38474. total: totalColumn,
  38475. visible: true
  38476. })
  38477. };
  38478. };
  38479. const renderItems = () => {
  38480. const [columnStart, columnEnd] = unref(columnsToRender);
  38481. const [rowStart, rowEnd] = unref(rowsToRender);
  38482. const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props;
  38483. const children = [];
  38484. if (totalRow > 0 && totalColumn > 0) for (let row = rowStart; row <= rowEnd; row++) for (let column = columnStart; column <= columnEnd; column++) {
  38485. const key = itemKey({
  38486. columnIndex: column,
  38487. data,
  38488. rowIndex: row
  38489. });
  38490. children.push(h(Fragment, { key }, slots.default?.({
  38491. columnIndex: column,
  38492. data,
  38493. isScrolling: useIsScrolling ? unref(states).isScrolling : void 0,
  38494. style: getItemStyle(row, column),
  38495. rowIndex: row
  38496. })));
  38497. }
  38498. return children;
  38499. };
  38500. const renderInner = () => {
  38501. const Inner = resolveDynamicComponent(props.innerElement);
  38502. const children = renderItems();
  38503. return [h(Inner, mergeProps(props.innerProps, {
  38504. style: unref(innerStyle),
  38505. ref: innerRef
  38506. }), !isString(Inner) ? { default: () => children } : children)];
  38507. };
  38508. const renderWindow = () => {
  38509. const Container = resolveDynamicComponent(props.containerElement);
  38510. const { horizontalScrollbar, verticalScrollbar } = renderScrollbars();
  38511. const Inner = renderInner();
  38512. return h("div", {
  38513. key: 0,
  38514. class: ns.e("wrapper"),
  38515. role: props.role
  38516. }, [
  38517. h(Container, {
  38518. class: props.className,
  38519. style: unref(windowStyle),
  38520. onScroll,
  38521. ref: windowRef
  38522. }, !isString(Container) ? { default: () => Inner } : Inner),
  38523. horizontalScrollbar,
  38524. verticalScrollbar
  38525. ]);
  38526. };
  38527. return renderWindow;
  38528. }
  38529. });
  38530. };
  38531. //#endregion
  38532. //#region ../../packages/components/virtual-list/src/components/fixed-size-grid.ts
  38533. const FixedSizeGrid = createGrid({
  38534. name: "ElFixedSizeGrid",
  38535. getColumnPosition: ({ columnWidth }, index) => [columnWidth, index * columnWidth],
  38536. getRowPosition: ({ rowHeight }, index) => [rowHeight, index * rowHeight],
  38537. getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow,
  38538. getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn,
  38539. getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _, scrollBarWidth) => {
  38540. width = Number(width);
  38541. const lastColumnOffset = Math.max(0, totalColumn * columnWidth - width);
  38542. const maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth);
  38543. const minOffset = Math.max(0, columnIndex * columnWidth - width + scrollBarWidth + columnWidth);
  38544. if (alignment === "smart") if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) alignment = AUTO_ALIGNMENT;
  38545. else alignment = CENTERED_ALIGNMENT;
  38546. switch (alignment) {
  38547. case START_ALIGNMENT: return maxOffset;
  38548. case END_ALIGNMENT: return minOffset;
  38549. case CENTERED_ALIGNMENT: {
  38550. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  38551. if (middleOffset < Math.ceil(width / 2)) return 0;
  38552. else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) return lastColumnOffset;
  38553. else return middleOffset;
  38554. }
  38555. case AUTO_ALIGNMENT:
  38556. default: if (scrollLeft >= minOffset && scrollLeft <= maxOffset) return scrollLeft;
  38557. else if (minOffset > maxOffset) return minOffset;
  38558. else if (scrollLeft < minOffset) return minOffset;
  38559. else return maxOffset;
  38560. }
  38561. },
  38562. getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _, scrollBarWidth) => {
  38563. height = Number(height);
  38564. const lastRowOffset = Math.max(0, totalRow * rowHeight - height);
  38565. const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
  38566. const minOffset = Math.max(0, rowIndex * rowHeight - height + scrollBarWidth + rowHeight);
  38567. if (align === SMART_ALIGNMENT) if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) align = AUTO_ALIGNMENT;
  38568. else align = CENTERED_ALIGNMENT;
  38569. switch (align) {
  38570. case START_ALIGNMENT: return maxOffset;
  38571. case END_ALIGNMENT: return minOffset;
  38572. case CENTERED_ALIGNMENT: {
  38573. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  38574. if (middleOffset < Math.ceil(height / 2)) return 0;
  38575. else if (middleOffset > lastRowOffset + Math.floor(height / 2)) return lastRowOffset;
  38576. else return middleOffset;
  38577. }
  38578. case AUTO_ALIGNMENT:
  38579. default: if (scrollTop >= minOffset && scrollTop <= maxOffset) return scrollTop;
  38580. else if (minOffset > maxOffset) return minOffset;
  38581. else if (scrollTop < minOffset) return minOffset;
  38582. else return maxOffset;
  38583. }
  38584. },
  38585. getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(0, Math.min(totalColumn - 1, Math.floor(scrollLeft / columnWidth))),
  38586. getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => {
  38587. const left = startIndex * columnWidth;
  38588. const visibleColumnsCount = Math.ceil((width + scrollLeft - left) / columnWidth);
  38589. return Math.max(0, Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1));
  38590. },
  38591. getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(0, Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))),
  38592. getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => {
  38593. const top = startIndex * rowHeight;
  38594. const numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight);
  38595. return Math.max(0, Math.min(totalRow - 1, startIndex + numVisibleRows - 1));
  38596. },
  38597. initCache: () => void 0,
  38598. clearCache: true,
  38599. validateProps: ({ columnWidth, rowHeight }) => {}
  38600. });
  38601. //#endregion
  38602. //#region ../../packages/components/virtual-list/src/components/dynamic-size-grid.ts
  38603. const { max, min, floor } = Math;
  38604. const ACCESS_SIZER_KEY_MAP = {
  38605. column: "columnWidth",
  38606. row: "rowHeight"
  38607. };
  38608. const ACCESS_LAST_VISITED_KEY_MAP = {
  38609. column: "lastVisitedColumnIndex",
  38610. row: "lastVisitedRowIndex"
  38611. };
  38612. const getItemFromCache = (props, index, gridCache, type) => {
  38613. const [cachedItems, sizer, lastVisited] = [
  38614. gridCache[type],
  38615. props[ACCESS_SIZER_KEY_MAP[type]],
  38616. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
  38617. ];
  38618. if (index > lastVisited) {
  38619. let offset = 0;
  38620. if (lastVisited >= 0) {
  38621. const item = cachedItems[lastVisited];
  38622. offset = item.offset + item.size;
  38623. }
  38624. for (let i = lastVisited + 1; i <= index; i++) {
  38625. const size = sizer(i);
  38626. cachedItems[i] = {
  38627. offset,
  38628. size
  38629. };
  38630. offset += size;
  38631. }
  38632. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index;
  38633. }
  38634. return cachedItems[index];
  38635. };
  38636. const bs = (props, gridCache, low, high, offset, type) => {
  38637. while (low <= high) {
  38638. const mid = low + floor((high - low) / 2);
  38639. const currentOffset = getItemFromCache(props, mid, gridCache, type).offset;
  38640. if (currentOffset === offset) return mid;
  38641. else if (currentOffset < offset) low = mid + 1;
  38642. else high = mid - 1;
  38643. }
  38644. return max(0, low - 1);
  38645. };
  38646. const es = (props, gridCache, idx, offset, type) => {
  38647. const total = type === "column" ? props.totalColumn : props.totalRow;
  38648. let exponent = 1;
  38649. while (idx < total && getItemFromCache(props, idx, gridCache, type).offset < offset) {
  38650. idx += exponent;
  38651. exponent *= 2;
  38652. }
  38653. return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
  38654. };
  38655. const findItem = (props, gridCache, offset, type) => {
  38656. const [cache, lastVisitedIndex] = [gridCache[type], gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]];
  38657. if ((lastVisitedIndex > 0 ? cache[lastVisitedIndex].offset : 0) >= offset) return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
  38658. return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
  38659. };
  38660. const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
  38661. let sizeOfVisitedRows = 0;
  38662. if (lastVisitedRowIndex >= totalRow) lastVisitedRowIndex = totalRow - 1;
  38663. if (lastVisitedRowIndex >= 0) {
  38664. const item = row[lastVisitedRowIndex];
  38665. sizeOfVisitedRows = item.offset + item.size;
  38666. }
  38667. const sizeOfUnvisitedItems = (totalRow - lastVisitedRowIndex - 1) * estimatedRowHeight;
  38668. return sizeOfVisitedRows + sizeOfUnvisitedItems;
  38669. };
  38670. const getEstimatedTotalWidth = ({ totalColumn }, { column, estimatedColumnWidth, lastVisitedColumnIndex }) => {
  38671. let sizeOfVisitedColumns = 0;
  38672. if (lastVisitedColumnIndex > totalColumn) lastVisitedColumnIndex = totalColumn - 1;
  38673. if (lastVisitedColumnIndex >= 0) {
  38674. const item = column[lastVisitedColumnIndex];
  38675. sizeOfVisitedColumns = item.offset + item.size;
  38676. }
  38677. const sizeOfUnvisitedItems = (totalColumn - lastVisitedColumnIndex - 1) * estimatedColumnWidth;
  38678. return sizeOfVisitedColumns + sizeOfUnvisitedItems;
  38679. };
  38680. const ACCESS_ESTIMATED_SIZE_KEY_MAP = {
  38681. column: getEstimatedTotalWidth,
  38682. row: getEstimatedTotalHeight
  38683. };
  38684. const getOffset$1 = (props, index, alignment, scrollOffset, cache, type, scrollBarWidth) => {
  38685. const [size, estimatedSizeAssociates] = [type === "row" ? props.height : props.width, ACCESS_ESTIMATED_SIZE_KEY_MAP[type]];
  38686. const item = getItemFromCache(props, index, cache, type);
  38687. const maxOffset = max(0, min(estimatedSizeAssociates(props, cache) - size, item.offset));
  38688. const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
  38689. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  38690. else alignment = CENTERED_ALIGNMENT;
  38691. switch (alignment) {
  38692. case START_ALIGNMENT: return maxOffset;
  38693. case END_ALIGNMENT: return minOffset;
  38694. case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2);
  38695. case AUTO_ALIGNMENT:
  38696. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  38697. else if (minOffset > maxOffset) return minOffset;
  38698. else if (scrollOffset < minOffset) return minOffset;
  38699. else return maxOffset;
  38700. }
  38701. };
  38702. const DynamicSizeGrid = createGrid({
  38703. name: "ElDynamicSizeGrid",
  38704. getColumnPosition: (props, idx, cache) => {
  38705. const item = getItemFromCache(props, idx, cache, "column");
  38706. return [item.size, item.offset];
  38707. },
  38708. getRowPosition: (props, idx, cache) => {
  38709. const item = getItemFromCache(props, idx, cache, "row");
  38710. return [item.size, item.offset];
  38711. },
  38712. getColumnOffset: (props, columnIndex, alignment, scrollLeft, cache, scrollBarWidth) => getOffset$1(props, columnIndex, alignment, scrollLeft, cache, "column", scrollBarWidth),
  38713. getRowOffset: (props, rowIndex, alignment, scrollTop, cache, scrollBarWidth) => getOffset$1(props, rowIndex, alignment, scrollTop, cache, "row", scrollBarWidth),
  38714. getColumnStartIndexForOffset: (props, scrollLeft, cache) => findItem(props, cache, scrollLeft, "column"),
  38715. getColumnStopIndexForStartIndex: (props, startIndex, scrollLeft, cache) => {
  38716. const item = getItemFromCache(props, startIndex, cache, "column");
  38717. const maxOffset = scrollLeft + props.width;
  38718. let offset = item.offset + item.size;
  38719. let stopIndex = startIndex;
  38720. while (stopIndex < props.totalColumn - 1 && offset < maxOffset) {
  38721. stopIndex++;
  38722. offset += getItemFromCache(props, startIndex, cache, "column").size;
  38723. }
  38724. return stopIndex;
  38725. },
  38726. getEstimatedTotalHeight,
  38727. getEstimatedTotalWidth,
  38728. getRowStartIndexForOffset: (props, scrollTop, cache) => findItem(props, cache, scrollTop, "row"),
  38729. getRowStopIndexForStartIndex: (props, startIndex, scrollTop, cache) => {
  38730. const { totalRow, height } = props;
  38731. const item = getItemFromCache(props, startIndex, cache, "row");
  38732. const maxOffset = scrollTop + height;
  38733. let offset = item.size + item.offset;
  38734. let stopIndex = startIndex;
  38735. while (stopIndex < totalRow - 1 && offset < maxOffset) {
  38736. stopIndex++;
  38737. offset += getItemFromCache(props, stopIndex, cache, "row").size;
  38738. }
  38739. return stopIndex;
  38740. },
  38741. injectToInstance: (instance, cache) => {
  38742. const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => {
  38743. forceUpdate = isUndefined(forceUpdate) ? true : forceUpdate;
  38744. if (isNumber(columnIndex)) cache.value.lastVisitedColumnIndex = Math.min(cache.value.lastVisitedColumnIndex, columnIndex - 1);
  38745. if (isNumber(rowIndex)) cache.value.lastVisitedRowIndex = Math.min(cache.value.lastVisitedRowIndex, rowIndex - 1);
  38746. instance.exposed?.getItemStyleCache.value(-1, null, null);
  38747. if (forceUpdate) instance.proxy?.$forceUpdate();
  38748. };
  38749. const resetAfterColumnIndex = (columnIndex, forceUpdate) => {
  38750. resetAfter({ columnIndex }, forceUpdate);
  38751. };
  38752. const resetAfterRowIndex = (rowIndex, forceUpdate) => {
  38753. resetAfter({ rowIndex }, forceUpdate);
  38754. };
  38755. Object.assign(instance.proxy, {
  38756. resetAfterColumnIndex,
  38757. resetAfterRowIndex,
  38758. resetAfter
  38759. });
  38760. },
  38761. initCache: ({ estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE, estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }) => {
  38762. return {
  38763. column: {},
  38764. estimatedColumnWidth,
  38765. estimatedRowHeight,
  38766. lastVisitedColumnIndex: -1,
  38767. lastVisitedRowIndex: -1,
  38768. row: {}
  38769. };
  38770. },
  38771. clearCache: false,
  38772. validateProps: ({ columnWidth, rowHeight }) => {}
  38773. });
  38774. //#endregion
  38775. //#region ../../packages/components/select-v2/src/group-item.vue?vue&type=script&lang.ts
  38776. var group_item_vue_vue_type_script_lang_default = defineComponent({
  38777. props: {
  38778. item: {
  38779. type: Object,
  38780. required: true
  38781. },
  38782. style: { type: Object },
  38783. height: Number
  38784. },
  38785. setup() {
  38786. return { ns: useNamespace("select") };
  38787. }
  38788. });
  38789. //#endregion
  38790. //#region ../../packages/components/select-v2/src/group-item.vue
  38791. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  38792. return openBlock(), createElementBlock("div", {
  38793. class: normalizeClass(_ctx.ns.be("group", "title")),
  38794. style: normalizeStyle({
  38795. ..._ctx.style,
  38796. lineHeight: `${_ctx.height}px`
  38797. })
  38798. }, toDisplayString(_ctx.item.label), 7);
  38799. }
  38800. var group_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(group_item_vue_vue_type_script_lang_default, [["render", _sfc_render$7]]);
  38801. //#endregion
  38802. //#region ../../packages/components/select-v2/src/useOption.ts
  38803. function useOption(props, { emit }) {
  38804. return {
  38805. hoverItem: () => {
  38806. if (!props.disabled) emit("hover", props.index);
  38807. },
  38808. selectOptionClick: () => {
  38809. if (!props.disabled) emit("select", props.item, props.index);
  38810. }
  38811. };
  38812. }
  38813. //#endregion
  38814. //#region ../../packages/components/select-v2/src/defaults.ts
  38815. const selectV2Props = buildProps({
  38816. allowCreate: Boolean,
  38817. autocomplete: {
  38818. type: definePropType(String),
  38819. default: "none"
  38820. },
  38821. automaticDropdown: Boolean,
  38822. clearable: Boolean,
  38823. clearIcon: {
  38824. type: iconPropType,
  38825. default: circle_close_default
  38826. },
  38827. effect: {
  38828. type: definePropType(String),
  38829. default: "light"
  38830. },
  38831. collapseTags: Boolean,
  38832. collapseTagsTooltip: Boolean,
  38833. tagTooltip: {
  38834. type: definePropType(Object),
  38835. default: () => ({})
  38836. },
  38837. maxCollapseTags: {
  38838. type: Number,
  38839. default: 1
  38840. },
  38841. defaultFirstOption: Boolean,
  38842. disabled: {
  38843. type: Boolean,
  38844. default: void 0
  38845. },
  38846. estimatedOptionHeight: {
  38847. type: Number,
  38848. default: void 0
  38849. },
  38850. filterable: Boolean,
  38851. filterMethod: { type: definePropType(Function) },
  38852. height: {
  38853. type: Number,
  38854. default: 274
  38855. },
  38856. itemHeight: {
  38857. type: Number,
  38858. default: 34
  38859. },
  38860. id: String,
  38861. loading: Boolean,
  38862. loadingText: String,
  38863. modelValue: {
  38864. type: definePropType([
  38865. Array,
  38866. String,
  38867. Number,
  38868. Boolean,
  38869. Object
  38870. ]),
  38871. default: void 0
  38872. },
  38873. multiple: Boolean,
  38874. multipleLimit: {
  38875. type: Number,
  38876. default: 0
  38877. },
  38878. name: String,
  38879. noDataText: String,
  38880. noMatchText: String,
  38881. remoteMethod: { type: definePropType(Function) },
  38882. reserveKeyword: {
  38883. type: Boolean,
  38884. default: true
  38885. },
  38886. options: {
  38887. type: definePropType(Array),
  38888. required: true
  38889. },
  38890. placeholder: { type: String },
  38891. teleported: useTooltipContentProps.teleported,
  38892. persistent: {
  38893. type: Boolean,
  38894. default: true
  38895. },
  38896. popperClass: useTooltipContentProps.popperClass,
  38897. popperStyle: useTooltipContentProps.popperStyle,
  38898. popperOptions: {
  38899. type: definePropType(Object),
  38900. default: () => ({})
  38901. },
  38902. remote: Boolean,
  38903. debounce: {
  38904. type: Number,
  38905. default: 300
  38906. },
  38907. size: useSizeProp,
  38908. props: {
  38909. type: definePropType(Object),
  38910. default: () => defaultProps$2
  38911. },
  38912. valueKey: {
  38913. type: String,
  38914. default: "value"
  38915. },
  38916. scrollbarAlwaysOn: Boolean,
  38917. validateEvent: {
  38918. type: Boolean,
  38919. default: true
  38920. },
  38921. offset: {
  38922. type: Number,
  38923. default: 12
  38924. },
  38925. remoteShowSuffix: Boolean,
  38926. showArrow: {
  38927. type: Boolean,
  38928. default: true
  38929. },
  38930. placement: {
  38931. type: definePropType(String),
  38932. values: Ee,
  38933. default: "bottom-start"
  38934. },
  38935. fallbackPlacements: {
  38936. type: definePropType(Array),
  38937. default: [
  38938. "bottom-start",
  38939. "top-start",
  38940. "right",
  38941. "left"
  38942. ]
  38943. },
  38944. tagType: {
  38945. ...tagProps.type,
  38946. default: "info"
  38947. },
  38948. tagEffect: {
  38949. ...tagProps.effect,
  38950. default: "light"
  38951. },
  38952. tabindex: {
  38953. type: [String, Number],
  38954. default: 0
  38955. },
  38956. appendTo: useTooltipContentProps.appendTo,
  38957. fitInputWidth: {
  38958. type: [Boolean, Number],
  38959. default: true,
  38960. validator(val) {
  38961. return isBoolean(val) || isNumber(val);
  38962. }
  38963. },
  38964. suffixIcon: {
  38965. type: iconPropType,
  38966. default: arrow_down_default
  38967. },
  38968. ...useEmptyValuesProps,
  38969. ...useAriaProps(["ariaLabel"])
  38970. });
  38971. const optionV2Props = buildProps({
  38972. data: Array,
  38973. disabled: Boolean,
  38974. hovering: Boolean,
  38975. item: {
  38976. type: definePropType(Object),
  38977. required: true
  38978. },
  38979. index: Number,
  38980. style: Object,
  38981. selected: Boolean,
  38982. created: Boolean
  38983. });
  38984. const selectV2Emits = {
  38985. [UPDATE_MODEL_EVENT]: (val) => true,
  38986. [CHANGE_EVENT]: (val) => true,
  38987. "remove-tag": (val) => true,
  38988. "visible-change": (visible) => true,
  38989. focus: (evt) => evt instanceof FocusEvent,
  38990. blur: (evt) => evt instanceof FocusEvent,
  38991. clear: () => true
  38992. };
  38993. const optionV2Emits = {
  38994. hover: (index) => isNumber(index),
  38995. select: (val, index) => true
  38996. };
  38997. //#endregion
  38998. //#region ../../packages/components/select-v2/src/token.ts
  38999. const selectV2InjectionKey = Symbol("ElSelectV2Injection");
  39000. //#endregion
  39001. //#region ../../packages/components/select-v2/src/option-item.vue?vue&type=script&lang.ts
  39002. var option_item_vue_vue_type_script_lang_default = defineComponent({
  39003. props: optionV2Props,
  39004. emits: optionV2Emits,
  39005. setup(props, { emit }) {
  39006. const select = inject(selectV2InjectionKey);
  39007. const ns = useNamespace("select");
  39008. const { hoverItem, selectOptionClick } = useOption(props, { emit });
  39009. const { getLabel } = useProps(select.props);
  39010. return {
  39011. ns,
  39012. contentId: select.contentId,
  39013. hoverItem,
  39014. selectOptionClick,
  39015. getLabel
  39016. };
  39017. }
  39018. });
  39019. //#endregion
  39020. //#region ../../packages/components/select-v2/src/option-item.vue
  39021. const _hoisted_1$22 = [
  39022. "id",
  39023. "aria-selected",
  39024. "aria-disabled"
  39025. ];
  39026. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  39027. return openBlock(), createElementBlock("li", {
  39028. id: `${_ctx.contentId}-${_ctx.index}`,
  39029. role: "option",
  39030. "aria-selected": _ctx.selected,
  39031. "aria-disabled": _ctx.disabled || void 0,
  39032. style: normalizeStyle(_ctx.style),
  39033. class: normalizeClass([
  39034. _ctx.ns.be("dropdown", "item"),
  39035. _ctx.ns.is("selected", _ctx.selected),
  39036. _ctx.ns.is("disabled", _ctx.disabled),
  39037. _ctx.ns.is("created", _ctx.created),
  39038. _ctx.ns.is("hovering", _ctx.hovering)
  39039. ]),
  39040. onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  39041. onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  39042. }, [renderSlot(_ctx.$slots, "default", {
  39043. item: _ctx.item,
  39044. index: _ctx.index,
  39045. disabled: _ctx.disabled
  39046. }, () => [createElementVNode("span", null, toDisplayString(_ctx.getLabel(_ctx.item)), 1)])], 46, _hoisted_1$22);
  39047. }
  39048. var option_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_item_vue_vue_type_script_lang_default, [["render", _sfc_render$6]]);
  39049. //#endregion
  39050. //#region ../../packages/components/select-v2/src/select-dropdown.tsx
  39051. const props = {
  39052. loading: Boolean,
  39053. data: {
  39054. type: Array,
  39055. required: true
  39056. },
  39057. hoveringIndex: Number,
  39058. width: Number,
  39059. id: String,
  39060. ariaLabel: String
  39061. };
  39062. var select_dropdown_default = /* @__PURE__ */ defineComponent({
  39063. name: "ElSelectDropdown",
  39064. props,
  39065. setup(props, { slots, expose }) {
  39066. const select = inject(selectV2InjectionKey);
  39067. const ns = useNamespace("select");
  39068. const { getLabel, getValue, getDisabled } = useProps(select.props);
  39069. const cachedHeights = ref([]);
  39070. const listRef = ref();
  39071. const size = computed(() => props.data.length);
  39072. watch(() => size.value, () => {
  39073. select.tooltipRef.value?.updatePopper?.();
  39074. });
  39075. const isSized = computed(() => isUndefined(select.props.estimatedOptionHeight));
  39076. const listProps = computed(() => {
  39077. if (isSized.value) return { itemSize: select.props.itemHeight };
  39078. return {
  39079. estimatedSize: select.props.estimatedOptionHeight,
  39080. itemSize: (idx) => cachedHeights.value[idx]
  39081. };
  39082. });
  39083. const contains = (arr = [], target) => {
  39084. const { props: { valueKey } } = select;
  39085. if (!isObject$1(target)) return arr.includes(target);
  39086. return arr && arr.some((item) => {
  39087. return toRaw(get(item, valueKey)) === get(target, valueKey);
  39088. });
  39089. };
  39090. const isEqual = (selected, target) => {
  39091. if (!isObject$1(target)) return selected === target;
  39092. else {
  39093. const { valueKey } = select.props;
  39094. return get(selected, valueKey) === get(target, valueKey);
  39095. }
  39096. };
  39097. const isItemSelected = (modelValue, target) => {
  39098. if (select.props.multiple) return contains(modelValue, getValue(target));
  39099. return isEqual(modelValue, getValue(target));
  39100. };
  39101. const isItemDisabled = (modelValue, selected) => {
  39102. const { disabled, multiple, multipleLimit } = select.props;
  39103. return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
  39104. };
  39105. const isItemHovering = (target) => props.hoveringIndex === target;
  39106. const scrollToItem = (index) => {
  39107. const list = listRef.value;
  39108. if (list) list.scrollToItem(index);
  39109. };
  39110. const resetScrollTop = () => {
  39111. const list = listRef.value;
  39112. if (list) list.resetScrollTop();
  39113. };
  39114. expose({
  39115. listRef,
  39116. isSized,
  39117. isItemDisabled,
  39118. isItemHovering,
  39119. isItemSelected,
  39120. scrollToItem,
  39121. resetScrollTop
  39122. });
  39123. const Item = (itemProps) => {
  39124. const { index, data, style } = itemProps;
  39125. const sized = unref(isSized);
  39126. const { itemSize, estimatedSize } = unref(listProps);
  39127. const { modelValue } = select.props;
  39128. const { onSelect, onHover } = select;
  39129. const item = data[index];
  39130. if (item.type === "Group") return createVNode(group_item_default, {
  39131. "item": item,
  39132. "style": style,
  39133. "height": sized ? itemSize : estimatedSize
  39134. }, null);
  39135. const isSelected = isItemSelected(modelValue, item);
  39136. const isDisabled = isItemDisabled(modelValue, isSelected);
  39137. const isHovering = isItemHovering(index);
  39138. return createVNode(option_item_default, mergeProps(itemProps, {
  39139. "selected": isSelected,
  39140. "disabled": getDisabled(item) || isDisabled,
  39141. "created": !!item.created,
  39142. "hovering": isHovering,
  39143. "item": item,
  39144. "onSelect": onSelect,
  39145. "onHover": onHover
  39146. }), { default: (props) => slots.default?.(props) || createVNode("span", null, [getLabel(item)]) });
  39147. };
  39148. const { onKeyboardNavigate, onKeyboardSelect } = select;
  39149. const onForward = () => {
  39150. onKeyboardNavigate("forward");
  39151. };
  39152. const onBackward = () => {
  39153. onKeyboardNavigate("backward");
  39154. };
  39155. const onEscOrTab = () => {};
  39156. const onKeydown = (e) => {
  39157. const code = getEventCode(e);
  39158. const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE;
  39159. if ([
  39160. esc,
  39161. down,
  39162. up,
  39163. enter,
  39164. numpadEnter
  39165. ].includes(code)) {
  39166. e.preventDefault();
  39167. e.stopPropagation();
  39168. }
  39169. switch (code) {
  39170. case tab:
  39171. case esc:
  39172. onEscOrTab();
  39173. break;
  39174. case down:
  39175. onForward();
  39176. break;
  39177. case up:
  39178. onBackward();
  39179. break;
  39180. case enter:
  39181. case numpadEnter:
  39182. onKeyboardSelect();
  39183. break;
  39184. }
  39185. };
  39186. return () => {
  39187. const { data, width } = props;
  39188. const { height, multiple, scrollbarAlwaysOn } = select.props;
  39189. const isScrollbarAlwaysOn = computed(() => {
  39190. return isIOS ? true : scrollbarAlwaysOn;
  39191. });
  39192. const List = unref(isSized) ? FixedSizeList : DynamicSizeList;
  39193. return createVNode("div", {
  39194. "class": [ns.b("dropdown"), ns.is("multiple", multiple)],
  39195. "style": { width: `${width}px` }
  39196. }, [
  39197. slots.header?.(),
  39198. slots.loading?.() || slots.empty?.() || createVNode(List, mergeProps({ "ref": listRef }, unref(listProps), {
  39199. "className": ns.be("dropdown", "list"),
  39200. "scrollbarAlwaysOn": isScrollbarAlwaysOn.value,
  39201. "data": data,
  39202. "height": height,
  39203. "width": width,
  39204. "total": data.length,
  39205. "innerElement": "ul",
  39206. "innerProps": {
  39207. id: props.id,
  39208. role: "listbox",
  39209. "aria-label": props.ariaLabel,
  39210. "aria-orientation": "vertical"
  39211. },
  39212. "onKeydown": onKeydown
  39213. }), { default: (props) => createVNode(Item, props, null) }),
  39214. slots.footer?.()
  39215. ]);
  39216. };
  39217. }
  39218. });
  39219. //#endregion
  39220. //#region ../../packages/components/select-v2/src/useAllowCreate.ts
  39221. function useAllowCreate(props, states) {
  39222. const { aliasProps, getLabel, getValue } = useProps(props);
  39223. const createOptionCount = ref(0);
  39224. const cachedSelectedOption = ref();
  39225. const enableAllowCreateMode = computed(() => {
  39226. return props.allowCreate && props.filterable;
  39227. });
  39228. watch(() => props.options, (options) => {
  39229. const optionLabelsSet = new Set(options.map((option) => getLabel(option)));
  39230. states.createdOptions = states.createdOptions.filter((createdOption) => !optionLabelsSet.has(getLabel(createdOption)));
  39231. });
  39232. function hasExistingOption(query) {
  39233. const hasOption = (option) => getLabel(option) === query;
  39234. return props.options && props.options.some(hasOption) || states.createdOptions.some(hasOption);
  39235. }
  39236. function selectNewOption(option) {
  39237. if (!enableAllowCreateMode.value) return;
  39238. if (props.multiple && option.created) createOptionCount.value++;
  39239. else cachedSelectedOption.value = option;
  39240. }
  39241. function createNewOption(query) {
  39242. if (enableAllowCreateMode.value) if (query && query.length > 0) {
  39243. if (hasExistingOption(query)) {
  39244. states.createdOptions = states.createdOptions.filter((createdOption) => getLabel(createdOption) !== states.previousQuery);
  39245. return;
  39246. }
  39247. const newOption = {
  39248. [aliasProps.value.value]: query,
  39249. [aliasProps.value.label]: query,
  39250. created: true,
  39251. [aliasProps.value.disabled]: false
  39252. };
  39253. if (states.createdOptions.length >= createOptionCount.value) states.createdOptions[createOptionCount.value] = newOption;
  39254. else states.createdOptions.push(newOption);
  39255. } else if (props.multiple) states.createdOptions.length = createOptionCount.value;
  39256. else {
  39257. const selectedOption = cachedSelectedOption.value;
  39258. states.createdOptions.length = 0;
  39259. if (selectedOption && selectedOption.created) states.createdOptions.push(selectedOption);
  39260. }
  39261. }
  39262. function removeNewOption(option) {
  39263. if (!enableAllowCreateMode.value || !option || !option.created || option.created && props.reserveKeyword && states.inputValue === getLabel(option)) return;
  39264. const idx = states.createdOptions.findIndex((it) => getValue(it) === getValue(option));
  39265. if (~idx) {
  39266. states.createdOptions.splice(idx, 1);
  39267. createOptionCount.value--;
  39268. }
  39269. }
  39270. function clearAllNewOption() {
  39271. if (enableAllowCreateMode.value) {
  39272. states.createdOptions.length = 0;
  39273. createOptionCount.value = 0;
  39274. }
  39275. }
  39276. return {
  39277. createNewOption,
  39278. removeNewOption,
  39279. selectNewOption,
  39280. clearAllNewOption
  39281. };
  39282. }
  39283. //#endregion
  39284. //#region ../../packages/components/select-v2/src/useSelect.ts
  39285. const useSelect$1 = (props, emit) => {
  39286. const { t } = useLocale();
  39287. const slots = useSlots();
  39288. const nsSelect = useNamespace("select");
  39289. const nsInput = useNamespace("input");
  39290. const { form: elForm, formItem: elFormItem } = useFormItem();
  39291. const { inputId } = useFormItemInputId(props, { formItemContext: elFormItem });
  39292. const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props);
  39293. const { valueOnClear, isEmptyValue } = useEmptyValues(props);
  39294. const states = reactive({
  39295. inputValue: "",
  39296. cachedOptions: [],
  39297. createdOptions: [],
  39298. hoveringIndex: -1,
  39299. inputHovering: false,
  39300. selectionWidth: 0,
  39301. collapseItemWidth: 0,
  39302. previousQuery: null,
  39303. previousValue: void 0,
  39304. selectedLabel: "",
  39305. menuVisibleOnFocus: false,
  39306. isBeforeHide: false
  39307. });
  39308. const popperSize = ref(-1);
  39309. const debouncing = ref(false);
  39310. const selectRef = ref();
  39311. const selectionRef = ref();
  39312. const tooltipRef = ref();
  39313. const tagTooltipRef = ref();
  39314. const inputRef = ref();
  39315. const prefixRef = ref();
  39316. const suffixRef = ref();
  39317. const menuRef = ref();
  39318. const tagMenuRef = ref();
  39319. const collapseItemRef = ref();
  39320. const { isComposing, handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } = useComposition({ afterComposition: (e) => onInput(e) });
  39321. const selectDisabled = useFormDisabled();
  39322. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  39323. disabled: selectDisabled,
  39324. afterFocus() {
  39325. if (props.automaticDropdown && !expanded.value) {
  39326. expanded.value = true;
  39327. states.menuVisibleOnFocus = true;
  39328. }
  39329. },
  39330. beforeBlur(event) {
  39331. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  39332. },
  39333. afterBlur() {
  39334. expanded.value = false;
  39335. states.menuVisibleOnFocus = false;
  39336. if (props.validateEvent) elFormItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  39337. }
  39338. });
  39339. const allOptions = computed(() => filterOptions(""));
  39340. const hasOptions = computed(() => {
  39341. if (props.loading) return false;
  39342. return props.options.length > 0 || states.createdOptions.length > 0;
  39343. });
  39344. const filteredOptions = ref([]);
  39345. const expanded = ref(false);
  39346. const needStatusIcon = computed(() => elForm?.statusIcon ?? false);
  39347. const popupHeight = computed(() => {
  39348. const totalHeight = filteredOptions.value.length * props.itemHeight;
  39349. return totalHeight > props.height ? props.height : totalHeight;
  39350. });
  39351. const hasModelValue = computed(() => {
  39352. return props.multiple ? isArray$1(props.modelValue) && props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  39353. });
  39354. const showClearBtn = computed(() => {
  39355. return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
  39356. });
  39357. const iconComponent = computed(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  39358. const iconReverse = computed(() => iconComponent.value && nsSelect.is("reverse", expanded.value));
  39359. const validateState = computed(() => elFormItem?.validateState || "");
  39360. const validateIcon = computed(() => {
  39361. if (!validateState.value) return;
  39362. return ValidateComponentsMap[validateState.value];
  39363. });
  39364. const debounce = computed(() => props.remote ? props.debounce : 0);
  39365. const isRemoteSearchEmpty = computed(() => props.remote && !states.inputValue && !hasOptions.value);
  39366. const emptyText = computed(() => {
  39367. if (props.loading) return props.loadingText || t("el.select.loading");
  39368. else {
  39369. if (props.filterable && states.inputValue && hasOptions.value && filteredOptions.value.length === 0) return props.noMatchText || t("el.select.noMatch");
  39370. if (!hasOptions.value) return props.noDataText || t("el.select.noData");
  39371. }
  39372. return null;
  39373. });
  39374. const isFilterMethodValid = computed(() => props.filterable && isFunction$1(props.filterMethod));
  39375. const isRemoteMethodValid = computed(() => props.filterable && props.remote && isFunction$1(props.remoteMethod));
  39376. const filterOptions = (query) => {
  39377. const regexp = new RegExp(escapeStringRegexp(query), "i");
  39378. const isValidOption = (o) => {
  39379. if (isFilterMethodValid.value || isRemoteMethodValid.value) return true;
  39380. return query ? regexp.test(getLabel(o) || "") : true;
  39381. };
  39382. if (props.loading) return [];
  39383. return [...states.createdOptions, ...props.options].reduce((all, item) => {
  39384. const options = getOptions(item);
  39385. if (isArray$1(options)) {
  39386. const filtered = options.filter(isValidOption);
  39387. if (filtered.length > 0) all.push({
  39388. label: getLabel(item),
  39389. type: "Group"
  39390. }, ...filtered);
  39391. } else if (props.remote || isValidOption(item)) all.push(item);
  39392. return all;
  39393. }, []);
  39394. };
  39395. const updateOptions = () => {
  39396. filteredOptions.value = filterOptions(states.inputValue);
  39397. };
  39398. const allOptionsValueMap = computed(() => {
  39399. const valueMap = /* @__PURE__ */ new Map();
  39400. allOptions.value.forEach((option, index) => {
  39401. valueMap.set(getValueKey(getValue(option)), {
  39402. option,
  39403. index
  39404. });
  39405. });
  39406. return valueMap;
  39407. });
  39408. const filteredOptionsValueMap = computed(() => {
  39409. const valueMap = /* @__PURE__ */ new Map();
  39410. filteredOptions.value.forEach((option, index) => {
  39411. valueMap.set(getValueKey(getValue(option)), {
  39412. option,
  39413. index
  39414. });
  39415. });
  39416. return valueMap;
  39417. });
  39418. const optionsAllDisabled = computed(() => filteredOptions.value.every((option) => getDisabled(option)));
  39419. const selectSize = useFormSize();
  39420. const collapseTagSize = computed(() => "small" === selectSize.value ? "small" : "default");
  39421. const calculatePopperSize = () => {
  39422. if (isNumber(props.fitInputWidth)) {
  39423. popperSize.value = props.fitInputWidth;
  39424. return;
  39425. }
  39426. const width = selectRef.value?.offsetWidth || 200;
  39427. if (!props.fitInputWidth && hasOptions.value) nextTick(() => {
  39428. popperSize.value = Math.max(width, calculateLabelMaxWidth());
  39429. });
  39430. else popperSize.value = width;
  39431. };
  39432. const calculateLabelMaxWidth = () => {
  39433. const ctx = document.createElement("canvas").getContext("2d");
  39434. const selector = nsSelect.be("dropdown", "item");
  39435. const dropdownItemEl = (menuRef.value?.listRef?.innerRef || document).querySelector(`.${selector}`);
  39436. if (dropdownItemEl === null || ctx === null) return 0;
  39437. const style = getComputedStyle(dropdownItemEl);
  39438. const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
  39439. ctx.font = `bold ${style.font.replace(new RegExp(`\\b${style.fontWeight}\\b`), "")}`;
  39440. return filteredOptions.value.reduce((max, option) => {
  39441. const metrics = ctx.measureText(getLabel(option));
  39442. return Math.max(metrics.width, max);
  39443. }, 0) + padding;
  39444. };
  39445. const getGapWidth = () => {
  39446. if (!selectionRef.value) return 0;
  39447. const style = window.getComputedStyle(selectionRef.value);
  39448. return Number.parseFloat(style.gap || "6px");
  39449. };
  39450. const tagStyle = computed(() => {
  39451. const gapWidth = getGapWidth();
  39452. const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
  39453. return { maxWidth: `${collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` };
  39454. });
  39455. const collapseTagStyle = computed(() => {
  39456. return { maxWidth: `${states.selectionWidth}px` };
  39457. });
  39458. const shouldShowPlaceholder = computed(() => {
  39459. if (isArray$1(props.modelValue)) return props.modelValue.length === 0 && !states.inputValue;
  39460. return props.filterable ? !states.inputValue : true;
  39461. });
  39462. const currentPlaceholder = computed(() => {
  39463. const _placeholder = props.placeholder ?? t("el.select.placeholder");
  39464. return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  39465. });
  39466. const popperRef = computed(() => tooltipRef.value?.popperRef?.contentRef);
  39467. const indexRef = computed(() => {
  39468. if (props.multiple) {
  39469. const len = props.modelValue.length;
  39470. if (len > 0 && filteredOptionsValueMap.value.has(props.modelValue[len - 1])) {
  39471. const { index } = filteredOptionsValueMap.value.get(props.modelValue[len - 1]);
  39472. return index;
  39473. }
  39474. } else if (!isEmptyValue(props.modelValue) && filteredOptionsValueMap.value.has(props.modelValue)) {
  39475. const { index } = filteredOptionsValueMap.value.get(props.modelValue);
  39476. return index;
  39477. }
  39478. return -1;
  39479. });
  39480. const dropdownMenuVisible = computed({
  39481. get() {
  39482. return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
  39483. },
  39484. set(val) {
  39485. expanded.value = val;
  39486. }
  39487. });
  39488. const showTagList = computed(() => {
  39489. if (!props.multiple) return [];
  39490. return props.collapseTags ? states.cachedOptions.slice(0, props.maxCollapseTags) : states.cachedOptions;
  39491. });
  39492. const collapseTagList = computed(() => {
  39493. if (!props.multiple) return [];
  39494. return props.collapseTags ? states.cachedOptions.slice(props.maxCollapseTags) : [];
  39495. });
  39496. const { createNewOption, removeNewOption, selectNewOption, clearAllNewOption } = useAllowCreate(props, states);
  39497. const toggleMenu = (event) => {
  39498. if (selectDisabled.value || props.filterable && expanded.value && event && !suffixRef.value?.contains(event.target)) return;
  39499. if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false;
  39500. else expanded.value = !expanded.value;
  39501. };
  39502. const onInputChange = () => {
  39503. if (states.inputValue.length > 0 && !expanded.value) expanded.value = true;
  39504. createNewOption(states.inputValue);
  39505. nextTick(() => {
  39506. handleQueryChange(states.inputValue);
  39507. });
  39508. };
  39509. const debouncedOnInputChange = useDebounceFn(() => {
  39510. onInputChange();
  39511. debouncing.value = false;
  39512. }, debounce);
  39513. const handleQueryChange = (val) => {
  39514. if (states.previousQuery === val || isComposing.value) return;
  39515. states.previousQuery = val;
  39516. if (props.filterable && isFunction$1(props.filterMethod)) props.filterMethod(val);
  39517. else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) props.remoteMethod(val);
  39518. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptions.value.length) nextTick(checkDefaultFirstOption);
  39519. else nextTick(updateHoveringIndex);
  39520. };
  39521. /**
  39522. * find and highlight first option as default selected
  39523. * @remark
  39524. * - if the first option in dropdown list is user-created,
  39525. * it would be at the end of the optionsArray
  39526. * so find it and set hover.
  39527. * (NOTE: there must be only one user-created option in dropdown list with query)
  39528. * - if there's no user-created option in list, just find the first one as usual
  39529. * (NOTE: exclude options that are disabled or in disabled-group)
  39530. */
  39531. const checkDefaultFirstOption = () => {
  39532. const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group");
  39533. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  39534. const firstOriginOption = optionsInDropdown[0];
  39535. states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption);
  39536. };
  39537. const emitChange = (val) => {
  39538. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  39539. };
  39540. const update = (val) => {
  39541. emit(UPDATE_MODEL_EVENT, val);
  39542. emitChange(val);
  39543. states.previousValue = props.multiple ? String(val) : val;
  39544. nextTick(() => {
  39545. if (props.multiple && isArray$1(props.modelValue)) {
  39546. const cachedOptions = states.cachedOptions.slice();
  39547. const selectedOptions = props.modelValue.map((value) => getOption(value, cachedOptions));
  39548. if (!isEqual$1(states.cachedOptions, selectedOptions)) states.cachedOptions = selectedOptions;
  39549. } else initStates(true);
  39550. });
  39551. };
  39552. const getValueIndex = (arr = [], value) => {
  39553. if (!isObject$1(value)) return arr.indexOf(value);
  39554. const valueKey = props.valueKey;
  39555. let index = -1;
  39556. arr.some((item, i) => {
  39557. if (get(item, valueKey) === get(value, valueKey)) {
  39558. index = i;
  39559. return true;
  39560. }
  39561. return false;
  39562. });
  39563. return index;
  39564. };
  39565. const getValueKey = (item) => {
  39566. return isObject$1(item) ? get(item, props.valueKey) : item;
  39567. };
  39568. const handleResize = () => {
  39569. calculatePopperSize();
  39570. };
  39571. const resetSelectionWidth = () => {
  39572. states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  39573. };
  39574. const resetCollapseItemWidth = () => {
  39575. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  39576. };
  39577. const updateTooltip = () => {
  39578. tooltipRef.value?.updatePopper?.();
  39579. };
  39580. const updateTagTooltip = () => {
  39581. tagTooltipRef.value?.updatePopper?.();
  39582. };
  39583. const onSelect = (option) => {
  39584. const optionValue = getValue(option);
  39585. if (props.multiple) {
  39586. let selectedOptions = props.modelValue.slice();
  39587. const index = getValueIndex(selectedOptions, optionValue);
  39588. if (index > -1) {
  39589. selectedOptions = [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)];
  39590. states.cachedOptions.splice(index, 1);
  39591. removeNewOption(option);
  39592. } else if (props.multipleLimit <= 0 || selectedOptions.length < props.multipleLimit) {
  39593. selectedOptions = [...selectedOptions, optionValue];
  39594. states.cachedOptions.push(option);
  39595. selectNewOption(option);
  39596. }
  39597. update(selectedOptions);
  39598. if (option.created) handleQueryChange("");
  39599. if (props.filterable && (option.created || !props.reserveKeyword)) states.inputValue = "";
  39600. } else {
  39601. states.selectedLabel = getLabel(option);
  39602. !isEqual$1(props.modelValue, optionValue) && update(optionValue);
  39603. expanded.value = false;
  39604. selectNewOption(option);
  39605. if (!option.created) clearAllNewOption();
  39606. }
  39607. focus();
  39608. };
  39609. const deleteTag = (event, option) => {
  39610. let selectedOptions = props.modelValue.slice();
  39611. const index = getValueIndex(selectedOptions, getValue(option));
  39612. if (index > -1 && !selectDisabled.value) {
  39613. selectedOptions = [...props.modelValue.slice(0, index), ...props.modelValue.slice(index + 1)];
  39614. states.cachedOptions.splice(index, 1);
  39615. update(selectedOptions);
  39616. emit("remove-tag", getValue(option));
  39617. removeNewOption(option);
  39618. }
  39619. event.stopPropagation();
  39620. focus();
  39621. };
  39622. const focus = () => {
  39623. inputRef.value?.focus();
  39624. };
  39625. const blur = () => {
  39626. if (expanded.value) {
  39627. expanded.value = false;
  39628. nextTick(() => inputRef.value?.blur());
  39629. return;
  39630. }
  39631. inputRef.value?.blur();
  39632. };
  39633. const handleEsc = () => {
  39634. if (states.inputValue.length > 0) states.inputValue = "";
  39635. else expanded.value = false;
  39636. };
  39637. const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => !states.cachedOptions.some((option) => getValue(option) === it && getDisabled(option)));
  39638. const handleDel = (e) => {
  39639. const code = getEventCode(e);
  39640. if (!props.multiple) return;
  39641. if (code === EVENT_CODE.delete) return;
  39642. if (states.inputValue.length === 0) {
  39643. e.preventDefault();
  39644. const selected = props.modelValue.slice();
  39645. const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
  39646. if (lastNotDisabledIndex < 0) return;
  39647. const removeTagValue = selected[lastNotDisabledIndex];
  39648. selected.splice(lastNotDisabledIndex, 1);
  39649. const option = states.cachedOptions[lastNotDisabledIndex];
  39650. states.cachedOptions.splice(lastNotDisabledIndex, 1);
  39651. removeNewOption(option);
  39652. update(selected);
  39653. emit("remove-tag", removeTagValue);
  39654. }
  39655. };
  39656. const handleClear = () => {
  39657. let emptyValue;
  39658. if (isArray$1(props.modelValue)) emptyValue = [];
  39659. else emptyValue = valueOnClear.value;
  39660. states.selectedLabel = "";
  39661. expanded.value = false;
  39662. update(emptyValue);
  39663. emit("clear");
  39664. clearAllNewOption();
  39665. focus();
  39666. };
  39667. const onKeyboardNavigate = (direction, hoveringIndex = void 0) => {
  39668. const options = filteredOptions.value;
  39669. if (!["forward", "backward"].includes(direction) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) return;
  39670. if (!expanded.value) return toggleMenu();
  39671. if (isUndefined(hoveringIndex)) hoveringIndex = states.hoveringIndex;
  39672. let newIndex = -1;
  39673. if (direction === "forward") {
  39674. newIndex = hoveringIndex + 1;
  39675. if (newIndex >= options.length) newIndex = 0;
  39676. } else if (direction === "backward") {
  39677. newIndex = hoveringIndex - 1;
  39678. if (newIndex < 0 || newIndex >= options.length) newIndex = options.length - 1;
  39679. }
  39680. const option = options[newIndex];
  39681. if (getDisabled(option) || option.type === "Group") return onKeyboardNavigate(direction, newIndex);
  39682. else {
  39683. states.hoveringIndex = newIndex;
  39684. scrollToItem(newIndex);
  39685. }
  39686. };
  39687. const onKeyboardSelect = () => {
  39688. if (!expanded.value) return toggleMenu();
  39689. else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) onSelect(filteredOptions.value[states.hoveringIndex]);
  39690. };
  39691. const onHoverOption = (idx) => {
  39692. states.hoveringIndex = idx ?? -1;
  39693. };
  39694. const updateHoveringIndex = () => {
  39695. if (!props.multiple) states.hoveringIndex = filteredOptions.value.findIndex((item) => {
  39696. return getValueKey(getValue(item)) === getValueKey(props.modelValue);
  39697. });
  39698. else {
  39699. const length = props.modelValue.length;
  39700. if (length > 0) {
  39701. const lastValue = props.modelValue[length - 1];
  39702. states.hoveringIndex = filteredOptions.value.findIndex((item) => getValueKey(lastValue) === getValueKey(getValue(item)));
  39703. } else states.hoveringIndex = -1;
  39704. }
  39705. };
  39706. const onInput = (event) => {
  39707. states.inputValue = event.target.value;
  39708. if (props.remote) {
  39709. debouncing.value = true;
  39710. debouncedOnInputChange();
  39711. } else return onInputChange();
  39712. };
  39713. const handleClickOutside = (event) => {
  39714. expanded.value = false;
  39715. if (isFocused.value) handleBlur(new FocusEvent("blur", event));
  39716. };
  39717. const handleMenuEnter = () => {
  39718. states.isBeforeHide = false;
  39719. return nextTick(() => {
  39720. if (~indexRef.value) scrollToItem(indexRef.value);
  39721. });
  39722. };
  39723. const scrollToItem = (index) => {
  39724. menuRef.value.scrollToItem(index);
  39725. };
  39726. const getOption = (value, cachedOptions) => {
  39727. const selectValue = getValueKey(value);
  39728. if (allOptionsValueMap.value.has(selectValue)) {
  39729. const { option } = allOptionsValueMap.value.get(selectValue);
  39730. return option;
  39731. }
  39732. if (cachedOptions && cachedOptions.length) {
  39733. const option = cachedOptions.find((option) => getValueKey(getValue(option)) === selectValue);
  39734. if (option) return option;
  39735. }
  39736. return {
  39737. [aliasProps.value.value]: value,
  39738. [aliasProps.value.label]: value
  39739. };
  39740. };
  39741. const getIndex = (option) => allOptionsValueMap.value.get(getValue(option))?.index ?? -1;
  39742. const initStates = (needUpdateSelectedLabel = false) => {
  39743. if (props.multiple) if (props.modelValue.length > 0) {
  39744. const cachedOptions = states.cachedOptions.slice();
  39745. states.cachedOptions.length = 0;
  39746. states.previousValue = props.modelValue.toString();
  39747. for (const value of props.modelValue) {
  39748. const option = getOption(value, cachedOptions);
  39749. states.cachedOptions.push(option);
  39750. }
  39751. } else {
  39752. states.cachedOptions = [];
  39753. states.previousValue = void 0;
  39754. }
  39755. else if (hasModelValue.value) {
  39756. states.previousValue = props.modelValue;
  39757. const options = filteredOptions.value;
  39758. const selectedItemIndex = options.findIndex((option) => getValueKey(getValue(option)) === getValueKey(props.modelValue));
  39759. if (~selectedItemIndex) states.selectedLabel = getLabel(options[selectedItemIndex]);
  39760. else if (!states.selectedLabel || needUpdateSelectedLabel) states.selectedLabel = getValueKey(props.modelValue);
  39761. } else {
  39762. states.selectedLabel = "";
  39763. states.previousValue = void 0;
  39764. }
  39765. clearAllNewOption();
  39766. calculatePopperSize();
  39767. };
  39768. watch(() => props.fitInputWidth, () => {
  39769. calculatePopperSize();
  39770. });
  39771. watch(expanded, (val) => {
  39772. if (val) {
  39773. if (!props.persistent) calculatePopperSize();
  39774. handleQueryChange("");
  39775. } else {
  39776. states.inputValue = "";
  39777. states.previousQuery = null;
  39778. states.isBeforeHide = true;
  39779. states.menuVisibleOnFocus = false;
  39780. createNewOption("");
  39781. }
  39782. });
  39783. watch(() => props.modelValue, (val, oldVal) => {
  39784. if (!val || isArray$1(val) && val.length === 0 || props.multiple && !isEqual$1(val.toString(), states.previousValue) || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) initStates(true);
  39785. if (!isEqual$1(val, oldVal) && props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  39786. }, { deep: true });
  39787. watch(() => props.options, () => {
  39788. const input = inputRef.value;
  39789. if (!input || input && document.activeElement !== input) initStates();
  39790. }, {
  39791. deep: true,
  39792. flush: "post"
  39793. });
  39794. watch(() => filteredOptions.value, () => {
  39795. calculatePopperSize();
  39796. return menuRef.value && nextTick(menuRef.value.resetScrollTop);
  39797. });
  39798. watchEffect(() => {
  39799. if (states.isBeforeHide) return;
  39800. updateOptions();
  39801. });
  39802. watchEffect(() => {
  39803. const { valueKey, options } = props;
  39804. const duplicateValue = /* @__PURE__ */ new Map();
  39805. for (const item of options) {
  39806. const optionValue = getValue(item);
  39807. let v = optionValue;
  39808. if (isObject$1(v)) v = get(optionValue, valueKey);
  39809. if (duplicateValue.get(v)) {
  39810. /* @__PURE__ */ debugWarn("ElSelectV2", `The option values you provided seem to be duplicated, which may cause some problems, please check.`);
  39811. break;
  39812. } else duplicateValue.set(v, true);
  39813. }
  39814. });
  39815. onMounted(() => {
  39816. initStates();
  39817. });
  39818. useResizeObserver(selectRef, handleResize);
  39819. useResizeObserver(selectionRef, resetSelectionWidth);
  39820. useResizeObserver(wrapperRef, updateTooltip);
  39821. useResizeObserver(tagMenuRef, updateTagTooltip);
  39822. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  39823. let stop;
  39824. watch(() => dropdownMenuVisible.value, (newVal) => {
  39825. if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop;
  39826. else {
  39827. stop?.();
  39828. stop = void 0;
  39829. }
  39830. emit("visible-change", newVal);
  39831. });
  39832. return {
  39833. inputId,
  39834. collapseTagSize,
  39835. currentPlaceholder,
  39836. expanded,
  39837. emptyText,
  39838. popupHeight,
  39839. debounce,
  39840. allOptions,
  39841. allOptionsValueMap,
  39842. filteredOptions,
  39843. iconComponent,
  39844. iconReverse,
  39845. tagStyle,
  39846. collapseTagStyle,
  39847. popperSize,
  39848. dropdownMenuVisible,
  39849. hasModelValue,
  39850. shouldShowPlaceholder,
  39851. selectDisabled,
  39852. selectSize,
  39853. needStatusIcon,
  39854. showClearBtn,
  39855. states,
  39856. isFocused,
  39857. nsSelect,
  39858. nsInput,
  39859. inputRef,
  39860. menuRef,
  39861. tagMenuRef,
  39862. tooltipRef,
  39863. tagTooltipRef,
  39864. selectRef,
  39865. wrapperRef,
  39866. selectionRef,
  39867. prefixRef,
  39868. suffixRef,
  39869. collapseItemRef,
  39870. popperRef,
  39871. validateState,
  39872. validateIcon,
  39873. showTagList,
  39874. collapseTagList,
  39875. debouncedOnInputChange,
  39876. deleteTag,
  39877. getLabel,
  39878. getValue,
  39879. getDisabled,
  39880. getValueKey,
  39881. getIndex,
  39882. handleClear,
  39883. handleClickOutside,
  39884. handleDel,
  39885. handleEsc,
  39886. focus,
  39887. blur,
  39888. handleMenuEnter,
  39889. handleResize,
  39890. resetSelectionWidth,
  39891. updateTooltip,
  39892. updateTagTooltip,
  39893. updateOptions,
  39894. toggleMenu,
  39895. scrollTo: scrollToItem,
  39896. onInput,
  39897. onKeyboardNavigate,
  39898. onKeyboardSelect,
  39899. onSelect,
  39900. onHover: onHoverOption,
  39901. handleCompositionStart,
  39902. handleCompositionEnd,
  39903. handleCompositionUpdate
  39904. };
  39905. };
  39906. //#endregion
  39907. //#region ../../packages/components/select-v2/src/select.vue?vue&type=script&lang.ts
  39908. var select_vue_vue_type_script_lang_default = defineComponent({
  39909. name: "ElSelectV2",
  39910. components: {
  39911. ElSelectMenu: select_dropdown_default,
  39912. ElTag,
  39913. ElTooltip,
  39914. ElIcon
  39915. },
  39916. directives: { ClickOutside },
  39917. props: selectV2Props,
  39918. emits: selectV2Emits,
  39919. setup(props, { emit }) {
  39920. const modelValue = computed(() => {
  39921. const { modelValue: rawModelValue, multiple } = props;
  39922. const fallback = multiple ? [] : void 0;
  39923. if (isArray$1(rawModelValue)) return multiple ? rawModelValue : fallback;
  39924. return multiple ? fallback : rawModelValue;
  39925. });
  39926. const API = useSelect$1(reactive({
  39927. ...toRefs(props),
  39928. modelValue
  39929. }), emit);
  39930. const { calculatorRef, inputStyle } = useCalcInputWidth();
  39931. const contentId = useId();
  39932. provide(selectV2InjectionKey, {
  39933. props: reactive({
  39934. ...toRefs(props),
  39935. height: API.popupHeight,
  39936. modelValue
  39937. }),
  39938. expanded: API.expanded,
  39939. tooltipRef: API.tooltipRef,
  39940. contentId,
  39941. onSelect: API.onSelect,
  39942. onHover: API.onHover,
  39943. onKeyboardNavigate: API.onKeyboardNavigate,
  39944. onKeyboardSelect: API.onKeyboardSelect
  39945. });
  39946. const selectedLabel = computed(() => {
  39947. if (!props.multiple) return API.states.selectedLabel;
  39948. return API.states.cachedOptions.map((i) => API.getLabel(i));
  39949. });
  39950. return {
  39951. ...API,
  39952. modelValue,
  39953. selectedLabel,
  39954. calculatorRef,
  39955. inputStyle,
  39956. contentId,
  39957. BORDER_HORIZONTAL_WIDTH
  39958. };
  39959. }
  39960. });
  39961. //#endregion
  39962. //#region ../../packages/components/select-v2/src/select.vue
  39963. const _hoisted_1$21 = [
  39964. "id",
  39965. "value",
  39966. "autocomplete",
  39967. "tabindex",
  39968. "aria-expanded",
  39969. "aria-label",
  39970. "disabled",
  39971. "aria-controls",
  39972. "aria-activedescendant",
  39973. "readonly",
  39974. "name"
  39975. ];
  39976. const _hoisted_2$13 = ["textContent"];
  39977. const _hoisted_3$5 = { key: 1 };
  39978. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  39979. const _component_el_tag = resolveComponent("el-tag");
  39980. const _component_el_tooltip = resolveComponent("el-tooltip");
  39981. const _component_el_icon = resolveComponent("el-icon");
  39982. const _component_el_select_menu = resolveComponent("el-select-menu");
  39983. const _directive_click_outside = resolveDirective("click-outside");
  39984. return withDirectives((openBlock(), createElementBlock("div", {
  39985. ref: "selectRef",
  39986. class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
  39987. onMouseenter: _cache[15] || (_cache[15] = ($event) => _ctx.states.inputHovering = true),
  39988. onMouseleave: _cache[16] || (_cache[16] = ($event) => _ctx.states.inputHovering = false)
  39989. }, [createVNode(_component_el_tooltip, {
  39990. ref: "tooltipRef",
  39991. visible: _ctx.dropdownMenuVisible,
  39992. teleported: _ctx.teleported,
  39993. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  39994. "popper-style": _ctx.popperStyle,
  39995. "gpu-acceleration": false,
  39996. "stop-popper-mouse-event": false,
  39997. "popper-options": _ctx.popperOptions,
  39998. "fallback-placements": _ctx.fallbackPlacements,
  39999. effect: _ctx.effect,
  40000. placement: _ctx.placement,
  40001. pure: "",
  40002. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  40003. trigger: "click",
  40004. persistent: _ctx.persistent,
  40005. "append-to": _ctx.appendTo,
  40006. "show-arrow": _ctx.showArrow,
  40007. offset: _ctx.offset,
  40008. onBeforeShow: _ctx.handleMenuEnter,
  40009. onHide: _cache[14] || (_cache[14] = ($event) => _ctx.states.isBeforeHide = false)
  40010. }, {
  40011. default: withCtx(() => [createElementVNode("div", {
  40012. ref: "wrapperRef",
  40013. class: normalizeClass([
  40014. _ctx.nsSelect.e("wrapper"),
  40015. _ctx.nsSelect.is("focused", _ctx.isFocused),
  40016. _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
  40017. _ctx.nsSelect.is("filterable", _ctx.filterable),
  40018. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  40019. ]),
  40020. onClick: _cache[11] || (_cache[11] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
  40021. }, [
  40022. _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
  40023. key: 0,
  40024. ref: "prefixRef",
  40025. class: normalizeClass(_ctx.nsSelect.e("prefix"))
  40026. }, [renderSlot(_ctx.$slots, "prefix")], 2)) : createCommentVNode("v-if", true),
  40027. createElementVNode("div", {
  40028. ref: "selectionRef",
  40029. class: normalizeClass([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)])
  40030. }, [
  40031. _ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
  40032. key: 0,
  40033. data: _ctx.states.cachedOptions,
  40034. deleteTag: _ctx.deleteTag,
  40035. selectDisabled: _ctx.selectDisabled
  40036. }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  40037. return openBlock(), createElementBlock("div", {
  40038. key: _ctx.getValueKey(_ctx.getValue(item)),
  40039. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  40040. }, [createVNode(_component_el_tag, {
  40041. closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
  40042. size: _ctx.collapseTagSize,
  40043. type: _ctx.tagType,
  40044. effect: _ctx.tagEffect,
  40045. "disable-transitions": "",
  40046. style: normalizeStyle(_ctx.tagStyle),
  40047. onClose: ($event) => _ctx.deleteTag($event, item)
  40048. }, {
  40049. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", {
  40050. index: _ctx.getIndex(item),
  40051. label: _ctx.getLabel(item),
  40052. value: _ctx.getValue(item)
  40053. }, () => [createTextVNode(toDisplayString(_ctx.getLabel(item)), 1)])], 2)]),
  40054. _: 2
  40055. }, 1032, [
  40056. "closable",
  40057. "size",
  40058. "type",
  40059. "effect",
  40060. "style",
  40061. "onClose"
  40062. ])], 2);
  40063. }), 128)), _ctx.collapseTags && _ctx.states.cachedOptions.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
  40064. key: 0,
  40065. ref: "tagTooltipRef",
  40066. disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
  40067. "fallback-placements": _ctx.tagTooltip?.fallbackPlacements ?? [
  40068. "bottom",
  40069. "top",
  40070. "right",
  40071. "left"
  40072. ],
  40073. effect: _ctx.tagTooltip?.effect ?? _ctx.effect,
  40074. placement: _ctx.tagTooltip?.placement ?? "bottom",
  40075. "popper-class": _ctx.tagTooltip?.popperClass ?? _ctx.popperClass,
  40076. "popper-style": _ctx.tagTooltip?.popperStyle ?? _ctx.popperStyle,
  40077. teleported: _ctx.tagTooltip?.teleported ?? _ctx.teleported,
  40078. "append-to": _ctx.tagTooltip?.appendTo ?? _ctx.appendTo,
  40079. "popper-options": _ctx.tagTooltip?.popperOptions ?? _ctx.popperOptions,
  40080. transition: _ctx.tagTooltip?.transition,
  40081. "show-after": _ctx.tagTooltip?.showAfter,
  40082. "hide-after": _ctx.tagTooltip?.hideAfter,
  40083. "auto-close": _ctx.tagTooltip?.autoClose,
  40084. offset: _ctx.tagTooltip?.offset
  40085. }, {
  40086. default: withCtx(() => [createElementVNode("div", {
  40087. ref: "collapseItemRef",
  40088. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  40089. }, [createVNode(_component_el_tag, {
  40090. closable: false,
  40091. size: _ctx.collapseTagSize,
  40092. type: _ctx.tagType,
  40093. effect: _ctx.tagEffect,
  40094. style: normalizeStyle(_ctx.collapseTagStyle),
  40095. "disable-transitions": ""
  40096. }, {
  40097. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, " + " + toDisplayString(_ctx.states.cachedOptions.length - _ctx.maxCollapseTags), 3)]),
  40098. _: 1
  40099. }, 8, [
  40100. "size",
  40101. "type",
  40102. "effect",
  40103. "style"
  40104. ])], 2)]),
  40105. content: withCtx(() => [createElementVNode("div", {
  40106. ref: "tagMenuRef",
  40107. class: normalizeClass(_ctx.nsSelect.e("selection"))
  40108. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (selected) => {
  40109. return openBlock(), createElementBlock("div", {
  40110. key: _ctx.getValueKey(_ctx.getValue(selected)),
  40111. class: normalizeClass(_ctx.nsSelect.e("selected-item"))
  40112. }, [createVNode(_component_el_tag, {
  40113. class: "in-tooltip",
  40114. closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
  40115. size: _ctx.collapseTagSize,
  40116. type: _ctx.tagType,
  40117. effect: _ctx.tagEffect,
  40118. "disable-transitions": "",
  40119. onClose: ($event) => _ctx.deleteTag($event, selected)
  40120. }, {
  40121. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(_ctx.nsSelect.e("tags-text")) }, [renderSlot(_ctx.$slots, "label", {
  40122. index: _ctx.getIndex(selected),
  40123. label: _ctx.getLabel(selected),
  40124. value: _ctx.getValue(selected)
  40125. }, () => [createTextVNode(toDisplayString(_ctx.getLabel(selected)), 1)])], 2)]),
  40126. _: 2
  40127. }, 1032, [
  40128. "closable",
  40129. "size",
  40130. "type",
  40131. "effect",
  40132. "onClose"
  40133. ])], 2);
  40134. }), 128))], 2)]),
  40135. _: 3
  40136. }, 8, [
  40137. "disabled",
  40138. "fallback-placements",
  40139. "effect",
  40140. "placement",
  40141. "popper-class",
  40142. "popper-style",
  40143. "teleported",
  40144. "append-to",
  40145. "popper-options",
  40146. "transition",
  40147. "show-after",
  40148. "hide-after",
  40149. "auto-close",
  40150. "offset"
  40151. ])) : createCommentVNode("v-if", true)]) : createCommentVNode("v-if", true),
  40152. createElementVNode("div", { class: normalizeClass([
  40153. _ctx.nsSelect.e("selected-item"),
  40154. _ctx.nsSelect.e("input-wrapper"),
  40155. _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused)
  40156. ]) }, [createElementVNode("input", {
  40157. id: _ctx.inputId,
  40158. ref: "inputRef",
  40159. value: _ctx.states.inputValue,
  40160. style: normalizeStyle(_ctx.inputStyle),
  40161. autocomplete: _ctx.autocomplete,
  40162. tabindex: _ctx.tabindex,
  40163. "aria-autocomplete": "none",
  40164. "aria-haspopup": "listbox",
  40165. autocapitalize: "off",
  40166. "aria-expanded": _ctx.expanded,
  40167. "aria-label": _ctx.ariaLabel,
  40168. class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  40169. disabled: _ctx.selectDisabled,
  40170. role: "combobox",
  40171. "aria-controls": _ctx.contentId,
  40172. "aria-activedescendant": _ctx.states.hoveringIndex >= 0 ? `${_ctx.contentId}-${_ctx.states.hoveringIndex}` : "",
  40173. readonly: !_ctx.filterable,
  40174. spellcheck: "false",
  40175. type: "text",
  40176. name: _ctx.name,
  40177. onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  40178. onChange: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
  40179. onCompositionstart: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  40180. onCompositionupdate: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  40181. onCompositionend: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  40182. onKeydown: [
  40183. _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
  40184. _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
  40185. _cache[7] || (_cache[7] = withKeys(withModifiers((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])),
  40186. _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"])),
  40187. _cache[9] || (_cache[9] = withKeys(withModifiers((...args) => _ctx.handleDel && _ctx.handleDel(...args), ["stop"]), ["delete"]))
  40188. ],
  40189. onClick: _cache[10] || (_cache[10] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  40190. }, null, 46, _hoisted_1$21), _ctx.filterable ? (openBlock(), createElementBlock("span", {
  40191. key: 0,
  40192. ref: "calculatorRef",
  40193. "aria-hidden": "true",
  40194. class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
  40195. textContent: toDisplayString(_ctx.states.inputValue)
  40196. }, null, 10, _hoisted_2$13)) : createCommentVNode("v-if", true)], 2),
  40197. _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
  40198. key: 1,
  40199. class: normalizeClass([
  40200. _ctx.nsSelect.e("selected-item"),
  40201. _ctx.nsSelect.e("placeholder"),
  40202. _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
  40203. ])
  40204. }, [_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
  40205. key: 0,
  40206. index: _ctx.allOptionsValueMap.get(_ctx.modelValue)?.index ?? -1,
  40207. label: _ctx.currentPlaceholder,
  40208. value: _ctx.modelValue
  40209. }, () => [createElementVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)]) : (openBlock(), createElementBlock("span", _hoisted_3$5, toDisplayString(_ctx.currentPlaceholder), 1))], 2)) : createCommentVNode("v-if", true)
  40210. ], 2),
  40211. createElementVNode("div", {
  40212. ref: "suffixRef",
  40213. class: normalizeClass(_ctx.nsSelect.e("suffix"))
  40214. }, [
  40215. _ctx.iconComponent ? withDirectives((openBlock(), createBlock(_component_el_icon, {
  40216. key: 0,
  40217. class: normalizeClass([
  40218. _ctx.nsSelect.e("caret"),
  40219. _ctx.nsInput.e("icon"),
  40220. _ctx.iconReverse
  40221. ])
  40222. }, {
  40223. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]),
  40224. _: 1
  40225. }, 8, ["class"])), [[vShow, !_ctx.showClearBtn]]) : createCommentVNode("v-if", true),
  40226. _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  40227. key: 1,
  40228. class: normalizeClass([
  40229. _ctx.nsSelect.e("caret"),
  40230. _ctx.nsInput.e("icon"),
  40231. _ctx.nsSelect.e("clear")
  40232. ]),
  40233. onClick: withModifiers(_ctx.handleClear, ["prevent", "stop"])
  40234. }, {
  40235. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))]),
  40236. _: 1
  40237. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
  40238. _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
  40239. key: 2,
  40240. class: normalizeClass([
  40241. _ctx.nsInput.e("icon"),
  40242. _ctx.nsInput.e("validateIcon"),
  40243. _ctx.nsInput.is("loading", _ctx.validateState === "validating")
  40244. ])
  40245. }, {
  40246. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))]),
  40247. _: 1
  40248. }, 8, ["class"])) : createCommentVNode("v-if", true)
  40249. ], 2)
  40250. ], 2)]),
  40251. content: withCtx(() => [createVNode(_component_el_select_menu, {
  40252. id: _ctx.contentId,
  40253. ref: "menuRef",
  40254. data: _ctx.filteredOptions,
  40255. width: _ctx.popperSize - _ctx.BORDER_HORIZONTAL_WIDTH,
  40256. "hovering-index": _ctx.states.hoveringIndex,
  40257. "scrollbar-always-on": _ctx.scrollbarAlwaysOn,
  40258. "aria-label": _ctx.ariaLabel
  40259. }, createSlots({
  40260. default: withCtx((scope) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))]),
  40261. _: 2
  40262. }, [
  40263. _ctx.$slots.header ? {
  40264. name: "header",
  40265. fn: withCtx(() => [createElementVNode("div", {
  40266. class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
  40267. onClick: _cache[12] || (_cache[12] = withModifiers(() => {}, ["stop"]))
  40268. }, [renderSlot(_ctx.$slots, "header")], 2)]),
  40269. key: "0"
  40270. } : void 0,
  40271. _ctx.$slots.loading && _ctx.loading ? {
  40272. name: "loading",
  40273. fn: withCtx(() => [createElementVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading")) }, [renderSlot(_ctx.$slots, "loading")], 2)]),
  40274. key: "1"
  40275. } : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
  40276. name: "empty",
  40277. fn: withCtx(() => [createElementVNode("div", { class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("span", null, toDisplayString(_ctx.emptyText), 1)])], 2)]),
  40278. key: "2"
  40279. } : void 0,
  40280. _ctx.$slots.footer ? {
  40281. name: "footer",
  40282. fn: withCtx(() => [createElementVNode("div", {
  40283. class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
  40284. onClick: _cache[13] || (_cache[13] = withModifiers(() => {}, ["stop"]))
  40285. }, [renderSlot(_ctx.$slots, "footer")], 2)]),
  40286. key: "3"
  40287. } : void 0
  40288. ]), 1032, [
  40289. "id",
  40290. "data",
  40291. "width",
  40292. "hovering-index",
  40293. "scrollbar-always-on",
  40294. "aria-label"
  40295. ])]),
  40296. _: 3
  40297. }, 8, [
  40298. "visible",
  40299. "teleported",
  40300. "popper-class",
  40301. "popper-style",
  40302. "popper-options",
  40303. "fallback-placements",
  40304. "effect",
  40305. "placement",
  40306. "transition",
  40307. "persistent",
  40308. "append-to",
  40309. "show-arrow",
  40310. "offset",
  40311. "onBeforeShow"
  40312. ])], 34)), [[
  40313. _directive_click_outside,
  40314. _ctx.handleClickOutside,
  40315. _ctx.popperRef
  40316. ]]);
  40317. }
  40318. var select_default = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default, [["render", _sfc_render$5]]);
  40319. //#endregion
  40320. //#region ../../packages/components/select-v2/index.ts
  40321. const ElSelectV2 = withInstall(select_default);
  40322. //#endregion
  40323. //#region ../../packages/components/skeleton/src/skeleton.ts
  40324. /**
  40325. * @deprecated Removed after 3.0.0, Use `SkeletonProps` instead.
  40326. */
  40327. const skeletonProps = buildProps({
  40328. animated: Boolean,
  40329. count: {
  40330. type: Number,
  40331. default: 1
  40332. },
  40333. rows: {
  40334. type: Number,
  40335. default: 3
  40336. },
  40337. loading: {
  40338. type: Boolean,
  40339. default: true
  40340. },
  40341. throttle: { type: definePropType([Number, Object]) }
  40342. });
  40343. //#endregion
  40344. //#region ../../packages/components/skeleton/src/skeleton-item.ts
  40345. /**
  40346. * @deprecated Removed after 3.0.0, Use `SkeletonItemProps` instead.
  40347. */
  40348. const skeletonItemProps = buildProps({ variant: {
  40349. type: String,
  40350. values: [
  40351. "circle",
  40352. "rect",
  40353. "h1",
  40354. "h3",
  40355. "text",
  40356. "caption",
  40357. "p",
  40358. "image",
  40359. "button"
  40360. ],
  40361. default: "text"
  40362. } });
  40363. //#endregion
  40364. //#region ../../packages/components/skeleton/src/skeleton-item.vue?vue&type=script&setup=true&lang.ts
  40365. var skeleton_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  40366. name: "ElSkeletonItem",
  40367. __name: "skeleton-item",
  40368. props: skeletonItemProps,
  40369. setup(__props) {
  40370. const ns = useNamespace("skeleton");
  40371. return (_ctx, _cache) => {
  40372. return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).e("item"), unref(ns).e(__props.variant)]) }, [__props.variant === "image" ? (openBlock(), createBlock(unref(picture_filled_default), { key: 0 })) : createCommentVNode("v-if", true)], 2);
  40373. };
  40374. }
  40375. });
  40376. //#endregion
  40377. //#region ../../packages/components/skeleton/src/skeleton-item.vue
  40378. var skeleton_item_default = skeleton_item_vue_vue_type_script_setup_true_lang_default;
  40379. //#endregion
  40380. //#region ../../packages/components/skeleton/src/skeleton.vue?vue&type=script&setup=true&lang.ts
  40381. var skeleton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  40382. name: "ElSkeleton",
  40383. __name: "skeleton",
  40384. props: skeletonProps,
  40385. setup(__props, { expose: __expose }) {
  40386. const props = __props;
  40387. const ns = useNamespace("skeleton");
  40388. const uiLoading = useThrottleRender(toRef(props, "loading"), props.throttle);
  40389. __expose({ uiLoading });
  40390. return (_ctx, _cache) => {
  40391. return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({
  40392. key: 0,
  40393. class: [unref(ns).b(), unref(ns).is("animated", __props.animated)]
  40394. }, _ctx.$attrs), [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.count, (i) => {
  40395. return openBlock(), createElementBlock(Fragment, { key: i }, [unref(uiLoading) ? renderSlot(_ctx.$slots, "template", { key: i }, () => [createVNode(skeleton_item_default, {
  40396. class: normalizeClass(unref(ns).is("first")),
  40397. variant: "p"
  40398. }, null, 8, ["class"]), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (item) => {
  40399. return openBlock(), createBlock(skeleton_item_default, {
  40400. key: item,
  40401. class: normalizeClass([unref(ns).e("paragraph"), unref(ns).is("last", item === __props.rows && __props.rows > 1)]),
  40402. variant: "p"
  40403. }, null, 8, ["class"]);
  40404. }), 128))]) : createCommentVNode("v-if", true)], 64);
  40405. }), 128))], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
  40406. };
  40407. }
  40408. });
  40409. //#endregion
  40410. //#region ../../packages/components/skeleton/src/skeleton.vue
  40411. var skeleton_default = skeleton_vue_vue_type_script_setup_true_lang_default;
  40412. //#endregion
  40413. //#region ../../packages/components/skeleton/index.ts
  40414. const ElSkeleton = withInstall(skeleton_default, { SkeletonItem: skeleton_item_default });
  40415. const ElSkeletonItem = withNoopInstall(skeleton_item_default);
  40416. //#endregion
  40417. //#region ../../packages/components/slider/src/constants.ts
  40418. const sliderContextKey = Symbol("sliderContextKey");
  40419. //#endregion
  40420. //#region ../../packages/components/slider/src/slider.ts
  40421. const sliderProps = buildProps({
  40422. modelValue: {
  40423. type: definePropType([Number, Array]),
  40424. default: 0
  40425. },
  40426. id: {
  40427. type: String,
  40428. default: void 0
  40429. },
  40430. min: {
  40431. type: Number,
  40432. default: 0
  40433. },
  40434. max: {
  40435. type: Number,
  40436. default: 100
  40437. },
  40438. step: {
  40439. type: Number,
  40440. default: 1
  40441. },
  40442. showInput: Boolean,
  40443. showInputControls: {
  40444. type: Boolean,
  40445. default: true
  40446. },
  40447. size: useSizeProp,
  40448. inputSize: useSizeProp,
  40449. showStops: Boolean,
  40450. showTooltip: {
  40451. type: Boolean,
  40452. default: true
  40453. },
  40454. formatTooltip: {
  40455. type: definePropType(Function),
  40456. default: void 0
  40457. },
  40458. disabled: {
  40459. type: Boolean,
  40460. default: void 0
  40461. },
  40462. range: Boolean,
  40463. vertical: Boolean,
  40464. height: String,
  40465. rangeStartLabel: {
  40466. type: String,
  40467. default: void 0
  40468. },
  40469. rangeEndLabel: {
  40470. type: String,
  40471. default: void 0
  40472. },
  40473. formatValueText: {
  40474. type: definePropType(Function),
  40475. default: void 0
  40476. },
  40477. tooltipClass: {
  40478. type: String,
  40479. default: void 0
  40480. },
  40481. placement: {
  40482. type: String,
  40483. values: Ee,
  40484. default: "top"
  40485. },
  40486. marks: { type: definePropType(Object) },
  40487. validateEvent: {
  40488. type: Boolean,
  40489. default: true
  40490. },
  40491. persistent: {
  40492. type: Boolean,
  40493. default: true
  40494. },
  40495. ...useAriaProps(["ariaLabel"])
  40496. });
  40497. const isValidValue$1 = (value) => isNumber(value) || isArray$1(value) && value.every(isNumber);
  40498. const sliderEmits = {
  40499. [UPDATE_MODEL_EVENT]: isValidValue$1,
  40500. [INPUT_EVENT]: isValidValue$1,
  40501. [CHANGE_EVENT]: isValidValue$1
  40502. };
  40503. //#endregion
  40504. //#region ../../packages/components/slider/src/composables/use-lifecycle.ts
  40505. const useLifecycle = (props, initData, resetSize) => {
  40506. const sliderWrapper = ref();
  40507. onMounted(async () => {
  40508. if (props.range) {
  40509. if (isArray$1(props.modelValue)) {
  40510. initData.firstValue = Math.max(props.min, props.modelValue[0]);
  40511. initData.secondValue = Math.min(props.max, props.modelValue[1]);
  40512. } else {
  40513. initData.firstValue = props.min;
  40514. initData.secondValue = props.max;
  40515. }
  40516. initData.oldValue = [initData.firstValue, initData.secondValue];
  40517. } else {
  40518. if (!isNumber(props.modelValue) || Number.isNaN(props.modelValue)) initData.firstValue = props.min;
  40519. else initData.firstValue = Math.min(props.max, Math.max(props.min, props.modelValue));
  40520. initData.oldValue = initData.firstValue;
  40521. }
  40522. useEventListener(window, "resize", resetSize);
  40523. await nextTick();
  40524. resetSize();
  40525. });
  40526. return { sliderWrapper };
  40527. };
  40528. //#endregion
  40529. //#region ../../packages/components/slider/src/composables/use-marks.ts
  40530. const useMarks = (props) => {
  40531. return computed(() => {
  40532. if (!props.marks) return [];
  40533. return Object.keys(props.marks).map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props.max && point >= props.min).map((point) => ({
  40534. point,
  40535. position: (point - props.min) * 100 / (props.max - props.min),
  40536. mark: props.marks[point]
  40537. }));
  40538. });
  40539. };
  40540. //#endregion
  40541. //#region ../../packages/components/slider/src/composables/use-slide.ts
  40542. const useSlide = (props, initData, emit) => {
  40543. const { formItem: elFormItem } = useFormItem();
  40544. const slider = shallowRef();
  40545. const firstButton = ref();
  40546. const secondButton = ref();
  40547. const buttonRefs = {
  40548. firstButton,
  40549. secondButton
  40550. };
  40551. const sliderDisabled = useFormDisabled();
  40552. const minValue = computed(() => {
  40553. return Math.min(initData.firstValue, initData.secondValue);
  40554. });
  40555. const maxValue = computed(() => {
  40556. return Math.max(initData.firstValue, initData.secondValue);
  40557. });
  40558. const barSize = computed(() => {
  40559. return props.range ? `${100 * (maxValue.value - minValue.value) / (props.max - props.min)}%` : `${100 * (initData.firstValue - props.min) / (props.max - props.min)}%`;
  40560. });
  40561. const barStart = computed(() => {
  40562. return props.range ? `${100 * (minValue.value - props.min) / (props.max - props.min)}%` : "0%";
  40563. });
  40564. const runwayStyle = computed(() => {
  40565. return props.vertical ? { height: props.height } : {};
  40566. });
  40567. const barStyle = computed(() => {
  40568. return props.vertical ? {
  40569. height: barSize.value,
  40570. bottom: barStart.value
  40571. } : {
  40572. width: barSize.value,
  40573. left: barStart.value
  40574. };
  40575. });
  40576. const resetSize = () => {
  40577. if (slider.value) initData.sliderSize = slider.value.getBoundingClientRect()[props.vertical ? "height" : "width"];
  40578. };
  40579. const getButtonRefByPercent = (percent) => {
  40580. const targetValue = props.min + percent * (props.max - props.min) / 100;
  40581. if (!props.range) return firstButton;
  40582. let buttonRefName;
  40583. if (Math.abs(minValue.value - targetValue) < Math.abs(maxValue.value - targetValue)) buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton";
  40584. else buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton";
  40585. return buttonRefs[buttonRefName];
  40586. };
  40587. const setPosition = (percent) => {
  40588. const buttonRef = getButtonRefByPercent(percent);
  40589. buttonRef.value.setPosition(percent);
  40590. return buttonRef;
  40591. };
  40592. const setFirstValue = (firstValue) => {
  40593. initData.firstValue = firstValue ?? props.min;
  40594. _emit(props.range ? [minValue.value, maxValue.value] : firstValue ?? props.min);
  40595. };
  40596. const setSecondValue = (secondValue) => {
  40597. initData.secondValue = secondValue;
  40598. if (props.range) _emit([minValue.value, maxValue.value]);
  40599. };
  40600. const _emit = (val) => {
  40601. emit(UPDATE_MODEL_EVENT, val);
  40602. emit(INPUT_EVENT, val);
  40603. };
  40604. const emitChange = async () => {
  40605. await nextTick();
  40606. emit(CHANGE_EVENT, props.range ? [minValue.value, maxValue.value] : props.modelValue);
  40607. };
  40608. const handleSliderPointerEvent = (event) => {
  40609. if (sliderDisabled.value || initData.dragging) return;
  40610. resetSize();
  40611. let newPercent = 0;
  40612. if (props.vertical) {
  40613. const clientY = event.touches?.item(0)?.clientY ?? event.clientY;
  40614. newPercent = (slider.value.getBoundingClientRect().bottom - clientY) / initData.sliderSize * 100;
  40615. } else newPercent = ((event.touches?.item(0)?.clientX ?? event.clientX) - slider.value.getBoundingClientRect().left) / initData.sliderSize * 100;
  40616. if (newPercent < 0 || newPercent > 100) return;
  40617. return setPosition(newPercent);
  40618. };
  40619. const onSliderWrapperPrevent = (event) => {
  40620. if (buttonRefs["firstButton"].value?.dragging || buttonRefs["secondButton"].value?.dragging) event.preventDefault();
  40621. };
  40622. const onSliderDown = async (event) => {
  40623. const buttonRef = handleSliderPointerEvent(event);
  40624. if (buttonRef) {
  40625. await nextTick();
  40626. buttonRef.value.onButtonDown(event);
  40627. }
  40628. };
  40629. const onSliderClick = (event) => {
  40630. if (handleSliderPointerEvent(event)) emitChange();
  40631. };
  40632. const onSliderMarkerDown = (position) => {
  40633. if (sliderDisabled.value || initData.dragging) return;
  40634. if (setPosition(position)) emitChange();
  40635. };
  40636. return {
  40637. elFormItem,
  40638. slider,
  40639. firstButton,
  40640. secondButton,
  40641. sliderDisabled,
  40642. minValue,
  40643. maxValue,
  40644. runwayStyle,
  40645. barStyle,
  40646. resetSize,
  40647. setPosition,
  40648. emitChange,
  40649. onSliderWrapperPrevent,
  40650. onSliderClick,
  40651. onSliderDown,
  40652. onSliderMarkerDown,
  40653. setFirstValue,
  40654. setSecondValue
  40655. };
  40656. };
  40657. //#endregion
  40658. //#region ../../packages/components/slider/src/composables/use-slider-button.ts
  40659. const useTooltip = (props, formatTooltip, showTooltip) => {
  40660. const tooltip = ref();
  40661. const tooltipVisible = ref(false);
  40662. const enableFormat = computed(() => {
  40663. return formatTooltip.value instanceof Function;
  40664. });
  40665. return {
  40666. tooltip,
  40667. tooltipVisible,
  40668. formatValue: computed(() => {
  40669. return enableFormat.value && formatTooltip.value(props.modelValue) || props.modelValue;
  40670. }),
  40671. displayTooltip: debounce(() => {
  40672. showTooltip.value && (tooltipVisible.value = true);
  40673. }, 50),
  40674. hideTooltip: debounce(() => {
  40675. showTooltip.value && (tooltipVisible.value = false);
  40676. }, 50)
  40677. };
  40678. };
  40679. const useSliderButton = (props, initData, emit) => {
  40680. const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging } = inject(sliderContextKey);
  40681. const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props, formatTooltip, showTooltip);
  40682. const button = ref();
  40683. const currentPosition = computed(() => {
  40684. return `${(props.modelValue - min.value) / (max.value - min.value) * 100}%`;
  40685. });
  40686. const wrapperStyle = computed(() => {
  40687. return props.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
  40688. });
  40689. const handleMouseEnter = () => {
  40690. initData.hovering = true;
  40691. displayTooltip();
  40692. };
  40693. const handleMouseLeave = () => {
  40694. initData.hovering = false;
  40695. if (!initData.dragging) hideTooltip();
  40696. };
  40697. const onButtonDown = (event) => {
  40698. if (disabled.value) return;
  40699. event.preventDefault();
  40700. onDragStart(event);
  40701. window.addEventListener("mousemove", onDragging);
  40702. window.addEventListener("touchmove", onDragging);
  40703. window.addEventListener("mouseup", onDragEnd);
  40704. window.addEventListener("touchend", onDragEnd);
  40705. window.addEventListener("contextmenu", onDragEnd);
  40706. button.value.focus();
  40707. };
  40708. const incrementPosition = (amount) => {
  40709. if (disabled.value) return;
  40710. initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max.value - min.value) * 100;
  40711. setPosition(initData.newPosition);
  40712. emitChange();
  40713. };
  40714. const onLeftKeyDown = () => {
  40715. incrementPosition(-step.value);
  40716. };
  40717. const onRightKeyDown = () => {
  40718. incrementPosition(step.value);
  40719. };
  40720. const onPageDownKeyDown = () => {
  40721. incrementPosition(-step.value * 4);
  40722. };
  40723. const onPageUpKeyDown = () => {
  40724. incrementPosition(step.value * 4);
  40725. };
  40726. const onHomeKeyDown = () => {
  40727. if (disabled.value) return;
  40728. setPosition(0);
  40729. emitChange();
  40730. };
  40731. const onEndKeyDown = () => {
  40732. if (disabled.value) return;
  40733. setPosition(100);
  40734. emitChange();
  40735. };
  40736. const onKeyDown = (event) => {
  40737. const code = getEventCode(event);
  40738. let isPreventDefault = true;
  40739. switch (code) {
  40740. case EVENT_CODE.left:
  40741. case EVENT_CODE.down:
  40742. onLeftKeyDown();
  40743. break;
  40744. case EVENT_CODE.right:
  40745. case EVENT_CODE.up:
  40746. onRightKeyDown();
  40747. break;
  40748. case EVENT_CODE.home:
  40749. onHomeKeyDown();
  40750. break;
  40751. case EVENT_CODE.end:
  40752. onEndKeyDown();
  40753. break;
  40754. case EVENT_CODE.pageDown:
  40755. onPageDownKeyDown();
  40756. break;
  40757. case EVENT_CODE.pageUp:
  40758. onPageUpKeyDown();
  40759. break;
  40760. default:
  40761. isPreventDefault = false;
  40762. break;
  40763. }
  40764. isPreventDefault && event.preventDefault();
  40765. };
  40766. const getClientXY = (event) => {
  40767. let clientX;
  40768. let clientY;
  40769. if (event.type.startsWith("touch")) {
  40770. clientY = event.touches[0].clientY;
  40771. clientX = event.touches[0].clientX;
  40772. } else {
  40773. clientY = event.clientY;
  40774. clientX = event.clientX;
  40775. }
  40776. return {
  40777. clientX,
  40778. clientY
  40779. };
  40780. };
  40781. const onDragStart = (event) => {
  40782. initData.dragging = true;
  40783. initData.isClick = true;
  40784. const { clientX, clientY } = getClientXY(event);
  40785. if (props.vertical) initData.startY = clientY;
  40786. else initData.startX = clientX;
  40787. initData.startPosition = Number.parseFloat(currentPosition.value);
  40788. initData.newPosition = initData.startPosition;
  40789. };
  40790. const onDragging = (event) => {
  40791. if (initData.dragging) {
  40792. initData.isClick = false;
  40793. displayTooltip();
  40794. resetSize();
  40795. let diff;
  40796. const { clientX, clientY } = getClientXY(event);
  40797. if (props.vertical) {
  40798. initData.currentY = clientY;
  40799. diff = (initData.startY - initData.currentY) / sliderSize.value * 100;
  40800. } else {
  40801. initData.currentX = clientX;
  40802. diff = (initData.currentX - initData.startX) / sliderSize.value * 100;
  40803. }
  40804. initData.newPosition = initData.startPosition + diff;
  40805. setPosition(initData.newPosition);
  40806. }
  40807. };
  40808. const onDragEnd = () => {
  40809. if (initData.dragging) {
  40810. setTimeout(() => {
  40811. initData.dragging = false;
  40812. if (!initData.hovering) hideTooltip();
  40813. if (!initData.isClick) setPosition(initData.newPosition);
  40814. emitChange();
  40815. }, 0);
  40816. window.removeEventListener("mousemove", onDragging);
  40817. window.removeEventListener("touchmove", onDragging);
  40818. window.removeEventListener("mouseup", onDragEnd);
  40819. window.removeEventListener("touchend", onDragEnd);
  40820. window.removeEventListener("contextmenu", onDragEnd);
  40821. }
  40822. };
  40823. const setPosition = async (newPosition) => {
  40824. if (newPosition === null || Number.isNaN(+newPosition)) return;
  40825. newPosition = clamp$1(newPosition, 0, 100);
  40826. const fullSteps = Math.floor((max.value - min.value) / step.value);
  40827. const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
  40828. const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
  40829. let value;
  40830. if (newPosition < fullRangePercentage) {
  40831. const valueBetween = fullRangePercentage / fullSteps;
  40832. const steps = Math.round(newPosition / valueBetween);
  40833. value = min.value + steps * step.value;
  40834. } else if (newPosition < threshold) value = min.value + fullSteps * step.value;
  40835. else value = max.value;
  40836. value = Number.parseFloat(value.toFixed(precision.value));
  40837. if (value !== props.modelValue) emit(UPDATE_MODEL_EVENT, value);
  40838. if (!initData.dragging && props.modelValue !== initData.oldValue) initData.oldValue = props.modelValue;
  40839. await nextTick();
  40840. initData.dragging && displayTooltip();
  40841. tooltip.value.updatePopper();
  40842. };
  40843. watch(() => initData.dragging, (val) => {
  40844. updateDragging(val);
  40845. });
  40846. useEventListener(button, "touchstart", onButtonDown, { passive: false });
  40847. return {
  40848. disabled,
  40849. button,
  40850. tooltip,
  40851. tooltipVisible,
  40852. showTooltip,
  40853. persistent,
  40854. wrapperStyle,
  40855. formatValue,
  40856. handleMouseEnter,
  40857. handleMouseLeave,
  40858. onButtonDown,
  40859. onKeyDown,
  40860. setPosition
  40861. };
  40862. };
  40863. //#endregion
  40864. //#region ../../packages/components/slider/src/composables/use-stops.ts
  40865. const useStops = (props, initData, minValue, maxValue) => {
  40866. const stops = computed(() => {
  40867. if (!props.showStops || props.min > props.max) return [];
  40868. if (props.step === 0) {
  40869. /* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
  40870. return [];
  40871. }
  40872. const stopCount = Math.ceil((props.max - props.min) / props.step);
  40873. const stepWidth = 100 * props.step / (props.max - props.min);
  40874. const result = Array.from({ length: stopCount - 1 }).map((_, index) => (index + 1) * stepWidth);
  40875. if (props.range) return result.filter((step) => {
  40876. return step < 100 * (minValue.value - props.min) / (props.max - props.min) || step > 100 * (maxValue.value - props.min) / (props.max - props.min);
  40877. });
  40878. else return result.filter((step) => step > 100 * (initData.firstValue - props.min) / (props.max - props.min));
  40879. });
  40880. const getStopStyle = (position) => {
  40881. return props.vertical ? { bottom: `${position}%` } : { left: `${position}%` };
  40882. };
  40883. return {
  40884. stops,
  40885. getStopStyle
  40886. };
  40887. };
  40888. //#endregion
  40889. //#region ../../packages/components/slider/src/composables/use-watch.ts
  40890. const useWatch = (props, initData, minValue, maxValue, emit, elFormItem) => {
  40891. const _emit = (val) => {
  40892. emit(UPDATE_MODEL_EVENT, val);
  40893. emit(INPUT_EVENT, val);
  40894. };
  40895. const valueChanged = () => {
  40896. if (props.range) return ![minValue.value, maxValue.value].every((item, index) => item === initData.oldValue[index]);
  40897. else return props.modelValue !== initData.oldValue;
  40898. };
  40899. const setValues = () => {
  40900. if (props.min > props.max) throwError("Slider", "min should not be greater than max.");
  40901. const val = props.modelValue;
  40902. if (props.range && isArray$1(val)) if (val[1] < props.min) _emit([props.min, props.min]);
  40903. else if (val[0] > props.max) _emit([props.max, props.max]);
  40904. else if (val[0] < props.min) _emit([props.min, val[1]]);
  40905. else if (val[1] > props.max) _emit([val[0], props.max]);
  40906. else {
  40907. initData.firstValue = val[0];
  40908. initData.secondValue = val[1];
  40909. if (valueChanged()) {
  40910. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  40911. initData.oldValue = val.slice();
  40912. }
  40913. }
  40914. else if (!props.range && isNumber(val) && !Number.isNaN(val)) if (val < props.min) _emit(props.min);
  40915. else if (val > props.max) _emit(props.max);
  40916. else {
  40917. initData.firstValue = val;
  40918. if (valueChanged()) {
  40919. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  40920. initData.oldValue = val;
  40921. }
  40922. }
  40923. };
  40924. setValues();
  40925. watch(() => initData.dragging, (val) => {
  40926. if (!val) setValues();
  40927. });
  40928. watch(() => props.modelValue, (val, oldVal) => {
  40929. if (initData.dragging || isArray$1(val) && isArray$1(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) return;
  40930. setValues();
  40931. }, { deep: true });
  40932. watch(() => [props.min, props.max], () => {
  40933. setValues();
  40934. });
  40935. };
  40936. //#endregion
  40937. //#region ../../packages/components/slider/src/button.ts
  40938. const sliderButtonProps = buildProps({
  40939. modelValue: {
  40940. type: Number,
  40941. default: 0
  40942. },
  40943. vertical: Boolean,
  40944. tooltipClass: String,
  40945. placement: {
  40946. type: String,
  40947. values: Ee,
  40948. default: "top"
  40949. }
  40950. });
  40951. const sliderButtonEmits = { [UPDATE_MODEL_EVENT]: (value) => isNumber(value) };
  40952. //#endregion
  40953. //#region ../../packages/components/slider/src/button.vue?vue&type=script&setup=true&lang.ts
  40954. const _hoisted_1$20 = ["tabindex"];
  40955. var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  40956. name: "ElSliderButton",
  40957. __name: "button",
  40958. props: sliderButtonProps,
  40959. emits: sliderButtonEmits,
  40960. setup(__props, { expose: __expose, emit: __emit }) {
  40961. const props = __props;
  40962. const emit = __emit;
  40963. const ns = useNamespace("slider");
  40964. const initData = reactive({
  40965. hovering: false,
  40966. dragging: false,
  40967. isClick: false,
  40968. startX: 0,
  40969. currentX: 0,
  40970. startY: 0,
  40971. currentY: 0,
  40972. startPosition: 0,
  40973. newPosition: 0,
  40974. oldValue: props.modelValue
  40975. });
  40976. const tooltipPersistent = computed(() => !showTooltip.value ? false : persistent.value);
  40977. const { disabled, button, tooltip, showTooltip, persistent, tooltipVisible, wrapperStyle, formatValue, handleMouseEnter, handleMouseLeave, onButtonDown, onKeyDown, setPosition } = useSliderButton(props, initData, emit);
  40978. const { hovering, dragging } = toRefs(initData);
  40979. __expose({
  40980. onButtonDown,
  40981. onKeyDown,
  40982. setPosition,
  40983. hovering,
  40984. dragging
  40985. });
  40986. return (_ctx, _cache) => {
  40987. return openBlock(), createElementBlock("div", {
  40988. ref_key: "button",
  40989. ref: button,
  40990. class: normalizeClass([unref(ns).e("button-wrapper"), {
  40991. hover: unref(hovering),
  40992. dragging: unref(dragging)
  40993. }]),
  40994. style: normalizeStyle(unref(wrapperStyle)),
  40995. tabindex: unref(disabled) ? void 0 : 0,
  40996. onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
  40997. onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
  40998. onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
  40999. onFocus: _cache[3] || (_cache[3] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
  41000. onBlur: _cache[4] || (_cache[4] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
  41001. onKeydown: _cache[5] || (_cache[5] = (...args) => unref(onKeyDown) && unref(onKeyDown)(...args))
  41002. }, [createVNode(unref(ElTooltip), {
  41003. ref_key: "tooltip",
  41004. ref: tooltip,
  41005. visible: unref(tooltipVisible),
  41006. placement: _ctx.placement,
  41007. "fallback-placements": [
  41008. "top",
  41009. "bottom",
  41010. "right",
  41011. "left"
  41012. ],
  41013. "stop-popper-mouse-event": false,
  41014. "popper-class": _ctx.tooltipClass,
  41015. disabled: !unref(showTooltip),
  41016. persistent: tooltipPersistent.value
  41017. }, {
  41018. content: withCtx(() => [createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)]),
  41019. default: withCtx(() => [createElementVNode("div", { class: normalizeClass([unref(ns).e("button"), {
  41020. hover: unref(hovering),
  41021. dragging: unref(dragging)
  41022. }]) }, null, 2)]),
  41023. _: 1
  41024. }, 8, [
  41025. "visible",
  41026. "placement",
  41027. "popper-class",
  41028. "disabled",
  41029. "persistent"
  41030. ])], 46, _hoisted_1$20);
  41031. };
  41032. }
  41033. });
  41034. //#endregion
  41035. //#region ../../packages/components/slider/src/button.vue
  41036. var button_default = button_vue_vue_type_script_setup_true_lang_default;
  41037. //#endregion
  41038. //#region ../../packages/components/slider/src/marker.ts
  41039. const sliderMarkerProps = buildProps({ mark: {
  41040. type: definePropType([String, Object]),
  41041. default: void 0
  41042. } });
  41043. var marker_default = defineComponent({
  41044. name: "ElSliderMarker",
  41045. props: sliderMarkerProps,
  41046. setup(props) {
  41047. const ns = useNamespace("slider");
  41048. const label = computed(() => {
  41049. return isString(props.mark) ? props.mark : props.mark.label;
  41050. });
  41051. const style = computed(() => isString(props.mark) ? void 0 : props.mark.style);
  41052. return () => h("div", {
  41053. class: ns.e("marks-text"),
  41054. style: style.value
  41055. }, label.value);
  41056. }
  41057. });
  41058. //#endregion
  41059. //#region ../../packages/components/slider/src/slider.vue?vue&type=script&setup=true&lang.ts
  41060. const _hoisted_1$19 = [
  41061. "id",
  41062. "role",
  41063. "aria-label",
  41064. "aria-labelledby"
  41065. ];
  41066. const _hoisted_2$12 = { key: 1 };
  41067. var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  41068. name: "ElSlider",
  41069. __name: "slider",
  41070. props: sliderProps,
  41071. emits: sliderEmits,
  41072. setup(__props, { expose: __expose, emit: __emit }) {
  41073. const props = __props;
  41074. const emit = __emit;
  41075. const ns = useNamespace("slider");
  41076. const { t } = useLocale();
  41077. const initData = reactive({
  41078. firstValue: 0,
  41079. secondValue: 0,
  41080. oldValue: 0,
  41081. dragging: false,
  41082. sliderSize: 1
  41083. });
  41084. const { elFormItem, slider, firstButton, secondButton, sliderDisabled, minValue, maxValue, runwayStyle, barStyle, resetSize, emitChange, onSliderWrapperPrevent, onSliderClick, onSliderDown, onSliderMarkerDown, setFirstValue, setSecondValue } = useSlide(props, initData, emit);
  41085. const { stops, getStopStyle } = useStops(props, initData, minValue, maxValue);
  41086. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: elFormItem });
  41087. const sliderWrapperSize = useFormSize();
  41088. const sliderInputSize = computed(() => props.inputSize || sliderWrapperSize.value);
  41089. const groupLabel = computed(() => {
  41090. return props.ariaLabel || t("el.slider.defaultLabel", {
  41091. min: props.min,
  41092. max: props.max
  41093. });
  41094. });
  41095. const firstButtonLabel = computed(() => {
  41096. if (props.range) return props.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
  41097. else return groupLabel.value;
  41098. });
  41099. const firstValueText = computed(() => {
  41100. return props.formatValueText ? props.formatValueText(firstValue.value) : `${firstValue.value}`;
  41101. });
  41102. const secondButtonLabel = computed(() => {
  41103. return props.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
  41104. });
  41105. const secondValueText = computed(() => {
  41106. return props.formatValueText ? props.formatValueText(secondValue.value) : `${secondValue.value}`;
  41107. });
  41108. const sliderKls = computed(() => [
  41109. ns.b(),
  41110. ns.m(sliderWrapperSize.value),
  41111. ns.is("vertical", props.vertical),
  41112. { [ns.m("with-input")]: props.showInput }
  41113. ]);
  41114. const markList = useMarks(props);
  41115. useWatch(props, initData, minValue, maxValue, emit, elFormItem);
  41116. const precision = computed(() => {
  41117. const precisions = [
  41118. props.min,
  41119. props.max,
  41120. props.step
  41121. ].map((item) => {
  41122. const decimal = `${item}`.split(".")[1];
  41123. return decimal ? decimal.length : 0;
  41124. });
  41125. return Math.max.apply(null, precisions);
  41126. });
  41127. const { sliderWrapper } = useLifecycle(props, initData, resetSize);
  41128. const { firstValue, secondValue, sliderSize } = toRefs(initData);
  41129. const updateDragging = (val) => {
  41130. initData.dragging = val;
  41131. };
  41132. useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, { passive: false });
  41133. useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, { passive: false });
  41134. provide(sliderContextKey, {
  41135. ...toRefs(props),
  41136. sliderSize,
  41137. disabled: sliderDisabled,
  41138. precision,
  41139. emitChange,
  41140. resetSize,
  41141. updateDragging
  41142. });
  41143. __expose({ onSliderClick });
  41144. return (_ctx, _cache) => {
  41145. return openBlock(), createElementBlock("div", {
  41146. id: _ctx.range ? unref(inputId) : void 0,
  41147. ref_key: "sliderWrapper",
  41148. ref: sliderWrapper,
  41149. class: normalizeClass(sliderKls.value),
  41150. role: _ctx.range ? "group" : void 0,
  41151. "aria-label": _ctx.range && !unref(isLabeledByFormItem) ? groupLabel.value : void 0,
  41152. "aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? unref(elFormItem)?.labelId : void 0
  41153. }, [createElementVNode("div", {
  41154. ref_key: "slider",
  41155. ref: slider,
  41156. class: normalizeClass([
  41157. unref(ns).e("runway"),
  41158. { "show-input": _ctx.showInput && !_ctx.range },
  41159. unref(ns).is("disabled", unref(sliderDisabled))
  41160. ]),
  41161. style: normalizeStyle(unref(runwayStyle)),
  41162. onMousedown: _cache[0] || (_cache[0] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args)),
  41163. onTouchstartPassive: _cache[1] || (_cache[1] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args))
  41164. }, [
  41165. createElementVNode("div", {
  41166. class: normalizeClass(unref(ns).e("bar")),
  41167. style: normalizeStyle(unref(barStyle))
  41168. }, null, 6),
  41169. createVNode(button_default, {
  41170. id: !_ctx.range ? unref(inputId) : void 0,
  41171. ref_key: "firstButton",
  41172. ref: firstButton,
  41173. "model-value": unref(firstValue),
  41174. vertical: _ctx.vertical,
  41175. "tooltip-class": _ctx.tooltipClass,
  41176. placement: _ctx.placement,
  41177. role: "slider",
  41178. "aria-label": _ctx.range || !unref(isLabeledByFormItem) ? firstButtonLabel.value : void 0,
  41179. "aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? unref(elFormItem)?.labelId : void 0,
  41180. "aria-valuemin": _ctx.min,
  41181. "aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max,
  41182. "aria-valuenow": unref(firstValue),
  41183. "aria-valuetext": firstValueText.value,
  41184. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  41185. "aria-disabled": unref(sliderDisabled),
  41186. "onUpdate:modelValue": unref(setFirstValue)
  41187. }, null, 8, [
  41188. "id",
  41189. "model-value",
  41190. "vertical",
  41191. "tooltip-class",
  41192. "placement",
  41193. "aria-label",
  41194. "aria-labelledby",
  41195. "aria-valuemin",
  41196. "aria-valuemax",
  41197. "aria-valuenow",
  41198. "aria-valuetext",
  41199. "aria-orientation",
  41200. "aria-disabled",
  41201. "onUpdate:modelValue"
  41202. ]),
  41203. _ctx.range ? (openBlock(), createBlock(button_default, {
  41204. key: 0,
  41205. ref_key: "secondButton",
  41206. ref: secondButton,
  41207. "model-value": unref(secondValue),
  41208. vertical: _ctx.vertical,
  41209. "tooltip-class": _ctx.tooltipClass,
  41210. placement: _ctx.placement,
  41211. role: "slider",
  41212. "aria-label": secondButtonLabel.value,
  41213. "aria-valuemin": unref(firstValue),
  41214. "aria-valuemax": _ctx.max,
  41215. "aria-valuenow": unref(secondValue),
  41216. "aria-valuetext": secondValueText.value,
  41217. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  41218. "aria-disabled": unref(sliderDisabled),
  41219. "onUpdate:modelValue": unref(setSecondValue)
  41220. }, null, 8, [
  41221. "model-value",
  41222. "vertical",
  41223. "tooltip-class",
  41224. "placement",
  41225. "aria-label",
  41226. "aria-valuemin",
  41227. "aria-valuemax",
  41228. "aria-valuenow",
  41229. "aria-valuetext",
  41230. "aria-orientation",
  41231. "aria-disabled",
  41232. "onUpdate:modelValue"
  41233. ])) : createCommentVNode("v-if", true),
  41234. _ctx.showStops ? (openBlock(), createElementBlock("div", _hoisted_2$12, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(stops), (item, key) => {
  41235. return openBlock(), createElementBlock("div", {
  41236. key,
  41237. class: normalizeClass(unref(ns).e("stop")),
  41238. style: normalizeStyle(unref(getStopStyle)(item))
  41239. }, null, 6);
  41240. }), 128))])) : createCommentVNode("v-if", true),
  41241. unref(markList).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createElementVNode("div", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
  41242. return openBlock(), createElementBlock("div", {
  41243. key,
  41244. style: normalizeStyle(unref(getStopStyle)(item.position)),
  41245. class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")])
  41246. }, null, 6);
  41247. }), 128))]), createElementVNode("div", { class: normalizeClass(unref(ns).e("marks")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
  41248. return openBlock(), createBlock(unref(marker_default), {
  41249. key,
  41250. mark: item.mark,
  41251. style: normalizeStyle(unref(getStopStyle)(item.position)),
  41252. onMousedown: withModifiers(($event) => unref(onSliderMarkerDown)(item.position), ["stop"])
  41253. }, null, 8, [
  41254. "mark",
  41255. "style",
  41256. "onMousedown"
  41257. ]);
  41258. }), 128))], 2)], 64)) : createCommentVNode("v-if", true)
  41259. ], 38), _ctx.showInput && !_ctx.range ? (openBlock(), createBlock(unref(ElInputNumber), {
  41260. key: 0,
  41261. ref: "input",
  41262. "model-value": unref(firstValue),
  41263. class: normalizeClass(unref(ns).e("input")),
  41264. step: _ctx.step,
  41265. disabled: unref(sliderDisabled),
  41266. controls: _ctx.showInputControls,
  41267. min: _ctx.min,
  41268. max: _ctx.max,
  41269. precision: precision.value,
  41270. size: sliderInputSize.value,
  41271. "onUpdate:modelValue": unref(setFirstValue),
  41272. onChange: unref(emitChange)
  41273. }, null, 8, [
  41274. "model-value",
  41275. "class",
  41276. "step",
  41277. "disabled",
  41278. "controls",
  41279. "min",
  41280. "max",
  41281. "precision",
  41282. "size",
  41283. "onUpdate:modelValue",
  41284. "onChange"
  41285. ])) : createCommentVNode("v-if", true)], 10, _hoisted_1$19);
  41286. };
  41287. }
  41288. });
  41289. //#endregion
  41290. //#region ../../packages/components/slider/src/slider.vue
  41291. var slider_default = slider_vue_vue_type_script_setup_true_lang_default;
  41292. //#endregion
  41293. //#region ../../packages/components/slider/index.ts
  41294. const ElSlider = withInstall(slider_default);
  41295. //#endregion
  41296. //#region ../../packages/components/space/src/item.ts
  41297. const spaceItemProps = buildProps({ prefixCls: { type: String } });
  41298. const SpaceItem = defineComponent({
  41299. name: "ElSpaceItem",
  41300. props: spaceItemProps,
  41301. setup(props, { slots }) {
  41302. const ns = useNamespace("space");
  41303. const classes = computed(() => `${props.prefixCls || ns.b()}__item`);
  41304. return () => h("div", { class: classes.value }, renderSlot(slots, "default"));
  41305. }
  41306. });
  41307. //#endregion
  41308. //#region ../../packages/components/space/src/use-space.ts
  41309. const SIZE_MAP = {
  41310. small: 8,
  41311. default: 12,
  41312. large: 16
  41313. };
  41314. function useSpace(props) {
  41315. const ns = useNamespace("space");
  41316. const classes = computed(() => [
  41317. ns.b(),
  41318. ns.m(props.direction),
  41319. props.class
  41320. ]);
  41321. const horizontalSize = ref(0);
  41322. const verticalSize = ref(0);
  41323. const containerStyle = computed(() => {
  41324. return [
  41325. props.wrap || props.fill ? { flexWrap: "wrap" } : {},
  41326. { alignItems: props.alignment },
  41327. {
  41328. rowGap: `${verticalSize.value}px`,
  41329. columnGap: `${horizontalSize.value}px`
  41330. },
  41331. props.style
  41332. ];
  41333. });
  41334. const itemStyle = computed(() => {
  41335. return props.fill ? {
  41336. flexGrow: 1,
  41337. minWidth: `${props.fillRatio}%`
  41338. } : {};
  41339. });
  41340. watchEffect(() => {
  41341. const { size = "small", wrap, direction: dir, fill } = props;
  41342. if (isArray$1(size)) {
  41343. const [h = 0, v = 0] = size;
  41344. horizontalSize.value = h;
  41345. verticalSize.value = v;
  41346. } else {
  41347. let val;
  41348. if (isNumber(size)) val = size;
  41349. else val = SIZE_MAP[size || "small"] || SIZE_MAP.small;
  41350. if ((wrap || fill) && dir === "horizontal") horizontalSize.value = verticalSize.value = val;
  41351. else if (dir === "horizontal") {
  41352. horizontalSize.value = val;
  41353. verticalSize.value = 0;
  41354. } else {
  41355. verticalSize.value = val;
  41356. horizontalSize.value = 0;
  41357. }
  41358. }
  41359. });
  41360. return {
  41361. classes,
  41362. containerStyle,
  41363. itemStyle
  41364. };
  41365. }
  41366. //#endregion
  41367. //#region ../../packages/components/space/src/space.ts
  41368. const spaceProps = buildProps({
  41369. direction: {
  41370. type: String,
  41371. values: ["horizontal", "vertical"],
  41372. default: "horizontal"
  41373. },
  41374. class: {
  41375. type: definePropType([
  41376. String,
  41377. Object,
  41378. Array
  41379. ]),
  41380. default: ""
  41381. },
  41382. style: {
  41383. type: definePropType([
  41384. String,
  41385. Array,
  41386. Object
  41387. ]),
  41388. default: ""
  41389. },
  41390. alignment: {
  41391. type: definePropType(String),
  41392. default: "center"
  41393. },
  41394. prefixCls: { type: String },
  41395. spacer: {
  41396. type: definePropType([
  41397. Object,
  41398. String,
  41399. Number,
  41400. Array
  41401. ]),
  41402. default: null,
  41403. validator: (val) => isVNode(val) || isNumber(val) || isString(val)
  41404. },
  41405. wrap: Boolean,
  41406. fill: Boolean,
  41407. fillRatio: {
  41408. type: Number,
  41409. default: 100
  41410. },
  41411. size: {
  41412. type: [
  41413. String,
  41414. Array,
  41415. Number
  41416. ],
  41417. values: componentSizes,
  41418. validator: (val) => {
  41419. return isNumber(val) || isArray$1(val) && val.length === 2 && val.every(isNumber);
  41420. }
  41421. }
  41422. });
  41423. const Space = defineComponent({
  41424. name: "ElSpace",
  41425. props: spaceProps,
  41426. setup(props, { slots }) {
  41427. const { classes, containerStyle, itemStyle } = useSpace(props);
  41428. function extractChildren(children, parentKey = "", extractedChildren = []) {
  41429. const { prefixCls } = props;
  41430. children.forEach((child, loopKey) => {
  41431. if (isFragment(child)) {
  41432. if (isArray$1(child.children)) child.children.forEach((nested, key) => {
  41433. if (isFragment(nested) && isArray$1(nested.children)) extractChildren(nested.children, `${parentKey + key}-`, extractedChildren);
  41434. else if (isVNode(nested) && nested?.type === Comment) extractedChildren.push(nested);
  41435. else extractedChildren.push(createVNode(SpaceItem, {
  41436. style: itemStyle.value,
  41437. prefixCls,
  41438. key: `nested-${parentKey + key}`
  41439. }, { default: () => [nested] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  41440. });
  41441. } else if (isValidElementNode(child)) extractedChildren.push(createVNode(SpaceItem, {
  41442. style: itemStyle.value,
  41443. prefixCls,
  41444. key: `LoopKey${parentKey + loopKey}`
  41445. }, { default: () => [child] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  41446. });
  41447. return extractedChildren;
  41448. }
  41449. return () => {
  41450. const { spacer, direction } = props;
  41451. const children = renderSlot(slots, "default", { key: 0 }, () => []);
  41452. if ((children.children ?? []).length === 0) return null;
  41453. if (isArray$1(children.children)) {
  41454. let extractedChildren = extractChildren(children.children);
  41455. if (spacer) {
  41456. const len = extractedChildren.length - 1;
  41457. extractedChildren = extractedChildren.reduce((acc, child, idx) => {
  41458. const children = [...acc, child];
  41459. if (idx !== len) children.push(createVNode("span", {
  41460. style: [itemStyle.value, direction === "vertical" ? "width: 100%" : null],
  41461. key: idx
  41462. }, [isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)], PatchFlags.STYLE));
  41463. return children;
  41464. }, []);
  41465. }
  41466. return createVNode("div", {
  41467. class: classes.value,
  41468. style: containerStyle.value
  41469. }, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS);
  41470. }
  41471. return children.children;
  41472. };
  41473. }
  41474. });
  41475. //#endregion
  41476. //#region ../../packages/components/space/index.ts
  41477. const ElSpace = withInstall(Space);
  41478. //#endregion
  41479. //#region ../../packages/components/statistic/src/statistic.ts
  41480. /**
  41481. * @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
  41482. */
  41483. const statisticProps = buildProps({
  41484. decimalSeparator: {
  41485. type: String,
  41486. default: "."
  41487. },
  41488. groupSeparator: {
  41489. type: String,
  41490. default: ","
  41491. },
  41492. precision: {
  41493. type: Number,
  41494. default: 0
  41495. },
  41496. formatter: Function,
  41497. value: {
  41498. type: definePropType([Number, Object]),
  41499. default: 0
  41500. },
  41501. prefix: String,
  41502. suffix: String,
  41503. title: String,
  41504. valueStyle: { type: definePropType([
  41505. String,
  41506. Object,
  41507. Array
  41508. ]) }
  41509. });
  41510. //#endregion
  41511. //#region ../../packages/components/statistic/src/statistic.vue?vue&type=script&setup=true&lang.ts
  41512. var statistic_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  41513. name: "ElStatistic",
  41514. __name: "statistic",
  41515. props: statisticProps,
  41516. setup(__props, { expose: __expose }) {
  41517. const props = __props;
  41518. const ns = useNamespace("statistic");
  41519. const displayValue = computed(() => {
  41520. const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
  41521. if (isFunction$1(formatter)) return formatter(value);
  41522. if (!isNumber(value) || Number.isNaN(value)) return value;
  41523. let [integer, decimal = ""] = String(value).split(".");
  41524. decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
  41525. integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
  41526. return [integer, decimal].join(decimal ? decimalSeparator : "");
  41527. });
  41528. __expose({ displayValue });
  41529. return (_ctx, _cache) => {
  41530. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", {
  41531. key: 0,
  41532. class: normalizeClass(unref(ns).e("head"))
  41533. }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [
  41534. _ctx.$slots.prefix || __props.prefix ? (openBlock(), createElementBlock("div", {
  41535. key: 0,
  41536. class: normalizeClass(unref(ns).e("prefix"))
  41537. }, [renderSlot(_ctx.$slots, "prefix", {}, () => [createElementVNode("span", null, toDisplayString(__props.prefix), 1)])], 2)) : createCommentVNode("v-if", true),
  41538. createElementVNode("span", {
  41539. class: normalizeClass(unref(ns).e("number")),
  41540. style: normalizeStyle(__props.valueStyle)
  41541. }, toDisplayString(displayValue.value), 7),
  41542. _ctx.$slots.suffix || __props.suffix ? (openBlock(), createElementBlock("div", {
  41543. key: 1,
  41544. class: normalizeClass(unref(ns).e("suffix"))
  41545. }, [renderSlot(_ctx.$slots, "suffix", {}, () => [createElementVNode("span", null, toDisplayString(__props.suffix), 1)])], 2)) : createCommentVNode("v-if", true)
  41546. ], 2)], 2);
  41547. };
  41548. }
  41549. });
  41550. //#endregion
  41551. //#region ../../packages/components/statistic/src/statistic.vue
  41552. var statistic_default = statistic_vue_vue_type_script_setup_true_lang_default;
  41553. //#endregion
  41554. //#region ../../packages/components/statistic/index.ts
  41555. const ElStatistic = withInstall(statistic_default);
  41556. //#endregion
  41557. //#region ../../packages/components/countdown/src/countdown.ts
  41558. /**
  41559. * @deprecated Removed after 3.0.0, Use `CountdownProps` instead.
  41560. */
  41561. const countdownProps = buildProps({
  41562. format: {
  41563. type: String,
  41564. default: "HH:mm:ss"
  41565. },
  41566. prefix: String,
  41567. suffix: String,
  41568. title: String,
  41569. value: {
  41570. type: definePropType([Number, Object]),
  41571. default: 0
  41572. },
  41573. valueStyle: { type: definePropType([
  41574. String,
  41575. Object,
  41576. Array
  41577. ]) }
  41578. });
  41579. const countdownEmits = {
  41580. finish: () => true,
  41581. [CHANGE_EVENT]: (value) => isNumber(value)
  41582. };
  41583. //#endregion
  41584. //#region ../../packages/components/countdown/src/utils.ts
  41585. const timeUnits$1 = [
  41586. ["Y", 1e3 * 60 * 60 * 24 * 365],
  41587. ["M", 1e3 * 60 * 60 * 24 * 30],
  41588. ["D", 1e3 * 60 * 60 * 24],
  41589. ["H", 1e3 * 60 * 60],
  41590. ["m", 1e3 * 60],
  41591. ["s", 1e3],
  41592. ["S", 1]
  41593. ];
  41594. const getTime = (value) => {
  41595. return isNumber(value) ? new Date(value).getTime() : value.valueOf();
  41596. };
  41597. const formatTime$1 = (timestamp, format) => {
  41598. let timeLeft = timestamp;
  41599. return timeUnits$1.reduce((current, [name, unit]) => {
  41600. const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g");
  41601. if (replaceRegex.test(current)) {
  41602. const value = Math.floor(timeLeft / unit);
  41603. timeLeft -= value * unit;
  41604. return current.replace(replaceRegex, (match) => String(value).padStart(match.length, "0"));
  41605. }
  41606. return current;
  41607. }, format).replace(/\[([^\]]*)]/g, "$1");
  41608. };
  41609. //#endregion
  41610. //#region ../../packages/components/countdown/src/countdown.vue?vue&type=script&setup=true&lang.ts
  41611. var countdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  41612. name: "ElCountdown",
  41613. __name: "countdown",
  41614. props: countdownProps,
  41615. emits: countdownEmits,
  41616. setup(__props, { expose: __expose, emit: __emit }) {
  41617. const props = __props;
  41618. const emit = __emit;
  41619. let timer;
  41620. const rawValue = ref(0);
  41621. const displayValue = computed(() => formatTime$1(rawValue.value, props.format));
  41622. const formatter = (val) => formatTime$1(val, props.format);
  41623. const stopTimer = () => {
  41624. if (timer) {
  41625. cAF(timer);
  41626. timer = void 0;
  41627. }
  41628. };
  41629. const startTimer = () => {
  41630. const timestamp = getTime(props.value);
  41631. const frameFunc = () => {
  41632. let diff = timestamp - Date.now();
  41633. emit(CHANGE_EVENT, diff);
  41634. if (diff <= 0) {
  41635. diff = 0;
  41636. stopTimer();
  41637. emit("finish");
  41638. } else timer = rAF(frameFunc);
  41639. rawValue.value = diff;
  41640. };
  41641. timer = rAF(frameFunc);
  41642. };
  41643. onMounted(() => {
  41644. rawValue.value = getTime(props.value) - Date.now();
  41645. watch(() => [props.value, props.format], () => {
  41646. stopTimer();
  41647. startTimer();
  41648. }, { immediate: true });
  41649. });
  41650. onBeforeUnmount(() => {
  41651. stopTimer();
  41652. });
  41653. __expose({ displayValue });
  41654. return (_ctx, _cache) => {
  41655. return openBlock(), createBlock(unref(ElStatistic), {
  41656. value: rawValue.value,
  41657. title: __props.title,
  41658. prefix: __props.prefix,
  41659. suffix: __props.suffix,
  41660. "value-style": __props.valueStyle,
  41661. formatter
  41662. }, createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
  41663. return {
  41664. name,
  41665. fn: withCtx(() => [renderSlot(_ctx.$slots, name)])
  41666. };
  41667. })]), 1032, [
  41668. "value",
  41669. "title",
  41670. "prefix",
  41671. "suffix",
  41672. "value-style"
  41673. ]);
  41674. };
  41675. }
  41676. });
  41677. //#endregion
  41678. //#region ../../packages/components/countdown/src/countdown.vue
  41679. var countdown_default = countdown_vue_vue_type_script_setup_true_lang_default;
  41680. //#endregion
  41681. //#region ../../packages/components/countdown/index.ts
  41682. const ElCountdown = withInstall(countdown_default);
  41683. //#endregion
  41684. //#region ../../packages/components/steps/src/steps.ts
  41685. /**
  41686. * @deprecated Removed after 3.0.0, Use `StepsProps` instead.
  41687. */
  41688. const stepsProps = buildProps({
  41689. space: {
  41690. type: [Number, String],
  41691. default: ""
  41692. },
  41693. active: {
  41694. type: Number,
  41695. default: 0
  41696. },
  41697. direction: {
  41698. type: String,
  41699. default: "horizontal",
  41700. values: ["horizontal", "vertical"]
  41701. },
  41702. alignCenter: { type: Boolean },
  41703. simple: { type: Boolean },
  41704. finishStatus: {
  41705. type: String,
  41706. values: [
  41707. "wait",
  41708. "process",
  41709. "finish",
  41710. "error",
  41711. "success"
  41712. ],
  41713. default: "finish"
  41714. },
  41715. processStatus: {
  41716. type: String,
  41717. values: [
  41718. "wait",
  41719. "process",
  41720. "finish",
  41721. "error",
  41722. "success"
  41723. ],
  41724. default: "process"
  41725. }
  41726. });
  41727. const stepsEmits = { [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber) };
  41728. //#endregion
  41729. //#region ../../packages/components/steps/src/tokens.ts
  41730. const STEPS_INJECTION_KEY = "ElSteps";
  41731. //#endregion
  41732. //#region ../../packages/components/steps/src/steps.vue?vue&type=script&setup=true&lang.ts
  41733. var steps_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  41734. name: "ElSteps",
  41735. __name: "steps",
  41736. props: stepsProps,
  41737. emits: stepsEmits,
  41738. setup(__props, { emit: __emit }) {
  41739. const props = __props;
  41740. const emit = __emit;
  41741. const ns = useNamespace("steps");
  41742. const { children: steps, addChild: addStep, removeChild: removeStep, ChildrenSorter: StepsSorter } = useOrderedChildren(getCurrentInstance(), "ElStep");
  41743. watch(steps, () => {
  41744. steps.value.forEach((instance, index) => {
  41745. instance.setIndex(index);
  41746. });
  41747. });
  41748. provide(STEPS_INJECTION_KEY, {
  41749. props,
  41750. steps,
  41751. addStep,
  41752. removeStep
  41753. });
  41754. watch(() => props.active, (newVal, oldVal) => {
  41755. emit(CHANGE_EVENT, newVal, oldVal);
  41756. });
  41757. return (_ctx, _cache) => {
  41758. return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b(), unref(ns).m(__props.simple ? "simple" : __props.direction)]) }, [renderSlot(_ctx.$slots, "default"), createVNode(unref(StepsSorter))], 2);
  41759. };
  41760. }
  41761. });
  41762. //#endregion
  41763. //#region ../../packages/components/steps/src/steps.vue
  41764. var steps_default$1 = steps_vue_vue_type_script_setup_true_lang_default;
  41765. //#endregion
  41766. //#region ../../packages/components/steps/src/item.ts
  41767. /**
  41768. * @deprecated Removed after 3.0.0, Use `StepProps` instead.
  41769. */
  41770. const stepProps = buildProps({
  41771. title: {
  41772. type: String,
  41773. default: ""
  41774. },
  41775. icon: { type: iconPropType },
  41776. description: {
  41777. type: String,
  41778. default: ""
  41779. },
  41780. status: {
  41781. type: String,
  41782. values: [
  41783. "",
  41784. "wait",
  41785. "process",
  41786. "finish",
  41787. "error",
  41788. "success"
  41789. ],
  41790. default: ""
  41791. }
  41792. });
  41793. //#endregion
  41794. //#region ../../packages/components/steps/src/item.vue?vue&type=script&setup=true&lang.ts
  41795. var item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  41796. name: "ElStep",
  41797. __name: "item",
  41798. props: stepProps,
  41799. setup(__props) {
  41800. const props = __props;
  41801. const ns = useNamespace("step");
  41802. const index = ref(-1);
  41803. const lineStyle = ref({});
  41804. const internalStatus = ref("");
  41805. const parent = inject(STEPS_INJECTION_KEY);
  41806. const currentInstance = getCurrentInstance();
  41807. let stepDiff = 0;
  41808. let beforeActive = 0;
  41809. onMounted(() => {
  41810. watch([
  41811. () => parent.props.active,
  41812. () => parent.props.processStatus,
  41813. () => parent.props.finishStatus
  41814. ], ([active], [oldActive]) => {
  41815. beforeActive = oldActive || 0;
  41816. stepDiff = active - beforeActive;
  41817. updateStatus(active);
  41818. }, { immediate: true });
  41819. });
  41820. const currentStatus = computed(() => {
  41821. return props.status || internalStatus.value;
  41822. });
  41823. const prevInternalStatus = computed(() => {
  41824. const prevStep = parent.steps.value[index.value - 1];
  41825. return prevStep ? prevStep.internalStatus.value : "wait";
  41826. });
  41827. const isCenter = computed(() => {
  41828. return parent.props.alignCenter;
  41829. });
  41830. const isVertical = computed(() => {
  41831. return parent.props.direction === "vertical";
  41832. });
  41833. const isSimple = computed(() => {
  41834. return parent.props.simple;
  41835. });
  41836. const stepsCount = computed(() => {
  41837. return parent.steps.value.length;
  41838. });
  41839. const isLast = computed(() => {
  41840. return parent.steps.value[stepsCount.value - 1]?.uid === currentInstance.uid;
  41841. });
  41842. const space = computed(() => {
  41843. return isSimple.value ? "" : parent.props.space;
  41844. });
  41845. const containerKls = computed(() => {
  41846. return [
  41847. ns.b(),
  41848. ns.is(isSimple.value ? "simple" : parent.props.direction),
  41849. ns.is("flex", isLast.value && !space.value && !isCenter.value),
  41850. ns.is("center", isCenter.value && !isVertical.value && !isSimple.value)
  41851. ];
  41852. });
  41853. const style = computed(() => {
  41854. const style = { flexBasis: isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%` };
  41855. if (isVertical.value) return style;
  41856. if (isLast.value) style.maxWidth = `${100 / stepsCount.value}%`;
  41857. return style;
  41858. });
  41859. const setIndex = (val) => {
  41860. index.value = val;
  41861. };
  41862. const calcProgress = (status) => {
  41863. const isWait = status === "wait";
  41864. const style = { transitionDelay: `${Math.abs(stepDiff) === 1 ? 0 : stepDiff > 0 ? (index.value + 1 - beforeActive) * 150 : -(index.value + 1 - parent.props.active) * 150}ms` };
  41865. const step = status === parent.props.processStatus || isWait ? 0 : 100;
  41866. style.borderWidth = step && !isSimple.value ? "1px" : 0;
  41867. style[parent.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
  41868. lineStyle.value = style;
  41869. };
  41870. const updateStatus = (activeIndex) => {
  41871. if (activeIndex > index.value) internalStatus.value = parent.props.finishStatus;
  41872. else if (activeIndex === index.value && prevInternalStatus.value !== "error") internalStatus.value = parent.props.processStatus;
  41873. else internalStatus.value = "wait";
  41874. const prevChild = parent.steps.value[index.value - 1];
  41875. if (prevChild) prevChild.calcProgress(internalStatus.value);
  41876. };
  41877. const stepItemState = {
  41878. uid: currentInstance.uid,
  41879. getVnode: () => currentInstance.vnode,
  41880. currentStatus,
  41881. internalStatus,
  41882. setIndex,
  41883. calcProgress
  41884. };
  41885. parent.addStep(stepItemState);
  41886. onBeforeUnmount(() => {
  41887. parent.removeStep(stepItemState);
  41888. });
  41889. return (_ctx, _cache) => {
  41890. return openBlock(), createElementBlock("div", {
  41891. style: normalizeStyle(style.value),
  41892. class: normalizeClass(containerKls.value)
  41893. }, [
  41894. createCommentVNode(" icon & line "),
  41895. createElementVNode("div", { class: normalizeClass([unref(ns).e("head"), unref(ns).is(currentStatus.value)]) }, [!isSimple.value ? (openBlock(), createElementBlock("div", {
  41896. key: 0,
  41897. class: normalizeClass(unref(ns).e("line"))
  41898. }, [createElementVNode("i", {
  41899. class: normalizeClass(unref(ns).e("line-inner")),
  41900. style: normalizeStyle(lineStyle.value)
  41901. }, null, 6)], 2)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass([unref(ns).e("icon"), unref(ns).is(__props.icon || _ctx.$slots.icon ? "icon" : "text")]) }, [renderSlot(_ctx.$slots, "icon", {}, () => [__props.icon ? (openBlock(), createBlock(unref(ElIcon), {
  41902. key: 0,
  41903. class: normalizeClass(unref(ns).e("icon-inner"))
  41904. }, {
  41905. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  41906. _: 1
  41907. }, 8, ["class"])) : currentStatus.value === "success" ? (openBlock(), createBlock(unref(ElIcon), {
  41908. key: 1,
  41909. class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
  41910. }, {
  41911. default: withCtx(() => [createVNode(unref(check_default))]),
  41912. _: 1
  41913. }, 8, ["class"])) : currentStatus.value === "error" ? (openBlock(), createBlock(unref(ElIcon), {
  41914. key: 2,
  41915. class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
  41916. }, {
  41917. default: withCtx(() => [createVNode(unref(close_default))]),
  41918. _: 1
  41919. }, 8, ["class"])) : !isSimple.value ? (openBlock(), createElementBlock("div", {
  41920. key: 3,
  41921. class: normalizeClass(unref(ns).e("icon-inner"))
  41922. }, toDisplayString(index.value + 1), 3)) : createCommentVNode("v-if", true)])], 2)], 2),
  41923. createCommentVNode(" title & description "),
  41924. createElementVNode("div", { class: normalizeClass(unref(ns).e("main")) }, [createElementVNode("div", { class: normalizeClass([unref(ns).e("title"), unref(ns).is(currentStatus.value)]) }, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 2), isSimple.value ? (openBlock(), createElementBlock("div", {
  41925. key: 0,
  41926. class: normalizeClass(unref(ns).e("arrow"))
  41927. }, null, 2)) : (openBlock(), createElementBlock("div", {
  41928. key: 1,
  41929. class: normalizeClass([unref(ns).e("description"), unref(ns).is(currentStatus.value)])
  41930. }, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(__props.description), 1)])], 2))], 2)
  41931. ], 6);
  41932. };
  41933. }
  41934. });
  41935. //#endregion
  41936. //#region ../../packages/components/steps/src/item.vue
  41937. var item_default = item_vue_vue_type_script_setup_true_lang_default;
  41938. //#endregion
  41939. //#region ../../packages/components/steps/index.ts
  41940. const ElSteps = withInstall(steps_default$1, { Step: item_default });
  41941. const ElStep = withNoopInstall(item_default);
  41942. //#endregion
  41943. //#region ../../packages/components/switch/src/switch.ts
  41944. /**
  41945. * @deprecated Removed after 3.0.0, Use `SwitchProps` instead.
  41946. */
  41947. const switchProps = buildProps({
  41948. modelValue: {
  41949. type: [
  41950. Boolean,
  41951. String,
  41952. Number
  41953. ],
  41954. default: false
  41955. },
  41956. disabled: {
  41957. type: Boolean,
  41958. default: void 0
  41959. },
  41960. loading: Boolean,
  41961. size: {
  41962. type: String,
  41963. validator: isValidComponentSize
  41964. },
  41965. width: {
  41966. type: [String, Number],
  41967. default: ""
  41968. },
  41969. inlinePrompt: Boolean,
  41970. inactiveActionIcon: { type: iconPropType },
  41971. activeActionIcon: { type: iconPropType },
  41972. activeIcon: { type: iconPropType },
  41973. inactiveIcon: { type: iconPropType },
  41974. activeText: {
  41975. type: String,
  41976. default: ""
  41977. },
  41978. inactiveText: {
  41979. type: String,
  41980. default: ""
  41981. },
  41982. activeValue: {
  41983. type: [
  41984. Boolean,
  41985. String,
  41986. Number
  41987. ],
  41988. default: true
  41989. },
  41990. inactiveValue: {
  41991. type: [
  41992. Boolean,
  41993. String,
  41994. Number
  41995. ],
  41996. default: false
  41997. },
  41998. name: {
  41999. type: String,
  42000. default: ""
  42001. },
  42002. validateEvent: {
  42003. type: Boolean,
  42004. default: true
  42005. },
  42006. beforeChange: { type: definePropType(Function) },
  42007. id: String,
  42008. tabindex: { type: [String, Number] },
  42009. ...useAriaProps(["ariaLabel"])
  42010. });
  42011. const switchEmits = {
  42012. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  42013. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  42014. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  42015. };
  42016. //#endregion
  42017. //#region ../../packages/components/switch/src/switch.vue?vue&type=script&setup=true&lang.ts
  42018. const _hoisted_1$18 = [
  42019. "id",
  42020. "aria-checked",
  42021. "aria-disabled",
  42022. "aria-label",
  42023. "name",
  42024. "true-value",
  42025. "false-value",
  42026. "disabled",
  42027. "tabindex"
  42028. ];
  42029. const _hoisted_2$11 = ["aria-hidden"];
  42030. const _hoisted_3$4 = { key: 1 };
  42031. const _hoisted_4$3 = { key: 1 };
  42032. const _hoisted_5$1 = ["aria-hidden"];
  42033. const COMPONENT_NAME$6 = "ElSwitch";
  42034. var switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  42035. name: COMPONENT_NAME$6,
  42036. __name: "switch",
  42037. props: switchProps,
  42038. emits: switchEmits,
  42039. setup(__props, { expose: __expose, emit: __emit }) {
  42040. const props = __props;
  42041. const emit = __emit;
  42042. const { formItem } = useFormItem();
  42043. const switchSize = useFormSize();
  42044. const ns = useNamespace("switch");
  42045. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  42046. const switchDisabled = useFormDisabled(computed(() => {
  42047. if (props.loading) return true;
  42048. }));
  42049. const isControlled = ref(props.modelValue !== false);
  42050. const input = shallowRef();
  42051. const switchKls = computed(() => [
  42052. ns.b(),
  42053. ns.m(switchSize.value),
  42054. ns.is("disabled", switchDisabled.value),
  42055. ns.is("checked", checked.value)
  42056. ]);
  42057. const labelLeftKls = computed(() => [
  42058. ns.e("label"),
  42059. ns.em("label", "left"),
  42060. ns.is("active", !checked.value)
  42061. ]);
  42062. const labelRightKls = computed(() => [
  42063. ns.e("label"),
  42064. ns.em("label", "right"),
  42065. ns.is("active", checked.value)
  42066. ]);
  42067. const coreStyle = computed(() => ({ width: addUnit(props.width) }));
  42068. watch(() => props.modelValue, () => {
  42069. isControlled.value = true;
  42070. });
  42071. const actualValue = computed(() => {
  42072. return isControlled.value ? props.modelValue : false;
  42073. });
  42074. const checked = computed(() => actualValue.value === props.activeValue);
  42075. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  42076. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  42077. emit(CHANGE_EVENT, props.inactiveValue);
  42078. emit(INPUT_EVENT, props.inactiveValue);
  42079. }
  42080. watch(checked, (val) => {
  42081. input.value.checked = val;
  42082. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  42083. });
  42084. const handleChange = () => {
  42085. const val = checked.value ? props.inactiveValue : props.activeValue;
  42086. emit(UPDATE_MODEL_EVENT, val);
  42087. emit(CHANGE_EVENT, val);
  42088. emit(INPUT_EVENT, val);
  42089. nextTick(() => {
  42090. input.value.checked = checked.value;
  42091. });
  42092. };
  42093. const switchValue = () => {
  42094. if (switchDisabled.value) return;
  42095. const { beforeChange } = props;
  42096. if (!beforeChange) {
  42097. handleChange();
  42098. return;
  42099. }
  42100. const shouldChange = beforeChange();
  42101. if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(COMPONENT_NAME$6, "beforeChange must return type `Promise<boolean>` or `boolean`");
  42102. if (isPromise(shouldChange)) shouldChange.then((result) => {
  42103. if (result) handleChange();
  42104. }).catch((e) => {
  42105. /* @__PURE__ */ debugWarn(COMPONENT_NAME$6, `some error occurred: ${e}`);
  42106. });
  42107. else if (shouldChange) handleChange();
  42108. };
  42109. const focus = () => {
  42110. input.value?.focus?.();
  42111. };
  42112. onMounted(() => {
  42113. input.value.checked = checked.value;
  42114. });
  42115. __expose({
  42116. focus,
  42117. checked
  42118. });
  42119. return (_ctx, _cache) => {
  42120. return openBlock(), createElementBlock("div", {
  42121. class: normalizeClass(switchKls.value),
  42122. onClick: withModifiers(switchValue, ["prevent"])
  42123. }, [
  42124. createElementVNode("input", {
  42125. id: unref(inputId),
  42126. ref_key: "input",
  42127. ref: input,
  42128. class: normalizeClass(unref(ns).e("input")),
  42129. type: "checkbox",
  42130. role: "switch",
  42131. "aria-checked": checked.value,
  42132. "aria-disabled": unref(switchDisabled),
  42133. "aria-label": __props.ariaLabel,
  42134. name: __props.name,
  42135. "true-value": __props.activeValue,
  42136. "false-value": __props.inactiveValue,
  42137. disabled: unref(switchDisabled),
  42138. tabindex: __props.tabindex,
  42139. onChange: handleChange,
  42140. onKeydown: withKeys(switchValue, ["enter"])
  42141. }, null, 42, _hoisted_1$18),
  42142. !__props.inlinePrompt && (__props.inactiveIcon || __props.inactiveText || _ctx.$slots.inactive) ? (openBlock(), createElementBlock("span", {
  42143. key: 0,
  42144. class: normalizeClass(labelLeftKls.value)
  42145. }, [renderSlot(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42146. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))]),
  42147. _: 1
  42148. })) : createCommentVNode("v-if", true), !__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock("span", {
  42149. key: 1,
  42150. "aria-hidden": checked.value
  42151. }, toDisplayString(__props.inactiveText), 9, _hoisted_2$11)) : createCommentVNode("v-if", true)])], 2)) : createCommentVNode("v-if", true),
  42152. createElementVNode("span", {
  42153. class: normalizeClass(unref(ns).e("core")),
  42154. style: normalizeStyle(coreStyle.value)
  42155. }, [__props.inlinePrompt ? (openBlock(), createElementBlock("div", {
  42156. key: 0,
  42157. class: normalizeClass(unref(ns).e("inner"))
  42158. }, [!checked.value ? (openBlock(), createElementBlock("div", {
  42159. key: 0,
  42160. class: normalizeClass(unref(ns).e("inner-wrapper"))
  42161. }, [renderSlot(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42162. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveIcon)))]),
  42163. _: 1
  42164. })) : createCommentVNode("v-if", true), !__props.inactiveIcon && __props.inactiveText ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(__props.inactiveText), 1)) : createCommentVNode("v-if", true)])], 2)) : (openBlock(), createElementBlock("div", {
  42165. key: 1,
  42166. class: normalizeClass(unref(ns).e("inner-wrapper"))
  42167. }, [renderSlot(_ctx.$slots, "active", {}, () => [__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42168. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))]),
  42169. _: 1
  42170. })) : createCommentVNode("v-if", true), !__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(__props.activeText), 1)) : createCommentVNode("v-if", true)])], 2))], 2)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("action")) }, [__props.loading ? (openBlock(), createBlock(unref(ElIcon), {
  42171. key: 0,
  42172. class: normalizeClass(unref(ns).is("loading"))
  42173. }, {
  42174. default: withCtx(() => [createVNode(unref(loading_default))]),
  42175. _: 1
  42176. }, 8, ["class"])) : checked.value ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [__props.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42177. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeActionIcon)))]),
  42178. _: 1
  42179. })) : createCommentVNode("v-if", true)]) : !checked.value ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [__props.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42180. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.inactiveActionIcon)))]),
  42181. _: 1
  42182. })) : createCommentVNode("v-if", true)]) : createCommentVNode("v-if", true)], 2)], 6),
  42183. !__props.inlinePrompt && (__props.activeIcon || __props.activeText || _ctx.$slots.active) ? (openBlock(), createElementBlock("span", {
  42184. key: 1,
  42185. class: normalizeClass(labelRightKls.value)
  42186. }, [renderSlot(_ctx.$slots, "active", {}, () => [__props.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  42187. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.activeIcon)))]),
  42188. _: 1
  42189. })) : createCommentVNode("v-if", true), !__props.activeIcon && __props.activeText ? (openBlock(), createElementBlock("span", {
  42190. key: 1,
  42191. "aria-hidden": !checked.value
  42192. }, toDisplayString(__props.activeText), 9, _hoisted_5$1)) : createCommentVNode("v-if", true)])], 2)) : createCommentVNode("v-if", true)
  42193. ], 2);
  42194. };
  42195. }
  42196. });
  42197. //#endregion
  42198. //#region ../../packages/components/switch/src/switch.vue
  42199. var switch_default = switch_vue_vue_type_script_setup_true_lang_default;
  42200. //#endregion
  42201. //#region ../../packages/components/switch/index.ts
  42202. const ElSwitch = withInstall(switch_default);
  42203. //#endregion
  42204. //#region ../../packages/components/table/src/util.ts
  42205. const getCell = function(event) {
  42206. return event.target?.closest("td");
  42207. };
  42208. const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
  42209. if (!sortKey && !sortMethod && (!sortBy || isArray$1(sortBy) && !sortBy.length)) return array;
  42210. if (isString(reverse)) reverse = reverse === "descending" ? -1 : 1;
  42211. else reverse = reverse && reverse < 0 ? -1 : 1;
  42212. const getKey = sortMethod ? null : function(value, index) {
  42213. if (sortBy) return flatMap(castArray$1(sortBy), (by) => {
  42214. if (isString(by)) return get(value, by);
  42215. else return by(value, index, array);
  42216. });
  42217. if (sortKey !== "$key") {
  42218. if (isObject$1(value) && "$value" in value) value = value.$value;
  42219. }
  42220. return [isObject$1(value) ? sortKey ? get(value, sortKey) : null : value];
  42221. };
  42222. const compare = function(a, b) {
  42223. if (sortMethod) return sortMethod(a.value, b.value);
  42224. for (let i = 0, len = a.key?.length ?? 0; i < len; i++) {
  42225. if (a.key?.[i] < b.key?.[i]) return -1;
  42226. if (a.key?.[i] > b.key?.[i]) return 1;
  42227. }
  42228. return 0;
  42229. };
  42230. return array.map((value, index) => {
  42231. return {
  42232. value,
  42233. index,
  42234. key: getKey ? getKey(value, index) : null
  42235. };
  42236. }).sort((a, b) => {
  42237. let order = compare(a, b);
  42238. if (!order) order = a.index - b.index;
  42239. return order * +reverse;
  42240. }).map((item) => item.value);
  42241. };
  42242. const getColumnById = function(table, columnId) {
  42243. let column = null;
  42244. table.columns.forEach((item) => {
  42245. if (item.id === columnId) column = item;
  42246. });
  42247. return column;
  42248. };
  42249. const getColumnByKey = function(table, columnKey) {
  42250. let column = null;
  42251. for (let i = 0; i < table.columns.length; i++) {
  42252. const item = table.columns[i];
  42253. if (item.columnKey === columnKey) {
  42254. column = item;
  42255. break;
  42256. }
  42257. }
  42258. if (!column) throwError("ElTable", `No column matching with column-key: ${columnKey}`);
  42259. return column;
  42260. };
  42261. const getColumnByCell = function(table, cell, namespace) {
  42262. const matches = (cell.className || "").match(new RegExp(`${namespace}-table_[^\\s]+`, "gm"));
  42263. if (matches) return getColumnById(table, matches[0]);
  42264. return null;
  42265. };
  42266. const getRowIdentity = (row, rowKey) => {
  42267. if (!row) throw new Error("Row is required when get row identity");
  42268. if (isString(rowKey)) {
  42269. if (!rowKey.includes(".")) return `${row[rowKey]}`;
  42270. const key = rowKey.split(".");
  42271. let current = row;
  42272. for (const element of key) current = current[element];
  42273. return `${current}`;
  42274. } else if (isFunction$1(rowKey)) return rowKey.call(null, row);
  42275. return "";
  42276. };
  42277. const getKeysMap = function(array, rowKey, flatten = false, childrenKey = "children") {
  42278. const data = array || [];
  42279. const arrayMap = {};
  42280. data.forEach((row, index) => {
  42281. arrayMap[getRowIdentity(row, rowKey)] = {
  42282. row,
  42283. index
  42284. };
  42285. if (flatten) {
  42286. const children = row[childrenKey];
  42287. if (isArray$1(children)) Object.assign(arrayMap, getKeysMap(children, rowKey, true, childrenKey));
  42288. }
  42289. });
  42290. return arrayMap;
  42291. };
  42292. function mergeOptions(defaults, config) {
  42293. const options = {};
  42294. let key;
  42295. for (key in defaults) options[key] = defaults[key];
  42296. for (key in config) if (hasOwn(config, key)) {
  42297. const value = config[key];
  42298. if (!isUndefined(value)) options[key] = value;
  42299. }
  42300. return options;
  42301. }
  42302. function parseWidth(width) {
  42303. if (width === "") return width;
  42304. if (!isUndefined(width)) {
  42305. width = Number.parseInt(width, 10);
  42306. if (Number.isNaN(width)) width = "";
  42307. }
  42308. return width;
  42309. }
  42310. function parseMinWidth(minWidth) {
  42311. if (minWidth === "") return minWidth;
  42312. if (!isUndefined(minWidth)) {
  42313. minWidth = parseWidth(minWidth);
  42314. if (Number.isNaN(minWidth)) minWidth = 80;
  42315. }
  42316. return minWidth;
  42317. }
  42318. function parseHeight(height) {
  42319. if (isNumber(height)) return height;
  42320. if (isString(height)) if (/^\d+(?:px)?$/.test(height)) return Number.parseInt(height, 10);
  42321. else return height;
  42322. return null;
  42323. }
  42324. function compose(...funcs) {
  42325. if (funcs.length === 0) return (arg) => arg;
  42326. if (funcs.length === 1) return funcs[0];
  42327. return funcs.reduce((a, b) => (...args) => a(b(...args)));
  42328. }
  42329. function toggleRowStatus(statusArr, row, newVal, tableTreeProps, selectable, rowIndex, rowKey) {
  42330. let _rowIndex = rowIndex ?? 0;
  42331. let changed = false;
  42332. const getIndex = () => {
  42333. if (!rowKey) return statusArr.indexOf(row);
  42334. const id = getRowIdentity(row, rowKey);
  42335. return statusArr.findIndex((item) => getRowIdentity(item, rowKey) === id);
  42336. };
  42337. const index = getIndex();
  42338. const included = index !== -1;
  42339. const isRowSelectable = selectable?.call(null, row, _rowIndex);
  42340. const toggleStatus = (type) => {
  42341. if (type === "add") statusArr.push(row);
  42342. else statusArr.splice(index, 1);
  42343. changed = true;
  42344. };
  42345. const getChildrenCount = (row) => {
  42346. let count = 0;
  42347. const children = tableTreeProps?.children && row[tableTreeProps.children];
  42348. if (children && isArray$1(children)) {
  42349. count += children.length;
  42350. children.forEach((item) => {
  42351. count += getChildrenCount(item);
  42352. });
  42353. }
  42354. return count;
  42355. };
  42356. if (!selectable || isRowSelectable) if (isBoolean(newVal)) {
  42357. if (newVal && !included) toggleStatus("add");
  42358. else if (!newVal && included) toggleStatus("remove");
  42359. } else included ? toggleStatus("remove") : toggleStatus("add");
  42360. if (!tableTreeProps?.checkStrictly && tableTreeProps?.children && isArray$1(row[tableTreeProps.children])) row[tableTreeProps.children].forEach((item) => {
  42361. const childChanged = toggleRowStatus(statusArr, item, newVal ?? !included, tableTreeProps, selectable, _rowIndex + 1, rowKey);
  42362. _rowIndex += getChildrenCount(item) + 1;
  42363. if (childChanged) changed = childChanged;
  42364. });
  42365. return changed;
  42366. }
  42367. function walkTreeNode(root, cb, childrenKey = "children", lazyKey = "hasChildren", lazy = false) {
  42368. const isNil = (array) => !(isArray$1(array) && array.length);
  42369. function _walker(parent, children, level) {
  42370. cb(parent, children, level);
  42371. children.forEach((item) => {
  42372. if (item[lazyKey] && lazy) {
  42373. cb(item, null, level + 1);
  42374. return;
  42375. }
  42376. const children = item[childrenKey];
  42377. if (!isNil(children)) _walker(item, children, level + 1);
  42378. });
  42379. }
  42380. root.forEach((item) => {
  42381. if (item[lazyKey] && lazy) {
  42382. cb(item, null, 0);
  42383. return;
  42384. }
  42385. const children = item[childrenKey];
  42386. if (!isNil(children)) _walker(item, children, 0);
  42387. });
  42388. }
  42389. const getTableOverflowTooltipProps = (props, innerText, row, column) => {
  42390. const popperOptions = {
  42391. strategy: "fixed",
  42392. ...props.popperOptions
  42393. };
  42394. const tooltipFormatterContent = isFunction$1(column?.tooltipFormatter) ? column.tooltipFormatter({
  42395. row,
  42396. column,
  42397. cellValue: getProp(row, column.property).value
  42398. }) : void 0;
  42399. if (isVNode(tooltipFormatterContent)) return {
  42400. slotContent: tooltipFormatterContent,
  42401. content: null,
  42402. ...props,
  42403. popperOptions
  42404. };
  42405. return {
  42406. slotContent: null,
  42407. content: tooltipFormatterContent ?? innerText,
  42408. ...props,
  42409. popperOptions
  42410. };
  42411. };
  42412. let removePopper = null;
  42413. function createTablePopper(props, popperContent, row, column, trigger, table) {
  42414. const tableOverflowTooltipProps = getTableOverflowTooltipProps(props, popperContent, row, column);
  42415. const mergedProps = {
  42416. ...tableOverflowTooltipProps,
  42417. slotContent: void 0
  42418. };
  42419. if (removePopper?.trigger === trigger) {
  42420. const comp = removePopper.vm?.component;
  42421. merge(comp?.props, mergedProps);
  42422. if (comp && tableOverflowTooltipProps.slotContent) comp.slots.content = () => [tableOverflowTooltipProps.slotContent];
  42423. return;
  42424. }
  42425. removePopper?.();
  42426. const parentNode = table?.refs.tableWrapper;
  42427. const ns = parentNode?.dataset.prefix;
  42428. const vm = createVNode(ElTooltip, {
  42429. virtualTriggering: true,
  42430. virtualRef: trigger,
  42431. appendTo: parentNode,
  42432. placement: "top",
  42433. transition: "none",
  42434. offset: 0,
  42435. hideAfter: 0,
  42436. ...mergedProps
  42437. }, tableOverflowTooltipProps.slotContent ? { content: () => tableOverflowTooltipProps.slotContent } : void 0);
  42438. vm.appContext = {
  42439. ...table.appContext,
  42440. ...table
  42441. };
  42442. const container = document.createElement("div");
  42443. render(vm, container);
  42444. vm.component.exposed.onOpen();
  42445. const scrollContainer = parentNode?.querySelector(`.${ns}-scrollbar__wrap`);
  42446. removePopper = () => {
  42447. if (vm.component?.exposed?.onClose) vm.component.exposed.onClose();
  42448. render(null, container);
  42449. const currentRemovePopper = removePopper;
  42450. scrollContainer?.removeEventListener("scroll", currentRemovePopper);
  42451. currentRemovePopper.trigger = void 0;
  42452. currentRemovePopper.vm = void 0;
  42453. removePopper = null;
  42454. };
  42455. removePopper.trigger = trigger ?? void 0;
  42456. removePopper.vm = vm;
  42457. scrollContainer?.addEventListener("scroll", removePopper);
  42458. }
  42459. function getCurrentColumns(column) {
  42460. if (column.children) return flatMap(column.children, getCurrentColumns);
  42461. else return [column];
  42462. }
  42463. function getColSpan(colSpan, column) {
  42464. return colSpan + column.colSpan;
  42465. }
  42466. const isFixedColumn = (index, fixed, store, realColumns) => {
  42467. let start = 0;
  42468. let after = index;
  42469. const columns = store.states.columns.value;
  42470. if (realColumns) {
  42471. const curColumns = getCurrentColumns(realColumns[index]);
  42472. start = columns.slice(0, columns.indexOf(curColumns[0])).reduce(getColSpan, 0);
  42473. after = start + curColumns.reduce(getColSpan, 0) - 1;
  42474. } else start = index;
  42475. let fixedLayout;
  42476. switch (fixed) {
  42477. case "left":
  42478. if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left";
  42479. break;
  42480. case "right":
  42481. if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right";
  42482. break;
  42483. default: if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left";
  42484. else if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right";
  42485. }
  42486. return fixedLayout ? {
  42487. direction: fixedLayout,
  42488. start,
  42489. after
  42490. } : {};
  42491. };
  42492. const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset = 0) => {
  42493. const classes = [];
  42494. const { direction, start, after } = isFixedColumn(index, fixed, store, realColumns);
  42495. if (direction) {
  42496. const isLeft = direction === "left";
  42497. classes.push(`${namespace}-fixed-column--${direction}`);
  42498. if (isLeft && after + offset === store.states.fixedLeafColumnsLength.value - 1) classes.push("is-last-column");
  42499. else if (!isLeft && start - offset === store.states.columns.value.length - store.states.rightFixedLeafColumnsLength.value) classes.push("is-first-column");
  42500. }
  42501. return classes;
  42502. };
  42503. function getOffset(offset, column) {
  42504. return offset + (isNull(column.realWidth) || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
  42505. }
  42506. const getFixedColumnOffset = (index, fixed, store, realColumns) => {
  42507. const { direction, start = 0, after = 0 } = isFixedColumn(index, fixed, store, realColumns);
  42508. if (!direction) return;
  42509. const styles = {};
  42510. const isLeft = direction === "left";
  42511. const columns = store.states.columns.value;
  42512. if (isLeft) styles.left = columns.slice(0, start).reduce(getOffset, 0);
  42513. else styles.right = columns.slice(after + 1).reverse().reduce(getOffset, 0);
  42514. return styles;
  42515. };
  42516. const ensurePosition = (style, key) => {
  42517. if (!style) return;
  42518. if (!Number.isNaN(style[key])) style[key] = `${style[key]}px`;
  42519. };
  42520. function ensureValidVNode(vnodes) {
  42521. return vnodes.some((child) => {
  42522. if (!isVNode(child)) return true;
  42523. if (child.type === Comment) return false;
  42524. if (child.type === Fragment && !ensureValidVNode(child.children)) return false;
  42525. return true;
  42526. }) ? vnodes : null;
  42527. }
  42528. //#endregion
  42529. //#region ../../packages/components/table/src/store/expand.ts
  42530. function useExpand(watcherData) {
  42531. const instance = getCurrentInstance();
  42532. const defaultExpandAll = ref(false);
  42533. const expandRows = ref([]);
  42534. const canRowExpand = (row, index) => {
  42535. const expandableFn = instance.store.states.rowExpandable.value;
  42536. return expandableFn?.(row, index) ?? true;
  42537. };
  42538. const updateExpandRows = () => {
  42539. const data = watcherData.data.value || [];
  42540. const rowKey = watcherData.rowKey.value;
  42541. if (defaultExpandAll.value) expandRows.value = instance.store.states.rowExpandable.value ? data.filter(canRowExpand) : data.slice();
  42542. else if (rowKey) {
  42543. const expandRowsMap = getKeysMap(expandRows.value, rowKey);
  42544. expandRows.value = data.filter((row, index) => {
  42545. return !!expandRowsMap[getRowIdentity(row, rowKey)] && canRowExpand(row, index);
  42546. });
  42547. } else expandRows.value = [];
  42548. };
  42549. const toggleRowExpansion = (row, expanded) => {
  42550. const rowIndex = (watcherData.data.value || []).indexOf(row);
  42551. if (rowIndex > -1 && !canRowExpand(row, rowIndex)) return;
  42552. if (toggleRowStatus(expandRows.value, row, expanded, void 0, void 0, void 0, watcherData.rowKey.value)) instance.emit("expand-change", row, expandRows.value.slice());
  42553. };
  42554. const setExpandRowKeys = (rowKeys) => {
  42555. instance.store.assertRowKey();
  42556. const data = watcherData.data.value || [];
  42557. const rowKey = watcherData.rowKey.value;
  42558. const keysMap = getKeysMap(data, rowKey);
  42559. expandRows.value = rowKeys.reduce((prev, cur) => {
  42560. const info = keysMap[cur];
  42561. if (info && canRowExpand(info.row, info.index)) prev.push(info.row);
  42562. return prev;
  42563. }, []);
  42564. };
  42565. const isRowExpanded = (row) => {
  42566. const rowKey = watcherData.rowKey.value;
  42567. if (rowKey) return !!getKeysMap(expandRows.value, rowKey)[getRowIdentity(row, rowKey)];
  42568. return expandRows.value.includes(row);
  42569. };
  42570. return {
  42571. updateExpandRows,
  42572. toggleRowExpansion,
  42573. setExpandRowKeys,
  42574. isRowExpanded,
  42575. states: {
  42576. expandRows,
  42577. defaultExpandAll
  42578. }
  42579. };
  42580. }
  42581. //#endregion
  42582. //#region ../../packages/components/table/src/store/current.ts
  42583. function useCurrent(watcherData) {
  42584. const instance = getCurrentInstance();
  42585. const _currentRowKey = ref(null);
  42586. const currentRow = ref(null);
  42587. const setCurrentRowKey = (key) => {
  42588. instance.store.assertRowKey();
  42589. _currentRowKey.value = key;
  42590. setCurrentRowByKey(key);
  42591. };
  42592. const restoreCurrentRowKey = () => {
  42593. _currentRowKey.value = null;
  42594. };
  42595. const setCurrentRowByKey = (key) => {
  42596. const { data, rowKey } = watcherData;
  42597. const oldCurrentRow = currentRow.value;
  42598. let _currentRow = null;
  42599. if (rowKey.value) _currentRow = (unref(data) || []).find((item) => getRowIdentity(item, rowKey.value) === key) ?? null;
  42600. currentRow.value = _currentRow ?? null;
  42601. instance.emit("current-change", currentRow.value, oldCurrentRow);
  42602. };
  42603. const updateCurrentRow = (_currentRow) => {
  42604. const oldCurrentRow = currentRow.value;
  42605. if (_currentRow && _currentRow !== oldCurrentRow) {
  42606. currentRow.value = _currentRow;
  42607. instance.emit("current-change", currentRow.value, oldCurrentRow);
  42608. return;
  42609. }
  42610. if (!_currentRow && oldCurrentRow) {
  42611. currentRow.value = null;
  42612. instance.emit("current-change", null, oldCurrentRow);
  42613. }
  42614. };
  42615. const updateCurrentRowData = () => {
  42616. const rowKey = watcherData.rowKey.value;
  42617. const data = watcherData.data.value || [];
  42618. const oldCurrentRow = currentRow.value;
  42619. if (oldCurrentRow && !data.includes(oldCurrentRow)) if (rowKey) setCurrentRowByKey(getRowIdentity(oldCurrentRow, rowKey));
  42620. else {
  42621. currentRow.value = null;
  42622. instance.emit("current-change", null, oldCurrentRow);
  42623. }
  42624. else if (_currentRowKey.value) {
  42625. setCurrentRowByKey(_currentRowKey.value);
  42626. restoreCurrentRowKey();
  42627. }
  42628. };
  42629. return {
  42630. setCurrentRowKey,
  42631. restoreCurrentRowKey,
  42632. setCurrentRowByKey,
  42633. updateCurrentRow,
  42634. updateCurrentRowData,
  42635. states: {
  42636. _currentRowKey,
  42637. currentRow
  42638. }
  42639. };
  42640. }
  42641. //#endregion
  42642. //#region ../../packages/components/table/src/store/tree.ts
  42643. function useTree$2(watcherData) {
  42644. const expandRowKeys = ref([]);
  42645. const treeData = ref({});
  42646. const indent = ref(16);
  42647. const lazy = ref(false);
  42648. const lazyTreeNodeMap = ref({});
  42649. const lazyColumnIdentifier = ref("hasChildren");
  42650. const childrenColumnName = ref("children");
  42651. const checkStrictly = ref(false);
  42652. const instance = getCurrentInstance();
  42653. const normalizedData = computed(() => {
  42654. if (!watcherData.rowKey.value) return {};
  42655. return normalize(watcherData.data.value || []);
  42656. });
  42657. const normalizedLazyNode = computed(() => {
  42658. const rowKey = watcherData.rowKey.value;
  42659. const keys = Object.keys(lazyTreeNodeMap.value);
  42660. const res = {};
  42661. if (!keys.length) return res;
  42662. keys.forEach((key) => {
  42663. if (lazyTreeNodeMap.value[key].length) {
  42664. const item = { children: [] };
  42665. lazyTreeNodeMap.value[key].forEach((row) => {
  42666. const currentRowKey = getRowIdentity(row, rowKey);
  42667. item.children.push(currentRowKey);
  42668. if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) res[currentRowKey] = { children: [] };
  42669. });
  42670. res[key] = item;
  42671. }
  42672. });
  42673. return res;
  42674. });
  42675. const normalize = (data) => {
  42676. const rowKey = watcherData.rowKey.value;
  42677. const res = {};
  42678. walkTreeNode(data, (parent, children, level) => {
  42679. const parentId = getRowIdentity(parent, rowKey);
  42680. if (isArray$1(children)) res[parentId] = {
  42681. children: children.map((row) => getRowIdentity(row, rowKey)),
  42682. level
  42683. };
  42684. else if (lazy.value) res[parentId] = {
  42685. children: [],
  42686. lazy: true,
  42687. level
  42688. };
  42689. }, childrenColumnName.value, lazyColumnIdentifier.value, lazy.value);
  42690. return res;
  42691. };
  42692. const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll) => {
  42693. ifExpandAll ||= instance.store?.states.defaultExpandAll.value;
  42694. const nested = normalizedData.value;
  42695. const normalizedLazyNode_ = normalizedLazyNode.value;
  42696. const keys = Object.keys(nested);
  42697. const newTreeData = {};
  42698. if (keys.length) {
  42699. const oldTreeData = unref(treeData);
  42700. const rootLazyRowKeys = [];
  42701. const getExpanded = (oldValue, key) => {
  42702. if (ifChangeExpandRowKeys) if (expandRowKeys.value) return ifExpandAll || expandRowKeys.value.includes(key);
  42703. else return !!(ifExpandAll || oldValue?.expanded);
  42704. else {
  42705. const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key);
  42706. return !!(oldValue?.expanded || included);
  42707. }
  42708. };
  42709. keys.forEach((key) => {
  42710. const oldValue = oldTreeData[key];
  42711. const newValue = { ...nested[key] };
  42712. newValue.expanded = getExpanded(oldValue, key);
  42713. if (newValue.lazy) {
  42714. const { loaded = false, loading = false } = oldValue || {};
  42715. newValue.loaded = !!loaded;
  42716. newValue.loading = !!loading;
  42717. rootLazyRowKeys.push(key);
  42718. }
  42719. newTreeData[key] = newValue;
  42720. });
  42721. const lazyKeys = Object.keys(normalizedLazyNode_);
  42722. if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) lazyKeys.forEach((key) => {
  42723. const oldValue = oldTreeData[key];
  42724. const lazyNodeChildren = normalizedLazyNode_[key].children;
  42725. if (rootLazyRowKeys.includes(key)) {
  42726. if (newTreeData[key].children?.length !== 0) throw new Error("[ElTable]children must be an empty array.");
  42727. newTreeData[key].children = lazyNodeChildren;
  42728. } else {
  42729. const { loaded = false, loading = false } = oldValue || {};
  42730. newTreeData[key] = {
  42731. lazy: true,
  42732. loaded: !!loaded,
  42733. loading: !!loading,
  42734. expanded: getExpanded(oldValue, key),
  42735. children: lazyNodeChildren,
  42736. level: void 0
  42737. };
  42738. }
  42739. });
  42740. }
  42741. treeData.value = newTreeData;
  42742. instance.store?.updateTableScrollY();
  42743. };
  42744. watch(() => expandRowKeys.value, () => {
  42745. updateTreeData(true);
  42746. });
  42747. watch(() => normalizedData.value, () => {
  42748. updateTreeData();
  42749. });
  42750. watch(() => normalizedLazyNode.value, () => {
  42751. updateTreeData();
  42752. });
  42753. const updateTreeExpandKeys = (value) => {
  42754. expandRowKeys.value = value;
  42755. updateTreeData();
  42756. };
  42757. const isUseLazy = (data) => {
  42758. return lazy.value && data && "loaded" in data && !data.loaded;
  42759. };
  42760. const toggleTreeExpansion = (row, expanded) => {
  42761. instance.store.assertRowKey();
  42762. const rowKey = watcherData.rowKey.value;
  42763. const id = getRowIdentity(row, rowKey);
  42764. const data = id && treeData.value[id];
  42765. if (id && data && "expanded" in data) {
  42766. const oldExpanded = data.expanded;
  42767. expanded = isUndefined(expanded) ? !data.expanded : expanded;
  42768. treeData.value[id].expanded = expanded;
  42769. if (oldExpanded !== expanded) instance.emit("expand-change", row, expanded);
  42770. expanded && isUseLazy(data) && loadData(row, id, data);
  42771. instance.store.updateTableScrollY();
  42772. }
  42773. };
  42774. const loadOrToggle = (row) => {
  42775. instance.store.assertRowKey();
  42776. const rowKey = watcherData.rowKey.value;
  42777. const id = getRowIdentity(row, rowKey);
  42778. const data = treeData.value[id];
  42779. if (isUseLazy(data)) loadData(row, id, data);
  42780. else toggleTreeExpansion(row, void 0);
  42781. };
  42782. const loadData = (row, key, treeNode) => {
  42783. const { load } = instance.props;
  42784. if (load && !treeData.value[key].loaded) {
  42785. treeData.value[key].loading = true;
  42786. load(row, treeNode, (data) => {
  42787. if (!isArray$1(data)) throw new TypeError("[ElTable] data must be an array");
  42788. treeData.value[key].loading = false;
  42789. treeData.value[key].loaded = true;
  42790. treeData.value[key].expanded = true;
  42791. if (data.length) lazyTreeNodeMap.value[key] = data;
  42792. instance.emit("expand-change", row, true);
  42793. });
  42794. }
  42795. };
  42796. const updateKeyChildren = (key, data) => {
  42797. const { lazy, rowKey } = instance.props;
  42798. if (!lazy) return;
  42799. if (!rowKey) throw new Error("[Table] rowKey is required in updateKeyChild");
  42800. if (lazyTreeNodeMap.value[key]) lazyTreeNodeMap.value[key] = data;
  42801. };
  42802. return {
  42803. loadData,
  42804. loadOrToggle,
  42805. toggleTreeExpansion,
  42806. updateTreeExpandKeys,
  42807. updateTreeData,
  42808. updateKeyChildren,
  42809. normalize,
  42810. states: {
  42811. expandRowKeys,
  42812. treeData,
  42813. indent,
  42814. lazy,
  42815. lazyTreeNodeMap,
  42816. lazyColumnIdentifier,
  42817. childrenColumnName,
  42818. checkStrictly
  42819. }
  42820. };
  42821. }
  42822. //#endregion
  42823. //#region ../../packages/components/table/src/store/watcher.ts
  42824. const sortData = (data, states) => {
  42825. const sortingColumn = states.sortingColumn;
  42826. if (!sortingColumn || isString(sortingColumn.sortable)) return data;
  42827. return orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  42828. };
  42829. const doFlattenColumns = (columns) => {
  42830. const result = [];
  42831. columns.forEach((column) => {
  42832. if (column.children && column.children.length > 0) result.push.apply(result, doFlattenColumns(column.children));
  42833. else result.push(column);
  42834. });
  42835. return result;
  42836. };
  42837. function useWatcher$1() {
  42838. const instance = getCurrentInstance();
  42839. const { size: tableSize } = toRefs(instance.proxy?.$props);
  42840. const rowKey = ref(null);
  42841. const data = ref([]);
  42842. const _data = ref([]);
  42843. const isComplex = ref(false);
  42844. const _columns = ref([]);
  42845. const originColumns = ref([]);
  42846. const columns = ref([]);
  42847. const fixedColumns = ref([]);
  42848. const rightFixedColumns = ref([]);
  42849. const leafColumns = ref([]);
  42850. const fixedLeafColumns = ref([]);
  42851. const rightFixedLeafColumns = ref([]);
  42852. const updateOrderFns = [];
  42853. const leafColumnsLength = ref(0);
  42854. const fixedLeafColumnsLength = ref(0);
  42855. const rightFixedLeafColumnsLength = ref(0);
  42856. const isAllSelected = ref(false);
  42857. const selection = ref([]);
  42858. const reserveSelection = ref(false);
  42859. const selectOnIndeterminate = ref(false);
  42860. const selectable = ref(null);
  42861. const rowExpandable = ref(null);
  42862. const filters = ref({});
  42863. const filteredData = ref(null);
  42864. const sortingColumn = ref(null);
  42865. const sortProp = ref(null);
  42866. const sortOrder = ref(null);
  42867. const hoverRow = ref(null);
  42868. const selectedMap = computed(() => {
  42869. return rowKey.value ? getKeysMap(selection.value, rowKey.value) : void 0;
  42870. });
  42871. watch(data, () => {
  42872. if (instance.state) {
  42873. scheduleLayout(false);
  42874. if (instance.props.tableLayout === "auto") instance.refs.tableHeaderRef?.updateFixedColumnStyle();
  42875. }
  42876. }, { deep: true });
  42877. const assertRowKey = () => {
  42878. if (!rowKey.value) throw new Error("[ElTable] prop row-key is required");
  42879. };
  42880. const updateChildFixed = (column) => {
  42881. column.children?.forEach((childColumn) => {
  42882. childColumn.fixed = column.fixed;
  42883. updateChildFixed(childColumn);
  42884. });
  42885. };
  42886. const updateColumns = () => {
  42887. _columns.value.forEach((column) => {
  42888. updateChildFixed(column);
  42889. });
  42890. fixedColumns.value = _columns.value.filter((column) => [true, "left"].includes(column.fixed));
  42891. const selectColumn = _columns.value.find((column) => column.type === "selection");
  42892. let selectColFixLeft;
  42893. if (selectColumn && selectColumn.fixed !== "right" && !fixedColumns.value.includes(selectColumn)) {
  42894. if (_columns.value.indexOf(selectColumn) === 0 && fixedColumns.value.length) {
  42895. fixedColumns.value.unshift(selectColumn);
  42896. selectColFixLeft = true;
  42897. }
  42898. }
  42899. rightFixedColumns.value = _columns.value.filter((column) => column.fixed === "right");
  42900. const notFixedColumns = _columns.value.filter((column) => (selectColFixLeft ? column.type !== "selection" : true) && !column.fixed);
  42901. originColumns.value = Array.from(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value);
  42902. const leafColumns = doFlattenColumns(notFixedColumns);
  42903. const fixedLeafColumns = doFlattenColumns(fixedColumns.value);
  42904. const rightFixedLeafColumns = doFlattenColumns(rightFixedColumns.value);
  42905. leafColumnsLength.value = leafColumns.length;
  42906. fixedLeafColumnsLength.value = fixedLeafColumns.length;
  42907. rightFixedLeafColumnsLength.value = rightFixedLeafColumns.length;
  42908. columns.value = Array.from(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  42909. isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0;
  42910. };
  42911. const scheduleLayout = (needUpdateColumns, immediate = false) => {
  42912. if (needUpdateColumns) updateColumns();
  42913. if (immediate) instance.state.doLayout();
  42914. else instance.state.debouncedUpdateLayout();
  42915. };
  42916. const isSelected = (row) => {
  42917. if (selectedMap.value) return !!selectedMap.value[getRowIdentity(row, rowKey.value)];
  42918. else return selection.value.includes(row);
  42919. };
  42920. const clearSelection = () => {
  42921. isAllSelected.value = false;
  42922. const oldSelection = selection.value;
  42923. selection.value = [];
  42924. if (oldSelection.length) instance.emit("selection-change", []);
  42925. };
  42926. const cleanSelection = () => {
  42927. let deleted;
  42928. if (rowKey.value) {
  42929. deleted = [];
  42930. const childrenKey = instance?.store?.states?.childrenColumnName.value;
  42931. const dataMap = getKeysMap(data.value, rowKey.value, true, childrenKey);
  42932. for (const key in selectedMap.value) if (hasOwn(selectedMap.value, key) && !dataMap[key]) deleted.push(selectedMap.value[key].row);
  42933. } else deleted = selection.value.filter((item) => !data.value.includes(item));
  42934. if (deleted.length) {
  42935. const newSelection = selection.value.filter((item) => !deleted.includes(item));
  42936. selection.value = newSelection;
  42937. instance.emit("selection-change", newSelection.slice());
  42938. }
  42939. };
  42940. const getSelectionRows = () => {
  42941. return (selection.value || []).slice();
  42942. };
  42943. const toggleRowSelection = (row, selected, emitChange = true, ignoreSelectable = false) => {
  42944. const treeProps = {
  42945. children: instance?.store?.states?.childrenColumnName.value,
  42946. checkStrictly: instance?.store?.states?.checkStrictly.value
  42947. };
  42948. if (toggleRowStatus(selection.value, row, selected, treeProps, ignoreSelectable ? void 0 : selectable.value, data.value.indexOf(row), rowKey.value)) {
  42949. const newSelection = (selection.value || []).slice();
  42950. if (emitChange) instance.emit("select", newSelection, row);
  42951. instance.emit("selection-change", newSelection);
  42952. }
  42953. };
  42954. const _toggleAllSelection = () => {
  42955. const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length);
  42956. isAllSelected.value = value;
  42957. let selectionChanged = false;
  42958. let childrenCount = 0;
  42959. const rowKey = instance?.store?.states?.rowKey.value;
  42960. const { childrenColumnName } = instance.store.states;
  42961. const treeProps = {
  42962. children: childrenColumnName.value,
  42963. checkStrictly: false
  42964. };
  42965. data.value.forEach((row, index) => {
  42966. const rowIndex = index + childrenCount;
  42967. if (toggleRowStatus(selection.value, row, value, treeProps, selectable.value, rowIndex, rowKey)) selectionChanged = true;
  42968. childrenCount += getChildrenCount(getRowIdentity(row, rowKey));
  42969. });
  42970. if (selectionChanged) instance.emit("selection-change", selection.value ? selection.value.slice() : []);
  42971. instance.emit("select-all", (selection.value || []).slice());
  42972. };
  42973. const updateAllSelected = () => {
  42974. if (data.value?.length === 0) {
  42975. isAllSelected.value = false;
  42976. return;
  42977. }
  42978. const { childrenColumnName } = instance.store.states;
  42979. let rowIndex = 0;
  42980. let selectedCount = 0;
  42981. const checkSelectedStatus = (data) => {
  42982. for (const row of data) {
  42983. const isRowSelectable = selectable.value && selectable.value.call(null, row, rowIndex);
  42984. if (!isSelected(row)) {
  42985. if (!selectable.value || isRowSelectable) return false;
  42986. } else selectedCount++;
  42987. rowIndex++;
  42988. if (row[childrenColumnName.value]?.length && !checkSelectedStatus(row[childrenColumnName.value])) return false;
  42989. }
  42990. return true;
  42991. };
  42992. const isAllSelected_ = checkSelectedStatus(data.value || []);
  42993. isAllSelected.value = selectedCount === 0 ? false : isAllSelected_;
  42994. };
  42995. const getChildrenCount = (rowKey) => {
  42996. if (!instance || !instance.store) return 0;
  42997. const { treeData } = instance.store.states;
  42998. let count = 0;
  42999. const children = treeData.value[rowKey]?.children;
  43000. if (children) {
  43001. count += children.length;
  43002. children.forEach((childKey) => {
  43003. count += getChildrenCount(childKey);
  43004. });
  43005. }
  43006. return count;
  43007. };
  43008. const updateFilters = (column, values) => {
  43009. const filters_ = {};
  43010. castArray$1(column).forEach((col) => {
  43011. filters.value[col.id] = values;
  43012. filters_[col.columnKey || col.id] = values;
  43013. });
  43014. return filters_;
  43015. };
  43016. const updateSort = (column, prop, order) => {
  43017. if (sortingColumn.value && sortingColumn.value !== column) sortingColumn.value.order = null;
  43018. sortingColumn.value = column;
  43019. sortProp.value = prop;
  43020. sortOrder.value = order;
  43021. };
  43022. const execFilter = () => {
  43023. let sourceData = unref(_data);
  43024. Object.keys(filters.value).forEach((columnId) => {
  43025. const values = filters.value[columnId];
  43026. if (!values || values.length === 0) return;
  43027. const column = getColumnById({ columns: columns.value }, columnId);
  43028. if (column && column.filterMethod) sourceData = sourceData.filter((row) => {
  43029. return values.some((value) => column.filterMethod.call(null, value, row, column));
  43030. });
  43031. });
  43032. filteredData.value = sourceData;
  43033. };
  43034. const execSort = () => {
  43035. data.value = sortData(filteredData.value ?? [], {
  43036. sortingColumn: sortingColumn.value,
  43037. sortProp: sortProp.value,
  43038. sortOrder: sortOrder.value
  43039. });
  43040. };
  43041. const execQuery = (ignore = void 0) => {
  43042. if (!ignore?.filter) execFilter();
  43043. execSort();
  43044. };
  43045. const clearFilter = (columnKeys) => {
  43046. const { tableHeaderRef } = instance.refs;
  43047. if (!tableHeaderRef) return;
  43048. const panels = Object.assign({}, tableHeaderRef.filterPanels);
  43049. const keys = Object.keys(panels);
  43050. if (!keys.length) return;
  43051. if (isString(columnKeys)) columnKeys = [columnKeys];
  43052. if (isArray$1(columnKeys)) {
  43053. const columns_ = columnKeys.map((key) => getColumnByKey({ columns: columns.value }, key));
  43054. keys.forEach((key) => {
  43055. const column = columns_.find((col) => col.id === key);
  43056. if (column) column.filteredValue = [];
  43057. });
  43058. instance.store.commit("filterChange", {
  43059. column: columns_,
  43060. values: [],
  43061. silent: true,
  43062. multi: true
  43063. });
  43064. } else {
  43065. keys.forEach((key) => {
  43066. const column = columns.value.find((col) => col.id === key);
  43067. if (column) column.filteredValue = [];
  43068. });
  43069. filters.value = {};
  43070. instance.store.commit("filterChange", {
  43071. column: {},
  43072. values: [],
  43073. silent: true
  43074. });
  43075. }
  43076. };
  43077. const clearSort = () => {
  43078. if (!sortingColumn.value) return;
  43079. updateSort(null, null, null);
  43080. instance.store.commit("changeSortCondition", { silent: true });
  43081. };
  43082. const { setExpandRowKeys, toggleRowExpansion, updateExpandRows, states: expandStates, isRowExpanded } = useExpand({
  43083. data,
  43084. rowKey
  43085. });
  43086. const { updateTreeExpandKeys, toggleTreeExpansion, updateTreeData, updateKeyChildren, loadOrToggle, states: treeStates } = useTree$2({
  43087. data,
  43088. rowKey
  43089. });
  43090. const { updateCurrentRowData, updateCurrentRow, setCurrentRowKey, states: currentData } = useCurrent({
  43091. data,
  43092. rowKey
  43093. });
  43094. const setExpandRowKeysAdapter = (val) => {
  43095. setExpandRowKeys(val);
  43096. updateTreeExpandKeys(val);
  43097. };
  43098. const toggleRowExpansionAdapter = (row, expanded) => {
  43099. if (columns.value.some(({ type }) => type === "expand")) toggleRowExpansion(row, expanded);
  43100. else toggleTreeExpansion(row, expanded);
  43101. };
  43102. return {
  43103. assertRowKey,
  43104. updateColumns,
  43105. scheduleLayout,
  43106. isSelected,
  43107. clearSelection,
  43108. cleanSelection,
  43109. getSelectionRows,
  43110. toggleRowSelection,
  43111. _toggleAllSelection,
  43112. toggleAllSelection: null,
  43113. updateAllSelected,
  43114. updateFilters,
  43115. updateCurrentRow,
  43116. updateSort,
  43117. execFilter,
  43118. execSort,
  43119. execQuery,
  43120. clearFilter,
  43121. clearSort,
  43122. toggleRowExpansion,
  43123. setExpandRowKeysAdapter,
  43124. setCurrentRowKey,
  43125. toggleRowExpansionAdapter,
  43126. isRowExpanded,
  43127. updateExpandRows,
  43128. updateCurrentRowData,
  43129. loadOrToggle,
  43130. updateTreeData,
  43131. updateKeyChildren,
  43132. states: {
  43133. tableSize,
  43134. rowKey,
  43135. data,
  43136. _data,
  43137. isComplex,
  43138. _columns,
  43139. originColumns,
  43140. columns,
  43141. fixedColumns,
  43142. rightFixedColumns,
  43143. leafColumns,
  43144. fixedLeafColumns,
  43145. rightFixedLeafColumns,
  43146. updateOrderFns,
  43147. leafColumnsLength,
  43148. fixedLeafColumnsLength,
  43149. rightFixedLeafColumnsLength,
  43150. isAllSelected,
  43151. selection,
  43152. reserveSelection,
  43153. selectOnIndeterminate,
  43154. selectable,
  43155. rowExpandable,
  43156. filters,
  43157. filteredData,
  43158. sortingColumn,
  43159. sortProp,
  43160. sortOrder,
  43161. hoverRow,
  43162. ...expandStates,
  43163. ...treeStates,
  43164. ...currentData
  43165. }
  43166. };
  43167. }
  43168. //#endregion
  43169. //#region ../../packages/components/table/src/store/index.ts
  43170. function replaceColumn(array, column) {
  43171. return array.map((item) => {
  43172. if (item.id === column.id) return column;
  43173. else if (item.children?.length) item.children = replaceColumn(item.children, column);
  43174. return item;
  43175. });
  43176. }
  43177. function sortColumn(array) {
  43178. array.forEach((item) => {
  43179. item.no = item.getColumnIndex?.();
  43180. if (item.children?.length) sortColumn(item.children);
  43181. });
  43182. array.sort((cur, pre) => cur.no - pre.no);
  43183. }
  43184. function useStore() {
  43185. const instance = getCurrentInstance();
  43186. const watcher = useWatcher$1();
  43187. const ns = useNamespace("table");
  43188. const { t } = useLocale();
  43189. const mutations = {
  43190. setData(states, data) {
  43191. const dataInstanceChanged = unref(states._data) !== data;
  43192. states.data.value = data;
  43193. states._data.value = data;
  43194. instance.store.execQuery();
  43195. instance.store.updateCurrentRowData();
  43196. instance.store.updateExpandRows();
  43197. instance.store.updateTreeData(instance.store.states.defaultExpandAll.value);
  43198. if (unref(states.reserveSelection)) instance.store.assertRowKey();
  43199. else if (dataInstanceChanged) instance.store.clearSelection();
  43200. else instance.store.cleanSelection();
  43201. instance.store.updateAllSelected();
  43202. if (instance.$ready) instance.store.scheduleLayout();
  43203. },
  43204. insertColumn(states, column, parent, updateColumnOrder) {
  43205. const array = unref(states._columns);
  43206. let newColumns = [];
  43207. if (!parent) {
  43208. array.push(column);
  43209. newColumns = array;
  43210. } else {
  43211. if (parent && !parent.children) parent.children = [];
  43212. parent.children?.push(column);
  43213. newColumns = replaceColumn(array, parent);
  43214. }
  43215. sortColumn(newColumns);
  43216. states._columns.value = newColumns;
  43217. states.updateOrderFns.push(updateColumnOrder);
  43218. if (column.type === "selection") {
  43219. states.selectable.value = column.selectable;
  43220. states.reserveSelection.value = column.reserveSelection;
  43221. }
  43222. if (instance.$ready) {
  43223. instance.store.updateColumns();
  43224. instance.store.scheduleLayout();
  43225. }
  43226. },
  43227. updateColumnOrder(states, column) {
  43228. if (column.getColumnIndex?.() === column.no) return;
  43229. sortColumn(states._columns.value);
  43230. if (instance.$ready) instance.store.updateColumns();
  43231. },
  43232. removeColumn(states, column, parent, updateColumnOrder) {
  43233. const array = unref(states._columns) || [];
  43234. if (parent) {
  43235. parent.children?.splice(parent.children.findIndex((item) => item.id === column.id), 1);
  43236. nextTick(() => {
  43237. if (parent.children?.length === 0) delete parent.children;
  43238. });
  43239. states._columns.value = replaceColumn(array, parent);
  43240. } else {
  43241. const index = array.indexOf(column);
  43242. if (index > -1) {
  43243. array.splice(index, 1);
  43244. states._columns.value = array;
  43245. }
  43246. }
  43247. const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder);
  43248. updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1);
  43249. if (instance.$ready) {
  43250. instance.store.updateColumns();
  43251. instance.store.scheduleLayout();
  43252. }
  43253. },
  43254. sort(states, options) {
  43255. const { prop, order, init } = options;
  43256. if (prop) {
  43257. const column = unref(states.columns).find((column) => column.property === prop);
  43258. if (column) {
  43259. column.order = order;
  43260. instance.store.updateSort(column, prop, order);
  43261. instance.store.commit("changeSortCondition", { init });
  43262. }
  43263. }
  43264. },
  43265. changeSortCondition(states, options) {
  43266. const { sortingColumn, sortProp, sortOrder } = states;
  43267. const columnValue = unref(sortingColumn), propValue = unref(sortProp), orderValue = unref(sortOrder);
  43268. if (isNull(orderValue)) {
  43269. states.sortingColumn.value = null;
  43270. states.sortProp.value = null;
  43271. }
  43272. instance.store.execQuery({ filter: true });
  43273. if (!options || !(options.silent || options.init)) instance.emit("sort-change", {
  43274. column: columnValue,
  43275. prop: propValue,
  43276. order: orderValue
  43277. });
  43278. instance.store.updateTableScrollY();
  43279. },
  43280. filterChange(_states, options) {
  43281. const { column, values, silent } = options;
  43282. const newFilters = instance.store.updateFilters(column, values);
  43283. instance.store.execQuery();
  43284. if (!silent) instance.emit("filter-change", newFilters);
  43285. instance.store.updateTableScrollY();
  43286. },
  43287. toggleAllSelection() {
  43288. instance.store.toggleAllSelection?.();
  43289. },
  43290. rowSelectedChanged(_states, row) {
  43291. instance.store.toggleRowSelection(row);
  43292. instance.store.updateAllSelected();
  43293. },
  43294. setHoverRow(states, row) {
  43295. states.hoverRow.value = row;
  43296. },
  43297. setCurrentRow(_states, row) {
  43298. instance.store.updateCurrentRow(row);
  43299. }
  43300. };
  43301. const commit = function(name, ...args) {
  43302. const mutations = instance.store.mutations;
  43303. if (mutations[name]) mutations[name].apply(instance, [instance.store.states, ...args]);
  43304. else throw new Error(`Action not found: ${name}`);
  43305. };
  43306. const updateTableScrollY = function() {
  43307. nextTick(() => instance.layout.updateScrollY.apply(instance.layout));
  43308. };
  43309. return {
  43310. ns,
  43311. t,
  43312. ...watcher,
  43313. mutations,
  43314. commit,
  43315. updateTableScrollY
  43316. };
  43317. }
  43318. //#endregion
  43319. //#region ../../packages/components/table/src/store/helper.ts
  43320. const InitialStateMap = {
  43321. rowKey: "rowKey",
  43322. defaultExpandAll: "defaultExpandAll",
  43323. rowExpandable: "rowExpandable",
  43324. selectOnIndeterminate: "selectOnIndeterminate",
  43325. indent: "indent",
  43326. lazy: "lazy",
  43327. ["treeProps.hasChildren"]: {
  43328. key: "lazyColumnIdentifier",
  43329. default: "hasChildren"
  43330. },
  43331. ["treeProps.children"]: {
  43332. key: "childrenColumnName",
  43333. default: "children"
  43334. },
  43335. ["treeProps.checkStrictly"]: {
  43336. key: "checkStrictly",
  43337. default: false
  43338. }
  43339. };
  43340. function createStore(table, props) {
  43341. if (!table) throw new Error("Table is required.");
  43342. const store = useStore();
  43343. store.toggleAllSelection = debounce(store._toggleAllSelection, 10);
  43344. Object.keys(InitialStateMap).forEach((key) => {
  43345. handleValue(getArrKeysValue(props, key), key, store);
  43346. });
  43347. proxyTableProps(store, props);
  43348. return store;
  43349. }
  43350. function proxyTableProps(store, props) {
  43351. Object.keys(InitialStateMap).forEach((key) => {
  43352. watch(() => getArrKeysValue(props, key), (value) => {
  43353. handleValue(value, key, store);
  43354. });
  43355. });
  43356. }
  43357. function handleValue(value, propsKey, store) {
  43358. let newVal = value;
  43359. let storeKey = InitialStateMap[propsKey];
  43360. if (isObject$1(storeKey)) {
  43361. newVal = newVal || storeKey.default;
  43362. storeKey = storeKey.key;
  43363. }
  43364. store.states[storeKey].value = newVal;
  43365. }
  43366. function getArrKeysValue(props, key) {
  43367. if (key.includes(".")) {
  43368. const keyList = key.split(".");
  43369. let value = props;
  43370. keyList.forEach((k) => {
  43371. value = value[k];
  43372. });
  43373. return value;
  43374. } else return props[key];
  43375. }
  43376. //#endregion
  43377. //#region ../../packages/components/table/src/table-layout.ts
  43378. var TableLayout = class {
  43379. constructor(options) {
  43380. this.observers = [];
  43381. this.table = null;
  43382. this.store = null;
  43383. this.columns = [];
  43384. this.fit = true;
  43385. this.showHeader = true;
  43386. this.height = ref(null);
  43387. this.scrollX = ref(false);
  43388. this.scrollY = ref(false);
  43389. this.bodyWidth = ref(null);
  43390. this.fixedWidth = ref(null);
  43391. this.rightFixedWidth = ref(null);
  43392. this.gutterWidth = 0;
  43393. for (const name in options) if (hasOwn(options, name)) if (isRef(this[name])) this[name].value = options[name];
  43394. else this[name] = options[name];
  43395. if (!this.table) throw new Error("Table is required for Table Layout");
  43396. if (!this.store) throw new Error("Store is required for Table Layout");
  43397. }
  43398. updateScrollY() {
  43399. const height = this.height.value;
  43400. /**
  43401. * When the height is not initialized, it is null.
  43402. * After the table is initialized, when the height is not configured, the height is 0.
  43403. */
  43404. if (isNull(height)) return false;
  43405. const scrollBarRef = this.table.refs.scrollBarRef;
  43406. if (this.table.vnode.el && scrollBarRef?.wrapRef) {
  43407. let scrollY = true;
  43408. const prevScrollY = this.scrollY.value;
  43409. scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight;
  43410. this.scrollY.value = scrollY;
  43411. return prevScrollY !== scrollY;
  43412. }
  43413. return false;
  43414. }
  43415. setHeight(value, prop = "height") {
  43416. if (!isClient) return;
  43417. const el = this.table.vnode.el;
  43418. value = parseHeight(value);
  43419. this.height.value = Number(value);
  43420. if (!el && (value || value === 0)) {
  43421. nextTick(() => this.setHeight(value, prop));
  43422. return;
  43423. }
  43424. if (el && isNumber(value)) {
  43425. el.style[prop] = `${value}px`;
  43426. this.updateElsHeight();
  43427. } else if (el && isString(value)) {
  43428. el.style[prop] = value;
  43429. this.updateElsHeight();
  43430. }
  43431. }
  43432. setMaxHeight(value) {
  43433. this.setHeight(value, "max-height");
  43434. }
  43435. getFlattenColumns() {
  43436. const flattenColumns = [];
  43437. this.table.store.states.columns.value.forEach((column) => {
  43438. if (column.isColumnGroup) flattenColumns.push.apply(flattenColumns, column.columns);
  43439. else flattenColumns.push(column);
  43440. });
  43441. return flattenColumns;
  43442. }
  43443. updateElsHeight() {
  43444. this.updateScrollY();
  43445. this.notifyObservers("scrollable");
  43446. }
  43447. headerDisplayNone(elm) {
  43448. if (!elm) return true;
  43449. let headerChild = elm;
  43450. while (headerChild.tagName !== "DIV") {
  43451. if (getComputedStyle(headerChild).display === "none") return true;
  43452. headerChild = headerChild.parentElement;
  43453. }
  43454. return false;
  43455. }
  43456. updateColumnsWidth() {
  43457. if (!isClient) return;
  43458. const fit = this.fit;
  43459. const bodyWidth = this.table.vnode.el?.clientWidth;
  43460. let bodyMinWidth = 0;
  43461. const flattenColumns = this.getFlattenColumns();
  43462. const flexColumns = flattenColumns.filter((column) => !isNumber(column.width));
  43463. flattenColumns.forEach((column) => {
  43464. if (isNumber(column.width) && column.realWidth) column.realWidth = null;
  43465. });
  43466. if (flexColumns.length > 0 && fit) {
  43467. flattenColumns.forEach((column) => {
  43468. bodyMinWidth += Number(column.width || column.minWidth || 80);
  43469. });
  43470. if (bodyMinWidth <= bodyWidth) {
  43471. this.scrollX.value = false;
  43472. const totalFlexWidth = bodyWidth - bodyMinWidth;
  43473. if (flexColumns.length === 1) flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth;
  43474. else {
  43475. const flexWidthPerPixel = totalFlexWidth / flexColumns.reduce((prev, column) => prev + Number(column.minWidth || 80), 0);
  43476. let noneFirstWidth = 0;
  43477. flexColumns.forEach((column, index) => {
  43478. if (index === 0) return;
  43479. const flexWidth = Math.floor(Number(column.minWidth || 80) * flexWidthPerPixel);
  43480. noneFirstWidth += flexWidth;
  43481. column.realWidth = Number(column.minWidth || 80) + flexWidth;
  43482. });
  43483. flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  43484. }
  43485. } else {
  43486. this.scrollX.value = true;
  43487. flexColumns.forEach((column) => {
  43488. column.realWidth = Number(column.minWidth);
  43489. });
  43490. }
  43491. this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth);
  43492. this.table.state.resizeState.value.width = this.bodyWidth.value;
  43493. } else {
  43494. flattenColumns.forEach((column) => {
  43495. if (!column.width && !column.minWidth) column.realWidth = 80;
  43496. else column.realWidth = Number(column.width || column.minWidth);
  43497. bodyMinWidth += column.realWidth;
  43498. });
  43499. this.scrollX.value = bodyMinWidth > bodyWidth;
  43500. this.bodyWidth.value = bodyMinWidth;
  43501. }
  43502. const fixedColumns = this.store.states.fixedColumns.value;
  43503. if (fixedColumns.length > 0) {
  43504. let fixedWidth = 0;
  43505. fixedColumns.forEach((column) => {
  43506. fixedWidth += Number(column.realWidth || column.width);
  43507. });
  43508. this.fixedWidth.value = fixedWidth;
  43509. }
  43510. const rightFixedColumns = this.store.states.rightFixedColumns.value;
  43511. if (rightFixedColumns.length > 0) {
  43512. let rightFixedWidth = 0;
  43513. rightFixedColumns.forEach((column) => {
  43514. rightFixedWidth += Number(column.realWidth || column.width);
  43515. });
  43516. this.rightFixedWidth.value = rightFixedWidth;
  43517. }
  43518. this.notifyObservers("columns");
  43519. }
  43520. addObserver(observer) {
  43521. this.observers.push(observer);
  43522. }
  43523. removeObserver(observer) {
  43524. const index = this.observers.indexOf(observer);
  43525. if (index !== -1) this.observers.splice(index, 1);
  43526. }
  43527. notifyObservers(event) {
  43528. this.observers.forEach((observer) => {
  43529. switch (event) {
  43530. case "columns":
  43531. observer.state?.onColumnsChange(this);
  43532. break;
  43533. case "scrollable":
  43534. observer.state?.onScrollableChange(this);
  43535. break;
  43536. default: throw new Error(`Table Layout don't have event ${event}.`);
  43537. }
  43538. });
  43539. }
  43540. };
  43541. //#endregion
  43542. //#region ../../packages/components/table/src/filter-panel.vue?vue&type=script&lang.ts
  43543. var filter_panel_vue_vue_type_script_lang_default = defineComponent({
  43544. name: "ElTableFilterPanel",
  43545. components: {
  43546. ElCheckbox,
  43547. ElCheckboxGroup,
  43548. ElScrollbar,
  43549. ElTooltip,
  43550. ElIcon,
  43551. ArrowDown: arrow_down_default,
  43552. ArrowUp: arrow_up_default
  43553. },
  43554. props: {
  43555. placement: {
  43556. type: String,
  43557. default: "bottom-start"
  43558. },
  43559. store: { type: Object },
  43560. column: { type: Object },
  43561. upDataColumn: { type: Function },
  43562. appendTo: useTooltipContentProps.appendTo
  43563. },
  43564. setup(props) {
  43565. const instance = getCurrentInstance();
  43566. const { t } = useLocale();
  43567. const ns = useNamespace("table-filter");
  43568. const parent = instance?.parent;
  43569. if (props.column && !parent.filterPanels.value[props.column.id]) parent.filterPanels.value[props.column.id] = instance;
  43570. const tooltipRef = ref(null);
  43571. const rootRef = ref(null);
  43572. const checkedIndex = ref(0);
  43573. const filters = computed(() => {
  43574. return props.column && props.column.filters;
  43575. });
  43576. const filterClassName = computed(() => {
  43577. if (props.column && props.column.filterClassName) return `${ns.b()} ${props.column.filterClassName}`;
  43578. return ns.b();
  43579. });
  43580. const filterValue = computed({
  43581. get: () => (props.column?.filteredValue || [])[0],
  43582. set: (value) => {
  43583. if (filteredValue.value) if (!isPropAbsent(value)) filteredValue.value.splice(0, 1, value);
  43584. else filteredValue.value.splice(0, 1);
  43585. }
  43586. });
  43587. const filteredValue = computed({
  43588. get() {
  43589. if (props.column) return props.column.filteredValue || [];
  43590. return [];
  43591. },
  43592. set(value) {
  43593. if (props.column) props.upDataColumn?.("filteredValue", value);
  43594. }
  43595. });
  43596. const multiple = computed(() => {
  43597. if (props.column) return props.column.filterMultiple;
  43598. return true;
  43599. });
  43600. const isActive = (filter) => {
  43601. return filter.value === filterValue.value;
  43602. };
  43603. const hidden = () => {
  43604. tooltipRef.value?.onClose();
  43605. };
  43606. const handleConfirm = () => {
  43607. confirmFilter(filteredValue.value);
  43608. hidden();
  43609. };
  43610. const handleReset = () => {
  43611. filteredValue.value = [];
  43612. confirmFilter(filteredValue.value);
  43613. hidden();
  43614. };
  43615. const handleSelect = (_filterValue, index) => {
  43616. filterValue.value = _filterValue;
  43617. checkedIndex.value = index;
  43618. if (!isPropAbsent(_filterValue)) confirmFilter(filteredValue.value);
  43619. else confirmFilter([]);
  43620. hidden();
  43621. };
  43622. const confirmFilter = (filteredValue) => {
  43623. props.store?.commit("filterChange", {
  43624. column: props.column,
  43625. values: filteredValue
  43626. });
  43627. props.store?.updateAllSelected();
  43628. };
  43629. const handleShowTooltip = () => {
  43630. rootRef.value?.focus();
  43631. !multiple.value && initCheckedIndex();
  43632. if (props.column) props.upDataColumn?.("filterOpened", true);
  43633. };
  43634. const handleHideTooltip = () => {
  43635. if (props.column) props.upDataColumn?.("filterOpened", false);
  43636. };
  43637. const initCheckedIndex = () => {
  43638. if (isPropAbsent(filterValue)) {
  43639. checkedIndex.value = 0;
  43640. return;
  43641. }
  43642. const idx = (filters.value || []).findIndex((item) => {
  43643. return item.value === filterValue.value;
  43644. });
  43645. checkedIndex.value = idx >= 0 ? idx + 1 : 0;
  43646. };
  43647. const handleKeydown = (event) => {
  43648. const code = getEventCode(event);
  43649. const len = (filters.value ? filters.value.length : 0) + 1;
  43650. let index = checkedIndex.value;
  43651. let isPreventDefault = true;
  43652. switch (code) {
  43653. case EVENT_CODE.down:
  43654. case EVENT_CODE.right:
  43655. index = (index + 1) % len;
  43656. break;
  43657. case EVENT_CODE.up:
  43658. case EVENT_CODE.left:
  43659. index = (index - 1 + len) % len;
  43660. break;
  43661. case EVENT_CODE.tab:
  43662. hidden();
  43663. isPreventDefault = false;
  43664. break;
  43665. case EVENT_CODE.enter:
  43666. case EVENT_CODE.space:
  43667. if (index === 0) handleSelect(null, 0);
  43668. else {
  43669. const item = (filters.value || [])[index - 1];
  43670. item.value && handleSelect(item.value, index);
  43671. }
  43672. break;
  43673. default:
  43674. isPreventDefault = false;
  43675. break;
  43676. }
  43677. isPreventDefault && event.preventDefault();
  43678. checkedIndex.value = index;
  43679. rootRef.value?.querySelector(`.${ns.e("list-item")}:nth-child(${index + 1})`)?.focus();
  43680. };
  43681. return {
  43682. multiple,
  43683. filterClassName,
  43684. filteredValue,
  43685. filterValue,
  43686. filters,
  43687. handleConfirm,
  43688. handleReset,
  43689. handleSelect,
  43690. isPropAbsent,
  43691. isActive,
  43692. t,
  43693. ns,
  43694. tooltipRef,
  43695. rootRef,
  43696. checkedIndex,
  43697. handleShowTooltip,
  43698. handleHideTooltip,
  43699. handleKeydown
  43700. };
  43701. }
  43702. });
  43703. //#endregion
  43704. //#region ../../packages/components/table/src/filter-panel.vue
  43705. const _hoisted_1$17 = ["disabled"];
  43706. const _hoisted_2$10 = ["tabindex", "aria-checked"];
  43707. const _hoisted_3$3 = [
  43708. "tabindex",
  43709. "aria-checked",
  43710. "onClick"
  43711. ];
  43712. const _hoisted_4$2 = ["aria-label"];
  43713. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  43714. const _component_el_checkbox = resolveComponent("el-checkbox");
  43715. const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
  43716. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  43717. const _component_arrow_up = resolveComponent("arrow-up");
  43718. const _component_arrow_down = resolveComponent("arrow-down");
  43719. const _component_el_icon = resolveComponent("el-icon");
  43720. const _component_el_tooltip = resolveComponent("el-tooltip");
  43721. return openBlock(), createBlock(_component_el_tooltip, {
  43722. ref: "tooltipRef",
  43723. offset: 0,
  43724. placement: _ctx.placement,
  43725. "show-arrow": false,
  43726. trigger: "click",
  43727. role: "dialog",
  43728. teleported: "",
  43729. effect: "light",
  43730. pure: "",
  43731. loop: "",
  43732. "popper-class": _ctx.filterClassName,
  43733. persistent: "",
  43734. "append-to": _ctx.appendTo,
  43735. onShow: _ctx.handleShowTooltip,
  43736. onHide: _ctx.handleHideTooltip
  43737. }, {
  43738. content: withCtx(() => [_ctx.multiple ? (openBlock(), createElementBlock("div", {
  43739. key: 0,
  43740. ref: "rootRef",
  43741. tabindex: "-1",
  43742. class: normalizeClass(_ctx.ns.e("multiple"))
  43743. }, [createElementVNode("div", { class: normalizeClass(_ctx.ns.e("content")) }, [createVNode(_component_el_scrollbar, { "wrap-class": _ctx.ns.e("wrap") }, {
  43744. default: withCtx(() => [createVNode(_component_el_checkbox_group, {
  43745. modelValue: _ctx.filteredValue,
  43746. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event),
  43747. class: normalizeClass(_ctx.ns.e("checkbox-group"))
  43748. }, {
  43749. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter) => {
  43750. return openBlock(), createBlock(_component_el_checkbox, {
  43751. key: filter.value,
  43752. value: filter.value
  43753. }, {
  43754. default: withCtx(() => [createTextVNode(toDisplayString(filter.text), 1)]),
  43755. _: 2
  43756. }, 1032, ["value"]);
  43757. }), 128))]),
  43758. _: 1
  43759. }, 8, ["modelValue", "class"])]),
  43760. _: 1
  43761. }, 8, ["wrap-class"])], 2), createElementVNode("div", { class: normalizeClass(_ctx.ns.e("bottom")) }, [createElementVNode("button", {
  43762. class: normalizeClass(_ctx.ns.is("disabled", _ctx.filteredValue.length === 0)),
  43763. disabled: _ctx.filteredValue.length === 0,
  43764. type: "button",
  43765. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args))
  43766. }, toDisplayString(_ctx.t("el.table.confirmFilter")), 11, _hoisted_1$17), createElementVNode("button", {
  43767. type: "button",
  43768. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args))
  43769. }, toDisplayString(_ctx.t("el.table.resetFilter")), 1)], 2)], 2)) : (openBlock(), createElementBlock("ul", {
  43770. key: 1,
  43771. ref: "rootRef",
  43772. tabindex: "-1",
  43773. role: "radiogroup",
  43774. class: normalizeClass(_ctx.ns.e("list")),
  43775. onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
  43776. }, [createElementVNode("li", {
  43777. role: "radio",
  43778. class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isPropAbsent(_ctx.filterValue))]),
  43779. tabindex: _ctx.checkedIndex === 0 ? 0 : -1,
  43780. "aria-checked": _ctx.isPropAbsent(_ctx.filterValue),
  43781. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null, 0))
  43782. }, toDisplayString(_ctx.t("el.table.clearFilter")), 11, _hoisted_2$10), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter, idx) => {
  43783. return openBlock(), createElementBlock("li", {
  43784. key: filter.value,
  43785. role: "radio",
  43786. class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]),
  43787. tabindex: _ctx.checkedIndex === idx + 1 ? 0 : -1,
  43788. "aria-checked": _ctx.isActive(filter),
  43789. onClick: ($event) => _ctx.handleSelect(filter.value, idx + 1)
  43790. }, toDisplayString(filter.text), 11, _hoisted_3$3);
  43791. }), 128))], 34))]),
  43792. default: withCtx(() => [createElementVNode("button", {
  43793. type: "button",
  43794. class: normalizeClass(`${_ctx.ns.namespace.value}-table__column-filter-trigger`),
  43795. "aria-label": _ctx.t("el.table.filterLabel", { column: _ctx.column?.label || "" })
  43796. }, [createVNode(_component_el_icon, null, {
  43797. default: withCtx(() => [renderSlot(_ctx.$slots, "filter-icon", {}, () => [_ctx.column?.filterOpened ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_arrow_down, { key: 1 }))])]),
  43798. _: 3
  43799. })], 10, _hoisted_4$2)]),
  43800. _: 3
  43801. }, 8, [
  43802. "placement",
  43803. "popper-class",
  43804. "append-to",
  43805. "onShow",
  43806. "onHide"
  43807. ]);
  43808. }
  43809. var filter_panel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(filter_panel_vue_vue_type_script_lang_default, [["render", _sfc_render$4]]);
  43810. //#endregion
  43811. //#region ../../packages/components/table/src/layout-observer.ts
  43812. function useLayoutObserver(root) {
  43813. const instance = getCurrentInstance();
  43814. onBeforeMount(() => {
  43815. tableLayout.value.addObserver(instance);
  43816. });
  43817. onMounted(() => {
  43818. onColumnsChange(tableLayout.value);
  43819. onScrollableChange(tableLayout.value);
  43820. });
  43821. onUpdated(() => {
  43822. onColumnsChange(tableLayout.value);
  43823. onScrollableChange(tableLayout.value);
  43824. });
  43825. onUnmounted(() => {
  43826. tableLayout.value.removeObserver(instance);
  43827. });
  43828. const tableLayout = computed(() => {
  43829. const layout = root.layout;
  43830. if (!layout) throw new Error("Can not find table layout.");
  43831. return layout;
  43832. });
  43833. const onColumnsChange = (layout) => {
  43834. const cols = root.vnode.el?.querySelectorAll("colgroup > col") || [];
  43835. if (!cols.length) return;
  43836. const flattenColumns = layout.getFlattenColumns();
  43837. const columnsMap = {};
  43838. flattenColumns.forEach((column) => {
  43839. columnsMap[column.id] = column;
  43840. });
  43841. for (let i = 0, j = cols.length; i < j; i++) {
  43842. const col = cols[i];
  43843. const column = columnsMap[col.getAttribute("name")];
  43844. if (column) col.setAttribute("width", column.realWidth || column.width);
  43845. }
  43846. };
  43847. const onScrollableChange = (layout) => {
  43848. const cols = root.vnode.el?.querySelectorAll("colgroup > col[name=gutter]") || [];
  43849. for (let i = 0, j = cols.length; i < j; i++) cols[i].setAttribute("width", layout.scrollY.value ? layout.gutterWidth : "0");
  43850. const ths = root.vnode.el?.querySelectorAll("th.gutter") || [];
  43851. for (let i = 0, j = ths.length; i < j; i++) {
  43852. const th = ths[i];
  43853. th.style.width = layout.scrollY.value ? `${layout.gutterWidth}px` : "0";
  43854. th.style.display = layout.scrollY.value ? "" : "none";
  43855. }
  43856. };
  43857. return {
  43858. tableLayout: tableLayout.value,
  43859. onColumnsChange,
  43860. onScrollableChange
  43861. };
  43862. }
  43863. //#endregion
  43864. //#region ../../packages/components/table/src/tokens.ts
  43865. const TABLE_INJECTION_KEY = Symbol("ElTable");
  43866. //#endregion
  43867. //#region ../../packages/components/table/src/table-header/event-helper.ts
  43868. function useEvent(props, emit) {
  43869. const instance = getCurrentInstance();
  43870. const parent = inject(TABLE_INJECTION_KEY);
  43871. const handleFilterClick = (event) => {
  43872. event.stopPropagation();
  43873. };
  43874. const handleHeaderClick = (event, column) => {
  43875. if (!column.filters && column.sortable) handleSortClick(event, column, false);
  43876. else if (column.filterable && !column.sortable) handleFilterClick(event);
  43877. parent?.emit("header-click", column, event);
  43878. };
  43879. const handleHeaderContextMenu = (event, column) => {
  43880. parent?.emit("header-contextmenu", column, event);
  43881. };
  43882. const draggingColumn = ref(null);
  43883. const dragging = ref(false);
  43884. const dragState = ref();
  43885. const handleMouseDown = (event, column) => {
  43886. if (!isClient) return;
  43887. if (column.children && column.children.length > 0) return;
  43888. /* istanbul ignore if */
  43889. if (draggingColumn.value && props.border && draggingColumn.value.id === column.id) {
  43890. dragging.value = true;
  43891. const table = parent;
  43892. emit("set-drag-visible", true);
  43893. const tableLeft = (table?.vnode.el)?.getBoundingClientRect().left;
  43894. const columnEl = instance?.vnode?.el?.querySelector(`th.${column.id}`);
  43895. const columnRect = columnEl.getBoundingClientRect();
  43896. const minLeft = columnRect.left - tableLeft + 30;
  43897. addClass(columnEl, "noclick");
  43898. dragState.value = {
  43899. startMouseLeft: event.clientX,
  43900. startLeft: columnRect.right - tableLeft,
  43901. startColumnLeft: columnRect.left - tableLeft,
  43902. tableLeft
  43903. };
  43904. const resizeProxy = table?.refs.resizeProxy;
  43905. resizeProxy.style.left = `${dragState.value.startLeft}px`;
  43906. document.onselectstart = function() {
  43907. return false;
  43908. };
  43909. document.ondragstart = function() {
  43910. return false;
  43911. };
  43912. const handleMouseMove = (event) => {
  43913. const deltaLeft = event.clientX - dragState.value.startMouseLeft;
  43914. const proxyLeft = dragState.value.startLeft + deltaLeft;
  43915. resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`;
  43916. };
  43917. const handleMouseUp = () => {
  43918. if (dragging.value) {
  43919. const { startColumnLeft, startLeft } = dragState.value;
  43920. column.width = column.realWidth = Number.parseInt(resizeProxy.style.left, 10) - startColumnLeft;
  43921. table?.emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
  43922. requestAnimationFrame(() => {
  43923. props.store.scheduleLayout(false, true);
  43924. });
  43925. document.body.style.cursor = "";
  43926. dragging.value = false;
  43927. draggingColumn.value = null;
  43928. dragState.value = void 0;
  43929. emit("set-drag-visible", false);
  43930. }
  43931. document.removeEventListener("mousemove", handleMouseMove);
  43932. document.removeEventListener("mouseup", handleMouseUp);
  43933. document.onselectstart = null;
  43934. document.ondragstart = null;
  43935. setTimeout(() => {
  43936. removeClass(columnEl, "noclick");
  43937. }, 0);
  43938. };
  43939. document.addEventListener("mousemove", handleMouseMove);
  43940. document.addEventListener("mouseup", handleMouseUp);
  43941. }
  43942. };
  43943. const handleMouseMove = (event, column) => {
  43944. if (!props.border || column.children && column.children.length > 0) return;
  43945. const el = event.target;
  43946. const target = isElement$1(el) ? el.closest("th") : null;
  43947. if (!target) return;
  43948. const isSortable = hasClass(target, "is-sortable");
  43949. if (isSortable) {
  43950. const cursor = dragging.value ? "col-resize" : "";
  43951. target.style.cursor = cursor;
  43952. const caret = target.querySelector(".caret-wrapper");
  43953. if (caret) caret.style.cursor = cursor;
  43954. }
  43955. if (!column.resizable || dragging.value) {
  43956. draggingColumn.value = null;
  43957. return;
  43958. }
  43959. const rect = target.getBoundingClientRect();
  43960. const isLastTh = target.parentNode?.lastElementChild === target;
  43961. const allowDrag = props.allowDragLastColumn || !isLastTh;
  43962. const isResizeHandleActive = rect.width > 12 && rect.right - event.clientX < 8 && allowDrag;
  43963. const cursor = isResizeHandleActive ? "col-resize" : "";
  43964. document.body.style.cursor = cursor;
  43965. draggingColumn.value = isResizeHandleActive ? column : null;
  43966. if (isSortable) target.style.cursor = cursor;
  43967. };
  43968. const handleMouseOut = () => {
  43969. if (!isClient || dragging.value) return;
  43970. document.body.style.cursor = "";
  43971. };
  43972. const toggleOrder = ({ order, sortOrders }) => {
  43973. if (order === "") return sortOrders[0];
  43974. const index = sortOrders.indexOf(order || null);
  43975. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  43976. };
  43977. const handleSortClick = (event, column, givenOrder) => {
  43978. event.stopPropagation();
  43979. const order = column.order === givenOrder ? null : givenOrder || toggleOrder(column);
  43980. const target = event.target?.closest("th");
  43981. if (target) {
  43982. if (hasClass(target, "noclick")) {
  43983. removeClass(target, "noclick");
  43984. return;
  43985. }
  43986. }
  43987. if (!column.sortable) return;
  43988. const clickTarget = event.currentTarget;
  43989. if (["ascending", "descending"].some((str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str))) return;
  43990. const states = props.store.states;
  43991. let sortProp = states.sortProp.value;
  43992. let sortOrder;
  43993. const sortingColumn = states.sortingColumn.value;
  43994. if (sortingColumn !== column || sortingColumn === column && isNull(sortingColumn.order)) {
  43995. if (sortingColumn) sortingColumn.order = null;
  43996. states.sortingColumn.value = column;
  43997. sortProp = column.property;
  43998. }
  43999. if (!order) sortOrder = column.order = null;
  44000. else sortOrder = column.order = order;
  44001. states.sortProp.value = sortProp;
  44002. states.sortOrder.value = sortOrder;
  44003. parent?.store.commit("changeSortCondition");
  44004. };
  44005. return {
  44006. handleHeaderClick,
  44007. handleHeaderContextMenu,
  44008. handleMouseDown,
  44009. handleMouseMove,
  44010. handleMouseOut,
  44011. handleSortClick,
  44012. handleFilterClick
  44013. };
  44014. }
  44015. //#endregion
  44016. //#region ../../packages/components/table/src/table-header/style.helper.ts
  44017. function useStyle$2(props) {
  44018. const parent = inject(TABLE_INJECTION_KEY);
  44019. const ns = useNamespace("table");
  44020. const getHeaderRowStyle = (rowIndex) => {
  44021. const headerRowStyle = parent?.props.headerRowStyle;
  44022. if (isFunction$1(headerRowStyle)) return headerRowStyle.call(null, { rowIndex });
  44023. return headerRowStyle;
  44024. };
  44025. const getHeaderRowClass = (rowIndex) => {
  44026. const classes = [];
  44027. const headerRowClassName = parent?.props.headerRowClassName;
  44028. if (isString(headerRowClassName)) classes.push(headerRowClassName);
  44029. else if (isFunction$1(headerRowClassName)) classes.push(headerRowClassName.call(null, { rowIndex }));
  44030. return classes.join(" ");
  44031. };
  44032. const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => {
  44033. let headerCellStyles = parent?.props.headerCellStyle ?? {};
  44034. if (isFunction$1(headerCellStyles)) headerCellStyles = headerCellStyles.call(null, {
  44035. rowIndex,
  44036. columnIndex,
  44037. row,
  44038. column
  44039. });
  44040. const fixedStyle = getFixedColumnOffset(columnIndex, column.fixed, props.store, row);
  44041. ensurePosition(fixedStyle, "left");
  44042. ensurePosition(fixedStyle, "right");
  44043. return Object.assign({}, headerCellStyles, fixedStyle);
  44044. };
  44045. const getHeaderCellClass = (rowIndex, columnIndex, row, column) => {
  44046. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, column.fixed, props.store, row);
  44047. const classes = [
  44048. column.id,
  44049. column.order,
  44050. column.headerAlign,
  44051. column.className,
  44052. column.labelClassName,
  44053. ...fixedClasses
  44054. ];
  44055. if (!column.children) classes.push("is-leaf");
  44056. if (column.sortable) classes.push("is-sortable");
  44057. const headerCellClassName = parent?.props.headerCellClassName;
  44058. if (isString(headerCellClassName)) classes.push(headerCellClassName);
  44059. else if (isFunction$1(headerCellClassName)) classes.push(headerCellClassName.call(null, {
  44060. rowIndex,
  44061. columnIndex,
  44062. row,
  44063. column
  44064. }));
  44065. classes.push(ns.e("cell"));
  44066. return classes.filter((className) => Boolean(className)).join(" ");
  44067. };
  44068. return {
  44069. getHeaderRowStyle,
  44070. getHeaderRowClass,
  44071. getHeaderCellStyle,
  44072. getHeaderCellClass
  44073. };
  44074. }
  44075. //#endregion
  44076. //#region ../../packages/components/table/src/table-header/utils-helper.ts
  44077. const getAllColumns = (columns) => {
  44078. const result = [];
  44079. columns.forEach((column) => {
  44080. if (column.children) {
  44081. result.push(column);
  44082. result.push.apply(result, getAllColumns(column.children));
  44083. } else result.push(column);
  44084. });
  44085. return result;
  44086. };
  44087. const convertToRows = (originColumns) => {
  44088. let maxLevel = 1;
  44089. const traverse = (column, parent) => {
  44090. if (parent) {
  44091. column.level = parent.level + 1;
  44092. if (maxLevel < column.level) maxLevel = column.level;
  44093. }
  44094. if (column.children) {
  44095. let colSpan = 0;
  44096. column.children.forEach((subColumn) => {
  44097. traverse(subColumn, column);
  44098. colSpan += subColumn.colSpan;
  44099. });
  44100. column.colSpan = colSpan;
  44101. } else column.colSpan = 1;
  44102. };
  44103. originColumns.forEach((column) => {
  44104. column.level = 1;
  44105. traverse(column, void 0);
  44106. });
  44107. const rows = [];
  44108. for (let i = 0; i < maxLevel; i++) rows.push([]);
  44109. getAllColumns(originColumns).forEach((column) => {
  44110. if (!column.children) column.rowSpan = maxLevel - column.level + 1;
  44111. else {
  44112. column.rowSpan = 1;
  44113. column.children.forEach((col) => col.isSubColumn = true);
  44114. }
  44115. rows[column.level - 1].push(column);
  44116. });
  44117. return rows;
  44118. };
  44119. function useUtils$1(props) {
  44120. const parent = inject(TABLE_INJECTION_KEY);
  44121. const columnRows = computed(() => {
  44122. return convertToRows(props.store.states.originColumns.value);
  44123. });
  44124. const isGroup = computed(() => {
  44125. const result = columnRows.value.length > 1;
  44126. if (result && parent) parent.state.isGroup.value = true;
  44127. return result;
  44128. });
  44129. const toggleAllSelection = (event) => {
  44130. event.stopPropagation();
  44131. parent?.store.commit("toggleAllSelection");
  44132. };
  44133. return {
  44134. isGroup,
  44135. toggleAllSelection,
  44136. columnRows
  44137. };
  44138. }
  44139. //#endregion
  44140. //#region ../../packages/components/table/src/table-header/index.ts
  44141. var table_header_default = defineComponent({
  44142. name: "ElTableHeader",
  44143. components: { ElCheckbox },
  44144. props: {
  44145. fixed: {
  44146. type: String,
  44147. default: ""
  44148. },
  44149. store: {
  44150. required: true,
  44151. type: Object
  44152. },
  44153. border: Boolean,
  44154. defaultSort: {
  44155. type: Object,
  44156. default: () => {
  44157. return {
  44158. prop: "",
  44159. order: ""
  44160. };
  44161. }
  44162. },
  44163. appendFilterPanelTo: { type: String },
  44164. allowDragLastColumn: { type: Boolean }
  44165. },
  44166. setup(props, { emit }) {
  44167. const instance = getCurrentInstance();
  44168. const parent = inject(TABLE_INJECTION_KEY);
  44169. const ns = useNamespace("table");
  44170. const filterPanels = ref({});
  44171. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  44172. const isTableLayoutAuto = parent?.props.tableLayout === "auto";
  44173. const saveIndexSelection = reactive(/* @__PURE__ */ new Map());
  44174. const theadRef = ref();
  44175. let delayId;
  44176. const updateFixedColumnStyle = () => {
  44177. delayId = setTimeout(() => {
  44178. if (saveIndexSelection.size > 0) {
  44179. saveIndexSelection.forEach((column, key) => {
  44180. const el = theadRef.value.querySelector(`.${key.replace(/\s/g, ".")}`);
  44181. if (el) column.width = el.getBoundingClientRect().width || column.width;
  44182. });
  44183. saveIndexSelection.clear();
  44184. }
  44185. });
  44186. };
  44187. watch(saveIndexSelection, updateFixedColumnStyle);
  44188. onBeforeUnmount(() => {
  44189. if (delayId) {
  44190. clearTimeout(delayId);
  44191. delayId = void 0;
  44192. }
  44193. });
  44194. onMounted(async () => {
  44195. await nextTick();
  44196. await nextTick();
  44197. const { prop, order } = props.defaultSort;
  44198. parent?.store.commit("sort", {
  44199. prop,
  44200. order,
  44201. init: true
  44202. });
  44203. updateFixedColumnStyle();
  44204. });
  44205. const { handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleMouseOut, handleSortClick, handleFilterClick } = useEvent(props, emit);
  44206. const { getHeaderRowStyle, getHeaderRowClass, getHeaderCellStyle, getHeaderCellClass } = useStyle$2(props);
  44207. const { isGroup, toggleAllSelection, columnRows } = useUtils$1(props);
  44208. const { t } = useLocale();
  44209. instance.state = {
  44210. onColumnsChange,
  44211. onScrollableChange
  44212. };
  44213. instance.filterPanels = filterPanels;
  44214. return {
  44215. ns,
  44216. t,
  44217. filterPanels,
  44218. onColumnsChange,
  44219. onScrollableChange,
  44220. columnRows,
  44221. getHeaderRowClass,
  44222. getHeaderRowStyle,
  44223. getHeaderCellClass,
  44224. getHeaderCellStyle,
  44225. handleHeaderClick,
  44226. handleHeaderContextMenu,
  44227. handleMouseDown,
  44228. handleMouseMove,
  44229. handleMouseOut,
  44230. handleSortClick,
  44231. handleFilterClick,
  44232. isGroup,
  44233. toggleAllSelection,
  44234. saveIndexSelection,
  44235. isTableLayoutAuto,
  44236. theadRef,
  44237. updateFixedColumnStyle
  44238. };
  44239. },
  44240. render() {
  44241. const { ns, t, isGroup, columnRows, getHeaderCellStyle, getHeaderCellClass, getHeaderRowClass, getHeaderRowStyle, handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleSortClick, handleMouseOut, store, $parent, saveIndexSelection, isTableLayoutAuto } = this;
  44242. let rowSpan = 1;
  44243. return h("thead", {
  44244. ref: "theadRef",
  44245. class: ns.is("group", isGroup)
  44246. }, columnRows.map((subColumns, rowIndex) => h("tr", {
  44247. class: getHeaderRowClass(rowIndex),
  44248. key: rowIndex,
  44249. style: getHeaderRowStyle(rowIndex)
  44250. }, subColumns.map((column, cellIndex) => {
  44251. if (column.rowSpan > rowSpan) rowSpan = column.rowSpan;
  44252. const _class = getHeaderCellClass(rowIndex, cellIndex, subColumns, column);
  44253. if (isTableLayoutAuto && column.fixed) saveIndexSelection.set(_class, column);
  44254. return h("th", {
  44255. class: _class,
  44256. colspan: column.colSpan,
  44257. key: `${column.id}-thead`,
  44258. rowspan: column.rowSpan,
  44259. scope: column.colSpan > 1 ? "colgroup" : "col",
  44260. ariaSort: column.sortable ? column.order : void 0,
  44261. style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
  44262. onClick: ($event) => {
  44263. if ($event.currentTarget?.classList.contains("noclick")) return;
  44264. handleHeaderClick($event, column);
  44265. },
  44266. onContextmenu: ($event) => handleHeaderContextMenu($event, column),
  44267. onMousedown: ($event) => handleMouseDown($event, column),
  44268. onMousemove: ($event) => handleMouseMove($event, column),
  44269. onMouseout: handleMouseOut
  44270. }, [h("div", { class: ["cell", column.filteredValue && column.filteredValue.length > 0 ? "highlight" : ""] }, [
  44271. column.renderHeader ? column.renderHeader({
  44272. column,
  44273. $index: cellIndex,
  44274. store,
  44275. _self: $parent
  44276. }) : column.label,
  44277. column.sortable && h("button", {
  44278. type: "button",
  44279. class: "caret-wrapper",
  44280. "aria-label": t("el.table.sortLabel", { column: column.label || "" }),
  44281. onClick: ($event) => handleSortClick($event, column)
  44282. }, [h("i", {
  44283. onClick: ($event) => handleSortClick($event, column, "ascending"),
  44284. class: "sort-caret ascending"
  44285. }), h("i", {
  44286. onClick: ($event) => handleSortClick($event, column, "descending"),
  44287. class: "sort-caret descending"
  44288. })]),
  44289. column.filterable && h(filter_panel_default, {
  44290. store,
  44291. placement: column.filterPlacement || "bottom-start",
  44292. appendTo: $parent?.appendFilterPanelTo,
  44293. column,
  44294. upDataColumn: (key, value) => {
  44295. column[key] = value;
  44296. }
  44297. }, { "filter-icon": () => column.renderFilterIcon ? column.renderFilterIcon({ filterOpened: column.filterOpened }) : null })
  44298. ])]);
  44299. }))));
  44300. }
  44301. });
  44302. //#endregion
  44303. //#region ../../packages/components/table/src/table-body/events-helper.ts
  44304. function isGreaterThan(a, b, epsilon = .03) {
  44305. return a - b > epsilon;
  44306. }
  44307. function useEvents(props) {
  44308. const parent = inject(TABLE_INJECTION_KEY);
  44309. const tooltipContent = ref("");
  44310. const tooltipTrigger = ref(h("div"));
  44311. const handleEvent = (event, row, name) => {
  44312. const table = parent;
  44313. const cell = getCell(event);
  44314. let column = null;
  44315. const namespace = table?.vnode.el?.dataset.prefix;
  44316. if (cell) {
  44317. column = getColumnByCell({ columns: props.store?.states.columns.value ?? [] }, cell, namespace);
  44318. if (column) table?.emit(`cell-${name}`, row, column, cell, event);
  44319. }
  44320. table?.emit(`row-${name}`, row, column, event);
  44321. };
  44322. const handleDoubleClick = (event, row) => {
  44323. handleEvent(event, row, "dblclick");
  44324. };
  44325. const handleClick = (event, row) => {
  44326. props.store?.commit("setCurrentRow", row);
  44327. handleEvent(event, row, "click");
  44328. };
  44329. const handleContextMenu = (event, row) => {
  44330. handleEvent(event, row, "contextmenu");
  44331. };
  44332. const handleMouseEnter = debounce((index) => {
  44333. props.store?.commit("setHoverRow", index);
  44334. }, 30);
  44335. const handleMouseLeave = debounce(() => {
  44336. props.store?.commit("setHoverRow", null);
  44337. }, 30);
  44338. const getPadding = (el) => {
  44339. const style = window.getComputedStyle(el, null);
  44340. return {
  44341. left: Number.parseInt(style.paddingLeft, 10) || 0,
  44342. right: Number.parseInt(style.paddingRight, 10) || 0,
  44343. top: Number.parseInt(style.paddingTop, 10) || 0,
  44344. bottom: Number.parseInt(style.paddingBottom, 10) || 0
  44345. };
  44346. };
  44347. const toggleRowClassByCell = (rowSpan, event, toggle) => {
  44348. let node = (event?.target)?.parentNode;
  44349. while (rowSpan > 1) {
  44350. node = node?.nextSibling;
  44351. if (!node || node.nodeName !== "TR") break;
  44352. toggle(node, "hover-row hover-fixed-row");
  44353. rowSpan--;
  44354. }
  44355. };
  44356. const handleCellMouseEnter = (event, row, tooltipOptions) => {
  44357. if (!parent) return;
  44358. const table = parent;
  44359. const cell = getCell(event);
  44360. const namespace = table?.vnode.el?.dataset.prefix;
  44361. let column = null;
  44362. if (cell) {
  44363. column = getColumnByCell({ columns: props.store?.states.columns.value ?? [] }, cell, namespace);
  44364. if (!column) return;
  44365. if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, addClass);
  44366. const hoverState = table.hoverState = {
  44367. cell,
  44368. column,
  44369. row
  44370. };
  44371. table?.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, event);
  44372. }
  44373. if (!tooltipOptions) {
  44374. if (removePopper?.trigger === cell) removePopper?.();
  44375. return;
  44376. }
  44377. const cellChild = event.target.querySelector(".cell");
  44378. if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length && cellChild.textContent?.trim())) return;
  44379. const range = document.createRange();
  44380. range.setStart(cellChild, 0);
  44381. range.setEnd(cellChild, cellChild.childNodes.length);
  44382. /** detail: https://github.com/element-plus/element-plus/issues/10790
  44383. * What went wrong?
  44384. * UI > Browser > Zoom, In Blink/WebKit, getBoundingClientRect() sometimes returns inexact values, probably due to lost precision during internal calculations. In the example above:
  44385. * - Expected: 188
  44386. * - Actual: 188.00000762939453
  44387. */
  44388. const { width: rangeWidth, height: rangeHeight } = range.getBoundingClientRect();
  44389. const { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect();
  44390. const { top, left, right, bottom } = getPadding(cellChild);
  44391. const horizontalPadding = left + right;
  44392. const verticalPadding = top + bottom;
  44393. if (isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) || isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) || isGreaterThan(cellChild.scrollWidth, cellChildWidth)) createTablePopper(tooltipOptions, (cell?.innerText || cell?.textContent) ?? "", row, column, cell, table);
  44394. else if (removePopper?.trigger === cell) removePopper?.();
  44395. };
  44396. const handleCellMouseLeave = (event) => {
  44397. const cell = getCell(event);
  44398. if (!cell) return;
  44399. if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, removeClass);
  44400. const oldHoverState = parent?.hoverState;
  44401. parent?.emit("cell-mouse-leave", oldHoverState?.row, oldHoverState?.column, oldHoverState?.cell, event);
  44402. };
  44403. return {
  44404. handleDoubleClick,
  44405. handleClick,
  44406. handleContextMenu,
  44407. handleMouseEnter,
  44408. handleMouseLeave,
  44409. handleCellMouseEnter,
  44410. handleCellMouseLeave,
  44411. tooltipContent,
  44412. tooltipTrigger
  44413. };
  44414. }
  44415. //#endregion
  44416. //#region ../../packages/components/table/src/table-body/styles-helper.ts
  44417. function useStyles$1(props) {
  44418. const parent = inject(TABLE_INJECTION_KEY);
  44419. const ns = useNamespace("table");
  44420. const getRowStyle = (row, rowIndex) => {
  44421. const rowStyle = parent?.props.rowStyle;
  44422. if (isFunction$1(rowStyle)) return rowStyle.call(null, {
  44423. row,
  44424. rowIndex
  44425. });
  44426. return rowStyle || null;
  44427. };
  44428. const getRowClass = (row, rowIndex, displayIndex) => {
  44429. const classes = [ns.e("row")];
  44430. if (parent?.props.highlightCurrentRow && row === props.store?.states.currentRow.value) classes.push("current-row");
  44431. if (props.stripe && displayIndex % 2 === 1) classes.push(ns.em("row", "striped"));
  44432. const rowClassName = parent?.props.rowClassName;
  44433. if (isString(rowClassName)) classes.push(rowClassName);
  44434. else if (isFunction$1(rowClassName)) classes.push(rowClassName.call(null, {
  44435. row,
  44436. rowIndex
  44437. }));
  44438. return classes;
  44439. };
  44440. const getCellStyle = (rowIndex, columnIndex, row, column) => {
  44441. const cellStyle = parent?.props.cellStyle;
  44442. let cellStyles = cellStyle ?? {};
  44443. if (isFunction$1(cellStyle)) cellStyles = cellStyle.call(null, {
  44444. rowIndex,
  44445. columnIndex,
  44446. row,
  44447. column
  44448. });
  44449. const fixedStyle = getFixedColumnOffset(columnIndex, props?.fixed, props.store);
  44450. ensurePosition(fixedStyle, "left");
  44451. ensurePosition(fixedStyle, "right");
  44452. return Object.assign({}, cellStyles, fixedStyle);
  44453. };
  44454. const getCellClass = (rowIndex, columnIndex, row, column, offset) => {
  44455. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, props?.fixed, props.store, void 0, offset);
  44456. const classes = [
  44457. column.id,
  44458. column.align,
  44459. column.className,
  44460. ...fixedClasses
  44461. ];
  44462. const cellClassName = parent?.props.cellClassName;
  44463. if (isString(cellClassName)) classes.push(cellClassName);
  44464. else if (isFunction$1(cellClassName)) classes.push(cellClassName.call(null, {
  44465. rowIndex,
  44466. columnIndex,
  44467. row,
  44468. column
  44469. }));
  44470. classes.push(ns.e("cell"));
  44471. return classes.filter((className) => Boolean(className)).join(" ");
  44472. };
  44473. const getSpan = (row, column, rowIndex, columnIndex) => {
  44474. let rowspan = 1;
  44475. let colspan = 1;
  44476. const fn = parent?.props.spanMethod;
  44477. if (isFunction$1(fn)) {
  44478. const result = fn({
  44479. row,
  44480. column,
  44481. rowIndex,
  44482. columnIndex
  44483. });
  44484. if (isArray$1(result)) {
  44485. rowspan = result[0];
  44486. colspan = result[1];
  44487. } else if (isObject$1(result)) {
  44488. rowspan = result.rowspan;
  44489. colspan = result.colspan;
  44490. }
  44491. }
  44492. return {
  44493. rowspan,
  44494. colspan
  44495. };
  44496. };
  44497. const getColspanRealWidth = (columns, colspan, index) => {
  44498. if (colspan < 1) return columns[index].realWidth;
  44499. const widthArr = columns.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan);
  44500. return Number(widthArr.reduce((acc, width) => Number(acc) + Number(width), -1));
  44501. };
  44502. return {
  44503. getRowStyle,
  44504. getRowClass,
  44505. getCellStyle,
  44506. getCellClass,
  44507. getSpan,
  44508. getColspanRealWidth
  44509. };
  44510. }
  44511. //#endregion
  44512. //#region ../../packages/components/table/src/table-body/td-wrapper.vue?vue&type=script&setup=true&lang.ts
  44513. const _hoisted_1$16 = ["colspan", "rowspan"];
  44514. var td_wrapper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  44515. name: "TableTdWrapper",
  44516. __name: "td-wrapper",
  44517. props: {
  44518. colspan: {
  44519. type: Number,
  44520. default: 1
  44521. },
  44522. rowspan: {
  44523. type: Number,
  44524. default: 1
  44525. }
  44526. },
  44527. setup(__props) {
  44528. return (_ctx, _cache) => {
  44529. return openBlock(), createElementBlock("td", {
  44530. colspan: __props.colspan,
  44531. rowspan: __props.rowspan
  44532. }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$16);
  44533. };
  44534. }
  44535. });
  44536. //#endregion
  44537. //#region ../../packages/components/table/src/table-body/td-wrapper.vue
  44538. var td_wrapper_default = td_wrapper_vue_vue_type_script_setup_true_lang_default;
  44539. //#endregion
  44540. //#region ../../packages/components/table/src/table-body/render-helper.ts
  44541. function useRender$1(props) {
  44542. const parent = inject(TABLE_INJECTION_KEY);
  44543. const ns = useNamespace("table");
  44544. const { handleDoubleClick, handleClick, handleContextMenu, handleMouseEnter, handleMouseLeave, handleCellMouseEnter, handleCellMouseLeave, tooltipContent, tooltipTrigger } = useEvents(props);
  44545. const { getRowStyle, getRowClass, getCellStyle, getCellClass, getSpan, getColspanRealWidth } = useStyles$1(props);
  44546. let displayIndex = -1;
  44547. const firstDefaultColumnIndex = computed(() => {
  44548. return props.store?.states.columns.value.findIndex(({ type }) => type === "default");
  44549. });
  44550. const getKeyOfRow = (row, index) => {
  44551. const rowKey = (parent?.props)?.rowKey;
  44552. if (rowKey) return getRowIdentity(row, rowKey);
  44553. return index;
  44554. };
  44555. const rowRender = (row, $index, treeRowData, expanded = false) => {
  44556. const { tooltipEffect, tooltipOptions, store } = props;
  44557. const { indent, columns } = store.states;
  44558. const rowClasses = [];
  44559. let display = true;
  44560. if (treeRowData) {
  44561. rowClasses.push(ns.em("row", `level-${treeRowData.level}`));
  44562. display = !!treeRowData.display;
  44563. }
  44564. if ($index === 0) displayIndex = -1;
  44565. if (props.stripe && display) displayIndex++;
  44566. rowClasses.push(...getRowClass(row, $index, displayIndex));
  44567. return h("tr", {
  44568. style: [display ? null : { display: "none" }, getRowStyle(row, $index)],
  44569. class: rowClasses,
  44570. key: getKeyOfRow(row, $index),
  44571. onDblclick: ($event) => handleDoubleClick($event, row),
  44572. onClick: ($event) => handleClick($event, row),
  44573. onContextmenu: ($event) => handleContextMenu($event, row),
  44574. onMouseenter: () => handleMouseEnter($index),
  44575. onMouseleave: handleMouseLeave
  44576. }, columns.value.map((column, cellIndex) => {
  44577. const { rowspan, colspan } = getSpan(row, column, $index, cellIndex);
  44578. if (!rowspan || !colspan) return null;
  44579. const columnData = Object.assign({}, column);
  44580. columnData.realWidth = getColspanRealWidth(columns.value, colspan, cellIndex);
  44581. const data = {
  44582. store,
  44583. _self: props.context || parent,
  44584. column: columnData,
  44585. row,
  44586. $index,
  44587. cellIndex,
  44588. expanded
  44589. };
  44590. if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {
  44591. data.treeNode = {
  44592. indent: treeRowData.level && treeRowData.level * indent.value,
  44593. level: treeRowData.level
  44594. };
  44595. if (isBoolean(treeRowData.expanded)) {
  44596. data.treeNode.expanded = treeRowData.expanded;
  44597. if ("loading" in treeRowData) data.treeNode.loading = treeRowData.loading;
  44598. if ("noLazyChildren" in treeRowData) data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  44599. }
  44600. }
  44601. const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`;
  44602. const patchKey = columnData.columnKey || columnData.rawColumnKey || "";
  44603. const mergedTooltipOptions = column.showOverflowTooltip && merge({ effect: tooltipEffect }, tooltipOptions, column.showOverflowTooltip);
  44604. return h(td_wrapper_default, {
  44605. style: getCellStyle($index, cellIndex, row, column),
  44606. class: getCellClass($index, cellIndex, row, column, colspan - 1),
  44607. key: `${patchKey}${baseKey}`,
  44608. rowspan,
  44609. colspan,
  44610. onMouseenter: ($event) => handleCellMouseEnter($event, row, mergedTooltipOptions),
  44611. onMouseleave: handleCellMouseLeave
  44612. }, { default: () => cellChildren(cellIndex, column, data) });
  44613. }));
  44614. };
  44615. const cellChildren = (_cellIndex, column, data) => {
  44616. return column.renderCell(data);
  44617. };
  44618. const wrappedRowRender = (row, $index) => {
  44619. const store = props.store;
  44620. const { isRowExpanded, assertRowKey } = store;
  44621. const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } = store.states;
  44622. const columns = store.states.columns.value;
  44623. if (columns.some(({ type }) => type === "expand")) {
  44624. const expanded = isRowExpanded(row);
  44625. const tr = rowRender(row, $index, void 0, expanded);
  44626. const renderExpanded = parent?.renderExpanded;
  44627. if (!renderExpanded) {
  44628. console.error("[Element Error]renderExpanded is required.");
  44629. return tr;
  44630. }
  44631. const rows = [[tr]];
  44632. if (parent.props.preserveExpandedContent || expanded) rows[0].push(h("tr", {
  44633. key: `expanded-row__${tr.key}`,
  44634. style: { display: expanded ? "" : "none" }
  44635. }, [h("td", {
  44636. colspan: columns.length,
  44637. class: `${ns.e("cell")} ${ns.e("expanded-cell")}`
  44638. }, [renderExpanded({
  44639. row,
  44640. $index,
  44641. store,
  44642. expanded
  44643. })])]));
  44644. return rows;
  44645. } else if (Object.keys(treeData.value).length) {
  44646. assertRowKey();
  44647. const key = getRowIdentity(row, rowKey.value);
  44648. let cur = treeData.value[key];
  44649. let treeRowData = null;
  44650. if (cur) {
  44651. treeRowData = {
  44652. expanded: cur.expanded,
  44653. level: cur.level,
  44654. display: true,
  44655. noLazyChildren: void 0,
  44656. loading: void 0
  44657. };
  44658. if (isBoolean(cur.lazy)) {
  44659. if (treeRowData && isBoolean(cur.loaded) && cur.loaded) treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  44660. treeRowData.loading = cur.loading;
  44661. }
  44662. }
  44663. const tmp = [rowRender(row, $index, treeRowData ?? void 0)];
  44664. if (cur) {
  44665. let i = 0;
  44666. const traverse = (children, parent) => {
  44667. if (!(children && children.length && parent)) return;
  44668. children.forEach((node) => {
  44669. const innerTreeRowData = {
  44670. display: parent.display && parent.expanded,
  44671. level: parent.level + 1,
  44672. expanded: false,
  44673. noLazyChildren: false,
  44674. loading: false
  44675. };
  44676. const childKey = getRowIdentity(node, rowKey.value);
  44677. if (isPropAbsent(childKey)) throw new Error("For nested data item, row-key is required.");
  44678. cur = { ...treeData.value[childKey] };
  44679. if (cur) {
  44680. innerTreeRowData.expanded = cur.expanded;
  44681. cur.level = cur.level || innerTreeRowData.level;
  44682. cur.display = !!(cur.expanded && innerTreeRowData.display);
  44683. if (isBoolean(cur.lazy)) {
  44684. if (isBoolean(cur.loaded) && cur.loaded) innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  44685. innerTreeRowData.loading = cur.loading;
  44686. }
  44687. }
  44688. i++;
  44689. tmp.push(rowRender(node, $index + i, innerTreeRowData));
  44690. if (cur) traverse(lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value], cur);
  44691. });
  44692. };
  44693. cur.display = true;
  44694. traverse(lazyTreeNodeMap.value[key] || row[childrenColumnName.value], cur);
  44695. }
  44696. return tmp;
  44697. } else return rowRender(row, $index, void 0);
  44698. };
  44699. return {
  44700. wrappedRowRender,
  44701. tooltipContent,
  44702. tooltipTrigger
  44703. };
  44704. }
  44705. //#endregion
  44706. //#region ../../packages/components/table/src/table-body/defaults.ts
  44707. const defaultProps$1 = {
  44708. store: {
  44709. required: true,
  44710. type: Object
  44711. },
  44712. stripe: Boolean,
  44713. tooltipEffect: String,
  44714. tooltipOptions: { type: Object },
  44715. context: {
  44716. default: () => ({}),
  44717. type: Object
  44718. },
  44719. rowClassName: [String, Function],
  44720. rowStyle: [Object, Function],
  44721. fixed: {
  44722. type: String,
  44723. default: ""
  44724. },
  44725. highlight: Boolean
  44726. };
  44727. //#endregion
  44728. //#region ../../packages/components/table/src/table-body/index.ts
  44729. var table_body_default = defineComponent({
  44730. name: "ElTableBody",
  44731. props: defaultProps$1,
  44732. setup(props) {
  44733. const instance = getCurrentInstance();
  44734. const parent = inject(TABLE_INJECTION_KEY);
  44735. const ns = useNamespace("table");
  44736. const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender$1(props);
  44737. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  44738. const hoveredCellList = [];
  44739. watch(props.store?.states.hoverRow, (newVal, oldVal) => {
  44740. const el = instance?.vnode.el;
  44741. const rows = Array.from(el?.children || []).filter((e) => e?.classList.contains(`${ns.e("row")}`));
  44742. let rowNum = newVal;
  44743. const childNodes = rows[rowNum]?.childNodes;
  44744. if (childNodes?.length) {
  44745. let control = 0;
  44746. Array.from(childNodes).reduce((acc, item, index) => {
  44747. if (childNodes[index]?.colSpan > 1) control = childNodes[index]?.colSpan;
  44748. if (item.nodeName !== "TD" && control === 0) acc.push(index);
  44749. control > 0 && control--;
  44750. return acc;
  44751. }, []).forEach((rowIndex) => {
  44752. rowNum = newVal;
  44753. while (rowNum > 0) {
  44754. const preChildNodes = rows[rowNum - 1]?.childNodes;
  44755. if (preChildNodes[rowIndex] && preChildNodes[rowIndex].nodeName === "TD" && preChildNodes[rowIndex].rowSpan > 1) {
  44756. addClass(preChildNodes[rowIndex], "hover-cell");
  44757. hoveredCellList.push(preChildNodes[rowIndex]);
  44758. break;
  44759. }
  44760. rowNum--;
  44761. }
  44762. });
  44763. } else {
  44764. hoveredCellList.forEach((item) => removeClass(item, "hover-cell"));
  44765. hoveredCellList.length = 0;
  44766. }
  44767. if (!props.store?.states.isComplex.value || !isClient) return;
  44768. rAF(() => {
  44769. const oldRow = rows[oldVal];
  44770. const newRow = rows[newVal];
  44771. if (oldRow && !oldRow.classList.contains("hover-fixed-row")) removeClass(oldRow, "hover-row");
  44772. if (newRow) addClass(newRow, "hover-row");
  44773. });
  44774. });
  44775. onUnmounted(() => {
  44776. removePopper?.();
  44777. });
  44778. return {
  44779. ns,
  44780. onColumnsChange,
  44781. onScrollableChange,
  44782. wrappedRowRender,
  44783. tooltipContent,
  44784. tooltipTrigger
  44785. };
  44786. },
  44787. render() {
  44788. const { wrappedRowRender, store } = this;
  44789. return h("tbody", { tabIndex: -1 }, [(store?.states.data.value || []).reduce((acc, row) => {
  44790. return acc.concat(wrappedRowRender(row, acc.length));
  44791. }, [])]);
  44792. }
  44793. });
  44794. //#endregion
  44795. //#region ../../packages/components/table/src/table-footer/mapState-helper.ts
  44796. function useMapState() {
  44797. const store = inject(TABLE_INJECTION_KEY)?.store;
  44798. return {
  44799. leftFixedLeafCount: computed(() => {
  44800. return store?.states.fixedLeafColumnsLength.value ?? 0;
  44801. }),
  44802. rightFixedLeafCount: computed(() => {
  44803. return store?.states.rightFixedColumns.value.length ?? 0;
  44804. }),
  44805. columnsCount: computed(() => {
  44806. return store?.states.columns.value.length ?? 0;
  44807. }),
  44808. leftFixedCount: computed(() => {
  44809. return store?.states.fixedColumns.value.length ?? 0;
  44810. }),
  44811. rightFixedCount: computed(() => {
  44812. return store?.states.rightFixedColumns.value.length ?? 0;
  44813. }),
  44814. columns: computed(() => store?.states.columns.value ?? [])
  44815. };
  44816. }
  44817. //#endregion
  44818. //#region ../../packages/components/table/src/table-footer/style-helper.ts
  44819. function useStyle$1(props) {
  44820. const { columns } = useMapState();
  44821. const ns = useNamespace("table");
  44822. const getCellClasses = (columns, cellIndex) => {
  44823. const column = columns[cellIndex];
  44824. const classes = [
  44825. ns.e("cell"),
  44826. column.id,
  44827. column.align,
  44828. column.labelClassName,
  44829. ...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props.store)
  44830. ];
  44831. if (column.className) classes.push(column.className);
  44832. if (!column.children) classes.push(ns.is("leaf"));
  44833. return classes;
  44834. };
  44835. const getCellStyles = (column, cellIndex) => {
  44836. const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props.store);
  44837. ensurePosition(fixedStyle, "left");
  44838. ensurePosition(fixedStyle, "right");
  44839. return fixedStyle;
  44840. };
  44841. return {
  44842. getCellClasses,
  44843. getCellStyles,
  44844. columns
  44845. };
  44846. }
  44847. //#endregion
  44848. //#region ../../packages/components/table/src/table-footer/index.ts
  44849. var table_footer_default = defineComponent({
  44850. name: "ElTableFooter",
  44851. props: {
  44852. fixed: {
  44853. type: String,
  44854. default: ""
  44855. },
  44856. store: {
  44857. required: true,
  44858. type: Object
  44859. },
  44860. summaryMethod: Function,
  44861. sumText: String,
  44862. border: Boolean,
  44863. defaultSort: {
  44864. type: Object,
  44865. default: () => {
  44866. return {
  44867. prop: "",
  44868. order: ""
  44869. };
  44870. }
  44871. }
  44872. },
  44873. setup(props) {
  44874. const parent = inject(TABLE_INJECTION_KEY);
  44875. const ns = useNamespace("table");
  44876. const { getCellClasses, getCellStyles, columns } = useStyle$1(props);
  44877. const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent);
  44878. return {
  44879. ns,
  44880. onScrollableChange,
  44881. onColumnsChange,
  44882. getCellClasses,
  44883. getCellStyles,
  44884. columns
  44885. };
  44886. },
  44887. render() {
  44888. const { columns, getCellStyles, getCellClasses, summaryMethod, sumText } = this;
  44889. const data = this.store.states.data.value;
  44890. let sums = [];
  44891. if (summaryMethod) sums = summaryMethod({
  44892. columns,
  44893. data
  44894. });
  44895. else columns.forEach((column, index) => {
  44896. if (index === 0) {
  44897. sums[index] = sumText;
  44898. return;
  44899. }
  44900. const values = data.map((item) => Number(item[column.property]));
  44901. const precisions = [];
  44902. let notNumber = true;
  44903. values.forEach((value) => {
  44904. if (!Number.isNaN(+value)) {
  44905. notNumber = false;
  44906. const decimal = `${value}`.split(".")[1];
  44907. precisions.push(decimal ? decimal.length : 0);
  44908. }
  44909. });
  44910. const precision = Math.max.apply(null, precisions);
  44911. if (!notNumber) sums[index] = values.reduce((prev, curr) => {
  44912. const value = Number(curr);
  44913. if (!Number.isNaN(+value)) return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  44914. else return prev;
  44915. }, 0);
  44916. else sums[index] = "";
  44917. });
  44918. return h(h("tfoot", [h("tr", {}, [...columns.map((column, cellIndex) => h("td", {
  44919. key: cellIndex,
  44920. colspan: column.colSpan,
  44921. rowspan: column.rowSpan,
  44922. class: getCellClasses(columns, cellIndex),
  44923. style: getCellStyles(column, cellIndex)
  44924. }, [h("div", { class: ["cell", column.labelClassName] }, [sums[cellIndex]])]))])]));
  44925. }
  44926. });
  44927. //#endregion
  44928. //#region ../../packages/components/table/src/table/utils-helper.ts
  44929. function useUtils(store) {
  44930. const setCurrentRow = (row) => {
  44931. store.commit("setCurrentRow", row);
  44932. };
  44933. const getSelectionRows = () => {
  44934. return store.getSelectionRows();
  44935. };
  44936. const toggleRowSelection = (row, selected, ignoreSelectable = true) => {
  44937. store.toggleRowSelection(row, selected, false, ignoreSelectable);
  44938. store.updateAllSelected();
  44939. };
  44940. const clearSelection = () => {
  44941. store.clearSelection();
  44942. };
  44943. const clearFilter = (columnKeys) => {
  44944. store.clearFilter(columnKeys);
  44945. };
  44946. const toggleAllSelection = () => {
  44947. store.commit("toggleAllSelection");
  44948. };
  44949. const toggleRowExpansion = (row, expanded) => {
  44950. store.toggleRowExpansionAdapter(row, expanded);
  44951. };
  44952. const clearSort = () => {
  44953. store.clearSort();
  44954. };
  44955. const sort = (prop, order) => {
  44956. store.commit("sort", {
  44957. prop,
  44958. order
  44959. });
  44960. };
  44961. const updateKeyChildren = (key, data) => {
  44962. store.updateKeyChildren(key, data);
  44963. };
  44964. return {
  44965. setCurrentRow,
  44966. getSelectionRows,
  44967. toggleRowSelection,
  44968. clearSelection,
  44969. clearFilter,
  44970. toggleAllSelection,
  44971. toggleRowExpansion,
  44972. clearSort,
  44973. sort,
  44974. updateKeyChildren
  44975. };
  44976. }
  44977. //#endregion
  44978. //#region ../../packages/components/table/src/table/style-helper.ts
  44979. function useStyle(props, layout, store, table) {
  44980. const isHidden = ref(false);
  44981. const renderExpanded = ref(null);
  44982. const resizeProxyVisible = ref(false);
  44983. const setDragVisible = (visible) => {
  44984. resizeProxyVisible.value = visible;
  44985. };
  44986. const resizeState = ref({
  44987. width: null,
  44988. height: null,
  44989. headerHeight: null
  44990. });
  44991. const isGroup = ref(false);
  44992. const scrollbarViewStyle = {
  44993. display: "inline-block",
  44994. verticalAlign: "middle"
  44995. };
  44996. const tableWidth = ref();
  44997. const tableScrollHeight = ref(0);
  44998. const bodyScrollHeight = ref(0);
  44999. const headerScrollHeight = ref(0);
  45000. const footerScrollHeight = ref(0);
  45001. const appendScrollHeight = ref(0);
  45002. watch(() => props.height, (value) => {
  45003. layout.setHeight(value ?? null);
  45004. }, { immediate: true });
  45005. watch(() => props.maxHeight, (value) => {
  45006. layout.setMaxHeight(value ?? null);
  45007. }, { immediate: true });
  45008. watch(() => [props.currentRowKey, store.states.rowKey], ([currentRowKey, rowKey]) => {
  45009. if (!unref(rowKey) || !unref(currentRowKey)) return;
  45010. store.setCurrentRowKey(`${currentRowKey}`);
  45011. }, { immediate: true });
  45012. watch(() => props.data, (data) => {
  45013. table.store.commit("setData", data);
  45014. }, {
  45015. immediate: true,
  45016. deep: true
  45017. });
  45018. watchEffect(() => {
  45019. if (props.expandRowKeys) store.setExpandRowKeysAdapter(props.expandRowKeys);
  45020. });
  45021. const handleMouseLeave = () => {
  45022. table.store.commit("setHoverRow", null);
  45023. if (table.hoverState) table.hoverState = null;
  45024. };
  45025. const handleHeaderFooterMousewheel = (_event, data) => {
  45026. const { pixelX, pixelY } = data;
  45027. if (Math.abs(pixelX) >= Math.abs(pixelY)) table.refs.bodyWrapper.scrollLeft += data.pixelX / 5;
  45028. };
  45029. const shouldUpdateHeight = computed(() => {
  45030. return props.height || props.maxHeight || store.states.fixedColumns.value.length > 0 || store.states.rightFixedColumns.value.length > 0;
  45031. });
  45032. const tableBodyStyles = computed(() => {
  45033. return { width: layout.bodyWidth.value ? `${layout.bodyWidth.value}px` : "" };
  45034. });
  45035. const doLayout = () => {
  45036. if (shouldUpdateHeight.value) layout.updateElsHeight();
  45037. layout.updateColumnsWidth();
  45038. if (typeof window === "undefined") return;
  45039. requestAnimationFrame(syncPosition);
  45040. };
  45041. onMounted(async () => {
  45042. await nextTick();
  45043. store.updateColumns();
  45044. bindEvents();
  45045. requestAnimationFrame(doLayout);
  45046. const el = table.vnode.el;
  45047. const tableHeader = table.refs.headerWrapper;
  45048. if (props.flexible && el && el.parentElement) el.parentElement.style.minWidth = "0";
  45049. resizeState.value = {
  45050. width: tableWidth.value = el.offsetWidth,
  45051. height: el.offsetHeight,
  45052. headerHeight: props.showHeader && tableHeader ? tableHeader.offsetHeight : null
  45053. };
  45054. store.states.columns.value.forEach((column) => {
  45055. if (column.filteredValue && column.filteredValue.length) table.store.commit("filterChange", {
  45056. column,
  45057. values: column.filteredValue,
  45058. silent: true
  45059. });
  45060. });
  45061. table.$ready = true;
  45062. });
  45063. const setScrollClassByEl = (el, className) => {
  45064. if (!el) return;
  45065. const classList = Array.from(el.classList).filter((item) => !item.startsWith("is-scrolling-"));
  45066. classList.push(layout.scrollX.value ? className : "is-scrolling-none");
  45067. el.className = classList.join(" ");
  45068. };
  45069. const setScrollClass = (className) => {
  45070. const { tableWrapper } = table.refs;
  45071. setScrollClassByEl(tableWrapper, className);
  45072. };
  45073. const hasScrollClass = (className) => {
  45074. const { tableWrapper } = table.refs;
  45075. return !!(tableWrapper && tableWrapper.classList.contains(className));
  45076. };
  45077. const syncPosition = function() {
  45078. if (!table.refs.scrollBarRef) return;
  45079. if (!layout.scrollX.value) {
  45080. const scrollingNoneClass = "is-scrolling-none";
  45081. if (!hasScrollClass(scrollingNoneClass)) setScrollClass(scrollingNoneClass);
  45082. return;
  45083. }
  45084. const scrollContainer = table.refs.scrollBarRef.wrapRef;
  45085. if (!scrollContainer) return;
  45086. const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
  45087. const { headerWrapper, footerWrapper } = table.refs;
  45088. if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
  45089. if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
  45090. if (scrollLeft >= scrollWidth - offsetWidth - 1) setScrollClass("is-scrolling-right");
  45091. else if (scrollLeft === 0) setScrollClass("is-scrolling-left");
  45092. else setScrollClass("is-scrolling-middle");
  45093. };
  45094. const bindEvents = () => {
  45095. if (!table.refs.scrollBarRef) return;
  45096. if (table.refs.scrollBarRef.wrapRef) useEventListener(table.refs.scrollBarRef.wrapRef, "scroll", syncPosition, { passive: true });
  45097. if (props.fit) useResizeObserver(table.vnode.el, resizeListener);
  45098. else useEventListener(window, "resize", resizeListener);
  45099. useResizeObserver(table.refs.tableInnerWrapper, () => {
  45100. resizeListener();
  45101. table.refs?.scrollBarRef?.update();
  45102. });
  45103. };
  45104. const resizeListener = () => {
  45105. const el = table.vnode.el;
  45106. if (!table.$ready || !el) return;
  45107. let shouldUpdateLayout = false;
  45108. const { width: oldWidth, height: oldHeight, headerHeight: oldHeaderHeight } = resizeState.value;
  45109. const width = tableWidth.value = el.offsetWidth;
  45110. if (oldWidth !== width) shouldUpdateLayout = true;
  45111. const height = el.offsetHeight;
  45112. if ((props.height || shouldUpdateHeight.value) && oldHeight !== height) shouldUpdateLayout = true;
  45113. const tableHeader = props.tableLayout === "fixed" ? table.refs.headerWrapper : table.refs.tableHeaderRef?.$el;
  45114. if (props.showHeader && tableHeader?.offsetHeight !== oldHeaderHeight) shouldUpdateLayout = true;
  45115. tableScrollHeight.value = table.refs.tableWrapper?.scrollHeight || 0;
  45116. headerScrollHeight.value = tableHeader?.scrollHeight || 0;
  45117. footerScrollHeight.value = table.refs.footerWrapper?.offsetHeight || 0;
  45118. appendScrollHeight.value = table.refs.appendWrapper?.offsetHeight || 0;
  45119. bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value - appendScrollHeight.value;
  45120. if (shouldUpdateLayout) {
  45121. resizeState.value = {
  45122. width,
  45123. height,
  45124. headerHeight: props.showHeader && tableHeader?.offsetHeight || 0
  45125. };
  45126. doLayout();
  45127. }
  45128. };
  45129. const tableSize = useFormSize();
  45130. const bodyWidth = computed(() => {
  45131. const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout;
  45132. return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : "";
  45133. });
  45134. const tableLayout = computed(() => {
  45135. if (props.maxHeight) return "fixed";
  45136. return props.tableLayout;
  45137. });
  45138. return {
  45139. isHidden,
  45140. renderExpanded,
  45141. setDragVisible,
  45142. isGroup,
  45143. handleMouseLeave,
  45144. handleHeaderFooterMousewheel,
  45145. tableSize,
  45146. emptyBlockStyle: computed(() => {
  45147. if (props.data && props.data.length) return;
  45148. let height = "100%";
  45149. if (props.height && bodyScrollHeight.value) height = `${bodyScrollHeight.value}px`;
  45150. const width = tableWidth.value;
  45151. return {
  45152. width: width ? `${width}px` : "",
  45153. height
  45154. };
  45155. }),
  45156. resizeProxyVisible,
  45157. bodyWidth,
  45158. resizeState,
  45159. doLayout,
  45160. tableBodyStyles,
  45161. tableLayout,
  45162. scrollbarViewStyle,
  45163. scrollbarStyle: computed(() => {
  45164. if (props.height) return { height: "100%" };
  45165. if (props.maxHeight) if (!Number.isNaN(Number(props.maxHeight))) return { maxHeight: `${+props.maxHeight - headerScrollHeight.value - footerScrollHeight.value}px` };
  45166. else return { maxHeight: `calc(${props.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)` };
  45167. return {};
  45168. })
  45169. };
  45170. }
  45171. //#endregion
  45172. //#region ../../packages/components/table/src/table/key-render-helper.ts
  45173. function useKeyRender(table) {
  45174. let observer;
  45175. const initWatchDom = () => {
  45176. const columnsWrapper = table.vnode.el.querySelector(".hidden-columns");
  45177. const config = {
  45178. childList: true,
  45179. subtree: true
  45180. };
  45181. const updateOrderFns = table.store.states.updateOrderFns;
  45182. observer = new MutationObserver(() => {
  45183. updateOrderFns.forEach((fn) => fn());
  45184. });
  45185. observer.observe(columnsWrapper, config);
  45186. };
  45187. onMounted(() => {
  45188. initWatchDom();
  45189. });
  45190. onUnmounted(() => {
  45191. observer?.disconnect();
  45192. });
  45193. }
  45194. //#endregion
  45195. //#region ../../packages/components/table/src/table/defaults.ts
  45196. var defaults_default$2 = {
  45197. data: {
  45198. type: Array,
  45199. default: () => []
  45200. },
  45201. size: useSizeProp,
  45202. width: [String, Number],
  45203. height: [String, Number],
  45204. maxHeight: [String, Number],
  45205. fit: {
  45206. type: Boolean,
  45207. default: true
  45208. },
  45209. stripe: Boolean,
  45210. border: Boolean,
  45211. rowKey: [String, Function],
  45212. showHeader: {
  45213. type: Boolean,
  45214. default: true
  45215. },
  45216. showSummary: Boolean,
  45217. sumText: String,
  45218. summaryMethod: Function,
  45219. rowClassName: [String, Function],
  45220. rowStyle: [Object, Function],
  45221. cellClassName: [String, Function],
  45222. cellStyle: [Object, Function],
  45223. headerRowClassName: [String, Function],
  45224. headerRowStyle: [Object, Function],
  45225. headerCellClassName: [String, Function],
  45226. headerCellStyle: [Object, Function],
  45227. highlightCurrentRow: Boolean,
  45228. currentRowKey: [String, Number],
  45229. emptyText: String,
  45230. expandRowKeys: Array,
  45231. defaultExpandAll: Boolean,
  45232. rowExpandable: { type: Function },
  45233. defaultSort: Object,
  45234. tooltipEffect: String,
  45235. tooltipOptions: Object,
  45236. spanMethod: Function,
  45237. selectOnIndeterminate: {
  45238. type: Boolean,
  45239. default: true
  45240. },
  45241. indent: {
  45242. type: Number,
  45243. default: 16
  45244. },
  45245. treeProps: {
  45246. type: Object,
  45247. default: () => {
  45248. return {
  45249. hasChildren: "hasChildren",
  45250. children: "children",
  45251. checkStrictly: false
  45252. };
  45253. }
  45254. },
  45255. lazy: Boolean,
  45256. load: Function,
  45257. style: {
  45258. type: [
  45259. String,
  45260. Object,
  45261. Array
  45262. ],
  45263. default: () => ({})
  45264. },
  45265. className: {
  45266. type: String,
  45267. default: ""
  45268. },
  45269. tableLayout: {
  45270. type: String,
  45271. default: "fixed"
  45272. },
  45273. scrollbarAlwaysOn: Boolean,
  45274. flexible: Boolean,
  45275. showOverflowTooltip: {
  45276. type: [Boolean, Object],
  45277. default: void 0
  45278. },
  45279. tooltipFormatter: Function,
  45280. appendFilterPanelTo: String,
  45281. scrollbarTabindex: {
  45282. type: [Number, String],
  45283. default: void 0
  45284. },
  45285. allowDragLastColumn: {
  45286. type: Boolean,
  45287. default: true
  45288. },
  45289. preserveExpandedContent: Boolean,
  45290. nativeScrollbar: Boolean
  45291. };
  45292. //#endregion
  45293. //#region ../../packages/components/table/src/h-helper.ts
  45294. function hColgroup(props) {
  45295. const isAuto = props.tableLayout === "auto";
  45296. let columns = props.columns || [];
  45297. if (isAuto) {
  45298. if (columns.every(({ width }) => isUndefined(width))) columns = [];
  45299. }
  45300. const getPropsData = (column) => {
  45301. const propsData = {
  45302. key: `${props.tableLayout}_${column.id}`,
  45303. style: {},
  45304. name: void 0
  45305. };
  45306. if (isAuto) propsData.style = { width: `${column.width}px` };
  45307. else propsData.name = column.id;
  45308. return propsData;
  45309. };
  45310. return h("colgroup", {}, columns.map((column) => h("col", getPropsData(column))));
  45311. }
  45312. hColgroup.props = ["columns", "tableLayout"];
  45313. //#endregion
  45314. //#region ../../packages/components/table/src/composables/use-scrollbar.ts
  45315. const useScrollbar$1 = () => {
  45316. const scrollBarRef = ref();
  45317. const scrollTo = (options, yCoord) => {
  45318. const scrollbar = scrollBarRef.value;
  45319. if (scrollbar) scrollbar.scrollTo(options, yCoord);
  45320. };
  45321. const setScrollPosition = (position, offset) => {
  45322. const scrollbar = scrollBarRef.value;
  45323. if (scrollbar && isNumber(offset) && ["Top", "Left"].includes(position)) scrollbar[`setScroll${position}`](offset);
  45324. };
  45325. const setScrollTop = (top) => setScrollPosition("Top", top);
  45326. const setScrollLeft = (left) => setScrollPosition("Left", left);
  45327. return {
  45328. scrollBarRef,
  45329. scrollTo,
  45330. setScrollTop,
  45331. setScrollLeft
  45332. };
  45333. };
  45334. //#endregion
  45335. //#region ../../packages/components/table/src/table.vue?vue&type=script&lang.ts
  45336. let tableIdSeed = 1;
  45337. var table_vue_vue_type_script_lang_default = defineComponent({
  45338. name: "ElTable",
  45339. directives: { Mousewheel },
  45340. components: {
  45341. TableHeader: table_header_default,
  45342. TableBody: table_body_default,
  45343. TableFooter: table_footer_default,
  45344. ElScrollbar,
  45345. hColgroup
  45346. },
  45347. props: defaults_default$2,
  45348. emits: [
  45349. "select",
  45350. "select-all",
  45351. "selection-change",
  45352. "cell-mouse-enter",
  45353. "cell-mouse-leave",
  45354. "cell-contextmenu",
  45355. "cell-click",
  45356. "cell-dblclick",
  45357. "row-click",
  45358. "row-contextmenu",
  45359. "row-dblclick",
  45360. "header-click",
  45361. "header-contextmenu",
  45362. "sort-change",
  45363. "filter-change",
  45364. "current-change",
  45365. "header-dragend",
  45366. "expand-change",
  45367. "scroll"
  45368. ],
  45369. setup(props) {
  45370. const { t } = useLocale();
  45371. const ns = useNamespace("table");
  45372. const globalConfig = useGlobalConfig("table");
  45373. const table = getCurrentInstance();
  45374. provide(TABLE_INJECTION_KEY, table);
  45375. const store = createStore(table, props);
  45376. table.store = store;
  45377. const layout = new TableLayout({
  45378. store: table.store,
  45379. table,
  45380. fit: props.fit,
  45381. showHeader: props.showHeader
  45382. });
  45383. table.layout = layout;
  45384. const isEmpty = computed(() => (store.states.data.value || []).length === 0);
  45385. /**
  45386. * open functions
  45387. */
  45388. const { setCurrentRow, getSelectionRows, toggleRowSelection, clearSelection, clearFilter, toggleAllSelection, toggleRowExpansion, clearSort, sort, updateKeyChildren } = useUtils(store);
  45389. const { isHidden, renderExpanded, setDragVisible, isGroup, handleMouseLeave, handleHeaderFooterMousewheel, tableSize, emptyBlockStyle, resizeProxyVisible, bodyWidth, resizeState, doLayout, tableBodyStyles, tableLayout, scrollbarViewStyle, scrollbarStyle } = useStyle(props, layout, store, table);
  45390. const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } = useScrollbar$1();
  45391. const debouncedUpdateLayout = debounce(doLayout, 50);
  45392. const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;
  45393. table.tableId = tableId;
  45394. table.state = {
  45395. isGroup,
  45396. resizeState,
  45397. doLayout,
  45398. debouncedUpdateLayout
  45399. };
  45400. const computedSumText = computed(() => props.sumText ?? t("el.table.sumText"));
  45401. const computedEmptyText = computed(() => {
  45402. return props.emptyText ?? t("el.table.emptyText");
  45403. });
  45404. const computedTooltipEffect = computed(() => props.tooltipEffect ?? globalConfig.value?.tooltipEffect);
  45405. const computedTooltipOptions = computed(() => props.tooltipOptions ?? globalConfig.value?.tooltipOptions);
  45406. const columns = computed(() => {
  45407. return convertToRows(store.states.originColumns.value)[0];
  45408. });
  45409. useKeyRender(table);
  45410. onBeforeUnmount(() => {
  45411. debouncedUpdateLayout.cancel();
  45412. });
  45413. return {
  45414. ns,
  45415. layout,
  45416. store,
  45417. columns,
  45418. handleHeaderFooterMousewheel,
  45419. handleMouseLeave,
  45420. tableId,
  45421. tableSize,
  45422. isHidden,
  45423. isEmpty,
  45424. renderExpanded,
  45425. resizeProxyVisible,
  45426. resizeState,
  45427. isGroup,
  45428. bodyWidth,
  45429. tableBodyStyles,
  45430. emptyBlockStyle,
  45431. debouncedUpdateLayout,
  45432. setCurrentRow,
  45433. getSelectionRows,
  45434. toggleRowSelection,
  45435. clearSelection,
  45436. clearFilter,
  45437. toggleAllSelection,
  45438. toggleRowExpansion,
  45439. clearSort,
  45440. doLayout,
  45441. sort,
  45442. updateKeyChildren,
  45443. t,
  45444. setDragVisible,
  45445. context: table,
  45446. computedSumText,
  45447. computedEmptyText,
  45448. computedTooltipEffect,
  45449. computedTooltipOptions,
  45450. tableLayout,
  45451. scrollbarViewStyle,
  45452. scrollbarStyle,
  45453. scrollBarRef,
  45454. scrollTo,
  45455. setScrollLeft,
  45456. setScrollTop,
  45457. allowDragLastColumn: props.allowDragLastColumn
  45458. };
  45459. }
  45460. });
  45461. //#endregion
  45462. //#region ../../packages/components/table/src/table.vue
  45463. const _hoisted_1$15 = ["data-prefix"];
  45464. const _hoisted_2$9 = {
  45465. ref: "hiddenColumns",
  45466. class: "hidden-columns"
  45467. };
  45468. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  45469. const _component_hColgroup = resolveComponent("hColgroup");
  45470. const _component_table_header = resolveComponent("table-header");
  45471. const _component_table_body = resolveComponent("table-body");
  45472. const _component_table_footer = resolveComponent("table-footer");
  45473. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  45474. const _directive_mousewheel = resolveDirective("mousewheel");
  45475. return openBlock(), createElementBlock("div", {
  45476. ref: "tableWrapper",
  45477. class: normalizeClass([
  45478. {
  45479. [_ctx.ns.m("fit")]: _ctx.fit,
  45480. [_ctx.ns.m("striped")]: _ctx.stripe,
  45481. [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
  45482. [_ctx.ns.m("hidden")]: _ctx.isHidden,
  45483. [_ctx.ns.m("group")]: _ctx.isGroup,
  45484. [_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
  45485. [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
  45486. [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
  45487. [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
  45488. [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
  45489. "has-footer": _ctx.showSummary
  45490. },
  45491. _ctx.ns.m(_ctx.tableSize),
  45492. _ctx.className,
  45493. _ctx.ns.b(),
  45494. _ctx.ns.m(`layout-${_ctx.tableLayout}`)
  45495. ]),
  45496. style: normalizeStyle(_ctx.style),
  45497. "data-prefix": _ctx.ns.namespace.value,
  45498. onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args))
  45499. }, [createElementVNode("div", {
  45500. ref: "tableInnerWrapper",
  45501. class: normalizeClass(_ctx.ns.e("inner-wrapper"))
  45502. }, [
  45503. createElementVNode("div", _hoisted_2$9, [renderSlot(_ctx.$slots, "default")], 512),
  45504. _ctx.showHeader && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
  45505. key: 0,
  45506. ref: "headerWrapper",
  45507. class: normalizeClass(_ctx.ns.e("header-wrapper"))
  45508. }, [createElementVNode("table", {
  45509. ref: "tableHeader",
  45510. class: normalizeClass(_ctx.ns.e("header")),
  45511. style: normalizeStyle(_ctx.tableBodyStyles),
  45512. border: "0",
  45513. cellpadding: "0",
  45514. cellspacing: "0"
  45515. }, [createVNode(_component_hColgroup, {
  45516. columns: _ctx.store.states.columns.value,
  45517. "table-layout": _ctx.tableLayout
  45518. }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_header, {
  45519. ref: "tableHeaderRef",
  45520. border: _ctx.border,
  45521. "default-sort": _ctx.defaultSort,
  45522. store: _ctx.store,
  45523. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  45524. "allow-drag-last-column": _ctx.allowDragLastColumn,
  45525. onSetDragVisible: _ctx.setDragVisible
  45526. }, null, 8, [
  45527. "border",
  45528. "default-sort",
  45529. "store",
  45530. "append-filter-panel-to",
  45531. "allow-drag-last-column",
  45532. "onSetDragVisible"
  45533. ])], 6)], 2)), [[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true),
  45534. createElementVNode("div", {
  45535. ref: "bodyWrapper",
  45536. class: normalizeClass(_ctx.ns.e("body-wrapper"))
  45537. }, [createVNode(_component_el_scrollbar, {
  45538. ref: "scrollBarRef",
  45539. "view-style": _ctx.scrollbarViewStyle,
  45540. "wrap-style": _ctx.scrollbarStyle,
  45541. always: _ctx.scrollbarAlwaysOn,
  45542. tabindex: _ctx.scrollbarTabindex,
  45543. native: _ctx.nativeScrollbar,
  45544. onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event))
  45545. }, {
  45546. default: withCtx(() => [
  45547. createElementVNode("table", {
  45548. ref: "tableBody",
  45549. class: normalizeClass(_ctx.ns.e("body")),
  45550. cellspacing: "0",
  45551. cellpadding: "0",
  45552. border: "0",
  45553. style: normalizeStyle({
  45554. width: _ctx.bodyWidth,
  45555. tableLayout: _ctx.tableLayout
  45556. })
  45557. }, [
  45558. createVNode(_component_hColgroup, {
  45559. columns: _ctx.store.states.columns.value,
  45560. "table-layout": _ctx.tableLayout
  45561. }, null, 8, ["columns", "table-layout"]),
  45562. _ctx.showHeader && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_header, {
  45563. key: 0,
  45564. ref: "tableHeaderRef",
  45565. class: normalizeClass(_ctx.ns.e("body-header")),
  45566. border: _ctx.border,
  45567. "default-sort": _ctx.defaultSort,
  45568. store: _ctx.store,
  45569. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  45570. onSetDragVisible: _ctx.setDragVisible
  45571. }, null, 8, [
  45572. "class",
  45573. "border",
  45574. "default-sort",
  45575. "store",
  45576. "append-filter-panel-to",
  45577. "onSetDragVisible"
  45578. ])) : createCommentVNode("v-if", true),
  45579. createVNode(_component_table_body, {
  45580. context: _ctx.context,
  45581. highlight: _ctx.highlightCurrentRow,
  45582. "row-class-name": _ctx.rowClassName,
  45583. "tooltip-effect": _ctx.computedTooltipEffect,
  45584. "tooltip-options": _ctx.computedTooltipOptions,
  45585. "row-style": _ctx.rowStyle,
  45586. store: _ctx.store,
  45587. stripe: _ctx.stripe
  45588. }, null, 8, [
  45589. "context",
  45590. "highlight",
  45591. "row-class-name",
  45592. "tooltip-effect",
  45593. "tooltip-options",
  45594. "row-style",
  45595. "store",
  45596. "stripe"
  45597. ]),
  45598. _ctx.showSummary && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_footer, {
  45599. key: 1,
  45600. class: normalizeClass(_ctx.ns.e("body-footer")),
  45601. border: _ctx.border,
  45602. "default-sort": _ctx.defaultSort,
  45603. store: _ctx.store,
  45604. "sum-text": _ctx.computedSumText,
  45605. "summary-method": _ctx.summaryMethod
  45606. }, null, 8, [
  45607. "class",
  45608. "border",
  45609. "default-sort",
  45610. "store",
  45611. "sum-text",
  45612. "summary-method"
  45613. ])) : createCommentVNode("v-if", true)
  45614. ], 6),
  45615. _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
  45616. key: 0,
  45617. ref: "emptyBlock",
  45618. style: normalizeStyle(_ctx.emptyBlockStyle),
  45619. class: normalizeClass(_ctx.ns.e("empty-block"))
  45620. }, [createElementVNode("span", { class: normalizeClass(_ctx.ns.e("empty-text")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.computedEmptyText), 1)])], 2)], 6)) : createCommentVNode("v-if", true),
  45621. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  45622. key: 1,
  45623. ref: "appendWrapper",
  45624. class: normalizeClass(_ctx.ns.e("append-wrapper"))
  45625. }, [renderSlot(_ctx.$slots, "append")], 2)) : createCommentVNode("v-if", true)
  45626. ]),
  45627. _: 3
  45628. }, 8, [
  45629. "view-style",
  45630. "wrap-style",
  45631. "always",
  45632. "tabindex",
  45633. "native"
  45634. ])], 2),
  45635. _ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
  45636. key: 1,
  45637. ref: "footerWrapper",
  45638. class: normalizeClass(_ctx.ns.e("footer-wrapper"))
  45639. }, [createElementVNode("table", {
  45640. class: normalizeClass(_ctx.ns.e("footer")),
  45641. cellspacing: "0",
  45642. cellpadding: "0",
  45643. border: "0",
  45644. style: normalizeStyle(_ctx.tableBodyStyles)
  45645. }, [createVNode(_component_hColgroup, {
  45646. columns: _ctx.store.states.columns.value,
  45647. "table-layout": _ctx.tableLayout
  45648. }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_footer, {
  45649. border: _ctx.border,
  45650. "default-sort": _ctx.defaultSort,
  45651. store: _ctx.store,
  45652. "sum-text": _ctx.computedSumText,
  45653. "summary-method": _ctx.summaryMethod
  45654. }, null, 8, [
  45655. "border",
  45656. "default-sort",
  45657. "store",
  45658. "sum-text",
  45659. "summary-method"
  45660. ])], 6)], 2)), [[vShow, !_ctx.isEmpty], [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true),
  45661. _ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock("div", {
  45662. key: 2,
  45663. class: normalizeClass(_ctx.ns.e("border-left-patch"))
  45664. }, null, 2)) : createCommentVNode("v-if", true)
  45665. ], 2), withDirectives(createElementVNode("div", {
  45666. ref: "resizeProxy",
  45667. class: normalizeClass(_ctx.ns.e("column-resize-proxy"))
  45668. }, null, 2), [[vShow, _ctx.resizeProxyVisible]])], 46, _hoisted_1$15);
  45669. }
  45670. var table_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_vue_vue_type_script_lang_default, [["render", _sfc_render$3]]);
  45671. //#endregion
  45672. //#region ../../packages/components/table/src/config.ts
  45673. const defaultClassNames = {
  45674. selection: "table-column--selection",
  45675. expand: "table__expand-column"
  45676. };
  45677. const cellStarts = {
  45678. default: { order: "" },
  45679. selection: {
  45680. width: 48,
  45681. minWidth: 48,
  45682. realWidth: 48,
  45683. order: ""
  45684. },
  45685. expand: {
  45686. width: 48,
  45687. minWidth: 48,
  45688. realWidth: 48,
  45689. order: ""
  45690. },
  45691. index: {
  45692. width: 48,
  45693. minWidth: 48,
  45694. realWidth: 48,
  45695. order: ""
  45696. }
  45697. };
  45698. const getDefaultClassName = (type) => {
  45699. return defaultClassNames[type] || "";
  45700. };
  45701. const cellForced = {
  45702. selection: {
  45703. renderHeader({ store }) {
  45704. function isDisabled() {
  45705. return store.states.data.value && store.states.data.value.length === 0;
  45706. }
  45707. return h(ElCheckbox, {
  45708. disabled: isDisabled(),
  45709. size: store.states.tableSize.value,
  45710. indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value,
  45711. "onUpdate:modelValue": store.toggleAllSelection ?? void 0,
  45712. modelValue: store.states.isAllSelected.value,
  45713. ariaLabel: store.t("el.table.selectAllLabel")
  45714. });
  45715. },
  45716. renderCell({ row, column, store, $index }) {
  45717. return h(ElCheckbox, {
  45718. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false,
  45719. size: store.states.tableSize.value,
  45720. onChange: () => {
  45721. store.commit("rowSelectedChanged", row);
  45722. },
  45723. onClick: (event) => event.stopPropagation(),
  45724. modelValue: store.isSelected(row),
  45725. ariaLabel: store.t("el.table.selectRowLabel")
  45726. });
  45727. },
  45728. sortable: false,
  45729. resizable: false
  45730. },
  45731. index: {
  45732. renderHeader({ column }) {
  45733. return column.label || "#";
  45734. },
  45735. renderCell({ column, $index }) {
  45736. let i = $index + 1;
  45737. const index = column.index;
  45738. if (isNumber(index)) i = $index + index;
  45739. else if (isFunction$1(index)) i = index($index);
  45740. return h("div", {}, [i]);
  45741. },
  45742. sortable: false
  45743. },
  45744. expand: {
  45745. renderHeader({ column }) {
  45746. return column.label || "";
  45747. },
  45748. renderCell({ column, row, store, expanded, $index }) {
  45749. const { ns } = store;
  45750. const classes = [ns.e("expand-icon")];
  45751. if (!column.renderExpand && expanded) classes.push(ns.em("expand-icon", "expanded"));
  45752. const callback = function(e) {
  45753. e.stopPropagation();
  45754. store.toggleRowExpansion(row);
  45755. };
  45756. const isRowExpandable = store.states.rowExpandable.value?.(row, $index) ?? true;
  45757. if (!isRowExpandable) classes.push(ns.is("disabled"));
  45758. return h("button", {
  45759. type: "button",
  45760. disabled: !isRowExpandable,
  45761. "aria-label": store.t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  45762. "aria-expanded": expanded,
  45763. class: classes,
  45764. onClick: callback
  45765. }, { default: () => {
  45766. if (column.renderExpand) return [column.renderExpand({
  45767. expanded,
  45768. expandable: isRowExpandable
  45769. })];
  45770. return [h(ElIcon, null, { default: () => {
  45771. return [h(arrow_right_default)];
  45772. } })];
  45773. } });
  45774. },
  45775. sortable: false,
  45776. resizable: false
  45777. }
  45778. };
  45779. function defaultRenderCell({ row, column, $index }) {
  45780. const property = column.property;
  45781. const value = property && getProp(row, property).value;
  45782. if (column && column.formatter) return column.formatter(row, column, value, $index);
  45783. return value?.toString?.() || "";
  45784. }
  45785. function treeCellPrefix({ row, treeNode, store }, createPlaceholder = false) {
  45786. const { ns } = store;
  45787. if (!treeNode) {
  45788. if (createPlaceholder) return [h("span", { class: ns.e("placeholder") })];
  45789. return null;
  45790. }
  45791. const ele = [];
  45792. const callback = function(e) {
  45793. e.stopPropagation();
  45794. if (treeNode.loading) return;
  45795. store.loadOrToggle(row);
  45796. };
  45797. if (treeNode.indent) ele.push(h("span", {
  45798. class: ns.e("indent"),
  45799. style: { "padding-left": `${treeNode.indent}px` }
  45800. }));
  45801. if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) {
  45802. const expandClasses = [ns.e("expand-icon"), treeNode.expanded ? ns.em("expand-icon", "expanded") : ""];
  45803. let icon = arrow_right_default;
  45804. if (treeNode.loading) icon = loading_default;
  45805. ele.push(h("button", {
  45806. type: "button",
  45807. "aria-label": store.t(treeNode.expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  45808. "aria-expanded": treeNode.expanded,
  45809. class: expandClasses,
  45810. onClick: callback
  45811. }, { default: () => {
  45812. return [h(ElIcon, { class: ns.is("loading", treeNode.loading) }, { default: () => [h(icon)] })];
  45813. } }));
  45814. } else ele.push(h("span", { class: ns.e("placeholder") }));
  45815. return ele;
  45816. }
  45817. //#endregion
  45818. //#region ../../packages/components/table/src/table-column/watcher-helper.ts
  45819. function getAllAliases(props, aliases) {
  45820. return props.reduce((prev, cur) => {
  45821. prev[cur] = cur;
  45822. return prev;
  45823. }, aliases);
  45824. }
  45825. function useWatcher(owner, props_) {
  45826. const instance = getCurrentInstance();
  45827. const registerComplexWatchers = () => {
  45828. const props = ["fixed"];
  45829. const aliases = {
  45830. realWidth: "width",
  45831. realMinWidth: "minWidth"
  45832. };
  45833. const allAliases = getAllAliases(props, aliases);
  45834. Object.keys(allAliases).forEach((key) => {
  45835. const columnKey = aliases[key];
  45836. if (hasOwn(props_, columnKey)) watch(() => props_[columnKey], (newVal) => {
  45837. let value = newVal;
  45838. if (columnKey === "width" && key === "realWidth") value = parseWidth(newVal);
  45839. if (columnKey === "minWidth" && key === "realMinWidth") value = parseMinWidth(newVal);
  45840. instance.columnConfig.value[columnKey] = value;
  45841. instance.columnConfig.value[key] = value;
  45842. const updateColumns = columnKey === "fixed";
  45843. owner.value.store.scheduleLayout(updateColumns);
  45844. });
  45845. });
  45846. };
  45847. const registerNormalWatchers = () => {
  45848. const props = [
  45849. "label",
  45850. "filters",
  45851. "filterMultiple",
  45852. "filteredValue",
  45853. "sortable",
  45854. "index",
  45855. "formatter",
  45856. "className",
  45857. "labelClassName",
  45858. "filterClassName",
  45859. "showOverflowTooltip",
  45860. "tooltipFormatter",
  45861. "resizable"
  45862. ];
  45863. const parentProps = ["showOverflowTooltip"];
  45864. const aliases = {
  45865. property: "prop",
  45866. align: "realAlign",
  45867. headerAlign: "realHeaderAlign"
  45868. };
  45869. const allAliases = getAllAliases(props, aliases);
  45870. Object.keys(allAliases).forEach((key) => {
  45871. const columnKey = aliases[key];
  45872. if (hasOwn(props_, columnKey)) watch(() => props_[columnKey], (newVal) => {
  45873. instance.columnConfig.value[key] = newVal;
  45874. if (key === "filters" || key === "filterMethod") instance.columnConfig.value["filterable"] = !!(instance.columnConfig.value["filters"] || instance.columnConfig.value["filterMethod"]);
  45875. });
  45876. });
  45877. parentProps.forEach((key) => {
  45878. if (hasOwn(owner.value.props, key)) watch(() => owner.value.props[key], (newVal) => {
  45879. if (instance.columnConfig.value.type === "selection") return;
  45880. if (!isUndefined(props_[key])) return;
  45881. instance.columnConfig.value[key] = newVal;
  45882. });
  45883. });
  45884. const globalConfig = useGlobalConfig("table");
  45885. if (globalConfig.value && hasOwn(globalConfig.value, "showOverflowTooltip")) watch(() => globalConfig.value?.showOverflowTooltip, (newVal) => {
  45886. if (instance.columnConfig.value.type === "selection") return;
  45887. if (!isUndefined(props_.showOverflowTooltip) || !isUndefined(owner.value.props.showOverflowTooltip)) return;
  45888. instance.columnConfig.value.showOverflowTooltip = newVal;
  45889. });
  45890. };
  45891. return {
  45892. registerComplexWatchers,
  45893. registerNormalWatchers
  45894. };
  45895. }
  45896. //#endregion
  45897. //#region ../../packages/components/table/src/table-column/render-helper.ts
  45898. function useRender(props, slots, owner) {
  45899. const instance = getCurrentInstance();
  45900. const columnId = ref("");
  45901. const isSubColumn = ref(false);
  45902. const realAlign = ref();
  45903. const realHeaderAlign = ref();
  45904. const ns = useNamespace("table");
  45905. watchEffect(() => {
  45906. realAlign.value = props.align ? `is-${props.align}` : null;
  45907. realAlign.value;
  45908. });
  45909. watchEffect(() => {
  45910. realHeaderAlign.value = props.headerAlign ? `is-${props.headerAlign}` : realAlign.value;
  45911. realHeaderAlign.value;
  45912. });
  45913. const columnOrTableParent = computed(() => {
  45914. let parent = instance.vnode.vParent || instance.parent;
  45915. while (parent && !parent.tableId && !parent.columnId) parent = parent.vnode.vParent || parent.parent;
  45916. return parent;
  45917. });
  45918. const hasTreeColumn = computed(() => {
  45919. const { store } = instance.parent;
  45920. if (!store) return false;
  45921. const { treeData } = store.states;
  45922. const treeDataValue = treeData.value;
  45923. return treeDataValue && Object.keys(treeDataValue).length > 0;
  45924. });
  45925. const realWidth = ref(parseWidth(props.width));
  45926. const realMinWidth = ref(parseMinWidth(props.minWidth));
  45927. const setColumnWidth = (column) => {
  45928. if (realWidth.value) column.width = realWidth.value;
  45929. if (realMinWidth.value) column.minWidth = realMinWidth.value;
  45930. if (!realWidth.value && realMinWidth.value) column.width = void 0;
  45931. if (!column.minWidth) column.minWidth = 80;
  45932. column.realWidth = Number(isUndefined(column.width) ? column.minWidth : column.width);
  45933. return column;
  45934. };
  45935. const setColumnForcedProps = (column) => {
  45936. const type = column.type;
  45937. const source = cellForced[type] || {};
  45938. Object.keys(source).forEach((prop) => {
  45939. const value = source[prop];
  45940. if (prop !== "className" && !isUndefined(value)) column[prop] = value;
  45941. });
  45942. const className = getDefaultClassName(type);
  45943. if (className) {
  45944. const forceClass = `${unref(ns.namespace)}-${className}`;
  45945. column.className = column.className ? `${column.className} ${forceClass}` : forceClass;
  45946. }
  45947. return column;
  45948. };
  45949. const checkSubColumn = (children) => {
  45950. if (isArray$1(children)) children.forEach((child) => check(child));
  45951. else check(children);
  45952. function check(item) {
  45953. if (item?.type?.name === "ElTableColumn") item.vParent = instance;
  45954. }
  45955. };
  45956. const setColumnRenders = (column) => {
  45957. if (props.renderHeader) /* @__PURE__ */ debugWarn("TableColumn", "Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.");
  45958. else if (column.type !== "selection") column.renderHeader = (scope) => {
  45959. instance.columnConfig.value["label"];
  45960. if (slots.header) {
  45961. const slotResult = slots.header(scope);
  45962. if (ensureValidVNode(slotResult)) return h(Fragment, slotResult);
  45963. }
  45964. return createTextVNode(column.label);
  45965. };
  45966. if (slots["filter-icon"]) column.renderFilterIcon = (scope) => {
  45967. return renderSlot(slots, "filter-icon", scope);
  45968. };
  45969. if (slots.expand) column.renderExpand = (scope) => {
  45970. return renderSlot(slots, "expand", scope);
  45971. };
  45972. let originRenderCell = column.renderCell;
  45973. if (column.type === "expand") {
  45974. column.renderCell = (data) => h("div", { class: "cell" }, [originRenderCell(data)]);
  45975. owner.value.renderExpanded = (row) => {
  45976. return slots.default ? slots.default(row) : slots.default;
  45977. };
  45978. } else {
  45979. originRenderCell = originRenderCell || defaultRenderCell;
  45980. column.renderCell = (data) => {
  45981. let children = null;
  45982. if (slots.default) {
  45983. const vnodes = slots.default(data);
  45984. children = vnodes.some((v) => v.type !== Comment) ? vnodes : originRenderCell(data);
  45985. } else children = originRenderCell(data);
  45986. const { columns } = owner.value.store.states;
  45987. const firstUserColumnIndex = columns.value.findIndex((item) => item.type === "default");
  45988. const prefix = treeCellPrefix(data, hasTreeColumn.value && data.cellIndex === firstUserColumnIndex);
  45989. const props = {
  45990. class: "cell",
  45991. style: {}
  45992. };
  45993. if (column.showOverflowTooltip) {
  45994. props.class = `${props.class} ${unref(ns.namespace)}-tooltip`;
  45995. props.style = { width: `${(data.column.realWidth || Number(data.column.width)) - 1}px` };
  45996. }
  45997. checkSubColumn(children);
  45998. return h("div", props, [prefix, children]);
  45999. };
  46000. }
  46001. return column;
  46002. };
  46003. const getPropsData = (...propsKey) => {
  46004. return propsKey.reduce((prev, cur) => {
  46005. if (isArray$1(cur)) cur.forEach((key) => {
  46006. prev[key] = props[key];
  46007. });
  46008. return prev;
  46009. }, {});
  46010. };
  46011. const getColumnElIndex = (children, child) => {
  46012. return Array.prototype.indexOf.call(children, child);
  46013. };
  46014. const updateColumnOrder = () => {
  46015. owner.value.store.commit("updateColumnOrder", instance.columnConfig.value);
  46016. };
  46017. return {
  46018. columnId,
  46019. realAlign,
  46020. isSubColumn,
  46021. realHeaderAlign,
  46022. columnOrTableParent,
  46023. setColumnWidth,
  46024. setColumnForcedProps,
  46025. setColumnRenders,
  46026. getPropsData,
  46027. getColumnElIndex,
  46028. updateColumnOrder
  46029. };
  46030. }
  46031. //#endregion
  46032. //#region ../../packages/components/table/src/table-column/defaults.ts
  46033. var defaults_default$1 = {
  46034. type: {
  46035. type: String,
  46036. default: "default"
  46037. },
  46038. label: String,
  46039. className: String,
  46040. labelClassName: String,
  46041. property: String,
  46042. prop: String,
  46043. width: {
  46044. type: [String, Number],
  46045. default: ""
  46046. },
  46047. minWidth: {
  46048. type: [String, Number],
  46049. default: ""
  46050. },
  46051. renderHeader: Function,
  46052. sortable: {
  46053. type: [Boolean, String],
  46054. default: false
  46055. },
  46056. sortMethod: Function,
  46057. sortBy: [
  46058. String,
  46059. Function,
  46060. Array
  46061. ],
  46062. resizable: {
  46063. type: Boolean,
  46064. default: true
  46065. },
  46066. columnKey: String,
  46067. align: String,
  46068. headerAlign: String,
  46069. showOverflowTooltip: {
  46070. type: [Boolean, Object],
  46071. default: void 0
  46072. },
  46073. tooltipFormatter: Function,
  46074. fixed: [Boolean, String],
  46075. formatter: Function,
  46076. selectable: Function,
  46077. reserveSelection: Boolean,
  46078. filterMethod: Function,
  46079. filteredValue: Array,
  46080. filters: Array,
  46081. filterPlacement: String,
  46082. filterMultiple: {
  46083. type: Boolean,
  46084. default: true
  46085. },
  46086. filterClassName: String,
  46087. index: [Number, Function],
  46088. sortOrders: {
  46089. type: Array,
  46090. default: () => {
  46091. return [
  46092. "ascending",
  46093. "descending",
  46094. null
  46095. ];
  46096. },
  46097. validator: (val) => {
  46098. return val.every((order) => [
  46099. "ascending",
  46100. "descending",
  46101. null
  46102. ].includes(order));
  46103. }
  46104. }
  46105. };
  46106. //#endregion
  46107. //#region ../../packages/components/table/src/table-column/index.ts
  46108. let columnIdSeed = 1;
  46109. var table_column_default = defineComponent({
  46110. name: "ElTableColumn",
  46111. components: { ElCheckbox },
  46112. props: defaults_default$1,
  46113. setup(props, { slots }) {
  46114. const instance = getCurrentInstance();
  46115. const globalConfig = useGlobalConfig("table");
  46116. const columnConfig = ref({});
  46117. const owner = computed(() => {
  46118. let parent = instance.parent;
  46119. while (parent && !parent.tableId) parent = parent.parent;
  46120. return parent;
  46121. });
  46122. const { registerNormalWatchers, registerComplexWatchers } = useWatcher(owner, props);
  46123. const { columnId, isSubColumn, realHeaderAlign, columnOrTableParent, setColumnWidth, setColumnForcedProps, setColumnRenders, getPropsData, getColumnElIndex, realAlign, updateColumnOrder } = useRender(props, slots, owner);
  46124. const parent = columnOrTableParent.value;
  46125. columnId.value = `${"tableId" in parent && parent.tableId || "columnId" in parent && parent.columnId}_column_${columnIdSeed++}`;
  46126. onBeforeMount(() => {
  46127. isSubColumn.value = owner.value !== parent;
  46128. const type = props.type || "default";
  46129. const sortable = props.sortable === "" ? true : props.sortable;
  46130. const showOverflowTooltip = type === "selection" ? false : isUndefined(props.showOverflowTooltip) ? parent.props.showOverflowTooltip ?? globalConfig.value?.showOverflowTooltip : props.showOverflowTooltip;
  46131. const tooltipFormatter = isUndefined(props.tooltipFormatter) ? parent.props.tooltipFormatter ?? globalConfig.value?.tooltipFormatter : props.tooltipFormatter;
  46132. const defaults = {
  46133. ...cellStarts[type],
  46134. id: columnId.value,
  46135. type,
  46136. property: props.prop || props.property,
  46137. align: realAlign,
  46138. headerAlign: realHeaderAlign,
  46139. showOverflowTooltip,
  46140. tooltipFormatter,
  46141. filterable: props.filters || props.filterMethod,
  46142. filteredValue: [],
  46143. filterPlacement: "",
  46144. filterClassName: "",
  46145. isColumnGroup: false,
  46146. isSubColumn: false,
  46147. filterOpened: false,
  46148. sortable,
  46149. index: props.index,
  46150. rawColumnKey: instance.vnode.key
  46151. };
  46152. let column = getPropsData([
  46153. "columnKey",
  46154. "label",
  46155. "className",
  46156. "labelClassName",
  46157. "type",
  46158. "renderHeader",
  46159. "formatter",
  46160. "fixed",
  46161. "resizable"
  46162. ], [
  46163. "sortMethod",
  46164. "sortBy",
  46165. "sortOrders"
  46166. ], ["selectable", "reserveSelection"], [
  46167. "filterMethod",
  46168. "filters",
  46169. "filterMultiple",
  46170. "filterOpened",
  46171. "filteredValue",
  46172. "filterPlacement",
  46173. "filterClassName"
  46174. ]);
  46175. column = mergeOptions(defaults, column);
  46176. column = compose(setColumnRenders, setColumnWidth, setColumnForcedProps)(column);
  46177. columnConfig.value = column;
  46178. registerNormalWatchers();
  46179. registerComplexWatchers();
  46180. });
  46181. onMounted(() => {
  46182. const parent = columnOrTableParent.value;
  46183. const children = isSubColumn.value ? parent.vnode.el?.children : parent.refs.hiddenColumns?.children;
  46184. const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el);
  46185. columnConfig.value.getColumnIndex = getColumnIndex;
  46186. getColumnIndex() > -1 && owner.value.store.commit("insertColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null, updateColumnOrder);
  46187. });
  46188. onBeforeUnmount(() => {
  46189. const getColumnIndex = columnConfig.value.getColumnIndex;
  46190. (getColumnIndex ? getColumnIndex() : -1) > -1 && owner.value.store.commit("removeColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null, updateColumnOrder);
  46191. });
  46192. instance.columnId = columnId.value;
  46193. instance.columnConfig = columnConfig;
  46194. },
  46195. render() {
  46196. try {
  46197. const renderDefault = this.$slots.default?.({
  46198. row: {},
  46199. column: {},
  46200. $index: -1
  46201. });
  46202. const children = [];
  46203. if (isArray$1(renderDefault)) {
  46204. for (const childNode of renderDefault) if (childNode.type?.name === "ElTableColumn" || childNode.shapeFlag & 2) children.push(childNode);
  46205. else if (childNode.type === Fragment && isArray$1(childNode.children)) childNode.children.forEach((vnode) => {
  46206. if (vnode?.patchFlag !== 1024 && !isString(vnode?.children)) children.push(vnode);
  46207. });
  46208. }
  46209. return h("div", children);
  46210. } catch {
  46211. return h("div", []);
  46212. }
  46213. }
  46214. });
  46215. //#endregion
  46216. //#region ../../packages/components/table/src/tableColumn.ts
  46217. var tableColumn_default = table_column_default;
  46218. //#endregion
  46219. //#region ../../packages/components/table/index.ts
  46220. const ElTable = withInstall(table_default, { TableColumn: tableColumn_default });
  46221. const ElTableColumn = withNoopInstall(tableColumn_default);
  46222. //#endregion
  46223. //#region ../../packages/components/table-v2/src/constants.ts
  46224. let SortOrder = /* @__PURE__ */ function(SortOrder) {
  46225. SortOrder["ASC"] = "asc";
  46226. SortOrder["DESC"] = "desc";
  46227. return SortOrder;
  46228. }({});
  46229. let Alignment = /* @__PURE__ */ function(Alignment) {
  46230. Alignment["LEFT"] = "left";
  46231. Alignment["CENTER"] = "center";
  46232. Alignment["RIGHT"] = "right";
  46233. return Alignment;
  46234. }({});
  46235. let FixedDir = /* @__PURE__ */ function(FixedDir) {
  46236. FixedDir["LEFT"] = "left";
  46237. FixedDir["RIGHT"] = "right";
  46238. return FixedDir;
  46239. }({});
  46240. const oppositeOrderMap = {
  46241. [SortOrder.ASC]: SortOrder.DESC,
  46242. [SortOrder.DESC]: SortOrder.ASC
  46243. };
  46244. const sortOrders = [SortOrder.ASC, SortOrder.DESC];
  46245. //#endregion
  46246. //#region ../../packages/components/table-v2/src/private.ts
  46247. const placeholderSign = Symbol("placeholder");
  46248. //#endregion
  46249. //#region ../../packages/components/table-v2/src/composables/utils.ts
  46250. const calcColumnStyle = (column, fixedColumn, fixed) => {
  46251. const flex = {
  46252. flexGrow: 0,
  46253. flexShrink: 0,
  46254. ...fixed ? {} : {
  46255. flexGrow: column.flexGrow ?? 0,
  46256. flexShrink: column.flexShrink ?? 1
  46257. }
  46258. };
  46259. const style = {
  46260. ...column.style ?? {},
  46261. ...flex,
  46262. flexBasis: "auto",
  46263. width: column.width
  46264. };
  46265. if (!fixedColumn) {
  46266. if (column.maxWidth) style.maxWidth = column.maxWidth;
  46267. if (column.minWidth) style.minWidth = column.minWidth;
  46268. }
  46269. return style;
  46270. };
  46271. //#endregion
  46272. //#region ../../packages/components/table-v2/src/composables/use-columns.ts
  46273. function useColumns(props, columns, fixed) {
  46274. const _columns = computed(() => unref(columns).map((column, index) => ({
  46275. ...column,
  46276. key: column.key ?? column.dataKey ?? index
  46277. })));
  46278. const visibleColumns = computed(() => {
  46279. return unref(_columns).filter((column) => !column.hidden);
  46280. });
  46281. const fixedColumnsOnLeft = computed(() => unref(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true));
  46282. const fixedColumnsOnRight = computed(() => unref(visibleColumns).filter((column) => column.fixed === "right"));
  46283. const normalColumns = computed(() => unref(visibleColumns).filter((column) => !column.fixed));
  46284. const mainColumns = computed(() => {
  46285. const ret = [];
  46286. unref(fixedColumnsOnLeft).forEach((column) => {
  46287. ret.push({
  46288. ...column,
  46289. placeholderSign
  46290. });
  46291. });
  46292. unref(normalColumns).forEach((column) => {
  46293. ret.push(column);
  46294. });
  46295. unref(fixedColumnsOnRight).forEach((column) => {
  46296. ret.push({
  46297. ...column,
  46298. placeholderSign
  46299. });
  46300. });
  46301. return ret;
  46302. });
  46303. const hasFixedColumns = computed(() => {
  46304. return unref(fixedColumnsOnLeft).length || unref(fixedColumnsOnRight).length;
  46305. });
  46306. const columnsStyles = computed(() => {
  46307. return unref(_columns).reduce((style, column) => {
  46308. style[column.key] = calcColumnStyle(column, unref(fixed), props.fixed);
  46309. return style;
  46310. }, {});
  46311. });
  46312. const columnsTotalWidth = computed(() => {
  46313. return unref(visibleColumns).reduce((width, column) => width + column.width, 0);
  46314. });
  46315. const getColumn = (key) => {
  46316. return unref(_columns).find((column) => column.key === key);
  46317. };
  46318. const getColumnStyle = (key) => {
  46319. return unref(columnsStyles)[key];
  46320. };
  46321. const updateColumnWidth = (column, width) => {
  46322. column.width = width;
  46323. };
  46324. function onColumnSorted(e) {
  46325. const { key } = e.currentTarget.dataset;
  46326. if (!key) return;
  46327. const { sortState, sortBy } = props;
  46328. let order = SortOrder.ASC;
  46329. if (isObject$1(sortState)) order = oppositeOrderMap[sortState[key]];
  46330. else order = oppositeOrderMap[sortBy.order];
  46331. props.onColumnSort?.({
  46332. column: getColumn(key),
  46333. key,
  46334. order
  46335. });
  46336. }
  46337. return {
  46338. columns: _columns,
  46339. columnsStyles,
  46340. columnsTotalWidth,
  46341. fixedColumnsOnLeft,
  46342. fixedColumnsOnRight,
  46343. hasFixedColumns,
  46344. mainColumns,
  46345. normalColumns,
  46346. visibleColumns,
  46347. getColumn,
  46348. getColumnStyle,
  46349. updateColumnWidth,
  46350. onColumnSorted
  46351. };
  46352. }
  46353. //#endregion
  46354. //#region ../../packages/components/table-v2/src/composables/use-scrollbar.ts
  46355. const useScrollbar = (props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }) => {
  46356. const scrollPos = ref({
  46357. scrollLeft: 0,
  46358. scrollTop: 0
  46359. });
  46360. function doScroll(params) {
  46361. const { scrollTop } = params;
  46362. mainTableRef.value?.scrollTo(params);
  46363. leftTableRef.value?.scrollToTop(scrollTop);
  46364. rightTableRef.value?.scrollToTop(scrollTop);
  46365. }
  46366. function scrollTo(params) {
  46367. scrollPos.value = params;
  46368. doScroll(params);
  46369. }
  46370. function scrollToTop(scrollTop) {
  46371. scrollPos.value.scrollTop = scrollTop;
  46372. doScroll(unref(scrollPos));
  46373. }
  46374. function scrollToLeft(scrollLeft) {
  46375. scrollPos.value.scrollLeft = scrollLeft;
  46376. mainTableRef.value?.scrollTo?.(unref(scrollPos));
  46377. }
  46378. function onScroll(params) {
  46379. scrollTo(params);
  46380. props.onScroll?.(params);
  46381. }
  46382. function onVerticalScroll({ scrollTop }) {
  46383. const { scrollTop: currentScrollTop } = unref(scrollPos);
  46384. if (scrollTop !== currentScrollTop) scrollToTop(scrollTop);
  46385. }
  46386. function scrollToRow(row, strategy = "auto") {
  46387. mainTableRef.value?.scrollToRow(row, strategy);
  46388. }
  46389. watch(() => unref(scrollPos).scrollTop, (cur, prev) => {
  46390. if (cur > prev) onMaybeEndReached();
  46391. });
  46392. return {
  46393. scrollPos,
  46394. scrollTo,
  46395. scrollToLeft,
  46396. scrollToTop,
  46397. scrollToRow,
  46398. onScroll,
  46399. onVerticalScroll
  46400. };
  46401. };
  46402. //#endregion
  46403. //#region ../../packages/components/table-v2/src/composables/use-row.ts
  46404. const useRow = (props, { mainTableRef, leftTableRef, rightTableRef, tableInstance, ns, isScrolling }) => {
  46405. const vm = getCurrentInstance();
  46406. const { emit } = vm;
  46407. const isResetting = shallowRef(false);
  46408. const expandedRowKeys = ref(props.defaultExpandedRowKeys || []);
  46409. const lastRenderedRowIndex = ref(-1);
  46410. const resetIndex = shallowRef(null);
  46411. const rowHeights = ref({});
  46412. const pendingRowHeights = ref({});
  46413. const leftTableHeights = shallowRef({});
  46414. const mainTableHeights = shallowRef({});
  46415. const rightTableHeights = shallowRef({});
  46416. const isDynamic = computed(() => isNumber(props.estimatedRowHeight));
  46417. function onRowsRendered(params) {
  46418. props.onRowsRendered?.(params);
  46419. if (params.rowCacheEnd > unref(lastRenderedRowIndex)) lastRenderedRowIndex.value = params.rowCacheEnd;
  46420. }
  46421. function onRowHovered({ hovered, rowKey }) {
  46422. if (isScrolling.value) return;
  46423. tableInstance.vnode.el.querySelectorAll(`[rowkey="${String(rowKey)}"]`).forEach((row) => {
  46424. if (hovered) row.classList.add(ns.is("hovered"));
  46425. else row.classList.remove(ns.is("hovered"));
  46426. });
  46427. }
  46428. function onRowExpanded({ expanded, rowData, rowIndex, rowKey }) {
  46429. const _expandedRowKeys = [...unref(expandedRowKeys)];
  46430. const currentKeyIndex = _expandedRowKeys.indexOf(rowKey);
  46431. if (expanded) {
  46432. if (currentKeyIndex === -1) _expandedRowKeys.push(rowKey);
  46433. } else if (currentKeyIndex > -1) _expandedRowKeys.splice(currentKeyIndex, 1);
  46434. expandedRowKeys.value = _expandedRowKeys;
  46435. emit("update:expandedRowKeys", _expandedRowKeys);
  46436. props.onRowExpand?.({
  46437. expanded,
  46438. rowData,
  46439. rowIndex,
  46440. rowKey
  46441. });
  46442. props.onExpandedRowsChange?.(_expandedRowKeys);
  46443. if (tableInstance.vnode.el.querySelector(`.${ns.is("hovered")}[rowkey="${String(rowKey)}"]`)) nextTick(() => onRowHovered({
  46444. hovered: true,
  46445. rowKey
  46446. }));
  46447. }
  46448. const flushingRowHeights = debounce(() => {
  46449. isResetting.value = true;
  46450. rowHeights.value = {
  46451. ...unref(rowHeights),
  46452. ...unref(pendingRowHeights)
  46453. };
  46454. resetAfterIndex(unref(resetIndex), false);
  46455. pendingRowHeights.value = {};
  46456. resetIndex.value = null;
  46457. mainTableRef.value?.forceUpdate();
  46458. leftTableRef.value?.forceUpdate();
  46459. rightTableRef.value?.forceUpdate();
  46460. vm.proxy?.$forceUpdate();
  46461. isResetting.value = false;
  46462. }, 0);
  46463. function resetAfterIndex(index, forceUpdate = false) {
  46464. if (!unref(isDynamic)) return;
  46465. [
  46466. mainTableRef,
  46467. leftTableRef,
  46468. rightTableRef
  46469. ].forEach((tableRef) => {
  46470. const table = unref(tableRef);
  46471. if (table) table.resetAfterRowIndex(index, forceUpdate);
  46472. });
  46473. }
  46474. function resetHeights(rowKey, height, rowIdx) {
  46475. const resetIdx = unref(resetIndex);
  46476. if (resetIdx === null) resetIndex.value = rowIdx;
  46477. else if (resetIdx > rowIdx) resetIndex.value = rowIdx;
  46478. pendingRowHeights.value[rowKey] = height;
  46479. }
  46480. function onRowHeightChange({ rowKey, height, rowIndex }, fixedDir) {
  46481. if (!fixedDir) mainTableHeights.value[rowKey] = height;
  46482. else if (fixedDir === FixedDir.RIGHT) rightTableHeights.value[rowKey] = height;
  46483. else leftTableHeights.value[rowKey] = height;
  46484. const maximumHeight = Math.max(...[
  46485. leftTableHeights,
  46486. rightTableHeights,
  46487. mainTableHeights
  46488. ].map((records) => records.value[rowKey] || 0));
  46489. if (unref(rowHeights)[rowKey] !== maximumHeight) {
  46490. resetHeights(rowKey, maximumHeight, rowIndex);
  46491. flushingRowHeights();
  46492. }
  46493. }
  46494. return {
  46495. expandedRowKeys,
  46496. lastRenderedRowIndex,
  46497. isDynamic,
  46498. isResetting,
  46499. rowHeights,
  46500. resetAfterIndex,
  46501. onRowExpanded,
  46502. onRowHovered,
  46503. onRowsRendered,
  46504. onRowHeightChange
  46505. };
  46506. };
  46507. //#endregion
  46508. //#region ../../packages/components/table-v2/src/composables/use-data.ts
  46509. const useData = (props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
  46510. const depthMap = ref({});
  46511. const flattenedData = computed(() => {
  46512. const depths = {};
  46513. const { data, rowKey } = props;
  46514. const _expandedRowKeys = unref(expandedRowKeys);
  46515. if (!_expandedRowKeys || !_expandedRowKeys.length) return data;
  46516. const array = [];
  46517. const keysSet = /* @__PURE__ */ new Set();
  46518. _expandedRowKeys.forEach((x) => keysSet.add(x));
  46519. let copy = data.slice();
  46520. copy.forEach((x) => depths[x[rowKey]] = 0);
  46521. while (copy.length > 0) {
  46522. const item = copy.shift();
  46523. array.push(item);
  46524. if (keysSet.has(item[rowKey]) && isArray$1(item.children) && item.children.length > 0) {
  46525. copy = [...item.children, ...copy];
  46526. item.children.forEach((child) => depths[child[rowKey]] = depths[item[rowKey]] + 1);
  46527. }
  46528. }
  46529. depthMap.value = depths;
  46530. return array;
  46531. });
  46532. const data = computed(() => {
  46533. const { data, expandColumnKey } = props;
  46534. return expandColumnKey ? unref(flattenedData) : data;
  46535. });
  46536. watch(data, (val, prev) => {
  46537. if (val !== prev) {
  46538. lastRenderedRowIndex.value = -1;
  46539. resetAfterIndex(0, true);
  46540. }
  46541. });
  46542. return {
  46543. data,
  46544. depthMap
  46545. };
  46546. };
  46547. //#endregion
  46548. //#region ../../packages/components/table-v2/src/utils.ts
  46549. const sumReducer = (sum, num) => sum + num;
  46550. const sum = (listLike) => {
  46551. return isArray$1(listLike) ? listLike.reduce(sumReducer, 0) : listLike;
  46552. };
  46553. const tryCall = (fLike, params, defaultRet = {}) => {
  46554. return isFunction$1(fLike) ? fLike(params) : fLike ?? defaultRet;
  46555. };
  46556. const enforceUnit = (style) => {
  46557. [
  46558. "width",
  46559. "maxWidth",
  46560. "minWidth",
  46561. "height"
  46562. ].forEach((key) => {
  46563. style[key] = addUnit(style[key]);
  46564. });
  46565. return style;
  46566. };
  46567. const componentToSlot = (ComponentLike) => isVNode(ComponentLike) ? (props) => h(ComponentLike, props) : ComponentLike;
  46568. //#endregion
  46569. //#region ../../packages/components/table-v2/src/composables/use-styles.ts
  46570. const useStyles = (props, { columnsTotalWidth, rowsHeight, fixedColumnsOnLeft, fixedColumnsOnRight }) => {
  46571. const bodyWidth = computed(() => {
  46572. const { fixed, width, vScrollbarSize } = props;
  46573. const ret = width - vScrollbarSize;
  46574. return fixed ? Math.max(Math.round(unref(columnsTotalWidth)), ret) : ret;
  46575. });
  46576. const mainTableHeight = computed(() => {
  46577. const { height = 0, maxHeight = 0, footerHeight, hScrollbarSize } = props;
  46578. if (maxHeight > 0) {
  46579. const _fixedRowsHeight = unref(fixedRowsHeight);
  46580. const _rowsHeight = unref(rowsHeight);
  46581. const total = unref(headerHeight) + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
  46582. return Math.min(total, maxHeight - footerHeight);
  46583. }
  46584. return height - footerHeight;
  46585. });
  46586. const fixedTableHeight = computed(() => {
  46587. const { maxHeight } = props;
  46588. const tableHeight = unref(mainTableHeight);
  46589. if (isNumber(maxHeight) && maxHeight > 0) return tableHeight;
  46590. const totalHeight = unref(rowsHeight) + unref(headerHeight) + unref(fixedRowsHeight);
  46591. return Math.min(tableHeight, totalHeight);
  46592. });
  46593. const mapColumn = (column) => column.width;
  46594. const leftTableWidth = computed(() => sum(unref(fixedColumnsOnLeft).map(mapColumn)));
  46595. const rightTableWidth = computed(() => sum(unref(fixedColumnsOnRight).map(mapColumn)));
  46596. const headerHeight = computed(() => sum(props.headerHeight));
  46597. const fixedRowsHeight = computed(() => {
  46598. return (props.fixedData?.length || 0) * props.rowHeight;
  46599. });
  46600. const windowHeight = computed(() => {
  46601. return unref(mainTableHeight) - unref(headerHeight) - unref(fixedRowsHeight);
  46602. });
  46603. const rootStyle = computed(() => {
  46604. const { style = {}, height, width } = props;
  46605. return enforceUnit({
  46606. ...style,
  46607. height,
  46608. width
  46609. });
  46610. });
  46611. return {
  46612. bodyWidth,
  46613. fixedTableHeight,
  46614. mainTableHeight,
  46615. leftTableWidth,
  46616. rightTableWidth,
  46617. windowHeight,
  46618. footerHeight: computed(() => enforceUnit({ height: props.footerHeight })),
  46619. emptyStyle: computed(() => ({
  46620. top: addUnit(unref(headerHeight)),
  46621. bottom: addUnit(props.footerHeight),
  46622. width: addUnit(props.width)
  46623. })),
  46624. rootStyle,
  46625. headerHeight
  46626. };
  46627. };
  46628. //#endregion
  46629. //#region ../../packages/components/table-v2/src/composables/use-auto-resize.ts
  46630. const useAutoResize = (props) => {
  46631. const sizer = ref();
  46632. const width$ = ref(0);
  46633. const height$ = ref(0);
  46634. let resizerStopper;
  46635. onMounted(() => {
  46636. resizerStopper = useResizeObserver(sizer, ([entry]) => {
  46637. const { width, height } = entry.contentRect;
  46638. const { paddingLeft, paddingRight, paddingTop, paddingBottom } = getComputedStyle(entry.target);
  46639. const left = Number.parseInt(paddingLeft) || 0;
  46640. const right = Number.parseInt(paddingRight) || 0;
  46641. const top = Number.parseInt(paddingTop) || 0;
  46642. const bottom = Number.parseInt(paddingBottom) || 0;
  46643. width$.value = width - left - right;
  46644. height$.value = height - top - bottom;
  46645. }).stop;
  46646. });
  46647. onBeforeUnmount(() => {
  46648. resizerStopper?.();
  46649. });
  46650. watch([width$, height$], ([width, height]) => {
  46651. props.onResize?.({
  46652. width,
  46653. height
  46654. });
  46655. });
  46656. return {
  46657. sizer,
  46658. width: width$,
  46659. height: height$
  46660. };
  46661. };
  46662. //#endregion
  46663. //#region ../../packages/components/table-v2/src/use-table.ts
  46664. function useTable(props) {
  46665. const mainTableRef = ref();
  46666. const leftTableRef = ref();
  46667. const rightTableRef = ref();
  46668. const { columns, columnsStyles, columnsTotalWidth, fixedColumnsOnLeft, fixedColumnsOnRight, hasFixedColumns, mainColumns, onColumnSorted } = useColumns(props, toRef(props, "columns"), toRef(props, "fixed"));
  46669. const { scrollTo, scrollToLeft, scrollToTop, scrollToRow, onScroll, onVerticalScroll, scrollPos } = useScrollbar(props, {
  46670. mainTableRef,
  46671. leftTableRef,
  46672. rightTableRef,
  46673. onMaybeEndReached
  46674. });
  46675. const ns = useNamespace("table-v2");
  46676. const instance = getCurrentInstance();
  46677. const isScrolling = shallowRef(false);
  46678. const { expandedRowKeys, lastRenderedRowIndex, isDynamic, isResetting, rowHeights, resetAfterIndex, onRowExpanded, onRowHeightChange, onRowHovered, onRowsRendered } = useRow(props, {
  46679. mainTableRef,
  46680. leftTableRef,
  46681. rightTableRef,
  46682. tableInstance: instance,
  46683. ns,
  46684. isScrolling
  46685. });
  46686. const { data, depthMap } = useData(props, {
  46687. expandedRowKeys,
  46688. lastRenderedRowIndex,
  46689. resetAfterIndex
  46690. });
  46691. const rowsHeight = computed(() => {
  46692. const { estimatedRowHeight, rowHeight } = props;
  46693. const _data = unref(data);
  46694. if (isNumber(estimatedRowHeight)) return Object.values(unref(rowHeights)).reduce((acc, curr) => acc + curr, 0);
  46695. return _data.length * rowHeight;
  46696. });
  46697. const { bodyWidth, fixedTableHeight, mainTableHeight, leftTableWidth, rightTableWidth, windowHeight, footerHeight, emptyStyle, rootStyle, headerHeight } = useStyles(props, {
  46698. columnsTotalWidth,
  46699. fixedColumnsOnLeft,
  46700. fixedColumnsOnRight,
  46701. rowsHeight
  46702. });
  46703. const containerRef = ref();
  46704. const showEmpty = computed(() => {
  46705. const noData = unref(data).length === 0;
  46706. return isArray$1(props.fixedData) ? props.fixedData.length === 0 && noData : noData;
  46707. });
  46708. function getRowHeight(rowIndex) {
  46709. const { estimatedRowHeight, rowHeight, rowKey } = props;
  46710. if (!estimatedRowHeight) return rowHeight;
  46711. return unref(rowHeights)[unref(data)[rowIndex][rowKey]] || estimatedRowHeight;
  46712. }
  46713. const isEndReached = ref(false);
  46714. function onMaybeEndReached() {
  46715. const { onEndReached } = props;
  46716. if (!onEndReached) return;
  46717. const { scrollTop } = unref(scrollPos);
  46718. const _totalHeight = unref(rowsHeight);
  46719. const remainDistance = _totalHeight - (scrollTop + unref(windowHeight)) + props.hScrollbarSize;
  46720. if (!isEndReached.value && unref(lastRenderedRowIndex) >= 0 && _totalHeight <= scrollTop + unref(mainTableHeight) - unref(headerHeight)) {
  46721. isEndReached.value = true;
  46722. onEndReached(remainDistance);
  46723. } else isEndReached.value = false;
  46724. }
  46725. watch(() => unref(rowsHeight), () => isEndReached.value = false);
  46726. watch(() => props.expandedRowKeys, (val) => expandedRowKeys.value = val, { deep: true });
  46727. return {
  46728. columns,
  46729. containerRef,
  46730. mainTableRef,
  46731. leftTableRef,
  46732. rightTableRef,
  46733. isDynamic,
  46734. isResetting,
  46735. isScrolling,
  46736. hasFixedColumns,
  46737. columnsStyles,
  46738. columnsTotalWidth,
  46739. data,
  46740. expandedRowKeys,
  46741. depthMap,
  46742. fixedColumnsOnLeft,
  46743. fixedColumnsOnRight,
  46744. mainColumns,
  46745. bodyWidth,
  46746. emptyStyle,
  46747. rootStyle,
  46748. footerHeight,
  46749. mainTableHeight,
  46750. fixedTableHeight,
  46751. leftTableWidth,
  46752. rightTableWidth,
  46753. showEmpty,
  46754. getRowHeight,
  46755. onColumnSorted,
  46756. onRowHovered,
  46757. onRowExpanded,
  46758. onRowsRendered,
  46759. onRowHeightChange,
  46760. scrollTo,
  46761. scrollToLeft,
  46762. scrollToTop,
  46763. scrollToRow,
  46764. onScroll,
  46765. onVerticalScroll
  46766. };
  46767. }
  46768. //#endregion
  46769. //#region ../../packages/components/table-v2/src/tokens.ts
  46770. const TableV2InjectionKey = Symbol("tableV2");
  46771. const TABLE_V2_GRID_INJECTION_KEY = "tableV2GridScrollLeft";
  46772. //#endregion
  46773. //#region ../../packages/components/table-v2/src/common.ts
  46774. /**
  46775. * @Note even though we can use `string[] | string` as the type but for
  46776. * convenience here we only use `string` as the acceptable value here.
  46777. */
  46778. const classType = String;
  46779. const columns = {
  46780. type: definePropType(Array),
  46781. required: true
  46782. };
  46783. const column = { type: definePropType(Object) };
  46784. const fixedDataType = { type: definePropType(Array) };
  46785. const dataType = {
  46786. ...fixedDataType,
  46787. required: true
  46788. };
  46789. const expandColumnKey = String;
  46790. const expandKeys = {
  46791. type: definePropType(Array),
  46792. default: () => mutable([])
  46793. };
  46794. const requiredNumber = {
  46795. type: Number,
  46796. required: true
  46797. };
  46798. const rowKey = {
  46799. type: definePropType([
  46800. String,
  46801. Number,
  46802. Symbol
  46803. ]),
  46804. default: "id"
  46805. };
  46806. /**
  46807. * @note even though we can use `StyleValue` but that would be difficult for us to mapping them,
  46808. * so we only use `CSSProperties` as the acceptable value here.
  46809. */
  46810. const styleType = { type: definePropType(Object) };
  46811. //#endregion
  46812. //#region ../../packages/components/table-v2/src/row.ts
  46813. const tableV2RowProps = buildProps({
  46814. class: String,
  46815. columns,
  46816. columnsStyles: {
  46817. type: definePropType(Object),
  46818. required: true
  46819. },
  46820. depth: Number,
  46821. expandColumnKey,
  46822. estimatedRowHeight: {
  46823. ...virtualizedGridProps.estimatedRowHeight,
  46824. default: void 0
  46825. },
  46826. isScrolling: Boolean,
  46827. onRowExpand: { type: definePropType(Function) },
  46828. onRowHover: { type: definePropType(Function) },
  46829. onRowHeightChange: { type: definePropType(Function) },
  46830. rowData: {
  46831. type: definePropType(Object),
  46832. required: true
  46833. },
  46834. rowEventHandlers: { type: definePropType(Object) },
  46835. rowIndex: {
  46836. type: Number,
  46837. required: true
  46838. },
  46839. rowKey,
  46840. style: { type: definePropType(Object) }
  46841. });
  46842. //#endregion
  46843. //#region ../../packages/components/table-v2/src/header.ts
  46844. const requiredNumberType = {
  46845. type: Number,
  46846. required: true
  46847. };
  46848. const tableV2HeaderProps = buildProps({
  46849. class: String,
  46850. columns,
  46851. fixedHeaderData: { type: definePropType(Array) },
  46852. headerData: {
  46853. type: definePropType(Array),
  46854. required: true
  46855. },
  46856. headerHeight: {
  46857. type: definePropType([Number, Array]),
  46858. default: 50
  46859. },
  46860. rowWidth: requiredNumberType,
  46861. rowHeight: {
  46862. type: Number,
  46863. default: 50
  46864. },
  46865. height: requiredNumberType,
  46866. width: requiredNumberType
  46867. });
  46868. //#endregion
  46869. //#region ../../packages/components/table-v2/src/grid.ts
  46870. const tableV2GridProps = buildProps({
  46871. columns,
  46872. data: dataType,
  46873. fixedData: fixedDataType,
  46874. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  46875. width: requiredNumber,
  46876. height: requiredNumber,
  46877. headerWidth: requiredNumber,
  46878. headerHeight: tableV2HeaderProps.headerHeight,
  46879. bodyWidth: requiredNumber,
  46880. rowHeight: requiredNumber,
  46881. cache: virtualizedListProps.cache,
  46882. useIsScrolling: Boolean,
  46883. scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,
  46884. scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,
  46885. scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,
  46886. class: classType,
  46887. style: styleType,
  46888. containerStyle: styleType,
  46889. getRowHeight: {
  46890. type: definePropType(Function),
  46891. required: true
  46892. },
  46893. rowKey: tableV2RowProps.rowKey,
  46894. onRowsRendered: { type: definePropType(Function) },
  46895. onScroll: { type: definePropType(Function) }
  46896. });
  46897. //#endregion
  46898. //#region ../../packages/components/table-v2/src/table.ts
  46899. const tableV2Props = buildProps({
  46900. cache: tableV2GridProps.cache,
  46901. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  46902. rowKey,
  46903. headerClass: { type: definePropType([String, Function]) },
  46904. headerProps: { type: definePropType([Object, Function]) },
  46905. headerCellProps: { type: definePropType([Object, Function]) },
  46906. headerHeight: tableV2HeaderProps.headerHeight,
  46907. footerHeight: {
  46908. type: Number,
  46909. default: 0
  46910. },
  46911. rowClass: { type: definePropType([String, Function]) },
  46912. rowProps: { type: definePropType([Object, Function]) },
  46913. rowHeight: {
  46914. type: Number,
  46915. default: 50
  46916. },
  46917. cellProps: { type: definePropType([Object, Function]) },
  46918. columns,
  46919. data: dataType,
  46920. dataGetter: { type: definePropType(Function) },
  46921. fixedData: fixedDataType,
  46922. expandColumnKey: tableV2RowProps.expandColumnKey,
  46923. expandedRowKeys: expandKeys,
  46924. defaultExpandedRowKeys: expandKeys,
  46925. class: classType,
  46926. fixed: Boolean,
  46927. style: { type: definePropType(Object) },
  46928. width: requiredNumber,
  46929. height: requiredNumber,
  46930. maxHeight: Number,
  46931. useIsScrolling: Boolean,
  46932. indentSize: {
  46933. type: Number,
  46934. default: 12
  46935. },
  46936. iconSize: {
  46937. type: Number,
  46938. default: 12
  46939. },
  46940. hScrollbarSize: virtualizedGridProps.hScrollbarSize,
  46941. vScrollbarSize: virtualizedGridProps.vScrollbarSize,
  46942. scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,
  46943. sortBy: {
  46944. type: definePropType(Object),
  46945. default: () => ({})
  46946. },
  46947. sortState: {
  46948. type: definePropType(Object),
  46949. default: void 0
  46950. },
  46951. onColumnSort: { type: definePropType(Function) },
  46952. onExpandedRowsChange: { type: definePropType(Function) },
  46953. onEndReached: { type: definePropType(Function) },
  46954. onRowExpand: tableV2RowProps.onRowExpand,
  46955. onScroll: tableV2GridProps.onScroll,
  46956. onRowsRendered: tableV2GridProps.onRowsRendered,
  46957. rowEventHandlers: tableV2RowProps.rowEventHandlers
  46958. });
  46959. //#endregion
  46960. //#region ../../packages/components/table-v2/src/components/cell.tsx
  46961. const TableV2Cell = (props, { slots }) => {
  46962. const { cellData, style } = props;
  46963. const displayText = cellData?.toString?.() || "";
  46964. const defaultSlot = renderSlot(slots, "default", props, () => [displayText]);
  46965. return createVNode("div", {
  46966. "class": props.class,
  46967. "title": displayText,
  46968. "style": style
  46969. }, [defaultSlot]);
  46970. };
  46971. TableV2Cell.displayName = "ElTableV2Cell";
  46972. TableV2Cell.inheritAttrs = false;
  46973. //#endregion
  46974. //#region ../../packages/components/table-v2/src/components/header-cell.tsx
  46975. const HeaderCell = (props, { slots }) => renderSlot(slots, "default", props, () => [createVNode("div", {
  46976. "class": props.class,
  46977. "title": props.column?.title
  46978. }, [props.column?.title])]);
  46979. HeaderCell.displayName = "ElTableV2HeaderCell";
  46980. HeaderCell.inheritAttrs = false;
  46981. //#endregion
  46982. //#region ../../packages/components/table-v2/src/header-row.ts
  46983. const tableV2HeaderRowProps = buildProps({
  46984. class: String,
  46985. columns,
  46986. columnsStyles: {
  46987. type: definePropType(Object),
  46988. required: true
  46989. },
  46990. headerIndex: Number,
  46991. style: { type: definePropType(Object) }
  46992. });
  46993. //#endregion
  46994. //#region ../../packages/components/table-v2/src/components/header-row.tsx
  46995. const TableV2HeaderRow = /* @__PURE__ */ defineComponent({
  46996. name: "ElTableV2HeaderRow",
  46997. props: tableV2HeaderRowProps,
  46998. setup(props, { slots }) {
  46999. return () => {
  47000. const { columns, columnsStyles, headerIndex, style } = props;
  47001. let Cells = columns.map((column, columnIndex) => {
  47002. return slots.cell({
  47003. columns,
  47004. column,
  47005. columnIndex,
  47006. headerIndex,
  47007. style: columnsStyles[column.key]
  47008. });
  47009. });
  47010. if (slots.header) Cells = slots.header({
  47011. cells: Cells.map((node) => {
  47012. if (isArray$1(node) && node.length === 1) return node[0];
  47013. return node;
  47014. }),
  47015. columns,
  47016. headerIndex
  47017. });
  47018. return createVNode("div", {
  47019. "class": props.class,
  47020. "style": style,
  47021. "role": "row"
  47022. }, [Cells]);
  47023. };
  47024. }
  47025. });
  47026. //#endregion
  47027. //#region ../../packages/components/table-v2/src/components/header.tsx
  47028. const TableV2Header = /* @__PURE__ */ defineComponent({
  47029. name: "ElTableV2Header",
  47030. props: tableV2HeaderProps,
  47031. setup(props, { slots, expose }) {
  47032. const ns = useNamespace("table-v2");
  47033. const scrollLeftInfo = inject(TABLE_V2_GRID_INJECTION_KEY);
  47034. const headerRef = ref();
  47035. const headerStyle = computed(() => enforceUnit({
  47036. width: props.width,
  47037. height: props.height
  47038. }));
  47039. const rowStyle = computed(() => enforceUnit({
  47040. width: props.rowWidth,
  47041. height: props.height
  47042. }));
  47043. const headerHeights = computed(() => castArray$1(unref(props.headerHeight)));
  47044. const scrollToLeft = (left) => {
  47045. const headerEl = unref(headerRef);
  47046. nextTick(() => {
  47047. headerEl?.scroll && headerEl.scroll({ left });
  47048. });
  47049. };
  47050. const renderFixedRows = () => {
  47051. const fixedRowClassName = ns.e("fixed-header-row");
  47052. const { columns, fixedHeaderData, rowHeight } = props;
  47053. return fixedHeaderData?.map((fixedRowData, fixedRowIndex) => {
  47054. const style = enforceUnit({
  47055. height: rowHeight,
  47056. width: "100%"
  47057. });
  47058. return slots.fixed?.({
  47059. class: fixedRowClassName,
  47060. columns,
  47061. rowData: fixedRowData,
  47062. rowIndex: -(fixedRowIndex + 1),
  47063. style
  47064. });
  47065. });
  47066. };
  47067. const renderDynamicRows = () => {
  47068. const dynamicRowClassName = ns.e("dynamic-header-row");
  47069. const { columns } = props;
  47070. return unref(headerHeights).map((rowHeight, rowIndex) => {
  47071. const style = enforceUnit({
  47072. width: "100%",
  47073. height: rowHeight
  47074. });
  47075. return slots.dynamic?.({
  47076. class: dynamicRowClassName,
  47077. columns,
  47078. headerIndex: rowIndex,
  47079. style
  47080. });
  47081. });
  47082. };
  47083. onUpdated(() => {
  47084. if (scrollLeftInfo?.value) scrollToLeft(scrollLeftInfo.value);
  47085. });
  47086. expose({ scrollToLeft });
  47087. return () => {
  47088. if (props.height <= 0) return;
  47089. return createVNode("div", {
  47090. "ref": headerRef,
  47091. "class": props.class,
  47092. "style": unref(headerStyle),
  47093. "role": "rowgroup"
  47094. }, [createVNode("div", {
  47095. "style": unref(rowStyle),
  47096. "class": ns.e("header")
  47097. }, [renderDynamicRows(), renderFixedRows()])]);
  47098. };
  47099. }
  47100. });
  47101. //#endregion
  47102. //#region ../../packages/components/table-v2/src/components/row.tsx
  47103. const useTableRow = (props) => {
  47104. const { isScrolling } = inject(TableV2InjectionKey);
  47105. const measured = ref(false);
  47106. const rowRef = ref();
  47107. const measurable = computed(() => {
  47108. return isNumber(props.estimatedRowHeight) && props.rowIndex >= 0;
  47109. });
  47110. const doMeasure = (isInit = false) => {
  47111. const $rowRef = unref(rowRef);
  47112. if (!$rowRef) return;
  47113. const { columns, onRowHeightChange, rowKey, rowIndex, style } = props;
  47114. const { height } = $rowRef.getBoundingClientRect();
  47115. measured.value = true;
  47116. nextTick(() => {
  47117. if (isInit || height !== Number.parseInt(style.height)) {
  47118. const firstColumn = columns[0];
  47119. const isPlaceholder = firstColumn?.placeholderSign === placeholderSign;
  47120. onRowHeightChange?.({
  47121. rowKey,
  47122. height,
  47123. rowIndex
  47124. }, firstColumn && !isPlaceholder && firstColumn.fixed);
  47125. }
  47126. });
  47127. };
  47128. const eventHandlers = computed(() => {
  47129. const { rowData, rowIndex, rowKey, onRowHover } = props;
  47130. const handlers = props.rowEventHandlers || {};
  47131. const eventHandlers = {};
  47132. Object.entries(handlers).forEach(([eventName, handler]) => {
  47133. if (isFunction$1(handler)) eventHandlers[eventName] = (event) => {
  47134. handler({
  47135. event,
  47136. rowData,
  47137. rowIndex,
  47138. rowKey
  47139. });
  47140. };
  47141. });
  47142. if (onRowHover) [{
  47143. name: "onMouseleave",
  47144. hovered: false
  47145. }, {
  47146. name: "onMouseenter",
  47147. hovered: true
  47148. }].forEach(({ name, hovered }) => {
  47149. const existedHandler = eventHandlers[name];
  47150. eventHandlers[name] = (event) => {
  47151. onRowHover({
  47152. event,
  47153. hovered,
  47154. rowData,
  47155. rowIndex,
  47156. rowKey
  47157. });
  47158. existedHandler?.(event);
  47159. };
  47160. });
  47161. return eventHandlers;
  47162. });
  47163. const onExpand = (expanded) => {
  47164. const { onRowExpand, rowData, rowIndex, rowKey } = props;
  47165. onRowExpand?.({
  47166. expanded,
  47167. rowData,
  47168. rowIndex,
  47169. rowKey
  47170. });
  47171. };
  47172. onMounted(() => {
  47173. if (unref(measurable)) doMeasure(true);
  47174. });
  47175. return {
  47176. isScrolling,
  47177. measurable,
  47178. measured,
  47179. rowRef,
  47180. eventHandlers,
  47181. onExpand
  47182. };
  47183. };
  47184. const TableV2Row = /* @__PURE__ */ defineComponent({
  47185. name: "ElTableV2TableRow",
  47186. props: tableV2RowProps,
  47187. setup(props, { expose, slots, attrs }) {
  47188. const { eventHandlers, isScrolling, measurable, measured, rowRef, onExpand } = useTableRow(props);
  47189. expose({ onExpand });
  47190. return () => {
  47191. const { columns, columnsStyles, expandColumnKey, depth, rowData, rowIndex, style } = props;
  47192. let ColumnCells = columns.map((column, columnIndex) => {
  47193. const expandable = isArray$1(rowData.children) && rowData.children.length > 0 && column.key === expandColumnKey;
  47194. return slots.cell({
  47195. column,
  47196. columns,
  47197. columnIndex,
  47198. depth,
  47199. style: columnsStyles[column.key],
  47200. rowData,
  47201. rowIndex,
  47202. isScrolling: unref(isScrolling),
  47203. expandIconProps: expandable ? {
  47204. rowData,
  47205. rowIndex,
  47206. onExpand
  47207. } : void 0
  47208. });
  47209. });
  47210. if (slots.row) ColumnCells = slots.row({
  47211. cells: ColumnCells.map((node) => {
  47212. if (isArray$1(node) && node.length === 1) return node[0];
  47213. return node;
  47214. }),
  47215. style,
  47216. columns,
  47217. depth,
  47218. rowData,
  47219. rowIndex,
  47220. isScrolling: unref(isScrolling)
  47221. });
  47222. if (unref(measurable)) {
  47223. const { height, ...exceptHeightStyle } = style || {};
  47224. const _measured = unref(measured);
  47225. return createVNode("div", mergeProps({
  47226. "ref": rowRef,
  47227. "class": props.class,
  47228. "style": _measured ? style : exceptHeightStyle,
  47229. "role": "row"
  47230. }, attrs, unref(eventHandlers)), [ColumnCells]);
  47231. }
  47232. return createVNode("div", mergeProps(attrs, {
  47233. "ref": rowRef,
  47234. "class": props.class,
  47235. "style": style,
  47236. "role": "row"
  47237. }, unref(eventHandlers)), [ColumnCells]);
  47238. };
  47239. }
  47240. });
  47241. //#endregion
  47242. //#region ../../packages/components/table-v2/src/components/sort-icon.tsx
  47243. const SortIcon = (props) => {
  47244. const { sortOrder } = props;
  47245. return createVNode("button", {
  47246. "type": "button",
  47247. "aria-label": props.ariaLabel,
  47248. "class": props.class
  47249. }, [createVNode(ElIcon, { "size": 14 }, { default: () => [sortOrder === SortOrder.ASC ? createVNode(sort_up_default, null, null) : createVNode(sort_down_default, null, null)] })]);
  47250. };
  47251. //#endregion
  47252. //#region ../../packages/components/table-v2/src/components/expand-icon.tsx
  47253. const ExpandIcon = (props) => {
  47254. const { expanded, expandable, onExpand, style, size, ariaLabel } = props;
  47255. return createVNode("button", mergeProps({
  47256. onClick: expandable ? () => onExpand(!expanded) : void 0,
  47257. ariaLabel,
  47258. ariaExpanded: expanded,
  47259. class: props.class
  47260. }, { "type": "button" }), [createVNode(ElIcon, {
  47261. "size": size,
  47262. "style": style
  47263. }, { default: () => [createVNode(arrow_right_default, null, null)] })]);
  47264. };
  47265. ExpandIcon.inheritAttrs = false;
  47266. //#endregion
  47267. //#region ../../packages/components/table-v2/src/table-grid.tsx
  47268. const COMPONENT_NAME$5 = "ElTableV2Grid";
  47269. const useTableGrid = (props) => {
  47270. const headerRef = ref();
  47271. const bodyRef = ref();
  47272. const scrollLeft = ref(0);
  47273. const totalHeight = computed(() => {
  47274. const { data, rowHeight, estimatedRowHeight } = props;
  47275. if (estimatedRowHeight) return;
  47276. return data.length * rowHeight;
  47277. });
  47278. const fixedRowHeight = computed(() => {
  47279. const { fixedData, rowHeight } = props;
  47280. return (fixedData?.length || 0) * rowHeight;
  47281. });
  47282. const headerHeight = computed(() => sum(props.headerHeight));
  47283. const gridHeight = computed(() => {
  47284. const { height } = props;
  47285. return Math.max(0, height - unref(headerHeight) - unref(fixedRowHeight));
  47286. });
  47287. const hasHeader = computed(() => {
  47288. return unref(headerHeight) + unref(fixedRowHeight) > 0;
  47289. });
  47290. const itemKey = ({ data, rowIndex }) => data[rowIndex][props.rowKey];
  47291. function onItemRendered({ rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd }) {
  47292. props.onRowsRendered?.({
  47293. rowCacheStart,
  47294. rowCacheEnd,
  47295. rowVisibleStart,
  47296. rowVisibleEnd
  47297. });
  47298. }
  47299. function resetAfterRowIndex(index, forceUpdate) {
  47300. bodyRef.value?.resetAfterRowIndex(index, forceUpdate);
  47301. }
  47302. function scrollTo(leftOrOptions, top) {
  47303. const header$ = unref(headerRef);
  47304. const body$ = unref(bodyRef);
  47305. if (isObject$1(leftOrOptions)) {
  47306. header$?.scrollToLeft(leftOrOptions.scrollLeft);
  47307. scrollLeft.value = leftOrOptions.scrollLeft;
  47308. body$?.scrollTo(leftOrOptions);
  47309. } else {
  47310. header$?.scrollToLeft(leftOrOptions);
  47311. scrollLeft.value = leftOrOptions;
  47312. body$?.scrollTo({
  47313. scrollLeft: leftOrOptions,
  47314. scrollTop: top
  47315. });
  47316. }
  47317. }
  47318. function scrollToTop(scrollTop) {
  47319. unref(bodyRef)?.scrollTo({ scrollTop });
  47320. }
  47321. function scrollToRow(row, strategy) {
  47322. const body = unref(bodyRef);
  47323. if (!body) return;
  47324. const prevScrollLeft = scrollLeft.value;
  47325. body.scrollToItem(row, 0, strategy);
  47326. if (prevScrollLeft) scrollTo({ scrollLeft: prevScrollLeft });
  47327. }
  47328. function forceUpdate() {
  47329. unref(bodyRef)?.$forceUpdate();
  47330. unref(headerRef)?.$forceUpdate();
  47331. }
  47332. watch(() => props.bodyWidth, () => {
  47333. if (isNumber(props.estimatedRowHeight)) bodyRef.value?.resetAfter({ columnIndex: 0 }, false);
  47334. });
  47335. return {
  47336. bodyRef,
  47337. forceUpdate,
  47338. fixedRowHeight,
  47339. gridHeight,
  47340. hasHeader,
  47341. headerHeight,
  47342. headerRef,
  47343. totalHeight,
  47344. itemKey,
  47345. onItemRendered,
  47346. resetAfterRowIndex,
  47347. scrollTo,
  47348. scrollToTop,
  47349. scrollToRow,
  47350. scrollLeft
  47351. };
  47352. };
  47353. const TableGrid = /* @__PURE__ */ defineComponent({
  47354. name: COMPONENT_NAME$5,
  47355. props: tableV2GridProps,
  47356. setup(props, { slots, expose }) {
  47357. const { ns } = inject(TableV2InjectionKey);
  47358. const { bodyRef, fixedRowHeight, gridHeight, hasHeader, headerRef, headerHeight, totalHeight, forceUpdate, itemKey, onItemRendered, resetAfterRowIndex, scrollTo, scrollToTop, scrollToRow, scrollLeft } = useTableGrid(props);
  47359. provide(TABLE_V2_GRID_INJECTION_KEY, scrollLeft);
  47360. onActivated(async () => {
  47361. await nextTick();
  47362. const scrollTop = bodyRef.value?.states.scrollTop;
  47363. scrollTop && scrollToTop(Math.round(scrollTop) + 1);
  47364. });
  47365. expose({
  47366. forceUpdate,
  47367. totalHeight,
  47368. scrollTo,
  47369. scrollToTop,
  47370. scrollToRow,
  47371. resetAfterRowIndex
  47372. });
  47373. const getColumnWidth = () => props.bodyWidth;
  47374. return () => {
  47375. const { cache, columns, data, fixedData, useIsScrolling, scrollbarAlwaysOn, scrollbarEndGap, scrollbarStartGap, style, rowHeight, bodyWidth, estimatedRowHeight, headerWidth, height, width, getRowHeight, onScroll } = props;
  47376. const isDynamicRowEnabled = isNumber(estimatedRowHeight);
  47377. const Grid = isDynamicRowEnabled ? DynamicSizeGrid : FixedSizeGrid;
  47378. const _headerHeight = unref(headerHeight);
  47379. return createVNode("div", {
  47380. "role": "table",
  47381. "class": [ns.e("table"), props.class],
  47382. "style": style
  47383. }, [createVNode(Grid, {
  47384. "ref": bodyRef,
  47385. "data": data,
  47386. "useIsScrolling": useIsScrolling,
  47387. "itemKey": itemKey,
  47388. "columnCache": 0,
  47389. "columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth,
  47390. "totalColumn": 1,
  47391. "totalRow": data.length,
  47392. "rowCache": cache,
  47393. "rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight,
  47394. "width": width,
  47395. "height": unref(gridHeight),
  47396. "class": ns.e("body"),
  47397. "role": "rowgroup",
  47398. "scrollbarStartGap": scrollbarStartGap,
  47399. "scrollbarEndGap": scrollbarEndGap,
  47400. "scrollbarAlwaysOn": scrollbarAlwaysOn,
  47401. "onScroll": onScroll,
  47402. "onItemRendered": onItemRendered,
  47403. "perfMode": false
  47404. }, { default: (params) => {
  47405. const rowData = data[params.rowIndex];
  47406. return slots.row?.({
  47407. ...params,
  47408. columns,
  47409. rowData
  47410. });
  47411. } }), unref(hasHeader) && createVNode(TableV2Header, {
  47412. "ref": headerRef,
  47413. "class": ns.e("header-wrapper"),
  47414. "columns": columns,
  47415. "headerData": data,
  47416. "headerHeight": props.headerHeight,
  47417. "fixedHeaderData": fixedData,
  47418. "rowWidth": headerWidth,
  47419. "rowHeight": rowHeight,
  47420. "width": width,
  47421. "height": Math.min(_headerHeight + unref(fixedRowHeight), height)
  47422. }, {
  47423. dynamic: slots.header,
  47424. fixed: slots.row
  47425. })]);
  47426. };
  47427. }
  47428. });
  47429. //#endregion
  47430. //#region ../../packages/components/table-v2/src/renderers/main-table.tsx
  47431. function _isSlot$5(s) {
  47432. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47433. }
  47434. const MainTable = (props, { slots }) => {
  47435. const { mainTableRef, ...rest } = props;
  47436. return createVNode(TableGrid, mergeProps({ "ref": mainTableRef }, rest), _isSlot$5(slots) ? slots : { default: () => [slots] });
  47437. };
  47438. //#endregion
  47439. //#region ../../packages/components/table-v2/src/renderers/left-table.tsx
  47440. function _isSlot$4(s) {
  47441. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47442. }
  47443. const LeftTable = (props, { slots }) => {
  47444. if (!props.columns.length) return;
  47445. const { leftTableRef, ...rest } = props;
  47446. return createVNode(TableGrid, mergeProps({ "ref": leftTableRef }, rest), _isSlot$4(slots) ? slots : { default: () => [slots] });
  47447. };
  47448. //#endregion
  47449. //#region ../../packages/components/table-v2/src/renderers/right-table.tsx
  47450. function _isSlot$3(s) {
  47451. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47452. }
  47453. const RightTable = (props, { slots }) => {
  47454. if (!props.columns.length) return;
  47455. const { rightTableRef, ...rest } = props;
  47456. return createVNode(TableGrid, mergeProps({ "ref": rightTableRef }, rest), _isSlot$3(slots) ? slots : { default: () => [slots] });
  47457. };
  47458. //#endregion
  47459. //#region ../../packages/components/table-v2/src/renderers/row.tsx
  47460. function _isSlot$2(s) {
  47461. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47462. }
  47463. const RowRenderer = (props, { slots }) => {
  47464. const { columns, columnsStyles, depthMap, expandColumnKey, expandedRowKeys, estimatedRowHeight, hasFixedColumns, rowData, rowIndex, style, isScrolling, rowProps, rowClass, rowKey, rowEventHandlers, ns, onRowHovered, onRowExpanded } = props;
  47465. const rowKls = tryCall(rowClass, {
  47466. columns,
  47467. rowData,
  47468. rowIndex
  47469. }, "");
  47470. const additionalProps = tryCall(rowProps, {
  47471. columns,
  47472. rowData,
  47473. rowIndex
  47474. });
  47475. const _rowKey = rowData[rowKey];
  47476. const depth = depthMap[_rowKey] || 0;
  47477. const canExpand = Boolean(expandColumnKey);
  47478. const isFixedRow = rowIndex < 0;
  47479. const kls = [
  47480. ns.e("row"),
  47481. rowKls,
  47482. ns.is("expanded", canExpand && expandedRowKeys.includes(_rowKey)),
  47483. ns.is("fixed", !depth && isFixedRow),
  47484. ns.is("customized", Boolean(slots.row)),
  47485. { [ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0 }
  47486. ];
  47487. const onRowHover = hasFixedColumns ? onRowHovered : void 0;
  47488. const _rowProps = {
  47489. ...additionalProps,
  47490. columns,
  47491. columnsStyles,
  47492. class: kls,
  47493. depth,
  47494. expandColumnKey,
  47495. estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
  47496. isScrolling,
  47497. rowIndex,
  47498. rowData,
  47499. rowKey: _rowKey,
  47500. rowEventHandlers,
  47501. style
  47502. };
  47503. const handlerMouseEnter = (e) => {
  47504. onRowHover?.({
  47505. hovered: true,
  47506. rowKey: _rowKey,
  47507. event: e,
  47508. rowData,
  47509. rowIndex
  47510. });
  47511. };
  47512. const handlerMouseLeave = (e) => {
  47513. onRowHover?.({
  47514. hovered: false,
  47515. rowKey: _rowKey,
  47516. event: e,
  47517. rowData,
  47518. rowIndex
  47519. });
  47520. };
  47521. return createVNode(TableV2Row, mergeProps(_rowProps, {
  47522. "onRowExpand": onRowExpanded,
  47523. "onMouseenter": handlerMouseEnter,
  47524. "onMouseleave": handlerMouseLeave,
  47525. "rowkey": _rowKey
  47526. }), _isSlot$2(slots) ? slots : { default: () => [slots] });
  47527. };
  47528. //#endregion
  47529. //#region ../../packages/components/table-v2/src/renderers/cell.tsx
  47530. const CellRenderer = ({ columns, column, columnIndex, depth, expandIconProps, isScrolling, rowData, rowIndex, style, expandedRowKeys, ns, t, cellProps: _cellProps, expandColumnKey, indentSize, iconSize, rowKey }, { slots }) => {
  47531. const cellStyle = enforceUnit(style);
  47532. if (column.placeholderSign === placeholderSign) return createVNode("div", {
  47533. "class": ns.em("row-cell", "placeholder"),
  47534. "style": cellStyle
  47535. }, null);
  47536. const { cellRenderer, dataKey, dataGetter } = column;
  47537. const cellData = isFunction$1(dataGetter) ? dataGetter({
  47538. columns,
  47539. column,
  47540. columnIndex,
  47541. rowData,
  47542. rowIndex
  47543. }) : get(rowData, dataKey ?? "");
  47544. const extraCellProps = tryCall(_cellProps, {
  47545. cellData,
  47546. columns,
  47547. column,
  47548. columnIndex,
  47549. rowIndex,
  47550. rowData
  47551. });
  47552. const cellProps = {
  47553. class: ns.e("cell-text"),
  47554. columns,
  47555. column,
  47556. columnIndex,
  47557. cellData,
  47558. isScrolling,
  47559. rowData,
  47560. rowIndex
  47561. };
  47562. const columnCellRenderer = componentToSlot(cellRenderer);
  47563. const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(TableV2Cell, cellProps, null)]);
  47564. const kls = [
  47565. ns.e("row-cell"),
  47566. column.class,
  47567. column.align === Alignment.CENTER && ns.is("align-center"),
  47568. column.align === Alignment.RIGHT && ns.is("align-right")
  47569. ];
  47570. const expandable = rowIndex >= 0 && expandColumnKey && column.key === expandColumnKey;
  47571. const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey]);
  47572. let IconOrPlaceholder;
  47573. const iconStyle = `margin-inline-start: ${depth * indentSize}px;`;
  47574. if (expandable) if (isObject$1(expandIconProps)) IconOrPlaceholder = createVNode(ExpandIcon, mergeProps(expandIconProps, {
  47575. "class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
  47576. "size": iconSize,
  47577. "expanded": expanded,
  47578. "ariaLabel": t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  47579. "style": iconStyle,
  47580. "expandable": true
  47581. }), null);
  47582. else IconOrPlaceholder = createVNode("div", { "style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ") }, null);
  47583. return createVNode("div", mergeProps({
  47584. "class": kls,
  47585. "style": cellStyle
  47586. }, extraCellProps, { "role": "cell" }), [IconOrPlaceholder, Cell]);
  47587. };
  47588. CellRenderer.inheritAttrs = false;
  47589. //#endregion
  47590. //#region ../../packages/components/table-v2/src/renderers/header.tsx
  47591. function _isSlot$1(s) {
  47592. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47593. }
  47594. const HeaderRenderer = ({ columns, columnsStyles, headerIndex, style, headerClass, headerProps, ns }, { slots }) => {
  47595. const param = {
  47596. columns,
  47597. headerIndex
  47598. };
  47599. const kls = [
  47600. ns.e("header-row"),
  47601. tryCall(headerClass, param, ""),
  47602. ns.is("customized", Boolean(slots.header))
  47603. ];
  47604. return createVNode(TableV2HeaderRow, {
  47605. ...tryCall(headerProps, param),
  47606. columnsStyles,
  47607. class: kls,
  47608. columns,
  47609. headerIndex,
  47610. style
  47611. }, _isSlot$1(slots) ? slots : { default: () => [slots] });
  47612. };
  47613. //#endregion
  47614. //#region ../../packages/components/table-v2/src/renderers/header-cell.tsx
  47615. const HeaderCellRenderer = (props, { slots }) => {
  47616. const { column, ns, t, style, onColumnSorted } = props;
  47617. const cellStyle = enforceUnit(style);
  47618. if (column.placeholderSign === placeholderSign) return createVNode("div", {
  47619. "class": ns.em("header-row-cell", "placeholder"),
  47620. "style": cellStyle
  47621. }, null);
  47622. const { headerCellRenderer, headerClass, sortable } = column;
  47623. /**
  47624. * render Cell children
  47625. */
  47626. const cellProps = {
  47627. ...props,
  47628. class: ns.e("header-cell-text")
  47629. };
  47630. const columnCellRenderer = componentToSlot(headerCellRenderer);
  47631. const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode(HeaderCell, cellProps, null)]);
  47632. /**
  47633. * Render cell container and sort indicator
  47634. */
  47635. const { sortBy, sortState, headerCellProps } = props;
  47636. let sorting, sortOrder, ariaSort;
  47637. if (sortState) {
  47638. const order = sortState[column.key];
  47639. sorting = Boolean(oppositeOrderMap[order]);
  47640. sortOrder = sorting ? order : SortOrder.ASC;
  47641. } else {
  47642. sorting = column.key === sortBy.key;
  47643. sortOrder = sorting ? sortBy.order : SortOrder.ASC;
  47644. }
  47645. if (sortOrder === SortOrder.ASC) ariaSort = "ascending";
  47646. else if (sortOrder === SortOrder.DESC) ariaSort = "descending";
  47647. else ariaSort = void 0;
  47648. const cellKls = [
  47649. ns.e("header-cell"),
  47650. tryCall(headerClass, props, ""),
  47651. column.align === Alignment.CENTER && ns.is("align-center"),
  47652. column.align === Alignment.RIGHT && ns.is("align-right"),
  47653. sortable && ns.is("sortable")
  47654. ];
  47655. return createVNode("div", mergeProps({
  47656. ...tryCall(headerCellProps, props),
  47657. onClick: column.sortable ? onColumnSorted : void 0,
  47658. ariaSort: sortable ? ariaSort : void 0,
  47659. class: cellKls,
  47660. style: cellStyle,
  47661. ["data-key"]: column.key
  47662. }, { "role": "columnheader" }), [Cell, sortable && createVNode(SortIcon, {
  47663. "class": [ns.e("sort-icon"), sorting && ns.is("sorting")],
  47664. "sortOrder": sortOrder,
  47665. "ariaLabel": t("el.table.sortLabel", { column: column.title || "" })
  47666. }, null)]);
  47667. };
  47668. //#endregion
  47669. //#region ../../packages/components/table-v2/src/renderers/footer.tsx
  47670. const Footer$1 = (props, { slots }) => {
  47671. return createVNode("div", {
  47672. "class": props.class,
  47673. "style": props.style
  47674. }, [slots.default?.()]);
  47675. };
  47676. Footer$1.displayName = "ElTableV2Footer";
  47677. //#endregion
  47678. //#region ../../packages/components/table-v2/src/renderers/empty.tsx
  47679. const Footer = (props, { slots }) => {
  47680. const defaultSlot = renderSlot(slots, "default", {}, () => [createVNode(ElEmpty, null, null)]);
  47681. return createVNode("div", {
  47682. "class": props.class,
  47683. "style": props.style
  47684. }, [defaultSlot]);
  47685. };
  47686. Footer.displayName = "ElTableV2Empty";
  47687. //#endregion
  47688. //#region ../../packages/components/table-v2/src/renderers/overlay.tsx
  47689. const Overlay = (props, { slots }) => {
  47690. return createVNode("div", {
  47691. "class": props.class,
  47692. "style": props.style
  47693. }, [slots.default?.()]);
  47694. };
  47695. Overlay.displayName = "ElTableV2Overlay";
  47696. //#endregion
  47697. //#region ../../packages/components/table-v2/src/table-v2.tsx
  47698. function _isSlot(s) {
  47699. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
  47700. }
  47701. const TableV2 = /* @__PURE__ */ defineComponent({
  47702. name: "ElTableV2",
  47703. props: tableV2Props,
  47704. setup(props, { slots, expose }) {
  47705. const ns = useNamespace("table-v2");
  47706. const { t } = useLocale();
  47707. const { columnsStyles, fixedColumnsOnLeft, fixedColumnsOnRight, mainColumns, mainTableHeight, fixedTableHeight, leftTableWidth, rightTableWidth, data, depthMap, expandedRowKeys, hasFixedColumns, mainTableRef, leftTableRef, rightTableRef, isDynamic, isResetting, isScrolling, bodyWidth, emptyStyle, rootStyle, footerHeight, showEmpty, scrollTo, scrollToLeft, scrollToTop, scrollToRow, getRowHeight, onColumnSorted, onRowHeightChange, onRowHovered, onRowExpanded, onRowsRendered, onScroll, onVerticalScroll } = useTable(props);
  47708. expose({
  47709. scrollTo,
  47710. scrollToLeft,
  47711. scrollToTop,
  47712. scrollToRow
  47713. });
  47714. provide(TableV2InjectionKey, {
  47715. ns,
  47716. isResetting,
  47717. isScrolling
  47718. });
  47719. return () => {
  47720. const { cache, cellProps, estimatedRowHeight, expandColumnKey, fixedData, headerHeight, headerClass, headerProps, headerCellProps, sortBy, sortState, rowHeight, rowClass, rowEventHandlers, rowKey, rowProps, scrollbarAlwaysOn, indentSize, iconSize, useIsScrolling, vScrollbarSize, width } = props;
  47721. const _data = unref(data);
  47722. const mainTableProps = {
  47723. cache,
  47724. class: ns.e("main"),
  47725. columns: unref(mainColumns),
  47726. data: _data,
  47727. fixedData,
  47728. estimatedRowHeight,
  47729. bodyWidth: unref(bodyWidth),
  47730. headerHeight,
  47731. headerWidth: unref(bodyWidth),
  47732. height: unref(mainTableHeight),
  47733. mainTableRef,
  47734. rowKey,
  47735. rowHeight,
  47736. scrollbarAlwaysOn,
  47737. scrollbarStartGap: 2,
  47738. scrollbarEndGap: vScrollbarSize,
  47739. useIsScrolling,
  47740. width,
  47741. getRowHeight,
  47742. onRowsRendered,
  47743. onScroll
  47744. };
  47745. const leftColumnsWidth = unref(leftTableWidth);
  47746. const _fixedTableHeight = unref(fixedTableHeight);
  47747. const leftTableProps = {
  47748. cache,
  47749. class: ns.e("left"),
  47750. columns: unref(fixedColumnsOnLeft),
  47751. data: _data,
  47752. fixedData,
  47753. estimatedRowHeight,
  47754. leftTableRef,
  47755. rowHeight,
  47756. bodyWidth: leftColumnsWidth,
  47757. headerWidth: leftColumnsWidth,
  47758. headerHeight,
  47759. height: _fixedTableHeight,
  47760. rowKey,
  47761. scrollbarAlwaysOn,
  47762. scrollbarStartGap: 2,
  47763. scrollbarEndGap: vScrollbarSize,
  47764. useIsScrolling,
  47765. width: leftColumnsWidth,
  47766. getRowHeight,
  47767. onScroll: onVerticalScroll
  47768. };
  47769. const rightColumnsWidth = unref(rightTableWidth);
  47770. const rightTableProps = {
  47771. cache,
  47772. class: ns.e("right"),
  47773. columns: unref(fixedColumnsOnRight),
  47774. data: _data,
  47775. fixedData,
  47776. estimatedRowHeight,
  47777. rightTableRef,
  47778. rowHeight,
  47779. bodyWidth: rightColumnsWidth,
  47780. headerWidth: rightColumnsWidth,
  47781. headerHeight,
  47782. height: _fixedTableHeight,
  47783. rowKey,
  47784. scrollbarAlwaysOn,
  47785. scrollbarStartGap: 2,
  47786. scrollbarEndGap: vScrollbarSize,
  47787. width: rightColumnsWidth,
  47788. style: `${ns.cssVarName("table-scrollbar-size")}: ${vScrollbarSize}px`,
  47789. useIsScrolling,
  47790. getRowHeight,
  47791. onScroll: onVerticalScroll
  47792. };
  47793. const _columnsStyles = unref(columnsStyles);
  47794. const tableRowProps = {
  47795. ns,
  47796. depthMap: unref(depthMap),
  47797. columnsStyles: _columnsStyles,
  47798. expandColumnKey,
  47799. expandedRowKeys: unref(expandedRowKeys),
  47800. estimatedRowHeight,
  47801. hasFixedColumns: unref(hasFixedColumns),
  47802. rowProps,
  47803. rowClass,
  47804. rowKey,
  47805. rowEventHandlers,
  47806. onRowHovered,
  47807. onRowExpanded,
  47808. onRowHeightChange
  47809. };
  47810. const tableCellProps = {
  47811. cellProps,
  47812. expandColumnKey,
  47813. indentSize,
  47814. iconSize,
  47815. rowKey,
  47816. expandedRowKeys: unref(expandedRowKeys),
  47817. ns,
  47818. t
  47819. };
  47820. const tableHeaderProps = {
  47821. ns,
  47822. headerClass,
  47823. headerProps,
  47824. columnsStyles: _columnsStyles
  47825. };
  47826. const tableHeaderCellProps = {
  47827. ns,
  47828. t,
  47829. sortBy,
  47830. sortState,
  47831. headerCellProps,
  47832. onColumnSorted
  47833. };
  47834. const tableSlots = {
  47835. row: (props) => createVNode(RowRenderer, mergeProps(props, tableRowProps), {
  47836. row: slots.row,
  47837. cell: (props) => {
  47838. let _slot;
  47839. return slots.cell ? createVNode(CellRenderer, mergeProps(props, tableCellProps, { "style": _columnsStyles[props.column.key] }), _isSlot(_slot = slots.cell(props)) ? _slot : { default: () => [_slot] }) : createVNode(CellRenderer, mergeProps(props, tableCellProps, { "style": _columnsStyles[props.column.key] }), null);
  47840. }
  47841. }),
  47842. header: (props) => createVNode(HeaderRenderer, mergeProps(props, tableHeaderProps), {
  47843. header: slots.header,
  47844. cell: (props) => {
  47845. let _slot2;
  47846. return slots["header-cell"] ? createVNode(HeaderCellRenderer, mergeProps(props, tableHeaderCellProps, { "style": _columnsStyles[props.column.key] }), _isSlot(_slot2 = slots["header-cell"](props)) ? _slot2 : { default: () => [_slot2] }) : createVNode(HeaderCellRenderer, mergeProps(props, tableHeaderCellProps, { "style": _columnsStyles[props.column.key] }), null);
  47847. }
  47848. })
  47849. };
  47850. const rootKls = [
  47851. props.class,
  47852. ns.b(),
  47853. ns.e("root"),
  47854. ns.is("dynamic", unref(isDynamic))
  47855. ];
  47856. const footerProps = {
  47857. class: ns.e("footer"),
  47858. style: unref(footerHeight)
  47859. };
  47860. return createVNode("div", {
  47861. "class": rootKls,
  47862. "style": unref(rootStyle)
  47863. }, [
  47864. createVNode(MainTable, mainTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47865. createVNode(LeftTable, leftTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47866. createVNode(RightTable, rightTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47867. slots.footer && createVNode(Footer$1, footerProps, { default: slots.footer }),
  47868. unref(showEmpty) && createVNode(Footer, {
  47869. "class": ns.e("empty"),
  47870. "style": unref(emptyStyle)
  47871. }, { default: slots.empty }),
  47872. slots.overlay && createVNode(Overlay, { "class": ns.e("overlay") }, { default: slots.overlay })
  47873. ]);
  47874. };
  47875. }
  47876. });
  47877. //#endregion
  47878. //#region ../../packages/components/table-v2/src/auto-resizer.ts
  47879. const autoResizerProps = buildProps({
  47880. disableWidth: Boolean,
  47881. disableHeight: Boolean,
  47882. onResize: { type: definePropType(Function) }
  47883. });
  47884. //#endregion
  47885. //#region ../../packages/components/table-v2/src/components/auto-resizer.tsx
  47886. const AutoResizer = /* @__PURE__ */ defineComponent({
  47887. name: "ElAutoResizer",
  47888. props: autoResizerProps,
  47889. setup(props, { slots }) {
  47890. const ns = useNamespace("auto-resizer");
  47891. const { height, width, sizer } = useAutoResize(props);
  47892. const style = {
  47893. width: "100%",
  47894. height: "100%"
  47895. };
  47896. return () => {
  47897. return createVNode("div", {
  47898. "ref": sizer,
  47899. "class": ns.b(),
  47900. "style": style
  47901. }, [slots.default?.({
  47902. height: height.value,
  47903. width: width.value
  47904. })]);
  47905. };
  47906. }
  47907. });
  47908. //#endregion
  47909. //#region ../../packages/components/table-v2/index.ts
  47910. const ElTableV2 = withInstall(TableV2);
  47911. const ElAutoResizer = withInstall(AutoResizer);
  47912. //#endregion
  47913. //#region ../../packages/components/tabs/src/constants.ts
  47914. const tabsRootContextKey = Symbol("tabsRootContextKey");
  47915. //#endregion
  47916. //#region ../../packages/components/tabs/src/tab-bar.ts
  47917. /**
  47918. * @deprecated Removed after 3.0.0, Use `TabBarProps` instead.
  47919. */
  47920. const tabBarProps = buildProps({
  47921. tabs: {
  47922. type: definePropType(Array),
  47923. default: () => mutable([])
  47924. },
  47925. tabRefs: {
  47926. type: definePropType(Object),
  47927. default: () => mutable({})
  47928. }
  47929. });
  47930. //#endregion
  47931. //#region ../../packages/components/tabs/src/tab-bar.vue?vue&type=script&setup=true&lang.ts
  47932. const COMPONENT_NAME$4 = "ElTabBar";
  47933. var tab_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  47934. name: COMPONENT_NAME$4,
  47935. __name: "tab-bar",
  47936. props: tabBarProps,
  47937. setup(__props, { expose: __expose }) {
  47938. const props = __props;
  47939. const rootTabs = inject(tabsRootContextKey);
  47940. if (!rootTabs) throwError(COMPONENT_NAME$4, "<el-tabs><el-tab-bar /></el-tabs>");
  47941. const ns = useNamespace("tabs");
  47942. const barRef = ref();
  47943. const barStyle = ref();
  47944. /**
  47945. * when defaultValue is not set, the bar is always shown.
  47946. *
  47947. * when defaultValue is set, the bar will be hidden until style is calculated
  47948. * to avoid the bar showing in the wrong position on initial render.
  47949. */
  47950. const renderActiveBar = computed(() => isUndefined(rootTabs.props.defaultValue) || Boolean(barStyle.value?.transform));
  47951. const getBarStyle = () => {
  47952. let offset = 0;
  47953. let tabSize = 0;
  47954. const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
  47955. const sizeDir = sizeName === "width" ? "x" : "y";
  47956. const position = sizeDir === "x" ? "left" : "top";
  47957. props.tabs.every((tab) => {
  47958. if (isUndefined(tab.paneName)) return false;
  47959. const $el = props.tabRefs[tab.paneName];
  47960. if (!$el) return false;
  47961. if (!tab.active) return true;
  47962. offset = $el[`offset${capitalize(position)}`];
  47963. tabSize = $el[`client${capitalize(sizeName)}`];
  47964. const tabStyles = window.getComputedStyle($el);
  47965. if (sizeName === "width") {
  47966. tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
  47967. offset += Number.parseFloat(tabStyles.paddingLeft);
  47968. }
  47969. return false;
  47970. });
  47971. return {
  47972. [sizeName]: `${tabSize}px`,
  47973. transform: `translate${capitalize(sizeDir)}(${offset}px)`
  47974. };
  47975. };
  47976. const update = () => barStyle.value = getBarStyle();
  47977. const tabObservers = [];
  47978. const observerTabs = () => {
  47979. tabObservers.forEach((observer) => observer.stop());
  47980. tabObservers.length = 0;
  47981. Object.values(props.tabRefs).forEach((tab) => {
  47982. tabObservers.push(useResizeObserver(tab, update));
  47983. });
  47984. };
  47985. watch(() => props.tabs, async () => {
  47986. await nextTick();
  47987. update();
  47988. observerTabs();
  47989. }, { immediate: true });
  47990. const barObserver = useResizeObserver(barRef, () => update());
  47991. onBeforeUnmount(() => {
  47992. tabObservers.forEach((observer) => observer.stop());
  47993. tabObservers.length = 0;
  47994. barObserver.stop();
  47995. });
  47996. __expose({
  47997. ref: barRef,
  47998. update
  47999. });
  48000. return (_ctx, _cache) => {
  48001. return renderActiveBar.value ? (openBlock(), createElementBlock("div", {
  48002. key: 0,
  48003. ref_key: "barRef",
  48004. ref: barRef,
  48005. class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
  48006. style: normalizeStyle(barStyle.value)
  48007. }, null, 6)) : createCommentVNode("v-if", true);
  48008. };
  48009. }
  48010. });
  48011. //#endregion
  48012. //#region ../../packages/components/tabs/src/tab-bar.vue
  48013. var tab_bar_default = tab_bar_vue_vue_type_script_setup_true_lang_default;
  48014. //#endregion
  48015. //#region ../../packages/components/tabs/src/tab-nav.tsx
  48016. const tabNavProps = buildProps({
  48017. panes: {
  48018. type: definePropType(Array),
  48019. default: () => mutable([])
  48020. },
  48021. currentName: {
  48022. type: [String, Number],
  48023. default: ""
  48024. },
  48025. editable: Boolean,
  48026. type: {
  48027. type: String,
  48028. values: [
  48029. "card",
  48030. "border-card",
  48031. ""
  48032. ],
  48033. default: ""
  48034. },
  48035. stretch: Boolean,
  48036. tabindex: {
  48037. type: [String, Number],
  48038. default: void 0
  48039. }
  48040. });
  48041. const tabNavEmits = {
  48042. tabClick: (tab, tabName, ev) => ev instanceof Event,
  48043. tabRemove: (tab, ev) => ev instanceof Event
  48044. };
  48045. const COMPONENT_NAME$3 = "ElTabNav";
  48046. const TabNav = /* @__PURE__ */ defineComponent({
  48047. name: COMPONENT_NAME$3,
  48048. props: tabNavProps,
  48049. emits: tabNavEmits,
  48050. setup(props, { expose, emit }) {
  48051. const rootTabs = inject(tabsRootContextKey);
  48052. if (!rootTabs) throwError(COMPONENT_NAME$3, `<el-tabs><tab-nav /></el-tabs>`);
  48053. const ns = useNamespace("tabs");
  48054. const visibility = useDocumentVisibility();
  48055. const focused = useWindowFocus();
  48056. const navScroll$ = ref();
  48057. const nav$ = ref();
  48058. const el$ = ref();
  48059. const tabRefsMap = ref({});
  48060. const tabBarRef = ref();
  48061. const scrollable = ref(false);
  48062. const navOffset = ref(0);
  48063. const isFocus = ref(false);
  48064. const focusable = ref(true);
  48065. const tracker = shallowRef();
  48066. const isHorizontal = computed(() => ["top", "bottom"].includes(rootTabs.props.tabPosition));
  48067. const sizeName = computed(() => isHorizontal.value ? "width" : "height");
  48068. const navStyle = computed(() => {
  48069. return { transform: `translate${sizeName.value === "width" ? "X" : "Y"}(-${navOffset.value}px)` };
  48070. });
  48071. const { width: navContainerWidth, height: navContainerHeight } = useElementSize(navScroll$);
  48072. const { width: navWidth, height: navHeight } = useElementSize(nav$, {
  48073. width: 0,
  48074. height: 0
  48075. }, { box: "border-box" });
  48076. const navContainerSize = computed(() => isHorizontal.value ? navContainerWidth.value : navContainerHeight.value);
  48077. const navSize = computed(() => isHorizontal.value ? navWidth.value : navHeight.value);
  48078. const { onWheel } = useWheel({
  48079. atStartEdge: computed(() => navOffset.value <= 0),
  48080. atEndEdge: computed(() => navSize.value - navOffset.value <= navContainerSize.value),
  48081. layout: computed(() => isHorizontal.value ? "horizontal" : "vertical")
  48082. }, (offset) => {
  48083. navOffset.value = clamp$1(navOffset.value + offset, 0, navSize.value - navContainerSize.value);
  48084. });
  48085. const scrollPrev = () => {
  48086. if (!navScroll$.value) return;
  48087. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48088. const currentOffset = navOffset.value;
  48089. if (!currentOffset) return;
  48090. navOffset.value = currentOffset > containerSize ? currentOffset - containerSize : 0;
  48091. };
  48092. const scrollNext = () => {
  48093. if (!navScroll$.value || !nav$.value) return;
  48094. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  48095. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48096. const currentOffset = navOffset.value;
  48097. if (navSize - currentOffset <= containerSize) return;
  48098. navOffset.value = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  48099. };
  48100. const scrollToActiveTab = async () => {
  48101. const nav = nav$.value;
  48102. if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return;
  48103. await nextTick();
  48104. const activeTab = tabRefsMap.value[props.currentName];
  48105. if (!activeTab) return;
  48106. const navScroll = navScroll$.value;
  48107. const activeTabBounding = activeTab.getBoundingClientRect();
  48108. const navScrollBounding = navScroll.getBoundingClientRect();
  48109. const maxOffset = isHorizontal.value ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  48110. const currentOffset = navOffset.value;
  48111. let newOffset = currentOffset;
  48112. if (isHorizontal.value) {
  48113. if (activeTabBounding.left < navScrollBounding.left) newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  48114. if (activeTabBounding.right > navScrollBounding.right) newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  48115. } else {
  48116. if (activeTabBounding.top < navScrollBounding.top) newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  48117. if (activeTabBounding.bottom > navScrollBounding.bottom) newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  48118. }
  48119. newOffset = Math.max(newOffset, 0);
  48120. navOffset.value = Math.min(newOffset, maxOffset);
  48121. };
  48122. const update = () => {
  48123. if (!nav$.value || !navScroll$.value) return;
  48124. props.stretch && tabBarRef.value?.update();
  48125. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  48126. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48127. const currentOffset = navOffset.value;
  48128. if (containerSize < navSize) {
  48129. scrollable.value = scrollable.value || {};
  48130. scrollable.value.prev = currentOffset;
  48131. scrollable.value.next = currentOffset + containerSize < navSize;
  48132. if (navSize - currentOffset < containerSize) navOffset.value = navSize - containerSize;
  48133. } else {
  48134. scrollable.value = false;
  48135. if (currentOffset > 0) navOffset.value = 0;
  48136. }
  48137. };
  48138. const changeTab = (event) => {
  48139. const code = getEventCode(event);
  48140. let step = 0;
  48141. switch (code) {
  48142. case EVENT_CODE.left:
  48143. case EVENT_CODE.up:
  48144. step = -1;
  48145. break;
  48146. case EVENT_CODE.right:
  48147. case EVENT_CODE.down:
  48148. step = 1;
  48149. break;
  48150. default: return;
  48151. }
  48152. const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
  48153. let nextIndex = tabList.indexOf(event.target) + step;
  48154. if (nextIndex < 0) nextIndex = tabList.length - 1;
  48155. else if (nextIndex >= tabList.length) nextIndex = 0;
  48156. tabList[nextIndex].focus({ preventScroll: true });
  48157. tabList[nextIndex].click();
  48158. setFocus();
  48159. };
  48160. const setFocus = () => {
  48161. if (focusable.value) isFocus.value = true;
  48162. };
  48163. const removeFocus = () => isFocus.value = false;
  48164. const setRefs = (el, key) => {
  48165. tabRefsMap.value[key] = el;
  48166. };
  48167. const focusActiveTab = async () => {
  48168. await nextTick();
  48169. tabRefsMap.value[props.currentName]?.focus({ preventScroll: true });
  48170. };
  48171. watch(visibility, (visibility) => {
  48172. if (visibility === "hidden") focusable.value = false;
  48173. else if (visibility === "visible") setTimeout(() => focusable.value = true, 50);
  48174. });
  48175. watch(focused, (focused) => {
  48176. if (focused) setTimeout(() => focusable.value = true, 50);
  48177. else focusable.value = false;
  48178. });
  48179. useResizeObserver(el$, () => {
  48180. rAF(update);
  48181. });
  48182. onMounted(() => setTimeout(() => scrollToActiveTab(), 0));
  48183. onUpdated(() => update());
  48184. expose({
  48185. scrollToActiveTab,
  48186. removeFocus,
  48187. focusActiveTab,
  48188. tabListRef: nav$,
  48189. tabBarRef,
  48190. scheduleRender: () => triggerRef(tracker)
  48191. });
  48192. return () => {
  48193. const scrollBtn = scrollable.value ? [createVNode("span", {
  48194. "class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
  48195. "onClick": scrollPrev
  48196. }, [createVNode(ElIcon, null, { default: () => [createVNode(arrow_left_default, null, null)] })]), createVNode("span", {
  48197. "class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
  48198. "onClick": scrollNext
  48199. }, [createVNode(ElIcon, null, { default: () => [createVNode(arrow_right_default, null, null)] })])] : null;
  48200. const tabs = props.panes.map((pane, index) => {
  48201. const uid = pane.uid;
  48202. const disabled = pane.props.disabled;
  48203. const tabName = pane.props.name ?? pane.index ?? `${index}`;
  48204. const closable = !disabled && (pane.isClosable || pane.props.closable !== false && props.editable);
  48205. pane.index = `${index}`;
  48206. const btnClose = closable ? createVNode(ElIcon, {
  48207. "class": "is-icon-close",
  48208. "onClick": (ev) => emit("tabRemove", pane, ev)
  48209. }, { default: () => [createVNode(close_default, null, null)] }) : null;
  48210. const tabLabelContent = pane.slots.label?.() || pane.props.label;
  48211. const tabindex = !disabled && pane.active ? props.tabindex ?? rootTabs.props.tabindex : -1;
  48212. return createVNode("div", {
  48213. "ref": (el) => setRefs(el, tabName),
  48214. "class": [
  48215. ns.e("item"),
  48216. ns.is(rootTabs.props.tabPosition),
  48217. ns.is("active", pane.active),
  48218. ns.is("disabled", disabled),
  48219. ns.is("closable", closable),
  48220. ns.is("focus", isFocus.value)
  48221. ],
  48222. "id": `tab-${tabName}`,
  48223. "key": `tab-${uid}`,
  48224. "aria-controls": `pane-${tabName}`,
  48225. "role": "tab",
  48226. "aria-selected": pane.active,
  48227. "tabindex": tabindex,
  48228. "onFocus": () => setFocus(),
  48229. "onBlur": () => removeFocus(),
  48230. "onClick": (ev) => {
  48231. removeFocus();
  48232. emit("tabClick", pane, tabName, ev);
  48233. },
  48234. "onKeydown": (ev) => {
  48235. const code = getEventCode(ev);
  48236. if (closable && (code === EVENT_CODE.delete || code === EVENT_CODE.backspace)) emit("tabRemove", pane, ev);
  48237. }
  48238. }, [...[tabLabelContent, btnClose]]);
  48239. });
  48240. tracker.value;
  48241. return createVNode("div", {
  48242. "ref": el$,
  48243. "class": [
  48244. ns.e("nav-wrap"),
  48245. ns.is("scrollable", !!scrollable.value),
  48246. ns.is(rootTabs.props.tabPosition)
  48247. ]
  48248. }, [scrollBtn, createVNode("div", {
  48249. "class": ns.e("nav-scroll"),
  48250. "ref": navScroll$
  48251. }, [props.panes.length > 0 ? createVNode("div", {
  48252. "class": [
  48253. ns.e("nav"),
  48254. ns.is(rootTabs.props.tabPosition),
  48255. ns.is("stretch", props.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition))
  48256. ],
  48257. "ref": nav$,
  48258. "style": navStyle.value,
  48259. "role": "tablist",
  48260. "onKeydown": changeTab,
  48261. "onWheel": onWheel
  48262. }, [...[!props.type ? createVNode(tab_bar_default, {
  48263. "ref": tabBarRef,
  48264. "tabs": [...props.panes],
  48265. "tabRefs": tabRefsMap.value
  48266. }, null) : null, tabs]]) : null])]);
  48267. };
  48268. }
  48269. });
  48270. //#endregion
  48271. //#region ../../packages/components/tabs/src/tabs.tsx
  48272. const tabsProps = buildProps({
  48273. type: {
  48274. type: String,
  48275. values: [
  48276. "card",
  48277. "border-card",
  48278. ""
  48279. ],
  48280. default: ""
  48281. },
  48282. closable: Boolean,
  48283. addable: Boolean,
  48284. modelValue: { type: [String, Number] },
  48285. defaultValue: { type: [String, Number] },
  48286. editable: Boolean,
  48287. tabPosition: {
  48288. type: String,
  48289. values: [
  48290. "top",
  48291. "right",
  48292. "bottom",
  48293. "left"
  48294. ],
  48295. default: "top"
  48296. },
  48297. beforeLeave: {
  48298. type: definePropType(Function),
  48299. default: () => true
  48300. },
  48301. stretch: Boolean,
  48302. tabindex: {
  48303. type: [String, Number],
  48304. default: 0
  48305. }
  48306. });
  48307. const isPaneName = (value) => isString(value) || isNumber(value);
  48308. const tabsEmits = {
  48309. [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
  48310. tabClick: (pane, ev) => ev instanceof Event,
  48311. tabChange: (name) => isPaneName(name),
  48312. edit: (paneName, action) => ["remove", "add"].includes(action),
  48313. tabRemove: (name) => isPaneName(name),
  48314. tabAdd: () => true
  48315. };
  48316. const Tabs = /* @__PURE__ */ defineComponent({
  48317. name: "ElTabs",
  48318. props: tabsProps,
  48319. emits: tabsEmits,
  48320. setup(props, { emit, slots, expose }) {
  48321. const ns = useNamespace("tabs");
  48322. const isVertical = computed(() => ["left", "right"].includes(props.tabPosition));
  48323. const { children: panes, addChild: registerPane, removeChild: unregisterPane, ChildrenSorter: PanesSorter } = useOrderedChildren(getCurrentInstance(), "ElTabPane");
  48324. const nav$ = ref();
  48325. const currentName = ref((isUndefined(props.modelValue) ? props.defaultValue : props.modelValue) ?? "0");
  48326. const setCurrentName = async (value, trigger = false) => {
  48327. if (currentName.value === value || isUndefined(value)) return;
  48328. try {
  48329. let canLeave;
  48330. if (props.beforeLeave) {
  48331. const result = props.beforeLeave(value, currentName.value);
  48332. canLeave = result instanceof Promise ? await result : result;
  48333. } else canLeave = true;
  48334. if (canLeave !== false) {
  48335. const isFocusInsidePane = panes.value.find((item) => item.paneName === currentName.value)?.isFocusInsidePane();
  48336. currentName.value = value;
  48337. if (trigger) {
  48338. emit(UPDATE_MODEL_EVENT, value);
  48339. emit("tabChange", value);
  48340. }
  48341. nav$.value?.removeFocus?.();
  48342. if (isFocusInsidePane) nav$.value?.focusActiveTab();
  48343. }
  48344. } catch {}
  48345. };
  48346. const handleTabClick = (tab, tabName, event) => {
  48347. if (tab.props.disabled) return;
  48348. emit("tabClick", tab, event);
  48349. setCurrentName(tabName, true);
  48350. };
  48351. const handleTabRemove = (pane, ev) => {
  48352. if (pane.props.disabled || isUndefined(pane.props.name)) return;
  48353. ev.stopPropagation();
  48354. emit("edit", pane.props.name, "remove");
  48355. emit("tabRemove", pane.props.name);
  48356. };
  48357. const handleTabAdd = () => {
  48358. emit("edit", void 0, "add");
  48359. emit("tabAdd");
  48360. };
  48361. const handleKeydown = (event) => {
  48362. const code = getEventCode(event);
  48363. if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(code)) handleTabAdd();
  48364. };
  48365. const swapChildren = (vnode) => {
  48366. const actualFirstChild = vnode.el.firstChild;
  48367. const firstChild = ["bottom", "right"].includes(props.tabPosition) ? vnode.children[0].el : vnode.children[1].el;
  48368. if (actualFirstChild !== firstChild) actualFirstChild.before(firstChild);
  48369. };
  48370. watch(() => props.modelValue, (modelValue) => setCurrentName(modelValue));
  48371. watch(currentName, async () => {
  48372. await nextTick();
  48373. nav$.value?.scrollToActiveTab();
  48374. });
  48375. provide(tabsRootContextKey, {
  48376. props,
  48377. currentName,
  48378. registerPane,
  48379. unregisterPane,
  48380. nav$
  48381. });
  48382. expose({
  48383. currentName,
  48384. get tabNavRef() {
  48385. return omit(nav$.value, ["scheduleRender"]);
  48386. }
  48387. });
  48388. return () => {
  48389. const addSlot = slots["add-icon"];
  48390. const newButton = props.editable || props.addable ? createVNode("div", {
  48391. "class": [ns.e("new-tab"), isVertical.value && ns.e("new-tab-vertical")],
  48392. "tabindex": props.tabindex,
  48393. "onClick": handleTabAdd,
  48394. "onKeydown": handleKeydown
  48395. }, [addSlot ? renderSlot(slots, "add-icon") : createVNode(ElIcon, { "class": ns.is("icon-plus") }, { default: () => [createVNode(plus_default, null, null)] })]) : null;
  48396. const tabNav = () => createVNode(TabNav, {
  48397. "ref": nav$,
  48398. "currentName": currentName.value,
  48399. "editable": props.editable,
  48400. "type": props.type,
  48401. "panes": panes.value,
  48402. "stretch": props.stretch,
  48403. "onTabClick": handleTabClick,
  48404. "onTabRemove": handleTabRemove
  48405. }, null);
  48406. const header = createVNode("div", { "class": [
  48407. ns.e("header"),
  48408. isVertical.value && ns.e("header-vertical"),
  48409. ns.is(props.tabPosition)
  48410. ] }, [createVNode(PanesSorter, null, {
  48411. default: tabNav,
  48412. $stable: true
  48413. }), newButton]);
  48414. const panels = createVNode("div", { "class": ns.e("content") }, [renderSlot(slots, "default")]);
  48415. return createVNode("div", {
  48416. "class": [
  48417. ns.b(),
  48418. ns.m(props.tabPosition),
  48419. {
  48420. [ns.m("card")]: props.type === "card",
  48421. [ns.m("border-card")]: props.type === "border-card"
  48422. }
  48423. ],
  48424. "onVnodeMounted": swapChildren,
  48425. "onVnodeUpdated": swapChildren
  48426. }, [panels, header]);
  48427. };
  48428. }
  48429. });
  48430. //#endregion
  48431. //#region ../../packages/components/tabs/src/tab-pane.ts
  48432. /**
  48433. * @deprecated Removed after 3.0.0, Use `TabPaneProps` instead.
  48434. */
  48435. const tabPaneProps = buildProps({
  48436. label: {
  48437. type: String,
  48438. default: ""
  48439. },
  48440. name: { type: [String, Number] },
  48441. closable: {
  48442. type: Boolean,
  48443. default: void 0
  48444. },
  48445. disabled: Boolean,
  48446. lazy: Boolean
  48447. });
  48448. //#endregion
  48449. //#region ../../packages/components/tabs/src/tab-pane.vue?vue&type=script&setup=true&lang.ts
  48450. const _hoisted_1$14 = [
  48451. "id",
  48452. "aria-hidden",
  48453. "aria-labelledby"
  48454. ];
  48455. const COMPONENT_NAME$2 = "ElTabPane";
  48456. var tab_pane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  48457. name: COMPONENT_NAME$2,
  48458. __name: "tab-pane",
  48459. props: tabPaneProps,
  48460. setup(__props) {
  48461. const props = __props;
  48462. const instance = getCurrentInstance();
  48463. const slots = useSlots();
  48464. const tabsRoot = inject(tabsRootContextKey);
  48465. if (!tabsRoot) throwError(COMPONENT_NAME$2, "usage: <el-tabs><el-tab-pane /></el-tabs/>");
  48466. const ns = useNamespace("tab-pane");
  48467. const paneRef = ref();
  48468. const index = ref();
  48469. const isClosable = computed(() => props.closable ?? tabsRoot.props.closable);
  48470. const active = computed(() => tabsRoot.currentName.value === (props.name ?? index.value));
  48471. const loaded = ref(active.value);
  48472. const paneName = computed(() => props.name ?? index.value);
  48473. const shouldBeRender = computed(() => !props.lazy || loaded.value || active.value);
  48474. const isFocusInsidePane = () => {
  48475. return paneRef.value?.contains(document.activeElement);
  48476. };
  48477. watch(active, (val) => {
  48478. if (val) loaded.value = true;
  48479. });
  48480. const pane = reactive({
  48481. uid: instance.uid,
  48482. getVnode: () => instance.vnode,
  48483. slots,
  48484. props,
  48485. paneName,
  48486. active,
  48487. index,
  48488. isClosable,
  48489. isFocusInsidePane
  48490. });
  48491. tabsRoot.registerPane(pane);
  48492. onBeforeUnmount(() => {
  48493. tabsRoot.unregisterPane(pane);
  48494. });
  48495. onBeforeUpdate(() => {
  48496. if (slots.label) tabsRoot.nav$.value?.scheduleRender();
  48497. });
  48498. return (_ctx, _cache) => {
  48499. return shouldBeRender.value ? withDirectives((openBlock(), createElementBlock("div", {
  48500. key: 0,
  48501. id: `pane-${paneName.value}`,
  48502. ref_key: "paneRef",
  48503. ref: paneRef,
  48504. class: normalizeClass(unref(ns).b()),
  48505. role: "tabpanel",
  48506. "aria-hidden": !active.value,
  48507. "aria-labelledby": `tab-${paneName.value}`
  48508. }, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_1$14)), [[vShow, active.value]]) : createCommentVNode("v-if", true);
  48509. };
  48510. }
  48511. });
  48512. //#endregion
  48513. //#region ../../packages/components/tabs/src/tab-pane.vue
  48514. var tab_pane_default = tab_pane_vue_vue_type_script_setup_true_lang_default;
  48515. //#endregion
  48516. //#region ../../packages/components/tabs/index.ts
  48517. const ElTabs = withInstall(Tabs, { TabPane: tab_pane_default });
  48518. const ElTabPane = withNoopInstall(tab_pane_default);
  48519. //#endregion
  48520. //#region ../../packages/components/text/src/text.ts
  48521. /**
  48522. * @deprecated Removed after 3.0.0, Use `TextProps` instead.
  48523. */
  48524. const textProps = buildProps({
  48525. type: {
  48526. type: String,
  48527. values: [
  48528. "primary",
  48529. "success",
  48530. "info",
  48531. "warning",
  48532. "danger",
  48533. ""
  48534. ],
  48535. default: ""
  48536. },
  48537. size: {
  48538. type: String,
  48539. values: componentSizes,
  48540. default: ""
  48541. },
  48542. truncated: Boolean,
  48543. lineClamp: { type: [String, Number] },
  48544. tag: {
  48545. type: String,
  48546. default: "span"
  48547. }
  48548. });
  48549. //#endregion
  48550. //#region ../../packages/components/text/src/text.vue?vue&type=script&setup=true&lang.ts
  48551. var text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  48552. name: "ElText",
  48553. __name: "text",
  48554. props: textProps,
  48555. setup(__props) {
  48556. const props = __props;
  48557. const textRef = ref();
  48558. const textSize = useFormSize();
  48559. const ns = useNamespace("text");
  48560. const textKls = computed(() => [
  48561. ns.b(),
  48562. ns.m(props.type),
  48563. ns.m(textSize.value),
  48564. ns.is("truncated", props.truncated),
  48565. ns.is("line-clamp", !isUndefined(props.lineClamp))
  48566. ]);
  48567. const bindTitle = () => {
  48568. if (useAttrs$1().title) return;
  48569. let shouldAddTitle = false;
  48570. const text = textRef.value?.textContent || "";
  48571. if (props.truncated) {
  48572. const width = textRef.value?.offsetWidth;
  48573. const scrollWidth = textRef.value?.scrollWidth;
  48574. if (width && scrollWidth && scrollWidth > width) shouldAddTitle = true;
  48575. } else if (!isUndefined(props.lineClamp)) {
  48576. const height = textRef.value?.offsetHeight;
  48577. const scrollHeight = textRef.value?.scrollHeight;
  48578. if (height && scrollHeight && scrollHeight > height) shouldAddTitle = true;
  48579. }
  48580. if (shouldAddTitle) textRef.value?.setAttribute("title", text);
  48581. else textRef.value?.removeAttribute("title");
  48582. };
  48583. onMounted(bindTitle);
  48584. onUpdated(bindTitle);
  48585. return (_ctx, _cache) => {
  48586. return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
  48587. ref_key: "textRef",
  48588. ref: textRef,
  48589. class: normalizeClass(textKls.value),
  48590. style: normalizeStyle({ "-webkit-line-clamp": __props.lineClamp })
  48591. }, {
  48592. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  48593. _: 3
  48594. }, 8, ["class", "style"]);
  48595. };
  48596. }
  48597. });
  48598. //#endregion
  48599. //#region ../../packages/components/text/src/text.vue
  48600. var text_default = text_vue_vue_type_script_setup_true_lang_default;
  48601. //#endregion
  48602. //#region ../../packages/components/text/index.ts
  48603. const ElText = withInstall(text_default);
  48604. //#endregion
  48605. //#region ../../packages/components/time-select/src/time-select.ts
  48606. const DEFAULT_STEP = "00:30";
  48607. /**
  48608. * @deprecated Removed after 3.0.0, Use `TimeSelectProps` instead.
  48609. */
  48610. const timeSelectProps = buildProps({
  48611. format: {
  48612. type: String,
  48613. default: "HH:mm"
  48614. },
  48615. modelValue: { type: definePropType(String) },
  48616. disabled: {
  48617. type: Boolean,
  48618. default: void 0
  48619. },
  48620. editable: {
  48621. type: Boolean,
  48622. default: true
  48623. },
  48624. effect: {
  48625. type: definePropType(String),
  48626. default: "light"
  48627. },
  48628. clearable: {
  48629. type: Boolean,
  48630. default: true
  48631. },
  48632. size: useSizeProp,
  48633. placeholder: String,
  48634. start: {
  48635. type: String,
  48636. default: "09:00"
  48637. },
  48638. end: {
  48639. type: String,
  48640. default: "18:00"
  48641. },
  48642. step: {
  48643. type: String,
  48644. default: DEFAULT_STEP
  48645. },
  48646. minTime: { type: definePropType(String) },
  48647. maxTime: { type: definePropType(String) },
  48648. includeEndTime: Boolean,
  48649. name: String,
  48650. prefixIcon: {
  48651. type: definePropType([String, Object]),
  48652. default: () => clock_default
  48653. },
  48654. clearIcon: {
  48655. type: definePropType([String, Object]),
  48656. default: () => circle_close_default
  48657. },
  48658. popperClass: {
  48659. type: String,
  48660. default: ""
  48661. },
  48662. popperStyle: { type: definePropType([String, Object]) },
  48663. ...useEmptyValuesProps
  48664. });
  48665. //#endregion
  48666. //#region ../../packages/components/time-select/src/utils.ts
  48667. const parseTime = (time) => {
  48668. const values = (time || "").split(":");
  48669. if (values.length >= 2) {
  48670. let hours = Number.parseInt(values[0], 10);
  48671. const minutes = Number.parseInt(values[1], 10);
  48672. const timeUpper = time.toUpperCase();
  48673. if (timeUpper.includes("AM") && hours === 12) hours = 0;
  48674. else if (timeUpper.includes("PM") && hours !== 12) hours += 12;
  48675. return {
  48676. hours,
  48677. minutes
  48678. };
  48679. }
  48680. return null;
  48681. };
  48682. const compareTime = (time1, time2) => {
  48683. const value1 = parseTime(time1);
  48684. if (!value1) return -1;
  48685. const value2 = parseTime(time2);
  48686. if (!value2) return -1;
  48687. const minutes1 = value1.minutes + value1.hours * 60;
  48688. const minutes2 = value2.minutes + value2.hours * 60;
  48689. if (minutes1 === minutes2) return 0;
  48690. return minutes1 > minutes2 ? 1 : -1;
  48691. };
  48692. const padTime = (time) => {
  48693. return `${time}`.padStart(2, "0");
  48694. };
  48695. const formatTime = (time) => {
  48696. return `${padTime(time.hours)}:${padTime(time.minutes)}`;
  48697. };
  48698. const nextTime = (time, step) => {
  48699. const timeValue = parseTime(time);
  48700. if (!timeValue) return "";
  48701. const stepValue = parseTime(step);
  48702. if (!stepValue) return "";
  48703. const next = {
  48704. hours: timeValue.hours,
  48705. minutes: timeValue.minutes
  48706. };
  48707. next.minutes += stepValue.minutes;
  48708. next.hours += stepValue.hours;
  48709. next.hours += Math.floor(next.minutes / 60);
  48710. next.minutes = next.minutes % 60;
  48711. return formatTime(next);
  48712. };
  48713. //#endregion
  48714. //#region ../../packages/components/time-select/src/time-select.vue?vue&type=script&setup=true&lang.ts
  48715. var time_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  48716. name: "ElTimeSelect",
  48717. __name: "time-select",
  48718. props: timeSelectProps,
  48719. emits: [
  48720. CHANGE_EVENT,
  48721. "blur",
  48722. "focus",
  48723. "clear",
  48724. UPDATE_MODEL_EVENT
  48725. ],
  48726. setup(__props, { expose: __expose }) {
  48727. import_dayjs_min.default.extend(import_customParseFormat.default);
  48728. const { Option: ElOption } = ElSelect;
  48729. const props = __props;
  48730. const nsInput = useNamespace("input");
  48731. const select = ref();
  48732. const _disabled = useFormDisabled();
  48733. const { lang } = useLocale();
  48734. const value = computed(() => props.modelValue);
  48735. const start = computed(() => {
  48736. const time = parseTime(props.start);
  48737. return time ? formatTime(time) : null;
  48738. });
  48739. const end = computed(() => {
  48740. const time = parseTime(props.end);
  48741. return time ? formatTime(time) : null;
  48742. });
  48743. const minTime = computed(() => {
  48744. const time = parseTime(props.minTime || "");
  48745. return time ? formatTime(time) : null;
  48746. });
  48747. const maxTime = computed(() => {
  48748. const time = parseTime(props.maxTime || "");
  48749. return time ? formatTime(time) : null;
  48750. });
  48751. const step = computed(() => {
  48752. const time = parseTime(props.step);
  48753. const isInvalidStep = !time || time.hours < 0 || time.minutes < 0 || Number.isNaN(time.hours) || Number.isNaN(time.minutes) || time.hours === 0 && time.minutes === 0;
  48754. if (isInvalidStep) /* @__PURE__ */ debugWarn("ElTimeSelect", `invalid step, fallback to default step (${DEFAULT_STEP}).`);
  48755. return !isInvalidStep ? formatTime(time) : DEFAULT_STEP;
  48756. });
  48757. const items = computed(() => {
  48758. const result = [];
  48759. const push = (formattedValue, rawValue) => {
  48760. result.push({
  48761. value: formattedValue,
  48762. rawValue,
  48763. disabled: compareTime(rawValue, minTime.value || "-1:-1") <= 0 || compareTime(rawValue, maxTime.value || "100:100") >= 0
  48764. });
  48765. };
  48766. if (props.start && props.end && props.step) {
  48767. let current = start.value;
  48768. let currentTime;
  48769. while (current && end.value && compareTime(current, end.value) <= 0) {
  48770. currentTime = (0, import_dayjs_min.default)(current, "HH:mm").locale(lang.value).format(props.format);
  48771. push(currentTime, current);
  48772. current = nextTime(current, step.value);
  48773. }
  48774. if (props.includeEndTime && end.value && result[result.length - 1]?.rawValue !== end.value) push((0, import_dayjs_min.default)(end.value, "HH:mm").locale(lang.value).format(props.format), end.value);
  48775. }
  48776. return result;
  48777. });
  48778. const blur = () => {
  48779. select.value?.blur?.();
  48780. };
  48781. const focus = () => {
  48782. select.value?.focus?.();
  48783. };
  48784. __expose({
  48785. blur,
  48786. focus
  48787. });
  48788. return (_ctx, _cache) => {
  48789. return openBlock(), createBlock(unref(ElSelect), {
  48790. ref_key: "select",
  48791. ref: select,
  48792. name: __props.name,
  48793. "model-value": value.value,
  48794. disabled: unref(_disabled),
  48795. clearable: __props.clearable,
  48796. "clear-icon": __props.clearIcon,
  48797. size: __props.size,
  48798. effect: __props.effect,
  48799. placeholder: __props.placeholder,
  48800. "default-first-option": "",
  48801. filterable: __props.editable,
  48802. "empty-values": __props.emptyValues,
  48803. "value-on-clear": __props.valueOnClear,
  48804. "popper-class": __props.popperClass,
  48805. "popper-style": __props.popperStyle,
  48806. "onUpdate:modelValue": _cache[0] || (_cache[0] = (event) => _ctx.$emit(unref(UPDATE_MODEL_EVENT), event)),
  48807. onChange: _cache[1] || (_cache[1] = (event) => _ctx.$emit(unref(CHANGE_EVENT), event)),
  48808. onBlur: _cache[2] || (_cache[2] = (event) => _ctx.$emit("blur", event)),
  48809. onFocus: _cache[3] || (_cache[3] = (event) => _ctx.$emit("focus", event)),
  48810. onClear: _cache[4] || (_cache[4] = () => _ctx.$emit("clear"))
  48811. }, {
  48812. prefix: withCtx(() => [__props.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  48813. key: 0,
  48814. class: normalizeClass(unref(nsInput).e("prefix-icon"))
  48815. }, {
  48816. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon)))]),
  48817. _: 1
  48818. }, 8, ["class"])) : createCommentVNode("v-if", true)]),
  48819. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item) => {
  48820. return openBlock(), createBlock(unref(ElOption), {
  48821. key: item.value,
  48822. label: item.value,
  48823. value: item.value,
  48824. disabled: item.disabled
  48825. }, null, 8, [
  48826. "label",
  48827. "value",
  48828. "disabled"
  48829. ]);
  48830. }), 128))]),
  48831. _: 1
  48832. }, 8, [
  48833. "name",
  48834. "model-value",
  48835. "disabled",
  48836. "clearable",
  48837. "clear-icon",
  48838. "size",
  48839. "effect",
  48840. "placeholder",
  48841. "filterable",
  48842. "empty-values",
  48843. "value-on-clear",
  48844. "popper-class",
  48845. "popper-style"
  48846. ]);
  48847. };
  48848. }
  48849. });
  48850. //#endregion
  48851. //#region ../../packages/components/time-select/src/time-select.vue
  48852. var time_select_default = time_select_vue_vue_type_script_setup_true_lang_default;
  48853. //#endregion
  48854. //#region ../../packages/components/time-select/index.ts
  48855. const ElTimeSelect = withInstall(time_select_default);
  48856. //#endregion
  48857. //#region ../../packages/components/timeline/src/tokens.ts
  48858. const TIMELINE_INJECTION_KEY = "timeline";
  48859. //#endregion
  48860. //#region ../../packages/components/timeline/src/timeline.ts
  48861. const timelineProps = buildProps({
  48862. mode: {
  48863. type: String,
  48864. values: [
  48865. "start",
  48866. "alternate",
  48867. "alternate-reverse",
  48868. "end"
  48869. ],
  48870. default: "start"
  48871. },
  48872. reverse: Boolean
  48873. });
  48874. const Timeline = defineComponent({
  48875. name: "ElTimeline",
  48876. props: timelineProps,
  48877. setup(props, { slots }) {
  48878. const ns = useNamespace("timeline");
  48879. provide(TIMELINE_INJECTION_KEY, {
  48880. props,
  48881. slots
  48882. });
  48883. const timelineKls = computed(() => [ns.b(), ns.is(props.mode)]);
  48884. return () => {
  48885. const children = flattedChildren(slots.default?.() ?? []);
  48886. return h("ul", { class: timelineKls.value }, props.reverse ? children.reverse() : children);
  48887. };
  48888. }
  48889. });
  48890. //#endregion
  48891. //#region ../../packages/components/timeline/src/timeline-item.ts
  48892. /**
  48893. * @deprecated Removed after 3.0.0, Use `TimelineItemProps` instead.
  48894. */
  48895. const timelineItemProps = buildProps({
  48896. timestamp: {
  48897. type: String,
  48898. default: ""
  48899. },
  48900. hideTimestamp: Boolean,
  48901. center: Boolean,
  48902. placement: {
  48903. type: String,
  48904. values: ["top", "bottom"],
  48905. default: "bottom"
  48906. },
  48907. type: {
  48908. type: String,
  48909. values: [
  48910. "primary",
  48911. "success",
  48912. "warning",
  48913. "danger",
  48914. "info"
  48915. ],
  48916. default: ""
  48917. },
  48918. color: {
  48919. type: String,
  48920. default: ""
  48921. },
  48922. size: {
  48923. type: String,
  48924. values: ["normal", "large"],
  48925. default: "normal"
  48926. },
  48927. icon: { type: iconPropType },
  48928. hollow: Boolean
  48929. });
  48930. //#endregion
  48931. //#region ../../packages/components/timeline/src/timeline-item.vue?vue&type=script&setup=true&lang.ts
  48932. var timeline_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  48933. name: "ElTimelineItem",
  48934. __name: "timeline-item",
  48935. props: timelineItemProps,
  48936. setup(__props) {
  48937. const props = __props;
  48938. const { props: timelineProps } = inject(TIMELINE_INJECTION_KEY);
  48939. const ns = useNamespace("timeline-item");
  48940. const defaultNodeKls = computed(() => [
  48941. ns.e("node"),
  48942. ns.em("node", props.size || ""),
  48943. ns.em("node", props.type || ""),
  48944. ns.is("hollow", props.hollow)
  48945. ]);
  48946. const timelineItemKls = computed(() => [
  48947. ns.b(),
  48948. { [ns.e("center")]: props.center },
  48949. ns.is(timelineProps.mode)
  48950. ]);
  48951. return (_ctx, _cache) => {
  48952. return openBlock(), createElementBlock("li", { class: normalizeClass(timelineItemKls.value) }, [
  48953. createElementVNode("div", { class: normalizeClass(unref(ns).e("tail")) }, null, 2),
  48954. !_ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
  48955. key: 0,
  48956. class: normalizeClass(defaultNodeKls.value),
  48957. style: normalizeStyle({ backgroundColor: __props.color })
  48958. }, [__props.icon ? (openBlock(), createBlock(unref(ElIcon), {
  48959. key: 0,
  48960. class: normalizeClass(unref(ns).e("icon"))
  48961. }, {
  48962. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon)))]),
  48963. _: 1
  48964. }, 8, ["class"])) : createCommentVNode("v-if", true)], 6)) : createCommentVNode("v-if", true),
  48965. _ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
  48966. key: 1,
  48967. class: normalizeClass(unref(ns).e("dot"))
  48968. }, [renderSlot(_ctx.$slots, "dot")], 2)) : createCommentVNode("v-if", true),
  48969. createElementVNode("div", { class: normalizeClass(unref(ns).e("wrapper")) }, [
  48970. !__props.hideTimestamp && __props.placement === "top" ? (openBlock(), createElementBlock("div", {
  48971. key: 0,
  48972. class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")])
  48973. }, toDisplayString(__props.timestamp), 3)) : createCommentVNode("v-if", true),
  48974. createElementVNode("div", { class: normalizeClass(unref(ns).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2),
  48975. !__props.hideTimestamp && __props.placement === "bottom" ? (openBlock(), createElementBlock("div", {
  48976. key: 1,
  48977. class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")])
  48978. }, toDisplayString(__props.timestamp), 3)) : createCommentVNode("v-if", true)
  48979. ], 2)
  48980. ], 2);
  48981. };
  48982. }
  48983. });
  48984. //#endregion
  48985. //#region ../../packages/components/timeline/src/timeline-item.vue
  48986. var timeline_item_default = timeline_item_vue_vue_type_script_setup_true_lang_default;
  48987. //#endregion
  48988. //#region ../../packages/components/timeline/index.ts
  48989. const ElTimeline = withInstall(Timeline, { TimelineItem: timeline_item_default });
  48990. const ElTimelineItem = withNoopInstall(timeline_item_default);
  48991. //#endregion
  48992. //#region ../../packages/components/transfer/src/transfer.ts
  48993. const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
  48994. const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
  48995. /**
  48996. * @deprecated Removed after 3.0.0, Use `TransferProps` instead.
  48997. */
  48998. const transferProps = buildProps({
  48999. data: {
  49000. type: definePropType(Array),
  49001. default: () => []
  49002. },
  49003. titles: {
  49004. type: definePropType(Array),
  49005. default: () => []
  49006. },
  49007. buttonTexts: {
  49008. type: definePropType(Array),
  49009. default: () => []
  49010. },
  49011. filterPlaceholder: String,
  49012. filterMethod: { type: definePropType(Function) },
  49013. leftDefaultChecked: {
  49014. type: definePropType(Array),
  49015. default: () => []
  49016. },
  49017. rightDefaultChecked: {
  49018. type: definePropType(Array),
  49019. default: () => []
  49020. },
  49021. renderContent: { type: definePropType(Function) },
  49022. modelValue: {
  49023. type: definePropType(Array),
  49024. default: () => []
  49025. },
  49026. format: {
  49027. type: definePropType(Object),
  49028. default: () => ({})
  49029. },
  49030. filterable: Boolean,
  49031. props: {
  49032. type: definePropType(Object),
  49033. default: () => mutable({
  49034. label: "label",
  49035. key: "key",
  49036. disabled: "disabled"
  49037. })
  49038. },
  49039. targetOrder: {
  49040. type: String,
  49041. values: [
  49042. "original",
  49043. "push",
  49044. "unshift"
  49045. ],
  49046. default: "original"
  49047. },
  49048. validateEvent: {
  49049. type: Boolean,
  49050. default: true
  49051. }
  49052. });
  49053. const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray$1) || isArray$1(value) && isNil(movedKeys);
  49054. const transferEmits = {
  49055. [CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray$1) && ["left", "right"].includes(direction),
  49056. [UPDATE_MODEL_EVENT]: (value) => isArray$1(value),
  49057. [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
  49058. [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
  49059. };
  49060. //#endregion
  49061. //#region ../../packages/components/transfer/src/transfer-panel.ts
  49062. const CHECKED_CHANGE_EVENT = "checked-change";
  49063. /**
  49064. * @deprecated Removed after 3.0.0, Use `TransferPanelProps` instead.
  49065. */
  49066. const transferPanelProps = buildProps({
  49067. data: transferProps.data,
  49068. optionRender: { type: definePropType(Function) },
  49069. placeholder: String,
  49070. title: String,
  49071. filterable: Boolean,
  49072. format: transferProps.format,
  49073. filterMethod: transferProps.filterMethod,
  49074. defaultChecked: transferProps.leftDefaultChecked,
  49075. props: transferProps.props
  49076. });
  49077. const transferPanelEmits = { [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn };
  49078. //#endregion
  49079. //#region ../../packages/components/transfer/src/composables/use-props-alias.ts
  49080. const usePropsAlias = (props) => {
  49081. const initProps = {
  49082. label: "label",
  49083. key: "key",
  49084. disabled: "disabled"
  49085. };
  49086. return computed(() => ({
  49087. ...initProps,
  49088. ...props.props
  49089. }));
  49090. };
  49091. //#endregion
  49092. //#region ../../packages/components/transfer/src/composables/use-check.ts
  49093. const useCheck$1 = (props, panelState, emit) => {
  49094. const propsAlias = usePropsAlias(props);
  49095. const filteredData = computed(() => {
  49096. return props.data.filter((item) => {
  49097. if (isFunction$1(props.filterMethod)) return props.filterMethod(panelState.query, item);
  49098. else return String(item[propsAlias.value.label] || item[propsAlias.value.key]).toLowerCase().includes(panelState.query.toLowerCase());
  49099. });
  49100. });
  49101. const checkableData = computed(() => filteredData.value.filter((item) => !item[propsAlias.value.disabled]));
  49102. const checkedSummary = computed(() => {
  49103. const checkedLength = panelState.checked.length;
  49104. const dataLength = props.data.length;
  49105. const { noChecked, hasChecked } = props.format;
  49106. if (noChecked && hasChecked) return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
  49107. else return `${checkedLength}/${dataLength}`;
  49108. });
  49109. const isIndeterminate = computed(() => {
  49110. const checkedLength = panelState.checked.length;
  49111. return checkedLength > 0 && checkedLength < checkableData.value.length;
  49112. });
  49113. const updateAllChecked = () => {
  49114. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  49115. panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item));
  49116. };
  49117. const handleAllCheckedChange = (value) => {
  49118. panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
  49119. };
  49120. watch(() => panelState.checked, (val, oldVal) => {
  49121. updateAllChecked();
  49122. if (panelState.checkChangeByUser) emit(CHECKED_CHANGE_EVENT, val, val.concat(oldVal).filter((v) => !val.includes(v) || !oldVal.includes(v)));
  49123. else {
  49124. emit(CHECKED_CHANGE_EVENT, val);
  49125. panelState.checkChangeByUser = true;
  49126. }
  49127. });
  49128. watch(checkableData, () => {
  49129. updateAllChecked();
  49130. });
  49131. watch(() => props.data, () => {
  49132. const checked = [];
  49133. const filteredDataKeys = filteredData.value.map((item) => item[propsAlias.value.key]);
  49134. panelState.checked.forEach((item) => {
  49135. if (filteredDataKeys.includes(item)) checked.push(item);
  49136. });
  49137. panelState.checkChangeByUser = false;
  49138. panelState.checked = checked;
  49139. });
  49140. watch(() => props.defaultChecked, (val, oldVal) => {
  49141. if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item))) return;
  49142. const checked = [];
  49143. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  49144. val.forEach((item) => {
  49145. if (checkableDataKeys.includes(item)) checked.push(item);
  49146. });
  49147. panelState.checkChangeByUser = false;
  49148. panelState.checked = checked;
  49149. }, { immediate: true });
  49150. return {
  49151. filteredData,
  49152. checkableData,
  49153. checkedSummary,
  49154. isIndeterminate,
  49155. updateAllChecked,
  49156. handleAllCheckedChange
  49157. };
  49158. };
  49159. //#endregion
  49160. //#region ../../packages/components/transfer/src/composables/use-checked-change.ts
  49161. const useCheckedChange = (checkedState, emit) => {
  49162. const onSourceCheckedChange = (val, movedKeys) => {
  49163. checkedState.leftChecked = val;
  49164. if (!movedKeys) return;
  49165. emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
  49166. };
  49167. const onTargetCheckedChange = (val, movedKeys) => {
  49168. checkedState.rightChecked = val;
  49169. if (!movedKeys) return;
  49170. emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
  49171. };
  49172. return {
  49173. onSourceCheckedChange,
  49174. onTargetCheckedChange
  49175. };
  49176. };
  49177. //#endregion
  49178. //#region ../../packages/components/transfer/src/composables/use-computed-data.ts
  49179. const useComputedData = (props) => {
  49180. const propsAlias = usePropsAlias(props);
  49181. const dataObj = computed(() => props.data.reduce((o, cur) => (o[cur[propsAlias.value.key]] = cur) && o, {}));
  49182. return {
  49183. sourceData: computed(() => props.data.filter((item) => !props.modelValue.includes(item[propsAlias.value.key]))),
  49184. targetData: computed(() => {
  49185. if (props.targetOrder === "original") return props.data.filter((item) => props.modelValue.includes(item[propsAlias.value.key]));
  49186. else return props.modelValue.reduce((arr, cur) => {
  49187. const val = dataObj.value[cur];
  49188. if (val) arr.push(val);
  49189. return arr;
  49190. }, []);
  49191. })
  49192. };
  49193. };
  49194. //#endregion
  49195. //#region ../../packages/components/transfer/src/composables/use-move.ts
  49196. const useMove = (props, checkedState, emit) => {
  49197. const propsAlias = usePropsAlias(props);
  49198. const _emit = (value, direction, movedKeys) => {
  49199. emit(UPDATE_MODEL_EVENT, value);
  49200. emit(CHANGE_EVENT, value, direction, movedKeys);
  49201. };
  49202. const addToLeft = () => {
  49203. const currentValue = props.modelValue.slice();
  49204. checkedState.rightChecked.forEach((item) => {
  49205. const index = currentValue.indexOf(item);
  49206. if (index > -1) currentValue.splice(index, 1);
  49207. });
  49208. _emit(currentValue, "left", checkedState.rightChecked);
  49209. };
  49210. const addToRight = () => {
  49211. let currentValue = props.modelValue.slice();
  49212. const itemsToBeMoved = props.data.filter((item) => {
  49213. const itemKey = item[propsAlias.value.key];
  49214. return checkedState.leftChecked.includes(itemKey) && !props.modelValue.includes(itemKey);
  49215. }).map((item) => item[propsAlias.value.key]);
  49216. currentValue = props.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  49217. if (props.targetOrder === "original") currentValue = props.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]);
  49218. _emit(currentValue, "right", checkedState.leftChecked);
  49219. };
  49220. return {
  49221. addToLeft,
  49222. addToRight
  49223. };
  49224. };
  49225. //#endregion
  49226. //#region ../../packages/components/transfer/src/transfer-panel.vue?vue&type=script&setup=true&lang.ts
  49227. var transfer_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  49228. name: "ElTransferPanel",
  49229. __name: "transfer-panel",
  49230. props: transferPanelProps,
  49231. emits: transferPanelEmits,
  49232. setup(__props, { expose: __expose, emit: __emit }) {
  49233. const props = __props;
  49234. const emit = __emit;
  49235. const slots = useSlots();
  49236. const OptionContent = ({ option }) => option;
  49237. const { t } = useLocale();
  49238. const ns = useNamespace("transfer");
  49239. const panelState = reactive({
  49240. checked: [],
  49241. allChecked: false,
  49242. query: "",
  49243. checkChangeByUser: true
  49244. });
  49245. const propsAlias = usePropsAlias(props);
  49246. const { filteredData, checkedSummary, isIndeterminate, handleAllCheckedChange } = useCheck$1(props, panelState, emit);
  49247. const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
  49248. const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
  49249. const { checked, allChecked, query } = toRefs(panelState);
  49250. __expose({ query });
  49251. return (_ctx, _cache) => {
  49252. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b("panel")) }, [
  49253. createElementVNode("p", { class: normalizeClass(unref(ns).be("panel", "header")) }, [createVNode(unref(ElCheckbox), {
  49254. modelValue: unref(allChecked),
  49255. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(allChecked) ? allChecked.value = $event : null),
  49256. indeterminate: unref(isIndeterminate),
  49257. "validate-event": false,
  49258. onChange: unref(handleAllCheckedChange)
  49259. }, {
  49260. default: withCtx(() => [createElementVNode("span", { class: normalizeClass(unref(ns).be("panel", "header-title")) }, toDisplayString(__props.title), 3), createElementVNode("span", { class: normalizeClass(unref(ns).be("panel", "header-count")) }, toDisplayString(unref(checkedSummary)), 3)]),
  49261. _: 1
  49262. }, 8, [
  49263. "modelValue",
  49264. "indeterminate",
  49265. "onChange"
  49266. ])], 2),
  49267. createElementVNode("div", { class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", hasFooter.value)]) }, [
  49268. __props.filterable ? (openBlock(), createBlock(unref(ElInput), {
  49269. key: 0,
  49270. modelValue: unref(query),
  49271. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(query) ? query.value = $event : null),
  49272. class: normalizeClass(unref(ns).be("panel", "filter")),
  49273. size: "default",
  49274. placeholder: __props.placeholder,
  49275. "prefix-icon": unref(search_default),
  49276. clearable: "",
  49277. "validate-event": false
  49278. }, null, 8, [
  49279. "modelValue",
  49280. "class",
  49281. "placeholder",
  49282. "prefix-icon"
  49283. ])) : createCommentVNode("v-if", true),
  49284. withDirectives(createVNode(unref(ElCheckboxGroup), {
  49285. modelValue: unref(checked),
  49286. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(checked) ? checked.value = $event : null),
  49287. "validate-event": false,
  49288. class: normalizeClass([unref(ns).is("filterable", __props.filterable), unref(ns).be("panel", "list")])
  49289. }, {
  49290. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
  49291. return openBlock(), createBlock(unref(ElCheckbox), {
  49292. key: item[unref(propsAlias).key],
  49293. class: normalizeClass(unref(ns).be("panel", "item")),
  49294. value: item[unref(propsAlias).key],
  49295. disabled: item[unref(propsAlias).disabled],
  49296. "validate-event": false
  49297. }, {
  49298. default: withCtx(() => [createVNode(OptionContent, { option: __props.optionRender?.(item) }, null, 8, ["option"])]),
  49299. _: 2
  49300. }, 1032, [
  49301. "class",
  49302. "value",
  49303. "disabled"
  49304. ]);
  49305. }), 128))]),
  49306. _: 1
  49307. }, 8, ["modelValue", "class"]), [[vShow, !hasNoMatch.value && !unref(isEmpty)(__props.data)]]),
  49308. withDirectives(createElementVNode("div", { class: normalizeClass(unref(ns).be("panel", "empty")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(hasNoMatch.value ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 1)])], 2), [[vShow, hasNoMatch.value || unref(isEmpty)(__props.data)]])
  49309. ], 2),
  49310. hasFooter.value ? (openBlock(), createElementBlock("p", {
  49311. key: 0,
  49312. class: normalizeClass(unref(ns).be("panel", "footer"))
  49313. }, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)
  49314. ], 2);
  49315. };
  49316. }
  49317. });
  49318. //#endregion
  49319. //#region ../../packages/components/transfer/src/transfer-panel.vue
  49320. var transfer_panel_default = transfer_panel_vue_vue_type_script_setup_true_lang_default;
  49321. //#endregion
  49322. //#region ../../packages/components/transfer/src/transfer.vue?vue&type=script&setup=true&lang.ts
  49323. const _hoisted_1$13 = { key: 0 };
  49324. const _hoisted_2$8 = { key: 0 };
  49325. var transfer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  49326. name: "ElTransfer",
  49327. __name: "transfer",
  49328. props: transferProps,
  49329. emits: transferEmits,
  49330. setup(__props, { expose: __expose, emit: __emit }) {
  49331. const props = __props;
  49332. const emit = __emit;
  49333. const slots = useSlots();
  49334. const { t } = useLocale();
  49335. const ns = useNamespace("transfer");
  49336. const { formItem } = useFormItem();
  49337. const checkedState = reactive({
  49338. leftChecked: [],
  49339. rightChecked: []
  49340. });
  49341. const propsAlias = usePropsAlias(props);
  49342. const { sourceData, targetData } = useComputedData(props);
  49343. const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit);
  49344. const { addToLeft, addToRight } = useMove(props, checkedState, emit);
  49345. const leftPanel = ref();
  49346. const rightPanel = ref();
  49347. const clearQuery = (which) => {
  49348. switch (which) {
  49349. case "left":
  49350. leftPanel.value.query = "";
  49351. break;
  49352. case "right":
  49353. rightPanel.value.query = "";
  49354. break;
  49355. }
  49356. };
  49357. const hasButtonTexts = computed(() => props.buttonTexts.length === 2);
  49358. const leftPanelTitle = computed(() => props.titles[0] || t("el.transfer.titles.0"));
  49359. const rightPanelTitle = computed(() => props.titles[1] || t("el.transfer.titles.1"));
  49360. const panelFilterPlaceholder = computed(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
  49361. watch(() => props.modelValue, () => {
  49362. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  49363. });
  49364. const optionRender = computed(() => (option) => {
  49365. if (props.renderContent) return props.renderContent(h, option);
  49366. const defaultSlotVNodes = (slots.default?.({ option }) || []).filter((node) => node.type !== Comment);
  49367. if (defaultSlotVNodes.length) return defaultSlotVNodes;
  49368. return h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
  49369. });
  49370. __expose({
  49371. clearQuery,
  49372. leftPanel,
  49373. rightPanel
  49374. });
  49375. return (_ctx, _cache) => {
  49376. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [
  49377. createVNode(transfer_panel_default, {
  49378. ref_key: "leftPanel",
  49379. ref: leftPanel,
  49380. data: unref(sourceData),
  49381. "option-render": optionRender.value,
  49382. placeholder: panelFilterPlaceholder.value,
  49383. title: leftPanelTitle.value,
  49384. filterable: __props.filterable,
  49385. format: __props.format,
  49386. "filter-method": __props.filterMethod,
  49387. "default-checked": __props.leftDefaultChecked,
  49388. props: props.props,
  49389. onCheckedChange: unref(onSourceCheckedChange)
  49390. }, {
  49391. empty: withCtx(() => [renderSlot(_ctx.$slots, "left-empty")]),
  49392. default: withCtx(() => [renderSlot(_ctx.$slots, "left-footer")]),
  49393. _: 3
  49394. }, 8, [
  49395. "data",
  49396. "option-render",
  49397. "placeholder",
  49398. "title",
  49399. "filterable",
  49400. "format",
  49401. "filter-method",
  49402. "default-checked",
  49403. "props",
  49404. "onCheckedChange"
  49405. ]),
  49406. createElementVNode("div", { class: normalizeClass(unref(ns).e("buttons")) }, [createVNode(unref(ElButton), {
  49407. type: "primary",
  49408. class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
  49409. disabled: unref(isEmpty)(checkedState.rightChecked),
  49410. onClick: unref(addToLeft)
  49411. }, {
  49412. default: withCtx(() => [createVNode(unref(ElIcon), null, {
  49413. default: withCtx(() => [createVNode(unref(arrow_left_default))]),
  49414. _: 1
  49415. }), !unref(isUndefined)(__props.buttonTexts[0]) ? (openBlock(), createElementBlock("span", _hoisted_1$13, toDisplayString(__props.buttonTexts[0]), 1)) : createCommentVNode("v-if", true)]),
  49416. _: 1
  49417. }, 8, [
  49418. "class",
  49419. "disabled",
  49420. "onClick"
  49421. ]), createVNode(unref(ElButton), {
  49422. type: "primary",
  49423. class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", hasButtonTexts.value)]),
  49424. disabled: unref(isEmpty)(checkedState.leftChecked),
  49425. onClick: unref(addToRight)
  49426. }, {
  49427. default: withCtx(() => [!unref(isUndefined)(__props.buttonTexts[1]) ? (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString(__props.buttonTexts[1]), 1)) : createCommentVNode("v-if", true), createVNode(unref(ElIcon), null, {
  49428. default: withCtx(() => [createVNode(unref(arrow_right_default))]),
  49429. _: 1
  49430. })]),
  49431. _: 1
  49432. }, 8, [
  49433. "class",
  49434. "disabled",
  49435. "onClick"
  49436. ])], 2),
  49437. createVNode(transfer_panel_default, {
  49438. ref_key: "rightPanel",
  49439. ref: rightPanel,
  49440. data: unref(targetData),
  49441. "option-render": optionRender.value,
  49442. placeholder: panelFilterPlaceholder.value,
  49443. filterable: __props.filterable,
  49444. format: __props.format,
  49445. "filter-method": __props.filterMethod,
  49446. title: rightPanelTitle.value,
  49447. "default-checked": __props.rightDefaultChecked,
  49448. props: props.props,
  49449. onCheckedChange: unref(onTargetCheckedChange)
  49450. }, {
  49451. empty: withCtx(() => [renderSlot(_ctx.$slots, "right-empty")]),
  49452. default: withCtx(() => [renderSlot(_ctx.$slots, "right-footer")]),
  49453. _: 3
  49454. }, 8, [
  49455. "data",
  49456. "option-render",
  49457. "placeholder",
  49458. "filterable",
  49459. "format",
  49460. "filter-method",
  49461. "title",
  49462. "default-checked",
  49463. "props",
  49464. "onCheckedChange"
  49465. ])
  49466. ], 2);
  49467. };
  49468. }
  49469. });
  49470. //#endregion
  49471. //#region ../../packages/components/transfer/src/transfer.vue
  49472. var transfer_default = transfer_vue_vue_type_script_setup_true_lang_default;
  49473. //#endregion
  49474. //#region ../../packages/components/transfer/index.ts
  49475. const ElTransfer = withInstall(transfer_default);
  49476. //#endregion
  49477. //#region ../../packages/components/tree/src/model/util.ts
  49478. const NODE_KEY = "$treeNodeId";
  49479. const markNodeData = function(node, data) {
  49480. if (!data || data[NODE_KEY]) return;
  49481. Object.defineProperty(data, NODE_KEY, {
  49482. value: node.id,
  49483. enumerable: false,
  49484. configurable: false,
  49485. writable: false
  49486. });
  49487. };
  49488. const getNodeKey = (key, data) => data?.[key || NODE_KEY];
  49489. const handleCurrentChange = (store, emit, setCurrent) => {
  49490. const preCurrentNode = store.value.currentNode;
  49491. setCurrent();
  49492. const currentNode = store.value.currentNode;
  49493. if (preCurrentNode === currentNode) return;
  49494. emit("current-change", currentNode ? currentNode.data : null, currentNode);
  49495. };
  49496. //#endregion
  49497. //#region ../../packages/components/tree/src/model/node.ts
  49498. const getChildState = (node) => {
  49499. let all = true;
  49500. let none = true;
  49501. let allWithoutDisable = true;
  49502. let isEffectivelyChecked = true;
  49503. for (let i = 0, j = node.length; i < j; i++) {
  49504. const n = node[i];
  49505. if (n.checked !== true || n.indeterminate) {
  49506. all = false;
  49507. if (!n.disabled) allWithoutDisable = false;
  49508. }
  49509. if (n.checked !== false || n.indeterminate) none = false;
  49510. if (!n.isEffectivelyChecked) isEffectivelyChecked = false;
  49511. }
  49512. return {
  49513. all,
  49514. none,
  49515. allWithoutDisable,
  49516. half: !all && !none,
  49517. isEffectivelyChecked
  49518. };
  49519. };
  49520. const reInitChecked = function(node) {
  49521. if (node.childNodes.length === 0 || node.loading) {
  49522. node.isEffectivelyChecked = node.disabled || node.checked;
  49523. return;
  49524. }
  49525. const { all, none, half, isEffectivelyChecked } = getChildState(node.childNodes);
  49526. node.isEffectivelyChecked = isEffectivelyChecked;
  49527. if (all) {
  49528. node.checked = true;
  49529. node.indeterminate = false;
  49530. } else if (half) {
  49531. node.checked = false;
  49532. node.indeterminate = true;
  49533. } else if (none) {
  49534. node.checked = false;
  49535. node.indeterminate = false;
  49536. }
  49537. const parent = node.parent;
  49538. if (!parent || parent.level === 0) return;
  49539. if (!node.store.checkStrictly) reInitChecked(parent);
  49540. };
  49541. const getPropertyFromData = function(node, prop) {
  49542. const props = node.store.props;
  49543. const data = node.data || {};
  49544. const config = props[prop];
  49545. if (isFunction$1(config)) return config(data, node);
  49546. else if (isString(config)) return data[config];
  49547. else if (isUndefined(config)) {
  49548. const dataProp = data[prop];
  49549. return isUndefined(dataProp) ? "" : dataProp;
  49550. }
  49551. };
  49552. const setCanFocus = function(childNodes, focus) {
  49553. childNodes.forEach((item) => {
  49554. item.canFocus = focus;
  49555. setCanFocus(item.childNodes, focus);
  49556. });
  49557. };
  49558. let nodeIdSeed = 0;
  49559. var Node$1 = class Node$1 {
  49560. constructor(options) {
  49561. this.isLeafByUser = void 0;
  49562. this.isLeaf = void 0;
  49563. this.isEffectivelyChecked = false;
  49564. this.id = nodeIdSeed++;
  49565. this.text = null;
  49566. this.checked = false;
  49567. this.indeterminate = false;
  49568. this.data = null;
  49569. this.expanded = false;
  49570. this.parent = null;
  49571. this.visible = true;
  49572. this.isCurrent = false;
  49573. this.canFocus = false;
  49574. for (const name in options) if (hasOwn(options, name)) this[name] = options[name];
  49575. this.level = 0;
  49576. this.loaded = false;
  49577. this.childNodes = [];
  49578. this.loading = false;
  49579. if (this.parent) this.level = this.parent.level + 1;
  49580. }
  49581. initialize() {
  49582. const store = this.store;
  49583. if (!store) throw new Error("[Node]store is required!");
  49584. store.registerNode(this);
  49585. const props = store.props;
  49586. if (props && typeof props.isLeaf !== "undefined") {
  49587. const isLeaf = getPropertyFromData(this, "isLeaf");
  49588. if (isBoolean(isLeaf)) this.isLeafByUser = isLeaf;
  49589. }
  49590. if (store.lazy !== true && this.data) {
  49591. this.setData(this.data);
  49592. if (store.defaultExpandAll) {
  49593. this.expanded = true;
  49594. this.canFocus = true;
  49595. }
  49596. } else if (this.level > 0 && store.lazy && store.defaultExpandAll && !this.isLeafByUser) this.expand();
  49597. if (!isArray$1(this.data)) markNodeData(this, this.data);
  49598. if (!this.data) return;
  49599. const defaultExpandedKeys = store.defaultExpandedKeys;
  49600. const key = store.key;
  49601. if (key && !isNil(this.key) && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) this.expand(null, store.autoExpandParent);
  49602. if (key && store.currentNodeKey !== void 0 && this.key === store.currentNodeKey) {
  49603. store.currentNode && (store.currentNode.isCurrent = false);
  49604. store.currentNode = this;
  49605. store.currentNode.isCurrent = true;
  49606. }
  49607. if (store.lazy) store._initDefaultCheckedNode(this);
  49608. this.updateLeafState();
  49609. if (this.level === 1 || this.parent?.expanded === true) this.canFocus = true;
  49610. }
  49611. setData(data) {
  49612. if (!isArray$1(data)) markNodeData(this, data);
  49613. this.data = data;
  49614. this.childNodes = [];
  49615. let children;
  49616. if (this.level === 0 && isArray$1(this.data)) children = this.data;
  49617. else children = getPropertyFromData(this, "children") || [];
  49618. for (let i = 0, j = children.length; i < j; i++) this.insertChild({ data: children[i] });
  49619. }
  49620. get label() {
  49621. return getPropertyFromData(this, "label");
  49622. }
  49623. get key() {
  49624. const nodeKey = this.store.key;
  49625. if (this.data) return this.data[nodeKey];
  49626. return null;
  49627. }
  49628. get disabled() {
  49629. return getPropertyFromData(this, "disabled");
  49630. }
  49631. get nextSibling() {
  49632. const parent = this.parent;
  49633. if (parent) {
  49634. const index = parent.childNodes.indexOf(this);
  49635. if (index > -1) return parent.childNodes[index + 1];
  49636. }
  49637. return null;
  49638. }
  49639. get previousSibling() {
  49640. const parent = this.parent;
  49641. if (parent) {
  49642. const index = parent.childNodes.indexOf(this);
  49643. if (index > -1) return index > 0 ? parent.childNodes[index - 1] : null;
  49644. }
  49645. return null;
  49646. }
  49647. contains(target, deep = true) {
  49648. return (this.childNodes || []).some((child) => child === target || deep && child.contains(target));
  49649. }
  49650. remove() {
  49651. const parent = this.parent;
  49652. if (parent) parent.removeChild(this);
  49653. }
  49654. insertChild(child, index, batch) {
  49655. if (!child) throw new Error("InsertChild error: child is required.");
  49656. if (!(child instanceof Node$1)) {
  49657. if (!batch) {
  49658. const children = this.getChildren(true);
  49659. if (!children?.includes(child.data)) if (isUndefined(index) || index < 0) children?.push(child.data);
  49660. else children?.splice(index, 0, child.data);
  49661. }
  49662. Object.assign(child, {
  49663. parent: this,
  49664. store: this.store
  49665. });
  49666. child = reactive(new Node$1(child));
  49667. if (child instanceof Node$1) child.initialize();
  49668. }
  49669. child.level = this.level + 1;
  49670. if (isUndefined(index) || index < 0) this.childNodes.push(child);
  49671. else this.childNodes.splice(index, 0, child);
  49672. this.updateLeafState();
  49673. }
  49674. insertBefore(child, ref) {
  49675. let index;
  49676. if (ref) index = this.childNodes.indexOf(ref);
  49677. this.insertChild(child, index);
  49678. }
  49679. insertAfter(child, ref) {
  49680. let index;
  49681. if (ref) {
  49682. index = this.childNodes.indexOf(ref);
  49683. if (index !== -1) index += 1;
  49684. }
  49685. this.insertChild(child, index);
  49686. }
  49687. removeChild(child) {
  49688. const children = this.getChildren() || [];
  49689. const dataIndex = children.indexOf(child.data);
  49690. if (dataIndex > -1) children.splice(dataIndex, 1);
  49691. const index = this.childNodes.indexOf(child);
  49692. if (index > -1) {
  49693. this.store && this.store.deregisterNode(child);
  49694. child.parent = null;
  49695. this.childNodes.splice(index, 1);
  49696. }
  49697. this.updateLeafState();
  49698. }
  49699. removeChildByData(data) {
  49700. const targetNode = this.childNodes.find((child) => child.data === data);
  49701. if (targetNode) this.removeChild(targetNode);
  49702. }
  49703. expand(callback, expandParent) {
  49704. const done = () => {
  49705. if (expandParent) {
  49706. let parent = this.parent;
  49707. while (parent && parent.level > 0) {
  49708. parent.expanded = true;
  49709. parent = parent.parent;
  49710. }
  49711. }
  49712. this.expanded = true;
  49713. if (callback) callback();
  49714. setCanFocus(this.childNodes, true);
  49715. };
  49716. if (this.shouldLoadData()) this.loadData((data) => {
  49717. if (isArray$1(data)) {
  49718. if (this.checked) this.setChecked(true, true);
  49719. else if (!this.store.checkStrictly) reInitChecked(this);
  49720. done();
  49721. }
  49722. });
  49723. else done();
  49724. }
  49725. doCreateChildren(array, defaultProps = {}) {
  49726. array.forEach((item) => {
  49727. this.insertChild(Object.assign({ data: item }, defaultProps), void 0, true);
  49728. });
  49729. }
  49730. collapse() {
  49731. this.expanded = false;
  49732. setCanFocus(this.childNodes, false);
  49733. }
  49734. shouldLoadData() {
  49735. return Boolean(this.store.lazy === true && this.store.load && !this.loaded);
  49736. }
  49737. updateLeafState() {
  49738. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") {
  49739. this.isLeaf = this.isLeafByUser;
  49740. this.isEffectivelyChecked = this.isLeaf && this.disabled;
  49741. return;
  49742. }
  49743. const childNodes = this.childNodes;
  49744. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  49745. this.isLeaf = !childNodes || childNodes.length === 0;
  49746. this.isEffectivelyChecked = this.isLeaf && this.disabled;
  49747. return;
  49748. }
  49749. this.isLeaf = false;
  49750. }
  49751. setChecked(value, deep, recursion, passValue) {
  49752. this.indeterminate = value === "half";
  49753. this.checked = value === true;
  49754. this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked);
  49755. if (this.store.checkStrictly) return;
  49756. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  49757. const handleDescendants = () => {
  49758. if (deep) {
  49759. const childNodes = this.childNodes;
  49760. for (let i = 0, j = childNodes.length; i < j; i++) {
  49761. const child = childNodes[i];
  49762. passValue = passValue || value !== false;
  49763. const isCheck = child.disabled && child.isLeaf ? child.checked : passValue;
  49764. child.setChecked(isCheck, deep, true, passValue);
  49765. }
  49766. const { half, all, isEffectivelyChecked } = getChildState(childNodes);
  49767. if (!all) {
  49768. this.checked = all;
  49769. this.indeterminate = half;
  49770. }
  49771. this.isEffectivelyChecked = !this.childNodes.length ? this.disabled || this.checked : isEffectivelyChecked;
  49772. }
  49773. };
  49774. if (this.shouldLoadData()) {
  49775. this.loadData(() => {
  49776. handleDescendants();
  49777. reInitChecked(this);
  49778. }, { checked: value !== false });
  49779. return;
  49780. } else handleDescendants();
  49781. }
  49782. const parent = this.parent;
  49783. if (!parent || parent.level === 0) return;
  49784. if (!recursion) reInitChecked(parent);
  49785. }
  49786. getChildren(forceInit = false) {
  49787. if (this.level === 0) return this.data;
  49788. const data = this.data;
  49789. if (!data) return null;
  49790. const props = this.store.props;
  49791. let children = "children";
  49792. if (props) children = props.children || "children";
  49793. if (isUndefined(data[children])) data[children] = null;
  49794. if (forceInit && !data[children]) data[children] = [];
  49795. return data[children];
  49796. }
  49797. updateChildren() {
  49798. const newData = this.getChildren() || [];
  49799. const oldData = this.childNodes.map((node) => node.data);
  49800. const newDataMap = {};
  49801. const newNodes = [];
  49802. newData.forEach((item, index) => {
  49803. const key = item[NODE_KEY];
  49804. if (!!key && oldData.some((data) => data?.[NODE_KEY] === key)) newDataMap[key] = {
  49805. index,
  49806. data: item
  49807. };
  49808. else newNodes.push({
  49809. index,
  49810. data: item
  49811. });
  49812. });
  49813. if (!this.store.lazy) oldData.forEach((item) => {
  49814. if (!newDataMap[item?.[NODE_KEY]]) this.removeChildByData(item);
  49815. });
  49816. newNodes.forEach(({ index, data }) => {
  49817. this.insertChild({ data }, index);
  49818. });
  49819. this.updateLeafState();
  49820. }
  49821. loadData(callback, defaultProps = {}) {
  49822. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  49823. this.loading = true;
  49824. const resolve = (children) => {
  49825. this.childNodes = [];
  49826. this.doCreateChildren(children, defaultProps);
  49827. this.loaded = true;
  49828. this.loading = false;
  49829. this.updateLeafState();
  49830. if (callback) callback.call(this, children);
  49831. };
  49832. const reject = () => {
  49833. this.loading = false;
  49834. };
  49835. this.store.load(this, resolve, reject);
  49836. } else if (callback) callback.call(this);
  49837. }
  49838. eachNode(callback) {
  49839. const arr = [this];
  49840. while (arr.length) {
  49841. const node = arr.shift();
  49842. arr.unshift(...node.childNodes);
  49843. callback(node);
  49844. }
  49845. }
  49846. reInitChecked() {
  49847. if (this.store.checkStrictly) return;
  49848. reInitChecked(this);
  49849. }
  49850. };
  49851. //#endregion
  49852. //#region ../../packages/components/tree/src/model/tree-store.ts
  49853. var TreeStore = class {
  49854. constructor(options) {
  49855. this.lazy = false;
  49856. this.checkStrictly = false;
  49857. this.autoExpandParent = false;
  49858. this.defaultExpandAll = false;
  49859. this.checkDescendants = false;
  49860. this.currentNode = null;
  49861. this.currentNodeKey = null;
  49862. for (const option in options) if (hasOwn(options, option)) this[option] = options[option];
  49863. this.nodesMap = {};
  49864. }
  49865. initialize() {
  49866. this.root = new Node$1({
  49867. data: this.data,
  49868. store: this
  49869. });
  49870. this.root.initialize();
  49871. if (this.lazy && this.load) {
  49872. const loadFn = this.load;
  49873. loadFn(this.root, (data) => {
  49874. this.root.doCreateChildren(data);
  49875. this._initDefaultCheckedNodes();
  49876. }, NOOP);
  49877. } else this._initDefaultCheckedNodes();
  49878. }
  49879. filter(value) {
  49880. const filterNodeMethod = this.filterNodeMethod;
  49881. const lazy = this.lazy;
  49882. const traverse = async function(node) {
  49883. const childNodes = node.root ? node.root.childNodes : node.childNodes;
  49884. for (const [index, child] of childNodes.entries()) {
  49885. child.visible = !!filterNodeMethod?.call(child, value, child.data, child);
  49886. if (index % 80 === 0 && index > 0) await nextTick();
  49887. await traverse(child);
  49888. }
  49889. if (!node.visible && childNodes.length) {
  49890. let allHidden = true;
  49891. allHidden = !childNodes.some((child) => child.visible);
  49892. if (node.root) node.root.visible = allHidden === false;
  49893. else node.visible = allHidden === false;
  49894. }
  49895. if (!value) return;
  49896. if (node.visible && !node.isLeaf) {
  49897. if (!lazy || node.loaded) node.expand();
  49898. }
  49899. };
  49900. traverse(this);
  49901. }
  49902. setData(newVal) {
  49903. if (newVal !== this.root.data) {
  49904. this.nodesMap = {};
  49905. this.root.setData(newVal);
  49906. this._initDefaultCheckedNodes();
  49907. this.setCurrentNodeKey(this.currentNodeKey);
  49908. } else this.root.updateChildren();
  49909. }
  49910. getNode(data) {
  49911. if (data instanceof Node$1) return data;
  49912. const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
  49913. return this.nodesMap[key] || null;
  49914. }
  49915. insertBefore(data, refData) {
  49916. const refNode = this.getNode(refData);
  49917. refNode.parent?.insertBefore({ data }, refNode);
  49918. }
  49919. insertAfter(data, refData) {
  49920. const refNode = this.getNode(refData);
  49921. refNode.parent?.insertAfter({ data }, refNode);
  49922. }
  49923. remove(data) {
  49924. const node = this.getNode(data);
  49925. if (node && node.parent) {
  49926. if (node === this.currentNode) this.currentNode = null;
  49927. node.parent.removeChild(node);
  49928. }
  49929. }
  49930. append(data, parentData) {
  49931. const parentNode = !isPropAbsent(parentData) ? this.getNode(parentData) : this.root;
  49932. if (parentNode) parentNode.insertChild({ data });
  49933. }
  49934. _initDefaultCheckedNodes() {
  49935. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49936. const nodesMap = this.nodesMap;
  49937. defaultCheckedKeys.forEach((checkedKey) => {
  49938. const node = nodesMap[checkedKey];
  49939. if (node) node.setChecked(true, !this.checkStrictly);
  49940. });
  49941. }
  49942. _initDefaultCheckedNode(node) {
  49943. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49944. if (!isNil(node.key) && defaultCheckedKeys.includes(node.key)) node.setChecked(true, !this.checkStrictly);
  49945. }
  49946. setDefaultCheckedKey(newVal) {
  49947. if (newVal !== this.defaultCheckedKeys) {
  49948. this.defaultCheckedKeys = newVal;
  49949. this._initDefaultCheckedNodes();
  49950. }
  49951. }
  49952. registerNode(node) {
  49953. const key = this.key;
  49954. if (!node || !node.data) return;
  49955. if (!key) this.nodesMap[node.id] = node;
  49956. else {
  49957. const nodeKey = node.key;
  49958. if (!isNil(nodeKey)) this.nodesMap[nodeKey] = node;
  49959. }
  49960. }
  49961. deregisterNode(node) {
  49962. if (!this.key || !node || !node.data) return;
  49963. node.childNodes.forEach((child) => {
  49964. this.deregisterNode(child);
  49965. });
  49966. delete this.nodesMap[node.key];
  49967. }
  49968. getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
  49969. const checkedNodes = [];
  49970. const traverse = function(node) {
  49971. (node.root ? node.root.childNodes : node.childNodes).forEach((child) => {
  49972. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) checkedNodes.push(child.data);
  49973. traverse(child);
  49974. });
  49975. };
  49976. traverse(this);
  49977. return checkedNodes;
  49978. }
  49979. getCheckedKeys(leafOnly = false) {
  49980. return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
  49981. }
  49982. getHalfCheckedNodes() {
  49983. const nodes = [];
  49984. const traverse = function(node) {
  49985. (node.root ? node.root.childNodes : node.childNodes).forEach((child) => {
  49986. if (child.indeterminate) nodes.push(child.data);
  49987. traverse(child);
  49988. });
  49989. };
  49990. traverse(this);
  49991. return nodes;
  49992. }
  49993. getHalfCheckedKeys() {
  49994. return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
  49995. }
  49996. _getAllNodes() {
  49997. const allNodes = [];
  49998. const nodesMap = this.nodesMap;
  49999. for (const nodeKey in nodesMap) if (hasOwn(nodesMap, nodeKey)) allNodes.push(nodesMap[nodeKey]);
  50000. return allNodes;
  50001. }
  50002. updateChildren(key, data) {
  50003. const node = this.nodesMap[key];
  50004. if (!node) return;
  50005. const childNodes = node.childNodes;
  50006. for (let i = childNodes.length - 1; i >= 0; i--) {
  50007. const child = childNodes[i];
  50008. this.remove(child.data);
  50009. }
  50010. for (let i = 0, j = data.length; i < j; i++) {
  50011. const child = data[i];
  50012. this.append(child, node.data);
  50013. }
  50014. }
  50015. _setCheckedKeys(key, leafOnly = false, checkedKeys) {
  50016. const allNodes = this._getAllNodes().sort((a, b) => a.level - b.level);
  50017. const cache = Object.create(null);
  50018. const keys = Object.keys(checkedKeys);
  50019. allNodes.forEach((node) => node.setChecked(false, false));
  50020. const cacheCheckedChild = (node) => {
  50021. node.childNodes.forEach((child) => {
  50022. cache[child.data[key]] = true;
  50023. if (child.childNodes?.length) cacheCheckedChild(child);
  50024. });
  50025. };
  50026. for (let i = 0, j = allNodes.length; i < j; i++) {
  50027. const node = allNodes[i];
  50028. const nodeKey = node.data[key].toString();
  50029. if (!keys.includes(nodeKey)) {
  50030. if (node.checked && !cache[nodeKey]) node.setChecked(false, false);
  50031. continue;
  50032. }
  50033. if (node.childNodes.length) cacheCheckedChild(node);
  50034. if (node.isLeaf || this.checkStrictly) {
  50035. node.setChecked(true, false);
  50036. continue;
  50037. }
  50038. node.setChecked(true, true);
  50039. if (leafOnly) {
  50040. node.setChecked(false, false, true);
  50041. const traverse = function(node) {
  50042. node.childNodes.forEach((child) => {
  50043. if (!child.isLeaf) child.setChecked(false, false, true);
  50044. traverse(child);
  50045. });
  50046. node.reInitChecked();
  50047. };
  50048. traverse(node);
  50049. }
  50050. }
  50051. }
  50052. setCheckedNodes(array, leafOnly = false) {
  50053. const key = this.key;
  50054. const checkedKeys = {};
  50055. array.forEach((item) => {
  50056. checkedKeys[(item || {})[key]] = true;
  50057. });
  50058. this._setCheckedKeys(key, leafOnly, checkedKeys);
  50059. }
  50060. setCheckedKeys(keys, leafOnly = false) {
  50061. this.defaultCheckedKeys = keys;
  50062. const key = this.key;
  50063. const checkedKeys = {};
  50064. keys.forEach((key) => {
  50065. checkedKeys[key] = true;
  50066. });
  50067. this._setCheckedKeys(key, leafOnly, checkedKeys);
  50068. }
  50069. setDefaultExpandedKeys(keys) {
  50070. keys = keys || [];
  50071. this.defaultExpandedKeys = keys;
  50072. keys.forEach((key) => {
  50073. const node = this.getNode(key);
  50074. if (node) node.expand(null, this.autoExpandParent);
  50075. });
  50076. }
  50077. setChecked(data, checked, deep) {
  50078. const node = this.getNode(data);
  50079. if (node) node.setChecked(!!checked, deep);
  50080. }
  50081. getCurrentNode() {
  50082. return this.currentNode;
  50083. }
  50084. setCurrentNode(currentNode) {
  50085. const prevCurrentNode = this.currentNode;
  50086. if (prevCurrentNode) prevCurrentNode.isCurrent = false;
  50087. this.currentNode = currentNode;
  50088. this.currentNode.isCurrent = true;
  50089. }
  50090. setUserCurrentNode(node, shouldAutoExpandParent = true) {
  50091. const key = node[this.key];
  50092. const currNode = this.nodesMap[key];
  50093. this.setCurrentNode(currNode);
  50094. if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) this.currentNode.parent?.expand(null, true);
  50095. }
  50096. setCurrentNodeKey(key, shouldAutoExpandParent = true) {
  50097. this.currentNodeKey = key;
  50098. if (isPropAbsent(key)) {
  50099. this.currentNode && (this.currentNode.isCurrent = false);
  50100. this.currentNode = null;
  50101. return;
  50102. }
  50103. const node = this.getNode(key);
  50104. if (node) {
  50105. this.setCurrentNode(node);
  50106. if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) this.currentNode.parent?.expand(null, true);
  50107. }
  50108. }
  50109. };
  50110. //#endregion
  50111. //#region ../../packages/components/tree/src/tokens.ts
  50112. const ROOT_TREE_INJECTION_KEY = "RootTree";
  50113. const NODE_INSTANCE_INJECTION_KEY = "NodeInstance";
  50114. const TREE_NODE_MAP_INJECTION_KEY = "TreeNodeMap";
  50115. //#endregion
  50116. //#region ../../packages/components/tree/src/tree-node-content.vue?vue&type=script&lang.ts
  50117. var tree_node_content_vue_vue_type_script_lang_default = defineComponent({
  50118. name: "ElTreeNodeContent",
  50119. props: {
  50120. node: {
  50121. type: Object,
  50122. required: true
  50123. },
  50124. renderContent: Function
  50125. },
  50126. setup(props) {
  50127. const ns = useNamespace("tree");
  50128. const nodeInstance = inject(NODE_INSTANCE_INJECTION_KEY);
  50129. const tree = inject(ROOT_TREE_INJECTION_KEY);
  50130. return () => {
  50131. const node = props.node;
  50132. const { data, store } = node;
  50133. return props.renderContent ? props.renderContent(h, {
  50134. _self: nodeInstance,
  50135. node,
  50136. data,
  50137. store
  50138. }) : renderSlot(tree.ctx.slots, "default", {
  50139. node,
  50140. data
  50141. }, () => [h(ElText, {
  50142. tag: "span",
  50143. truncated: true,
  50144. class: ns.be("node", "label")
  50145. }, () => [node.label])]);
  50146. };
  50147. }
  50148. });
  50149. //#endregion
  50150. //#region ../../packages/components/tree/src/tree-node-content.vue
  50151. var tree_node_content_default$1 = tree_node_content_vue_vue_type_script_lang_default;
  50152. //#endregion
  50153. //#region ../../packages/components/tree/src/model/useNodeExpandEventBroadcast.ts
  50154. function useNodeExpandEventBroadcast(props) {
  50155. const parentNodeMap = inject(TREE_NODE_MAP_INJECTION_KEY, null);
  50156. let currentNodeMap = {
  50157. treeNodeExpand: (node) => {
  50158. if (props.node !== node) props.node?.collapse();
  50159. },
  50160. children: /* @__PURE__ */ new Set()
  50161. };
  50162. if (parentNodeMap) parentNodeMap.children.add(currentNodeMap);
  50163. onBeforeUnmount(() => {
  50164. if (parentNodeMap) parentNodeMap.children.delete(currentNodeMap);
  50165. currentNodeMap = null;
  50166. });
  50167. provide(TREE_NODE_MAP_INJECTION_KEY, currentNodeMap);
  50168. return { broadcastExpanded: (node) => {
  50169. if (!props.accordion) return;
  50170. for (const childNode of currentNodeMap.children) childNode.treeNodeExpand(node);
  50171. } };
  50172. }
  50173. //#endregion
  50174. //#region ../../packages/components/tree/src/model/useDragNode.ts
  50175. const dragEventsKey = Symbol("dragEvents");
  50176. function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
  50177. const ns = useNamespace("tree");
  50178. const dragState = ref({
  50179. showDropIndicator: false,
  50180. draggingNode: null,
  50181. dropNode: null,
  50182. allowDrop: true,
  50183. dropType: null
  50184. });
  50185. const treeNodeDragStart = ({ event, treeNode }) => {
  50186. if (!event.dataTransfer) return;
  50187. if (isFunction$1(props.allowDrag) && !props.allowDrag(treeNode.node)) {
  50188. event.preventDefault();
  50189. return false;
  50190. }
  50191. event.dataTransfer.effectAllowed = "move";
  50192. try {
  50193. event.dataTransfer.setData("text/plain", "");
  50194. } catch {}
  50195. dragState.value.draggingNode = treeNode;
  50196. ctx.emit("node-drag-start", treeNode.node, event);
  50197. };
  50198. const treeNodeDragOver = ({ event, treeNode }) => {
  50199. if (!event.dataTransfer) return;
  50200. const dropNode = treeNode;
  50201. const oldDropNode = dragState.value.dropNode;
  50202. if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) removeClass(oldDropNode.$el, ns.is("drop-inner"));
  50203. const draggingNode = dragState.value.draggingNode;
  50204. if (!draggingNode || !dropNode) return;
  50205. let dropPrev = true;
  50206. let dropInner = true;
  50207. let dropNext = true;
  50208. let userAllowDropInner = true;
  50209. if (isFunction$1(props.allowDrop)) {
  50210. dropPrev = props.allowDrop(draggingNode.node, dropNode.node, "prev");
  50211. userAllowDropInner = dropInner = props.allowDrop(draggingNode.node, dropNode.node, "inner");
  50212. dropNext = props.allowDrop(draggingNode.node, dropNode.node, "next");
  50213. }
  50214. event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
  50215. if ((dropPrev || dropInner || dropNext) && oldDropNode?.node.id !== dropNode.node.id) {
  50216. if (oldDropNode) ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
  50217. ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event);
  50218. }
  50219. if (dropPrev || dropInner || dropNext) dragState.value.dropNode = dropNode;
  50220. else dragState.value.dropNode = null;
  50221. if (dropNode.node.nextSibling === draggingNode.node) dropNext = false;
  50222. if (dropNode.node.previousSibling === draggingNode.node) dropPrev = false;
  50223. if (dropNode.node.contains(draggingNode.node, false)) dropInner = false;
  50224. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  50225. dropPrev = false;
  50226. dropInner = false;
  50227. dropNext = false;
  50228. }
  50229. const dropEl = dropNode.$el;
  50230. const targetPosition = dropEl.querySelector(`.${ns.be("node", "content")}`).getBoundingClientRect();
  50231. const treePosition = el$.value.getBoundingClientRect();
  50232. const treeScrollTop = el$.value.scrollTop;
  50233. let dropType;
  50234. const prevPercent = dropPrev ? dropInner ? .25 : dropNext ? .45 : 1 : Number.NEGATIVE_INFINITY;
  50235. const nextPercent = dropNext ? dropInner ? .75 : dropPrev ? .55 : 0 : Number.POSITIVE_INFINITY;
  50236. let indicatorTop = -9999;
  50237. const distance = event.clientY - targetPosition.top;
  50238. if (distance < targetPosition.height * prevPercent) dropType = "before";
  50239. else if (distance > targetPosition.height * nextPercent) dropType = "after";
  50240. else if (dropInner) dropType = "inner";
  50241. else dropType = "none";
  50242. const iconPosition = dropEl.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect();
  50243. const dropIndicator = dropIndicator$.value;
  50244. if (dropType === "before") indicatorTop = iconPosition.top - treePosition.top + treeScrollTop;
  50245. else if (dropType === "after") indicatorTop = iconPosition.bottom - treePosition.top + treeScrollTop;
  50246. dropIndicator.style.top = `${indicatorTop}px`;
  50247. dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`;
  50248. if (dropType === "inner") addClass(dropEl, ns.is("drop-inner"));
  50249. else removeClass(dropEl, ns.is("drop-inner"));
  50250. dragState.value.showDropIndicator = dropType === "before" || dropType === "after";
  50251. dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner;
  50252. dragState.value.dropType = dropType;
  50253. ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event);
  50254. };
  50255. const treeNodeDragEnd = (event) => {
  50256. const { draggingNode, dropType, dropNode } = dragState.value;
  50257. event.preventDefault();
  50258. if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
  50259. if (draggingNode?.node.data && dropNode) {
  50260. const draggingNodeCopy = { data: draggingNode.node.data };
  50261. if (dropType !== "none") draggingNode.node.remove();
  50262. if (dropType === "before") dropNode.node.parent?.insertBefore(draggingNodeCopy, dropNode.node);
  50263. else if (dropType === "after") dropNode.node.parent?.insertAfter(draggingNodeCopy, dropNode.node);
  50264. else if (dropType === "inner") dropNode.node.insertChild(draggingNodeCopy);
  50265. if (dropType !== "none") {
  50266. store.value.registerNode(draggingNodeCopy);
  50267. if (store.value.key) draggingNode.node.eachNode((node) => {
  50268. store.value.nodesMap[node.data[store.value.key]]?.setChecked(node.checked, !store.value.checkStrictly);
  50269. });
  50270. }
  50271. removeClass(dropNode.$el, ns.is("drop-inner"));
  50272. ctx.emit("node-drag-end", draggingNode.node, dropNode.node, dropType, event);
  50273. if (dropType !== "none") ctx.emit("node-drop", draggingNode.node, dropNode.node, dropType, event);
  50274. }
  50275. if (draggingNode && !dropNode) ctx.emit("node-drag-end", draggingNode.node, null, dropType, event);
  50276. dragState.value.showDropIndicator = false;
  50277. dragState.value.draggingNode = null;
  50278. dragState.value.dropNode = null;
  50279. dragState.value.allowDrop = true;
  50280. };
  50281. provide(dragEventsKey, {
  50282. treeNodeDragStart,
  50283. treeNodeDragOver,
  50284. treeNodeDragEnd
  50285. });
  50286. return { dragState };
  50287. }
  50288. //#endregion
  50289. //#region ../../packages/components/tree/src/tree-node.vue?vue&type=script&lang.ts
  50290. var tree_node_vue_vue_type_script_lang_default = defineComponent({
  50291. name: "ElTreeNode",
  50292. components: {
  50293. ElCollapseTransition,
  50294. ElCheckbox,
  50295. NodeContent: tree_node_content_default$1,
  50296. ElIcon,
  50297. Loading: loading_default
  50298. },
  50299. props: {
  50300. node: {
  50301. type: Node$1,
  50302. default: () => ({})
  50303. },
  50304. props: {
  50305. type: Object,
  50306. default: () => ({})
  50307. },
  50308. accordion: Boolean,
  50309. renderContent: Function,
  50310. renderAfterExpand: Boolean,
  50311. showCheckbox: Boolean
  50312. },
  50313. emits: ["node-expand"],
  50314. setup(props, ctx) {
  50315. const ns = useNamespace("tree");
  50316. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  50317. const tree = inject(ROOT_TREE_INJECTION_KEY);
  50318. const expanded = ref(false);
  50319. const childNodeRendered = ref(false);
  50320. const oldChecked = ref();
  50321. const oldIndeterminate = ref();
  50322. const node$ = ref();
  50323. const dragEvents = inject(dragEventsKey);
  50324. const instance = getCurrentInstance();
  50325. provide(NODE_INSTANCE_INJECTION_KEY, instance);
  50326. if (!tree) /* @__PURE__ */ debugWarn("Tree", "Can not find node's tree.");
  50327. if (props.node.expanded) {
  50328. expanded.value = true;
  50329. childNodeRendered.value = true;
  50330. }
  50331. const childrenKey = tree.props.props["children"] || "children";
  50332. watch(() => {
  50333. const children = props.node.data?.[childrenKey];
  50334. return children && [...children];
  50335. }, () => {
  50336. props.node.updateChildren();
  50337. });
  50338. watch(() => props.node.indeterminate, (val) => {
  50339. handleSelectChange(props.node.checked, val);
  50340. });
  50341. watch(() => props.node.checked, (val) => {
  50342. handleSelectChange(val, props.node.indeterminate);
  50343. });
  50344. watch(() => props.node.childNodes.length, () => props.node.reInitChecked());
  50345. watch(() => props.node.expanded, (val) => {
  50346. nextTick(() => expanded.value = val);
  50347. if (val) childNodeRendered.value = true;
  50348. });
  50349. const getNodeKey$2 = (node) => {
  50350. return tree.props.nodeKey ? getNodeKey(tree.props.nodeKey, node.data) : node.id;
  50351. };
  50352. const getNodeClass = (node) => {
  50353. const nodeClassFunc = props.props.class;
  50354. if (!nodeClassFunc) return {};
  50355. let className;
  50356. if (isFunction$1(nodeClassFunc)) {
  50357. const { data } = node;
  50358. className = nodeClassFunc(data, node);
  50359. } else className = nodeClassFunc;
  50360. if (isString(className)) return { [className]: true };
  50361. else return className;
  50362. };
  50363. const handleSelectChange = (checked, indeterminate) => {
  50364. if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) tree.ctx.emit("check-change", props.node.data, checked, indeterminate);
  50365. oldChecked.value = checked;
  50366. oldIndeterminate.value = indeterminate;
  50367. };
  50368. const handleClick = (e) => {
  50369. handleCurrentChange(tree.store, tree.ctx.emit, () => {
  50370. if (tree?.props?.nodeKey) {
  50371. const curNodeKey = getNodeKey$2(props.node);
  50372. tree.store.value.setCurrentNodeKey(curNodeKey);
  50373. } else tree.store.value.setCurrentNode(props.node);
  50374. });
  50375. tree.currentNode.value = props.node;
  50376. if (tree.props.expandOnClickNode) handleExpandIconClick();
  50377. if ((tree.props.checkOnClickNode || props.node.isLeaf && tree.props.checkOnClickLeaf && props.showCheckbox) && !props.node.disabled) handleCheckChange(!props.node.checked);
  50378. tree.ctx.emit("node-click", props.node.data, props.node, instance, e);
  50379. };
  50380. const handleContextMenu = (event) => {
  50381. if (tree.instance.vnode.props?.["onNodeContextmenu"]) {
  50382. event.stopPropagation();
  50383. event.preventDefault();
  50384. }
  50385. tree.ctx.emit("node-contextmenu", event, props.node.data, props.node, instance);
  50386. };
  50387. const handleExpandIconClick = () => {
  50388. if (props.node.isLeaf) return;
  50389. if (expanded.value) {
  50390. tree.ctx.emit("node-collapse", props.node.data, props.node, instance);
  50391. props.node.collapse();
  50392. } else props.node.expand(() => {
  50393. ctx.emit("node-expand", props.node.data, props.node, instance);
  50394. });
  50395. };
  50396. const handleCheckChange = (value) => {
  50397. const checkStrictly = tree?.props.checkStrictly;
  50398. const childNodes = props.node.childNodes;
  50399. if (!checkStrictly && childNodes.length) value = childNodes.some((node) => !node.isEffectivelyChecked);
  50400. props.node.setChecked(value, !checkStrictly);
  50401. nextTick(() => {
  50402. const store = tree.store.value;
  50403. tree.ctx.emit("check", props.node.data, {
  50404. checkedNodes: store.getCheckedNodes(),
  50405. checkedKeys: store.getCheckedKeys(),
  50406. halfCheckedNodes: store.getHalfCheckedNodes(),
  50407. halfCheckedKeys: store.getHalfCheckedKeys()
  50408. });
  50409. });
  50410. };
  50411. const handleChildNodeExpand = (nodeData, node, instance) => {
  50412. broadcastExpanded(node);
  50413. tree.ctx.emit("node-expand", nodeData, node, instance);
  50414. };
  50415. const handleDragStart = (event) => {
  50416. if (!tree.props.draggable) return;
  50417. dragEvents.treeNodeDragStart({
  50418. event,
  50419. treeNode: props
  50420. });
  50421. };
  50422. const handleDragOver = (event) => {
  50423. event.preventDefault();
  50424. if (!tree.props.draggable) return;
  50425. dragEvents.treeNodeDragOver({
  50426. event,
  50427. treeNode: {
  50428. $el: node$.value,
  50429. node: props.node
  50430. }
  50431. });
  50432. };
  50433. const handleDrop = (event) => {
  50434. event.preventDefault();
  50435. };
  50436. const handleDragEnd = (event) => {
  50437. if (!tree.props.draggable) return;
  50438. dragEvents.treeNodeDragEnd(event);
  50439. };
  50440. return {
  50441. ns,
  50442. node$,
  50443. tree,
  50444. expanded,
  50445. childNodeRendered,
  50446. oldChecked,
  50447. oldIndeterminate,
  50448. getNodeKey: getNodeKey$2,
  50449. getNodeClass,
  50450. handleSelectChange,
  50451. handleClick,
  50452. handleContextMenu,
  50453. handleExpandIconClick,
  50454. handleCheckChange,
  50455. handleChildNodeExpand,
  50456. handleDragStart,
  50457. handleDragOver,
  50458. handleDrop,
  50459. handleDragEnd,
  50460. CaretRight: caret_right_default
  50461. };
  50462. }
  50463. });
  50464. //#endregion
  50465. //#region ../../packages/components/tree/src/tree-node.vue
  50466. const _hoisted_1$12 = [
  50467. "aria-expanded",
  50468. "aria-disabled",
  50469. "aria-checked",
  50470. "draggable",
  50471. "data-key"
  50472. ];
  50473. const _hoisted_2$7 = ["aria-expanded"];
  50474. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  50475. const _component_el_icon = resolveComponent("el-icon");
  50476. const _component_el_checkbox = resolveComponent("el-checkbox");
  50477. const _component_loading = resolveComponent("loading");
  50478. const _component_node_content = resolveComponent("node-content");
  50479. const _component_el_tree_node = resolveComponent("el-tree-node");
  50480. const _component_el_collapse_transition = resolveComponent("el-collapse-transition");
  50481. return withDirectives((openBlock(), createElementBlock("div", {
  50482. ref: "node$",
  50483. class: normalizeClass([
  50484. _ctx.ns.b("node"),
  50485. _ctx.ns.is("expanded", _ctx.expanded),
  50486. _ctx.ns.is("current", _ctx.node.isCurrent),
  50487. _ctx.ns.is("hidden", !_ctx.node.visible),
  50488. _ctx.ns.is("focusable", !_ctx.node.disabled),
  50489. _ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked),
  50490. _ctx.getNodeClass(_ctx.node)
  50491. ]),
  50492. role: "treeitem",
  50493. tabindex: "-1",
  50494. "aria-expanded": _ctx.expanded,
  50495. "aria-disabled": _ctx.node.disabled,
  50496. "aria-checked": _ctx.node.checked,
  50497. draggable: _ctx.tree.props.draggable,
  50498. "data-key": _ctx.getNodeKey(_ctx.node),
  50499. onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
  50500. onContextmenu: _cache[3] || (_cache[3] = (...args) => _ctx.handleContextMenu && _ctx.handleContextMenu(...args)),
  50501. onDragstart: _cache[4] || (_cache[4] = withModifiers((...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args), ["stop"])),
  50502. onDragover: _cache[5] || (_cache[5] = withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["stop"])),
  50503. onDragend: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.handleDragEnd && _ctx.handleDragEnd(...args), ["stop"])),
  50504. onDrop: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.handleDrop && _ctx.handleDrop(...args), ["stop"]))
  50505. }, [createElementVNode("div", {
  50506. class: normalizeClass(_ctx.ns.be("node", "content")),
  50507. style: normalizeStyle({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" })
  50508. }, [
  50509. _ctx.tree.props.icon || _ctx.CaretRight ? (openBlock(), createBlock(_component_el_icon, {
  50510. key: 0,
  50511. class: normalizeClass([
  50512. _ctx.ns.be("node", "expand-icon"),
  50513. _ctx.ns.is("leaf", _ctx.node.isLeaf),
  50514. { expanded: !_ctx.node.isLeaf && _ctx.expanded }
  50515. ]),
  50516. onClick: withModifiers(_ctx.handleExpandIconClick, ["stop"])
  50517. }, {
  50518. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.tree.props.icon || _ctx.CaretRight)))]),
  50519. _: 1
  50520. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
  50521. _ctx.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
  50522. key: 1,
  50523. "model-value": _ctx.node.checked,
  50524. indeterminate: _ctx.node.indeterminate,
  50525. disabled: !!_ctx.node.disabled,
  50526. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"])),
  50527. onChange: _ctx.handleCheckChange
  50528. }, null, 8, [
  50529. "model-value",
  50530. "indeterminate",
  50531. "disabled",
  50532. "onChange"
  50533. ])) : createCommentVNode("v-if", true),
  50534. _ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, {
  50535. key: 2,
  50536. class: normalizeClass([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")])
  50537. }, {
  50538. default: withCtx(() => [createVNode(_component_loading)]),
  50539. _: 1
  50540. }, 8, ["class"])) : createCommentVNode("v-if", true),
  50541. createVNode(_component_node_content, {
  50542. node: _ctx.node,
  50543. "render-content": _ctx.renderContent
  50544. }, null, 8, ["node", "render-content"])
  50545. ], 6), createVNode(_component_el_collapse_transition, null, {
  50546. default: withCtx(() => [!_ctx.renderAfterExpand || _ctx.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", {
  50547. key: 0,
  50548. class: normalizeClass(_ctx.ns.be("node", "children")),
  50549. role: "group",
  50550. "aria-expanded": _ctx.expanded,
  50551. onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
  50552. }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.node.childNodes, (child) => {
  50553. return openBlock(), createBlock(_component_el_tree_node, {
  50554. key: _ctx.getNodeKey(child),
  50555. "render-content": _ctx.renderContent,
  50556. "render-after-expand": _ctx.renderAfterExpand,
  50557. "show-checkbox": _ctx.showCheckbox,
  50558. node: child,
  50559. accordion: _ctx.accordion,
  50560. props: _ctx.props,
  50561. onNodeExpand: _ctx.handleChildNodeExpand
  50562. }, null, 8, [
  50563. "render-content",
  50564. "render-after-expand",
  50565. "show-checkbox",
  50566. "node",
  50567. "accordion",
  50568. "props",
  50569. "onNodeExpand"
  50570. ]);
  50571. }), 128))], 10, _hoisted_2$7)), [[vShow, _ctx.expanded]]) : createCommentVNode("v-if", true)]),
  50572. _: 1
  50573. })], 42, _hoisted_1$12)), [[vShow, _ctx.node.visible]]);
  50574. }
  50575. var tree_node_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_node_vue_vue_type_script_lang_default, [["render", _sfc_render$2]]);
  50576. //#endregion
  50577. //#region ../../packages/components/tree/src/model/useKeydown.ts
  50578. function useKeydown({ el$ }, store) {
  50579. const ns = useNamespace("tree");
  50580. onMounted(() => {
  50581. initTabIndex();
  50582. });
  50583. onUpdated(() => {
  50584. el$.value?.querySelectorAll("input[type=checkbox]").forEach((checkbox) => {
  50585. checkbox.setAttribute("tabindex", "-1");
  50586. });
  50587. });
  50588. function canNodeFocus(treeItems, nextIndex) {
  50589. const currentNode = store.value.getNode(treeItems[nextIndex].dataset.key);
  50590. return currentNode.canFocus && currentNode.visible && (currentNode.parent?.expanded || currentNode.parent?.level === 0);
  50591. }
  50592. const handleKeydown = (ev) => {
  50593. const currentItem = ev.target;
  50594. if (!currentItem.className.includes(ns.b("node"))) return;
  50595. const code = getEventCode(ev);
  50596. const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  50597. const currentIndex = treeItems.indexOf(currentItem);
  50598. let nextIndex;
  50599. if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {
  50600. ev.preventDefault();
  50601. if (code === EVENT_CODE.up) {
  50602. nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.length - 1;
  50603. const startIndex = nextIndex;
  50604. while (true) {
  50605. if (canNodeFocus(treeItems, nextIndex)) break;
  50606. nextIndex--;
  50607. if (nextIndex === startIndex) {
  50608. nextIndex = -1;
  50609. break;
  50610. }
  50611. if (nextIndex < 0) nextIndex = treeItems.length - 1;
  50612. }
  50613. } else {
  50614. nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.length - 1 ? currentIndex + 1 : 0;
  50615. const startIndex = nextIndex;
  50616. while (true) {
  50617. if (canNodeFocus(treeItems, nextIndex)) break;
  50618. nextIndex++;
  50619. if (nextIndex === startIndex) {
  50620. nextIndex = -1;
  50621. break;
  50622. }
  50623. if (nextIndex >= treeItems.length) nextIndex = 0;
  50624. }
  50625. }
  50626. nextIndex !== -1 && treeItems[nextIndex].focus();
  50627. }
  50628. if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {
  50629. ev.preventDefault();
  50630. currentItem.click();
  50631. }
  50632. const hasInput = currentItem.querySelector("[type=\"checkbox\"]");
  50633. if ([
  50634. EVENT_CODE.enter,
  50635. EVENT_CODE.numpadEnter,
  50636. EVENT_CODE.space
  50637. ].includes(code) && hasInput) {
  50638. ev.preventDefault();
  50639. hasInput.click();
  50640. }
  50641. };
  50642. useEventListener(el$, "keydown", handleKeydown);
  50643. const initTabIndex = () => {
  50644. if (!el$.value) return;
  50645. const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  50646. Array.from(el$.value.querySelectorAll("input[type=checkbox]")).forEach((checkbox) => {
  50647. checkbox.setAttribute("tabindex", "-1");
  50648. });
  50649. const checkedItem = el$.value.querySelectorAll(`.${ns.is("checked")}[role=treeitem]`);
  50650. if (checkedItem.length) {
  50651. checkedItem[0].setAttribute("tabindex", "0");
  50652. return;
  50653. }
  50654. treeItems[0]?.setAttribute("tabindex", "0");
  50655. };
  50656. }
  50657. //#endregion
  50658. //#region ../../packages/components/tree/src/tree.ts
  50659. const treeProps = buildProps({
  50660. data: {
  50661. type: definePropType(Array),
  50662. default: () => []
  50663. },
  50664. emptyText: { type: String },
  50665. renderAfterExpand: {
  50666. type: Boolean,
  50667. default: true
  50668. },
  50669. nodeKey: String,
  50670. checkStrictly: Boolean,
  50671. defaultExpandAll: Boolean,
  50672. expandOnClickNode: {
  50673. type: Boolean,
  50674. default: true
  50675. },
  50676. checkOnClickNode: Boolean,
  50677. checkOnClickLeaf: {
  50678. type: Boolean,
  50679. default: true
  50680. },
  50681. checkDescendants: Boolean,
  50682. autoExpandParent: {
  50683. type: Boolean,
  50684. default: true
  50685. },
  50686. defaultCheckedKeys: { type: Array },
  50687. defaultExpandedKeys: { type: Array },
  50688. currentNodeKey: { type: [String, Number] },
  50689. renderContent: { type: definePropType(Function) },
  50690. showCheckbox: Boolean,
  50691. draggable: Boolean,
  50692. allowDrag: { type: definePropType(Function) },
  50693. allowDrop: { type: definePropType(Function) },
  50694. props: {
  50695. type: Object,
  50696. default: () => ({
  50697. children: "children",
  50698. label: "label",
  50699. disabled: "disabled"
  50700. })
  50701. },
  50702. lazy: Boolean,
  50703. highlightCurrent: Boolean,
  50704. load: { type: Function },
  50705. filterNodeMethod: { type: Function },
  50706. accordion: Boolean,
  50707. indent: {
  50708. type: Number,
  50709. default: 18
  50710. },
  50711. icon: { type: iconPropType }
  50712. });
  50713. const treeEmits = {
  50714. "check-change": (data, checked, indeterminate) => data && isBoolean(checked) && isBoolean(indeterminate),
  50715. "current-change": (data, node) => true,
  50716. "node-click": (data, node, nodeInstance, evt) => data && node && evt instanceof Event,
  50717. "node-contextmenu": (evt, data, node, nodeInstance) => evt instanceof Event && data && node,
  50718. "node-collapse": (data, node, nodeInstance) => data && node,
  50719. "node-expand": (data, node, nodeInstance) => data && node,
  50720. check: (data, checkedInfo) => data && checkedInfo,
  50721. "node-drag-start": (node, evt) => node && evt,
  50722. "node-drag-end": (draggingNode, dropNode, dropType, evt) => draggingNode && evt,
  50723. "node-drop": (draggingNode, dropNode, dropType, evt) => draggingNode && dropNode && evt,
  50724. "node-drag-leave": (draggingNode, oldDropNode, evt) => draggingNode && oldDropNode && evt,
  50725. "node-drag-enter": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt,
  50726. "node-drag-over": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt
  50727. };
  50728. //#endregion
  50729. //#region ../../packages/components/tree/src/tree.vue?vue&type=script&lang.ts
  50730. var tree_vue_vue_type_script_lang_default = defineComponent({
  50731. name: "ElTree",
  50732. components: { ElTreeNode: tree_node_default$1 },
  50733. props: treeProps,
  50734. emits: treeEmits,
  50735. setup(props, ctx) {
  50736. const { t } = useLocale();
  50737. const ns = useNamespace("tree");
  50738. const store = ref(new TreeStore({
  50739. key: props.nodeKey,
  50740. data: props.data,
  50741. lazy: props.lazy,
  50742. props: props.props,
  50743. load: props.load,
  50744. currentNodeKey: props.currentNodeKey,
  50745. checkStrictly: props.checkStrictly,
  50746. checkDescendants: props.checkDescendants,
  50747. defaultCheckedKeys: props.defaultCheckedKeys,
  50748. defaultExpandedKeys: props.defaultExpandedKeys,
  50749. autoExpandParent: props.autoExpandParent,
  50750. defaultExpandAll: props.defaultExpandAll,
  50751. filterNodeMethod: props.filterNodeMethod
  50752. }));
  50753. store.value.initialize();
  50754. const root = ref(store.value.root);
  50755. const currentNode = ref(null);
  50756. const el$ = ref(null);
  50757. const dropIndicator$ = ref(null);
  50758. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  50759. const { dragState } = useDragNodeHandler({
  50760. props,
  50761. ctx,
  50762. el$,
  50763. dropIndicator$,
  50764. store
  50765. });
  50766. useKeydown({ el$ }, store);
  50767. const instance = getCurrentInstance();
  50768. const isSelectTree = computed(() => {
  50769. let parent = instance?.parent;
  50770. while (parent) {
  50771. if (parent.type.name === "ElTreeSelect") return true;
  50772. parent = parent.parent;
  50773. }
  50774. return false;
  50775. });
  50776. const isEmpty = computed(() => {
  50777. const { childNodes } = root.value;
  50778. return (!childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible)) && !isSelectTree.value;
  50779. });
  50780. watch(() => props.currentNodeKey, (newVal) => {
  50781. store.value.setCurrentNodeKey(newVal ?? null);
  50782. });
  50783. watch(() => props.defaultCheckedKeys, (newVal, oldVal) => {
  50784. if (isEqual$1(newVal, oldVal)) return;
  50785. store.value.setDefaultCheckedKey(newVal ?? []);
  50786. });
  50787. watch(() => props.defaultExpandedKeys, (newVal) => {
  50788. store.value.setDefaultExpandedKeys(newVal ?? []);
  50789. });
  50790. watch(() => props.data, (newVal) => {
  50791. store.value.setData(newVal);
  50792. }, { deep: true });
  50793. watch(() => props.checkStrictly, (newVal) => {
  50794. store.value.checkStrictly = newVal;
  50795. });
  50796. const filter = (value) => {
  50797. if (!props.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter");
  50798. store.value.filter(value);
  50799. };
  50800. const getNodeKey$1 = (node) => {
  50801. return props.nodeKey ? getNodeKey(props.nodeKey, node.data) : node.id;
  50802. };
  50803. const requireNodeKey = (methodName) => {
  50804. if (!props.nodeKey) throw new Error(`[Tree] nodeKey is required in ${methodName}`);
  50805. };
  50806. const getNodePath = (data) => {
  50807. requireNodeKey("getNodePath");
  50808. const node = store.value.getNode(data);
  50809. if (!node) return [];
  50810. const path = [node.data];
  50811. let parent = node.parent;
  50812. while (parent && parent !== root.value) {
  50813. path.push(parent.data);
  50814. parent = parent.parent;
  50815. }
  50816. return path.reverse();
  50817. };
  50818. const getCheckedNodes = (leafOnly, includeHalfChecked) => {
  50819. return store.value.getCheckedNodes(leafOnly, includeHalfChecked);
  50820. };
  50821. const getCheckedKeys = (leafOnly) => {
  50822. return store.value.getCheckedKeys(leafOnly);
  50823. };
  50824. const getCurrentNode = () => {
  50825. const currentNode = store.value.getCurrentNode();
  50826. return currentNode ? currentNode.data : null;
  50827. };
  50828. const getCurrentKey = () => {
  50829. requireNodeKey("getCurrentKey");
  50830. const currentNode = getCurrentNode();
  50831. return currentNode ? currentNode[props.nodeKey] : null;
  50832. };
  50833. const setCheckedNodes = (nodes, leafOnly) => {
  50834. requireNodeKey("setCheckedNodes");
  50835. store.value.setCheckedNodes(nodes, leafOnly);
  50836. };
  50837. const setCheckedKeys = (keys, leafOnly) => {
  50838. requireNodeKey("setCheckedKeys");
  50839. store.value.setCheckedKeys(keys, leafOnly);
  50840. };
  50841. const setChecked = (data, checked, deep) => {
  50842. store.value.setChecked(data, checked, deep);
  50843. };
  50844. const getHalfCheckedNodes = () => {
  50845. return store.value.getHalfCheckedNodes();
  50846. };
  50847. const getHalfCheckedKeys = () => {
  50848. return store.value.getHalfCheckedKeys();
  50849. };
  50850. const setCurrentNode = (node, shouldAutoExpandParent = true) => {
  50851. requireNodeKey("setCurrentNode");
  50852. handleCurrentChange(store, ctx.emit, () => {
  50853. broadcastExpanded(node);
  50854. store.value.setUserCurrentNode(node, shouldAutoExpandParent);
  50855. });
  50856. };
  50857. const setCurrentKey = (key = null, shouldAutoExpandParent = true) => {
  50858. requireNodeKey("setCurrentKey");
  50859. handleCurrentChange(store, ctx.emit, () => {
  50860. broadcastExpanded();
  50861. store.value.setCurrentNodeKey(key, shouldAutoExpandParent);
  50862. });
  50863. };
  50864. const getNode = (data) => {
  50865. return store.value.getNode(data);
  50866. };
  50867. const remove = (data) => {
  50868. store.value.remove(data);
  50869. };
  50870. const append = (data, parentNode) => {
  50871. store.value.append(data, parentNode);
  50872. };
  50873. const insertBefore = (data, refNode) => {
  50874. store.value.insertBefore(data, refNode);
  50875. };
  50876. const insertAfter = (data, refNode) => {
  50877. store.value.insertAfter(data, refNode);
  50878. };
  50879. const handleNodeExpand = (nodeData, node, instance) => {
  50880. broadcastExpanded(node);
  50881. ctx.emit("node-expand", nodeData, node, instance);
  50882. };
  50883. const updateKeyChildren = (key, data) => {
  50884. requireNodeKey("updateKeyChildren");
  50885. store.value.updateChildren(key, data);
  50886. };
  50887. provide(ROOT_TREE_INJECTION_KEY, {
  50888. ctx,
  50889. props,
  50890. store,
  50891. root,
  50892. currentNode,
  50893. instance
  50894. });
  50895. provide(formItemContextKey, void 0);
  50896. return {
  50897. ns,
  50898. store,
  50899. root,
  50900. currentNode,
  50901. dragState,
  50902. el$,
  50903. dropIndicator$,
  50904. isEmpty,
  50905. filter,
  50906. getNodeKey: getNodeKey$1,
  50907. getNodePath,
  50908. getCheckedNodes,
  50909. getCheckedKeys,
  50910. getCurrentNode,
  50911. getCurrentKey,
  50912. setCheckedNodes,
  50913. setCheckedKeys,
  50914. setChecked,
  50915. getHalfCheckedNodes,
  50916. getHalfCheckedKeys,
  50917. setCurrentNode,
  50918. setCurrentKey,
  50919. t,
  50920. getNode,
  50921. remove,
  50922. append,
  50923. insertBefore,
  50924. insertAfter,
  50925. handleNodeExpand,
  50926. updateKeyChildren
  50927. };
  50928. }
  50929. });
  50930. //#endregion
  50931. //#region ../../packages/components/tree/src/tree.vue
  50932. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  50933. const _component_el_tree_node = resolveComponent("el-tree-node");
  50934. return openBlock(), createElementBlock("div", {
  50935. ref: "el$",
  50936. class: normalizeClass([
  50937. _ctx.ns.b(),
  50938. _ctx.ns.is("dragging", !!_ctx.dragState.draggingNode),
  50939. _ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop),
  50940. _ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"),
  50941. { [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent }
  50942. ]),
  50943. role: "tree"
  50944. }, [
  50945. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.root.childNodes, (child) => {
  50946. return openBlock(), createBlock(_component_el_tree_node, {
  50947. key: _ctx.getNodeKey(child),
  50948. node: child,
  50949. props: _ctx.props,
  50950. accordion: _ctx.accordion,
  50951. "render-after-expand": _ctx.renderAfterExpand,
  50952. "show-checkbox": _ctx.showCheckbox,
  50953. "render-content": _ctx.renderContent,
  50954. onNodeExpand: _ctx.handleNodeExpand
  50955. }, null, 8, [
  50956. "node",
  50957. "props",
  50958. "accordion",
  50959. "render-after-expand",
  50960. "show-checkbox",
  50961. "render-content",
  50962. "onNodeExpand"
  50963. ]);
  50964. }), 128)),
  50965. _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
  50966. key: 0,
  50967. class: normalizeClass(_ctx.ns.e("empty-block"))
  50968. }, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("span", { class: normalizeClass(_ctx.ns.e("empty-text")) }, toDisplayString(_ctx.emptyText ?? _ctx.t("el.tree.emptyText")), 3)])], 2)) : createCommentVNode("v-if", true),
  50969. withDirectives(createElementVNode("div", {
  50970. ref: "dropIndicator$",
  50971. class: normalizeClass(_ctx.ns.e("drop-indicator"))
  50972. }, null, 2), [[vShow, _ctx.dragState.showDropIndicator]])
  50973. ], 2);
  50974. }
  50975. var tree_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_vue_vue_type_script_lang_default, [["render", _sfc_render$1]]);
  50976. //#endregion
  50977. //#region ../../packages/components/tree/index.ts
  50978. const ElTree = withInstall(tree_default$1);
  50979. //#endregion
  50980. //#region ../../packages/components/tree-select/src/select.ts
  50981. const useSelect = (props, { attrs, emit }, { select, tree, key }) => {
  50982. const ns = useNamespace("tree-select");
  50983. watch(() => props.data, () => {
  50984. if (props.filterable) nextTick(() => {
  50985. tree.value?.filter(select.value?.states.inputValue);
  50986. });
  50987. }, { flush: "post" });
  50988. const focusLastNode = (listNode) => {
  50989. const lastNode = listNode.at(-1);
  50990. if (lastNode.expanded && lastNode.childNodes.at(-1)) focusLastNode([lastNode.childNodes.at(-1)]);
  50991. else {
  50992. (tree.value.el$?.querySelector(`[data-key="${listNode.at(-1).key}"]`))?.focus({ preventScroll: true });
  50993. return;
  50994. }
  50995. };
  50996. onMounted(() => {
  50997. useEventListener(() => select.value?.$el, "keydown", async (evt) => {
  50998. const code = getEventCode(evt);
  50999. const { dropdownMenuVisible } = select.value;
  51000. if ([EVENT_CODE.down, EVENT_CODE.up].includes(code) && dropdownMenuVisible) {
  51001. await nextTick();
  51002. setTimeout(() => {
  51003. if (EVENT_CODE.up === code) {
  51004. const listNode = tree.value.store.root.childNodes;
  51005. focusLastNode(listNode);
  51006. return;
  51007. }
  51008. select.value.optionsArray[select.value.states.hoveringIndex].$el?.parentNode?.parentNode?.focus({ preventScroll: true });
  51009. });
  51010. }
  51011. }, { capture: true });
  51012. });
  51013. return {
  51014. ...pick(toRefs(props), Object.keys(ElSelect.props)),
  51015. ...attrs,
  51016. class: computed(() => attrs.class),
  51017. style: computed(() => attrs.style),
  51018. "onUpdate:modelValue": (value) => emit(UPDATE_MODEL_EVENT, value),
  51019. valueKey: key,
  51020. popperClass: computed(() => {
  51021. const classes = [ns.e("popper")];
  51022. if (props.popperClass) classes.push(props.popperClass);
  51023. return classes.join(" ");
  51024. }),
  51025. filterMethod: (keyword = "") => {
  51026. if (props.filterMethod) props.filterMethod(keyword);
  51027. else if (props.remoteMethod) props.remoteMethod(keyword);
  51028. else tree.value?.filter(keyword);
  51029. }
  51030. };
  51031. };
  51032. //#endregion
  51033. //#region ../../packages/components/tree-select/src/tree-select-option.ts
  51034. const component = defineComponent({
  51035. extends: ElOption,
  51036. setup(props, ctx) {
  51037. const result = ElOption.setup(props, ctx);
  51038. delete result.selectOptionClick;
  51039. const vm = getCurrentInstance().proxy;
  51040. nextTick(() => {
  51041. if (!result.select.states.cachedOptions.get(vm.value)) result.select.onOptionCreate(vm);
  51042. });
  51043. watch(() => ctx.attrs.visible, (val) => {
  51044. nextTick(() => {
  51045. result.states.visible = val;
  51046. });
  51047. }, { immediate: true });
  51048. return result;
  51049. },
  51050. methods: { selectOptionClick() {
  51051. this.$el.parentElement.click();
  51052. } }
  51053. });
  51054. //#endregion
  51055. //#region ../../packages/components/tree-select/src/utils.ts
  51056. function isValidValue(val) {
  51057. return val || val === 0;
  51058. }
  51059. function isValidArray(val) {
  51060. return isArray$1(val) && val.length;
  51061. }
  51062. function toValidArray(val) {
  51063. return isArray$1(val) ? val : isValidValue(val) ? [val] : [];
  51064. }
  51065. function treeFind(treeData, findCallback, getChildren, resultCallback, parent) {
  51066. for (let i = 0; i < treeData.length; i++) {
  51067. const data = treeData[i];
  51068. if (findCallback(data, i, treeData, parent)) return resultCallback ? resultCallback(data, i, treeData, parent) : data;
  51069. else {
  51070. const children = getChildren(data);
  51071. if (isValidArray(children)) {
  51072. const find = treeFind(children, findCallback, getChildren, resultCallback, data);
  51073. if (find) return find;
  51074. }
  51075. }
  51076. }
  51077. }
  51078. function treeEach(treeData, callback, getChildren, parent) {
  51079. for (let i = 0; i < treeData.length; i++) {
  51080. const data = treeData[i];
  51081. callback(data, i, treeData, parent);
  51082. const children = getChildren(data);
  51083. if (isValidArray(children)) treeEach(children, callback, getChildren, data);
  51084. }
  51085. }
  51086. //#endregion
  51087. //#region ../../packages/components/tree-select/src/tree.ts
  51088. const useTree$1 = (props, { attrs, slots, emit }, { select, tree, key }) => {
  51089. watch([() => props.modelValue, tree], () => {
  51090. if (props.showCheckbox) nextTick(() => {
  51091. const treeInstance = tree.value;
  51092. if (treeInstance && !isEqual$1(treeInstance.getCheckedKeys(), toValidArray(props.modelValue))) treeInstance.setCheckedKeys(toValidArray(props.modelValue));
  51093. });
  51094. }, {
  51095. immediate: true,
  51096. deep: true
  51097. });
  51098. const propsMap = computed(() => ({
  51099. value: key.value,
  51100. label: "label",
  51101. children: "children",
  51102. disabled: "disabled",
  51103. isLeaf: "isLeaf",
  51104. ...props.props
  51105. }));
  51106. const getNodeValByProp = (prop, data) => {
  51107. const propVal = propsMap.value[prop];
  51108. if (isFunction$1(propVal)) return propVal(data, tree.value?.getNode(getNodeValByProp("value", data)));
  51109. else return data[propVal];
  51110. };
  51111. const defaultExpandedParentKeys = toValidArray(props.modelValue).map((value) => {
  51112. return treeFind(props.data || [], (data) => getNodeValByProp("value", data) === value, (data) => getNodeValByProp("children", data), (data, index, array, parent) => parent && getNodeValByProp("value", parent));
  51113. }).filter((item) => isValidValue(item));
  51114. const cacheOptions = computed(() => {
  51115. if (!props.renderAfterExpand && !props.lazy) return [];
  51116. const options = [];
  51117. treeEach(props.data.concat(props.cacheData), (node) => {
  51118. const value = getNodeValByProp("value", node);
  51119. options.push({
  51120. value,
  51121. currentLabel: getNodeValByProp("label", node),
  51122. isDisabled: getNodeValByProp("disabled", node)
  51123. });
  51124. }, (data) => getNodeValByProp("children", data));
  51125. return options;
  51126. });
  51127. const getChildCheckedKeys = () => {
  51128. return tree.value?.getCheckedKeys().filter((checkedKey) => {
  51129. const node = tree.value?.getNode(checkedKey);
  51130. return !isNil(node) && isEmpty(node.childNodes);
  51131. });
  51132. };
  51133. const emitChange = (val) => {
  51134. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  51135. };
  51136. function update(val) {
  51137. emit(UPDATE_MODEL_EVENT, val);
  51138. emitChange(val);
  51139. }
  51140. return {
  51141. ...pick(toRefs(props), Object.keys(ElTree.props)),
  51142. ...attrs,
  51143. nodeKey: key,
  51144. expandOnClickNode: computed(() => {
  51145. return !props.checkStrictly && props.expandOnClickNode;
  51146. }),
  51147. defaultExpandedKeys: computed(() => {
  51148. return props.defaultExpandedKeys ? props.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys;
  51149. }),
  51150. renderContent: (h, { node, data, store }) => {
  51151. return h(component, {
  51152. value: getNodeValByProp("value", data),
  51153. label: getNodeValByProp("label", data),
  51154. disabled: getNodeValByProp("disabled", data),
  51155. visible: node.visible
  51156. }, props.renderContent ? () => props.renderContent(h, {
  51157. node,
  51158. data,
  51159. store
  51160. }) : slots.default ? () => slots.default({
  51161. node,
  51162. data,
  51163. store
  51164. }) : void 0);
  51165. },
  51166. filterNodeMethod: (value, data, node) => {
  51167. if (props.filterNodeMethod) return props.filterNodeMethod(value, data, node);
  51168. if (!value) return true;
  51169. return new RegExp(escapeStringRegexp(value), "i").test(getNodeValByProp("label", data) || "");
  51170. },
  51171. onNodeClick: (data, node, e) => {
  51172. attrs.onNodeClick?.(data, node, e);
  51173. if (props.showCheckbox && props.checkOnClickNode) return;
  51174. if (!props.showCheckbox && (props.checkStrictly || node.isLeaf)) {
  51175. if (!getNodeValByProp("disabled", data)) {
  51176. const option = select.value?.states.options.get(getNodeValByProp("value", data));
  51177. select.value?.handleOptionSelect(option);
  51178. }
  51179. } else if (props.expandOnClickNode) e.proxy.handleExpandIconClick();
  51180. },
  51181. onCheck: (data, params) => {
  51182. if (!props.showCheckbox) return;
  51183. const dataValue = getNodeValByProp("value", data);
  51184. const dataMap = {};
  51185. treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes);
  51186. const uncachedCheckedKeys = params.checkedKeys;
  51187. const cachedKeys = props.multiple ? toValidArray(props.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)) : [];
  51188. const checkedKeys = cachedKeys.concat(uncachedCheckedKeys);
  51189. if (props.checkStrictly) update(props.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0);
  51190. else if (props.multiple) {
  51191. const childKeys = getChildCheckedKeys();
  51192. update(cachedKeys.concat(childKeys));
  51193. } else {
  51194. const firstLeaf = treeFind([data], (data) => !isValidArray(getNodeValByProp("children", data)) && !getNodeValByProp("disabled", data), (data) => getNodeValByProp("children", data));
  51195. const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0;
  51196. const hasCheckedChild = isValidValue(props.modelValue) && !!treeFind([data], (data) => getNodeValByProp("value", data) === props.modelValue, (data) => getNodeValByProp("children", data));
  51197. update(firstLeafKey === props.modelValue || hasCheckedChild ? void 0 : firstLeafKey);
  51198. }
  51199. nextTick(() => {
  51200. const checkedKeys = toValidArray(props.modelValue);
  51201. tree.value.setCheckedKeys(checkedKeys);
  51202. attrs.onCheck?.(data, {
  51203. checkedKeys: tree.value.getCheckedKeys(),
  51204. checkedNodes: tree.value.getCheckedNodes(),
  51205. halfCheckedKeys: tree.value.getHalfCheckedKeys(),
  51206. halfCheckedNodes: tree.value.getHalfCheckedNodes()
  51207. });
  51208. });
  51209. select.value?.focus();
  51210. },
  51211. onNodeExpand: (data, node, e) => {
  51212. attrs.onNodeExpand?.(data, node, e);
  51213. nextTick(() => {
  51214. if (!props.checkStrictly && props.lazy && props.multiple && node.checked) {
  51215. const dataMap = {};
  51216. const uncachedCheckedKeys = tree.value.getCheckedKeys();
  51217. treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes);
  51218. const cachedKeys = toValidArray(props.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item));
  51219. const childKeys = getChildCheckedKeys();
  51220. update(cachedKeys.concat(childKeys));
  51221. }
  51222. });
  51223. },
  51224. cacheOptions
  51225. };
  51226. };
  51227. //#endregion
  51228. //#region ../../packages/components/tree-select/src/cache-options.ts
  51229. var cache_options_default = defineComponent({
  51230. props: { data: {
  51231. type: Array,
  51232. default: () => []
  51233. } },
  51234. setup(props) {
  51235. const select = inject(selectKey);
  51236. watch(() => props.data, () => {
  51237. props.data.forEach((item) => {
  51238. if (!select.states.cachedOptions.has(item.value)) select.states.cachedOptions.set(item.value, item);
  51239. });
  51240. const inputs = select.selectRef?.querySelectorAll("input") || [];
  51241. if (isClient && !Array.from(inputs).includes(document.activeElement)) select.setSelected();
  51242. }, {
  51243. flush: "post",
  51244. immediate: true
  51245. });
  51246. return () => void 0;
  51247. }
  51248. });
  51249. //#endregion
  51250. //#region ../../packages/components/tree-select/src/tree-select.vue?vue&type=script&lang.ts
  51251. var tree_select_vue_vue_type_script_lang_default = defineComponent({
  51252. name: "ElTreeSelect",
  51253. inheritAttrs: false,
  51254. props: {
  51255. ...selectProps,
  51256. ...treeProps,
  51257. cacheData: {
  51258. type: Array,
  51259. default: () => []
  51260. }
  51261. },
  51262. setup(props, context) {
  51263. const { slots, expose, emit, attrs } = context;
  51264. const childAttrs = {
  51265. ...attrs,
  51266. onChange: void 0
  51267. };
  51268. const select = ref();
  51269. const tree = ref();
  51270. const key = computed(() => props.nodeKey || props.valueKey || "value");
  51271. const selectProps = useSelect(props, {
  51272. attrs,
  51273. emit
  51274. }, {
  51275. select,
  51276. tree,
  51277. key
  51278. });
  51279. const { cacheOptions, ...treeProps } = useTree$1(props, {
  51280. attrs: childAttrs,
  51281. slots,
  51282. emit
  51283. }, {
  51284. select,
  51285. tree,
  51286. key
  51287. });
  51288. const methods = reactive({});
  51289. expose(methods);
  51290. onMounted(() => {
  51291. Object.assign(methods, {
  51292. ...pick(tree.value, [
  51293. "filter",
  51294. "updateKeyChildren",
  51295. "getCheckedNodes",
  51296. "setCheckedNodes",
  51297. "getCheckedKeys",
  51298. "setCheckedKeys",
  51299. "setChecked",
  51300. "getHalfCheckedNodes",
  51301. "getHalfCheckedKeys",
  51302. "getCurrentKey",
  51303. "getCurrentNode",
  51304. "setCurrentKey",
  51305. "setCurrentNode",
  51306. "getNode",
  51307. "remove",
  51308. "append",
  51309. "insertBefore",
  51310. "insertAfter"
  51311. ]),
  51312. ...pick(select.value, [
  51313. "focus",
  51314. "blur",
  51315. "selectedLabel"
  51316. ]),
  51317. treeRef: tree.value,
  51318. selectRef: select.value
  51319. });
  51320. });
  51321. return () => h(
  51322. ElSelect,
  51323. /**
  51324. * 1. The `props` is processed into `Refs`, but `v-bind` and
  51325. * render function props cannot read `Refs`, so use `reactive`
  51326. * unwrap the `Refs` and keep reactive.
  51327. * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,
  51328. * so use function.
  51329. */
  51330. reactive({
  51331. ...selectProps,
  51332. ref: (ref) => select.value = ref
  51333. }),
  51334. {
  51335. ...slots,
  51336. default: () => [h(cache_options_default, { data: cacheOptions.value }), h(ElTree, reactive({
  51337. ...treeProps,
  51338. ref: (ref) => tree.value = ref
  51339. }))]
  51340. }
  51341. );
  51342. }
  51343. });
  51344. //#endregion
  51345. //#region ../../packages/components/tree-select/src/tree-select.vue
  51346. var tree_select_default = tree_select_vue_vue_type_script_lang_default;
  51347. //#endregion
  51348. //#region ../../packages/components/tree-select/index.ts
  51349. const ElTreeSelect = withInstall(tree_select_default);
  51350. //#endregion
  51351. //#region ../../packages/components/tree-v2/src/virtual-tree.ts
  51352. const ROOT_TREE_INJECTION_KEY$1 = Symbol();
  51353. const EMPTY_NODE = {
  51354. key: -1,
  51355. level: -1,
  51356. data: {}
  51357. };
  51358. let TreeOptionsEnum = /* @__PURE__ */ function(TreeOptionsEnum) {
  51359. TreeOptionsEnum["KEY"] = "id";
  51360. TreeOptionsEnum["LABEL"] = "label";
  51361. TreeOptionsEnum["CHILDREN"] = "children";
  51362. TreeOptionsEnum["DISABLED"] = "disabled";
  51363. TreeOptionsEnum["CLASS"] = "";
  51364. return TreeOptionsEnum;
  51365. }({});
  51366. let SetOperationEnum = /* @__PURE__ */ function(SetOperationEnum) {
  51367. SetOperationEnum["ADD"] = "add";
  51368. SetOperationEnum["DELETE"] = "delete";
  51369. return SetOperationEnum;
  51370. }({});
  51371. const itemSize = {
  51372. type: Number,
  51373. default: 26
  51374. };
  51375. /**
  51376. * @deprecated Removed after 3.0.0, Use `TreeProps` instead.
  51377. */
  51378. const treeProps$1 = buildProps({
  51379. data: {
  51380. type: definePropType(Array),
  51381. default: () => mutable([])
  51382. },
  51383. emptyText: { type: String },
  51384. height: {
  51385. type: Number,
  51386. default: 200
  51387. },
  51388. props: {
  51389. type: definePropType(Object),
  51390. default: () => mutable({
  51391. children: TreeOptionsEnum.CHILDREN,
  51392. label: TreeOptionsEnum.LABEL,
  51393. disabled: TreeOptionsEnum.DISABLED,
  51394. value: TreeOptionsEnum.KEY,
  51395. class: TreeOptionsEnum.CLASS
  51396. })
  51397. },
  51398. highlightCurrent: Boolean,
  51399. showCheckbox: Boolean,
  51400. defaultCheckedKeys: {
  51401. type: definePropType(Array),
  51402. default: () => mutable([])
  51403. },
  51404. checkStrictly: Boolean,
  51405. defaultExpandedKeys: {
  51406. type: definePropType(Array),
  51407. default: () => mutable([])
  51408. },
  51409. indent: {
  51410. type: Number,
  51411. default: 16
  51412. },
  51413. itemSize,
  51414. icon: { type: iconPropType },
  51415. expandOnClickNode: {
  51416. type: Boolean,
  51417. default: true
  51418. },
  51419. checkOnClickNode: Boolean,
  51420. checkOnClickLeaf: {
  51421. type: Boolean,
  51422. default: true
  51423. },
  51424. currentNodeKey: { type: definePropType([String, Number]) },
  51425. accordion: Boolean,
  51426. filterMethod: { type: definePropType(Function) },
  51427. perfMode: {
  51428. type: Boolean,
  51429. default: true
  51430. },
  51431. scrollbarAlwaysOn: Boolean
  51432. });
  51433. /**
  51434. * @deprecated Removed after 3.0.0, Use `TreeNodeProps` instead.
  51435. */
  51436. const treeNodeProps = buildProps({
  51437. node: {
  51438. type: definePropType(Object),
  51439. default: () => mutable(EMPTY_NODE)
  51440. },
  51441. expanded: Boolean,
  51442. checked: Boolean,
  51443. indeterminate: Boolean,
  51444. showCheckbox: Boolean,
  51445. disabled: Boolean,
  51446. current: Boolean,
  51447. hiddenExpandIcon: Boolean,
  51448. itemSize
  51449. });
  51450. const treeNodeContentProps = buildProps({ node: {
  51451. type: definePropType(Object),
  51452. required: true
  51453. } });
  51454. const NODE_CLICK = "node-click";
  51455. const NODE_DROP = "node-drop";
  51456. const NODE_EXPAND = "node-expand";
  51457. const NODE_COLLAPSE = "node-collapse";
  51458. const CURRENT_CHANGE = "current-change";
  51459. const NODE_CHECK = "check";
  51460. const NODE_CHECK_CHANGE = "check-change";
  51461. const NODE_CONTEXTMENU = "node-contextmenu";
  51462. const treeEmits$1 = {
  51463. [NODE_CLICK]: (data, node, e) => data && node && e,
  51464. [NODE_DROP]: (data, node, e) => data && node && e,
  51465. [NODE_EXPAND]: (data, node) => data && node,
  51466. [NODE_COLLAPSE]: (data, node) => data && node,
  51467. [CURRENT_CHANGE]: (data, node) => data && node,
  51468. [NODE_CHECK]: (data, checkedInfo) => data && checkedInfo,
  51469. [NODE_CHECK_CHANGE]: (data, checked) => data && isBoolean(checked),
  51470. [NODE_CONTEXTMENU]: (evt, data, node) => evt && data && node
  51471. };
  51472. const treeNodeEmits = {
  51473. click: (node, e) => !!(node && e),
  51474. drop: (node, e) => !!(node && e),
  51475. toggle: (node) => !!node,
  51476. check: (node, checked) => node && isBoolean(checked)
  51477. };
  51478. //#endregion
  51479. //#region ../../packages/components/tree-v2/src/composables/useCheck.ts
  51480. function useCheck(props, tree) {
  51481. const checkedKeys = ref(/* @__PURE__ */ new Set());
  51482. const indeterminateKeys = ref(/* @__PURE__ */ new Set());
  51483. const { emit } = getCurrentInstance();
  51484. watch([() => tree.value, () => props.defaultCheckedKeys], () => {
  51485. return nextTick(() => {
  51486. _setCheckedKeys(props.defaultCheckedKeys);
  51487. });
  51488. }, { immediate: true });
  51489. const updateCheckedKeys = () => {
  51490. if (!tree.value || !props.showCheckbox || props.checkStrictly) return;
  51491. const { levelTreeNodeMap, maxLevel } = tree.value;
  51492. const checkedKeySet = checkedKeys.value;
  51493. const indeterminateKeySet = /* @__PURE__ */ new Set();
  51494. for (let level = maxLevel; level >= 1; --level) {
  51495. const nodes = levelTreeNodeMap.get(level);
  51496. if (!nodes) continue;
  51497. nodes.forEach((node) => {
  51498. const children = node.children;
  51499. let isEffectivelyChecked = !node.isLeaf || node.disabled || checkedKeySet.has(node.key);
  51500. if (children) {
  51501. let allChecked = true;
  51502. let hasChecked = false;
  51503. for (const childNode of children) {
  51504. const key = childNode.key;
  51505. if (!childNode.isEffectivelyChecked) isEffectivelyChecked = false;
  51506. if (checkedKeySet.has(key)) hasChecked = true;
  51507. else if (indeterminateKeySet.has(key)) {
  51508. allChecked = false;
  51509. hasChecked = true;
  51510. break;
  51511. } else allChecked = false;
  51512. }
  51513. if (allChecked) checkedKeySet.add(node.key);
  51514. else if (hasChecked) {
  51515. indeterminateKeySet.add(node.key);
  51516. checkedKeySet.delete(node.key);
  51517. } else {
  51518. checkedKeySet.delete(node.key);
  51519. indeterminateKeySet.delete(node.key);
  51520. }
  51521. }
  51522. node.isEffectivelyChecked = isEffectivelyChecked;
  51523. });
  51524. }
  51525. indeterminateKeys.value = indeterminateKeySet;
  51526. };
  51527. const isChecked = (node) => checkedKeys.value.has(node.key);
  51528. const isIndeterminate = (node) => indeterminateKeys.value.has(node.key);
  51529. const toggleCheckbox = (node, isChecked, nodeClick = true, immediateUpdate = true) => {
  51530. const checkedKeySet = checkedKeys.value;
  51531. const children = node.children;
  51532. if (!props.checkStrictly && nodeClick && children?.length) isChecked = children.some((node) => !node.isEffectivelyChecked);
  51533. const toggle = (node, checked) => {
  51534. checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](node.key);
  51535. const children = node.children;
  51536. if (!props.checkStrictly && children) children.forEach((childNode) => {
  51537. if (!childNode.disabled || childNode.children) toggle(childNode, checked);
  51538. });
  51539. };
  51540. toggle(node, isChecked);
  51541. if (immediateUpdate) updateCheckedKeys();
  51542. if (nodeClick) afterNodeCheck(node, isChecked);
  51543. };
  51544. const afterNodeCheck = (node, checked) => {
  51545. const { checkedNodes, checkedKeys } = getChecked();
  51546. const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked();
  51547. emit(NODE_CHECK, node.data, {
  51548. checkedKeys,
  51549. checkedNodes,
  51550. halfCheckedKeys,
  51551. halfCheckedNodes
  51552. });
  51553. emit(NODE_CHECK_CHANGE, node.data, checked);
  51554. };
  51555. function getCheckedKeys(leafOnly = false) {
  51556. return getChecked(leafOnly).checkedKeys;
  51557. }
  51558. function getCheckedNodes(leafOnly = false) {
  51559. return getChecked(leafOnly).checkedNodes;
  51560. }
  51561. function getHalfCheckedKeys() {
  51562. return getHalfChecked().halfCheckedKeys;
  51563. }
  51564. function getHalfCheckedNodes() {
  51565. return getHalfChecked().halfCheckedNodes;
  51566. }
  51567. function getChecked(leafOnly = false) {
  51568. const checkedNodes = [];
  51569. const keys = [];
  51570. if (tree?.value && props.showCheckbox) {
  51571. const { treeNodeMap } = tree.value;
  51572. checkedKeys.value.forEach((key) => {
  51573. const node = treeNodeMap.get(key);
  51574. if (node && (!leafOnly || leafOnly && node.isLeaf)) {
  51575. keys.push(key);
  51576. checkedNodes.push(node.data);
  51577. }
  51578. });
  51579. }
  51580. return {
  51581. checkedKeys: keys,
  51582. checkedNodes
  51583. };
  51584. }
  51585. function getHalfChecked() {
  51586. const halfCheckedNodes = [];
  51587. const halfCheckedKeys = [];
  51588. if (tree?.value && props.showCheckbox) {
  51589. const { treeNodeMap } = tree.value;
  51590. indeterminateKeys.value.forEach((key) => {
  51591. const node = treeNodeMap.get(key);
  51592. if (node) {
  51593. halfCheckedKeys.push(key);
  51594. halfCheckedNodes.push(node.data);
  51595. }
  51596. });
  51597. }
  51598. return {
  51599. halfCheckedNodes,
  51600. halfCheckedKeys
  51601. };
  51602. }
  51603. function setCheckedKeys(keys) {
  51604. checkedKeys.value.clear();
  51605. indeterminateKeys.value.clear();
  51606. nextTick(() => {
  51607. _setCheckedKeys(keys);
  51608. });
  51609. }
  51610. function setChecked(key, isChecked) {
  51611. if (tree?.value && props.showCheckbox) {
  51612. const node = tree.value.treeNodeMap.get(key);
  51613. if (node) toggleCheckbox(node, isChecked, false);
  51614. }
  51615. }
  51616. function _setCheckedKeys(keys) {
  51617. if (tree?.value) {
  51618. const { treeNodeMap } = tree.value;
  51619. if (props.showCheckbox && treeNodeMap && keys?.length > 0) {
  51620. for (const key of keys) {
  51621. const node = treeNodeMap.get(key);
  51622. if (node && !isChecked(node)) toggleCheckbox(node, true, false, false);
  51623. }
  51624. updateCheckedKeys();
  51625. }
  51626. }
  51627. }
  51628. return {
  51629. updateCheckedKeys,
  51630. toggleCheckbox,
  51631. isChecked,
  51632. isIndeterminate,
  51633. getCheckedKeys,
  51634. getCheckedNodes,
  51635. getHalfCheckedKeys,
  51636. getHalfCheckedNodes,
  51637. setChecked,
  51638. setCheckedKeys
  51639. };
  51640. }
  51641. //#endregion
  51642. //#region ../../packages/components/tree-v2/src/composables/useFilter.ts
  51643. function useFilter(props, tree) {
  51644. const hiddenNodeKeySet = ref(/* @__PURE__ */ new Set([]));
  51645. const hiddenExpandIconKeySet = ref(/* @__PURE__ */ new Set([]));
  51646. const filterable = computed(() => {
  51647. return isFunction$1(props.filterMethod);
  51648. });
  51649. function doFilter(query) {
  51650. if (!filterable.value) return;
  51651. const expandKeySet = /* @__PURE__ */ new Set();
  51652. const hiddenExpandIconKeys = hiddenExpandIconKeySet.value;
  51653. const hiddenKeys = hiddenNodeKeySet.value;
  51654. const family = [];
  51655. const nodes = tree.value?.treeNodes || [];
  51656. const filter = props.filterMethod;
  51657. hiddenKeys.clear();
  51658. function traverse(nodes) {
  51659. nodes.forEach((node) => {
  51660. family.push(node);
  51661. if (filter?.(query, node.data, node)) family.forEach((member) => {
  51662. expandKeySet.add(member.key);
  51663. member.expanded = true;
  51664. });
  51665. else {
  51666. node.expanded = false;
  51667. if (node.isLeaf) hiddenKeys.add(node.key);
  51668. }
  51669. const children = node.children;
  51670. if (children) traverse(children);
  51671. if (!node.isLeaf) {
  51672. if (!expandKeySet.has(node.key)) hiddenKeys.add(node.key);
  51673. else if (children) {
  51674. let allHidden = true;
  51675. for (const childNode of children) if (!hiddenKeys.has(childNode.key)) {
  51676. allHidden = false;
  51677. break;
  51678. }
  51679. if (allHidden) hiddenExpandIconKeys.add(node.key);
  51680. else hiddenExpandIconKeys.delete(node.key);
  51681. }
  51682. }
  51683. family.pop();
  51684. });
  51685. }
  51686. traverse(nodes);
  51687. return expandKeySet;
  51688. }
  51689. function isForceHiddenExpandIcon(node) {
  51690. return hiddenExpandIconKeySet.value.has(node.key);
  51691. }
  51692. return {
  51693. hiddenExpandIconKeySet,
  51694. hiddenNodeKeySet,
  51695. doFilter,
  51696. isForceHiddenExpandIcon
  51697. };
  51698. }
  51699. //#endregion
  51700. //#region ../../packages/components/tree-v2/src/composables/useTree.ts
  51701. function useTree(props, emit) {
  51702. const expandedKeySet = ref(/* @__PURE__ */ new Set());
  51703. const currentKey = ref();
  51704. const tree = shallowRef();
  51705. const listRef = ref();
  51706. const { isIndeterminate, isChecked, toggleCheckbox, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys } = useCheck(props, tree);
  51707. const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(props, tree);
  51708. const valueKey = computed(() => {
  51709. return props.props?.value || TreeOptionsEnum.KEY;
  51710. });
  51711. const childrenKey = computed(() => {
  51712. return props.props?.children || TreeOptionsEnum.CHILDREN;
  51713. });
  51714. const disabledKey = computed(() => {
  51715. return props.props?.disabled || TreeOptionsEnum.DISABLED;
  51716. });
  51717. const labelKey = computed(() => {
  51718. return props.props?.label || TreeOptionsEnum.LABEL;
  51719. });
  51720. const flattenTree = computed(() => {
  51721. const expandedKeys = expandedKeySet.value;
  51722. const hiddenKeys = hiddenNodeKeySet.value;
  51723. const flattenNodes = [];
  51724. const nodes = tree.value?.treeNodes || [];
  51725. const stack = [];
  51726. for (let i = nodes.length - 1; i >= 0; --i) stack.push(nodes[i]);
  51727. while (stack.length) {
  51728. const node = stack.pop();
  51729. if (hiddenKeys.has(node.key)) continue;
  51730. flattenNodes.push(node);
  51731. if (node.children && expandedKeys.has(node.key)) for (let i = node.children.length - 1; i >= 0; --i) stack.push(node.children[i]);
  51732. }
  51733. return flattenNodes;
  51734. });
  51735. const isNotEmpty = computed(() => {
  51736. return flattenTree.value.length > 0;
  51737. });
  51738. function createTree(data) {
  51739. const treeNodeMap = /* @__PURE__ */ new Map();
  51740. const levelTreeNodeMap = /* @__PURE__ */ new Map();
  51741. let maxLevel = 1;
  51742. function traverse(nodes, level = 1, parent = void 0) {
  51743. const siblings = [];
  51744. for (const rawNode of nodes) {
  51745. const value = getKey(rawNode);
  51746. const node = {
  51747. level,
  51748. key: value,
  51749. data: rawNode
  51750. };
  51751. node.label = getLabel(rawNode);
  51752. node.parent = parent;
  51753. const children = getChildren(rawNode);
  51754. node.disabled = getDisabled(rawNode);
  51755. node.isLeaf = !children || children.length === 0;
  51756. node.expanded = expandedKeySet.value.has(value);
  51757. if (children && children.length) node.children = traverse(children, level + 1, node);
  51758. siblings.push(node);
  51759. treeNodeMap.set(value, node);
  51760. if (!levelTreeNodeMap.has(level)) levelTreeNodeMap.set(level, []);
  51761. levelTreeNodeMap.get(level)?.push(node);
  51762. }
  51763. if (level > maxLevel) maxLevel = level;
  51764. return siblings;
  51765. }
  51766. const treeNodes = traverse(data);
  51767. return {
  51768. treeNodeMap,
  51769. levelTreeNodeMap,
  51770. maxLevel,
  51771. treeNodes
  51772. };
  51773. }
  51774. function filter(query) {
  51775. const keys = doFilter(query);
  51776. if (keys) expandedKeySet.value = keys;
  51777. }
  51778. function getChildren(node) {
  51779. return node[childrenKey.value];
  51780. }
  51781. function getKey(node) {
  51782. if (!node) return "";
  51783. return node[valueKey.value];
  51784. }
  51785. function getDisabled(node) {
  51786. return node[disabledKey.value];
  51787. }
  51788. function getLabel(node) {
  51789. return node[labelKey.value];
  51790. }
  51791. function toggleExpand(node) {
  51792. if (expandedKeySet.value.has(node.key)) collapseNode(node);
  51793. else expandNode(node);
  51794. }
  51795. function setExpandedKeys(keys) {
  51796. const expandedKeys = /* @__PURE__ */ new Set();
  51797. const nodeMap = tree.value.treeNodeMap;
  51798. expandedKeySet.value.forEach((key) => {
  51799. const node = nodeMap.get(key);
  51800. expandedKeySet.value.delete(node.key);
  51801. node.expanded = false;
  51802. });
  51803. keys.forEach((k) => {
  51804. let node = nodeMap.get(k);
  51805. while (node && !expandedKeys.has(node.key)) {
  51806. expandedKeys.add(node.key);
  51807. node.expanded = true;
  51808. node = node.parent;
  51809. }
  51810. });
  51811. expandedKeySet.value = expandedKeys;
  51812. }
  51813. function handleNodeClick(node, e) {
  51814. emit(NODE_CLICK, node.data, node, e);
  51815. handleCurrentChange(node);
  51816. if (props.expandOnClickNode) toggleExpand(node);
  51817. if (props.showCheckbox && (props.checkOnClickNode || node.isLeaf && props.checkOnClickLeaf) && !node.disabled) toggleCheckbox(node, !isChecked(node), true);
  51818. }
  51819. function handleNodeDrop(node, e) {
  51820. emit(NODE_DROP, node.data, node, e);
  51821. }
  51822. function handleCurrentChange(node) {
  51823. if (!isCurrent(node)) {
  51824. currentKey.value = node.key;
  51825. emit(CURRENT_CHANGE, node.data, node);
  51826. }
  51827. }
  51828. function handleNodeCheck(node, checked) {
  51829. toggleCheckbox(node, checked);
  51830. }
  51831. function expandNode(node) {
  51832. const keySet = expandedKeySet.value;
  51833. if (tree.value && props.accordion) {
  51834. const { treeNodeMap } = tree.value;
  51835. keySet.forEach((key) => {
  51836. const treeNode = treeNodeMap.get(key);
  51837. if (node && node.level === treeNode?.level) {
  51838. keySet.delete(key);
  51839. treeNode.expanded = false;
  51840. }
  51841. });
  51842. }
  51843. keySet.add(node.key);
  51844. const _node = getNode(node.key);
  51845. if (_node) {
  51846. _node.expanded = true;
  51847. emit(NODE_EXPAND, _node.data, _node);
  51848. }
  51849. }
  51850. function collapseNode(node) {
  51851. expandedKeySet.value.delete(node.key);
  51852. const _node = getNode(node.key);
  51853. if (_node) {
  51854. _node.expanded = false;
  51855. emit(NODE_COLLAPSE, _node.data, _node);
  51856. }
  51857. }
  51858. function isDisabled(node) {
  51859. return !!node.disabled;
  51860. }
  51861. function isCurrent(node) {
  51862. const current = currentKey.value;
  51863. return current !== void 0 && current === node.key;
  51864. }
  51865. function getCurrentNode() {
  51866. if (!currentKey.value) return void 0;
  51867. return tree.value?.treeNodeMap.get(currentKey.value)?.data;
  51868. }
  51869. function getCurrentKey() {
  51870. return currentKey.value;
  51871. }
  51872. function setCurrentKey(key) {
  51873. currentKey.value = key;
  51874. }
  51875. function setData(data) {
  51876. tree.value = createTree(data);
  51877. }
  51878. function getNode(data) {
  51879. const key = isObject$1(data) ? getKey(data) : data;
  51880. return tree.value?.treeNodeMap.get(key);
  51881. }
  51882. function scrollToNode(key, strategy = "auto") {
  51883. const node = getNode(key);
  51884. if (node && listRef.value) listRef.value.scrollToItem(flattenTree.value.indexOf(node), strategy);
  51885. }
  51886. function scrollTo(offset) {
  51887. listRef.value?.scrollTo(offset);
  51888. }
  51889. watch(() => props.currentNodeKey, (key) => {
  51890. currentKey.value = key;
  51891. }, { immediate: true });
  51892. watch(() => props.defaultExpandedKeys, (key) => {
  51893. expandedKeySet.value = new Set(key);
  51894. }, { immediate: true });
  51895. watch(() => props.data, (data) => {
  51896. setData(data);
  51897. }, { immediate: true });
  51898. return {
  51899. tree,
  51900. flattenTree,
  51901. isNotEmpty,
  51902. listRef,
  51903. getKey,
  51904. getChildren,
  51905. toggleExpand,
  51906. toggleCheckbox,
  51907. isChecked,
  51908. isIndeterminate,
  51909. isDisabled,
  51910. isCurrent,
  51911. isForceHiddenExpandIcon,
  51912. handleNodeClick,
  51913. handleNodeDrop,
  51914. handleNodeCheck,
  51915. getCurrentNode,
  51916. getCurrentKey,
  51917. setCurrentKey,
  51918. getCheckedKeys,
  51919. getCheckedNodes,
  51920. getHalfCheckedKeys,
  51921. getHalfCheckedNodes,
  51922. setChecked,
  51923. setCheckedKeys,
  51924. filter,
  51925. setData,
  51926. getNode,
  51927. expandNode,
  51928. collapseNode,
  51929. setExpandedKeys,
  51930. scrollToNode,
  51931. scrollTo
  51932. };
  51933. }
  51934. //#endregion
  51935. //#region ../../packages/components/tree-v2/src/tree-node-content.ts
  51936. var tree_node_content_default = defineComponent({
  51937. name: "ElTreeNodeContent",
  51938. props: treeNodeContentProps,
  51939. setup(props) {
  51940. const tree = inject(ROOT_TREE_INJECTION_KEY$1);
  51941. const ns = useNamespace("tree");
  51942. return () => {
  51943. const node = props.node;
  51944. const { data } = node;
  51945. return tree?.ctx.slots.default ? tree.ctx.slots.default({
  51946. node,
  51947. data
  51948. }) : h(ElText, {
  51949. tag: "span",
  51950. truncated: true,
  51951. class: ns.be("node", "label")
  51952. }, () => [node?.label]);
  51953. };
  51954. }
  51955. });
  51956. //#endregion
  51957. //#region ../../packages/components/tree-v2/src/tree-node.vue?vue&type=script&setup=true&lang.ts
  51958. const _hoisted_1$11 = [
  51959. "aria-expanded",
  51960. "aria-disabled",
  51961. "aria-checked",
  51962. "data-key"
  51963. ];
  51964. var tree_node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  51965. name: "ElTreeNode",
  51966. __name: "tree-node",
  51967. props: treeNodeProps,
  51968. emits: treeNodeEmits,
  51969. setup(__props, { emit: __emit }) {
  51970. const props = __props;
  51971. const emit = __emit;
  51972. const tree = inject(ROOT_TREE_INJECTION_KEY$1);
  51973. const ns = useNamespace("tree");
  51974. const indent = computed(() => tree?.props.indent ?? 16);
  51975. const icon = computed(() => tree?.props.icon ?? caret_right_default);
  51976. const getNodeClass = (node) => {
  51977. const nodeClassFunc = tree?.props.props?.class;
  51978. if (!nodeClassFunc) return {};
  51979. let className;
  51980. if (isFunction$1(nodeClassFunc)) {
  51981. const { data } = node;
  51982. className = nodeClassFunc(data, node);
  51983. } else className = nodeClassFunc;
  51984. return isString(className) ? { [className]: true } : className;
  51985. };
  51986. const handleClick = (e) => {
  51987. emit("click", props.node, e);
  51988. };
  51989. const handleDrop = (e) => {
  51990. emit("drop", props.node, e);
  51991. };
  51992. const handleExpandIconClick = () => {
  51993. emit("toggle", props.node);
  51994. };
  51995. const handleCheckChange = (value) => {
  51996. emit("check", props.node, value);
  51997. };
  51998. const handleContextMenu = (event) => {
  51999. if (tree?.instance?.vnode?.props?.["onNodeContextmenu"]) {
  52000. event.stopPropagation();
  52001. event.preventDefault();
  52002. }
  52003. tree?.ctx.emit(NODE_CONTEXTMENU, event, props.node?.data, props.node);
  52004. };
  52005. return (_ctx, _cache) => {
  52006. return openBlock(), createElementBlock("div", {
  52007. ref: "node$",
  52008. class: normalizeClass([
  52009. unref(ns).b("node"),
  52010. unref(ns).is("expanded", __props.expanded),
  52011. unref(ns).is("current", __props.current),
  52012. unref(ns).is("focusable", !__props.disabled),
  52013. unref(ns).is("checked", !__props.disabled && __props.checked),
  52014. getNodeClass(__props.node)
  52015. ]),
  52016. role: "treeitem",
  52017. tabindex: "-1",
  52018. "aria-expanded": __props.expanded,
  52019. "aria-disabled": __props.disabled,
  52020. "aria-checked": __props.checked,
  52021. "data-key": __props.node?.key,
  52022. onClick: withModifiers(handleClick, ["stop"]),
  52023. onContextmenu: handleContextMenu,
  52024. onDragover: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
  52025. onDragenter: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
  52026. onDrop: withModifiers(handleDrop, ["stop"])
  52027. }, [createElementVNode("div", {
  52028. class: normalizeClass(unref(ns).be("node", "content")),
  52029. style: normalizeStyle({
  52030. paddingLeft: `${(__props.node.level - 1) * indent.value}px`,
  52031. height: __props.itemSize + "px"
  52032. })
  52033. }, [
  52034. icon.value ? (openBlock(), createBlock(unref(ElIcon), {
  52035. key: 0,
  52036. class: normalizeClass([
  52037. unref(ns).is("leaf", !!__props.node?.isLeaf),
  52038. unref(ns).is("hidden", __props.hiddenExpandIcon),
  52039. { expanded: !__props.node?.isLeaf && __props.expanded },
  52040. unref(ns).be("node", "expand-icon")
  52041. ]),
  52042. onClick: withModifiers(handleExpandIconClick, ["stop"])
  52043. }, {
  52044. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(icon.value)))]),
  52045. _: 1
  52046. }, 8, ["class"])) : createCommentVNode("v-if", true),
  52047. __props.showCheckbox ? (openBlock(), createBlock(unref(ElCheckbox), {
  52048. key: 1,
  52049. "model-value": __props.checked,
  52050. indeterminate: __props.indeterminate,
  52051. disabled: __props.disabled,
  52052. onChange: handleCheckChange,
  52053. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  52054. }, null, 8, [
  52055. "model-value",
  52056. "indeterminate",
  52057. "disabled"
  52058. ])) : createCommentVNode("v-if", true),
  52059. createVNode(unref(tree_node_content_default), { node: {
  52060. ...__props.node,
  52061. expanded: __props.expanded
  52062. } }, null, 8, ["node"])
  52063. ], 6)], 42, _hoisted_1$11);
  52064. };
  52065. }
  52066. });
  52067. //#endregion
  52068. //#region ../../packages/components/tree-v2/src/tree-node.vue
  52069. var tree_node_default = tree_node_vue_vue_type_script_setup_true_lang_default;
  52070. //#endregion
  52071. //#region ../../packages/components/tree-v2/src/tree.vue?vue&type=script&setup=true&lang.ts
  52072. var tree_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  52073. name: "ElTreeV2",
  52074. __name: "tree",
  52075. props: treeProps$1,
  52076. emits: treeEmits$1,
  52077. setup(__props, { expose: __expose, emit: __emit }) {
  52078. const props = __props;
  52079. const emit = __emit;
  52080. const slots = useSlots();
  52081. const treeNodeSize = computed(() => props.itemSize);
  52082. provide(ROOT_TREE_INJECTION_KEY$1, {
  52083. ctx: {
  52084. emit,
  52085. slots
  52086. },
  52087. props,
  52088. instance: getCurrentInstance()
  52089. });
  52090. provide(formItemContextKey, void 0);
  52091. const { t } = useLocale();
  52092. const ns = useNamespace("tree");
  52093. const { flattenTree, isNotEmpty, listRef, toggleExpand, isIndeterminate, isChecked, isDisabled, isCurrent, isForceHiddenExpandIcon, handleNodeClick, handleNodeDrop, handleNodeCheck, toggleCheckbox, getCurrentNode, getCurrentKey, setCurrentKey, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys, filter, setData, getNode, expandNode, collapseNode, setExpandedKeys, scrollToNode, scrollTo } = useTree(props, emit);
  52094. __expose({
  52095. toggleCheckbox,
  52096. getCurrentNode,
  52097. getCurrentKey,
  52098. setCurrentKey,
  52099. getCheckedKeys,
  52100. getCheckedNodes,
  52101. getHalfCheckedKeys,
  52102. getHalfCheckedNodes,
  52103. setChecked,
  52104. setCheckedKeys,
  52105. filter,
  52106. setData,
  52107. getNode,
  52108. expandNode,
  52109. collapseNode,
  52110. setExpandedKeys,
  52111. scrollToNode,
  52112. scrollTo
  52113. });
  52114. return (_ctx, _cache) => {
  52115. return openBlock(), createElementBlock("div", {
  52116. class: normalizeClass([unref(ns).b(), { [unref(ns).m("highlight-current")]: __props.highlightCurrent }]),
  52117. role: "tree"
  52118. }, [unref(isNotEmpty) ? (openBlock(), createBlock(unref(FixedSizeList), {
  52119. key: 0,
  52120. ref_key: "listRef",
  52121. ref: listRef,
  52122. "class-name": unref(ns).b("virtual-list"),
  52123. data: unref(flattenTree),
  52124. total: unref(flattenTree).length,
  52125. height: __props.height,
  52126. "item-size": treeNodeSize.value,
  52127. "perf-mode": __props.perfMode,
  52128. "scrollbar-always-on": __props.scrollbarAlwaysOn
  52129. }, {
  52130. default: withCtx(({ data, index, style }) => [(openBlock(), createBlock(tree_node_default, {
  52131. key: data[index].key,
  52132. style: normalizeStyle(style),
  52133. node: data[index],
  52134. expanded: data[index].expanded,
  52135. "show-checkbox": __props.showCheckbox,
  52136. checked: unref(isChecked)(data[index]),
  52137. indeterminate: unref(isIndeterminate)(data[index]),
  52138. "item-size": treeNodeSize.value,
  52139. disabled: unref(isDisabled)(data[index]),
  52140. current: unref(isCurrent)(data[index]),
  52141. "hidden-expand-icon": unref(isForceHiddenExpandIcon)(data[index]),
  52142. onClick: unref(handleNodeClick),
  52143. onToggle: unref(toggleExpand),
  52144. onCheck: unref(handleNodeCheck),
  52145. onDrop: unref(handleNodeDrop)
  52146. }, null, 8, [
  52147. "style",
  52148. "node",
  52149. "expanded",
  52150. "show-checkbox",
  52151. "checked",
  52152. "indeterminate",
  52153. "item-size",
  52154. "disabled",
  52155. "current",
  52156. "hidden-expand-icon",
  52157. "onClick",
  52158. "onToggle",
  52159. "onCheck",
  52160. "onDrop"
  52161. ]))]),
  52162. _: 1
  52163. }, 8, [
  52164. "class-name",
  52165. "data",
  52166. "total",
  52167. "height",
  52168. "item-size",
  52169. "perf-mode",
  52170. "scrollbar-always-on"
  52171. ])) : (openBlock(), createElementBlock("div", {
  52172. key: 1,
  52173. class: normalizeClass(unref(ns).e("empty-block"))
  52174. }, [renderSlot(_ctx.$slots, "empty", {}, () => [createElementVNode("span", { class: normalizeClass(unref(ns).e("empty-text")) }, toDisplayString(__props.emptyText ?? unref(t)("el.tree.emptyText")), 3)])], 2))], 2);
  52175. };
  52176. }
  52177. });
  52178. //#endregion
  52179. //#region ../../packages/components/tree-v2/src/tree.vue
  52180. var tree_default = tree_vue_vue_type_script_setup_true_lang_default;
  52181. //#endregion
  52182. //#region ../../packages/components/tree-v2/index.ts
  52183. const ElTreeV2 = withInstall(tree_default);
  52184. //#endregion
  52185. //#region ../../packages/components/upload/src/ajax.ts
  52186. const SCOPE$3 = "ElUpload";
  52187. var UploadAjaxError = class extends Error {
  52188. constructor(message, status, method, url) {
  52189. super(message);
  52190. this.name = "UploadAjaxError";
  52191. this.status = status;
  52192. this.method = method;
  52193. this.url = url;
  52194. }
  52195. };
  52196. function getError(action, option, xhr) {
  52197. let msg;
  52198. if (xhr.response) msg = `${xhr.response.error || xhr.response}`;
  52199. else if (xhr.responseText) msg = `${xhr.responseText}`;
  52200. else msg = `fail to ${option.method} ${action} ${xhr.status}`;
  52201. return new UploadAjaxError(msg, xhr.status, option.method, action);
  52202. }
  52203. function getBody(xhr) {
  52204. const text = xhr.responseText || xhr.response;
  52205. if (!text) return text;
  52206. try {
  52207. return JSON.parse(text);
  52208. } catch {
  52209. return text;
  52210. }
  52211. }
  52212. const ajaxUpload = (option) => {
  52213. if (typeof XMLHttpRequest === "undefined") throwError(SCOPE$3, "XMLHttpRequest is undefined");
  52214. const xhr = new XMLHttpRequest();
  52215. const action = option.action;
  52216. if (xhr.upload) xhr.upload.addEventListener("progress", (evt) => {
  52217. const progressEvt = evt;
  52218. progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0;
  52219. option.onProgress(progressEvt);
  52220. });
  52221. const formData = new FormData();
  52222. if (option.data) for (const [key, value] of Object.entries(option.data)) if (isArray$1(value)) if (value.length === 2 && value[0] instanceof Blob && isString(value[1])) formData.append(key, value[0], value[1]);
  52223. else value.forEach((item) => {
  52224. formData.append(key, item);
  52225. });
  52226. else formData.append(key, value);
  52227. formData.append(option.filename, option.file, option.file.name);
  52228. xhr.addEventListener("error", () => {
  52229. option.onError(getError(action, option, xhr));
  52230. });
  52231. xhr.addEventListener("load", () => {
  52232. if (xhr.status < 200 || xhr.status >= 300) return option.onError(getError(action, option, xhr));
  52233. option.onSuccess(getBody(xhr));
  52234. });
  52235. xhr.open(option.method, action, true);
  52236. if (option.withCredentials && "withCredentials" in xhr) xhr.withCredentials = true;
  52237. const headers = option.headers || {};
  52238. if (headers instanceof Headers) headers.forEach((value, key) => xhr.setRequestHeader(key, value));
  52239. else for (const [key, value] of Object.entries(headers)) {
  52240. if (isNil(value)) continue;
  52241. xhr.setRequestHeader(key, String(value));
  52242. }
  52243. xhr.send(formData);
  52244. return xhr;
  52245. };
  52246. //#endregion
  52247. //#region ../../packages/components/upload/src/upload.ts
  52248. /**
  52249. * @deprecated Removed after 3.0.0, Use `UploadProps` instead.
  52250. */
  52251. const uploadListTypes = [
  52252. "text",
  52253. "picture",
  52254. "picture-card"
  52255. ];
  52256. let fileId = 1;
  52257. const genFileId = () => Date.now() + fileId++;
  52258. /**
  52259. * @deprecated Removed after 3.0.0, Use `UploadBaseProps` instead.
  52260. */
  52261. const uploadBaseProps = buildProps({
  52262. action: {
  52263. type: String,
  52264. default: "#"
  52265. },
  52266. headers: { type: definePropType(Object) },
  52267. method: {
  52268. type: String,
  52269. default: "post"
  52270. },
  52271. data: {
  52272. type: definePropType([
  52273. Object,
  52274. Function,
  52275. Promise
  52276. ]),
  52277. default: () => mutable({})
  52278. },
  52279. multiple: Boolean,
  52280. name: {
  52281. type: String,
  52282. default: "file"
  52283. },
  52284. drag: Boolean,
  52285. withCredentials: Boolean,
  52286. showFileList: {
  52287. type: Boolean,
  52288. default: true
  52289. },
  52290. accept: {
  52291. type: String,
  52292. default: ""
  52293. },
  52294. fileList: {
  52295. type: definePropType(Array),
  52296. default: () => mutable([])
  52297. },
  52298. autoUpload: {
  52299. type: Boolean,
  52300. default: true
  52301. },
  52302. listType: {
  52303. type: String,
  52304. values: uploadListTypes,
  52305. default: "text"
  52306. },
  52307. httpRequest: {
  52308. type: definePropType(Function),
  52309. default: ajaxUpload
  52310. },
  52311. disabled: {
  52312. type: Boolean,
  52313. default: void 0
  52314. },
  52315. limit: Number,
  52316. directory: Boolean
  52317. });
  52318. /**
  52319. * @deprecated Removed after 3.0.0, Use `UploadProps` instead.
  52320. */
  52321. const uploadProps = buildProps({
  52322. ...uploadBaseProps,
  52323. beforeUpload: {
  52324. type: definePropType(Function),
  52325. default: NOOP
  52326. },
  52327. beforeRemove: { type: definePropType(Function) },
  52328. onRemove: {
  52329. type: definePropType(Function),
  52330. default: NOOP
  52331. },
  52332. onChange: {
  52333. type: definePropType(Function),
  52334. default: NOOP
  52335. },
  52336. onPreview: {
  52337. type: definePropType(Function),
  52338. default: NOOP
  52339. },
  52340. onSuccess: {
  52341. type: definePropType(Function),
  52342. default: NOOP
  52343. },
  52344. onProgress: {
  52345. type: definePropType(Function),
  52346. default: NOOP
  52347. },
  52348. onError: {
  52349. type: definePropType(Function),
  52350. default: NOOP
  52351. },
  52352. onExceed: {
  52353. type: definePropType(Function),
  52354. default: NOOP
  52355. },
  52356. crossorigin: { type: definePropType(String) }
  52357. });
  52358. const uploadBasePropsDefaults = {
  52359. action: "#",
  52360. method: "post",
  52361. data: () => mutable({}),
  52362. name: "file",
  52363. showFileList: true,
  52364. accept: "",
  52365. fileList: () => mutable([]),
  52366. autoUpload: true,
  52367. listType: "text",
  52368. httpRequest: ajaxUpload,
  52369. disabled: void 0
  52370. };
  52371. const uploadPropsDefaults = {
  52372. ...uploadBasePropsDefaults,
  52373. beforeUpload: NOOP,
  52374. onRemove: NOOP,
  52375. onChange: NOOP,
  52376. onPreview: NOOP,
  52377. onSuccess: NOOP,
  52378. onProgress: NOOP,
  52379. onError: NOOP,
  52380. onExceed: NOOP
  52381. };
  52382. //#endregion
  52383. //#region ../../packages/components/upload/src/constants.ts
  52384. const uploadContextKey = Symbol("uploadContextKey");
  52385. //#endregion
  52386. //#region ../../packages/components/upload/src/upload-list.ts
  52387. /**
  52388. * @deprecated Removed after 3.0.0, Use `UploadListProps` instead.
  52389. */
  52390. const uploadListProps = buildProps({
  52391. files: {
  52392. type: definePropType(Array),
  52393. default: () => mutable([])
  52394. },
  52395. disabled: {
  52396. type: Boolean,
  52397. default: void 0
  52398. },
  52399. handlePreview: {
  52400. type: definePropType(Function),
  52401. default: NOOP
  52402. },
  52403. listType: {
  52404. type: String,
  52405. values: uploadListTypes,
  52406. default: "text"
  52407. },
  52408. crossorigin: { type: definePropType(String) }
  52409. });
  52410. const uploadListEmits = { remove: (file) => !!file };
  52411. //#endregion
  52412. //#region ../../packages/components/upload/src/upload-list.vue?vue&type=script&setup=true&lang.ts
  52413. const _hoisted_1$10 = [
  52414. "tabindex",
  52415. "aria-disabled",
  52416. "onKeydown"
  52417. ];
  52418. const _hoisted_2$6 = ["src", "crossorigin"];
  52419. const _hoisted_3$2 = ["onClick"];
  52420. const _hoisted_4$1 = ["title"];
  52421. const _hoisted_5 = ["onClick"];
  52422. const _hoisted_6 = ["onClick"];
  52423. var upload_list_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  52424. name: "ElUploadList",
  52425. __name: "upload-list",
  52426. props: uploadListProps,
  52427. emits: uploadListEmits,
  52428. setup(__props, { emit: __emit }) {
  52429. const props = __props;
  52430. const emit = __emit;
  52431. const { t } = useLocale();
  52432. const nsUpload = useNamespace("upload");
  52433. const nsIcon = useNamespace("icon");
  52434. const nsList = useNamespace("list");
  52435. const disabled = useFormDisabled();
  52436. const focusing = ref(false);
  52437. const containerKls = computed(() => [
  52438. nsUpload.b("list"),
  52439. nsUpload.bm("list", props.listType),
  52440. nsUpload.is("disabled", disabled.value)
  52441. ]);
  52442. const handleRemove = (file) => {
  52443. emit("remove", file);
  52444. };
  52445. return (_ctx, _cache) => {
  52446. return openBlock(), createBlock(TransitionGroup, {
  52447. tag: "ul",
  52448. class: normalizeClass(containerKls.value),
  52449. name: unref(nsList).b()
  52450. }, {
  52451. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.files, (file, index) => {
  52452. return openBlock(), createElementBlock("li", {
  52453. key: file.uid || file.name,
  52454. class: normalizeClass([
  52455. unref(nsUpload).be("list", "item"),
  52456. unref(nsUpload).is(file.status),
  52457. { focusing: focusing.value }
  52458. ]),
  52459. tabindex: unref(disabled) ? void 0 : 0,
  52460. "aria-disabled": unref(disabled),
  52461. role: "button",
  52462. onKeydown: withKeys(($event) => !unref(disabled) && handleRemove(file), ["delete"]),
  52463. onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true),
  52464. onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false),
  52465. onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false)
  52466. }, [renderSlot(_ctx.$slots, "default", {
  52467. file,
  52468. index
  52469. }, () => [
  52470. __props.listType === "picture" || file.status !== "uploading" && __props.listType === "picture-card" ? (openBlock(), createElementBlock("img", {
  52471. key: 0,
  52472. class: normalizeClass(unref(nsUpload).be("list", "item-thumbnail")),
  52473. src: file.url,
  52474. crossorigin: __props.crossorigin,
  52475. alt: ""
  52476. }, null, 10, _hoisted_2$6)) : createCommentVNode("v-if", true),
  52477. file.status === "uploading" || __props.listType !== "picture-card" ? (openBlock(), createElementBlock("div", {
  52478. key: 1,
  52479. class: normalizeClass(unref(nsUpload).be("list", "item-info"))
  52480. }, [createElementVNode("a", {
  52481. class: normalizeClass(unref(nsUpload).be("list", "item-name")),
  52482. onClick: withModifiers(($event) => __props.handlePreview(file), ["prevent"])
  52483. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("document")) }, {
  52484. default: withCtx(() => [createVNode(unref(document_default))]),
  52485. _: 1
  52486. }, 8, ["class"]), createElementVNode("span", {
  52487. class: normalizeClass(unref(nsUpload).be("list", "item-file-name")),
  52488. title: file.name
  52489. }, toDisplayString(file.name), 11, _hoisted_4$1)], 10, _hoisted_3$2), file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), {
  52490. key: 0,
  52491. type: __props.listType === "picture-card" ? "circle" : "line",
  52492. "stroke-width": __props.listType === "picture-card" ? 6 : 2,
  52493. percentage: Number(file.percentage),
  52494. style: normalizeStyle(__props.listType === "picture-card" ? "" : "margin-top: 0.5rem")
  52495. }, null, 8, [
  52496. "type",
  52497. "stroke-width",
  52498. "percentage",
  52499. "style"
  52500. ])) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true),
  52501. createElementVNode("label", { class: normalizeClass(unref(nsUpload).be("list", "item-status-label")) }, [__props.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), {
  52502. key: 0,
  52503. class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("circle-check")])
  52504. }, {
  52505. default: withCtx(() => [createVNode(unref(circle_check_default))]),
  52506. _: 1
  52507. }, 8, ["class"])) : ["picture-card", "picture"].includes(__props.listType) ? (openBlock(), createBlock(unref(ElIcon), {
  52508. key: 1,
  52509. class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("check")])
  52510. }, {
  52511. default: withCtx(() => [createVNode(unref(check_default))]),
  52512. _: 1
  52513. }, 8, ["class"])) : createCommentVNode("v-if", true)], 2),
  52514. !unref(disabled) ? (openBlock(), createBlock(unref(ElIcon), {
  52515. key: 2,
  52516. class: normalizeClass(unref(nsIcon).m("close")),
  52517. "aria-label": unref(t)("el.upload.delete"),
  52518. role: "button",
  52519. tabindex: "0",
  52520. onClick: ($event) => handleRemove(file),
  52521. onKeydown: withKeys(withModifiers(($event) => handleRemove(file), ["prevent"]), ["enter", "space"])
  52522. }, {
  52523. default: withCtx(() => [createVNode(unref(close_default))]),
  52524. _: 1
  52525. }, 8, [
  52526. "class",
  52527. "aria-label",
  52528. "onClick",
  52529. "onKeydown"
  52530. ])) : createCommentVNode("v-if", true),
  52531. !unref(disabled) ? (openBlock(), createElementBlock("i", {
  52532. key: 3,
  52533. class: normalizeClass(unref(nsIcon).m("close-tip"))
  52534. }, toDisplayString(unref(t)("el.upload.deleteTip")), 3)) : createCommentVNode("v-if", true),
  52535. __props.listType === "picture-card" ? (openBlock(), createElementBlock("span", {
  52536. key: 4,
  52537. class: normalizeClass(unref(nsUpload).be("list", "item-actions"))
  52538. }, [createElementVNode("span", {
  52539. class: normalizeClass(unref(nsUpload).be("list", "item-preview")),
  52540. onClick: ($event) => __props.handlePreview(file)
  52541. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("zoom-in")) }, {
  52542. default: withCtx(() => [createVNode(unref(zoom_in_default))]),
  52543. _: 1
  52544. }, 8, ["class"])], 10, _hoisted_5), !unref(disabled) ? (openBlock(), createElementBlock("span", {
  52545. key: 0,
  52546. class: normalizeClass(unref(nsUpload).be("list", "item-delete")),
  52547. onClick: ($event) => handleRemove(file)
  52548. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(nsIcon).m("delete")) }, {
  52549. default: withCtx(() => [createVNode(unref(delete_default))]),
  52550. _: 1
  52551. }, 8, ["class"])], 10, _hoisted_6)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)
  52552. ])], 42, _hoisted_1$10);
  52553. }), 128)), renderSlot(_ctx.$slots, "append")]),
  52554. _: 3
  52555. }, 8, ["class", "name"]);
  52556. };
  52557. }
  52558. });
  52559. //#endregion
  52560. //#region ../../packages/components/upload/src/upload-list.vue
  52561. var upload_list_default = upload_list_vue_vue_type_script_setup_true_lang_default;
  52562. //#endregion
  52563. //#region ../../packages/components/upload/src/upload-content.ts
  52564. /**
  52565. * @deprecated Removed after 3.0.0, Use `UploadContentProps` instead.
  52566. */
  52567. const uploadContentProps = buildProps({
  52568. ...uploadBaseProps,
  52569. beforeUpload: {
  52570. type: definePropType(Function),
  52571. default: NOOP
  52572. },
  52573. onRemove: {
  52574. type: definePropType(Function),
  52575. default: NOOP
  52576. },
  52577. onStart: {
  52578. type: definePropType(Function),
  52579. default: NOOP
  52580. },
  52581. onSuccess: {
  52582. type: definePropType(Function),
  52583. default: NOOP
  52584. },
  52585. onProgress: {
  52586. type: definePropType(Function),
  52587. default: NOOP
  52588. },
  52589. onError: {
  52590. type: definePropType(Function),
  52591. default: NOOP
  52592. },
  52593. onExceed: {
  52594. type: definePropType(Function),
  52595. default: NOOP
  52596. }
  52597. });
  52598. const uploadContentPropsDefaults = {
  52599. ...uploadBasePropsDefaults,
  52600. beforeUpload: NOOP,
  52601. onRemove: NOOP,
  52602. onStart: NOOP,
  52603. onSuccess: NOOP,
  52604. onProgress: NOOP,
  52605. onError: NOOP,
  52606. onExceed: NOOP
  52607. };
  52608. //#endregion
  52609. //#region ../../packages/components/upload/src/upload-dragger.ts
  52610. /**
  52611. * @deprecated Removed after 3.0.0, Use `UploadDraggerProps` instead.
  52612. */
  52613. const uploadDraggerProps = buildProps({
  52614. disabled: {
  52615. type: Boolean,
  52616. default: void 0
  52617. },
  52618. directory: Boolean
  52619. });
  52620. const uploadDraggerEmits = { file: (file) => isArray$1(file) };
  52621. //#endregion
  52622. //#region ../../packages/components/upload/src/upload-dragger.vue?vue&type=script&setup=true&lang.ts
  52623. const COMPONENT_NAME$1 = "ElUploadDrag";
  52624. var upload_dragger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  52625. name: COMPONENT_NAME$1,
  52626. __name: "upload-dragger",
  52627. props: uploadDraggerProps,
  52628. emits: uploadDraggerEmits,
  52629. setup(__props, { emit: __emit }) {
  52630. const props = __props;
  52631. const emit = __emit;
  52632. if (!inject(uploadContextKey)) throwError(COMPONENT_NAME$1, "usage: <el-upload><el-upload-dragger /></el-upload>");
  52633. const ns = useNamespace("upload");
  52634. const dragover = ref(false);
  52635. const disabled = useFormDisabled();
  52636. const getFile = (entry) => {
  52637. return new Promise((resolve, reject) => entry.file(resolve, reject));
  52638. };
  52639. const getAllFiles = async (entry) => {
  52640. try {
  52641. if (entry.isFile) {
  52642. const file = await getFile(entry);
  52643. file.isDirectory = false;
  52644. return [file];
  52645. }
  52646. if (entry.isDirectory) {
  52647. const dirReader = entry.createReader();
  52648. const getEntries = () => {
  52649. return new Promise((resolve, reject) => dirReader.readEntries(resolve, reject));
  52650. };
  52651. const entries = [];
  52652. let readEntries = await getEntries();
  52653. /**
  52654. * In Chromium-based browsers, readEntries() will only return the first 100 FileSystemEntry instances.
  52655. * https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries#:~:text=In%20Chromium%2Dbased%20browsers%2C%20readEntries()%20will%20only%20return%20the%20first%20100%20FileSystemEntry%20instances.%20In%20order%20to%20obtain%20all%20of%20the%20instances%2C%20readEntries()%20must%20be%20called%20multiple%20times.
  52656. */
  52657. while (readEntries.length > 0) {
  52658. entries.push(...readEntries);
  52659. readEntries = await getEntries();
  52660. }
  52661. const filePromises = entries.map((entry) => getAllFiles(entry).catch(() => []));
  52662. return flatten(await Promise.all(filePromises));
  52663. }
  52664. } catch {
  52665. return [];
  52666. }
  52667. return [];
  52668. };
  52669. const onDrop = async (e) => {
  52670. if (disabled.value) return;
  52671. dragover.value = false;
  52672. e.stopPropagation();
  52673. const files = Array.from(e.dataTransfer.files);
  52674. const items = e.dataTransfer.items || [];
  52675. if (props.directory) {
  52676. const entries = Array.from(items).map((item) => item?.webkitGetAsEntry?.()).filter((entry) => entry);
  52677. emit("file", flatten(await Promise.all(entries.map(getAllFiles))));
  52678. return;
  52679. }
  52680. files.forEach((file, index) => {
  52681. const entry = items[index]?.webkitGetAsEntry?.();
  52682. if (entry) file.isDirectory = entry.isDirectory;
  52683. });
  52684. emit("file", files);
  52685. };
  52686. const onDragover = () => {
  52687. if (!disabled.value) dragover.value = true;
  52688. };
  52689. const onDragleave = (e) => {
  52690. if (!e.currentTarget.contains(e.relatedTarget)) dragover.value = false;
  52691. };
  52692. return (_ctx, _cache) => {
  52693. return openBlock(), createElementBlock("div", {
  52694. class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
  52695. onDrop: withModifiers(onDrop, ["prevent"]),
  52696. onDragover: withModifiers(onDragover, ["prevent"]),
  52697. onDragleave: withModifiers(onDragleave, ["prevent"])
  52698. }, [renderSlot(_ctx.$slots, "default")], 34);
  52699. };
  52700. }
  52701. });
  52702. //#endregion
  52703. //#region ../../packages/components/upload/src/upload-dragger.vue
  52704. var upload_dragger_default = upload_dragger_vue_vue_type_script_setup_true_lang_default;
  52705. //#endregion
  52706. //#region ../../packages/components/upload/src/upload-content.vue?vue&type=script&setup=true&lang.ts
  52707. const _hoisted_1$9 = [
  52708. "tabindex",
  52709. "aria-disabled",
  52710. "onKeydown"
  52711. ];
  52712. const _hoisted_2$5 = [
  52713. "name",
  52714. "disabled",
  52715. "multiple",
  52716. "accept",
  52717. "webkitdirectory"
  52718. ];
  52719. var upload_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  52720. name: "ElUploadContent",
  52721. inheritAttrs: false,
  52722. __name: "upload-content",
  52723. props: uploadContentProps,
  52724. setup(__props, { expose: __expose }) {
  52725. const props = __props;
  52726. const ns = useNamespace("upload");
  52727. const disabled = useFormDisabled();
  52728. const requests = shallowRef({});
  52729. const inputRef = shallowRef();
  52730. const uploadFiles = (files) => {
  52731. if (files.length === 0) return;
  52732. const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props;
  52733. if (limit && fileList.length + files.length > limit) {
  52734. onExceed(files, fileList);
  52735. return;
  52736. }
  52737. if (!multiple) files = files.slice(0, 1);
  52738. for (const file of files) {
  52739. const rawFile = file;
  52740. rawFile.uid = genFileId();
  52741. onStart(rawFile);
  52742. if (autoUpload) upload(rawFile);
  52743. }
  52744. };
  52745. const upload = async (rawFile) => {
  52746. inputRef.value.value = "";
  52747. if (!props.beforeUpload) return doUpload(rawFile);
  52748. let hookResult;
  52749. let beforeData = {};
  52750. try {
  52751. const originData = props.data;
  52752. const beforeUploadPromise = props.beforeUpload(rawFile);
  52753. beforeData = isPlainObject$1(props.data) ? cloneDeep(props.data) : props.data;
  52754. hookResult = await beforeUploadPromise;
  52755. if (isPlainObject$1(props.data) && isEqual$1(originData, beforeData)) beforeData = cloneDeep(props.data);
  52756. } catch {
  52757. hookResult = false;
  52758. }
  52759. if (hookResult === false) {
  52760. props.onRemove(rawFile);
  52761. return;
  52762. }
  52763. let file = rawFile;
  52764. if (hookResult instanceof Blob) if (hookResult instanceof File) file = hookResult;
  52765. else file = new File([hookResult], rawFile.name, { type: rawFile.type });
  52766. doUpload(Object.assign(file, { uid: rawFile.uid }), beforeData);
  52767. };
  52768. const resolveData = async (data, rawFile) => {
  52769. if (isFunction$1(data)) return data(rawFile);
  52770. return data;
  52771. };
  52772. const doUpload = async (rawFile, beforeData) => {
  52773. const { headers, data, method, withCredentials, name: filename, action, onProgress, onSuccess, onError, httpRequest } = props;
  52774. try {
  52775. beforeData = await resolveData(beforeData ?? data, rawFile);
  52776. } catch {
  52777. props.onRemove(rawFile);
  52778. return;
  52779. }
  52780. const { uid } = rawFile;
  52781. const options = {
  52782. headers: headers || {},
  52783. withCredentials,
  52784. file: rawFile,
  52785. data: beforeData,
  52786. method,
  52787. filename,
  52788. action,
  52789. onProgress: (evt) => {
  52790. onProgress(evt, rawFile);
  52791. },
  52792. onSuccess: (res) => {
  52793. onSuccess(res, rawFile);
  52794. delete requests.value[uid];
  52795. },
  52796. onError: (err) => {
  52797. onError(err, rawFile);
  52798. delete requests.value[uid];
  52799. }
  52800. };
  52801. const request = httpRequest(options);
  52802. requests.value[uid] = request;
  52803. if (request instanceof Promise) request.then(options.onSuccess, options.onError);
  52804. };
  52805. const handleChange = (e) => {
  52806. const files = e.target.files;
  52807. if (!files) return;
  52808. uploadFiles(Array.from(files));
  52809. };
  52810. const handleClick = () => {
  52811. if (!disabled.value) {
  52812. inputRef.value.value = "";
  52813. inputRef.value.click();
  52814. }
  52815. };
  52816. const handleKeydown = () => {
  52817. handleClick();
  52818. };
  52819. const abort = (file) => {
  52820. entriesOf(requests.value).filter(file ? ([uid]) => String(file.uid) === uid : () => true).forEach(([uid, req]) => {
  52821. if (req instanceof XMLHttpRequest) req.abort();
  52822. delete requests.value[uid];
  52823. });
  52824. };
  52825. __expose({
  52826. abort,
  52827. upload
  52828. });
  52829. return (_ctx, _cache) => {
  52830. return openBlock(), createElementBlock("div", {
  52831. class: normalizeClass([
  52832. unref(ns).b(),
  52833. unref(ns).m(__props.listType),
  52834. unref(ns).is("drag", __props.drag),
  52835. unref(ns).is("disabled", unref(disabled))
  52836. ]),
  52837. tabindex: unref(disabled) ? void 0 : 0,
  52838. "aria-disabled": unref(disabled),
  52839. role: "button",
  52840. onClick: handleClick,
  52841. onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"])
  52842. }, [__props.drag ? (openBlock(), createBlock(upload_dragger_default, {
  52843. key: 0,
  52844. disabled: unref(disabled),
  52845. directory: __props.directory,
  52846. onFile: uploadFiles
  52847. }, {
  52848. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  52849. _: 3
  52850. }, 8, ["disabled", "directory"])) : renderSlot(_ctx.$slots, "default", { key: 1 }), createElementVNode("input", {
  52851. ref_key: "inputRef",
  52852. ref: inputRef,
  52853. class: normalizeClass(unref(ns).e("input")),
  52854. name: __props.name,
  52855. disabled: unref(disabled),
  52856. multiple: __props.multiple,
  52857. accept: __props.accept,
  52858. webkitdirectory: __props.directory || void 0,
  52859. type: "file",
  52860. onChange: handleChange,
  52861. onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
  52862. }, null, 42, _hoisted_2$5)], 42, _hoisted_1$9);
  52863. };
  52864. }
  52865. });
  52866. //#endregion
  52867. //#region ../../packages/components/upload/src/upload-content.vue
  52868. var upload_content_default = upload_content_vue_vue_type_script_setup_true_lang_default;
  52869. //#endregion
  52870. //#region ../../packages/components/upload/src/use-handlers.ts
  52871. const SCOPE$2 = "ElUpload";
  52872. const revokeFileObjectURL = (file) => {
  52873. if (file.url?.startsWith("blob:")) URL.revokeObjectURL(file.url);
  52874. };
  52875. const useHandlers = (props, uploadRef) => {
  52876. const uploadFiles = useVModel(props, "fileList", void 0, { passive: true });
  52877. const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
  52878. function abort(file) {
  52879. uploadRef.value?.abort(file);
  52880. }
  52881. function clearFiles(states = [
  52882. "ready",
  52883. "uploading",
  52884. "success",
  52885. "fail"
  52886. ]) {
  52887. uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
  52888. }
  52889. function removeFile(file) {
  52890. uploadFiles.value = uploadFiles.value.filter((uploadFile) => uploadFile.uid !== file.uid);
  52891. }
  52892. const emitChange = (file) => {
  52893. nextTick(() => props.onChange(file, uploadFiles.value));
  52894. };
  52895. const handleError = (err, rawFile) => {
  52896. const file = getFile(rawFile);
  52897. if (!file) return;
  52898. console.error(err);
  52899. file.status = "fail";
  52900. removeFile(file);
  52901. props.onError(err, file, uploadFiles.value);
  52902. emitChange(file);
  52903. };
  52904. const handleProgress = (evt, rawFile) => {
  52905. const file = getFile(rawFile);
  52906. if (!file) return;
  52907. props.onProgress(evt, file, uploadFiles.value);
  52908. file.status = "uploading";
  52909. file.percentage = Math.round(evt.percent);
  52910. };
  52911. const handleSuccess = (response, rawFile) => {
  52912. const file = getFile(rawFile);
  52913. if (!file) return;
  52914. file.status = "success";
  52915. file.response = response;
  52916. props.onSuccess(response, file, uploadFiles.value);
  52917. emitChange(file);
  52918. };
  52919. const handleStart = (file) => {
  52920. if (isNil(file.uid)) file.uid = genFileId();
  52921. const uploadFile = {
  52922. name: file.name,
  52923. percentage: 0,
  52924. status: "ready",
  52925. size: file.size,
  52926. raw: file,
  52927. uid: file.uid
  52928. };
  52929. if (props.listType === "picture-card" || props.listType === "picture") try {
  52930. uploadFile.url = URL.createObjectURL(file);
  52931. } catch (err) {
  52932. /* @__PURE__ */ debugWarn(SCOPE$2, err.message);
  52933. props.onError(err, uploadFile, uploadFiles.value);
  52934. }
  52935. uploadFiles.value = [...uploadFiles.value, uploadFile];
  52936. emitChange(uploadFile);
  52937. };
  52938. const handleRemove = async (file) => {
  52939. const uploadFile = file instanceof File ? getFile(file) : file;
  52940. if (!uploadFile) throwError(SCOPE$2, "file to be removed not found");
  52941. const doRemove = (file) => {
  52942. abort(file);
  52943. removeFile(file);
  52944. props.onRemove(file, uploadFiles.value);
  52945. revokeFileObjectURL(file);
  52946. };
  52947. if (props.beforeRemove) {
  52948. if (await props.beforeRemove(uploadFile, uploadFiles.value) !== false) doRemove(uploadFile);
  52949. } else doRemove(uploadFile);
  52950. };
  52951. function submit() {
  52952. uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => raw && uploadRef.value?.upload(raw));
  52953. }
  52954. watch(() => props.listType, (val) => {
  52955. if (val !== "picture-card" && val !== "picture") return;
  52956. uploadFiles.value = uploadFiles.value.map((file) => {
  52957. const { raw, url } = file;
  52958. if (!url && raw) try {
  52959. file.url = URL.createObjectURL(raw);
  52960. } catch (err) {
  52961. props.onError(err, file, uploadFiles.value);
  52962. }
  52963. return file;
  52964. });
  52965. });
  52966. watch(uploadFiles, (files) => {
  52967. for (const file of files) {
  52968. file.uid ||= genFileId();
  52969. file.status ||= "success";
  52970. }
  52971. }, {
  52972. immediate: true,
  52973. deep: true
  52974. });
  52975. return {
  52976. uploadFiles,
  52977. abort,
  52978. clearFiles,
  52979. handleError,
  52980. handleProgress,
  52981. handleStart,
  52982. handleSuccess,
  52983. handleRemove,
  52984. submit,
  52985. revokeFileObjectURL
  52986. };
  52987. };
  52988. //#endregion
  52989. //#region ../../packages/components/upload/src/upload.vue?vue&type=script&setup=true&lang.ts
  52990. var upload_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  52991. name: "ElUpload",
  52992. __name: "upload",
  52993. props: uploadProps,
  52994. setup(__props, { expose: __expose }) {
  52995. const props = __props;
  52996. const disabled = useFormDisabled();
  52997. const uploadRef = shallowRef();
  52998. const { abort, submit, clearFiles, uploadFiles, handleStart, handleError, handleRemove, handleSuccess, handleProgress, revokeFileObjectURL } = useHandlers(props, uploadRef);
  52999. const isPictureCard = computed(() => props.listType === "picture-card");
  53000. const uploadContentProps = computed(() => ({
  53001. ...props,
  53002. fileList: uploadFiles.value,
  53003. onStart: handleStart,
  53004. onProgress: handleProgress,
  53005. onSuccess: handleSuccess,
  53006. onError: handleError,
  53007. onRemove: handleRemove
  53008. }));
  53009. onBeforeUnmount(() => {
  53010. uploadFiles.value.forEach(revokeFileObjectURL);
  53011. });
  53012. provide(uploadContextKey, { accept: toRef(props, "accept") });
  53013. __expose({
  53014. abort,
  53015. submit,
  53016. clearFiles,
  53017. handleStart,
  53018. handleRemove
  53019. });
  53020. return (_ctx, _cache) => {
  53021. return openBlock(), createElementBlock("div", null, [
  53022. isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(upload_list_default, {
  53023. key: 0,
  53024. disabled: unref(disabled),
  53025. "list-type": __props.listType,
  53026. files: unref(uploadFiles),
  53027. crossorigin: __props.crossorigin,
  53028. "handle-preview": __props.onPreview,
  53029. onRemove: unref(handleRemove)
  53030. }, createSlots({
  53031. append: withCtx(() => [createVNode(upload_content_default, mergeProps({
  53032. ref_key: "uploadRef",
  53033. ref: uploadRef
  53034. }, uploadContentProps.value), {
  53035. default: withCtx(() => [_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)]),
  53036. _: 3
  53037. }, 16)]),
  53038. _: 2
  53039. }, [_ctx.$slots.file ? {
  53040. name: "default",
  53041. fn: withCtx(({ file, index }) => [renderSlot(_ctx.$slots, "file", {
  53042. file,
  53043. index
  53044. })]),
  53045. key: "0"
  53046. } : void 0]), 1032, [
  53047. "disabled",
  53048. "list-type",
  53049. "files",
  53050. "crossorigin",
  53051. "handle-preview",
  53052. "onRemove"
  53053. ])) : createCommentVNode("v-if", true),
  53054. !isPictureCard.value || isPictureCard.value && !__props.showFileList ? (openBlock(), createBlock(upload_content_default, mergeProps({
  53055. key: 1,
  53056. ref_key: "uploadRef",
  53057. ref: uploadRef
  53058. }, uploadContentProps.value), {
  53059. default: withCtx(() => [_ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)]),
  53060. _: 3
  53061. }, 16)) : createCommentVNode("v-if", true),
  53062. _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true),
  53063. renderSlot(_ctx.$slots, "tip"),
  53064. !isPictureCard.value && __props.showFileList ? (openBlock(), createBlock(upload_list_default, {
  53065. key: 3,
  53066. disabled: unref(disabled),
  53067. "list-type": __props.listType,
  53068. files: unref(uploadFiles),
  53069. crossorigin: __props.crossorigin,
  53070. "handle-preview": __props.onPreview,
  53071. onRemove: unref(handleRemove)
  53072. }, createSlots({ _: 2 }, [_ctx.$slots.file ? {
  53073. name: "default",
  53074. fn: withCtx(({ file, index }) => [renderSlot(_ctx.$slots, "file", {
  53075. file,
  53076. index
  53077. })]),
  53078. key: "0"
  53079. } : void 0]), 1032, [
  53080. "disabled",
  53081. "list-type",
  53082. "files",
  53083. "crossorigin",
  53084. "handle-preview",
  53085. "onRemove"
  53086. ])) : createCommentVNode("v-if", true)
  53087. ]);
  53088. };
  53089. }
  53090. });
  53091. //#endregion
  53092. //#region ../../packages/components/upload/src/upload.vue
  53093. var upload_default = upload_vue_vue_type_script_setup_true_lang_default;
  53094. //#endregion
  53095. //#region ../../packages/components/upload/index.ts
  53096. const ElUpload = withInstall(upload_default);
  53097. //#endregion
  53098. //#region ../../packages/components/watermark/src/watermark.ts
  53099. /**
  53100. * @deprecated Removed after 3.0.0, Use `WatermarkProps` instead.
  53101. */
  53102. const watermarkProps = buildProps({
  53103. zIndex: {
  53104. type: Number,
  53105. default: 9
  53106. },
  53107. rotate: {
  53108. type: Number,
  53109. default: -22
  53110. },
  53111. width: Number,
  53112. height: Number,
  53113. image: String,
  53114. content: {
  53115. type: definePropType([String, Array]),
  53116. default: "Element Plus"
  53117. },
  53118. font: { type: definePropType(Object) },
  53119. gap: {
  53120. type: definePropType(Array),
  53121. default: () => [100, 100]
  53122. },
  53123. offset: { type: definePropType(Array) }
  53124. });
  53125. //#endregion
  53126. //#region ../../packages/components/watermark/src/utils.ts
  53127. /** converting camel-cased strings to be lowercase and link it with Separator */
  53128. function toLowercaseSeparator(key) {
  53129. return key.replace(/([A-Z])/g, "-$1").toLowerCase();
  53130. }
  53131. function getStyleStr(style) {
  53132. return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
  53133. }
  53134. /** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
  53135. function getPixelRatio() {
  53136. return window.devicePixelRatio || 1;
  53137. }
  53138. /** Whether to re-render the watermark */
  53139. const reRendering = (mutation, watermarkElement) => {
  53140. let flag = false;
  53141. if (mutation.removedNodes.length && watermarkElement) flag = Array.from(mutation.removedNodes).includes(watermarkElement);
  53142. if (mutation.type === "attributes" && mutation.target === watermarkElement) flag = true;
  53143. return flag;
  53144. };
  53145. //#endregion
  53146. //#region ../../packages/components/watermark/src/useClips.ts
  53147. const TEXT_ALIGN_RATIO_MAP = {
  53148. left: [0, .5],
  53149. start: [0, .5],
  53150. center: [.5, 0],
  53151. right: [1, -.5],
  53152. end: [1, -.5]
  53153. };
  53154. function prepareCanvas(width, height, ratio = 1) {
  53155. const canvas = document.createElement("canvas");
  53156. const ctx = canvas.getContext("2d");
  53157. const realWidth = width * ratio;
  53158. const realHeight = height * ratio;
  53159. canvas.setAttribute("width", `${realWidth}px`);
  53160. canvas.setAttribute("height", `${realHeight}px`);
  53161. ctx.save();
  53162. return [
  53163. ctx,
  53164. canvas,
  53165. realWidth,
  53166. realHeight
  53167. ];
  53168. }
  53169. /**
  53170. * Get the clips of text content.
  53171. * This is a lazy hook function since SSR no need this
  53172. */
  53173. function useClips() {
  53174. function getClips(content, rotate, ratio, width, height, font, gapX, gapY, space) {
  53175. const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
  53176. let baselineOffset = 0;
  53177. if (content instanceof HTMLImageElement) ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
  53178. else {
  53179. const { color, fontSize, fontStyle, fontWeight, fontFamily, textAlign, textBaseline } = font;
  53180. const mergedFontSize = Number(fontSize) * ratio;
  53181. ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
  53182. ctx.fillStyle = color;
  53183. ctx.textAlign = textAlign;
  53184. ctx.textBaseline = textBaseline;
  53185. const contents = isArray$1(content) ? content : [content];
  53186. if (textBaseline !== "top" && contents[0]) {
  53187. const argumentMetrics = ctx.measureText(contents[0]);
  53188. ctx.textBaseline = "top";
  53189. const topMetrics = ctx.measureText(contents[0]);
  53190. baselineOffset = argumentMetrics.actualBoundingBoxAscent - topMetrics.actualBoundingBoxAscent;
  53191. }
  53192. contents?.forEach((item, index) => {
  53193. const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign];
  53194. ctx.fillText(item ?? "", contentWidth * alignRatio + space * spaceRatio, index * (mergedFontSize + font.fontGap * ratio));
  53195. });
  53196. }
  53197. const angle = Math.PI / 180 * Number(rotate);
  53198. const maxSize = Math.max(width, height);
  53199. const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
  53200. rCtx.translate(realMaxSize / 2, realMaxSize / 2);
  53201. rCtx.rotate(angle);
  53202. if (contentWidth > 0 && contentHeight > 0) rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
  53203. function getRotatePos(x, y) {
  53204. return [x * Math.cos(angle) - y * Math.sin(angle), x * Math.sin(angle) + y * Math.cos(angle)];
  53205. }
  53206. let left = 0;
  53207. let right = 0;
  53208. let top = 0;
  53209. let bottom = 0;
  53210. const halfWidth = contentWidth / 2;
  53211. const halfHeight = contentHeight / 2;
  53212. [
  53213. [0 - halfWidth, 0 - halfHeight],
  53214. [0 + halfWidth, 0 - halfHeight],
  53215. [0 + halfWidth, 0 + halfHeight],
  53216. [0 - halfWidth, 0 + halfHeight]
  53217. ].forEach(([x, y]) => {
  53218. const [targetX, targetY] = getRotatePos(x, y);
  53219. left = Math.min(left, targetX);
  53220. right = Math.max(right, targetX);
  53221. top = Math.min(top, targetY);
  53222. bottom = Math.max(bottom, targetY);
  53223. });
  53224. const cutLeft = left + realMaxSize / 2;
  53225. const cutTop = top + realMaxSize / 2;
  53226. const cutWidth = right - left;
  53227. const cutHeight = bottom - top;
  53228. const realGapX = gapX * ratio;
  53229. const realGapY = gapY * ratio;
  53230. const filledWidth = (cutWidth + realGapX) * 2;
  53231. const filledHeight = cutHeight + realGapY;
  53232. const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
  53233. function drawImg(targetX = 0, targetY = 0) {
  53234. fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY + baselineOffset, cutWidth, cutHeight);
  53235. }
  53236. drawImg();
  53237. drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
  53238. drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
  53239. return [
  53240. fCanvas.toDataURL(),
  53241. filledWidth / ratio,
  53242. filledHeight / ratio
  53243. ];
  53244. }
  53245. return getClips;
  53246. }
  53247. //#endregion
  53248. //#region ../../packages/components/watermark/src/watermark.vue?vue&type=script&setup=true&lang.ts
  53249. var watermark_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  53250. name: "ElWatermark",
  53251. __name: "watermark",
  53252. props: watermarkProps,
  53253. setup(__props) {
  53254. const style = { position: "relative" };
  53255. const props = __props;
  53256. const fontGap = computed(() => props.font?.fontGap ?? 3);
  53257. const color = computed(() => props.font?.color ?? "rgba(0,0,0,.15)");
  53258. const fontSize = computed(() => props.font?.fontSize ?? 16);
  53259. const fontWeight = computed(() => props.font?.fontWeight ?? "normal");
  53260. const fontStyle = computed(() => props.font?.fontStyle ?? "normal");
  53261. const fontFamily = computed(() => props.font?.fontFamily ?? "sans-serif");
  53262. const textAlign = computed(() => props.font?.textAlign ?? "center");
  53263. const textBaseline = computed(() => props.font?.textBaseline ?? "hanging");
  53264. const gapX = computed(() => props.gap[0]);
  53265. const gapY = computed(() => props.gap[1]);
  53266. const gapXCenter = computed(() => gapX.value / 2);
  53267. const gapYCenter = computed(() => gapY.value / 2);
  53268. const offsetLeft = computed(() => props.offset?.[0] ?? gapXCenter.value);
  53269. const offsetTop = computed(() => props.offset?.[1] ?? gapYCenter.value);
  53270. const getMarkStyle = () => {
  53271. const markStyle = {
  53272. zIndex: props.zIndex,
  53273. position: "absolute",
  53274. left: 0,
  53275. top: 0,
  53276. width: "100%",
  53277. height: "100%",
  53278. pointerEvents: "none",
  53279. backgroundRepeat: "repeat"
  53280. };
  53281. /** Calculate the style of the offset */
  53282. let positionLeft = offsetLeft.value - gapXCenter.value;
  53283. let positionTop = offsetTop.value - gapYCenter.value;
  53284. if (positionLeft > 0) {
  53285. markStyle.left = `${positionLeft}px`;
  53286. markStyle.width = `calc(100% - ${positionLeft}px)`;
  53287. positionLeft = 0;
  53288. }
  53289. if (positionTop > 0) {
  53290. markStyle.top = `${positionTop}px`;
  53291. markStyle.height = `calc(100% - ${positionTop}px)`;
  53292. positionTop = 0;
  53293. }
  53294. markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
  53295. return markStyle;
  53296. };
  53297. const containerRef = shallowRef(null);
  53298. const watermarkRef = shallowRef();
  53299. const stopObservation = ref(false);
  53300. const destroyWatermark = () => {
  53301. if (watermarkRef.value) {
  53302. watermarkRef.value.remove();
  53303. watermarkRef.value = void 0;
  53304. }
  53305. };
  53306. const appendWatermark = (base64Url, markWidth) => {
  53307. if (containerRef.value && watermarkRef.value) {
  53308. stopObservation.value = true;
  53309. watermarkRef.value.setAttribute("style", getStyleStr({
  53310. ...getMarkStyle(),
  53311. backgroundImage: `url('${base64Url}')`,
  53312. backgroundSize: `${Math.floor(markWidth)}px`
  53313. }));
  53314. containerRef.value?.append(watermarkRef.value);
  53315. setTimeout(() => {
  53316. stopObservation.value = false;
  53317. });
  53318. }
  53319. };
  53320. /**
  53321. * Get the width and height of the watermark. The default values are as follows
  53322. * Image: [120, 64]; Content: It's calculated by content;
  53323. */
  53324. const getMarkSize = (ctx) => {
  53325. let defaultWidth = 120;
  53326. let defaultHeight = 64;
  53327. let space = 0;
  53328. const { image, content, width, height, rotate } = props;
  53329. if (!image && ctx.measureText) {
  53330. ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
  53331. const contents = isArray$1(content) ? content : [content];
  53332. let maxWidth = 0;
  53333. let maxHeight = 0;
  53334. contents.forEach((item) => {
  53335. const { width, fontBoundingBoxAscent, fontBoundingBoxDescent, actualBoundingBoxAscent, actualBoundingBoxDescent } = ctx.measureText(item);
  53336. const height = isUndefined(fontBoundingBoxAscent) ? actualBoundingBoxAscent + actualBoundingBoxDescent : fontBoundingBoxAscent + fontBoundingBoxDescent;
  53337. if (width > maxWidth) maxWidth = Math.ceil(width);
  53338. if (height > maxHeight) maxHeight = Math.ceil(height);
  53339. });
  53340. defaultWidth = maxWidth;
  53341. defaultHeight = maxHeight * contents.length + (contents.length - 1) * fontGap.value;
  53342. const angle = Math.PI / 180 * Number(rotate);
  53343. space = Math.ceil(Math.abs(Math.sin(angle) * defaultHeight) / 2);
  53344. defaultWidth += space;
  53345. }
  53346. return [
  53347. width ?? defaultWidth,
  53348. height ?? defaultHeight,
  53349. space
  53350. ];
  53351. };
  53352. const getClips = useClips();
  53353. const renderWatermark = () => {
  53354. const ctx = document.createElement("canvas").getContext("2d");
  53355. const image = props.image;
  53356. const content = props.content;
  53357. const rotate = props.rotate;
  53358. if (ctx) {
  53359. if (!watermarkRef.value) watermarkRef.value = document.createElement("div");
  53360. const ratio = getPixelRatio();
  53361. const [markWidth, markHeight, space] = getMarkSize(ctx);
  53362. const drawCanvas = (drawContent) => {
  53363. const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, {
  53364. color: color.value,
  53365. fontSize: fontSize.value,
  53366. fontStyle: fontStyle.value,
  53367. fontWeight: fontWeight.value,
  53368. fontFamily: fontFamily.value,
  53369. fontGap: fontGap.value,
  53370. textAlign: textAlign.value,
  53371. textBaseline: textBaseline.value
  53372. }, gapX.value, gapY.value, space);
  53373. appendWatermark(textClips, clipWidth);
  53374. };
  53375. if (image) {
  53376. const img = new Image();
  53377. img.onload = () => {
  53378. drawCanvas(img);
  53379. };
  53380. img.onerror = () => {
  53381. drawCanvas(content);
  53382. };
  53383. img.crossOrigin = "anonymous";
  53384. img.referrerPolicy = "no-referrer";
  53385. img.src = image;
  53386. } else drawCanvas(content);
  53387. }
  53388. };
  53389. onMounted(() => {
  53390. renderWatermark();
  53391. });
  53392. watch(() => props, () => {
  53393. renderWatermark();
  53394. }, {
  53395. deep: true,
  53396. flush: "post"
  53397. });
  53398. onBeforeUnmount(() => {
  53399. destroyWatermark();
  53400. });
  53401. const onMutate = (mutations) => {
  53402. if (stopObservation.value) return;
  53403. mutations.forEach((mutation) => {
  53404. if (reRendering(mutation, watermarkRef.value)) {
  53405. destroyWatermark();
  53406. renderWatermark();
  53407. }
  53408. });
  53409. };
  53410. useMutationObserver(containerRef, onMutate, {
  53411. attributes: true,
  53412. subtree: true,
  53413. childList: true
  53414. });
  53415. return (_ctx, _cache) => {
  53416. return openBlock(), createElementBlock("div", {
  53417. ref_key: "containerRef",
  53418. ref: containerRef,
  53419. style: normalizeStyle([style])
  53420. }, [renderSlot(_ctx.$slots, "default")], 4);
  53421. };
  53422. }
  53423. });
  53424. //#endregion
  53425. //#region ../../packages/components/watermark/src/watermark.vue
  53426. var watermark_default = watermark_vue_vue_type_script_setup_true_lang_default;
  53427. //#endregion
  53428. //#region ../../packages/components/watermark/index.ts
  53429. const ElWatermark = withInstall(watermark_default);
  53430. //#endregion
  53431. //#region ../../packages/components/tour/src/content.ts
  53432. const tourStrategies = ["absolute", "fixed"];
  53433. const tourPlacements = [
  53434. "top-start",
  53435. "top-end",
  53436. "top",
  53437. "bottom-start",
  53438. "bottom-end",
  53439. "bottom",
  53440. "left-start",
  53441. "left-end",
  53442. "left",
  53443. "right-start",
  53444. "right-end",
  53445. "right"
  53446. ];
  53447. /**
  53448. * @deprecated Removed after 3.0.0, Use `TourContentProps` instead.
  53449. */
  53450. const tourContentProps = buildProps({
  53451. placement: {
  53452. type: definePropType(String),
  53453. values: tourPlacements,
  53454. default: "bottom"
  53455. },
  53456. reference: {
  53457. type: definePropType(Object),
  53458. default: null
  53459. },
  53460. strategy: {
  53461. type: definePropType(String),
  53462. values: tourStrategies,
  53463. default: "absolute"
  53464. },
  53465. offset: {
  53466. type: Number,
  53467. default: 10
  53468. },
  53469. showArrow: Boolean,
  53470. zIndex: {
  53471. type: Number,
  53472. default: 2001
  53473. }
  53474. });
  53475. const tourContentEmits = { close: () => true };
  53476. //#endregion
  53477. //#region ../../packages/components/tour/src/tour.ts
  53478. /**
  53479. * @deprecated Removed after 3.0.0, Use `TourProps` instead.
  53480. */
  53481. const tourProps = buildProps({
  53482. modelValue: Boolean,
  53483. current: {
  53484. type: Number,
  53485. default: 0
  53486. },
  53487. showArrow: {
  53488. type: Boolean,
  53489. default: true
  53490. },
  53491. showClose: {
  53492. type: Boolean,
  53493. default: true
  53494. },
  53495. closeIcon: { type: iconPropType },
  53496. placement: tourContentProps.placement,
  53497. contentStyle: { type: definePropType([Object]) },
  53498. mask: {
  53499. type: definePropType([Boolean, Object]),
  53500. default: true
  53501. },
  53502. gap: {
  53503. type: definePropType(Object),
  53504. default: () => ({
  53505. offset: 6,
  53506. radius: 2
  53507. })
  53508. },
  53509. zIndex: { type: Number },
  53510. scrollIntoViewOptions: {
  53511. type: definePropType([Boolean, Object]),
  53512. default: () => ({ block: "center" })
  53513. },
  53514. type: { type: definePropType(String) },
  53515. appendTo: {
  53516. type: teleportProps.to.type,
  53517. default: "body"
  53518. },
  53519. closeOnPressEscape: {
  53520. type: Boolean,
  53521. default: true
  53522. },
  53523. targetAreaClickable: {
  53524. type: Boolean,
  53525. default: true
  53526. }
  53527. });
  53528. const tourEmits = {
  53529. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  53530. ["update:current"]: (current) => isNumber(current),
  53531. close: (current) => isNumber(current),
  53532. finish: () => true,
  53533. change: (current) => isNumber(current)
  53534. };
  53535. //#endregion
  53536. //#region ../../packages/components/tour/src/mask.ts
  53537. /**
  53538. * @deprecated Removed after 3.0.0, Use `MaskProps` instead.
  53539. */
  53540. const maskProps = buildProps({
  53541. zIndex: {
  53542. type: Number,
  53543. default: 1001
  53544. },
  53545. visible: Boolean,
  53546. fill: {
  53547. type: String,
  53548. default: "rgba(0,0,0,0.5)"
  53549. },
  53550. pos: { type: definePropType(Object) },
  53551. targetAreaClickable: {
  53552. type: Boolean,
  53553. default: true
  53554. }
  53555. });
  53556. //#endregion
  53557. //#region ../../packages/components/tour/src/helper.ts
  53558. const useTarget = (target, open, gap, mergedMask, scrollIntoViewOptions) => {
  53559. const posInfo = ref(null);
  53560. const getTargetEl = () => {
  53561. let targetEl;
  53562. if (isString(target.value)) targetEl = document.querySelector(target.value);
  53563. else if (isFunction$1(target.value)) targetEl = target.value();
  53564. else targetEl = target.value;
  53565. return targetEl;
  53566. };
  53567. const updatePosInfo = () => {
  53568. const targetEl = getTargetEl();
  53569. if (!targetEl || !open.value) {
  53570. posInfo.value = null;
  53571. return;
  53572. }
  53573. if (!isInViewPort(targetEl)) targetEl.scrollIntoView(scrollIntoViewOptions.value);
  53574. const { left, top, width, height } = targetEl.getBoundingClientRect();
  53575. posInfo.value = {
  53576. left,
  53577. top,
  53578. width,
  53579. height,
  53580. radius: 0
  53581. };
  53582. };
  53583. onMounted(() => {
  53584. watch([open, target], () => {
  53585. updatePosInfo();
  53586. }, { immediate: true });
  53587. window.addEventListener("resize", updatePosInfo);
  53588. });
  53589. onBeforeUnmount(() => {
  53590. window.removeEventListener("resize", updatePosInfo);
  53591. });
  53592. const getGapOffset = (index) => (isArray$1(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ?? 6;
  53593. const mergedPosInfo = computed(() => {
  53594. if (!posInfo.value) return posInfo.value;
  53595. const gapOffsetX = getGapOffset(0);
  53596. const gapOffsetY = getGapOffset(1);
  53597. const gapRadius = gap.value?.radius || 2;
  53598. return {
  53599. left: posInfo.value.left - gapOffsetX,
  53600. top: posInfo.value.top - gapOffsetY,
  53601. width: posInfo.value.width + gapOffsetX * 2,
  53602. height: posInfo.value.height + gapOffsetY * 2,
  53603. radius: gapRadius
  53604. };
  53605. });
  53606. return {
  53607. mergedPosInfo,
  53608. triggerTarget: computed(() => {
  53609. const targetEl = getTargetEl();
  53610. if (!mergedMask.value || !targetEl || !window.DOMRect) return targetEl || void 0;
  53611. return { getBoundingClientRect() {
  53612. return window.DOMRect.fromRect({
  53613. width: mergedPosInfo.value?.width || 0,
  53614. height: mergedPosInfo.value?.height || 0,
  53615. x: mergedPosInfo.value?.left || 0,
  53616. y: mergedPosInfo.value?.top || 0
  53617. });
  53618. } };
  53619. })
  53620. };
  53621. };
  53622. const tourKey = Symbol("ElTour");
  53623. function isInViewPort(element) {
  53624. const viewWidth = window.innerWidth || document.documentElement.clientWidth;
  53625. const viewHeight = window.innerHeight || document.documentElement.clientHeight;
  53626. const { top, right, bottom, left } = element.getBoundingClientRect();
  53627. return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight;
  53628. }
  53629. const useFloating$1 = (referenceRef, contentRef, arrowRef, placement, strategy, offset$2, zIndex, showArrow) => {
  53630. const x = ref();
  53631. const y = ref();
  53632. const middlewareData = ref({});
  53633. const states = {
  53634. x,
  53635. y,
  53636. placement,
  53637. strategy,
  53638. middlewareData
  53639. };
  53640. const middleware = computed(() => {
  53641. const _middleware = [
  53642. offset(unref(offset$2)),
  53643. flip(),
  53644. shift(),
  53645. overflowMiddleware()
  53646. ];
  53647. if (unref(showArrow) && unref(arrowRef)) _middleware.push(arrow({ element: unref(arrowRef) }));
  53648. return _middleware;
  53649. });
  53650. const update = async () => {
  53651. if (!isClient) return;
  53652. const referenceEl = unref(referenceRef);
  53653. const contentEl = unref(contentRef);
  53654. if (!referenceEl || !contentEl) return;
  53655. const data = await computePosition(referenceEl, contentEl, {
  53656. placement: unref(placement),
  53657. strategy: unref(strategy),
  53658. middleware: unref(middleware)
  53659. });
  53660. keysOf(states).forEach((key) => {
  53661. states[key].value = data[key];
  53662. });
  53663. };
  53664. const contentStyle = computed(() => {
  53665. if (!unref(referenceRef)) return {
  53666. position: "fixed",
  53667. top: "50%",
  53668. left: "50%",
  53669. transform: "translate3d(-50%, -50%, 0)",
  53670. maxWidth: "100vw",
  53671. zIndex: unref(zIndex)
  53672. };
  53673. const { overflow } = unref(middlewareData);
  53674. return {
  53675. position: unref(strategy),
  53676. zIndex: unref(zIndex),
  53677. top: unref(y) != null ? `${unref(y)}px` : "",
  53678. left: unref(x) != null ? `${unref(x)}px` : "",
  53679. maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : ""
  53680. };
  53681. });
  53682. const arrowStyle = computed(() => {
  53683. if (!unref(showArrow)) return {};
  53684. const { arrow } = unref(middlewareData);
  53685. return {
  53686. left: arrow?.x != null ? `${arrow?.x}px` : "",
  53687. top: arrow?.y != null ? `${arrow?.y}px` : ""
  53688. };
  53689. });
  53690. let cleanup;
  53691. onMounted(() => {
  53692. const referenceEl = unref(referenceRef);
  53693. const contentEl = unref(contentRef);
  53694. if (referenceEl && contentEl) cleanup = autoUpdate(referenceEl, contentEl, update);
  53695. watchEffect(() => {
  53696. update();
  53697. });
  53698. });
  53699. onBeforeUnmount(() => {
  53700. cleanup && cleanup();
  53701. });
  53702. return {
  53703. update,
  53704. contentStyle,
  53705. arrowStyle
  53706. };
  53707. };
  53708. const overflowMiddleware = () => {
  53709. return {
  53710. name: "overflow",
  53711. async fn(state) {
  53712. const overflow = await detectOverflow(state);
  53713. let overWidth = 0;
  53714. if (overflow.left > 0) overWidth = overflow.left;
  53715. if (overflow.right > 0) overWidth = overflow.right;
  53716. return { data: { maxWidth: state.rects.floating.width - overWidth } };
  53717. }
  53718. };
  53719. };
  53720. //#endregion
  53721. //#region ../../packages/components/tour/src/mask.vue?vue&type=script&setup=true&lang.ts
  53722. const _hoisted_1$8 = { style: {
  53723. width: "100%",
  53724. height: "100%"
  53725. } };
  53726. const _hoisted_2$4 = ["d"];
  53727. var mask_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  53728. name: "ElTourMask",
  53729. inheritAttrs: false,
  53730. __name: "mask",
  53731. props: maskProps,
  53732. setup(__props) {
  53733. const props = __props;
  53734. const { ns } = inject(tourKey);
  53735. const radius = computed(() => props.pos?.radius ?? 2);
  53736. const roundInfo = computed(() => {
  53737. const v = radius.value;
  53738. const baseInfo = `a${v},${v} 0 0 1`;
  53739. return {
  53740. topRight: `${baseInfo} ${v},${v}`,
  53741. bottomRight: `${baseInfo} ${-v},${v}`,
  53742. bottomLeft: `${baseInfo} ${-v},${-v}`,
  53743. topLeft: `${baseInfo} ${v},${-v}`
  53744. };
  53745. });
  53746. const { width: windowWidth, height: windowHeight } = useWindowSize();
  53747. const path = computed(() => {
  53748. const width = windowWidth.value;
  53749. const height = windowHeight.value;
  53750. const info = roundInfo.value;
  53751. const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`;
  53752. const _radius = radius.value;
  53753. return props.pos ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${props.pos.width - _radius * 2} ${info.topRight} v${props.pos.height - _radius * 2} ${info.bottomRight} h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${-props.pos.height + _radius * 2} ${info.topLeft} z` : _path;
  53754. });
  53755. const maskStyle = computed(() => ({
  53756. position: "fixed",
  53757. left: 0,
  53758. right: 0,
  53759. top: 0,
  53760. bottom: 0,
  53761. zIndex: props.zIndex,
  53762. pointerEvents: props.pos && props.targetAreaClickable ? "none" : "auto"
  53763. }));
  53764. const pathStyle = computed(() => ({
  53765. fill: props.fill,
  53766. pointerEvents: "auto",
  53767. cursor: "auto"
  53768. }));
  53769. useLockscreen(toRef(props, "visible"), { ns });
  53770. return (_ctx, _cache) => {
  53771. return __props.visible ? (openBlock(), createElementBlock("div", mergeProps({
  53772. key: 0,
  53773. class: unref(ns).e("mask"),
  53774. style: maskStyle.value
  53775. }, _ctx.$attrs), [(openBlock(), createElementBlock("svg", _hoisted_1$8, [createElementVNode("path", {
  53776. class: normalizeClass(unref(ns).e("hollow")),
  53777. style: normalizeStyle(pathStyle.value),
  53778. d: path.value
  53779. }, null, 14, _hoisted_2$4)]))], 16)) : createCommentVNode("v-if", true);
  53780. };
  53781. }
  53782. });
  53783. //#endregion
  53784. //#region ../../packages/components/tour/src/mask.vue
  53785. var mask_default = mask_vue_vue_type_script_setup_true_lang_default;
  53786. //#endregion
  53787. //#region ../../packages/components/tour/src/content.vue?vue&type=script&setup=true&lang.ts
  53788. const _hoisted_1$7 = ["data-side"];
  53789. var content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  53790. name: "ElTourContent",
  53791. __name: "content",
  53792. props: tourContentProps,
  53793. emits: tourContentEmits,
  53794. setup(__props, { emit: __emit }) {
  53795. const props = __props;
  53796. const emit = __emit;
  53797. const placement = ref(props.placement);
  53798. const strategy = ref(props.strategy);
  53799. const contentRef = ref(null);
  53800. const arrowRef = ref(null);
  53801. watch(() => props.placement, () => {
  53802. placement.value = props.placement;
  53803. });
  53804. const { contentStyle, arrowStyle } = useFloating$1(toRef(props, "reference"), contentRef, arrowRef, placement, strategy, toRef(props, "offset"), toRef(props, "zIndex"), toRef(props, "showArrow"));
  53805. const side = computed(() => {
  53806. return placement.value.split("-")[0];
  53807. });
  53808. const { ns } = inject(tourKey);
  53809. const onCloseRequested = () => {
  53810. emit("close");
  53811. };
  53812. const onFocusoutPrevented = (event) => {
  53813. if (event.detail.focusReason === "pointer") event.preventDefault();
  53814. };
  53815. return (_ctx, _cache) => {
  53816. return openBlock(), createElementBlock("div", {
  53817. ref_key: "contentRef",
  53818. ref: contentRef,
  53819. style: normalizeStyle(unref(contentStyle)),
  53820. class: normalizeClass(unref(ns).e("content")),
  53821. "data-side": side.value,
  53822. tabindex: "-1"
  53823. }, [createVNode(unref(focus_trap_default), {
  53824. loop: "",
  53825. trapped: "",
  53826. "focus-start-el": "container",
  53827. "focus-trap-el": contentRef.value || void 0,
  53828. onReleaseRequested: onCloseRequested,
  53829. onFocusoutPrevented
  53830. }, {
  53831. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  53832. _: 3
  53833. }, 8, ["focus-trap-el"]), __props.showArrow ? (openBlock(), createElementBlock("span", {
  53834. key: 0,
  53835. ref_key: "arrowRef",
  53836. ref: arrowRef,
  53837. style: normalizeStyle(unref(arrowStyle)),
  53838. class: normalizeClass(unref(ns).e("arrow"))
  53839. }, null, 6)) : createCommentVNode("v-if", true)], 14, _hoisted_1$7);
  53840. };
  53841. }
  53842. });
  53843. //#endregion
  53844. //#region ../../packages/components/tour/src/content.vue
  53845. var content_default$1 = content_vue_vue_type_script_setup_true_lang_default;
  53846. //#endregion
  53847. //#region ../../packages/components/tour/src/steps.ts
  53848. var steps_default = defineComponent({
  53849. name: "ElTourSteps",
  53850. props: { current: {
  53851. type: Number,
  53852. default: 0
  53853. } },
  53854. emits: ["update-total"],
  53855. setup(props, { slots, emit }) {
  53856. let cacheTotal = 0;
  53857. return () => {
  53858. const children = slots.default?.();
  53859. const result = [];
  53860. let total = 0;
  53861. function filterSteps(children) {
  53862. if (!isArray$1(children)) return;
  53863. children.forEach((item) => {
  53864. if ((item?.type || {})?.name === "ElTourStep") {
  53865. result.push(item);
  53866. total += 1;
  53867. }
  53868. });
  53869. }
  53870. if (children.length) filterSteps(flattedChildren(children[0]?.children));
  53871. if (cacheTotal !== total) {
  53872. cacheTotal = total;
  53873. emit("update-total", total);
  53874. }
  53875. if (result.length) return result[props.current];
  53876. return null;
  53877. };
  53878. }
  53879. });
  53880. //#endregion
  53881. //#region ../../packages/components/tour/src/tour.vue?vue&type=script&setup=true&lang.ts
  53882. var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  53883. name: "ElTour",
  53884. inheritAttrs: false,
  53885. __name: "tour",
  53886. props: tourProps,
  53887. emits: tourEmits,
  53888. setup(__props, { emit: __emit }) {
  53889. const props = __props;
  53890. const emit = __emit;
  53891. const ns = useNamespace("tour");
  53892. const total = ref(0);
  53893. const currentStep = ref();
  53894. const current = useVModel(props, "current", emit, { passive: true });
  53895. const currentTarget = computed(() => currentStep.value?.target);
  53896. const kls = computed(() => [ns.b(), mergedType.value === "primary" ? ns.m("primary") : ""]);
  53897. const mergedPlacement = computed(() => currentStep.value?.placement || props.placement);
  53898. const mergedContentStyle = computed(() => currentStep.value?.contentStyle ?? props.contentStyle);
  53899. const mergedMask = computed(() => currentStep.value?.mask ?? props.mask);
  53900. const mergedShowMask = computed(() => !!mergedMask.value && props.modelValue);
  53901. const mergedMaskStyle = computed(() => isBoolean(mergedMask.value) ? void 0 : mergedMask.value);
  53902. const mergedShowArrow = computed(() => !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow));
  53903. const mergedScrollIntoViewOptions = computed(() => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions);
  53904. const mergedType = computed(() => currentStep.value?.type ?? props.type);
  53905. const { nextZIndex } = useZIndex();
  53906. const nowZIndex = nextZIndex();
  53907. const mergedZIndex = computed(() => props.zIndex ?? nowZIndex);
  53908. const { mergedPosInfo: pos, triggerTarget } = useTarget(currentTarget, toRef(props, "modelValue"), toRef(props, "gap"), mergedMask, mergedScrollIntoViewOptions);
  53909. watch(() => props.modelValue, (val) => {
  53910. if (!val) current.value = 0;
  53911. });
  53912. const onEscClose = () => {
  53913. if (props.closeOnPressEscape) {
  53914. emit(UPDATE_MODEL_EVENT, false);
  53915. emit("close", current.value);
  53916. }
  53917. };
  53918. const onUpdateTotal = (val) => {
  53919. total.value = val;
  53920. };
  53921. const slots = useSlots();
  53922. provide(tourKey, {
  53923. currentStep,
  53924. current,
  53925. total,
  53926. showClose: toRef(props, "showClose"),
  53927. closeIcon: toRef(props, "closeIcon"),
  53928. mergedType,
  53929. ns,
  53930. slots,
  53931. updateModelValue(modelValue) {
  53932. emit(UPDATE_MODEL_EVENT, modelValue);
  53933. },
  53934. onClose() {
  53935. emit("close", current.value);
  53936. },
  53937. onFinish() {
  53938. emit("finish");
  53939. },
  53940. onChange() {
  53941. emit(CHANGE_EVENT, current.value);
  53942. }
  53943. });
  53944. return (_ctx, _cache) => {
  53945. return openBlock(), createElementBlock(Fragment, null, [
  53946. createVNode(unref(ElTeleport), { to: __props.appendTo }, {
  53947. default: withCtx(() => [createElementVNode("div", mergeProps({ class: kls.value }, _ctx.$attrs), [createVNode(mask_default, {
  53948. visible: mergedShowMask.value,
  53949. fill: mergedMaskStyle.value?.color,
  53950. style: normalizeStyle(mergedMaskStyle.value?.style),
  53951. pos: unref(pos),
  53952. "z-index": mergedZIndex.value,
  53953. "target-area-clickable": __props.targetAreaClickable
  53954. }, null, 8, [
  53955. "visible",
  53956. "fill",
  53957. "style",
  53958. "pos",
  53959. "z-index",
  53960. "target-area-clickable"
  53961. ]), __props.modelValue ? (openBlock(), createBlock(content_default$1, {
  53962. key: unref(current),
  53963. reference: unref(triggerTarget),
  53964. placement: mergedPlacement.value,
  53965. "show-arrow": mergedShowArrow.value,
  53966. "z-index": mergedZIndex.value,
  53967. style: normalizeStyle(mergedContentStyle.value),
  53968. onClose: onEscClose
  53969. }, {
  53970. default: withCtx(() => [createVNode(unref(steps_default), {
  53971. current: unref(current),
  53972. onUpdateTotal
  53973. }, {
  53974. default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
  53975. _: 3
  53976. }, 8, ["current"])]),
  53977. _: 3
  53978. }, 8, [
  53979. "reference",
  53980. "placement",
  53981. "show-arrow",
  53982. "z-index",
  53983. "style"
  53984. ])) : createCommentVNode("v-if", true)], 16)]),
  53985. _: 3
  53986. }, 8, ["to"]),
  53987. createCommentVNode(" just for IDE "),
  53988. createCommentVNode("v-if", true)
  53989. ], 64);
  53990. };
  53991. }
  53992. });
  53993. //#endregion
  53994. //#region ../../packages/components/tour/src/tour.vue
  53995. var tour_default = tour_vue_vue_type_script_setup_true_lang_default;
  53996. //#endregion
  53997. //#region ../../packages/components/tour/src/step.ts
  53998. /**
  53999. * @deprecated Removed after 3.0.0, Use `TourStepProps` instead.
  54000. */
  54001. const tourStepProps = buildProps({
  54002. target: { type: definePropType([
  54003. String,
  54004. Object,
  54005. Function
  54006. ]) },
  54007. title: String,
  54008. description: String,
  54009. showClose: {
  54010. type: Boolean,
  54011. default: void 0
  54012. },
  54013. closeIcon: { type: iconPropType },
  54014. showArrow: {
  54015. type: Boolean,
  54016. default: void 0
  54017. },
  54018. placement: tourContentProps.placement,
  54019. mask: {
  54020. type: definePropType([Boolean, Object]),
  54021. default: void 0
  54022. },
  54023. contentStyle: { type: definePropType([Object]) },
  54024. prevButtonProps: { type: definePropType(Object) },
  54025. nextButtonProps: { type: definePropType(Object) },
  54026. scrollIntoViewOptions: {
  54027. type: definePropType([Boolean, Object]),
  54028. default: void 0
  54029. },
  54030. type: { type: definePropType(String) }
  54031. });
  54032. const tourStepEmits = { close: () => true };
  54033. //#endregion
  54034. //#region ../../packages/components/tour/src/step.vue?vue&type=script&setup=true&lang.ts
  54035. const _hoisted_1$6 = ["aria-label"];
  54036. var step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54037. name: "ElTourStep",
  54038. __name: "step",
  54039. props: tourStepProps,
  54040. emits: tourStepEmits,
  54041. setup(__props, { emit: __emit }) {
  54042. const props = __props;
  54043. const emit = __emit;
  54044. const { Close } = CloseComponents;
  54045. const { t } = useLocale();
  54046. const { currentStep, current, total, showClose, closeIcon, mergedType, ns, slots: tourSlots, updateModelValue, onClose: tourOnClose, onFinish: tourOnFinish, onChange } = inject(tourKey);
  54047. watch(props, (val) => {
  54048. currentStep.value = val;
  54049. }, { immediate: true });
  54050. const mergedShowClose = computed(() => props.showClose ?? showClose.value);
  54051. const mergedCloseIcon = computed(() => props.closeIcon ?? closeIcon.value ?? Close);
  54052. const filterButtonProps = (btnProps) => {
  54053. if (!btnProps) return;
  54054. return omit(btnProps, ["children", "onClick"]);
  54055. };
  54056. const onPrev = () => {
  54057. current.value -= 1;
  54058. if (props.prevButtonProps?.onClick) props.prevButtonProps?.onClick();
  54059. onChange();
  54060. };
  54061. const onNext = () => {
  54062. if (current.value >= total.value - 1) onFinish();
  54063. else current.value += 1;
  54064. if (props.nextButtonProps?.onClick) props.nextButtonProps.onClick();
  54065. onChange();
  54066. };
  54067. const onFinish = () => {
  54068. onClose();
  54069. tourOnFinish();
  54070. };
  54071. const onClose = () => {
  54072. updateModelValue(false);
  54073. tourOnClose();
  54074. emit("close");
  54075. };
  54076. const handleKeydown = (e) => {
  54077. if (e.target?.isContentEditable) return;
  54078. switch (getEventCode(e)) {
  54079. case EVENT_CODE.left:
  54080. e.preventDefault();
  54081. current.value > 0 && onPrev();
  54082. break;
  54083. case EVENT_CODE.right:
  54084. e.preventDefault();
  54085. onNext();
  54086. break;
  54087. }
  54088. };
  54089. onMounted(() => {
  54090. window.addEventListener("keydown", handleKeydown);
  54091. });
  54092. onBeforeUnmount(() => {
  54093. window.removeEventListener("keydown", handleKeydown);
  54094. });
  54095. return (_ctx, _cache) => {
  54096. return openBlock(), createElementBlock(Fragment, null, [
  54097. mergedShowClose.value ? (openBlock(), createElementBlock("button", {
  54098. key: 0,
  54099. "aria-label": unref(t)("el.tour.close"),
  54100. class: normalizeClass(unref(ns).e("closebtn")),
  54101. type: "button",
  54102. onClick: onClose
  54103. }, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, {
  54104. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(mergedCloseIcon.value)))]),
  54105. _: 1
  54106. }, 8, ["class"])], 10, _hoisted_1$6)) : createCommentVNode("v-if", true),
  54107. createElementVNode("header", { class: normalizeClass([unref(ns).e("header"), { "show-close": unref(showClose) }]) }, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("span", {
  54108. role: "heading",
  54109. class: normalizeClass(unref(ns).e("title"))
  54110. }, toDisplayString(__props.title), 3)])], 2),
  54111. createElementVNode("div", { class: normalizeClass(unref(ns).e("body")) }, [renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("span", null, toDisplayString(__props.description), 1)])], 2),
  54112. createElementVNode("footer", { class: normalizeClass(unref(ns).e("footer")) }, [createElementVNode("div", { class: normalizeClass(unref(ns).b("indicators")) }, [unref(tourSlots).indicators ? (openBlock(), createBlock(resolveDynamicComponent(unref(tourSlots).indicators), {
  54113. key: 0,
  54114. current: unref(current),
  54115. total: unref(total)
  54116. }, null, 8, ["current", "total"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(total), (item, index) => {
  54117. return openBlock(), createElementBlock("span", {
  54118. key: item,
  54119. class: normalizeClass([unref(ns).b("indicator"), unref(ns).is("active", index === unref(current))])
  54120. }, null, 2);
  54121. }), 128))], 2), createElementVNode("div", { class: normalizeClass(unref(ns).b("buttons")) }, [unref(current) > 0 ? (openBlock(), createBlock(unref(ElButton), mergeProps({
  54122. key: 0,
  54123. size: "small",
  54124. type: unref(mergedType)
  54125. }, filterButtonProps(__props.prevButtonProps), { onClick: onPrev }), {
  54126. default: withCtx(() => [createTextVNode(toDisplayString(__props.prevButtonProps?.children ?? unref(t)("el.tour.previous")), 1)]),
  54127. _: 1
  54128. }, 16, ["type"])) : createCommentVNode("v-if", true), unref(current) <= unref(total) - 1 ? (openBlock(), createBlock(unref(ElButton), mergeProps({
  54129. key: 1,
  54130. size: "small",
  54131. type: unref(mergedType) === "primary" ? "default" : "primary"
  54132. }, filterButtonProps(__props.nextButtonProps), { onClick: onNext }), {
  54133. default: withCtx(() => [createTextVNode(toDisplayString(__props.nextButtonProps?.children ?? (unref(current) === unref(total) - 1 ? unref(t)("el.tour.finish") : unref(t)("el.tour.next"))), 1)]),
  54134. _: 1
  54135. }, 16, ["type"])) : createCommentVNode("v-if", true)], 2)], 2)
  54136. ], 64);
  54137. };
  54138. }
  54139. });
  54140. //#endregion
  54141. //#region ../../packages/components/tour/src/step.vue
  54142. var step_default = step_vue_vue_type_script_setup_true_lang_default;
  54143. //#endregion
  54144. //#region ../../packages/components/tour/index.ts
  54145. const ElTour = withInstall(tour_default, { TourStep: step_default });
  54146. const ElTourStep = withNoopInstall(step_default);
  54147. //#endregion
  54148. //#region ../../packages/components/anchor/src/anchor.ts
  54149. /**
  54150. * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.
  54151. */
  54152. const anchorProps = buildProps({
  54153. container: { type: definePropType([String, Object]) },
  54154. offset: {
  54155. type: Number,
  54156. default: 0
  54157. },
  54158. bound: {
  54159. type: Number,
  54160. default: 15
  54161. },
  54162. duration: {
  54163. type: Number,
  54164. default: 300
  54165. },
  54166. marker: {
  54167. type: Boolean,
  54168. default: true
  54169. },
  54170. type: {
  54171. type: definePropType(String),
  54172. default: "default"
  54173. },
  54174. direction: {
  54175. type: definePropType(String),
  54176. default: "vertical"
  54177. },
  54178. selectScrollTop: Boolean
  54179. });
  54180. const anchorEmits = {
  54181. change: (href) => isString(href),
  54182. click: (e, href) => e instanceof MouseEvent && (isString(href) || isUndefined(href))
  54183. };
  54184. //#endregion
  54185. //#region ../../packages/components/anchor/src/constants.ts
  54186. const anchorKey = Symbol("anchor");
  54187. //#endregion
  54188. //#region ../../packages/components/anchor/src/anchor.vue?vue&type=script&setup=true&lang.ts
  54189. var anchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54190. name: "ElAnchor",
  54191. __name: "anchor",
  54192. props: anchorProps,
  54193. emits: anchorEmits,
  54194. setup(__props, { expose: __expose, emit: __emit }) {
  54195. const props = __props;
  54196. const emit = __emit;
  54197. const slots = useSlots();
  54198. const currentAnchor = ref("");
  54199. const markerStyle = ref({});
  54200. const anchorRef = ref(null);
  54201. const markerRef = ref(null);
  54202. const containerEl = ref();
  54203. const links = {};
  54204. let isScrolling = false;
  54205. let currentScrollTop = 0;
  54206. const ns = useNamespace("anchor");
  54207. const cls = computed(() => [
  54208. ns.b(),
  54209. props.type === "underline" ? ns.m("underline") : "",
  54210. ns.m(props.direction)
  54211. ]);
  54212. const addLink = (state) => {
  54213. links[state.href] = state.el;
  54214. };
  54215. const removeLink = (href) => {
  54216. delete links[href];
  54217. };
  54218. const setCurrentAnchor = (href) => {
  54219. if (currentAnchor.value !== href) {
  54220. currentAnchor.value = href;
  54221. emit(CHANGE_EVENT, href);
  54222. }
  54223. };
  54224. let clearAnimate = null;
  54225. let currentTargetHref = "";
  54226. const scrollToAnchor = (href) => {
  54227. if (!containerEl.value) return;
  54228. const target = getElement(href);
  54229. if (!target) return;
  54230. if (clearAnimate) {
  54231. if (currentTargetHref === href) return;
  54232. clearAnimate();
  54233. }
  54234. currentTargetHref = href;
  54235. isScrolling = true;
  54236. const scrollEle = getScrollElement(target, containerEl.value);
  54237. const distance = getOffsetTopDistance(target, scrollEle);
  54238. const max = scrollEle.scrollHeight - scrollEle.clientHeight;
  54239. const to = Math.min(distance - props.offset, max);
  54240. clearAnimate = animateScrollTo(containerEl.value, currentScrollTop, to, props.duration, () => {
  54241. setTimeout(() => {
  54242. isScrolling = false;
  54243. currentTargetHref = "";
  54244. }, 20);
  54245. });
  54246. };
  54247. const scrollTo = (href) => {
  54248. if (href) {
  54249. setCurrentAnchor(href);
  54250. scrollToAnchor(href);
  54251. }
  54252. };
  54253. const handleClick = (e, href) => {
  54254. emit("click", e, href);
  54255. scrollTo(href);
  54256. };
  54257. const handleScroll = throttleByRaf(() => {
  54258. if (containerEl.value) currentScrollTop = getScrollTop(containerEl.value);
  54259. const currentHref = getCurrentHref();
  54260. if (isScrolling || isUndefined(currentHref)) return;
  54261. setCurrentAnchor(currentHref);
  54262. });
  54263. const getCurrentHref = () => {
  54264. if (!containerEl.value) return;
  54265. const scrollTop = getScrollTop(containerEl.value);
  54266. const anchorTopList = [];
  54267. for (const href of Object.keys(links)) {
  54268. const target = getElement(href);
  54269. if (!target) continue;
  54270. const distance = getOffsetTopDistance(target, getScrollElement(target, containerEl.value));
  54271. anchorTopList.push({
  54272. top: distance - props.offset - props.bound,
  54273. href
  54274. });
  54275. }
  54276. anchorTopList.sort((prev, next) => prev.top - next.top);
  54277. for (let i = 0; i < anchorTopList.length; i++) {
  54278. const item = anchorTopList[i];
  54279. const next = anchorTopList[i + 1];
  54280. if (i === 0 && scrollTop === 0) return props.selectScrollTop ? item.href : "";
  54281. if (item.top <= scrollTop && (!next || next.top > scrollTop)) return item.href;
  54282. }
  54283. };
  54284. const getContainer = () => {
  54285. const el = getElement(props.container);
  54286. if (!el || isWindow(el)) containerEl.value = window;
  54287. else containerEl.value = el;
  54288. };
  54289. useEventListener(containerEl, "scroll", handleScroll);
  54290. const updateMarkerStyle = () => {
  54291. nextTick(() => {
  54292. if (!anchorRef.value || !markerRef.value || !currentAnchor.value) {
  54293. markerStyle.value = {};
  54294. return;
  54295. }
  54296. const currentLinkEl = links[currentAnchor.value];
  54297. if (!currentLinkEl) {
  54298. markerStyle.value = {};
  54299. return;
  54300. }
  54301. const anchorRect = anchorRef.value.getBoundingClientRect();
  54302. const markerRect = markerRef.value.getBoundingClientRect();
  54303. const linkRect = currentLinkEl.getBoundingClientRect();
  54304. if (props.direction === "horizontal") markerStyle.value = {
  54305. left: `${linkRect.left - anchorRect.left}px`,
  54306. width: `${linkRect.width}px`,
  54307. opacity: 1
  54308. };
  54309. else markerStyle.value = {
  54310. top: `${linkRect.top - anchorRect.top + (linkRect.height - markerRect.height) / 2}px`,
  54311. opacity: 1
  54312. };
  54313. });
  54314. };
  54315. watch(currentAnchor, updateMarkerStyle);
  54316. watch(() => slots.default?.(), updateMarkerStyle);
  54317. onMounted(() => {
  54318. getContainer();
  54319. const hash = decodeURIComponent(window.location.hash);
  54320. if (getElement(hash)) scrollTo(hash);
  54321. else handleScroll();
  54322. });
  54323. watch(() => props.container, () => {
  54324. getContainer();
  54325. });
  54326. provide(anchorKey, {
  54327. ns,
  54328. direction: props.direction,
  54329. currentAnchor,
  54330. addLink,
  54331. removeLink,
  54332. handleClick
  54333. });
  54334. __expose({ scrollTo });
  54335. return (_ctx, _cache) => {
  54336. return openBlock(), createElementBlock("div", {
  54337. ref_key: "anchorRef",
  54338. ref: anchorRef,
  54339. class: normalizeClass(cls.value)
  54340. }, [__props.marker ? (openBlock(), createElementBlock("div", {
  54341. key: 0,
  54342. ref_key: "markerRef",
  54343. ref: markerRef,
  54344. class: normalizeClass(unref(ns).e("marker")),
  54345. style: normalizeStyle(markerStyle.value)
  54346. }, null, 6)) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("list")) }, [renderSlot(_ctx.$slots, "default")], 2)], 2);
  54347. };
  54348. }
  54349. });
  54350. //#endregion
  54351. //#region ../../packages/components/anchor/src/anchor.vue
  54352. var anchor_default = anchor_vue_vue_type_script_setup_true_lang_default;
  54353. //#endregion
  54354. //#region ../../packages/components/anchor/src/anchor-link.ts
  54355. /**
  54356. * @deprecated Removed after 3.0.0, Use `AnchorLinkProps` instead.
  54357. */
  54358. const anchorLinkProps = buildProps({
  54359. title: String,
  54360. href: String
  54361. });
  54362. //#endregion
  54363. //#region ../../packages/components/anchor/src/anchor-link.vue?vue&type=script&setup=true&lang.ts
  54364. const _hoisted_1$5 = ["href"];
  54365. var anchor_link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54366. name: "ElAnchorLink",
  54367. __name: "anchor-link",
  54368. props: anchorLinkProps,
  54369. setup(__props) {
  54370. const props = __props;
  54371. const linkRef = ref(null);
  54372. const { ns, direction, currentAnchor, addLink, removeLink, handleClick: contextHandleClick } = inject(anchorKey);
  54373. const cls = computed(() => [ns.e("link"), ns.is("active", currentAnchor.value === props.href)]);
  54374. const handleClick = (e) => {
  54375. contextHandleClick(e, props.href);
  54376. };
  54377. watch(() => props.href, (val, oldVal) => {
  54378. nextTick(() => {
  54379. if (oldVal) removeLink(oldVal);
  54380. if (val) addLink({
  54381. href: val,
  54382. el: linkRef.value
  54383. });
  54384. });
  54385. });
  54386. onMounted(() => {
  54387. const { href } = props;
  54388. if (href) addLink({
  54389. href,
  54390. el: linkRef.value
  54391. });
  54392. });
  54393. onBeforeUnmount(() => {
  54394. const { href } = props;
  54395. if (href) removeLink(href);
  54396. });
  54397. return (_ctx, _cache) => {
  54398. return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).e("item")) }, [createElementVNode("a", {
  54399. ref_key: "linkRef",
  54400. ref: linkRef,
  54401. class: normalizeClass(cls.value),
  54402. href: __props.href,
  54403. onClick: handleClick
  54404. }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])], 10, _hoisted_1$5), _ctx.$slots["sub-link"] && unref(direction) === "vertical" ? (openBlock(), createElementBlock("div", {
  54405. key: 0,
  54406. class: normalizeClass(unref(ns).e("list"))
  54407. }, [renderSlot(_ctx.$slots, "sub-link")], 2)) : createCommentVNode("v-if", true)], 2);
  54408. };
  54409. }
  54410. });
  54411. //#endregion
  54412. //#region ../../packages/components/anchor/src/anchor-link.vue
  54413. var anchor_link_default = anchor_link_vue_vue_type_script_setup_true_lang_default;
  54414. //#endregion
  54415. //#region ../../packages/components/anchor/index.ts
  54416. const ElAnchor = withInstall(anchor_default, { AnchorLink: anchor_link_default });
  54417. const ElAnchorLink = withNoopInstall(anchor_link_default);
  54418. //#endregion
  54419. //#region ../../packages/components/segmented/src/segmented.ts
  54420. const defaultProps = {
  54421. label: "label",
  54422. value: "value",
  54423. disabled: "disabled"
  54424. };
  54425. /**
  54426. * @deprecated Removed after 3.0.0, Use `SegmentedProps` instead.
  54427. */
  54428. const segmentedProps = buildProps({
  54429. direction: {
  54430. type: definePropType(String),
  54431. default: "horizontal"
  54432. },
  54433. options: {
  54434. type: definePropType(Array),
  54435. default: () => []
  54436. },
  54437. modelValue: {
  54438. type: [
  54439. String,
  54440. Number,
  54441. Boolean
  54442. ],
  54443. default: void 0
  54444. },
  54445. props: {
  54446. type: definePropType(Object),
  54447. default: () => defaultProps
  54448. },
  54449. block: Boolean,
  54450. size: useSizeProp,
  54451. disabled: {
  54452. type: Boolean,
  54453. default: void 0
  54454. },
  54455. validateEvent: {
  54456. type: Boolean,
  54457. default: true
  54458. },
  54459. id: String,
  54460. name: String,
  54461. ...useAriaProps(["ariaLabel"])
  54462. });
  54463. const segmentedEmits = {
  54464. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  54465. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  54466. };
  54467. //#endregion
  54468. //#region ../../packages/components/segmented/src/segmented.vue?vue&type=script&setup=true&lang.ts
  54469. const _hoisted_1$4 = [
  54470. "id",
  54471. "aria-label",
  54472. "aria-labelledby"
  54473. ];
  54474. const _hoisted_2$3 = [
  54475. "name",
  54476. "disabled",
  54477. "checked",
  54478. "onChange"
  54479. ];
  54480. var segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54481. name: "ElSegmented",
  54482. __name: "segmented",
  54483. props: segmentedProps,
  54484. emits: segmentedEmits,
  54485. setup(__props, { emit: __emit }) {
  54486. const props = __props;
  54487. const emit = __emit;
  54488. const ns = useNamespace("segmented");
  54489. const segmentedId = useId();
  54490. const segmentedSize = useFormSize();
  54491. const _disabled = useFormDisabled();
  54492. const { formItem } = useFormItem();
  54493. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  54494. const segmentedRef = ref(null);
  54495. const activeElement = useActiveElement();
  54496. const state = reactive({
  54497. isInit: false,
  54498. width: 0,
  54499. height: 0,
  54500. translateX: 0,
  54501. translateY: 0,
  54502. focusVisible: false
  54503. });
  54504. const handleChange = (evt, item) => {
  54505. const value = getValue(item);
  54506. emit(UPDATE_MODEL_EVENT, value);
  54507. emit(CHANGE_EVENT, value);
  54508. evt.target.checked = value === props.modelValue;
  54509. };
  54510. const aliasProps = computed(() => ({
  54511. ...defaultProps,
  54512. ...props.props
  54513. }));
  54514. const intoAny = (item) => item;
  54515. const getValue = (item) => {
  54516. return isObject$1(item) ? item[aliasProps.value.value] : item;
  54517. };
  54518. const getLabel = (item) => {
  54519. return isObject$1(item) ? item[aliasProps.value.label] : item;
  54520. };
  54521. const getDisabled = (item) => {
  54522. return !!(_disabled.value || (isObject$1(item) ? item[aliasProps.value.disabled] : false));
  54523. };
  54524. const getSelected = (item) => {
  54525. return props.modelValue === getValue(item);
  54526. };
  54527. const getOption = (value) => {
  54528. return props.options.find((item) => getValue(item) === value);
  54529. };
  54530. const getItemCls = (item) => {
  54531. return [
  54532. ns.e("item"),
  54533. ns.is("selected", getSelected(item)),
  54534. ns.is("disabled", getDisabled(item))
  54535. ];
  54536. };
  54537. const updateSelect = () => {
  54538. if (!segmentedRef.value) return;
  54539. const selectedItem = segmentedRef.value.querySelector(".is-selected");
  54540. const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
  54541. if (!selectedItem || !selectedItemInput) {
  54542. state.width = 0;
  54543. state.height = 0;
  54544. state.translateX = 0;
  54545. state.translateY = 0;
  54546. state.focusVisible = false;
  54547. return;
  54548. }
  54549. state.isInit = true;
  54550. if (props.direction === "vertical") {
  54551. state.height = selectedItem.offsetHeight;
  54552. state.translateY = selectedItem.offsetTop;
  54553. } else {
  54554. state.width = selectedItem.offsetWidth;
  54555. state.translateX = selectedItem.offsetLeft;
  54556. }
  54557. try {
  54558. state.focusVisible = selectedItemInput.matches(":focus-visible");
  54559. } catch {}
  54560. };
  54561. const segmentedCls = computed(() => [
  54562. ns.b(),
  54563. ns.m(segmentedSize.value),
  54564. ns.is("block", props.block)
  54565. ]);
  54566. const selectedStyle = computed(() => ({
  54567. width: props.direction === "vertical" ? "100%" : `${state.width}px`,
  54568. height: props.direction === "vertical" ? `${state.height}px` : "100%",
  54569. transform: props.direction === "vertical" ? `translateY(${state.translateY}px)` : `translateX(${state.translateX}px)`,
  54570. display: state.isInit ? "block" : "none"
  54571. }));
  54572. const selectedCls = computed(() => [
  54573. ns.e("item-selected"),
  54574. ns.is("disabled", getDisabled(getOption(props.modelValue))),
  54575. ns.is("focus-visible", state.focusVisible)
  54576. ]);
  54577. const name = computed(() => {
  54578. return props.name || segmentedId.value;
  54579. });
  54580. useResizeObserver(segmentedRef, updateSelect);
  54581. watch(activeElement, updateSelect);
  54582. watch(() => props.modelValue, () => {
  54583. updateSelect();
  54584. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  54585. }, { flush: "post" });
  54586. return (_ctx, _cache) => {
  54587. return __props.options.length ? (openBlock(), createElementBlock("div", {
  54588. key: 0,
  54589. id: unref(inputId),
  54590. ref_key: "segmentedRef",
  54591. ref: segmentedRef,
  54592. class: normalizeClass(segmentedCls.value),
  54593. role: "radiogroup",
  54594. "aria-label": !unref(isLabeledByFormItem) ? __props.ariaLabel || "segmented" : void 0,
  54595. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
  54596. }, [createElementVNode("div", { class: normalizeClass([unref(ns).e("group"), unref(ns).m(__props.direction)]) }, [createElementVNode("div", {
  54597. style: normalizeStyle(selectedStyle.value),
  54598. class: normalizeClass(selectedCls.value)
  54599. }, null, 6), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
  54600. return openBlock(), createElementBlock("label", {
  54601. key: index,
  54602. class: normalizeClass(getItemCls(item))
  54603. }, [createElementVNode("input", {
  54604. class: normalizeClass(unref(ns).e("item-input")),
  54605. type: "radio",
  54606. name: name.value,
  54607. disabled: getDisabled(item),
  54608. checked: getSelected(item),
  54609. onChange: ($event) => handleChange($event, item)
  54610. }, null, 42, _hoisted_2$3), createElementVNode("div", { class: normalizeClass(unref(ns).e("item-label")) }, [renderSlot(_ctx.$slots, "default", { item: intoAny(item) }, () => [createTextVNode(toDisplayString(getLabel(item)), 1)])], 2)], 2);
  54611. }), 128))], 2)], 10, _hoisted_1$4)) : createCommentVNode("v-if", true);
  54612. };
  54613. }
  54614. });
  54615. //#endregion
  54616. //#region ../../packages/components/segmented/src/segmented.vue
  54617. var segmented_default = segmented_vue_vue_type_script_setup_true_lang_default;
  54618. //#endregion
  54619. //#region ../../packages/components/segmented/index.ts
  54620. const ElSegmented = withInstall(segmented_default);
  54621. //#endregion
  54622. //#region ../../packages/components/mention/src/helper.ts
  54623. const filterOption = (pattern, option) => {
  54624. const lowerCase = pattern.toLowerCase();
  54625. return (option.label || option.value || "").toLowerCase().includes(lowerCase);
  54626. };
  54627. const getMentionCtx = (inputEl, prefix, split) => {
  54628. const { selectionEnd } = inputEl;
  54629. if (selectionEnd === null) return;
  54630. const inputValue = inputEl.value;
  54631. const prefixArray = castArray$1(prefix);
  54632. let splitIndex = -1;
  54633. let mentionCtx;
  54634. for (let i = selectionEnd - 1; i >= 0; --i) {
  54635. const char = inputValue[i];
  54636. if (char === split || char === "\n" || char === "\r") {
  54637. splitIndex = i;
  54638. continue;
  54639. }
  54640. if (prefixArray.includes(char)) {
  54641. const end = splitIndex === -1 ? selectionEnd : splitIndex;
  54642. mentionCtx = {
  54643. pattern: inputValue.slice(i + 1, end),
  54644. start: i + 1,
  54645. end,
  54646. prefix: char,
  54647. prefixIndex: i,
  54648. splitIndex,
  54649. selectionEnd
  54650. };
  54651. break;
  54652. }
  54653. }
  54654. return mentionCtx;
  54655. };
  54656. /**
  54657. * fork from textarea-caret-position
  54658. * https://github.com/component/textarea-caret-position
  54659. * The MIT License (MIT)
  54660. * Copyright (c) 2015 Jonathan Ong me@jongleberry.com
  54661. * Permission is hereby granted, free of charge, to any person obtaining a copy
  54662. * of this software and associated documentation files (the "Software"), to deal
  54663. * in the Software without restriction, including without limitation the rights
  54664. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  54665. * copies of the Software, and to permit persons to whom the Software is
  54666. * furnished to do so, subject to the following conditions:
  54667. * The above copyright notice and this permission notice shall be included in all
  54668. * copies or substantial portions of the Software.
  54669. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  54670. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  54671. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  54672. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  54673. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  54674. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  54675. * SOFTWARE.
  54676. */
  54677. const getCursorPosition = (element, options = {
  54678. debug: false,
  54679. useSelectionEnd: false
  54680. }) => {
  54681. const selectionStart = element.selectionStart !== null ? element.selectionStart : 0;
  54682. const selectionEnd = element.selectionEnd !== null ? element.selectionEnd : 0;
  54683. const position = options.useSelectionEnd ? selectionEnd : selectionStart;
  54684. const properties = [
  54685. "direction",
  54686. "boxSizing",
  54687. "width",
  54688. "height",
  54689. "overflowX",
  54690. "overflowY",
  54691. "borderTopWidth",
  54692. "borderRightWidth",
  54693. "borderBottomWidth",
  54694. "borderLeftWidth",
  54695. "borderStyle",
  54696. "paddingTop",
  54697. "paddingRight",
  54698. "paddingBottom",
  54699. "paddingLeft",
  54700. "fontStyle",
  54701. "fontVariant",
  54702. "fontWeight",
  54703. "fontStretch",
  54704. "fontSize",
  54705. "fontSizeAdjust",
  54706. "lineHeight",
  54707. "fontFamily",
  54708. "textAlign",
  54709. "textTransform",
  54710. "textIndent",
  54711. "textDecoration",
  54712. "letterSpacing",
  54713. "wordSpacing",
  54714. "tabSize",
  54715. "MozTabSize"
  54716. ];
  54717. if (options.debug) {
  54718. const el = document.querySelector("#input-textarea-caret-position-mirror-div");
  54719. if (el?.parentNode) el.parentNode.removeChild(el);
  54720. }
  54721. const div = document.createElement("div");
  54722. div.id = "input-textarea-caret-position-mirror-div";
  54723. document.body.appendChild(div);
  54724. const style = div.style;
  54725. const computed = window.getComputedStyle(element);
  54726. const isInput = element.nodeName === "INPUT";
  54727. style.whiteSpace = isInput ? "nowrap" : "pre-wrap";
  54728. if (!isInput) style.wordWrap = "break-word";
  54729. style.position = "absolute";
  54730. if (!options.debug) style.visibility = "hidden";
  54731. properties.forEach((prop) => {
  54732. if (isInput && prop === "lineHeight") if (computed.boxSizing === "border-box") {
  54733. const height = Number.parseInt(computed.height);
  54734. const outerHeight = Number.parseInt(computed.paddingTop) + Number.parseInt(computed.paddingBottom) + Number.parseInt(computed.borderTopWidth) + Number.parseInt(computed.borderBottomWidth);
  54735. const targetHeight = outerHeight + Number.parseInt(computed.lineHeight);
  54736. if (height > targetHeight) style.lineHeight = `${height - outerHeight}px`;
  54737. else if (height === targetHeight) style.lineHeight = computed.lineHeight;
  54738. else style.lineHeight = "0";
  54739. } else style.lineHeight = computed.height;
  54740. else style[prop] = computed[prop];
  54741. });
  54742. if (isFirefox()) {
  54743. if (element.scrollHeight > Number.parseInt(computed.height)) style.overflowY = "scroll";
  54744. } else style.overflow = "hidden";
  54745. div.textContent = element.value.slice(0, Math.max(0, position));
  54746. if (isInput && div.textContent) div.textContent = div.textContent.replace(/\s/g, "\xA0");
  54747. const span = document.createElement("span");
  54748. span.textContent = element.value.slice(Math.max(0, position)) || ".";
  54749. span.style.position = "relative";
  54750. span.style.left = `${-element.scrollLeft}px`;
  54751. span.style.top = `${-element.scrollTop}px`;
  54752. div.appendChild(span);
  54753. const relativePosition = {
  54754. top: span.offsetTop + Number.parseInt(computed.borderTopWidth),
  54755. left: span.offsetLeft + Number.parseInt(computed.borderLeftWidth),
  54756. height: Number.parseInt(computed.fontSize) * 1.5
  54757. };
  54758. if (options.debug) span.style.backgroundColor = "#aaa";
  54759. else document.body.removeChild(div);
  54760. if (relativePosition.left >= element.clientWidth) relativePosition.left = element.clientWidth;
  54761. return relativePosition;
  54762. };
  54763. //#endregion
  54764. //#region ../../packages/components/mention/src/mention.ts
  54765. /**
  54766. * @deprecated Removed after 3.0.0, Use `MentionProps` instead.
  54767. */
  54768. const mentionProps = buildProps({
  54769. ...inputProps,
  54770. options: {
  54771. type: definePropType(Array),
  54772. default: () => []
  54773. },
  54774. prefix: {
  54775. type: definePropType([String, Array]),
  54776. default: "@",
  54777. validator: (val) => {
  54778. if (isString(val)) return val.length === 1;
  54779. return val.every((v) => isString(v) && v.length === 1);
  54780. }
  54781. },
  54782. split: {
  54783. type: String,
  54784. default: " ",
  54785. validator: (val) => val.length === 1
  54786. },
  54787. filterOption: {
  54788. type: definePropType([Boolean, Function]),
  54789. default: () => filterOption,
  54790. validator: (val) => {
  54791. if (val === false) return true;
  54792. return isFunction$1(val);
  54793. }
  54794. },
  54795. placement: {
  54796. type: definePropType(String),
  54797. default: "bottom"
  54798. },
  54799. showArrow: Boolean,
  54800. offset: {
  54801. type: Number,
  54802. default: 0
  54803. },
  54804. whole: Boolean,
  54805. checkIsWhole: { type: definePropType(Function) },
  54806. modelValue: String,
  54807. loading: Boolean,
  54808. popperClass: useTooltipContentProps.popperClass,
  54809. popperStyle: useTooltipContentProps.popperStyle,
  54810. popperOptions: {
  54811. type: definePropType(Object),
  54812. default: () => ({})
  54813. },
  54814. props: {
  54815. type: definePropType(Object),
  54816. default: () => mentionDefaultProps
  54817. }
  54818. });
  54819. const mentionEmits = {
  54820. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  54821. "whole-remove": (pattern, prefix) => isString(pattern) && isString(prefix),
  54822. input: (value) => isString(value),
  54823. search: (pattern, prefix) => isString(pattern) && isString(prefix),
  54824. select: (option, prefix) => isObject$1(option) && isString(prefix),
  54825. focus: (evt) => evt instanceof FocusEvent,
  54826. blur: (evt) => evt instanceof FocusEvent
  54827. };
  54828. const mentionDefaultProps = {
  54829. value: "value",
  54830. label: "label",
  54831. disabled: "disabled"
  54832. };
  54833. //#endregion
  54834. //#region ../../packages/components/mention/src/mention-dropdown.ts
  54835. /**
  54836. * @deprecated Removed after 3.0.0, Use `MentionDropdownProps` instead.
  54837. */
  54838. const mentionDropdownProps = buildProps({
  54839. options: {
  54840. type: definePropType(Array),
  54841. default: () => []
  54842. },
  54843. loading: Boolean,
  54844. disabled: Boolean,
  54845. contentId: String,
  54846. ariaLabel: String
  54847. });
  54848. const mentionDropdownEmits = { select: (option) => isString(option.value) };
  54849. //#endregion
  54850. //#region ../../packages/components/mention/src/mention-dropdown.vue?vue&type=script&setup=true&lang.ts
  54851. const _hoisted_1$3 = [
  54852. "id",
  54853. "aria-disabled",
  54854. "aria-selected",
  54855. "onMousemove",
  54856. "onClick"
  54857. ];
  54858. var mention_dropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54859. name: "ElMentionDropdown",
  54860. __name: "mention-dropdown",
  54861. props: mentionDropdownProps,
  54862. emits: mentionDropdownEmits,
  54863. setup(__props, { expose: __expose, emit: __emit }) {
  54864. const props = __props;
  54865. const emit = __emit;
  54866. const ns = useNamespace("mention");
  54867. const { t } = useLocale();
  54868. const hoveringIndex = ref(-1);
  54869. const scrollbarRef = ref();
  54870. const optionRefs = ref();
  54871. const dropdownRef = ref();
  54872. const optionkls = (item, index) => [
  54873. ns.be("dropdown", "item"),
  54874. ns.is("hovering", hoveringIndex.value === index),
  54875. ns.is("disabled", item.disabled || props.disabled)
  54876. ];
  54877. const handleSelect = (item) => {
  54878. if (item.disabled || props.disabled) return;
  54879. emit("select", item);
  54880. };
  54881. const handleMouseEnter = (index) => {
  54882. hoveringIndex.value = index;
  54883. };
  54884. const filteredAllDisabled = computed(() => props.disabled || props.options.every((item) => item.disabled));
  54885. const hoverOption = computed(() => props.options[hoveringIndex.value]);
  54886. const selectHoverOption = () => {
  54887. if (!hoverOption.value || hoverOption.value.disabled || props.disabled) return;
  54888. emit("select", hoverOption.value);
  54889. };
  54890. const navigateOptions = (direction) => {
  54891. const { options } = props;
  54892. if (options.length === 0 || filteredAllDisabled.value) return;
  54893. if (direction === "next") {
  54894. hoveringIndex.value++;
  54895. if (hoveringIndex.value === options.length) hoveringIndex.value = 0;
  54896. } else if (direction === "prev") {
  54897. hoveringIndex.value--;
  54898. if (hoveringIndex.value < 0) hoveringIndex.value = options.length - 1;
  54899. }
  54900. const option = options[hoveringIndex.value];
  54901. if (option.disabled) {
  54902. navigateOptions(direction);
  54903. return;
  54904. }
  54905. nextTick(() => scrollToOption(option));
  54906. };
  54907. const scrollToOption = (option) => {
  54908. const { options } = props;
  54909. const index = options.findIndex((item) => item.value === option.value);
  54910. const target = optionRefs.value?.[index];
  54911. if (target) {
  54912. const menu = dropdownRef.value?.querySelector?.(`.${ns.be("dropdown", "wrap")}`);
  54913. if (menu) scrollIntoView(menu, target);
  54914. }
  54915. scrollbarRef.value?.handleScroll();
  54916. };
  54917. const resetHoveringIndex = () => {
  54918. if (filteredAllDisabled.value || props.options.length === 0) hoveringIndex.value = -1;
  54919. else hoveringIndex.value = props.options.findIndex((item) => !item.disabled);
  54920. };
  54921. watch(() => props.options, resetHoveringIndex, { immediate: true });
  54922. __expose({
  54923. hoveringIndex,
  54924. navigateOptions,
  54925. selectHoverOption,
  54926. hoverOption
  54927. });
  54928. return (_ctx, _cache) => {
  54929. return openBlock(), createElementBlock("div", {
  54930. ref_key: "dropdownRef",
  54931. ref: dropdownRef,
  54932. class: normalizeClass(unref(ns).b("dropdown"))
  54933. }, [
  54934. _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
  54935. key: 0,
  54936. class: normalizeClass(unref(ns).be("dropdown", "header"))
  54937. }, [renderSlot(_ctx.$slots, "header")], 2)) : createCommentVNode("v-if", true),
  54938. withDirectives(createVNode(unref(ElScrollbar), {
  54939. id: __props.contentId,
  54940. ref_key: "scrollbarRef",
  54941. ref: scrollbarRef,
  54942. tag: "ul",
  54943. "wrap-class": unref(ns).be("dropdown", "wrap"),
  54944. "view-class": unref(ns).be("dropdown", "list"),
  54945. role: "listbox",
  54946. "aria-label": __props.ariaLabel,
  54947. "aria-orientation": "vertical"
  54948. }, {
  54949. default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
  54950. return openBlock(), createElementBlock("li", {
  54951. id: `${__props.contentId}-${index}`,
  54952. ref_for: true,
  54953. ref_key: "optionRefs",
  54954. ref: optionRefs,
  54955. key: index,
  54956. class: normalizeClass(optionkls(item, index)),
  54957. role: "option",
  54958. "aria-disabled": item.disabled || __props.disabled || void 0,
  54959. "aria-selected": hoveringIndex.value === index,
  54960. onMousemove: ($event) => handleMouseEnter(index),
  54961. onClick: withModifiers(($event) => handleSelect(item), ["stop"])
  54962. }, [renderSlot(_ctx.$slots, "label", {
  54963. item,
  54964. index
  54965. }, () => [createElementVNode("span", null, toDisplayString(item.label ?? item.value), 1)])], 42, _hoisted_1$3);
  54966. }), 128))]),
  54967. _: 3
  54968. }, 8, [
  54969. "id",
  54970. "wrap-class",
  54971. "view-class",
  54972. "aria-label"
  54973. ]), [[vShow, __props.options.length > 0 && !__props.loading]]),
  54974. __props.loading ? (openBlock(), createElementBlock("div", {
  54975. key: 1,
  54976. class: normalizeClass(unref(ns).be("dropdown", "loading"))
  54977. }, [renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)])], 2)) : createCommentVNode("v-if", true),
  54978. _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
  54979. key: 2,
  54980. class: normalizeClass(unref(ns).be("dropdown", "footer"))
  54981. }, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
  54982. ], 2);
  54983. };
  54984. }
  54985. });
  54986. //#endregion
  54987. //#region ../../packages/components/mention/src/mention-dropdown.vue
  54988. var mention_dropdown_default = mention_dropdown_vue_vue_type_script_setup_true_lang_default;
  54989. //#endregion
  54990. //#region ../../packages/components/mention/src/mention.vue?vue&type=script&setup=true&lang.ts
  54991. var mention_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  54992. name: "ElMention",
  54993. inheritAttrs: false,
  54994. __name: "mention",
  54995. props: mentionProps,
  54996. emits: mentionEmits,
  54997. setup(__props, { expose: __expose, emit: __emit }) {
  54998. const props = __props;
  54999. const emit = __emit;
  55000. const passInputProps = computed(() => pick(props, Object.keys(inputProps)));
  55001. const ns = useNamespace("mention");
  55002. const disabled = useFormDisabled();
  55003. const contentId = useId();
  55004. const elInputRef = ref();
  55005. const tooltipRef = ref();
  55006. const dropdownRef = ref();
  55007. const visible = ref(false);
  55008. const cursorStyle = ref();
  55009. const mentionCtx = ref();
  55010. const computedPlacement = computed(() => props.showArrow ? props.placement : `${props.placement}-start`);
  55011. const computedFallbackPlacements = computed(() => props.showArrow ? ["bottom", "top"] : ["bottom-start", "top-start"]);
  55012. const aliasProps = computed(() => ({
  55013. ...mentionDefaultProps,
  55014. ...props.props
  55015. }));
  55016. const mapOption = (option) => {
  55017. const base = {
  55018. label: option[aliasProps.value.label],
  55019. value: option[aliasProps.value.value],
  55020. disabled: option[aliasProps.value.disabled]
  55021. };
  55022. return {
  55023. ...option,
  55024. ...base
  55025. };
  55026. };
  55027. const options = computed(() => props.options.map(mapOption));
  55028. const filteredOptions = computed(() => {
  55029. const { filterOption } = props;
  55030. if (!mentionCtx.value || !filterOption) return options.value;
  55031. return options.value.filter((option) => filterOption(mentionCtx.value.pattern, option));
  55032. });
  55033. const dropdownVisible = computed(() => {
  55034. return visible.value && (!!filteredOptions.value.length || props.loading);
  55035. });
  55036. const hoveringId = computed(() => {
  55037. return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`;
  55038. });
  55039. const handleInputChange = (value) => {
  55040. emit(UPDATE_MODEL_EVENT, value);
  55041. emit(INPUT_EVENT, value);
  55042. syncAfterCursorMove();
  55043. };
  55044. const handleInputKeyDown = (event) => {
  55045. if (elInputRef.value?.isComposing) return;
  55046. const code = getEventCode(event);
  55047. switch (code) {
  55048. case EVENT_CODE.left:
  55049. case EVENT_CODE.right:
  55050. syncAfterCursorMove();
  55051. break;
  55052. case EVENT_CODE.up:
  55053. case EVENT_CODE.down:
  55054. if (!visible.value) return;
  55055. event.preventDefault();
  55056. dropdownRef.value?.navigateOptions(code === EVENT_CODE.up ? "prev" : "next");
  55057. break;
  55058. case EVENT_CODE.enter:
  55059. case EVENT_CODE.numpadEnter:
  55060. if (!visible.value) {
  55061. props.type !== "textarea" && syncAfterCursorMove();
  55062. return;
  55063. }
  55064. event.preventDefault();
  55065. if (dropdownRef.value?.hoverOption) dropdownRef.value?.selectHoverOption();
  55066. else visible.value = false;
  55067. break;
  55068. case EVENT_CODE.esc:
  55069. if (!visible.value) return;
  55070. event.preventDefault();
  55071. visible.value = false;
  55072. break;
  55073. case EVENT_CODE.backspace: if (props.whole && mentionCtx.value) {
  55074. const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } = mentionCtx.value;
  55075. const inputEl = getInputEl();
  55076. if (!inputEl) return;
  55077. const inputValue = inputEl.value;
  55078. const matchOption = options.value.find((item) => item.value === pattern);
  55079. if ((isFunction$1(props.checkIsWhole) ? props.checkIsWhole(pattern, prefix) : matchOption) && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {
  55080. event.preventDefault();
  55081. const newValue = inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1);
  55082. emit(UPDATE_MODEL_EVENT, newValue);
  55083. emit(INPUT_EVENT, newValue);
  55084. emit("whole-remove", pattern, prefix);
  55085. const newSelectionEnd = prefixIndex;
  55086. nextTick(() => {
  55087. inputEl.selectionStart = newSelectionEnd;
  55088. inputEl.selectionEnd = newSelectionEnd;
  55089. syncDropdownVisible();
  55090. });
  55091. }
  55092. }
  55093. }
  55094. };
  55095. const { wrapperRef } = useFocusController(elInputRef, {
  55096. disabled,
  55097. afterFocus() {
  55098. syncAfterCursorMove();
  55099. },
  55100. beforeBlur(event) {
  55101. return tooltipRef.value?.isFocusInsideContent(event);
  55102. },
  55103. afterBlur() {
  55104. visible.value = false;
  55105. }
  55106. });
  55107. const handleInputMouseDown = () => {
  55108. syncAfterCursorMove();
  55109. };
  55110. const getOriginalOption = (mentionOption) => {
  55111. return props.options.find((option) => {
  55112. return mentionOption.value === option[aliasProps.value.value];
  55113. });
  55114. };
  55115. const handleSelect = (item) => {
  55116. if (!mentionCtx.value) return;
  55117. const inputEl = getInputEl();
  55118. if (!inputEl) return;
  55119. const inputValue = inputEl.value;
  55120. const { split } = props;
  55121. const newEndPart = inputValue.slice(mentionCtx.value.end);
  55122. const alreadySeparated = newEndPart.startsWith(split);
  55123. const newMiddlePart = `${item.value}${alreadySeparated ? "" : split}`;
  55124. const newValue = inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart;
  55125. emit(UPDATE_MODEL_EVENT, newValue);
  55126. emit(INPUT_EVENT, newValue);
  55127. emit("select", getOriginalOption(item), mentionCtx.value.prefix);
  55128. const newSelectionEnd = mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0);
  55129. nextTick(() => {
  55130. inputEl.selectionStart = newSelectionEnd;
  55131. inputEl.selectionEnd = newSelectionEnd;
  55132. inputEl.focus();
  55133. syncDropdownVisible();
  55134. });
  55135. };
  55136. const getInputEl = () => props.type === "textarea" ? elInputRef.value?.textarea : elInputRef.value?.input;
  55137. const syncAfterCursorMove = () => {
  55138. setTimeout(() => {
  55139. syncCursor();
  55140. syncDropdownVisible();
  55141. nextTick(() => tooltipRef.value?.updatePopper());
  55142. }, 0);
  55143. };
  55144. const syncCursor = () => {
  55145. const inputEl = getInputEl();
  55146. if (!inputEl) return;
  55147. const caretPosition = getCursorPosition(inputEl);
  55148. const inputRect = inputEl.getBoundingClientRect();
  55149. const wrapperRect = wrapperRef.value.getBoundingClientRect();
  55150. cursorStyle.value = {
  55151. position: "absolute",
  55152. width: 0,
  55153. height: `${caretPosition.height}px`,
  55154. left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,
  55155. top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`
  55156. };
  55157. };
  55158. const syncDropdownVisible = () => {
  55159. const inputEl = getInputEl();
  55160. if (document.activeElement !== inputEl) {
  55161. visible.value = false;
  55162. return;
  55163. }
  55164. const { prefix, split } = props;
  55165. mentionCtx.value = getMentionCtx(inputEl, prefix, split);
  55166. if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {
  55167. visible.value = true;
  55168. emit("search", mentionCtx.value.pattern, mentionCtx.value.prefix);
  55169. return;
  55170. }
  55171. visible.value = false;
  55172. };
  55173. __expose({
  55174. input: elInputRef,
  55175. tooltip: tooltipRef,
  55176. dropdownVisible
  55177. });
  55178. return (_ctx, _cache) => {
  55179. return openBlock(), createElementBlock("div", {
  55180. ref_key: "wrapperRef",
  55181. ref: wrapperRef,
  55182. class: normalizeClass(unref(ns).b())
  55183. }, [createVNode(unref(ElInput), mergeProps(mergeProps(passInputProps.value, _ctx.$attrs), {
  55184. ref_key: "elInputRef",
  55185. ref: elInputRef,
  55186. "model-value": __props.modelValue,
  55187. disabled: unref(disabled),
  55188. role: dropdownVisible.value ? "combobox" : void 0,
  55189. "aria-activedescendant": dropdownVisible.value ? hoveringId.value || "" : void 0,
  55190. "aria-controls": dropdownVisible.value ? unref(contentId) : void 0,
  55191. "aria-expanded": dropdownVisible.value || void 0,
  55192. "aria-label": __props.ariaLabel,
  55193. "aria-autocomplete": dropdownVisible.value ? "none" : void 0,
  55194. "aria-haspopup": dropdownVisible.value ? "listbox" : void 0,
  55195. onInput: handleInputChange,
  55196. onKeydown: handleInputKeyDown,
  55197. onMousedown: handleInputMouseDown
  55198. }), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
  55199. return {
  55200. name,
  55201. fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))])
  55202. };
  55203. })]), 1040, [
  55204. "model-value",
  55205. "disabled",
  55206. "role",
  55207. "aria-activedescendant",
  55208. "aria-controls",
  55209. "aria-expanded",
  55210. "aria-label",
  55211. "aria-autocomplete",
  55212. "aria-haspopup"
  55213. ]), createVNode(unref(ElTooltip), {
  55214. ref_key: "tooltipRef",
  55215. ref: tooltipRef,
  55216. visible: dropdownVisible.value,
  55217. "popper-class": [unref(ns).e("popper"), __props.popperClass],
  55218. "popper-style": __props.popperStyle,
  55219. "popper-options": __props.popperOptions,
  55220. placement: computedPlacement.value,
  55221. "fallback-placements": computedFallbackPlacements.value,
  55222. effect: "light",
  55223. pure: "",
  55224. offset: __props.offset,
  55225. "show-arrow": __props.showArrow
  55226. }, {
  55227. default: withCtx(() => [createElementVNode("div", { style: normalizeStyle(cursorStyle.value) }, null, 4)]),
  55228. content: withCtx(() => [createVNode(mention_dropdown_default, {
  55229. ref_key: "dropdownRef",
  55230. ref: dropdownRef,
  55231. options: filteredOptions.value,
  55232. disabled: unref(disabled),
  55233. loading: __props.loading,
  55234. "content-id": unref(contentId),
  55235. "aria-label": __props.ariaLabel,
  55236. onSelect: handleSelect,
  55237. onClick: _cache[0] || (_cache[0] = withModifiers(($event) => elInputRef.value?.focus(), ["stop"]))
  55238. }, createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
  55239. return {
  55240. name,
  55241. fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))])
  55242. };
  55243. })]), 1032, [
  55244. "options",
  55245. "disabled",
  55246. "loading",
  55247. "content-id",
  55248. "aria-label"
  55249. ])]),
  55250. _: 3
  55251. }, 8, [
  55252. "visible",
  55253. "popper-class",
  55254. "popper-style",
  55255. "popper-options",
  55256. "placement",
  55257. "fallback-placements",
  55258. "offset",
  55259. "show-arrow"
  55260. ])], 2);
  55261. };
  55262. }
  55263. });
  55264. //#endregion
  55265. //#region ../../packages/components/mention/src/mention.vue
  55266. var mention_default = mention_vue_vue_type_script_setup_true_lang_default;
  55267. //#endregion
  55268. //#region ../../packages/components/mention/index.ts
  55269. const ElMention = withInstall(mention_default);
  55270. //#endregion
  55271. //#region ../../packages/components/splitter/src/splitter.ts
  55272. /**
  55273. * @deprecated Removed after 3.0.0, Use `SplitterProps` instead.
  55274. */
  55275. const splitterProps = buildProps({
  55276. layout: {
  55277. type: String,
  55278. default: "horizontal",
  55279. values: ["horizontal", "vertical"]
  55280. },
  55281. lazy: Boolean
  55282. });
  55283. const splitterEmits = {
  55284. resizeStart: (index, sizes) => true,
  55285. resize: (index, sizes) => true,
  55286. resizeEnd: (index, sizes) => true,
  55287. collapse: (index, type, sizes) => true
  55288. };
  55289. //#endregion
  55290. //#region ../../packages/components/splitter/src/hooks/useContainer.ts
  55291. function useContainer(layout) {
  55292. const containerEl = ref();
  55293. const { width, height } = useElementSize(containerEl);
  55294. return {
  55295. containerEl,
  55296. containerSize: computed(() => {
  55297. return layout.value === "horizontal" ? width.value : height.value;
  55298. })
  55299. };
  55300. }
  55301. //#endregion
  55302. //#region ../../packages/components/splitter/src/hooks/useSize.ts
  55303. function getPct(str) {
  55304. return Number(str.slice(0, -1)) / 100;
  55305. }
  55306. function getPx(str) {
  55307. return Number(str.slice(0, -2));
  55308. }
  55309. function isPct(itemSize) {
  55310. return isString(itemSize) && itemSize.endsWith("%");
  55311. }
  55312. function isPx(itemSize) {
  55313. return isString(itemSize) && itemSize.endsWith("px");
  55314. }
  55315. function useSize$1(panels, containerSize) {
  55316. const propSizes = computed(() => panels.value.map((i) => i.size));
  55317. const panelCounts = computed(() => panels.value.length);
  55318. const percentSizes = ref([]);
  55319. watch([
  55320. propSizes,
  55321. panelCounts,
  55322. containerSize
  55323. ], () => {
  55324. let ptgList = [];
  55325. let emptyCount = 0;
  55326. for (let i = 0; i < panelCounts.value; i += 1) {
  55327. const itemSize = panels.value[i]?.size;
  55328. if (isPct(itemSize)) ptgList[i] = getPct(itemSize);
  55329. else if (isPx(itemSize)) ptgList[i] = getPx(itemSize) / containerSize.value;
  55330. else if (itemSize || itemSize === 0) {
  55331. const num = Number(itemSize);
  55332. if (!Number.isNaN(num)) ptgList[i] = num / containerSize.value;
  55333. } else {
  55334. emptyCount += 1;
  55335. ptgList[i] = void 0;
  55336. }
  55337. }
  55338. const totalPtg = ptgList.reduce((acc, ptg) => acc + (ptg || 0), 0);
  55339. if (totalPtg > 1 || !emptyCount) {
  55340. const scale = 1 / totalPtg;
  55341. ptgList = ptgList.map((ptg) => ptg === void 0 ? 0 : ptg * scale);
  55342. } else {
  55343. const avgRest = (1 - totalPtg) / emptyCount;
  55344. ptgList = ptgList.map((ptg) => ptg === void 0 ? avgRest : ptg);
  55345. }
  55346. percentSizes.value = ptgList;
  55347. });
  55348. const ptg2px = (ptg) => ptg * containerSize.value;
  55349. return {
  55350. percentSizes,
  55351. pxSizes: computed(() => percentSizes.value.map(ptg2px))
  55352. };
  55353. }
  55354. //#endregion
  55355. //#region ../../packages/components/splitter/src/hooks/useResize.ts
  55356. function useResize(panels, containerSize, pxSizes, lazy) {
  55357. const ptg2px = (ptg) => ptg * containerSize.value || 0;
  55358. function getLimitSize(str, defaultLimit) {
  55359. if (isPct(str)) return ptg2px(getPct(str));
  55360. else if (isPx(str)) return getPx(str);
  55361. return str ?? defaultLimit;
  55362. }
  55363. const lazyOffset = ref(0);
  55364. const movingIndex = ref(null);
  55365. let cachePxSizes = [];
  55366. let updatePanelSizes = NOOP;
  55367. const limitSizes = computed(() => panels.value.map((item) => [item.min, item.max]));
  55368. watch(lazy, () => {
  55369. if (lazyOffset.value) {
  55370. const mouseup = new MouseEvent("mouseup", { bubbles: true });
  55371. window.dispatchEvent(mouseup);
  55372. }
  55373. });
  55374. const onMoveStart = (index) => {
  55375. lazyOffset.value = 0;
  55376. movingIndex.value = {
  55377. index,
  55378. confirmed: false
  55379. };
  55380. cachePxSizes = pxSizes.value;
  55381. };
  55382. const onMoving = (index, offset) => {
  55383. let confirmedIndex = null;
  55384. if ((!movingIndex.value || !movingIndex.value.confirmed) && offset !== 0) {
  55385. if (offset > 0) {
  55386. confirmedIndex = index;
  55387. movingIndex.value = {
  55388. index,
  55389. confirmed: true
  55390. };
  55391. } else for (let i = index; i >= 0; i -= 1) if (cachePxSizes[i] > 0) {
  55392. confirmedIndex = i;
  55393. movingIndex.value = {
  55394. index: i,
  55395. confirmed: true
  55396. };
  55397. break;
  55398. }
  55399. }
  55400. const mergedIndex = confirmedIndex ?? movingIndex.value?.index ?? index;
  55401. const numSizes = [...cachePxSizes];
  55402. const nextIndex = mergedIndex + 1;
  55403. const startMinSize = getLimitSize(limitSizes.value[mergedIndex][0], 0);
  55404. const endMinSize = getLimitSize(limitSizes.value[nextIndex][0], 0);
  55405. const startMaxSize = getLimitSize(limitSizes.value[mergedIndex][1], containerSize.value || 0);
  55406. const endMaxSize = getLimitSize(limitSizes.value[nextIndex][1], containerSize.value || 0);
  55407. let mergedOffset = offset;
  55408. if (numSizes[mergedIndex] + mergedOffset < startMinSize) mergedOffset = startMinSize - numSizes[mergedIndex];
  55409. if (numSizes[nextIndex] - mergedOffset < endMinSize) mergedOffset = numSizes[nextIndex] - endMinSize;
  55410. if (numSizes[mergedIndex] + mergedOffset > startMaxSize) mergedOffset = startMaxSize - numSizes[mergedIndex];
  55411. if (numSizes[nextIndex] - mergedOffset > endMaxSize) mergedOffset = numSizes[nextIndex] - endMaxSize;
  55412. numSizes[mergedIndex] += mergedOffset;
  55413. numSizes[nextIndex] -= mergedOffset;
  55414. lazyOffset.value = mergedOffset;
  55415. updatePanelSizes = () => {
  55416. panels.value.forEach((panel, index) => {
  55417. panel.size = numSizes[index];
  55418. });
  55419. updatePanelSizes = NOOP;
  55420. };
  55421. if (!lazy.value) updatePanelSizes();
  55422. };
  55423. const onMoveEnd = () => {
  55424. if (lazy.value) updatePanelSizes();
  55425. lazyOffset.value = 0;
  55426. movingIndex.value = null;
  55427. cachePxSizes = [];
  55428. };
  55429. const cacheCollapsedSize = [];
  55430. const onCollapse = (index, type) => {
  55431. if (!cacheCollapsedSize.length) cacheCollapsedSize.push(...pxSizes.value);
  55432. const currentSizes = pxSizes.value;
  55433. const currentIndex = type === "start" ? index : index + 1;
  55434. const targetIndex = type === "start" ? index + 1 : index;
  55435. const currentSize = currentSizes[currentIndex];
  55436. const targetSize = currentSizes[targetIndex];
  55437. if (currentSize !== 0 && targetSize !== 0) {
  55438. currentSizes[currentIndex] = 0;
  55439. currentSizes[targetIndex] += currentSize;
  55440. cacheCollapsedSize[index] = currentSize;
  55441. } else {
  55442. const totalSize = currentSize + targetSize;
  55443. const targetCacheCollapsedSize = cacheCollapsedSize[index];
  55444. const currentCacheCollapsedSize = totalSize - targetCacheCollapsedSize;
  55445. currentSizes[targetIndex] = targetCacheCollapsedSize;
  55446. currentSizes[currentIndex] = currentCacheCollapsedSize;
  55447. }
  55448. panels.value.forEach((panel, index) => {
  55449. panel.size = currentSizes[index];
  55450. });
  55451. };
  55452. return {
  55453. lazyOffset,
  55454. onMoveStart,
  55455. onMoving,
  55456. onMoveEnd,
  55457. movingIndex,
  55458. onCollapse
  55459. };
  55460. }
  55461. //#endregion
  55462. //#region ../../packages/components/splitter/src/type.ts
  55463. const splitterRootContextKey = Symbol("splitterRootContextKey");
  55464. //#endregion
  55465. //#region ../../packages/components/splitter/src/splitter.vue?vue&type=script&setup=true&lang.ts
  55466. var splitter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  55467. name: "ElSplitter",
  55468. __name: "splitter",
  55469. props: splitterProps,
  55470. emits: splitterEmits,
  55471. setup(__props, { emit: __emit }) {
  55472. const ns = useNamespace("splitter");
  55473. const emits = __emit;
  55474. const props = __props;
  55475. const layout = toRef(props, "layout");
  55476. const lazy = toRef(props, "lazy");
  55477. const { containerEl, containerSize } = useContainer(layout);
  55478. const { removeChild: unregisterPanel, children: panels, addChild: registerPanel, ChildrenSorter: PanelsSorter } = useOrderedChildren(getCurrentInstance(), "ElSplitterPanel");
  55479. watch(panels, () => {
  55480. movingIndex.value = null;
  55481. panels.value.forEach((instance, index) => {
  55482. instance.setIndex(index);
  55483. });
  55484. });
  55485. const { percentSizes, pxSizes } = useSize$1(panels, containerSize);
  55486. const { lazyOffset, movingIndex, onMoveStart, onMoving, onMoveEnd, onCollapse } = useResize(panels, containerSize, pxSizes, lazy);
  55487. const splitterStyles = computed(() => {
  55488. return { [ns.cssVarBlockName("bar-offset")]: lazy.value ? `${lazyOffset.value}px` : void 0 };
  55489. });
  55490. const onResizeStart = (index) => {
  55491. onMoveStart(index);
  55492. emits("resizeStart", index, pxSizes.value);
  55493. };
  55494. const onResize = (index, offset) => {
  55495. onMoving(index, offset);
  55496. if (!lazy.value) emits("resize", index, pxSizes.value);
  55497. };
  55498. const onResizeEnd = async (index) => {
  55499. onMoveEnd();
  55500. await nextTick();
  55501. emits("resizeEnd", index, pxSizes.value);
  55502. };
  55503. const onCollapsible = (index, type) => {
  55504. onCollapse(index, type);
  55505. emits("collapse", index, type, pxSizes.value);
  55506. };
  55507. provide(splitterRootContextKey, reactive({
  55508. panels,
  55509. percentSizes,
  55510. pxSizes,
  55511. layout,
  55512. lazy,
  55513. movingIndex,
  55514. containerSize,
  55515. onMoveStart: onResizeStart,
  55516. onMoving: onResize,
  55517. onMoveEnd: onResizeEnd,
  55518. onCollapse: onCollapsible,
  55519. registerPanel,
  55520. unregisterPanel
  55521. }));
  55522. return (_ctx, _cache) => {
  55523. return openBlock(), createElementBlock("div", {
  55524. ref_key: "containerEl",
  55525. ref: containerEl,
  55526. class: normalizeClass([unref(ns).b(), unref(ns).e(layout.value)]),
  55527. style: normalizeStyle(splitterStyles.value)
  55528. }, [
  55529. renderSlot(_ctx.$slots, "default"),
  55530. createVNode(unref(PanelsSorter)),
  55531. createCommentVNode(" Prevent iframe touch events from breaking "),
  55532. unref(movingIndex) ? (openBlock(), createElementBlock("div", {
  55533. key: 0,
  55534. class: normalizeClass([unref(ns).e("mask"), unref(ns).e(`mask-${layout.value}`)])
  55535. }, null, 2)) : createCommentVNode("v-if", true)
  55536. ], 6);
  55537. };
  55538. }
  55539. });
  55540. //#endregion
  55541. //#region ../../packages/components/splitter/src/splitter.vue
  55542. var splitter_default = splitter_vue_vue_type_script_setup_true_lang_default;
  55543. //#endregion
  55544. //#region ../../packages/components/splitter/src/split-panel.ts
  55545. /**
  55546. * @deprecated Removed after 3.0.0, Use `SplitterPanelProps` instead.
  55547. */
  55548. const splitterPanelProps = buildProps({
  55549. min: { type: [String, Number] },
  55550. max: { type: [String, Number] },
  55551. size: { type: [String, Number] },
  55552. resizable: {
  55553. type: Boolean,
  55554. default: true
  55555. },
  55556. collapsible: Boolean
  55557. });
  55558. const splitterPanelEmits = { "update:size": (value) => typeof value === "number" || typeof value === "string" };
  55559. //#endregion
  55560. //#region ../../packages/components/splitter/src/hooks/usePanel.ts
  55561. function getCollapsible(collapsible) {
  55562. if (collapsible && isObject$1(collapsible)) return collapsible;
  55563. return {
  55564. start: !!collapsible,
  55565. end: !!collapsible
  55566. };
  55567. }
  55568. function isCollapsible(panel, size, nextPanel, nextSize) {
  55569. if (panel?.collapsible.end && size > 0) return true;
  55570. if (nextPanel?.collapsible.start && nextSize === 0 && size > 0) return true;
  55571. return false;
  55572. }
  55573. //#endregion
  55574. //#region ../../packages/components/splitter/src/split-bar.vue?vue&type=script&setup=true&lang.ts
  55575. var split_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  55576. name: "ElSplitterBar",
  55577. __name: "split-bar",
  55578. props: {
  55579. index: {
  55580. type: Number,
  55581. required: true
  55582. },
  55583. layout: {
  55584. type: String,
  55585. values: ["horizontal", "vertical"],
  55586. default: "horizontal"
  55587. },
  55588. resizable: {
  55589. type: Boolean,
  55590. default: true
  55591. },
  55592. lazy: Boolean,
  55593. startCollapsible: Boolean,
  55594. endCollapsible: Boolean
  55595. },
  55596. emits: [
  55597. "moveStart",
  55598. "moving",
  55599. "moveEnd",
  55600. "collapse"
  55601. ],
  55602. setup(__props, { emit: __emit }) {
  55603. const ns = useNamespace("splitter-bar");
  55604. const props = __props;
  55605. const emit = __emit;
  55606. const isHorizontal = computed(() => props.layout === "horizontal");
  55607. const barWrapStyles = computed(() => {
  55608. if (isHorizontal.value) return { width: 0 };
  55609. return { height: 0 };
  55610. });
  55611. const draggerStyles = computed(() => {
  55612. return {
  55613. width: isHorizontal.value ? "16px" : "100%",
  55614. height: isHorizontal.value ? "100%" : "16px",
  55615. cursor: !props.resizable ? "auto" : isHorizontal.value ? "ew-resize" : "ns-resize",
  55616. touchAction: "none"
  55617. };
  55618. });
  55619. const draggerPseudoClass = computed(() => {
  55620. const prefix = ns.e("dragger");
  55621. return {
  55622. [`${prefix}-horizontal`]: isHorizontal.value,
  55623. [`${prefix}-vertical`]: !isHorizontal.value,
  55624. [`${prefix}-active`]: !!startPos.value
  55625. };
  55626. });
  55627. const startPos = ref(null);
  55628. const onMousedown = (e) => {
  55629. if (!props.resizable) return;
  55630. startPos.value = [e.pageX, e.pageY];
  55631. emit("moveStart", props.index);
  55632. window.addEventListener("mouseup", onMouseUp);
  55633. window.addEventListener("mousemove", onMouseMove);
  55634. };
  55635. const onTouchStart = (e) => {
  55636. if (props.resizable && e.touches.length === 1) {
  55637. e.preventDefault();
  55638. const touch = e.touches[0];
  55639. startPos.value = [touch.pageX, touch.pageY];
  55640. emit("moveStart", props.index);
  55641. window.addEventListener("touchend", onTouchEnd);
  55642. window.addEventListener("touchmove", onTouchMove);
  55643. }
  55644. };
  55645. const onMouseMove = (e) => {
  55646. const { pageX, pageY } = e;
  55647. const offsetX = pageX - startPos.value[0];
  55648. const offsetY = pageY - startPos.value[1];
  55649. const offset = isHorizontal.value ? offsetX : offsetY;
  55650. emit("moving", props.index, offset);
  55651. };
  55652. const onTouchMove = (e) => {
  55653. if (e.touches.length === 1) {
  55654. e.preventDefault();
  55655. const touch = e.touches[0];
  55656. const offsetX = touch.pageX - startPos.value[0];
  55657. const offsetY = touch.pageY - startPos.value[1];
  55658. const offset = isHorizontal.value ? offsetX : offsetY;
  55659. emit("moving", props.index, offset);
  55660. }
  55661. };
  55662. const onMouseUp = () => {
  55663. startPos.value = null;
  55664. window.removeEventListener("mouseup", onMouseUp);
  55665. window.removeEventListener("mousemove", onMouseMove);
  55666. emit("moveEnd", props.index);
  55667. };
  55668. const onTouchEnd = () => {
  55669. startPos.value = null;
  55670. window.removeEventListener("touchend", onTouchEnd);
  55671. window.removeEventListener("touchmove", onTouchMove);
  55672. emit("moveEnd", props.index);
  55673. };
  55674. const StartIcon = computed(() => isHorizontal.value ? arrow_left_default : arrow_up_default);
  55675. const EndIcon = computed(() => isHorizontal.value ? arrow_right_default : arrow_down_default);
  55676. return (_ctx, _cache) => {
  55677. return openBlock(), createElementBlock("div", {
  55678. class: normalizeClass([unref(ns).b()]),
  55679. style: normalizeStyle(barWrapStyles.value)
  55680. }, [
  55681. __props.startCollapsible ? (openBlock(), createElementBlock("div", {
  55682. key: 0,
  55683. class: normalizeClass([unref(ns).e("collapse-icon"), unref(ns).e(`${__props.layout}-collapse-icon-start`)]),
  55684. onClick: _cache[0] || (_cache[0] = ($event) => emit("collapse", __props.index, "start"))
  55685. }, [renderSlot(_ctx.$slots, "start-collapsible", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(StartIcon.value), { style: {
  55686. "width": "12px",
  55687. "height": "12px"
  55688. } }))])], 2)) : createCommentVNode("v-if", true),
  55689. createElementVNode("div", {
  55690. class: normalizeClass([
  55691. unref(ns).e("dragger"),
  55692. draggerPseudoClass.value,
  55693. unref(ns).is("disabled", !__props.resizable),
  55694. unref(ns).is("lazy", __props.resizable && __props.lazy)
  55695. ]),
  55696. style: normalizeStyle(draggerStyles.value),
  55697. onMousedown,
  55698. onTouchstart: onTouchStart
  55699. }, null, 38),
  55700. __props.endCollapsible ? (openBlock(), createElementBlock("div", {
  55701. key: 1,
  55702. class: normalizeClass([unref(ns).e("collapse-icon"), unref(ns).e(`${__props.layout}-collapse-icon-end`)]),
  55703. onClick: _cache[1] || (_cache[1] = ($event) => emit("collapse", __props.index, "end"))
  55704. }, [renderSlot(_ctx.$slots, "end-collapsible", {}, () => [(openBlock(), createBlock(resolveDynamicComponent(EndIcon.value), { style: {
  55705. "width": "12px",
  55706. "height": "12px"
  55707. } }))])], 2)) : createCommentVNode("v-if", true)
  55708. ], 6);
  55709. };
  55710. }
  55711. });
  55712. //#endregion
  55713. //#region ../../packages/components/splitter/src/split-bar.vue
  55714. var split_bar_default = split_bar_vue_vue_type_script_setup_true_lang_default;
  55715. //#endregion
  55716. //#region ../../packages/components/splitter/src/split-panel.vue?vue&type=script&setup=true&lang.ts
  55717. const COMPONENT_NAME = "ElSplitterPanel";
  55718. var split_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  55719. name: COMPONENT_NAME,
  55720. __name: "split-panel",
  55721. props: splitterPanelProps,
  55722. emits: splitterPanelEmits,
  55723. setup(__props, { expose: __expose, emit: __emit }) {
  55724. const ns = useNamespace("splitter-panel");
  55725. const props = __props;
  55726. const emits = __emit;
  55727. const splitterContext = inject(splitterRootContextKey);
  55728. if (!splitterContext) throwError(COMPONENT_NAME, "usage: <el-splitter><el-splitter-panel /></el-splitter/>");
  55729. const { panels, layout, lazy, containerSize, pxSizes } = toRefs(splitterContext);
  55730. const { registerPanel, unregisterPanel, onCollapse, onMoveEnd, onMoveStart, onMoving } = splitterContext;
  55731. const panelEl = ref();
  55732. const instance = getCurrentInstance();
  55733. const uid = instance.uid;
  55734. const index = ref(0);
  55735. const panel = computed(() => panels.value[index.value]);
  55736. const setIndex = (val) => {
  55737. index.value = val;
  55738. };
  55739. const panelSize = computed(() => {
  55740. if (!panel.value) return 0;
  55741. return pxSizes.value[index.value] ?? 0;
  55742. });
  55743. const nextSize = computed(() => {
  55744. if (!panel.value) return 0;
  55745. return pxSizes.value[index.value + 1] ?? 0;
  55746. });
  55747. const nextPanel = computed(() => {
  55748. if (panel.value) return panels.value[index.value + 1];
  55749. return null;
  55750. });
  55751. const isResizable = computed(() => {
  55752. if (!nextPanel.value) return false;
  55753. return props.resizable && nextPanel.value?.resizable && (panelSize.value !== 0 || !props.min) && (nextSize.value !== 0 || !nextPanel.value.min);
  55754. });
  55755. const isShowBar = computed(() => {
  55756. if (!panel.value) return false;
  55757. return index.value !== panels.value.length - 1;
  55758. });
  55759. const startCollapsible = computed(() => isCollapsible(panel.value, panelSize.value, nextPanel.value, nextSize.value));
  55760. const endCollapsible = computed(() => isCollapsible(nextPanel.value, nextSize.value, panel.value, panelSize.value));
  55761. function sizeToPx(str) {
  55762. if (isPct(str)) return getPct(str) * containerSize.value || 0;
  55763. else if (isPx(str)) return getPx(str);
  55764. return str ?? 0;
  55765. }
  55766. let isSizeUpdating = false;
  55767. watch(() => props.size, () => {
  55768. if (!isSizeUpdating && panel.value) {
  55769. if (!containerSize.value) {
  55770. panel.value.size = props.size;
  55771. return;
  55772. }
  55773. const size = sizeToPx(props.size);
  55774. const maxSize = sizeToPx(props.max);
  55775. const minSize = sizeToPx(props.min);
  55776. const finalSize = Math.min(Math.max(size, minSize || 0), maxSize || size);
  55777. if (finalSize !== size) emits("update:size", finalSize);
  55778. panel.value.size = finalSize;
  55779. }
  55780. });
  55781. watch(() => panel.value?.size, (val) => {
  55782. if (val !== props.size) {
  55783. isSizeUpdating = true;
  55784. emits("update:size", val);
  55785. nextTick(() => isSizeUpdating = false);
  55786. }
  55787. });
  55788. watch(() => props.resizable, (val) => {
  55789. if (panel.value) panel.value.resizable = val;
  55790. });
  55791. const _panel = reactive({
  55792. uid,
  55793. getVnode: () => instance.vnode,
  55794. setIndex,
  55795. ...props,
  55796. collapsible: computed(() => getCollapsible(props.collapsible))
  55797. });
  55798. registerPanel(_panel);
  55799. onBeforeUnmount(() => unregisterPanel(_panel));
  55800. __expose({ splitterPanelRef: panelEl });
  55801. return (_ctx, _cache) => {
  55802. return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", mergeProps({
  55803. ref_key: "panelEl",
  55804. ref: panelEl,
  55805. class: [unref(ns).b()],
  55806. style: { flexBasis: `${panelSize.value}px` }
  55807. }, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16), isShowBar.value ? (openBlock(), createBlock(split_bar_default, {
  55808. key: 0,
  55809. index: index.value,
  55810. layout: unref(layout),
  55811. lazy: unref(lazy),
  55812. resizable: isResizable.value,
  55813. "start-collapsible": startCollapsible.value,
  55814. "end-collapsible": endCollapsible.value,
  55815. onMoveStart: unref(onMoveStart),
  55816. onMoving: unref(onMoving),
  55817. onMoveEnd: unref(onMoveEnd),
  55818. onCollapse: unref(onCollapse)
  55819. }, {
  55820. "start-collapsible": withCtx(() => [renderSlot(_ctx.$slots, "start-collapsible")]),
  55821. "end-collapsible": withCtx(() => [renderSlot(_ctx.$slots, "end-collapsible")]),
  55822. _: 3
  55823. }, 8, [
  55824. "index",
  55825. "layout",
  55826. "lazy",
  55827. "resizable",
  55828. "start-collapsible",
  55829. "end-collapsible",
  55830. "onMoveStart",
  55831. "onMoving",
  55832. "onMoveEnd",
  55833. "onCollapse"
  55834. ])) : createCommentVNode("v-if", true)], 64);
  55835. };
  55836. }
  55837. });
  55838. //#endregion
  55839. //#region ../../packages/components/splitter/src/split-panel.vue
  55840. var split_panel_default = split_panel_vue_vue_type_script_setup_true_lang_default;
  55841. //#endregion
  55842. //#region ../../packages/components/splitter/index.ts
  55843. const ElSplitter = withInstall(splitter_default, { SplitPanel: split_panel_default });
  55844. const ElSplitterPanel = withNoopInstall(split_panel_default);
  55845. //#endregion
  55846. //#region ../../packages/element-plus/component.ts
  55847. var component_default = [
  55848. ElAffix,
  55849. ElAlert,
  55850. ElAutocomplete,
  55851. ElAutoResizer,
  55852. ElAvatar,
  55853. ElAvatarGroup,
  55854. ElBacktop,
  55855. ElBadge,
  55856. ElBreadcrumb,
  55857. ElBreadcrumbItem,
  55858. ElButton,
  55859. ElButtonGroup,
  55860. ElCalendar,
  55861. ElCard,
  55862. ElCarousel,
  55863. ElCarouselItem,
  55864. ElCascader,
  55865. ElCascaderPanel,
  55866. ElCheckTag,
  55867. ElCheckbox,
  55868. ElCheckboxButton,
  55869. ElCheckboxGroup,
  55870. ElCol,
  55871. ElCollapse,
  55872. ElCollapseItem,
  55873. ElCollapseTransition,
  55874. ElColorPickerPanel,
  55875. ElColorPicker,
  55876. ElConfigProvider,
  55877. ElContainer,
  55878. ElAside,
  55879. ElFooter,
  55880. ElHeader,
  55881. ElMain,
  55882. ElDatePicker,
  55883. ElDatePickerPanel,
  55884. ElDescriptions,
  55885. ElDescriptionsItem,
  55886. ElDialog,
  55887. ElDivider,
  55888. ElDrawer,
  55889. ElDropdown,
  55890. ElDropdownItem,
  55891. ElDropdownMenu,
  55892. ElEmpty,
  55893. ElForm,
  55894. ElFormItem,
  55895. ElIcon,
  55896. ElImage,
  55897. ElImageViewer,
  55898. ElInput,
  55899. ElInputNumber,
  55900. ElInputTag,
  55901. ElLink,
  55902. ElMenu,
  55903. ElMenuItem,
  55904. ElMenuItemGroup,
  55905. ElSubMenu,
  55906. ElPageHeader,
  55907. ElPagination,
  55908. ElPopconfirm,
  55909. ElPopover,
  55910. ElPopper,
  55911. ElProgress,
  55912. ElRadio,
  55913. ElRadioButton,
  55914. ElRadioGroup,
  55915. ElRate,
  55916. ElResult,
  55917. ElRow,
  55918. ElScrollbar,
  55919. ElSelect,
  55920. ElOption,
  55921. ElOptionGroup,
  55922. ElSelectV2,
  55923. ElSkeleton,
  55924. ElSkeletonItem,
  55925. ElSlider,
  55926. ElSpace,
  55927. ElStatistic,
  55928. ElCountdown,
  55929. ElSteps,
  55930. ElStep,
  55931. ElSwitch,
  55932. ElTable,
  55933. ElTableColumn,
  55934. ElTableV2,
  55935. ElTabs,
  55936. ElTabPane,
  55937. ElTag,
  55938. ElText,
  55939. ElTimePicker,
  55940. ElTimeSelect,
  55941. ElTimeline,
  55942. ElTimelineItem,
  55943. ElTooltip,
  55944. ElTransfer,
  55945. ElTree,
  55946. ElTreeSelect,
  55947. ElTreeV2,
  55948. ElUpload,
  55949. ElWatermark,
  55950. ElTour,
  55951. ElTourStep,
  55952. ElAnchor,
  55953. ElAnchorLink,
  55954. ElSegmented,
  55955. ElMention,
  55956. ElSplitter,
  55957. ElSplitterPanel
  55958. ];
  55959. //#endregion
  55960. //#region ../../packages/components/infinite-scroll/src/index.ts
  55961. const SCOPE$1 = "ElInfiniteScroll";
  55962. const CHECK_INTERVAL = 50;
  55963. const DEFAULT_DELAY = 200;
  55964. const DEFAULT_DISTANCE = 0;
  55965. const attributes = {
  55966. delay: {
  55967. type: Number,
  55968. default: DEFAULT_DELAY
  55969. },
  55970. distance: {
  55971. type: Number,
  55972. default: DEFAULT_DISTANCE
  55973. },
  55974. disabled: {
  55975. type: Boolean,
  55976. default: false
  55977. },
  55978. immediate: {
  55979. type: Boolean,
  55980. default: true
  55981. }
  55982. };
  55983. const getScrollOptions = (el, instance) => {
  55984. return Object.entries(attributes).reduce((acm, [name, option]) => {
  55985. const { type, default: defaultValue } = option;
  55986. const attrVal = el.getAttribute(`infinite-scroll-${name}`);
  55987. let value = instance[attrVal] ?? attrVal ?? defaultValue;
  55988. value = value === "false" ? false : value;
  55989. value = type(value);
  55990. acm[name] = Number.isNaN(value) ? defaultValue : value;
  55991. return acm;
  55992. }, {});
  55993. };
  55994. const destroyObserver = (el) => {
  55995. const { observer } = el[SCOPE$1];
  55996. if (observer) {
  55997. observer.disconnect();
  55998. delete el[SCOPE$1].observer;
  55999. }
  56000. };
  56001. const handleScroll = (el, cb) => {
  56002. const { container, containerEl, instance, observer, lastScrollTop } = el[SCOPE$1];
  56003. const { disabled, distance } = getScrollOptions(el, instance);
  56004. const { clientHeight, scrollHeight, scrollTop } = containerEl;
  56005. const delta = scrollTop - lastScrollTop;
  56006. el[SCOPE$1].lastScrollTop = scrollTop;
  56007. if (observer || disabled || delta < 0) return;
  56008. let shouldTrigger = false;
  56009. if (container === el) shouldTrigger = scrollHeight - (clientHeight + scrollTop) <= distance;
  56010. else {
  56011. const { clientTop, scrollHeight: height } = el;
  56012. const offsetTop = getOffsetTopDistance(el, containerEl);
  56013. shouldTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance;
  56014. }
  56015. if (shouldTrigger) cb.call(instance);
  56016. };
  56017. function checkFull(el, cb) {
  56018. const { containerEl, instance } = el[SCOPE$1];
  56019. const { disabled } = getScrollOptions(el, instance);
  56020. if (disabled || containerEl.clientHeight === 0) return;
  56021. if (containerEl.scrollHeight <= containerEl.clientHeight) cb.call(instance);
  56022. else destroyObserver(el);
  56023. }
  56024. const InfiniteScroll = {
  56025. async mounted(el, binding) {
  56026. const { instance, value: cb } = binding;
  56027. useDeprecated({
  56028. scope: SCOPE$1,
  56029. from: "the directive v-infinite-scroll",
  56030. replacement: "the el-scrollbar infinite scroll",
  56031. version: "3.0.0",
  56032. ref: "https://element-plus.org/en-US/component/scrollbar#infinite-scroll"
  56033. }, true);
  56034. if (!isFunction$1(cb)) throwError(SCOPE$1, "'v-infinite-scroll' binding value must be a function");
  56035. await nextTick();
  56036. const { delay, immediate } = getScrollOptions(el, instance);
  56037. const container = getScrollContainer(el, true);
  56038. const containerEl = container === window ? document.documentElement : container;
  56039. const onScroll = throttle(handleScroll.bind(null, el, cb), delay);
  56040. if (!container) return;
  56041. el[SCOPE$1] = {
  56042. instance,
  56043. container,
  56044. containerEl,
  56045. delay,
  56046. cb,
  56047. onScroll,
  56048. lastScrollTop: containerEl.scrollTop
  56049. };
  56050. if (immediate) {
  56051. const observer = new MutationObserver(throttle(checkFull.bind(null, el, cb), CHECK_INTERVAL));
  56052. el[SCOPE$1].observer = observer;
  56053. observer.observe(el, {
  56054. childList: true,
  56055. subtree: true
  56056. });
  56057. checkFull(el, cb);
  56058. }
  56059. container.addEventListener("scroll", onScroll);
  56060. },
  56061. unmounted(el) {
  56062. if (!el[SCOPE$1]) return;
  56063. const { container, onScroll } = el[SCOPE$1];
  56064. container?.removeEventListener("scroll", onScroll);
  56065. destroyObserver(el);
  56066. },
  56067. async updated(el) {
  56068. if (!el[SCOPE$1]) await nextTick();
  56069. else {
  56070. const { containerEl, cb, observer } = el[SCOPE$1];
  56071. if (containerEl.clientHeight && observer) checkFull(el, cb);
  56072. }
  56073. }
  56074. };
  56075. //#endregion
  56076. //#region ../../packages/components/infinite-scroll/index.ts
  56077. const _InfiniteScroll = InfiniteScroll;
  56078. _InfiniteScroll.install = (app) => {
  56079. app.directive("InfiniteScroll", _InfiniteScroll);
  56080. };
  56081. const ElInfiniteScroll = _InfiniteScroll;
  56082. //#endregion
  56083. //#region ../../packages/components/loading/src/loading.ts
  56084. function createLoadingComponent(options, appContext) {
  56085. let afterLeaveTimer;
  56086. const afterLeaveFlag = ref(false);
  56087. const data = reactive({
  56088. ...options,
  56089. originalPosition: "",
  56090. originalOverflow: "",
  56091. visible: false
  56092. });
  56093. function setText(text) {
  56094. data.text = text;
  56095. }
  56096. function destroySelf() {
  56097. const target = data.parent;
  56098. const ns = vm.ns;
  56099. if (!target.vLoadingAddClassList) {
  56100. let loadingNumber = target.getAttribute("loading-number");
  56101. loadingNumber = Number.parseInt(loadingNumber) - 1;
  56102. if (!loadingNumber) {
  56103. removeClass(target, ns.bm("parent", "relative"));
  56104. target.removeAttribute("loading-number");
  56105. } else target.setAttribute("loading-number", loadingNumber.toString());
  56106. removeClass(target, ns.bm("parent", "hidden"));
  56107. }
  56108. removeElLoadingChild();
  56109. loadingInstance.unmount();
  56110. }
  56111. function removeElLoadingChild() {
  56112. vm.$el?.parentNode?.removeChild(vm.$el);
  56113. }
  56114. function close() {
  56115. if (options.beforeClose && !options.beforeClose()) return;
  56116. afterLeaveFlag.value = true;
  56117. clearTimeout(afterLeaveTimer);
  56118. afterLeaveTimer = setTimeout(handleAfterLeave, 400);
  56119. data.visible = false;
  56120. options.closed?.();
  56121. }
  56122. function handleAfterLeave() {
  56123. if (!afterLeaveFlag.value) return;
  56124. const target = data.parent;
  56125. afterLeaveFlag.value = false;
  56126. target.vLoadingAddClassList = void 0;
  56127. destroySelf();
  56128. }
  56129. const loadingInstance = createApp(defineComponent({
  56130. name: "ElLoading",
  56131. setup(_, { expose }) {
  56132. const { ns, zIndex } = useGlobalComponentSettings("loading");
  56133. expose({
  56134. ns,
  56135. zIndex
  56136. });
  56137. return () => {
  56138. const svg = data.spinner || data.svg;
  56139. const spinner = h("svg", {
  56140. class: "circular",
  56141. viewBox: data.svgViewBox ? data.svgViewBox : "0 0 50 50",
  56142. ...svg ? { innerHTML: svg } : {}
  56143. }, [h("circle", {
  56144. class: "path",
  56145. cx: "25",
  56146. cy: "25",
  56147. r: "20",
  56148. fill: "none"
  56149. })]);
  56150. const spinnerText = data.text ? h("p", { class: ns.b("text") }, [data.text]) : void 0;
  56151. return h(Transition, {
  56152. name: ns.b("fade"),
  56153. onAfterLeave: handleAfterLeave
  56154. }, { default: withCtx(() => [withDirectives(createVNode("div", {
  56155. style: { backgroundColor: data.background || "" },
  56156. class: [
  56157. ns.b("mask"),
  56158. data.customClass,
  56159. ns.is("fullscreen", data.fullscreen)
  56160. ]
  56161. }, [h("div", { class: ns.b("spinner") }, [spinner, spinnerText])]), [[vShow, data.visible]])]) });
  56162. };
  56163. }
  56164. }));
  56165. Object.assign(loadingInstance._context, appContext ?? {});
  56166. const vm = loadingInstance.mount(document.createElement("div"));
  56167. return {
  56168. ...toRefs(data),
  56169. setText,
  56170. removeElLoadingChild,
  56171. close,
  56172. handleAfterLeave,
  56173. vm,
  56174. get $el() {
  56175. return vm.$el;
  56176. }
  56177. };
  56178. }
  56179. //#endregion
  56180. //#region ../../packages/components/loading/src/service.ts
  56181. let fullscreenInstance = void 0;
  56182. const Loading = function(options = {}, context) {
  56183. if (!isClient) return void 0;
  56184. const resolved = resolveOptions(options);
  56185. if (resolved.fullscreen && fullscreenInstance) return fullscreenInstance;
  56186. const instance = createLoadingComponent({
  56187. ...resolved,
  56188. closed: () => {
  56189. resolved.closed?.();
  56190. if (resolved.fullscreen) fullscreenInstance = void 0;
  56191. }
  56192. }, context ?? Loading._context);
  56193. addStyle(resolved, resolved.parent, instance);
  56194. addClassList(resolved, resolved.parent, instance);
  56195. resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance);
  56196. /**
  56197. * add loading-number to parent.
  56198. * because if a fullscreen loading is triggered when somewhere
  56199. * a v-loading.body was triggered before and it's parent is
  56200. * document.body which with a margin , the fullscreen loading's
  56201. * destroySelf function will remove 'el-loading-parent--relative',
  56202. * and then the position of v-loading.body will be error.
  56203. */
  56204. let loadingNumber = resolved.parent.getAttribute("loading-number");
  56205. if (!loadingNumber) loadingNumber = "1";
  56206. else loadingNumber = `${Number.parseInt(loadingNumber) + 1}`;
  56207. resolved.parent.setAttribute("loading-number", loadingNumber);
  56208. resolved.parent.appendChild(instance.$el);
  56209. nextTick(() => instance.visible.value = resolved.visible);
  56210. if (resolved.fullscreen) fullscreenInstance = instance;
  56211. return instance;
  56212. };
  56213. const resolveOptions = (options) => {
  56214. let target;
  56215. if (isString(options.target)) target = document.querySelector(options.target) ?? document.body;
  56216. else target = options.target || document.body;
  56217. return {
  56218. parent: target === document.body || options.body ? document.body : target,
  56219. background: options.background || "",
  56220. svg: options.svg || "",
  56221. svgViewBox: options.svgViewBox || "",
  56222. spinner: options.spinner || false,
  56223. text: options.text || "",
  56224. fullscreen: target === document.body && (options.fullscreen ?? true),
  56225. lock: options.lock ?? false,
  56226. customClass: options.customClass || "",
  56227. visible: options.visible ?? true,
  56228. beforeClose: options.beforeClose,
  56229. closed: options.closed,
  56230. target
  56231. };
  56232. };
  56233. const addStyle = async (options, parent, instance) => {
  56234. const { nextZIndex } = instance.vm.zIndex || instance.vm._.exposed.zIndex;
  56235. const maskStyle = {};
  56236. if (options.fullscreen) {
  56237. instance.originalPosition.value = getStyle(document.body, "position");
  56238. instance.originalOverflow.value = getStyle(document.body, "overflow");
  56239. maskStyle.zIndex = nextZIndex();
  56240. } else if (options.parent === document.body) {
  56241. instance.originalPosition.value = getStyle(document.body, "position");
  56242. /**
  56243. * await dom render when visible is true in init,
  56244. * because some component's height maybe 0.
  56245. * e.g. el-table.
  56246. */
  56247. await nextTick();
  56248. for (const property of ["top", "left"]) {
  56249. const scroll = property === "top" ? "scrollTop" : "scrollLeft";
  56250. maskStyle[property] = `${options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle(document.body, `margin-${property}`), 10)}px`;
  56251. }
  56252. for (const property of ["height", "width"]) maskStyle[property] = `${options.target.getBoundingClientRect()[property]}px`;
  56253. } else instance.originalPosition.value = getStyle(parent, "position");
  56254. for (const [key, value] of Object.entries(maskStyle)) instance.$el.style[key] = value;
  56255. };
  56256. const addClassList = (options, parent, instance) => {
  56257. const ns = instance.vm.ns || instance.vm._.exposed.ns;
  56258. if (![
  56259. "absolute",
  56260. "fixed",
  56261. "sticky"
  56262. ].includes(instance.originalPosition.value)) addClass(parent, ns.bm("parent", "relative"));
  56263. else removeClass(parent, ns.bm("parent", "relative"));
  56264. if (options.fullscreen && options.lock) addClass(parent, ns.bm("parent", "hidden"));
  56265. else removeClass(parent, ns.bm("parent", "hidden"));
  56266. };
  56267. Loading._context = null;
  56268. //#endregion
  56269. //#region ../../packages/components/loading/src/directive.ts
  56270. const INSTANCE_KEY = Symbol("ElLoading");
  56271. const getAttributeName = (name) => {
  56272. return `element-loading-${hyphenate(name)}`;
  56273. };
  56274. const createInstance = (el, binding) => {
  56275. const vm = binding.instance;
  56276. const getBindingProp = (key) => isObject$1(binding.value) ? binding.value[key] : void 0;
  56277. const resolveExpression = (key) => {
  56278. return ref(isString(key) && vm?.[key] || key);
  56279. };
  56280. const getProp = (name) => resolveExpression(getBindingProp(name) || el.getAttribute(getAttributeName(name)));
  56281. const fullscreen = getBindingProp("fullscreen") ?? binding.modifiers.fullscreen;
  56282. const options = {
  56283. text: getProp("text"),
  56284. svg: getProp("svg"),
  56285. svgViewBox: getProp("svgViewBox"),
  56286. spinner: getProp("spinner"),
  56287. background: getProp("background"),
  56288. customClass: getProp("customClass"),
  56289. fullscreen,
  56290. target: getBindingProp("target") ?? (fullscreen ? void 0 : el),
  56291. body: getBindingProp("body") ?? binding.modifiers.body,
  56292. lock: getBindingProp("lock") ?? binding.modifiers.lock
  56293. };
  56294. const instance = Loading(options);
  56295. instance._context = vLoading._context;
  56296. el[INSTANCE_KEY] = {
  56297. options,
  56298. instance
  56299. };
  56300. };
  56301. const updateOptions = (originalOptions, newOptions) => {
  56302. for (const key of Object.keys(originalOptions)) if (isRef(originalOptions[key])) originalOptions[key].value = newOptions[key];
  56303. };
  56304. const vLoading = {
  56305. mounted(el, binding) {
  56306. if (binding.value) createInstance(el, binding);
  56307. },
  56308. updated(el, binding) {
  56309. const instance = el[INSTANCE_KEY];
  56310. if (!binding.value) {
  56311. instance?.instance.close();
  56312. el[INSTANCE_KEY] = null;
  56313. return;
  56314. }
  56315. if (!instance) createInstance(el, binding);
  56316. else updateOptions(instance.options, isObject$1(binding.value) ? binding.value : {
  56317. text: el.getAttribute(getAttributeName("text")),
  56318. svg: el.getAttribute(getAttributeName("svg")),
  56319. svgViewBox: el.getAttribute(getAttributeName("svgViewBox")),
  56320. spinner: el.getAttribute(getAttributeName("spinner")),
  56321. background: el.getAttribute(getAttributeName("background")),
  56322. customClass: el.getAttribute(getAttributeName("customClass"))
  56323. });
  56324. },
  56325. unmounted(el) {
  56326. el[INSTANCE_KEY]?.instance.close();
  56327. el[INSTANCE_KEY] = null;
  56328. }
  56329. };
  56330. vLoading._context = null;
  56331. //#endregion
  56332. //#region ../../packages/components/loading/index.ts
  56333. const ElLoading = {
  56334. install(app) {
  56335. Loading._context = app._context;
  56336. vLoading._context = app._context;
  56337. app.directive("loading", vLoading);
  56338. app.config.globalProperties.$loading = Loading;
  56339. },
  56340. directive: vLoading,
  56341. service: Loading
  56342. };
  56343. //#endregion
  56344. //#region ../../packages/components/message/src/message.ts
  56345. const messageTypes = [
  56346. "primary",
  56347. "success",
  56348. "info",
  56349. "warning",
  56350. "error"
  56351. ];
  56352. const messagePlacement = [
  56353. "top",
  56354. "top-left",
  56355. "top-right",
  56356. "bottom",
  56357. "bottom-left",
  56358. "bottom-right"
  56359. ];
  56360. const MESSAGE_DEFAULT_PLACEMENT = "top";
  56361. const messageDefaults = mutable({
  56362. customClass: "",
  56363. dangerouslyUseHTMLString: false,
  56364. duration: 3e3,
  56365. icon: void 0,
  56366. id: "",
  56367. message: "",
  56368. onClose: void 0,
  56369. showClose: false,
  56370. type: "info",
  56371. plain: false,
  56372. offset: 16,
  56373. placement: void 0,
  56374. zIndex: 0,
  56375. grouping: false,
  56376. repeatNum: 1,
  56377. appendTo: isClient ? document.body : void 0
  56378. });
  56379. /**
  56380. * @deprecated Removed after 3.0.0, Use `MessageProps` instead.
  56381. */
  56382. const messageProps = buildProps({
  56383. customClass: {
  56384. type: String,
  56385. default: messageDefaults.customClass
  56386. },
  56387. dangerouslyUseHTMLString: {
  56388. type: Boolean,
  56389. default: messageDefaults.dangerouslyUseHTMLString
  56390. },
  56391. duration: {
  56392. type: Number,
  56393. default: messageDefaults.duration
  56394. },
  56395. icon: {
  56396. type: iconPropType,
  56397. default: messageDefaults.icon
  56398. },
  56399. id: {
  56400. type: String,
  56401. default: messageDefaults.id
  56402. },
  56403. message: {
  56404. type: definePropType([
  56405. String,
  56406. Object,
  56407. Function
  56408. ]),
  56409. default: messageDefaults.message
  56410. },
  56411. onClose: {
  56412. type: definePropType(Function),
  56413. default: messageDefaults.onClose
  56414. },
  56415. showClose: {
  56416. type: Boolean,
  56417. default: messageDefaults.showClose
  56418. },
  56419. type: {
  56420. type: String,
  56421. values: messageTypes,
  56422. default: messageDefaults.type
  56423. },
  56424. plain: {
  56425. type: Boolean,
  56426. default: messageDefaults.plain
  56427. },
  56428. offset: {
  56429. type: Number,
  56430. default: messageDefaults.offset
  56431. },
  56432. placement: {
  56433. type: String,
  56434. values: messagePlacement,
  56435. default: messageDefaults.placement
  56436. },
  56437. zIndex: {
  56438. type: Number,
  56439. default: messageDefaults.zIndex
  56440. },
  56441. grouping: {
  56442. type: Boolean,
  56443. default: messageDefaults.grouping
  56444. },
  56445. repeatNum: {
  56446. type: Number,
  56447. default: messageDefaults.repeatNum
  56448. }
  56449. });
  56450. const messageEmits = { destroy: () => true };
  56451. //#endregion
  56452. //#region ../../packages/components/message/src/instance.ts
  56453. const placementInstances = shallowReactive({});
  56454. const getOrCreatePlacementInstances = (placement) => {
  56455. if (!placementInstances[placement]) placementInstances[placement] = shallowReactive([]);
  56456. return placementInstances[placement];
  56457. };
  56458. const getInstance = (id, placement) => {
  56459. const instances = placementInstances[placement] || [];
  56460. const idx = instances.findIndex((instance) => instance.id === id);
  56461. const current = instances[idx];
  56462. let prev;
  56463. if (idx > 0) prev = instances[idx - 1];
  56464. return {
  56465. current,
  56466. prev
  56467. };
  56468. };
  56469. const getLastOffset = (id, placement) => {
  56470. const { prev } = getInstance(id, placement);
  56471. if (!prev) return 0;
  56472. return prev.vm.exposed.bottom.value;
  56473. };
  56474. const getOffsetOrSpace = (id, offset, placement) => {
  56475. return (placementInstances[placement] || []).findIndex((instance) => instance.id === id) > 0 ? 16 : offset;
  56476. };
  56477. //#endregion
  56478. //#region ../../packages/components/message/src/message.vue?vue&type=script&setup=true&lang.ts
  56479. const _hoisted_1$2 = ["id"];
  56480. const _hoisted_2$2 = ["innerHTML"];
  56481. var message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  56482. name: "ElMessage",
  56483. __name: "message",
  56484. props: messageProps,
  56485. emits: messageEmits,
  56486. setup(__props, { expose: __expose, emit: __emit }) {
  56487. const { Close } = TypeComponents;
  56488. const props = __props;
  56489. const emit = __emit;
  56490. const isStartTransition = ref(false);
  56491. const { ns, zIndex } = useGlobalComponentSettings("message");
  56492. const { currentZIndex, nextZIndex } = zIndex;
  56493. const messageRef = ref();
  56494. const visible = ref(false);
  56495. const height = ref(0);
  56496. let stopTimer = void 0;
  56497. const badgeType = computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
  56498. const typeClass = computed(() => {
  56499. const type = props.type;
  56500. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  56501. });
  56502. const iconComponent = computed(() => props.icon || TypeComponentsMap[props.type] || "");
  56503. const placement = computed(() => props.placement || MESSAGE_DEFAULT_PLACEMENT);
  56504. const lastOffset = computed(() => getLastOffset(props.id, placement.value));
  56505. const offset = computed(() => {
  56506. return getOffsetOrSpace(props.id, props.offset, placement.value) + lastOffset.value;
  56507. });
  56508. const bottom = computed(() => height.value + offset.value);
  56509. const horizontalClass = computed(() => {
  56510. if (placement.value.includes("left")) return ns.is("left");
  56511. if (placement.value.includes("right")) return ns.is("right");
  56512. return ns.is("center");
  56513. });
  56514. const verticalProperty = computed(() => placement.value.startsWith("top") ? "top" : "bottom");
  56515. const customStyle = computed(() => ({
  56516. [verticalProperty.value]: `${offset.value}px`,
  56517. zIndex: currentZIndex.value
  56518. }));
  56519. function startTimer() {
  56520. if (props.duration === 0) return;
  56521. ({stop: stopTimer} = useTimeoutFn(() => {
  56522. close();
  56523. }, props.duration));
  56524. }
  56525. function clearTimer() {
  56526. stopTimer?.();
  56527. }
  56528. function close() {
  56529. visible.value = false;
  56530. nextTick(() => {
  56531. if (!isStartTransition.value) {
  56532. props.onClose?.();
  56533. emit("destroy");
  56534. }
  56535. });
  56536. }
  56537. function keydown(event) {
  56538. if (getEventCode(event) === EVENT_CODE.esc) close();
  56539. }
  56540. onMounted(() => {
  56541. startTimer();
  56542. nextZIndex();
  56543. visible.value = true;
  56544. });
  56545. watch(() => props.repeatNum, () => {
  56546. clearTimer();
  56547. startTimer();
  56548. });
  56549. useEventListener(document, "keydown", keydown);
  56550. useResizeObserver(messageRef, () => {
  56551. height.value = messageRef.value.getBoundingClientRect().height;
  56552. });
  56553. __expose({
  56554. visible,
  56555. bottom,
  56556. close
  56557. });
  56558. return (_ctx, _cache) => {
  56559. return openBlock(), createBlock(Transition, {
  56560. name: unref(ns).b("fade"),
  56561. onBeforeEnter: _cache[0] || (_cache[0] = ($event) => isStartTransition.value = true),
  56562. onBeforeLeave: __props.onClose,
  56563. onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
  56564. persisted: ""
  56565. }, {
  56566. default: withCtx(() => [withDirectives(createElementVNode("div", {
  56567. id: __props.id,
  56568. ref_key: "messageRef",
  56569. ref: messageRef,
  56570. class: normalizeClass([
  56571. unref(ns).b(),
  56572. { [unref(ns).m(__props.type)]: __props.type },
  56573. unref(ns).is("closable", __props.showClose),
  56574. unref(ns).is("plain", __props.plain),
  56575. unref(ns).is("bottom", verticalProperty.value === "bottom"),
  56576. horizontalClass.value,
  56577. __props.customClass
  56578. ]),
  56579. style: normalizeStyle(customStyle.value),
  56580. role: "alert",
  56581. onMouseenter: clearTimer,
  56582. onMouseleave: startTimer
  56583. }, [
  56584. __props.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), {
  56585. key: 0,
  56586. value: __props.repeatNum,
  56587. type: badgeType.value,
  56588. class: normalizeClass(unref(ns).e("badge"))
  56589. }, null, 8, [
  56590. "value",
  56591. "type",
  56592. "class"
  56593. ])) : createCommentVNode("v-if", true),
  56594. iconComponent.value ? (openBlock(), createBlock(unref(ElIcon), {
  56595. key: 1,
  56596. class: normalizeClass([unref(ns).e("icon"), typeClass.value])
  56597. }, {
  56598. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))]),
  56599. _: 1
  56600. }, 8, ["class"])) : createCommentVNode("v-if", true),
  56601. renderSlot(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
  56602. key: 0,
  56603. class: normalizeClass(unref(ns).e("content"))
  56604. }, toDisplayString(__props.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "), createElementVNode("p", {
  56605. class: normalizeClass(unref(ns).e("content")),
  56606. innerHTML: __props.message
  56607. }, null, 10, _hoisted_2$2)], 2112))]),
  56608. __props.showClose ? (openBlock(), createBlock(unref(ElIcon), {
  56609. key: 2,
  56610. class: normalizeClass(unref(ns).e("closeBtn")),
  56611. onClick: withModifiers(close, ["stop"])
  56612. }, {
  56613. default: withCtx(() => [createVNode(unref(Close))]),
  56614. _: 1
  56615. }, 8, ["class"])) : createCommentVNode("v-if", true)
  56616. ], 46, _hoisted_1$2), [[vShow, visible.value]])]),
  56617. _: 3
  56618. }, 8, ["name", "onBeforeLeave"]);
  56619. };
  56620. }
  56621. });
  56622. //#endregion
  56623. //#region ../../packages/components/message/src/message.vue
  56624. var message_default = message_vue_vue_type_script_setup_true_lang_default;
  56625. //#endregion
  56626. //#region ../../packages/components/message/src/method.ts
  56627. let seed$1 = 1;
  56628. const normalizeAppendTo = (normalized) => {
  56629. if (!normalized.appendTo) normalized.appendTo = document.body;
  56630. else if (isString(normalized.appendTo)) {
  56631. let appendTo = document.querySelector(normalized.appendTo);
  56632. if (!isElement$1(appendTo)) {
  56633. /* @__PURE__ */ debugWarn("ElMessage", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  56634. appendTo = document.body;
  56635. }
  56636. normalized.appendTo = appendTo;
  56637. }
  56638. };
  56639. const normalizePlacement = (normalized) => {
  56640. if (!normalized.placement && isString(messageConfig.placement) && messageConfig.placement) normalized.placement = messageConfig.placement;
  56641. if (!normalized.placement) normalized.placement = MESSAGE_DEFAULT_PLACEMENT;
  56642. if (!messagePlacement.includes(normalized.placement)) {
  56643. /* @__PURE__ */ debugWarn("ElMessage", `Invalid placement: ${normalized.placement}. Falling back to '${MESSAGE_DEFAULT_PLACEMENT}'.`);
  56644. normalized.placement = MESSAGE_DEFAULT_PLACEMENT;
  56645. }
  56646. };
  56647. const normalizeOptions = (params) => {
  56648. const options = !params || isString(params) || isVNode(params) || isFunction$1(params) ? { message: params } : params;
  56649. const normalized = {
  56650. ...messageDefaults,
  56651. ...options
  56652. };
  56653. normalizeAppendTo(normalized);
  56654. normalizePlacement(normalized);
  56655. if (isBoolean(messageConfig.grouping) && !normalized.grouping) normalized.grouping = messageConfig.grouping;
  56656. if (isNumber(messageConfig.duration) && normalized.duration === 3e3) normalized.duration = messageConfig.duration;
  56657. if (isNumber(messageConfig.offset) && normalized.offset === 16) normalized.offset = messageConfig.offset;
  56658. if (isBoolean(messageConfig.showClose) && !normalized.showClose) normalized.showClose = messageConfig.showClose;
  56659. if (isBoolean(messageConfig.plain) && !normalized.plain) normalized.plain = messageConfig.plain;
  56660. return normalized;
  56661. };
  56662. const closeMessage = (instance) => {
  56663. const instances = placementInstances[instance.props.placement || MESSAGE_DEFAULT_PLACEMENT];
  56664. const idx = instances.indexOf(instance);
  56665. if (idx === -1) return;
  56666. instances.splice(idx, 1);
  56667. const { handler } = instance;
  56668. handler.close();
  56669. };
  56670. const createMessage = ({ appendTo, ...options }, context) => {
  56671. const id = `message_${seed$1++}`;
  56672. const userOnClose = options.onClose;
  56673. const container = document.createElement("div");
  56674. const props = {
  56675. ...options,
  56676. id,
  56677. onClose: () => {
  56678. userOnClose?.();
  56679. closeMessage(instance);
  56680. },
  56681. onDestroy: () => {
  56682. render(null, container);
  56683. }
  56684. };
  56685. const vnode = createVNode(message_default, props, isFunction$1(props.message) || isVNode(props.message) ? { default: isFunction$1(props.message) ? props.message : () => props.message } : null);
  56686. vnode.appContext = context || message._context;
  56687. render(vnode, container);
  56688. appendTo.appendChild(container.firstElementChild);
  56689. const vm = vnode.component;
  56690. const instance = {
  56691. id,
  56692. vnode,
  56693. vm,
  56694. handler: { close: () => {
  56695. vm.exposed.close();
  56696. } },
  56697. props: vnode.component.props
  56698. };
  56699. return instance;
  56700. };
  56701. const message = (options = {}, context) => {
  56702. if (!isClient) return { close: () => void 0 };
  56703. const normalized = normalizeOptions(options);
  56704. const instances = getOrCreatePlacementInstances(normalized.placement || MESSAGE_DEFAULT_PLACEMENT);
  56705. if (normalized.grouping && instances.length) {
  56706. const instance = instances.find(({ vnode: vm }) => vm.props?.message === normalized.message);
  56707. if (instance) {
  56708. instance.props.repeatNum += 1;
  56709. instance.props.type = normalized.type;
  56710. return instance.handler;
  56711. }
  56712. }
  56713. if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) return { close: () => void 0 };
  56714. const instance = createMessage(normalized, context);
  56715. instances.push(instance);
  56716. return instance.handler;
  56717. };
  56718. messageTypes.forEach((type) => {
  56719. message[type] = (options = {}, appContext) => {
  56720. return message({
  56721. ...normalizeOptions(options),
  56722. type
  56723. }, appContext);
  56724. };
  56725. });
  56726. function closeAll$1(type) {
  56727. for (const placement in placementInstances) if (hasOwn(placementInstances, placement)) {
  56728. const instances = [...placementInstances[placement]];
  56729. for (const instance of instances) if (!type || type === instance.props.type) instance.handler.close();
  56730. }
  56731. }
  56732. function closeAllByPlacement(placement) {
  56733. if (!placementInstances[placement]) return;
  56734. [...placementInstances[placement]].forEach((instance) => instance.handler.close());
  56735. }
  56736. message.closeAll = closeAll$1;
  56737. message.closeAllByPlacement = closeAllByPlacement;
  56738. message._context = null;
  56739. //#endregion
  56740. //#region ../../packages/components/message/index.ts
  56741. const ElMessage = withInstallFunction(message, "$message");
  56742. //#endregion
  56743. //#region ../../packages/components/message-box/src/index.vue?vue&type=script&lang.ts
  56744. var index_vue_vue_type_script_lang_default = defineComponent({
  56745. name: "ElMessageBox",
  56746. directives: { TrapFocus },
  56747. components: {
  56748. ElButton,
  56749. ElFocusTrap: focus_trap_default,
  56750. ElInput,
  56751. ElOverlay,
  56752. ElIcon,
  56753. ...TypeComponents
  56754. },
  56755. inheritAttrs: false,
  56756. props: {
  56757. buttonSize: {
  56758. type: String,
  56759. validator: isValidComponentSize
  56760. },
  56761. modal: {
  56762. type: Boolean,
  56763. default: true
  56764. },
  56765. lockScroll: {
  56766. type: Boolean,
  56767. default: true
  56768. },
  56769. showClose: {
  56770. type: Boolean,
  56771. default: true
  56772. },
  56773. closeOnClickModal: {
  56774. type: Boolean,
  56775. default: true
  56776. },
  56777. closeOnPressEscape: {
  56778. type: Boolean,
  56779. default: true
  56780. },
  56781. closeOnHashChange: {
  56782. type: Boolean,
  56783. default: true
  56784. },
  56785. center: Boolean,
  56786. draggable: Boolean,
  56787. overflow: Boolean,
  56788. roundButton: Boolean,
  56789. container: {
  56790. type: String,
  56791. default: "body"
  56792. },
  56793. boxType: {
  56794. type: String,
  56795. default: ""
  56796. }
  56797. },
  56798. emits: ["vanish", "action"],
  56799. setup(props, { emit }) {
  56800. const { locale, zIndex, ns, size: btnSize } = useGlobalComponentSettings("message-box", computed(() => props.buttonSize));
  56801. const { t } = locale;
  56802. const { nextZIndex } = zIndex;
  56803. const visible = ref(false);
  56804. const state = reactive({
  56805. autofocus: true,
  56806. beforeClose: null,
  56807. callback: null,
  56808. cancelButtonText: "",
  56809. cancelButtonClass: "",
  56810. confirmButtonText: "",
  56811. confirmButtonClass: "",
  56812. cancelButtonType: "",
  56813. confirmButtonType: "primary",
  56814. customClass: "",
  56815. customStyle: {},
  56816. dangerouslyUseHTMLString: false,
  56817. distinguishCancelAndClose: false,
  56818. icon: "",
  56819. closeIcon: "",
  56820. inputPattern: null,
  56821. inputPlaceholder: "",
  56822. inputType: "text",
  56823. inputValue: "",
  56824. inputValidator: void 0,
  56825. inputErrorMessage: "",
  56826. message: "",
  56827. modalFade: true,
  56828. modalClass: "",
  56829. showCancelButton: false,
  56830. showConfirmButton: true,
  56831. type: "",
  56832. title: void 0,
  56833. showInput: false,
  56834. action: "",
  56835. confirmButtonLoading: false,
  56836. cancelButtonLoading: false,
  56837. confirmButtonLoadingIcon: markRaw(loading_default),
  56838. cancelButtonLoadingIcon: markRaw(loading_default),
  56839. confirmButtonDisabled: false,
  56840. editorErrorMessage: "",
  56841. validateError: false,
  56842. zIndex: nextZIndex()
  56843. });
  56844. const typeClass = computed(() => {
  56845. const type = state.type;
  56846. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  56847. });
  56848. const contentId = useId();
  56849. const inputId = useId();
  56850. const iconComponent = computed(() => {
  56851. const type = state.type;
  56852. return state.icon || type && TypeComponentsMap[type] || "";
  56853. });
  56854. const hasMessage = computed(() => !!state.message);
  56855. const rootRef = ref();
  56856. const headerRef = ref();
  56857. const focusStartRef = ref();
  56858. const inputRef = ref();
  56859. const confirmRef = ref();
  56860. const confirmButtonClasses = computed(() => state.confirmButtonClass);
  56861. watch(() => state.inputValue, async (val) => {
  56862. await nextTick();
  56863. if (props.boxType === "prompt" && val) validate();
  56864. }, { immediate: true });
  56865. watch(() => visible.value, (val) => {
  56866. if (val) {
  56867. if (props.boxType !== "prompt") if (state.autofocus) focusStartRef.value = confirmRef.value?.$el ?? rootRef.value;
  56868. else focusStartRef.value = rootRef.value;
  56869. state.zIndex = nextZIndex();
  56870. }
  56871. if (props.boxType !== "prompt") return;
  56872. if (val) nextTick().then(() => {
  56873. if (inputRef.value && inputRef.value.$el) if (state.autofocus) focusStartRef.value = getInputElement() ?? rootRef.value;
  56874. else focusStartRef.value = rootRef.value;
  56875. });
  56876. else {
  56877. state.editorErrorMessage = "";
  56878. state.validateError = false;
  56879. }
  56880. });
  56881. const { isDragging } = useDraggable(rootRef, headerRef, computed(() => props.draggable), computed(() => props.overflow));
  56882. onMounted(async () => {
  56883. await nextTick();
  56884. if (props.closeOnHashChange) window.addEventListener("hashchange", doClose);
  56885. });
  56886. onBeforeUnmount(() => {
  56887. if (props.closeOnHashChange) window.removeEventListener("hashchange", doClose);
  56888. });
  56889. function doClose() {
  56890. if (!visible.value) return;
  56891. visible.value = false;
  56892. nextTick(() => {
  56893. if (state.action) emit("action", state.action);
  56894. });
  56895. }
  56896. const handleWrapperClick = () => {
  56897. if (props.closeOnClickModal) handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
  56898. };
  56899. const overlayEvent = useSameTarget(handleWrapperClick);
  56900. const handleInputEnter = (e) => {
  56901. if (state.inputType !== "textarea" && !inputRef.value?.isComposing) {
  56902. e.preventDefault();
  56903. return handleAction("confirm");
  56904. }
  56905. };
  56906. const handleAction = (action) => {
  56907. if (props.boxType === "prompt" && action === "confirm" && !validate()) return;
  56908. state.action = action;
  56909. if (state.beforeClose) state.beforeClose?.(action, state, doClose);
  56910. else doClose();
  56911. };
  56912. const validate = () => {
  56913. if (props.boxType === "prompt") {
  56914. const inputPattern = state.inputPattern;
  56915. if (inputPattern && !inputPattern.test(state.inputValue || "")) {
  56916. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  56917. state.validateError = true;
  56918. return false;
  56919. }
  56920. const inputValidator = state.inputValidator;
  56921. if (isFunction$1(inputValidator)) {
  56922. const validateResult = inputValidator(state.inputValue);
  56923. if (validateResult === false) {
  56924. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  56925. state.validateError = true;
  56926. return false;
  56927. }
  56928. if (isString(validateResult)) {
  56929. state.editorErrorMessage = validateResult;
  56930. state.validateError = true;
  56931. return false;
  56932. }
  56933. }
  56934. }
  56935. state.editorErrorMessage = "";
  56936. state.validateError = false;
  56937. return true;
  56938. };
  56939. const getInputElement = () => {
  56940. const inputRefs = inputRef.value?.$refs;
  56941. return inputRefs?.input ?? inputRefs?.textarea;
  56942. };
  56943. const handleClose = () => {
  56944. handleAction("close");
  56945. };
  56946. const onCloseRequested = () => {
  56947. if (props.closeOnPressEscape) handleClose();
  56948. };
  56949. if (props.lockScroll) useLockscreen(visible, { ns });
  56950. return {
  56951. ...toRefs(state),
  56952. ns,
  56953. overlayEvent,
  56954. visible,
  56955. hasMessage,
  56956. typeClass,
  56957. contentId,
  56958. inputId,
  56959. btnSize,
  56960. iconComponent,
  56961. confirmButtonClasses,
  56962. rootRef,
  56963. focusStartRef,
  56964. headerRef,
  56965. inputRef,
  56966. isDragging,
  56967. confirmRef,
  56968. doClose,
  56969. handleClose,
  56970. onCloseRequested,
  56971. handleWrapperClick,
  56972. handleInputEnter,
  56973. handleAction,
  56974. t
  56975. };
  56976. }
  56977. });
  56978. //#endregion
  56979. //#region ../../packages/components/message-box/src/index.vue
  56980. const _hoisted_1$1 = ["aria-label", "aria-describedby"];
  56981. const _hoisted_2$1 = ["aria-label"];
  56982. const _hoisted_3$1 = ["id"];
  56983. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  56984. const _component_el_icon = resolveComponent("el-icon");
  56985. const _component_el_input = resolveComponent("el-input");
  56986. const _component_el_button = resolveComponent("el-button");
  56987. const _component_el_focus_trap = resolveComponent("el-focus-trap");
  56988. const _component_el_overlay = resolveComponent("el-overlay");
  56989. return openBlock(), createBlock(Transition, {
  56990. name: "fade-in-linear",
  56991. onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish")),
  56992. persisted: ""
  56993. }, {
  56994. default: withCtx(() => [withDirectives(createVNode(_component_el_overlay, {
  56995. "z-index": _ctx.zIndex,
  56996. "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
  56997. mask: _ctx.modal
  56998. }, {
  56999. default: withCtx(() => [createElementVNode("div", {
  57000. role: "dialog",
  57001. "aria-label": _ctx.title,
  57002. "aria-modal": "true",
  57003. "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
  57004. class: normalizeClass(`${_ctx.ns.namespace.value}-overlay-message-box`),
  57005. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)),
  57006. onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)),
  57007. onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args))
  57008. }, [createVNode(_component_el_focus_trap, {
  57009. loop: "",
  57010. trapped: _ctx.visible,
  57011. "focus-trap-el": _ctx.rootRef,
  57012. "focus-start-el": _ctx.focusStartRef,
  57013. onReleaseRequested: _ctx.onCloseRequested
  57014. }, {
  57015. default: withCtx(() => [createElementVNode("div", {
  57016. ref: "rootRef",
  57017. class: normalizeClass([
  57018. _ctx.ns.b(),
  57019. _ctx.customClass,
  57020. _ctx.ns.is("draggable", _ctx.draggable),
  57021. _ctx.ns.is("dragging", _ctx.isDragging),
  57022. { [_ctx.ns.m("center")]: _ctx.center }
  57023. ]),
  57024. style: normalizeStyle(_ctx.customStyle),
  57025. tabindex: "-1",
  57026. onClick: _cache[7] || (_cache[7] = withModifiers(() => {}, ["stop"]))
  57027. }, [
  57028. _ctx.title !== null && _ctx.title !== void 0 ? (openBlock(), createElementBlock("div", {
  57029. key: 0,
  57030. ref: "headerRef",
  57031. class: normalizeClass([_ctx.ns.e("header"), { "show-close": _ctx.showClose }])
  57032. }, [createElementVNode("div", { class: normalizeClass(_ctx.ns.e("title")) }, [_ctx.iconComponent && _ctx.center ? (openBlock(), createBlock(_component_el_icon, {
  57033. key: 0,
  57034. class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
  57035. }, {
  57036. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]),
  57037. _: 1
  57038. }, 8, ["class"])) : createCommentVNode("v-if", true), createElementVNode("span", null, toDisplayString(_ctx.title), 1)], 2), _ctx.showClose ? (openBlock(), createElementBlock("button", {
  57039. key: 0,
  57040. type: "button",
  57041. class: normalizeClass(_ctx.ns.e("headerbtn")),
  57042. "aria-label": _ctx.t("el.messagebox.close"),
  57043. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")),
  57044. onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"]))
  57045. }, [createVNode(_component_el_icon, { class: normalizeClass(_ctx.ns.e("close")) }, {
  57046. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || "close")))]),
  57047. _: 1
  57048. }, 8, ["class"])], 42, _hoisted_2$1)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true),
  57049. createElementVNode("div", {
  57050. id: _ctx.contentId,
  57051. class: normalizeClass(_ctx.ns.e("content"))
  57052. }, [createElementVNode("div", { class: normalizeClass(_ctx.ns.e("container")) }, [_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (openBlock(), createBlock(_component_el_icon, {
  57053. key: 0,
  57054. class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
  57055. }, {
  57056. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))]),
  57057. _: 1
  57058. }, 8, ["class"])) : createCommentVNode("v-if", true), _ctx.hasMessage ? (openBlock(), createElementBlock("div", {
  57059. key: 1,
  57060. class: normalizeClass(_ctx.ns.e("message"))
  57061. }, [renderSlot(_ctx.$slots, "default", {}, () => [!_ctx.dangerouslyUseHTMLString ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
  57062. key: 0,
  57063. for: _ctx.showInput ? _ctx.inputId : void 0,
  57064. textContent: toDisplayString(_ctx.message)
  57065. }, null, 8, ["for", "textContent"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
  57066. key: 1,
  57067. for: _ctx.showInput ? _ctx.inputId : void 0,
  57068. innerHTML: _ctx.message
  57069. }, null, 8, ["for", "innerHTML"]))])], 2)) : createCommentVNode("v-if", true)], 2), withDirectives(createElementVNode("div", { class: normalizeClass(_ctx.ns.e("input")) }, [createVNode(_component_el_input, {
  57070. id: _ctx.inputId,
  57071. ref: "inputRef",
  57072. modelValue: _ctx.inputValue,
  57073. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
  57074. type: _ctx.inputType,
  57075. placeholder: _ctx.inputPlaceholder,
  57076. "aria-invalid": _ctx.validateError,
  57077. class: normalizeClass({ invalid: _ctx.validateError }),
  57078. onKeydown: withKeys(_ctx.handleInputEnter, ["enter"])
  57079. }, null, 8, [
  57080. "id",
  57081. "modelValue",
  57082. "type",
  57083. "placeholder",
  57084. "aria-invalid",
  57085. "class",
  57086. "onKeydown"
  57087. ]), createElementVNode("div", {
  57088. class: normalizeClass(_ctx.ns.e("errormsg")),
  57089. style: normalizeStyle({ visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden" })
  57090. }, toDisplayString(_ctx.editorErrorMessage), 7)], 2), [[vShow, _ctx.showInput]])], 10, _hoisted_3$1),
  57091. createElementVNode("div", { class: normalizeClass(_ctx.ns.e("btns")) }, [_ctx.showCancelButton ? (openBlock(), createBlock(_component_el_button, {
  57092. key: 0,
  57093. type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
  57094. text: _ctx.cancelButtonType === "text",
  57095. loading: _ctx.cancelButtonLoading,
  57096. "loading-icon": _ctx.cancelButtonLoadingIcon,
  57097. class: normalizeClass([_ctx.cancelButtonClass]),
  57098. round: _ctx.roundButton,
  57099. size: _ctx.btnSize,
  57100. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
  57101. onKeydown: _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
  57102. }, {
  57103. default: withCtx(() => [createTextVNode(toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)]),
  57104. _: 1
  57105. }, 8, [
  57106. "type",
  57107. "text",
  57108. "loading",
  57109. "loading-icon",
  57110. "class",
  57111. "round",
  57112. "size"
  57113. ])) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_button, {
  57114. ref: "confirmRef",
  57115. type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
  57116. text: _ctx.confirmButtonType === "text",
  57117. loading: _ctx.confirmButtonLoading,
  57118. "loading-icon": _ctx.confirmButtonLoadingIcon,
  57119. class: normalizeClass([_ctx.confirmButtonClasses]),
  57120. round: _ctx.roundButton,
  57121. disabled: _ctx.confirmButtonDisabled,
  57122. size: _ctx.btnSize,
  57123. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
  57124. onKeydown: _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
  57125. }, {
  57126. default: withCtx(() => [createTextVNode(toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)]),
  57127. _: 1
  57128. }, 8, [
  57129. "type",
  57130. "text",
  57131. "loading",
  57132. "loading-icon",
  57133. "class",
  57134. "round",
  57135. "disabled",
  57136. "size"
  57137. ]), [[vShow, _ctx.showConfirmButton]])], 2)
  57138. ], 6)]),
  57139. _: 3
  57140. }, 8, [
  57141. "trapped",
  57142. "focus-trap-el",
  57143. "focus-start-el",
  57144. "onReleaseRequested"
  57145. ])], 42, _hoisted_1$1)]),
  57146. _: 3
  57147. }, 8, [
  57148. "z-index",
  57149. "overlay-class",
  57150. "mask"
  57151. ]), [[vShow, _ctx.visible]])]),
  57152. _: 3
  57153. });
  57154. }
  57155. var src_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
  57156. //#endregion
  57157. //#region ../../packages/components/message-box/src/messageBox.ts
  57158. const messageInstance = /* @__PURE__ */ new Map();
  57159. const getAppendToElement = (props) => {
  57160. let appendTo = document.body;
  57161. if (props.appendTo) {
  57162. if (isString(props.appendTo)) appendTo = document.querySelector(props.appendTo);
  57163. if (isElement$1(props.appendTo)) appendTo = props.appendTo;
  57164. if (!isElement$1(appendTo)) {
  57165. /* @__PURE__ */ debugWarn("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  57166. appendTo = document.body;
  57167. }
  57168. }
  57169. return appendTo;
  57170. };
  57171. const initInstance = (props, container, appContext = null) => {
  57172. const vnode = createVNode(src_default, props, isFunction$1(props.message) || isVNode(props.message) ? { default: isFunction$1(props.message) ? props.message : () => props.message } : null);
  57173. vnode.appContext = appContext;
  57174. render(vnode, container);
  57175. getAppendToElement(props).appendChild(container.firstElementChild);
  57176. return vnode.component;
  57177. };
  57178. const genContainer = () => {
  57179. return document.createElement("div");
  57180. };
  57181. const showMessage = (options, appContext) => {
  57182. const container = genContainer();
  57183. options.onVanish = () => {
  57184. render(null, container);
  57185. messageInstance.delete(vm);
  57186. };
  57187. options.onAction = (action) => {
  57188. const currentMsg = messageInstance.get(vm);
  57189. let resolve;
  57190. if (options.showInput) resolve = {
  57191. value: vm.inputValue,
  57192. action
  57193. };
  57194. else resolve = action;
  57195. if (options.callback) options.callback(resolve, instance.proxy);
  57196. else if (action === "cancel" || action === "close") if (options.distinguishCancelAndClose && action !== "cancel") currentMsg.reject("close");
  57197. else currentMsg.reject("cancel");
  57198. else currentMsg.resolve(resolve);
  57199. };
  57200. const instance = initInstance(options, container, appContext);
  57201. const vm = instance.proxy;
  57202. for (const prop in options) if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) if (prop === "closeIcon" && isObject$1(options[prop])) vm[prop] = markRaw(options[prop]);
  57203. else vm[prop] = options[prop];
  57204. vm.visible = true;
  57205. return vm;
  57206. };
  57207. function MessageBox(options, appContext = null) {
  57208. if (!isClient) return Promise.reject();
  57209. let callback;
  57210. if (isString(options) || isVNode(options)) options = { message: options };
  57211. else callback = options.callback;
  57212. return new Promise((resolve, reject) => {
  57213. const vm = showMessage(options, appContext ?? MessageBox._context);
  57214. messageInstance.set(vm, {
  57215. options,
  57216. callback,
  57217. resolve,
  57218. reject
  57219. });
  57220. });
  57221. }
  57222. const MESSAGE_BOX_VARIANTS = [
  57223. "alert",
  57224. "confirm",
  57225. "prompt"
  57226. ];
  57227. const MESSAGE_BOX_DEFAULT_OPTS = {
  57228. alert: {
  57229. closeOnPressEscape: false,
  57230. closeOnClickModal: false
  57231. },
  57232. confirm: { showCancelButton: true },
  57233. prompt: {
  57234. showCancelButton: true,
  57235. showInput: true
  57236. }
  57237. };
  57238. MESSAGE_BOX_VARIANTS.forEach((boxType) => {
  57239. MessageBox[boxType] = messageBoxFactory(boxType);
  57240. });
  57241. function messageBoxFactory(boxType) {
  57242. return (message, title, options, appContext) => {
  57243. let titleOrOpts = "";
  57244. if (isObject$1(title)) {
  57245. options = title;
  57246. titleOrOpts = "";
  57247. } else if (isUndefined(title)) titleOrOpts = "";
  57248. else titleOrOpts = title;
  57249. return MessageBox(Object.assign({
  57250. title: titleOrOpts,
  57251. message,
  57252. type: "",
  57253. ...MESSAGE_BOX_DEFAULT_OPTS[boxType]
  57254. }, options, { boxType }), appContext);
  57255. };
  57256. }
  57257. MessageBox.close = () => {
  57258. messageInstance.forEach((_, vm) => {
  57259. vm.doClose();
  57260. });
  57261. messageInstance.clear();
  57262. };
  57263. MessageBox._context = null;
  57264. //#endregion
  57265. //#region ../../packages/components/message-box/index.ts
  57266. const _MessageBox = MessageBox;
  57267. _MessageBox.install = (app) => {
  57268. _MessageBox._context = app._context;
  57269. app.config.globalProperties.$msgbox = _MessageBox;
  57270. app.config.globalProperties.$messageBox = _MessageBox;
  57271. app.config.globalProperties.$alert = _MessageBox.alert;
  57272. app.config.globalProperties.$confirm = _MessageBox.confirm;
  57273. app.config.globalProperties.$prompt = _MessageBox.prompt;
  57274. };
  57275. const ElMessageBox = _MessageBox;
  57276. //#endregion
  57277. //#region ../../packages/components/notification/src/notification.ts
  57278. const notificationTypes = [
  57279. "primary",
  57280. "success",
  57281. "info",
  57282. "warning",
  57283. "error"
  57284. ];
  57285. /**
  57286. * @deprecated Removed after 3.0.0, Use `NotificationProps` instead.
  57287. */
  57288. const notificationProps = buildProps({
  57289. customClass: {
  57290. type: String,
  57291. default: ""
  57292. },
  57293. dangerouslyUseHTMLString: Boolean,
  57294. duration: {
  57295. type: Number,
  57296. default: 4500
  57297. },
  57298. icon: { type: iconPropType },
  57299. id: {
  57300. type: String,
  57301. default: ""
  57302. },
  57303. message: {
  57304. type: definePropType([
  57305. String,
  57306. Object,
  57307. Function
  57308. ]),
  57309. default: ""
  57310. },
  57311. offset: {
  57312. type: Number,
  57313. default: 0
  57314. },
  57315. onClick: {
  57316. type: definePropType(Function),
  57317. default: () => void 0
  57318. },
  57319. onClose: {
  57320. type: definePropType(Function),
  57321. required: true
  57322. },
  57323. position: {
  57324. type: String,
  57325. values: [
  57326. "top-right",
  57327. "top-left",
  57328. "bottom-right",
  57329. "bottom-left"
  57330. ],
  57331. default: "top-right"
  57332. },
  57333. showClose: {
  57334. type: Boolean,
  57335. default: true
  57336. },
  57337. title: {
  57338. type: String,
  57339. default: ""
  57340. },
  57341. type: {
  57342. type: String,
  57343. values: [...notificationTypes, ""],
  57344. default: ""
  57345. },
  57346. zIndex: Number,
  57347. closeIcon: {
  57348. type: iconPropType,
  57349. default: close_default
  57350. }
  57351. });
  57352. const notificationEmits = { destroy: () => true };
  57353. //#endregion
  57354. //#region ../../packages/components/notification/src/notification.vue?vue&type=script&setup=true&lang.ts
  57355. const _hoisted_1 = ["id"];
  57356. const _hoisted_2 = ["textContent"];
  57357. const _hoisted_3 = { key: 0 };
  57358. const _hoisted_4 = ["innerHTML"];
  57359. var notification_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
  57360. name: "ElNotification",
  57361. __name: "notification",
  57362. props: notificationProps,
  57363. emits: notificationEmits,
  57364. setup(__props, { expose: __expose }) {
  57365. const props = __props;
  57366. const { ns, zIndex } = useGlobalComponentSettings("notification");
  57367. const { nextZIndex, currentZIndex } = zIndex;
  57368. const visible = ref(false);
  57369. let timer = void 0;
  57370. const typeClass = computed(() => {
  57371. const type = props.type;
  57372. return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
  57373. });
  57374. const iconComponent = computed(() => {
  57375. if (!props.type) return props.icon;
  57376. return TypeComponentsMap[props.type] || props.icon;
  57377. });
  57378. const horizontalClass = computed(() => props.position.endsWith("right") ? "right" : "left");
  57379. const verticalProperty = computed(() => props.position.startsWith("top") ? "top" : "bottom");
  57380. const positionStyle = computed(() => {
  57381. return {
  57382. [verticalProperty.value]: `${props.offset}px`,
  57383. zIndex: props.zIndex ?? currentZIndex.value
  57384. };
  57385. });
  57386. function startTimer() {
  57387. if (props.duration > 0) ({stop: timer} = useTimeoutFn(() => {
  57388. if (visible.value) close();
  57389. }, props.duration));
  57390. }
  57391. function clearTimer() {
  57392. timer?.();
  57393. }
  57394. function close() {
  57395. visible.value = false;
  57396. }
  57397. function onKeydown(event) {
  57398. switch (getEventCode(event)) {
  57399. case EVENT_CODE.delete:
  57400. case EVENT_CODE.backspace:
  57401. clearTimer();
  57402. break;
  57403. case EVENT_CODE.esc:
  57404. if (visible.value) close();
  57405. break;
  57406. default:
  57407. startTimer();
  57408. break;
  57409. }
  57410. }
  57411. onMounted(() => {
  57412. startTimer();
  57413. nextZIndex();
  57414. visible.value = true;
  57415. });
  57416. useEventListener(document, "keydown", onKeydown);
  57417. __expose({
  57418. visible,
  57419. close
  57420. });
  57421. return (_ctx, _cache) => {
  57422. return openBlock(), createBlock(Transition, {
  57423. name: unref(ns).b("fade"),
  57424. onBeforeLeave: __props.onClose,
  57425. onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
  57426. persisted: ""
  57427. }, {
  57428. default: withCtx(() => [withDirectives(createElementVNode("div", {
  57429. id: __props.id,
  57430. class: normalizeClass([
  57431. unref(ns).b(),
  57432. __props.customClass,
  57433. horizontalClass.value
  57434. ]),
  57435. style: normalizeStyle(positionStyle.value),
  57436. role: "alert",
  57437. onMouseenter: clearTimer,
  57438. onMouseleave: startTimer,
  57439. onClick: _cache[0] || (_cache[0] = (...args) => __props.onClick && __props.onClick(...args))
  57440. }, [iconComponent.value ? (openBlock(), createBlock(unref(ElIcon), {
  57441. key: 0,
  57442. class: normalizeClass([unref(ns).e("icon"), typeClass.value])
  57443. }, {
  57444. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(iconComponent.value)))]),
  57445. _: 1
  57446. }, 8, ["class"])) : createCommentVNode("v-if", true), createElementVNode("div", { class: normalizeClass(unref(ns).e("group")) }, [
  57447. createElementVNode("h2", {
  57448. class: normalizeClass(unref(ns).e("title")),
  57449. textContent: toDisplayString(__props.title)
  57450. }, null, 10, _hoisted_2),
  57451. withDirectives(createElementVNode("div", {
  57452. class: normalizeClass(unref(ns).e("content")),
  57453. style: normalizeStyle(!!__props.title ? void 0 : { margin: 0 })
  57454. }, [renderSlot(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "), createElementVNode("p", { innerHTML: __props.message }, null, 8, _hoisted_4)], 2112))])], 6), [[vShow, __props.message]]),
  57455. __props.showClose ? (openBlock(), createBlock(unref(ElIcon), {
  57456. key: 0,
  57457. class: normalizeClass(unref(ns).e("closeBtn")),
  57458. onClick: withModifiers(close, ["stop"])
  57459. }, {
  57460. default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.closeIcon)))]),
  57461. _: 1
  57462. }, 8, ["class"])) : createCommentVNode("v-if", true)
  57463. ], 2)], 46, _hoisted_1), [[vShow, visible.value]])]),
  57464. _: 3
  57465. }, 8, ["name", "onBeforeLeave"]);
  57466. };
  57467. }
  57468. });
  57469. //#endregion
  57470. //#region ../../packages/components/notification/src/notification.vue
  57471. var notification_default = notification_vue_vue_type_script_setup_true_lang_default;
  57472. //#endregion
  57473. //#region ../../packages/components/notification/src/notify.ts
  57474. const notifications = {
  57475. "top-left": [],
  57476. "top-right": [],
  57477. "bottom-left": [],
  57478. "bottom-right": []
  57479. };
  57480. const GAP_SIZE = 16;
  57481. let seed = 1;
  57482. const notify = function(options = {}, context) {
  57483. if (!isClient) return { close: () => void 0 };
  57484. if (isString(options) || isVNode(options)) options = { message: options };
  57485. const position = options.position || "top-right";
  57486. let verticalOffset = options.offset || 0;
  57487. notifications[position].forEach(({ vm }) => {
  57488. verticalOffset += (vm.el?.offsetHeight || 0) + GAP_SIZE;
  57489. });
  57490. verticalOffset += GAP_SIZE;
  57491. const id = `notification_${seed++}`;
  57492. const userOnClose = options.onClose;
  57493. const props = {
  57494. ...options,
  57495. offset: verticalOffset,
  57496. id,
  57497. onClose: () => {
  57498. close(id, position, userOnClose);
  57499. }
  57500. };
  57501. let appendTo = document.body;
  57502. if (isElement$1(options.appendTo)) appendTo = options.appendTo;
  57503. else if (isString(options.appendTo)) appendTo = document.querySelector(options.appendTo);
  57504. if (!isElement$1(appendTo)) {
  57505. /* @__PURE__ */ debugWarn("ElNotification", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  57506. appendTo = document.body;
  57507. }
  57508. const container = document.createElement("div");
  57509. const vm = createVNode(notification_default, props, isFunction$1(props.message) ? props.message : isVNode(props.message) ? () => props.message : null);
  57510. vm.appContext = isUndefined(context) ? notify._context : context;
  57511. vm.props.onDestroy = () => {
  57512. render(null, container);
  57513. };
  57514. render(vm, container);
  57515. notifications[position].push({ vm });
  57516. appendTo.appendChild(container.firstElementChild);
  57517. return { close: () => {
  57518. vm.component.exposed.visible.value = false;
  57519. } };
  57520. };
  57521. notificationTypes.forEach((type) => {
  57522. notify[type] = (options = {}, appContext) => {
  57523. if (isString(options) || isVNode(options)) options = { message: options };
  57524. return notify({
  57525. ...options,
  57526. type
  57527. }, appContext);
  57528. };
  57529. });
  57530. /**
  57531. * This function gets called when user click `x` button or press `esc` or the time reached its limitation.
  57532. * Emitted by transition@before-leave event so that we can fetch the current notification.offsetHeight, if this was called
  57533. * by @after-leave the DOM element will be removed from the page thus we can no longer fetch the offsetHeight.
  57534. * @param {String} id notification id to be closed
  57535. * @param {Position} position the positioning strategy
  57536. * @param {Function} userOnClose the callback called when close passed by user
  57537. */
  57538. function close(id, position, userOnClose) {
  57539. const orientedNotifications = notifications[position];
  57540. const idx = orientedNotifications.findIndex(({ vm }) => vm.component?.props.id === id);
  57541. if (idx === -1) return;
  57542. const { vm } = orientedNotifications[idx];
  57543. if (!vm) return;
  57544. userOnClose?.(vm);
  57545. const removedHeight = vm.el.offsetHeight;
  57546. const verticalPos = position.split("-")[0];
  57547. orientedNotifications.splice(idx, 1);
  57548. const len = orientedNotifications.length;
  57549. if (len < 1) return;
  57550. for (let i = idx; i < len; i++) {
  57551. const { el, component } = orientedNotifications[i].vm;
  57552. const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
  57553. component.props.offset = pos;
  57554. }
  57555. }
  57556. function closeAll() {
  57557. for (const orientedNotifications of Object.values(notifications)) orientedNotifications.forEach(({ vm }) => {
  57558. vm.component.exposed.visible.value = false;
  57559. });
  57560. }
  57561. function updateOffsets(position = "top-right") {
  57562. let verticalOffset = notifications[position][0]?.vm.component?.props?.offset || 0;
  57563. for (const { vm } of notifications[position]) {
  57564. vm.component.props.offset = verticalOffset;
  57565. verticalOffset += (vm.el?.offsetHeight || 0) + GAP_SIZE;
  57566. }
  57567. }
  57568. notify.closeAll = closeAll;
  57569. notify.updateOffsets = updateOffsets;
  57570. notify._context = null;
  57571. //#endregion
  57572. //#region ../../packages/components/notification/index.ts
  57573. const ElNotification = withInstallFunction(notify, "$notify");
  57574. //#endregion
  57575. //#region ../../packages/element-plus/plugin.ts
  57576. var plugin_default = [
  57577. ElInfiniteScroll,
  57578. ElLoading,
  57579. ElMessage,
  57580. ElMessageBox,
  57581. ElNotification,
  57582. ElPopoverDirective
  57583. ];
  57584. //#endregion
  57585. //#region ../../packages/element-plus/defaults.ts
  57586. var defaults_default = makeInstaller([...component_default, ...plugin_default]);
  57587. //#endregion
  57588. //#region ../../packages/element-plus/index.ts
  57589. const install = defaults_default.install;
  57590. const version = defaults_default.version;
  57591. var element_plus_default = defaults_default;
  57592. //#endregion
  57593. var dayjs = import_dayjs_min.default;
  57594. export { BAR_MAP, BORDER_HORIZONTAL_WIDTH, CAROUSEL_ITEM_NAME, CASCADER_PANEL_INJECTION_KEY, CHANGE_EVENT, ClickOutside, picker_default as CommonPicker, CommonProps, DEFAULT_DIALOG_TRANSITION, DEFAULT_EMPTY_VALUES, DEFAULT_FORMATS_DATE, DEFAULT_FORMATS_DATEPICKER, DEFAULT_FORMATS_TIME, DEFAULT_STEP, DEFAULT_VALUE_ON_CLEAR, DROPDOWN_INJECTION_KEY, DROPDOWN_INSTANCE_INJECTION_KEY, DefaultProps, DynamicSizeGrid, DynamicSizeList, EVENT_CODE, Effect, ElAffix, ElAlert, ElAnchor, ElAnchorLink, ElAside, ElAutoResizer, ElAutocomplete, ElAvatar, ElAvatarGroup, ElBacktop, ElBadge, ElBreadcrumb, ElBreadcrumbItem, ElButton, ElButtonGroup, ElCalendar, ElCard, ElCarousel, ElCarouselItem, ElCascader, ElCascaderPanel, ElCheckTag, ElCheckbox, ElCheckboxButton, ElCheckboxGroup, ElCol, ElCollapse, ElCollapseItem, ElCollapseTransition, ElColorPicker, ElColorPickerPanel, ElConfigProvider, ElContainer, ElCountdown, ElDatePicker, ElDatePickerPanel, ElDescriptions, ElDescriptionsItem, ElDialog, ElDivider, ElDrawer, ElDropdown, ElDropdownItem, ElDropdownMenu, ElEmpty, ElFooter, ElForm, ElFormItem, ElHeader, ElIcon, ElImage, ElImageViewer, ElInfiniteScroll, ElInput, ElInputNumber, ElInputTag, ElLink, ElLoading, vLoading as ElLoadingDirective, vLoading, Loading as ElLoadingService, ElMain, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElNotification, ElOption, ElOptionGroup, ElOverlay, ElPageHeader, ElPagination, ElPopconfirm, ElPopover, ElPopoverDirective, ElPopper, arrow_default as ElPopperArrow, content_default as ElPopperContent, trigger_default as ElPopperTrigger, ElProgress, ElRadio, ElRadioButton, ElRadioGroup, ElRate, ElResult, ElRow, ElScrollbar, ElSegmented, ElSelect, ElSelectV2, ElSkeleton, ElSkeletonItem, ElSlider, ElSpace, ElSplitter, ElSplitterPanel, ElStatistic, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTableV2, ElTabs, ElTag, ElText, ElTimePicker, ElTimeSelect, ElTimeline, ElTimelineItem, ElTooltip, ElTour, ElTourStep, ElTransfer, ElTree, ElTreeSelect, ElTreeV2, ElUpload, ElWatermark, FIRST_KEYS, FIRST_LAST_KEYS, FORWARD_REF_INJECTION_KEY, FixedSizeGrid, FixedSizeList, GAP, ID_INJECTION_KEY, INPUT_EVENT, INSTALLED_KEY, IconComponentMap, IconMap, LAST_KEYS, LEFT_CHECK_CHANGE_EVENT, MENU_INJECTION_KEY, MESSAGE_DEFAULT_PLACEMENT, MINIMUM_INPUT_WIDTH, Mousewheel, NODE_INSTANCE_INJECTION_KEY, PICKER_BASE_INJECTION_KEY, PICKER_POPPER_OPTIONS_INJECTION_KEY, POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY, RIGHT_CHECK_CHANGE_EVENT, ROOT_COMMON_COLOR_INJECTION_KEY, ROOT_COMMON_PICKER_INJECTION_KEY, ROOT_PICKER_INJECTION_KEY, ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, ROOT_TREE_INJECTION_KEY, RowAlign, RowJustify, SCOPE, SIZE_INJECTION_KEY, STEPS_INJECTION_KEY, SUB_MENU_INJECTION_KEY, TIMELINE_INJECTION_KEY, TOOLTIP_INJECTION_KEY, TREE_NODE_MAP_INJECTION_KEY, TableV2, Alignment as TableV2Alignment, FixedDir as TableV2FixedDir, placeholderSign as TableV2Placeholder, SortOrder as TableV2SortOrder, panel_time_pick_default as TimePickPanel, TrapFocus, UPDATE_MODEL_EVENT, WEEK_DAYS, ZINDEX_INJECTION_KEY, affixEmits, affixProps, alertEffects, alertEmits, alertProps, anchorEmits, anchorProps, ariaProps, arrowMiddleware, autoResizerProps, autocompleteEmits, autocompleteProps, avatarEmits, avatarGroupContextKey, avatarGroupProps, avatarProps, backtopEmits, backtopProps, badgeProps, breadcrumbItemProps, breadcrumbKey, breadcrumbProps, buildLocaleContext, buildTimeList, buildTranslator, buttonEmits, buttonGroupContextKey, buttonNativeTypes, buttonProps, buttonTypes, calendarEmits, calendarProps, cardContextKey, cardProps, carouselContextKey, carouselEmits, carouselItemProps, carouselProps, cascaderEmits, cascaderPanelEmits, cascaderPanelProps, cascaderProps, checkTagEmits, checkTagProps, checkboxDefaultProps, checkboxEmits, checkboxGroupContextKey, checkboxGroupEmits, checkboxGroupProps, checkboxProps, checkboxPropsDefaults, colProps, collapseContextKey, collapseEmits, collapseItemProps, collapseProps, colorPickerEmits, colorPickerPanelContextKey, colorPickerPanelEmits, colorPickerPanelProps, colorPickerProps, colorPickerPropsDefaults, columnAlignment, componentSizeMap, componentSizes, configProviderContextKey, configProviderProps, countdownEmits, countdownProps, createModelToggleComposable, dateEquals, datePickTypes, datePickerPanelProps, datePickerProps, dayOrDaysToDate, dayjs, element_plus_default as default, defaultInitialZIndex, defaultNamespace, defaultProps, descriptionItemProps, descriptionProps, dialogContextKey, dialogEmits, dialogInjectionKey, dialogProps, dialogPropsDefaults, dividerProps, drawerEmits, drawerProps, dropdownItemProps, dropdownMenuProps, dropdownProps, elPaginationKey, emitChangeFn, emptyProps, emptyValuesContextKey, extractDateFormat, extractTimeFormat, formContextKey, formEmits, formItemContextKey, formItemProps, formItemValidateStates, formMetaProps, formProps, formatter, genFileId, getPositionDataWithUnit, iconProps, imageEmits, imageProps, imageViewerEmits, imageViewerProps, inputEmits, inputNumberEmits, inputNumberProps, inputProps, inputPropsDefaults, inputTagEmits, inputTagProps, install, linkEmits, linkProps, localeContextKey, makeInstaller, makeList, mentionDefaultProps, mentionEmits, mentionProps, menuEmits, menuItemEmits, menuItemGroupProps, menuItemProps, menuProps, messageConfig, messageDefaults, messageEmits, messagePlacement, messageProps, messageTypes, namespaceContextKey, notificationEmits, notificationProps, notificationTypes, overlayEmits, overlayProps, pageHeaderEmits, pageHeaderProps, paginationEmits, paginationProps, parseDate, popconfirmEmits, popconfirmProps, popoverEmits, popoverProps, popoverPropsDefaults, popperArrowProps, popperArrowPropsDefaults, popperContentEmits, popperContentProps, popperContentPropsDefaults, popperCoreConfigProps, popperCoreConfigPropsDefaults, popperProps, popperTriggerProps, progressProps, provideGlobalConfig, radioButtonProps, radioButtonPropsDefaults, radioDefaultProps, radioEmits, radioGroupEmits, radioGroupKey, radioGroupProps, radioGroupPropsDefaults, radioProps, radioPropsBase, radioPropsDefaults, rangeArr, rateEmits, rateProps, renderThumbStyle, resultProps, roleTypes, rowContextKey, rowProps, scrollbarContextKey, scrollbarEmits, scrollbarProps, segmentedEmits, segmentedProps, selectEmits, selectGroupKey, selectKey, selectProps, selectV2InjectionKey, skeletonItemProps, skeletonProps, sliderContextKey, sliderEmits, sliderProps, spaceItemProps, spaceProps, splitterEmits, splitterPanelEmits, splitterPanelProps, splitterProps, statisticProps, stepProps, stepsEmits, stepsProps, subMenuProps, switchEmits, switchProps, tabBarProps, tabNavEmits, tabNavProps, tabPaneProps, tableV2Props, tableV2RowProps, tabsEmits, tabsProps, tabsRootContextKey, tagEmits, tagProps, textProps, thumbProps, timePickerDefaultProps, timePickerRangeTriggerProps, timePickerRngeTriggerProps, timeSelectProps, timeUnits, timelineItemProps, timelineProps, tooltipEmits, tourContentEmits, tourContentProps, tourEmits, tourPlacements, tourProps, tourStepEmits, tourStepProps, tourStrategies, transferCheckedChangeFn, transferEmits, transferProps, translate, treeEmits, treeProps, uploadBaseProps, uploadBasePropsDefaults, uploadContentProps, uploadContentPropsDefaults, uploadContextKey, uploadDraggerEmits, uploadDraggerProps, uploadListEmits, uploadListProps, uploadListTypes, uploadProps, uploadPropsDefaults, useAriaProps, useAttrs, useCalcInputWidth, useCascaderConfig, useComposition, useCursor, useDelayedRender, useDelayedToggle, useDelayedToggleProps, useDelayedTogglePropsDefaults, useDeprecated, useDialog, useDisabled, useDraggable, useEmptyValues, useEmptyValuesProps, useEscapeKeydown, useFloating, useFloatingProps, useFocus, useFocusController, useFormDisabled, useFormItem, useFormItemInputId, useFormSize, useForwardRef, useForwardRefDirective, useGetDerivedNamespace, useGlobalComponentSettings, useGlobalConfig, useGlobalSize, useId, useIdInjection, useLocale, useLockscreen, useModal, useModelToggle, useModelToggleEmits, useModelToggleProps, useNamespace, useOrderedChildren, usePopper, usePopperArrowProps, usePopperContainer, usePopperContainerId, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps, usePopperProps, usePopperTriggerProps, usePreventGlobal, useProp, useSameTarget, useSize, useSizeProp, useSizeProps, useSpace, useTeleport, useThrottleRender, useTimeout, useTooltipContentProps, useTooltipContentPropsDefaults, useTooltipModelToggle, useTooltipModelToggleEmits, useTooltipModelToggleProps, useTooltipProps, useTooltipTriggerProps, useTooltipTriggerPropsDefaults, useTransitionFallthrough, useTransitionFallthroughEmits, useZIndex, vRepeatClick, valueEquals, version, virtualizedGridProps, virtualizedListProps, virtualizedProps, virtualizedScrollbarProps, watermarkProps, zIndexContextKey };