| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806 |
- import { createRequire } from "node:module";
- import fs from "node:fs";
- import path, { dirname, resolve } from "node:path";
- import { fileURLToPath } from "node:url";
- import { createViteServerRpc } from "@vue/devtools-core";
- import { getViteRpcServer, setViteServerContext } from "@vue/devtools-kit";
- import sirv from "sirv";
- import { normalizePath } from "vite";
- import Inspect from "vite-plugin-inspect";
- import VueInspector from "vite-plugin-vue-inspector";
- import fsp from "node:fs/promises";
- //#region \0rolldown/runtime.js
- var __create = Object.create;
- var __defProp = Object.defineProperty;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __getProtoOf = Object.getPrototypeOf;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
- var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
- key = keys[i];
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
- get: ((k) => from[k]).bind(null, key),
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
- });
- }
- return to;
- };
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
- value: mod,
- enumerable: true
- }) : target, mod));
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
- //#endregion
- //#region ../../node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs
- let enabled = true;
- const globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
- /**
- * Detect how much colors the current terminal supports
- */
- let supportLevel = 0;
- if (globalVar.process && globalVar.process.env && globalVar.process.stdout) {
- const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env;
- if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") enabled = false;
- else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") enabled = true;
- else if (TERM === "dumb") enabled = false;
- else if ("CI" in globalVar.process.env && [
- "TRAVIS",
- "CIRCLECI",
- "APPVEYOR",
- "GITLAB_CI",
- "GITHUB_ACTIONS",
- "BUILDKITE",
- "DRONE"
- ].some((vendor) => vendor in globalVar.process.env)) enabled = true;
- else enabled = process.stdout.isTTY;
- if (enabled) if (process.platform === "win32") supportLevel = 3;
- else if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) supportLevel = 3;
- else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) supportLevel = 2;
- else supportLevel = 1;
- }
- let options = {
- enabled,
- supportLevel
- };
- function kolorist(start, end, level = 1) {
- const open = `\x1b[${start}m`;
- const close = `\x1b[${end}m`;
- const regex = new RegExp(`\\x1b\\[${end}m`, "g");
- return (str) => {
- return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str;
- };
- }
- kolorist(0, 0);
- const bold = kolorist(1, 22);
- const dim = kolorist(2, 22);
- kolorist(3, 23);
- kolorist(4, 24);
- kolorist(7, 27);
- kolorist(8, 28);
- kolorist(9, 29);
- kolorist(30, 39);
- kolorist(31, 39);
- const green = kolorist(32, 39);
- const yellow = kolorist(33, 39);
- kolorist(34, 39);
- kolorist(35, 39);
- const cyan = kolorist(36, 39);
- kolorist(97, 39);
- kolorist(90, 39);
- kolorist(37, 39);
- kolorist(91, 39);
- kolorist(92, 39);
- kolorist(93, 39);
- kolorist(94, 39);
- kolorist(95, 39);
- kolorist(96, 39);
- kolorist(40, 49);
- kolorist(41, 49);
- kolorist(42, 49);
- kolorist(43, 49);
- kolorist(44, 49);
- kolorist(45, 49);
- kolorist(46, 49);
- kolorist(107, 49);
- kolorist(100, 49);
- kolorist(101, 49);
- kolorist(102, 49);
- kolorist(103, 49);
- kolorist(104, 49);
- kolorist(105, 49);
- kolorist(106, 49);
- kolorist(47, 49);
- const DIR_CLIENT = resolve(typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url)), "../client");
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
- var require_array = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.splitWhen = exports.flatten = void 0;
- function flatten(items) {
- return items.reduce((collection, item) => [].concat(collection, item), []);
- }
- exports.flatten = flatten;
- function splitWhen(items, predicate) {
- const result = [[]];
- let groupIndex = 0;
- for (const item of items) if (predicate(item)) {
- groupIndex++;
- result[groupIndex] = [];
- } else result[groupIndex].push(item);
- return result;
- }
- exports.splitWhen = splitWhen;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/errno.js
- var require_errno = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isEnoentCodeError = void 0;
- function isEnoentCodeError(error) {
- return error.code === "ENOENT";
- }
- exports.isEnoentCodeError = isEnoentCodeError;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/fs.js
- var require_fs$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.createDirentFromStats = void 0;
- var DirentFromStats = class {
- constructor(name, stats) {
- this.name = name;
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
- this.isDirectory = stats.isDirectory.bind(stats);
- this.isFIFO = stats.isFIFO.bind(stats);
- this.isFile = stats.isFile.bind(stats);
- this.isSocket = stats.isSocket.bind(stats);
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
- }
- };
- function createDirentFromStats(name, stats) {
- return new DirentFromStats(name, stats);
- }
- exports.createDirentFromStats = createDirentFromStats;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js
- var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
- const os$1 = __require("os");
- const path$9 = __require("path");
- const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
- const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
- /**
- * All non-escaped special characters.
- * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
- * Windows: (){}[], !+@ before (, ! at the beginning.
- */
- const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
- const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
- /**
- * The device path (\\.\ or \\?\).
- * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
- */
- const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
- /**
- * All backslashes except those escaping special characters.
- * Windows: !()+@{}
- * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
- */
- const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
- /**
- * Designed to work only with simple paths: `dir\\file`.
- */
- function unixify(filepath) {
- return filepath.replace(/\\/g, "/");
- }
- exports.unixify = unixify;
- function makeAbsolute(cwd, filepath) {
- return path$9.resolve(cwd, filepath);
- }
- exports.makeAbsolute = makeAbsolute;
- function removeLeadingDotSegment(entry) {
- if (entry.charAt(0) === ".") {
- const secondCharactery = entry.charAt(1);
- if (secondCharactery === "/" || secondCharactery === "\\") return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
- }
- return entry;
- }
- exports.removeLeadingDotSegment = removeLeadingDotSegment;
- exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
- function escapeWindowsPath(pattern) {
- return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
- }
- exports.escapeWindowsPath = escapeWindowsPath;
- function escapePosixPath(pattern) {
- return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
- }
- exports.escapePosixPath = escapePosixPath;
- exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
- function convertWindowsPathToPattern(filepath) {
- return escapeWindowsPath(filepath).replace(DOS_DEVICE_PATH_RE, "//$1").replace(WINDOWS_BACKSLASHES_RE, "/");
- }
- exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
- function convertPosixPathToPattern(filepath) {
- return escapePosixPath(filepath);
- }
- exports.convertPosixPathToPattern = convertPosixPathToPattern;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/is-extglob@2.1.1/node_modules/is-extglob/index.js
- var require_is_extglob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- /*!
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
- *
- * Copyright (c) 2014-2016, Jon Schlinkert.
- * Licensed under the MIT License.
- */
- module.exports = function isExtglob(str) {
- if (typeof str !== "string" || str === "") return false;
- var match;
- while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
- if (match[2]) return true;
- str = str.slice(match.index + match[0].length);
- }
- return false;
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/is-glob@4.0.3/node_modules/is-glob/index.js
- var require_is_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- /*!
- * is-glob <https://github.com/jonschlinkert/is-glob>
- *
- * Copyright (c) 2014-2017, Jon Schlinkert.
- * Released under the MIT License.
- */
- var isExtglob = require_is_extglob();
- var chars = {
- "{": "}",
- "(": ")",
- "[": "]"
- };
- var strictCheck = function(str) {
- if (str[0] === "!") return true;
- var index = 0;
- var pipeIndex = -2;
- var closeSquareIndex = -2;
- var closeCurlyIndex = -2;
- var closeParenIndex = -2;
- var backSlashIndex = -2;
- while (index < str.length) {
- if (str[index] === "*") return true;
- if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) return true;
- if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
- if (closeSquareIndex < index) closeSquareIndex = str.indexOf("]", index);
- if (closeSquareIndex > index) {
- if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) return true;
- }
- }
- if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
- closeCurlyIndex = str.indexOf("}", index);
- if (closeCurlyIndex > index) {
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) return true;
- }
- }
- if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
- closeParenIndex = str.indexOf(")", index);
- if (closeParenIndex > index) {
- backSlashIndex = str.indexOf("\\", index);
- if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
- }
- }
- if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
- if (pipeIndex < index) pipeIndex = str.indexOf("|", index);
- if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
- closeParenIndex = str.indexOf(")", pipeIndex);
- if (closeParenIndex > pipeIndex) {
- backSlashIndex = str.indexOf("\\", pipeIndex);
- if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) return true;
- }
- }
- }
- if (str[index] === "\\") {
- var open = str[index + 1];
- index += 2;
- var close = chars[open];
- if (close) {
- var n = str.indexOf(close, index);
- if (n !== -1) index = n + 1;
- }
- if (str[index] === "!") return true;
- } else index++;
- }
- return false;
- };
- var relaxedCheck = function(str) {
- if (str[0] === "!") return true;
- var index = 0;
- while (index < str.length) {
- if (/[*?{}()[\]]/.test(str[index])) return true;
- if (str[index] === "\\") {
- var open = str[index + 1];
- index += 2;
- var close = chars[open];
- if (close) {
- var n = str.indexOf(close, index);
- if (n !== -1) index = n + 1;
- }
- if (str[index] === "!") return true;
- } else index++;
- }
- return false;
- };
- module.exports = function isGlob(str, options) {
- if (typeof str !== "string" || str === "") return false;
- if (isExtglob(str)) return true;
- var check = strictCheck;
- if (options && options.strict === false) check = relaxedCheck;
- return check(str);
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.js
- var require_glob_parent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- var isGlob = require_is_glob();
- var pathPosixDirname = __require("path").posix.dirname;
- var isWin32 = __require("os").platform() === "win32";
- var slash = "/";
- var backslash = /\\/g;
- var enclosure = /[\{\[].*[\}\]]$/;
- var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
- var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
- /**
- * @param {string} str
- * @param {Object} opts
- * @param {boolean} [opts.flipBackslashes=true]
- * @returns {string}
- */
- module.exports = function globParent(str, opts) {
- if (Object.assign({ flipBackslashes: true }, opts).flipBackslashes && isWin32 && str.indexOf(slash) < 0) str = str.replace(backslash, slash);
- if (enclosure.test(str)) str += slash;
- str += "a";
- do
- str = pathPosixDirname(str);
- while (isGlob(str) || globby.test(str));
- return str.replace(escaped, "$1");
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
- var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- exports.isInteger = (num) => {
- if (typeof num === "number") return Number.isInteger(num);
- if (typeof num === "string" && num.trim() !== "") return Number.isInteger(Number(num));
- return false;
- };
- /**
- * Find a node of the given type
- */
- exports.find = (node, type) => node.nodes.find((node) => node.type === type);
- /**
- * Find a node of the given type
- */
- exports.exceedsLimit = (min, max, step = 1, limit) => {
- if (limit === false) return false;
- if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
- return (Number(max) - Number(min)) / Number(step) >= limit;
- };
- /**
- * Escape the given node with '\\' before node.value
- */
- exports.escapeNode = (block, n = 0, type) => {
- const node = block.nodes[n];
- if (!node) return;
- if (type && node.type === type || node.type === "open" || node.type === "close") {
- if (node.escaped !== true) {
- node.value = "\\" + node.value;
- node.escaped = true;
- }
- }
- };
- /**
- * Returns true if the given brace node should be enclosed in literal braces
- */
- exports.encloseBrace = (node) => {
- if (node.type !== "brace") return false;
- if (node.commas >> 0 + node.ranges >> 0 === 0) {
- node.invalid = true;
- return true;
- }
- return false;
- };
- /**
- * Returns true if a brace node is invalid.
- */
- exports.isInvalidBrace = (block) => {
- if (block.type !== "brace") return false;
- if (block.invalid === true || block.dollar) return true;
- if (block.commas >> 0 + block.ranges >> 0 === 0) {
- block.invalid = true;
- return true;
- }
- if (block.open !== true || block.close !== true) {
- block.invalid = true;
- return true;
- }
- return false;
- };
- /**
- * Returns true if a node is an open or close node
- */
- exports.isOpenOrClose = (node) => {
- if (node.type === "open" || node.type === "close") return true;
- return node.open === true || node.close === true;
- };
- /**
- * Reduce an array of text nodes.
- */
- exports.reduce = (nodes) => nodes.reduce((acc, node) => {
- if (node.type === "text") acc.push(node.value);
- if (node.type === "range") node.type = "text";
- return acc;
- }, []);
- /**
- * Flatten an array
- */
- exports.flatten = (...args) => {
- const result = [];
- const flat = (arr) => {
- for (let i = 0; i < arr.length; i++) {
- const ele = arr[i];
- if (Array.isArray(ele)) {
- flat(ele);
- continue;
- }
- if (ele !== void 0) result.push(ele);
- }
- return result;
- };
- flat(args);
- return result;
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
- var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const utils = require_utils$3();
- module.exports = (ast, options = {}) => {
- const stringify = (node, parent = {}) => {
- const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
- let output = "";
- if (node.value) {
- if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) return "\\" + node.value;
- return node.value;
- }
- if (node.value) return node.value;
- if (node.nodes) for (const child of node.nodes) output += stringify(child);
- return output;
- };
- return stringify(ast);
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/is-number@7.0.0/node_modules/is-number/index.js
- /*!
- * is-number <https://github.com/jonschlinkert/is-number>
- *
- * Copyright (c) 2014-present, Jon Schlinkert.
- * Released under the MIT License.
- */
- var require_is_number = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- module.exports = function(num) {
- if (typeof num === "number") return num - num === 0;
- if (typeof num === "string" && num.trim() !== "") return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
- return false;
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/to-regex-range@5.0.1/node_modules/to-regex-range/index.js
- /*!
- * to-regex-range <https://github.com/micromatch/to-regex-range>
- *
- * Copyright (c) 2015-present, Jon Schlinkert.
- * Released under the MIT License.
- */
- var require_to_regex_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const isNumber = require_is_number();
- const toRegexRange = (min, max, options) => {
- if (isNumber(min) === false) throw new TypeError("toRegexRange: expected the first argument to be a number");
- if (max === void 0 || min === max) return String(min);
- if (isNumber(max) === false) throw new TypeError("toRegexRange: expected the second argument to be a number.");
- let opts = {
- relaxZeros: true,
- ...options
- };
- if (typeof opts.strictZeros === "boolean") opts.relaxZeros = opts.strictZeros === false;
- let relax = String(opts.relaxZeros);
- let shorthand = String(opts.shorthand);
- let capture = String(opts.capture);
- let wrap = String(opts.wrap);
- let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
- if (toRegexRange.cache.hasOwnProperty(cacheKey)) return toRegexRange.cache[cacheKey].result;
- let a = Math.min(min, max);
- let b = Math.max(min, max);
- if (Math.abs(a - b) === 1) {
- let result = min + "|" + max;
- if (opts.capture) return `(${result})`;
- if (opts.wrap === false) return result;
- return `(?:${result})`;
- }
- let isPadded = hasPadding(min) || hasPadding(max);
- let state = {
- min,
- max,
- a,
- b
- };
- let positives = [];
- let negatives = [];
- if (isPadded) {
- state.isPadded = isPadded;
- state.maxLen = String(state.max).length;
- }
- if (a < 0) {
- negatives = splitToPatterns(b < 0 ? Math.abs(b) : 1, Math.abs(a), state, opts);
- a = state.a = 0;
- }
- if (b >= 0) positives = splitToPatterns(a, b, state, opts);
- state.negatives = negatives;
- state.positives = positives;
- state.result = collatePatterns(negatives, positives, opts);
- if (opts.capture === true) state.result = `(${state.result})`;
- else if (opts.wrap !== false && positives.length + negatives.length > 1) state.result = `(?:${state.result})`;
- toRegexRange.cache[cacheKey] = state;
- return state.result;
- };
- function collatePatterns(neg, pos, options) {
- let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
- let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
- let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
- return onlyNegative.concat(intersected).concat(onlyPositive).join("|");
- }
- function splitToRanges(min, max) {
- let nines = 1;
- let zeros = 1;
- let stop = countNines(min, nines);
- let stops = new Set([max]);
- while (min <= stop && stop <= max) {
- stops.add(stop);
- nines += 1;
- stop = countNines(min, nines);
- }
- stop = countZeros(max + 1, zeros) - 1;
- while (min < stop && stop <= max) {
- stops.add(stop);
- zeros += 1;
- stop = countZeros(max + 1, zeros) - 1;
- }
- stops = [...stops];
- stops.sort(compare);
- return stops;
- }
- /**
- * Convert a range to a regex pattern
- * @param {Number} `start`
- * @param {Number} `stop`
- * @return {String}
- */
- function rangeToPattern(start, stop, options) {
- if (start === stop) return {
- pattern: start,
- count: [],
- digits: 0
- };
- let zipped = zip(start, stop);
- let digits = zipped.length;
- let pattern = "";
- let count = 0;
- for (let i = 0; i < digits; i++) {
- let [startDigit, stopDigit] = zipped[i];
- if (startDigit === stopDigit) pattern += startDigit;
- else if (startDigit !== "0" || stopDigit !== "9") pattern += toCharacterClass(startDigit, stopDigit, options);
- else count++;
- }
- if (count) pattern += options.shorthand === true ? "\\d" : "[0-9]";
- return {
- pattern,
- count: [count],
- digits
- };
- }
- function splitToPatterns(min, max, tok, options) {
- let ranges = splitToRanges(min, max);
- let tokens = [];
- let start = min;
- let prev;
- for (let i = 0; i < ranges.length; i++) {
- let max = ranges[i];
- let obj = rangeToPattern(String(start), String(max), options);
- let zeros = "";
- if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
- if (prev.count.length > 1) prev.count.pop();
- prev.count.push(obj.count[0]);
- prev.string = prev.pattern + toQuantifier(prev.count);
- start = max + 1;
- continue;
- }
- if (tok.isPadded) zeros = padZeros(max, tok, options);
- obj.string = zeros + obj.pattern + toQuantifier(obj.count);
- tokens.push(obj);
- start = max + 1;
- prev = obj;
- }
- return tokens;
- }
- function filterPatterns(arr, comparison, prefix, intersection, options) {
- let result = [];
- for (let ele of arr) {
- let { string } = ele;
- if (!intersection && !contains(comparison, "string", string)) result.push(prefix + string);
- if (intersection && contains(comparison, "string", string)) result.push(prefix + string);
- }
- return result;
- }
- /**
- * Zip strings
- */
- function zip(a, b) {
- let arr = [];
- for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
- return arr;
- }
- function compare(a, b) {
- return a > b ? 1 : b > a ? -1 : 0;
- }
- function contains(arr, key, val) {
- return arr.some((ele) => ele[key] === val);
- }
- function countNines(min, len) {
- return Number(String(min).slice(0, -len) + "9".repeat(len));
- }
- function countZeros(integer, zeros) {
- return integer - integer % Math.pow(10, zeros);
- }
- function toQuantifier(digits) {
- let [start = 0, stop = ""] = digits;
- if (stop || start > 1) return `{${start + (stop ? "," + stop : "")}}`;
- return "";
- }
- function toCharacterClass(a, b, options) {
- return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
- }
- function hasPadding(str) {
- return /^-?(0+)\d/.test(str);
- }
- function padZeros(value, tok, options) {
- if (!tok.isPadded) return value;
- let diff = Math.abs(tok.maxLen - String(value).length);
- let relax = options.relaxZeros !== false;
- switch (diff) {
- case 0: return "";
- case 1: return relax ? "0?" : "0";
- case 2: return relax ? "0{0,2}" : "00";
- default: return relax ? `0{0,${diff}}` : `0{${diff}}`;
- }
- }
- /**
- * Cache
- */
- toRegexRange.cache = {};
- toRegexRange.clearCache = () => toRegexRange.cache = {};
- /**
- * Expose `toRegexRange`
- */
- module.exports = toRegexRange;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fill-range@7.1.1/node_modules/fill-range/index.js
- /*!
- * fill-range <https://github.com/jonschlinkert/fill-range>
- *
- * Copyright (c) 2014-present, Jon Schlinkert.
- * Licensed under the MIT License.
- */
- var require_fill_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const util$1 = __require("util");
- const toRegexRange = require_to_regex_range();
- const isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
- const transform = (toNumber) => {
- return (value) => toNumber === true ? Number(value) : String(value);
- };
- const isValidValue = (value) => {
- return typeof value === "number" || typeof value === "string" && value !== "";
- };
- const isNumber = (num) => Number.isInteger(+num);
- const zeros = (input) => {
- let value = `${input}`;
- let index = -1;
- if (value[0] === "-") value = value.slice(1);
- if (value === "0") return false;
- while (value[++index] === "0");
- return index > 0;
- };
- const stringify = (start, end, options) => {
- if (typeof start === "string" || typeof end === "string") return true;
- return options.stringify === true;
- };
- const pad = (input, maxLength, toNumber) => {
- if (maxLength > 0) {
- let dash = input[0] === "-" ? "-" : "";
- if (dash) input = input.slice(1);
- input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
- }
- if (toNumber === false) return String(input);
- return input;
- };
- const toMaxLen = (input, maxLength) => {
- let negative = input[0] === "-" ? "-" : "";
- if (negative) {
- input = input.slice(1);
- maxLength--;
- }
- while (input.length < maxLength) input = "0" + input;
- return negative ? "-" + input : input;
- };
- const toSequence = (parts, options, maxLen) => {
- parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
- parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
- let prefix = options.capture ? "" : "?:";
- let positives = "";
- let negatives = "";
- let result;
- if (parts.positives.length) positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
- if (parts.negatives.length) negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
- if (positives && negatives) result = `${positives}|${negatives}`;
- else result = positives || negatives;
- if (options.wrap) return `(${prefix}${result})`;
- return result;
- };
- const toRange = (a, b, isNumbers, options) => {
- if (isNumbers) return toRegexRange(a, b, {
- wrap: false,
- ...options
- });
- let start = String.fromCharCode(a);
- if (a === b) return start;
- return `[${start}-${String.fromCharCode(b)}]`;
- };
- const toRegex = (start, end, options) => {
- if (Array.isArray(start)) {
- let wrap = options.wrap === true;
- let prefix = options.capture ? "" : "?:";
- return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
- }
- return toRegexRange(start, end, options);
- };
- const rangeError = (...args) => {
- return /* @__PURE__ */ new RangeError("Invalid range arguments: " + util$1.inspect(...args));
- };
- const invalidRange = (start, end, options) => {
- if (options.strictRanges === true) throw rangeError([start, end]);
- return [];
- };
- const invalidStep = (step, options) => {
- if (options.strictRanges === true) throw new TypeError(`Expected step "${step}" to be a number`);
- return [];
- };
- const fillNumbers = (start, end, step = 1, options = {}) => {
- let a = Number(start);
- let b = Number(end);
- if (!Number.isInteger(a) || !Number.isInteger(b)) {
- if (options.strictRanges === true) throw rangeError([start, end]);
- return [];
- }
- if (a === 0) a = 0;
- if (b === 0) b = 0;
- let descending = a > b;
- let startString = String(start);
- let endString = String(end);
- let stepString = String(step);
- step = Math.max(Math.abs(step), 1);
- let padded = zeros(startString) || zeros(endString) || zeros(stepString);
- let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
- let toNumber = padded === false && stringify(start, end, options) === false;
- let format = options.transform || transform(toNumber);
- if (options.toRegex && step === 1) return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
- let parts = {
- negatives: [],
- positives: []
- };
- let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
- let range = [];
- let index = 0;
- while (descending ? a >= b : a <= b) {
- if (options.toRegex === true && step > 1) push(a);
- else range.push(pad(format(a, index), maxLen, toNumber));
- a = descending ? a - step : a + step;
- index++;
- }
- if (options.toRegex === true) return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, {
- wrap: false,
- ...options
- });
- return range;
- };
- const fillLetters = (start, end, step = 1, options = {}) => {
- if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) return invalidRange(start, end, options);
- let format = options.transform || ((val) => String.fromCharCode(val));
- let a = `${start}`.charCodeAt(0);
- let b = `${end}`.charCodeAt(0);
- let descending = a > b;
- let min = Math.min(a, b);
- let max = Math.max(a, b);
- if (options.toRegex && step === 1) return toRange(min, max, false, options);
- let range = [];
- let index = 0;
- while (descending ? a >= b : a <= b) {
- range.push(format(a, index));
- a = descending ? a - step : a + step;
- index++;
- }
- if (options.toRegex === true) return toRegex(range, null, {
- wrap: false,
- options
- });
- return range;
- };
- const fill = (start, end, step, options = {}) => {
- if (end == null && isValidValue(start)) return [start];
- if (!isValidValue(start) || !isValidValue(end)) return invalidRange(start, end, options);
- if (typeof step === "function") return fill(start, end, 1, { transform: step });
- if (isObject(step)) return fill(start, end, 0, step);
- let opts = { ...options };
- if (opts.capture === true) opts.wrap = true;
- step = step || opts.step || 1;
- if (!isNumber(step)) {
- if (step != null && !isObject(step)) return invalidStep(step, opts);
- return fill(start, end, 1, step);
- }
- if (isNumber(start) && isNumber(end)) return fillNumbers(start, end, step, opts);
- return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
- };
- module.exports = fill;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
- var require_compile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const fill = require_fill_range();
- const utils = require_utils$3();
- const compile = (ast, options = {}) => {
- const walk = (node, parent = {}) => {
- const invalidBlock = utils.isInvalidBrace(parent);
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
- const invalid = invalidBlock === true || invalidNode === true;
- const prefix = options.escapeInvalid === true ? "\\" : "";
- let output = "";
- if (node.isOpen === true) return prefix + node.value;
- if (node.isClose === true) {
- console.log("node.isClose", prefix, node.value);
- return prefix + node.value;
- }
- if (node.type === "open") return invalid ? prefix + node.value : "(";
- if (node.type === "close") return invalid ? prefix + node.value : ")";
- if (node.type === "comma") return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
- if (node.value) return node.value;
- if (node.nodes && node.ranges > 0) {
- const args = utils.reduce(node.nodes);
- const range = fill(...args, {
- ...options,
- wrap: false,
- toRegex: true,
- strictZeros: true
- });
- if (range.length !== 0) return args.length > 1 && range.length > 1 ? `(${range})` : range;
- }
- if (node.nodes) for (const child of node.nodes) output += walk(child, node);
- return output;
- };
- return walk(ast);
- };
- module.exports = compile;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
- var require_expand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const fill = require_fill_range();
- const stringify = require_stringify();
- const utils = require_utils$3();
- const append = (queue = "", stash = "", enclose = false) => {
- const result = [];
- queue = [].concat(queue);
- stash = [].concat(stash);
- if (!stash.length) return queue;
- if (!queue.length) return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
- for (const item of queue) if (Array.isArray(item)) for (const value of item) result.push(append(value, stash, enclose));
- else for (let ele of stash) {
- if (enclose === true && typeof ele === "string") ele = `{${ele}}`;
- result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
- }
- return utils.flatten(result);
- };
- const expand = (ast, options = {}) => {
- const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
- const walk = (node, parent = {}) => {
- node.queue = [];
- let p = parent;
- let q = parent.queue;
- while (p.type !== "brace" && p.type !== "root" && p.parent) {
- p = p.parent;
- q = p.queue;
- }
- if (node.invalid || node.dollar) {
- q.push(append(q.pop(), stringify(node, options)));
- return;
- }
- if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
- q.push(append(q.pop(), ["{}"]));
- return;
- }
- if (node.nodes && node.ranges > 0) {
- const args = utils.reduce(node.nodes);
- if (utils.exceedsLimit(...args, options.step, rangeLimit)) throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
- let range = fill(...args, options);
- if (range.length === 0) range = stringify(node, options);
- q.push(append(q.pop(), range));
- node.nodes = [];
- return;
- }
- const enclose = utils.encloseBrace(node);
- let queue = node.queue;
- let block = node;
- while (block.type !== "brace" && block.type !== "root" && block.parent) {
- block = block.parent;
- queue = block.queue;
- }
- for (let i = 0; i < node.nodes.length; i++) {
- const child = node.nodes[i];
- if (child.type === "comma" && node.type === "brace") {
- if (i === 1) queue.push("");
- queue.push("");
- continue;
- }
- if (child.type === "close") {
- q.push(append(q.pop(), queue, enclose));
- continue;
- }
- if (child.value && child.type !== "open") {
- queue.push(append(queue.pop(), child.value));
- continue;
- }
- if (child.nodes) walk(child, node);
- }
- return queue;
- };
- return utils.flatten(walk(ast));
- };
- module.exports = expand;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
- var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- module.exports = {
- MAX_LENGTH: 1e4,
- CHAR_0: "0",
- CHAR_9: "9",
- CHAR_UPPERCASE_A: "A",
- CHAR_LOWERCASE_A: "a",
- CHAR_UPPERCASE_Z: "Z",
- CHAR_LOWERCASE_Z: "z",
- CHAR_LEFT_PARENTHESES: "(",
- CHAR_RIGHT_PARENTHESES: ")",
- CHAR_ASTERISK: "*",
- CHAR_AMPERSAND: "&",
- CHAR_AT: "@",
- CHAR_BACKSLASH: "\\",
- CHAR_BACKTICK: "`",
- CHAR_CARRIAGE_RETURN: "\r",
- CHAR_CIRCUMFLEX_ACCENT: "^",
- CHAR_COLON: ":",
- CHAR_COMMA: ",",
- CHAR_DOLLAR: "$",
- CHAR_DOT: ".",
- CHAR_DOUBLE_QUOTE: "\"",
- CHAR_EQUAL: "=",
- CHAR_EXCLAMATION_MARK: "!",
- CHAR_FORM_FEED: "\f",
- CHAR_FORWARD_SLASH: "/",
- CHAR_HASH: "#",
- CHAR_HYPHEN_MINUS: "-",
- CHAR_LEFT_ANGLE_BRACKET: "<",
- CHAR_LEFT_CURLY_BRACE: "{",
- CHAR_LEFT_SQUARE_BRACKET: "[",
- CHAR_LINE_FEED: "\n",
- CHAR_NO_BREAK_SPACE: "\xA0",
- CHAR_PERCENT: "%",
- CHAR_PLUS: "+",
- CHAR_QUESTION_MARK: "?",
- CHAR_RIGHT_ANGLE_BRACKET: ">",
- CHAR_RIGHT_CURLY_BRACE: "}",
- CHAR_RIGHT_SQUARE_BRACKET: "]",
- CHAR_SEMICOLON: ";",
- CHAR_SINGLE_QUOTE: "'",
- CHAR_SPACE: " ",
- CHAR_TAB: " ",
- CHAR_UNDERSCORE: "_",
- CHAR_VERTICAL_LINE: "|",
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: ""
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
- var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const stringify = require_stringify();
- /**
- * Constants
- */
- const { MAX_LENGTH, CHAR_BACKSLASH, CHAR_BACKTICK, CHAR_COMMA, CHAR_DOT, CHAR_LEFT_PARENTHESES, CHAR_RIGHT_PARENTHESES, CHAR_LEFT_CURLY_BRACE, CHAR_RIGHT_CURLY_BRACE, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_DOUBLE_QUOTE, CHAR_SINGLE_QUOTE, CHAR_NO_BREAK_SPACE, CHAR_ZERO_WIDTH_NOBREAK_SPACE } = require_constants$2();
- /**
- * parse
- */
- const parse = (input, options = {}) => {
- if (typeof input !== "string") throw new TypeError("Expected a string");
- const opts = options || {};
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- if (input.length > max) throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
- const ast = {
- type: "root",
- input,
- nodes: []
- };
- const stack = [ast];
- let block = ast;
- let prev = ast;
- let brackets = 0;
- const length = input.length;
- let index = 0;
- let depth = 0;
- let value;
- /**
- * Helpers
- */
- const advance = () => input[index++];
- const push = (node) => {
- if (node.type === "text" && prev.type === "dot") prev.type = "text";
- if (prev && prev.type === "text" && node.type === "text") {
- prev.value += node.value;
- return;
- }
- block.nodes.push(node);
- node.parent = block;
- node.prev = prev;
- prev = node;
- return node;
- };
- push({ type: "bos" });
- while (index < length) {
- block = stack[stack.length - 1];
- value = advance();
- /**
- * Invalid chars
- */
- if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) continue;
- /**
- * Escaped chars
- */
- if (value === CHAR_BACKSLASH) {
- push({
- type: "text",
- value: (options.keepEscaping ? value : "") + advance()
- });
- continue;
- }
- /**
- * Right square bracket (literal): ']'
- */
- if (value === CHAR_RIGHT_SQUARE_BRACKET) {
- push({
- type: "text",
- value: "\\" + value
- });
- continue;
- }
- /**
- * Left square bracket: '['
- */
- if (value === CHAR_LEFT_SQUARE_BRACKET) {
- brackets++;
- let next;
- while (index < length && (next = advance())) {
- value += next;
- if (next === CHAR_LEFT_SQUARE_BRACKET) {
- brackets++;
- continue;
- }
- if (next === CHAR_BACKSLASH) {
- value += advance();
- continue;
- }
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- brackets--;
- if (brackets === 0) break;
- }
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Parentheses
- */
- if (value === CHAR_LEFT_PARENTHESES) {
- block = push({
- type: "paren",
- nodes: []
- });
- stack.push(block);
- push({
- type: "text",
- value
- });
- continue;
- }
- if (value === CHAR_RIGHT_PARENTHESES) {
- if (block.type !== "paren") {
- push({
- type: "text",
- value
- });
- continue;
- }
- block = stack.pop();
- push({
- type: "text",
- value
- });
- block = stack[stack.length - 1];
- continue;
- }
- /**
- * Quotes: '|"|`
- */
- if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
- const open = value;
- let next;
- if (options.keepQuotes !== true) value = "";
- while (index < length && (next = advance())) {
- if (next === CHAR_BACKSLASH) {
- value += next + advance();
- continue;
- }
- if (next === open) {
- if (options.keepQuotes === true) value += next;
- break;
- }
- value += next;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Left curly brace: '{'
- */
- if (value === CHAR_LEFT_CURLY_BRACE) {
- depth++;
- block = push({
- type: "brace",
- open: true,
- close: false,
- dollar: prev.value && prev.value.slice(-1) === "$" || block.dollar === true,
- depth,
- commas: 0,
- ranges: 0,
- nodes: []
- });
- stack.push(block);
- push({
- type: "open",
- value
- });
- continue;
- }
- /**
- * Right curly brace: '}'
- */
- if (value === CHAR_RIGHT_CURLY_BRACE) {
- if (block.type !== "brace") {
- push({
- type: "text",
- value
- });
- continue;
- }
- const type = "close";
- block = stack.pop();
- block.close = true;
- push({
- type,
- value
- });
- depth--;
- block = stack[stack.length - 1];
- continue;
- }
- /**
- * Comma: ','
- */
- if (value === CHAR_COMMA && depth > 0) {
- if (block.ranges > 0) {
- block.ranges = 0;
- const open = block.nodes.shift();
- block.nodes = [open, {
- type: "text",
- value: stringify(block)
- }];
- }
- push({
- type: "comma",
- value
- });
- block.commas++;
- continue;
- }
- /**
- * Dot: '.'
- */
- if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
- const siblings = block.nodes;
- if (depth === 0 || siblings.length === 0) {
- push({
- type: "text",
- value
- });
- continue;
- }
- if (prev.type === "dot") {
- block.range = [];
- prev.value += value;
- prev.type = "range";
- if (block.nodes.length !== 3 && block.nodes.length !== 5) {
- block.invalid = true;
- block.ranges = 0;
- prev.type = "text";
- continue;
- }
- block.ranges++;
- block.args = [];
- continue;
- }
- if (prev.type === "range") {
- siblings.pop();
- const before = siblings[siblings.length - 1];
- before.value += prev.value + value;
- prev = before;
- block.ranges--;
- continue;
- }
- push({
- type: "dot",
- value
- });
- continue;
- }
- /**
- * Text
- */
- push({
- type: "text",
- value
- });
- }
- do {
- block = stack.pop();
- if (block.type !== "root") {
- block.nodes.forEach((node) => {
- if (!node.nodes) {
- if (node.type === "open") node.isOpen = true;
- if (node.type === "close") node.isClose = true;
- if (!node.nodes) node.type = "text";
- node.invalid = true;
- }
- });
- const parent = stack[stack.length - 1];
- const index = parent.nodes.indexOf(block);
- parent.nodes.splice(index, 1, ...block.nodes);
- }
- } while (stack.length > 0);
- push({ type: "eos" });
- return ast;
- };
- module.exports = parse;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
- var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const stringify = require_stringify();
- const compile = require_compile();
- const expand = require_expand();
- const parse = require_parse$1();
- /**
- * Expand the given pattern or create a regex-compatible string.
- *
- * ```js
- * const braces = require('braces');
- * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
- * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {String}
- * @api public
- */
- const braces = (input, options = {}) => {
- let output = [];
- if (Array.isArray(input)) for (const pattern of input) {
- const result = braces.create(pattern, options);
- if (Array.isArray(result)) output.push(...result);
- else output.push(result);
- }
- else output = [].concat(braces.create(input, options));
- if (options && options.expand === true && options.nodupes === true) output = [...new Set(output)];
- return output;
- };
- /**
- * Parse the given `str` with the given `options`.
- *
- * ```js
- * // braces.parse(pattern, [, options]);
- * const ast = braces.parse('a/{b,c}/d');
- * console.log(ast);
- * ```
- * @param {String} pattern Brace pattern to parse
- * @param {Object} options
- * @return {Object} Returns an AST
- * @api public
- */
- braces.parse = (input, options = {}) => parse(input, options);
- /**
- * Creates a braces string from an AST, or an AST node.
- *
- * ```js
- * const braces = require('braces');
- * let ast = braces.parse('foo/{a,b}/bar');
- * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
- * ```
- * @param {String} `input` Brace pattern or AST.
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
- braces.stringify = (input, options = {}) => {
- if (typeof input === "string") return stringify(braces.parse(input, options), options);
- return stringify(input, options);
- };
- /**
- * Compiles a brace pattern into a regex-compatible, optimized string.
- * This method is called by the main [braces](#braces) function by default.
- *
- * ```js
- * const braces = require('braces');
- * console.log(braces.compile('a/{b,c}/d'));
- * //=> ['a/(b|c)/d']
- * ```
- * @param {String} `input` Brace pattern or AST.
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
- braces.compile = (input, options = {}) => {
- if (typeof input === "string") input = braces.parse(input, options);
- return compile(input, options);
- };
- /**
- * Expands a brace pattern into an array. This method is called by the
- * main [braces](#braces) function when `options.expand` is true. Before
- * using this method it's recommended that you read the [performance notes](#performance))
- * and advantages of using [.compile](#compile) instead.
- *
- * ```js
- * const braces = require('braces');
- * console.log(braces.expand('a/{b,c}/d'));
- * //=> ['a/b/d', 'a/c/d'];
- * ```
- * @param {String} `pattern` Brace pattern
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
- braces.expand = (input, options = {}) => {
- if (typeof input === "string") input = braces.parse(input, options);
- let result = expand(input, options);
- if (options.noempty === true) result = result.filter(Boolean);
- if (options.nodupes === true) result = [...new Set(result)];
- return result;
- };
- /**
- * Processes a brace pattern and returns either an expanded array
- * (if `options.expand` is true), a highly optimized regex-compatible string.
- * This method is called by the main [braces](#braces) function.
- *
- * ```js
- * const braces = require('braces');
- * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
- * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
- * ```
- * @param {String} `pattern` Brace pattern
- * @param {Object} `options`
- * @return {Array} Returns an array of expanded values.
- * @api public
- */
- braces.create = (input, options = {}) => {
- if (input === "" || input.length < 3) return [input];
- return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
- };
- /**
- * Expose "braces"
- */
- module.exports = braces;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
- var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const path$8 = __require("path");
- const WIN_SLASH = "\\\\/";
- const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
- /**
- * Posix glob regex
- */
- const DOT_LITERAL = "\\.";
- const PLUS_LITERAL = "\\+";
- const QMARK_LITERAL = "\\?";
- const SLASH_LITERAL = "\\/";
- const ONE_CHAR = "(?=.)";
- const QMARK = "[^/]";
- const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
- const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
- const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
- const POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
- NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
- QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
- STAR: `${QMARK}*?`,
- START_ANCHOR
- };
- /**
- * Windows glob regex
- */
- const WINDOWS_CHARS = {
- ...POSIX_CHARS,
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
- };
- module.exports = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE: {
- alnum: "a-zA-Z0-9",
- alpha: "a-zA-Z",
- ascii: "\\x00-\\x7F",
- blank: " \\t",
- cntrl: "\\x00-\\x1F\\x7F",
- digit: "0-9",
- graph: "\\x21-\\x7E",
- lower: "a-z",
- print: "\\x20-\\x7E ",
- punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
- space: " \\t\\r\\n\\v\\f",
- upper: "A-Z",
- word: "A-Za-z0-9_",
- xdigit: "A-Fa-f0-9"
- },
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
- REPLACEMENTS: {
- "***": "*",
- "**/**": "**",
- "**/**/**": "**"
- },
- CHAR_0: 48,
- CHAR_9: 57,
- CHAR_UPPERCASE_A: 65,
- CHAR_LOWERCASE_A: 97,
- CHAR_UPPERCASE_Z: 90,
- CHAR_LOWERCASE_Z: 122,
- CHAR_LEFT_PARENTHESES: 40,
- CHAR_RIGHT_PARENTHESES: 41,
- CHAR_ASTERISK: 42,
- CHAR_AMPERSAND: 38,
- CHAR_AT: 64,
- CHAR_BACKWARD_SLASH: 92,
- CHAR_CARRIAGE_RETURN: 13,
- CHAR_CIRCUMFLEX_ACCENT: 94,
- CHAR_COLON: 58,
- CHAR_COMMA: 44,
- CHAR_DOT: 46,
- CHAR_DOUBLE_QUOTE: 34,
- CHAR_EQUAL: 61,
- CHAR_EXCLAMATION_MARK: 33,
- CHAR_FORM_FEED: 12,
- CHAR_FORWARD_SLASH: 47,
- CHAR_GRAVE_ACCENT: 96,
- CHAR_HASH: 35,
- CHAR_HYPHEN_MINUS: 45,
- CHAR_LEFT_ANGLE_BRACKET: 60,
- CHAR_LEFT_CURLY_BRACE: 123,
- CHAR_LEFT_SQUARE_BRACKET: 91,
- CHAR_LINE_FEED: 10,
- CHAR_NO_BREAK_SPACE: 160,
- CHAR_PERCENT: 37,
- CHAR_PLUS: 43,
- CHAR_QUESTION_MARK: 63,
- CHAR_RIGHT_ANGLE_BRACKET: 62,
- CHAR_RIGHT_CURLY_BRACE: 125,
- CHAR_RIGHT_SQUARE_BRACKET: 93,
- CHAR_SEMICOLON: 59,
- CHAR_SINGLE_QUOTE: 39,
- CHAR_SPACE: 32,
- CHAR_TAB: 9,
- CHAR_UNDERSCORE: 95,
- CHAR_VERTICAL_LINE: 124,
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
- SEP: path$8.sep,
- extglobChars(chars) {
- return {
- "!": {
- type: "negate",
- open: "(?:(?!(?:",
- close: `))${chars.STAR})`
- },
- "?": {
- type: "qmark",
- open: "(?:",
- close: ")?"
- },
- "+": {
- type: "plus",
- open: "(?:",
- close: ")+"
- },
- "*": {
- type: "star",
- open: "(?:",
- close: ")*"
- },
- "@": {
- type: "at",
- open: "(?:",
- close: ")"
- }
- };
- },
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
- var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- const path$7 = __require("path");
- const win32 = process.platform === "win32";
- const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
- exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
- exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
- exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
- exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
- exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
- exports.removeBackslashes = (str) => {
- return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
- return match === "\\" ? "" : match;
- });
- };
- exports.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split(".").map(Number);
- if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
- return false;
- };
- exports.isWindows = (options) => {
- if (options && typeof options.windows === "boolean") return options.windows;
- return win32 === true || path$7.sep === "\\";
- };
- exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
- exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith("./")) {
- output = output.slice(2);
- state.prefix = "./";
- }
- return output;
- };
- exports.wrapOutput = (input, state = {}, options = {}) => {
- let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
- if (state.negated === true) output = `(?:^(?!${output}).*$)`;
- return output;
- };
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
- var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const utils = require_utils$2();
- const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
- const isPathSeparator = (code) => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
- };
- const depth = (token) => {
- if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
- };
- /**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
- const scan = (input, options) => {
- const opts = options || {};
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = {
- value: "",
- depth: 0,
- isGlob: false
- };
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
- while (index < length) {
- code = advance();
- let next;
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
- continue;
- }
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- continue;
- }
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) continue;
- break;
- }
- if (braceEscaped !== true && code === CHAR_COMMA) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) continue;
- break;
- }
- if (code === CHAR_RIGHT_CURLY_BRACE) {
- braces--;
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
- if (scanToEnd === true) continue;
- break;
- }
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = {
- value: "",
- depth: 0,
- isGlob: false
- };
- if (finished === true) continue;
- if (prev === CHAR_DOT && index === start + 1) {
- start += 2;
- continue;
- }
- lastIndex = index + 1;
- continue;
- }
- if (opts.noext !== true) {
- if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) continue;
- break;
- }
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) continue;
- break;
- }
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- if (scanToEnd === true) continue;
- break;
- }
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- if (isGlob === true) {
- finished = true;
- if (scanToEnd === true) continue;
- break;
- }
- }
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
- let base = str;
- let prefix = "";
- let glob = "";
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = "";
- glob = str;
- } else base = str;
- if (base && base !== "" && base !== "/" && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
- }
- if (opts.unescape === true) {
- if (glob) glob = utils.removeBackslashes(glob);
- if (base && backslashes === true) base = utils.removeBackslashes(base);
- }
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) tokens.push(token);
- state.tokens = tokens;
- }
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else tokens[idx].value = value;
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== "") parts.push(value);
- prevIndex = i;
- }
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
- state.slashes = slashes;
- state.parts = parts;
- }
- return state;
- };
- module.exports = scan;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
- var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const constants = require_constants$1();
- const utils = require_utils$2();
- /**
- * Constants
- */
- const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
- /**
- * Helpers
- */
- const expandRange = (args, options) => {
- if (typeof options.expandRange === "function") return options.expandRange(...args, options);
- args.sort();
- const value = `[${args.join("-")}]`;
- try {
- new RegExp(value);
- } catch (ex) {
- return args.map((v) => utils.escapeRegex(v)).join("..");
- }
- return value;
- };
- /**
- * Create the message for a syntax error
- */
- const syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
- };
- /**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
- const parse = (input, options) => {
- if (typeof input !== "string") throw new TypeError("Expected a string");
- input = REPLACEMENTS[input] || input;
- const opts = { ...options };
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- let len = input.length;
- if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- const bos = {
- type: "bos",
- value: "",
- output: opts.prepend || ""
- };
- const tokens = [bos];
- const capture = opts.capture ? "" : "?:";
- const win32 = utils.isWindows(options);
- const PLATFORM_CHARS = constants.globChars(win32);
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
- const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
- const globstar = (opts) => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const nodot = opts.dot ? "" : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
- if (opts.capture) star = `(${star})`;
- if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: "",
- output: "",
- prefix: "",
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
- input = utils.removePrefix(input, state);
- len = input.length;
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
- /**
- * Tokenizing helpers
- */
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || "";
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = "", num = 0) => {
- state.consumed += value;
- state.index += num;
- };
- const append = (token) => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
- const negate = () => {
- let count = 1;
- while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
- advance();
- state.start++;
- count++;
- }
- if (count % 2 === 0) return false;
- state.negated = true;
- state.start++;
- return true;
- };
- const increment = (type) => {
- state[type]++;
- stack.push(type);
- };
- const decrement = (type) => {
- state[type]--;
- stack.pop();
- };
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
- const push = (tok) => {
- if (prev.type === "globstar") {
- const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
- const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
- if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = "star";
- prev.value = "*";
- prev.output = star;
- state.output += prev.output;
- }
- }
- if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === "text" && tok.type === "text") {
- prev.value += tok.value;
- prev.output = (prev.output || "") + tok.value;
- return;
- }
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
- const extglobOpen = (type, value) => {
- const token = {
- ...EXTGLOB_CHARS[value],
- conditions: 1,
- inner: ""
- };
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? "(" : "") + token.open;
- increment("parens");
- push({
- type,
- value,
- output: state.output ? "" : ONE_CHAR
- });
- push({
- type: "paren",
- extglob: true,
- value: advance(),
- output
- });
- extglobs.push(token);
- };
- const extglobClose = (token) => {
- let output = token.close + (opts.capture ? ")" : "");
- let rest;
- if (token.type === "negate") {
- let extglobStar = star;
- if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
- if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
- ...options,
- fastpaths: false
- }).output})${extglobStar})`;
- if (token.prev.type === "bos") state.negatedExtglob = true;
- }
- push({
- type: "paren",
- extglob: true,
- value,
- output
- });
- decrement("parens");
- };
- /**
- * Fast paths
- */
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === "\\") {
- backslashes = true;
- return m;
- }
- if (first === "?") {
- if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
- if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
- return QMARK.repeat(chars.length);
- }
- if (first === ".") return DOT_LITERAL.repeat(chars.length);
- if (first === "*") {
- if (esc) return esc + first + (rest ? star : "");
- return star;
- }
- return esc ? m : `\\${m}`;
- });
- if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
- else output = output.replace(/\\+/g, (m) => {
- return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
- });
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
- state.output = utils.wrapOutput(output, state, options);
- return state;
- }
- /**
- * Tokenize input until we reach end-of-string
- */
- while (!eos()) {
- value = advance();
- if (value === "\0") continue;
- /**
- * Escaped characters
- */
- if (value === "\\") {
- const next = peek();
- if (next === "/" && opts.bash !== true) continue;
- if (next === "." || next === ";") continue;
- if (!next) {
- value += "\\";
- push({
- type: "text",
- value
- });
- continue;
- }
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) value += "\\";
- }
- if (opts.unescape === true) value = advance();
- else value += advance();
- if (state.brackets === 0) {
- push({
- type: "text",
- value
- });
- continue;
- }
- }
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
- if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
- if (opts.posix !== false && value === ":") {
- const inner = prev.value.slice(1);
- if (inner.includes("[")) {
- prev.posix = true;
- if (inner.includes(":")) {
- const idx = prev.value.lastIndexOf("[");
- const pre = prev.value.slice(0, idx);
- const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
- if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
- continue;
- }
- }
- }
- }
- if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
- if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
- if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
- prev.value += value;
- append({ value });
- continue;
- }
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
- if (state.quotes === 1 && value !== "\"") {
- value = utils.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
- /**
- * Double quotes
- */
- if (value === "\"") {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Parentheses
- */
- if (value === "(") {
- increment("parens");
- push({
- type: "paren",
- value
- });
- continue;
- }
- if (value === ")") {
- if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
- push({
- type: "paren",
- value,
- output: state.parens ? ")" : "\\)"
- });
- decrement("parens");
- continue;
- }
- /**
- * Square brackets
- */
- if (value === "[") {
- if (opts.nobracket === true || !remaining().includes("]")) {
- if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
- value = `\\${value}`;
- } else increment("brackets");
- push({
- type: "bracket",
- value
- });
- continue;
- }
- if (value === "]") {
- if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
- push({
- type: "text",
- value,
- output: `\\${value}`
- });
- continue;
- }
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
- push({
- type: "text",
- value,
- output: `\\${value}`
- });
- continue;
- }
- decrement("brackets");
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
- prev.value += value;
- append({ value });
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
- const escaped = utils.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
- /**
- * Braces
- */
- if (value === "{" && opts.nobrace !== true) {
- increment("braces");
- const open = {
- type: "brace",
- value,
- output: "(",
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
- braces.push(open);
- push(open);
- continue;
- }
- if (value === "}") {
- const brace = braces[braces.length - 1];
- if (opts.nobrace === true || !brace) {
- push({
- type: "text",
- value,
- output: value
- });
- continue;
- }
- let output = ")";
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === "brace") break;
- if (arr[i].type !== "dots") range.unshift(arr[i].value);
- }
- output = expandRange(range, opts);
- state.backtrack = true;
- }
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = "\\{";
- value = output = "\\}";
- state.output = out;
- for (const t of toks) state.output += t.output || t.value;
- }
- push({
- type: "brace",
- value,
- output
- });
- decrement("braces");
- braces.pop();
- continue;
- }
- /**
- * Pipes
- */
- if (value === "|") {
- if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
- push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Commas
- */
- if (value === ",") {
- let output = value;
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === "braces") {
- brace.comma = true;
- output = "|";
- }
- push({
- type: "comma",
- value,
- output
- });
- continue;
- }
- /**
- * Slashes
- */
- if (value === "/") {
- if (prev.type === "dot" && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = "";
- state.output = "";
- tokens.pop();
- prev = bos;
- continue;
- }
- push({
- type: "slash",
- value,
- output: SLASH_LITERAL
- });
- continue;
- }
- /**
- * Dots
- */
- if (value === ".") {
- if (state.braces > 0 && prev.type === "dot") {
- if (prev.value === ".") prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = "dots";
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
- if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
- push({
- type: "text",
- value,
- output: DOT_LITERAL
- });
- continue;
- }
- push({
- type: "dot",
- value,
- output: DOT_LITERAL
- });
- continue;
- }
- /**
- * Question marks
- */
- if (value === "?") {
- if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- extglobOpen("qmark", value);
- continue;
- }
- if (prev && prev.type === "paren") {
- const next = peek();
- let output = value;
- if (next === "<" && !utils.supportsLookbehinds()) throw new Error("Node.js v10 or higher is required for regex lookbehinds");
- if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
- push({
- type: "text",
- value,
- output
- });
- continue;
- }
- if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
- push({
- type: "qmark",
- value,
- output: QMARK_NO_DOT
- });
- continue;
- }
- push({
- type: "qmark",
- value,
- output: QMARK
- });
- continue;
- }
- /**
- * Exclamation
- */
- if (value === "!") {
- if (opts.noextglob !== true && peek() === "(") {
- if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
- extglobOpen("negate", value);
- continue;
- }
- }
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
- /**
- * Plus
- */
- if (value === "+") {
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- extglobOpen("plus", value);
- continue;
- }
- if (prev && prev.value === "(" || opts.regex === false) {
- push({
- type: "plus",
- value,
- output: PLUS_LITERAL
- });
- continue;
- }
- if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
- push({
- type: "plus",
- value
- });
- continue;
- }
- push({
- type: "plus",
- value: PLUS_LITERAL
- });
- continue;
- }
- /**
- * Plain text
- */
- if (value === "@") {
- if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
- push({
- type: "at",
- extglob: true,
- value,
- output: ""
- });
- continue;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Plain text
- */
- if (value !== "*") {
- if (value === "$" || value === "^") value = `\\${value}`;
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
- push({
- type: "text",
- value
- });
- continue;
- }
- /**
- * Stars
- */
- if (prev && (prev.type === "globstar" || prev.star === true)) {
- prev.type = "star";
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen("star", value);
- continue;
- }
- if (prev.type === "star") {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === "slash" || prior.type === "bos";
- const afterStar = before && (before.type === "star" || before.type === "globstar");
- if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
- push({
- type: "star",
- value,
- output: ""
- });
- continue;
- }
- const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
- const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
- if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
- push({
- type: "star",
- value,
- output: ""
- });
- continue;
- }
- while (rest.slice(0, 3) === "/**") {
- const after = input[state.index + 4];
- if (after && after !== "/") break;
- rest = rest.slice(3);
- consume("/**", 3);
- }
- if (prior.type === "bos" && eos()) {
- prev.type = "globstar";
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = "globstar";
- prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
- if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
- const end = rest[1] !== void 0 ? "|$" : "";
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = "globstar";
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
- state.output += prior.output + prev.output;
- state.globstar = true;
- consume(value + advance());
- push({
- type: "slash",
- value: "/",
- output: ""
- });
- continue;
- }
- if (prior.type === "bos" && rest[0] === "/") {
- prev.type = "globstar";
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({
- type: "slash",
- value: "/",
- output: ""
- });
- continue;
- }
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = "globstar";
- prev.output = globstar(opts);
- prev.value += value;
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- const token = {
- type: "star",
- value,
- output: star
- };
- if (opts.bash === true) {
- token.output = ".*?";
- if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
- push(token);
- continue;
- }
- if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
- if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
- if (prev.type === "dot") {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
- if (peek() !== "*") {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
- push(token);
- }
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
- state.output = utils.escapeLast(state.output, "[");
- decrement("brackets");
- }
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
- state.output = utils.escapeLast(state.output, "(");
- decrement("parens");
- }
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
- state.output = utils.escapeLast(state.output, "{");
- decrement("braces");
- }
- if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
- type: "maybe_slash",
- value: "",
- output: `${SLASH_LITERAL}?`
- });
- if (state.backtrack === true) {
- state.output = "";
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
- if (token.suffix) state.output += token.suffix;
- }
- }
- return state;
- };
- /**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
- parse.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- const len = input.length;
- if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- input = REPLACEMENTS[input] || input;
- const win32 = utils.isWindows(options);
- const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(win32);
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? "" : "?:";
- const state = {
- negated: false,
- prefix: ""
- };
- let star = opts.bash === true ? ".*?" : STAR;
- if (opts.capture) star = `(${star})`;
- const globstar = (opts) => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const create = (str) => {
- switch (str) {
- case "*": return `${nodot}${ONE_CHAR}${star}`;
- case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
- case "**": return nodot + globstar(opts);
- case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
- case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
- const source = create(match[1]);
- if (!source) return;
- return source + DOT_LITERAL + match[2];
- }
- }
- };
- let source = create(utils.removePrefix(input, state));
- if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
- return source;
- };
- module.exports = parse;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
- var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const path$6 = __require("path");
- const scan = require_scan();
- const parse = require_parse();
- const utils = require_utils$2();
- const constants = require_constants$1();
- const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
- /**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
- const picomatch = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map((input) => picomatch(input, options, returnState));
- const arrayMatcher = (str) => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
- const isState = isObject(glob) && glob.tokens && glob.input;
- if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
- const opts = options || {};
- const posix = utils.isWindows(options);
- const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
- const state = regex.state;
- delete regex.state;
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = {
- ...options,
- ignore: null,
- onMatch: null,
- onResult: null
- };
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
- }
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch.test(input, regex, options, {
- glob,
- posix
- });
- const result = {
- glob,
- state,
- regex,
- posix,
- input,
- output,
- match,
- isMatch
- };
- if (typeof opts.onResult === "function") opts.onResult(result);
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === "function") opts.onIgnore(result);
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (typeof opts.onMatch === "function") opts.onMatch(result);
- return returnObject ? result : true;
- };
- if (returnState) matcher.state = state;
- return matcher;
- };
- /**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
- picomatch.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== "string") throw new TypeError("Expected input to be a string");
- if (input === "") return {
- isMatch: false,
- output: ""
- };
- const opts = options || {};
- const format = opts.format || (posix ? utils.toPosixSlashes : null);
- let match = input === glob;
- let output = match && format ? format(input) : input;
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
- if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
- else match = regex.exec(output);
- return {
- isMatch: Boolean(match),
- match,
- output
- };
- };
- /**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
- picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
- return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$6.basename(input));
- };
- /**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
- picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
- /**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
- picomatch.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
- return parse(pattern, {
- ...options,
- fastpaths: false
- });
- };
- /**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
- picomatch.scan = (input, options) => scan(input, options);
- /**
- * Compile a regular expression from the `state` object returned by the
- * [parse()](#parse) method.
- *
- * @param {Object} `state`
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
- * @return {RegExp}
- * @api public
- */
- picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) return state.output;
- const opts = options || {};
- const prepend = opts.contains ? "" : "^";
- const append = opts.contains ? "" : "$";
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) source = `^(?!${source}).*$`;
- const regex = picomatch.toRegex(source, options);
- if (returnState === true) regex.state = state;
- return regex;
- };
- /**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
- picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
- let parsed = {
- negated: false,
- fastpaths: true
- };
- if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
- if (!parsed.output) parsed = parse(input, options);
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
- };
- /**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
- picomatch.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
- };
- /**
- * Picomatch constants.
- * @return {Object}
- */
- picomatch.constants = constants;
- /**
- * Expose "picomatch"
- */
- module.exports = picomatch;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
- var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- module.exports = require_picomatch$1();
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
- var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const util = __require("util");
- const braces = require_braces();
- const picomatch = require_picomatch();
- const utils = require_utils$2();
- const isEmptyString = (v) => v === "" || v === "./";
- const hasBraces = (v) => {
- const index = v.indexOf("{");
- return index > -1 && v.indexOf("}", index) > -1;
- };
- /**
- * Returns an array of strings that match one or more glob patterns.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm(list, patterns[, options]);
- *
- * console.log(mm(['a.js', 'a.txt'], ['*.js']));
- * //=> [ 'a.js' ]
- * ```
- * @param {String|Array<string>} `list` List of strings to match.
- * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options)
- * @return {Array} Returns an array of matches
- * @summary false
- * @api public
- */
- const micromatch = (list, patterns, options) => {
- patterns = [].concat(patterns);
- list = [].concat(list);
- let omit = /* @__PURE__ */ new Set();
- let keep = /* @__PURE__ */ new Set();
- let items = /* @__PURE__ */ new Set();
- let negatives = 0;
- let onResult = (state) => {
- items.add(state.output);
- if (options && options.onResult) options.onResult(state);
- };
- for (let i = 0; i < patterns.length; i++) {
- let isMatch = picomatch(String(patterns[i]), {
- ...options,
- onResult
- }, true);
- let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
- if (negated) negatives++;
- for (let item of list) {
- let matched = isMatch(item, true);
- if (!(negated ? !matched.isMatch : matched.isMatch)) continue;
- if (negated) omit.add(matched.output);
- else {
- omit.delete(matched.output);
- keep.add(matched.output);
- }
- }
- }
- let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
- if (options && matches.length === 0) {
- if (options.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
- if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
- }
- return matches;
- };
- /**
- * Backwards compatibility
- */
- micromatch.match = micromatch;
- /**
- * Returns a matcher function from the given glob `pattern` and `options`.
- * The returned function takes a string to match as its only argument and returns
- * true if the string is a match.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.matcher(pattern[, options]);
- *
- * const isMatch = mm.matcher('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @param {String} `pattern` Glob pattern
- * @param {Object} `options`
- * @return {Function} Returns a matcher function.
- * @api public
- */
- micromatch.matcher = (pattern, options) => picomatch(pattern, options);
- /**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.isMatch(string, patterns[, options]);
- *
- * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(mm.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String} `str` The string to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `[options]` See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
- micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
- /**
- * Backwards compatibility
- */
- micromatch.any = micromatch.isMatch;
- /**
- * Returns a list of strings that _**do not match any**_ of the given `patterns`.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.not(list, patterns[, options]);
- *
- * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
- * //=> ['b.b', 'c.c']
- * ```
- * @param {Array} `list` Array of strings to match.
- * @param {String|Array} `patterns` One or more glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Array} Returns an array of strings that **do not match** the given patterns.
- * @api public
- */
- micromatch.not = (list, patterns, options = {}) => {
- patterns = [].concat(patterns).map(String);
- let result = /* @__PURE__ */ new Set();
- let items = [];
- let onResult = (state) => {
- if (options.onResult) options.onResult(state);
- items.push(state.output);
- };
- let matches = new Set(micromatch(list, patterns, {
- ...options,
- onResult
- }));
- for (let item of items) if (!matches.has(item)) result.add(item);
- return [...result];
- };
- /**
- * Returns true if the given `string` contains the given pattern. Similar
- * to [.isMatch](#isMatch) but the pattern can match any part of the string.
- *
- * ```js
- * var mm = require('micromatch');
- * // mm.contains(string, pattern[, options]);
- *
- * console.log(mm.contains('aa/bb/cc', '*b'));
- * //=> true
- * console.log(mm.contains('aa/bb/cc', '*d'));
- * //=> false
- * ```
- * @param {String} `str` The string to match.
- * @param {String|Array} `patterns` Glob pattern to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
- * @api public
- */
- micromatch.contains = (str, pattern, options) => {
- if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
- if (Array.isArray(pattern)) return pattern.some((p) => micromatch.contains(str, p, options));
- if (typeof pattern === "string") {
- if (isEmptyString(str) || isEmptyString(pattern)) return false;
- if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) return true;
- }
- return micromatch.isMatch(str, pattern, {
- ...options,
- contains: true
- });
- };
- /**
- * Filter the keys of the given object with the given `glob` pattern
- * and `options`. Does not attempt to match nested keys. If you need this feature,
- * use [glob-object][] instead.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.matchKeys(object, patterns[, options]);
- *
- * const obj = { aa: 'a', ab: 'b', ac: 'c' };
- * console.log(mm.matchKeys(obj, '*b'));
- * //=> { ab: 'b' }
- * ```
- * @param {Object} `object` The object with keys to filter.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Object} Returns an object with only keys that match the given patterns.
- * @api public
- */
- micromatch.matchKeys = (obj, patterns, options) => {
- if (!utils.isObject(obj)) throw new TypeError("Expected the first argument to be an object");
- let keys = micromatch(Object.keys(obj), patterns, options);
- let res = {};
- for (let key of keys) res[key] = obj[key];
- return res;
- };
- /**
- * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.some(list, patterns[, options]);
- *
- * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
- * // true
- * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
- * // false
- * ```
- * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
- * @api public
- */
- micromatch.some = (list, patterns, options) => {
- let items = [].concat(list);
- for (let pattern of [].concat(patterns)) {
- let isMatch = picomatch(String(pattern), options);
- if (items.some((item) => isMatch(item))) return true;
- }
- return false;
- };
- /**
- * Returns true if every string in the given `list` matches
- * any of the given glob `patterns`.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.every(list, patterns[, options]);
- *
- * console.log(mm.every('foo.js', ['foo.js']));
- * // true
- * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
- * // true
- * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
- * // false
- * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
- * // false
- * ```
- * @param {String|Array} `list` The string or array of strings to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
- * @api public
- */
- micromatch.every = (list, patterns, options) => {
- let items = [].concat(list);
- for (let pattern of [].concat(patterns)) {
- let isMatch = picomatch(String(pattern), options);
- if (!items.every((item) => isMatch(item))) return false;
- }
- return true;
- };
- /**
- * Returns true if **all** of the given `patterns` match
- * the specified string.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.all(string, patterns[, options]);
- *
- * console.log(mm.all('foo.js', ['foo.js']));
- * // true
- *
- * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
- * // false
- *
- * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
- * // true
- *
- * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
- * // true
- * ```
- * @param {String|Array} `str` The string to test.
- * @param {String|Array} `patterns` One or more glob patterns to use for matching.
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
- micromatch.all = (str, patterns, options) => {
- if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
- return [].concat(patterns).every((p) => picomatch(p, options)(str));
- };
- /**
- * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.capture(pattern, string[, options]);
- *
- * console.log(mm.capture('test/*.js', 'test/foo.js'));
- * //=> ['foo']
- * console.log(mm.capture('test/*.js', 'foo/bar.css'));
- * //=> null
- * ```
- * @param {String} `glob` Glob pattern to use for matching.
- * @param {String} `input` String to match
- * @param {Object} `options` See available [options](#options) for changing how matches are performed
- * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
- * @api public
- */
- micromatch.capture = (glob, input, options) => {
- let posix = utils.isWindows(options);
- let match = picomatch.makeRe(String(glob), {
- ...options,
- capture: true
- }).exec(posix ? utils.toPosixSlashes(input) : input);
- if (match) return match.slice(1).map((v) => v === void 0 ? "" : v);
- };
- /**
- * Create a regular expression from the given glob `pattern`.
- *
- * ```js
- * const mm = require('micromatch');
- * // mm.makeRe(pattern[, options]);
- *
- * console.log(mm.makeRe('*.js'));
- * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
- * ```
- * @param {String} `pattern` A glob pattern to convert to regex.
- * @param {Object} `options`
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
- micromatch.makeRe = (...args) => picomatch.makeRe(...args);
- /**
- * Scan a glob pattern to separate the pattern into segments. Used
- * by the [split](#split) method.
- *
- * ```js
- * const mm = require('micromatch');
- * const state = mm.scan(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
- micromatch.scan = (...args) => picomatch.scan(...args);
- /**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const mm = require('micromatch');
- * const state = mm.parse(pattern[, options]);
- * ```
- * @param {String} `glob`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as regex source string.
- * @api public
- */
- micromatch.parse = (patterns, options) => {
- let res = [];
- for (let pattern of [].concat(patterns || [])) for (let str of braces(String(pattern), options)) res.push(picomatch.parse(str, options));
- return res;
- };
- /**
- * Process the given brace `pattern`.
- *
- * ```js
- * const { braces } = require('micromatch');
- * console.log(braces('foo/{a,b,c}/bar'));
- * //=> [ 'foo/(a|b|c)/bar' ]
- *
- * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
- * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
- * ```
- * @param {String} `pattern` String with brace pattern to process.
- * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
- * @return {Array}
- * @api public
- */
- micromatch.braces = (pattern, options) => {
- if (typeof pattern !== "string") throw new TypeError("Expected a string");
- if (options && options.nobrace === true || !hasBraces(pattern)) return [pattern];
- return braces(pattern, options);
- };
- /**
- * Expand braces
- */
- micromatch.braceExpand = (pattern, options) => {
- if (typeof pattern !== "string") throw new TypeError("Expected a string");
- return micromatch.braces(pattern, {
- ...options,
- expand: true
- });
- };
- /**
- * Expose micromatch
- */
- micromatch.hasBraces = hasBraces;
- module.exports = micromatch;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js
- var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
- const path$5 = __require("path");
- const globParent = require_glob_parent();
- const micromatch = require_micromatch();
- const GLOBSTAR = "**";
- const ESCAPE_SYMBOL = "\\";
- const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
- const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
- const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
- const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
- const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
- /**
- * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
- * The latter is due to the presence of the device path at the beginning of the UNC path.
- */
- const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
- function isStaticPattern(pattern, options = {}) {
- return !isDynamicPattern(pattern, options);
- }
- exports.isStaticPattern = isStaticPattern;
- function isDynamicPattern(pattern, options = {}) {
- /**
- * A special case with an empty string is necessary for matching patterns that start with a forward slash.
- * An empty string cannot be a dynamic pattern.
- * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
- */
- if (pattern === "") return false;
- /**
- * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
- * filepath directly (without read directory).
- */
- if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) return true;
- if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) return true;
- if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) return true;
- if (options.braceExpansion !== false && hasBraceExpansion(pattern)) return true;
- return false;
- }
- exports.isDynamicPattern = isDynamicPattern;
- function hasBraceExpansion(pattern) {
- const openingBraceIndex = pattern.indexOf("{");
- if (openingBraceIndex === -1) return false;
- const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
- if (closingBraceIndex === -1) return false;
- const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
- return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
- }
- function convertToPositivePattern(pattern) {
- return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
- }
- exports.convertToPositivePattern = convertToPositivePattern;
- function convertToNegativePattern(pattern) {
- return "!" + pattern;
- }
- exports.convertToNegativePattern = convertToNegativePattern;
- function isNegativePattern(pattern) {
- return pattern.startsWith("!") && pattern[1] !== "(";
- }
- exports.isNegativePattern = isNegativePattern;
- function isPositivePattern(pattern) {
- return !isNegativePattern(pattern);
- }
- exports.isPositivePattern = isPositivePattern;
- function getNegativePatterns(patterns) {
- return patterns.filter(isNegativePattern);
- }
- exports.getNegativePatterns = getNegativePatterns;
- function getPositivePatterns(patterns) {
- return patterns.filter(isPositivePattern);
- }
- exports.getPositivePatterns = getPositivePatterns;
- /**
- * Returns patterns that can be applied inside the current directory.
- *
- * @example
- * // ['./*', '*', 'a/*']
- * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
- */
- function getPatternsInsideCurrentDirectory(patterns) {
- return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
- }
- exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
- /**
- * Returns patterns to be expanded relative to (outside) the current directory.
- *
- * @example
- * // ['../*', './../*']
- * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
- */
- function getPatternsOutsideCurrentDirectory(patterns) {
- return patterns.filter(isPatternRelatedToParentDirectory);
- }
- exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
- function isPatternRelatedToParentDirectory(pattern) {
- return pattern.startsWith("..") || pattern.startsWith("./..");
- }
- exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
- function getBaseDirectory(pattern) {
- return globParent(pattern, { flipBackslashes: false });
- }
- exports.getBaseDirectory = getBaseDirectory;
- function hasGlobStar(pattern) {
- return pattern.includes(GLOBSTAR);
- }
- exports.hasGlobStar = hasGlobStar;
- function endsWithSlashGlobStar(pattern) {
- return pattern.endsWith("/" + GLOBSTAR);
- }
- exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
- function isAffectDepthOfReadingPattern(pattern) {
- const basename = path$5.basename(pattern);
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
- }
- exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
- function expandPatternsWithBraceExpansion(patterns) {
- return patterns.reduce((collection, pattern) => {
- return collection.concat(expandBraceExpansion(pattern));
- }, []);
- }
- exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
- function expandBraceExpansion(pattern) {
- const patterns = micromatch.braces(pattern, {
- expand: true,
- nodupes: true,
- keepEscaping: true
- });
- /**
- * Sort the patterns by length so that the same depth patterns are processed side by side.
- * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
- */
- patterns.sort((a, b) => a.length - b.length);
- /**
- * Micromatch can return an empty string in the case of patterns like `{a,}`.
- */
- return patterns.filter((pattern) => pattern !== "");
- }
- exports.expandBraceExpansion = expandBraceExpansion;
- function getPatternParts(pattern, options) {
- let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
- /**
- * The scan method returns an empty array in some cases.
- * See micromatch/picomatch#58 for more details.
- */
- if (parts.length === 0) parts = [pattern];
- /**
- * The scan method does not return an empty part for the pattern with a forward slash.
- * This is another part of micromatch/picomatch#58.
- */
- if (parts[0].startsWith("/")) {
- parts[0] = parts[0].slice(1);
- parts.unshift("");
- }
- return parts;
- }
- exports.getPatternParts = getPatternParts;
- function makeRe(pattern, options) {
- return micromatch.makeRe(pattern, options);
- }
- exports.makeRe = makeRe;
- function convertPatternsToRe(patterns, options) {
- return patterns.map((pattern) => makeRe(pattern, options));
- }
- exports.convertPatternsToRe = convertPatternsToRe;
- function matchAny(entry, patternsRe) {
- return patternsRe.some((patternRe) => patternRe.test(entry));
- }
- exports.matchAny = matchAny;
- /**
- * This package only works with forward slashes as a path separator.
- * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
- */
- function removeDuplicateSlashes(pattern) {
- return pattern.replace(DOUBLE_SLASH_RE, "/");
- }
- exports.removeDuplicateSlashes = removeDuplicateSlashes;
- function partitionAbsoluteAndRelative(patterns) {
- const absolute = [];
- const relative = [];
- for (const pattern of patterns) if (isAbsolute(pattern)) absolute.push(pattern);
- else relative.push(pattern);
- return [absolute, relative];
- }
- exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
- function isAbsolute(pattern) {
- return path$5.isAbsolute(pattern);
- }
- exports.isAbsolute = isAbsolute;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js
- var require_merge2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- const PassThrough = __require("stream").PassThrough;
- const slice = Array.prototype.slice;
- module.exports = merge2;
- function merge2() {
- const streamsQueue = [];
- const args = slice.call(arguments);
- let merging = false;
- let options = args[args.length - 1];
- if (options && !Array.isArray(options) && options.pipe == null) args.pop();
- else options = {};
- const doEnd = options.end !== false;
- const doPipeError = options.pipeError === true;
- if (options.objectMode == null) options.objectMode = true;
- if (options.highWaterMark == null) options.highWaterMark = 64 * 1024;
- const mergedStream = PassThrough(options);
- function addStream() {
- for (let i = 0, len = arguments.length; i < len; i++) streamsQueue.push(pauseStreams(arguments[i], options));
- mergeStream();
- return this;
- }
- function mergeStream() {
- if (merging) return;
- merging = true;
- let streams = streamsQueue.shift();
- if (!streams) {
- process.nextTick(endStream);
- return;
- }
- if (!Array.isArray(streams)) streams = [streams];
- let pipesCount = streams.length + 1;
- function next() {
- if (--pipesCount > 0) return;
- merging = false;
- mergeStream();
- }
- function pipe(stream) {
- function onend() {
- stream.removeListener("merge2UnpipeEnd", onend);
- stream.removeListener("end", onend);
- if (doPipeError) stream.removeListener("error", onerror);
- next();
- }
- function onerror(err) {
- mergedStream.emit("error", err);
- }
- if (stream._readableState.endEmitted) return next();
- stream.on("merge2UnpipeEnd", onend);
- stream.on("end", onend);
- if (doPipeError) stream.on("error", onerror);
- stream.pipe(mergedStream, { end: false });
- stream.resume();
- }
- for (let i = 0; i < streams.length; i++) pipe(streams[i]);
- next();
- }
- function endStream() {
- merging = false;
- mergedStream.emit("queueDrain");
- if (doEnd) mergedStream.end();
- }
- mergedStream.setMaxListeners(0);
- mergedStream.add = addStream;
- mergedStream.on("unpipe", function(stream) {
- stream.emit("merge2UnpipeEnd");
- });
- if (args.length) addStream.apply(null, args);
- return mergedStream;
- }
- function pauseStreams(streams, options) {
- if (!Array.isArray(streams)) {
- if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options));
- if (!streams._readableState || !streams.pause || !streams.pipe) throw new Error("Only readable stream can be merged.");
- streams.pause();
- } else for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options);
- return streams;
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js
- var require_stream$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.merge = void 0;
- const merge2 = require_merge2();
- function merge(streams) {
- const mergedStream = merge2(streams);
- streams.forEach((stream) => {
- stream.once("error", (error) => mergedStream.emit("error", error));
- });
- mergedStream.once("close", () => propagateCloseEventToSources(streams));
- mergedStream.once("end", () => propagateCloseEventToSources(streams));
- return mergedStream;
- }
- exports.merge = merge;
- function propagateCloseEventToSources(streams) {
- streams.forEach((stream) => stream.emit("close"));
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/string.js
- var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.isEmpty = exports.isString = void 0;
- function isString(input) {
- return typeof input === "string";
- }
- exports.isString = isString;
- function isEmpty(input) {
- return input === "";
- }
- exports.isEmpty = isEmpty;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/index.js
- var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
- exports.array = require_array();
- exports.errno = require_errno();
- exports.fs = require_fs$3();
- exports.path = require_path();
- exports.pattern = require_pattern();
- exports.stream = require_stream$3();
- exports.string = require_string();
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/managers/tasks.js
- var require_tasks = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
- const utils = require_utils$1();
- function generate(input, settings) {
- const patterns = processPatterns(input, settings);
- const ignore = processPatterns(settings.ignore, settings);
- const positivePatterns = getPositivePatterns(patterns);
- const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
- const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
- const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
- return staticTasks.concat(dynamicTasks);
- }
- exports.generate = generate;
- function processPatterns(input, settings) {
- let patterns = input;
- /**
- * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
- * and some problems with the micromatch package (see fast-glob issues: #365, #394).
- *
- * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
- * in matching in the case of a large set of patterns after expansion.
- */
- if (settings.braceExpansion) patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
- /**
- * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
- * at any nesting level.
- *
- * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
- * the pattern in the filter before creating a regular expression. There is no need to change the patterns
- * in the application. Only on the input.
- */
- if (settings.baseNameMatch) patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
- /**
- * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
- */
- return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
- }
- /**
- * Returns tasks grouped by basic pattern directories.
- *
- * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
- * This is necessary because directory traversal starts at the base directory and goes deeper.
- */
- function convertPatternsToTasks(positive, negative, dynamic) {
- const tasks = [];
- const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
- const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
- const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
- const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
- tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
- if ("." in insideCurrentDirectoryGroup) tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
- else tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
- return tasks;
- }
- exports.convertPatternsToTasks = convertPatternsToTasks;
- function getPositivePatterns(patterns) {
- return utils.pattern.getPositivePatterns(patterns);
- }
- exports.getPositivePatterns = getPositivePatterns;
- function getNegativePatternsAsPositive(patterns, ignore) {
- return utils.pattern.getNegativePatterns(patterns).concat(ignore).map(utils.pattern.convertToPositivePattern);
- }
- exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
- function groupPatternsByBaseDirectory(patterns) {
- return patterns.reduce((collection, pattern) => {
- const base = utils.pattern.getBaseDirectory(pattern);
- if (base in collection) collection[base].push(pattern);
- else collection[base] = [pattern];
- return collection;
- }, {});
- }
- exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
- function convertPatternGroupsToTasks(positive, negative, dynamic) {
- return Object.keys(positive).map((base) => {
- return convertPatternGroupToTask(base, positive[base], negative, dynamic);
- });
- }
- exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
- function convertPatternGroupToTask(base, positive, negative, dynamic) {
- return {
- dynamic,
- positive,
- negative,
- base,
- patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
- };
- }
- exports.convertPatternGroupToTask = convertPatternGroupToTask;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
- var require_async$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.read = void 0;
- function read(path, settings, callback) {
- settings.fs.lstat(path, (lstatError, lstat) => {
- if (lstatError !== null) {
- callFailureCallback(callback, lstatError);
- return;
- }
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
- callSuccessCallback(callback, lstat);
- return;
- }
- settings.fs.stat(path, (statError, stat) => {
- if (statError !== null) {
- if (settings.throwErrorOnBrokenSymbolicLink) {
- callFailureCallback(callback, statError);
- return;
- }
- callSuccessCallback(callback, lstat);
- return;
- }
- if (settings.markSymbolicLink) stat.isSymbolicLink = () => true;
- callSuccessCallback(callback, stat);
- });
- });
- }
- exports.read = read;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, result) {
- callback(null, result);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
- var require_sync$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.read = void 0;
- function read(path, settings) {
- const lstat = settings.fs.lstatSync(path);
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
- try {
- const stat = settings.fs.statSync(path);
- if (settings.markSymbolicLink) stat.isSymbolicLink = () => true;
- return stat;
- } catch (error) {
- if (!settings.throwErrorOnBrokenSymbolicLink) return lstat;
- throw error;
- }
- }
- exports.read = read;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js
- var require_fs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
- const fs$3 = __require("fs");
- exports.FILE_SYSTEM_ADAPTER = {
- lstat: fs$3.lstat,
- stat: fs$3.stat,
- lstatSync: fs$3.lstatSync,
- statSync: fs$3.statSync
- };
- function createFileSystemAdapter(fsMethods) {
- if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
- return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
- }
- exports.createFileSystemAdapter = createFileSystemAdapter;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
- var require_settings$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const fs = require_fs$2();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
- this.fs = fs.createFileSystemAdapter(this._options.fs);
- this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports.default = Settings;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js
- var require_out$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.statSync = exports.stat = exports.Settings = void 0;
- const async = require_async$5();
- const sync = require_sync$5();
- const settings_1 = require_settings$3();
- exports.Settings = settings_1.default;
- function stat(path, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- async.read(path, getSettings(), optionsOrSettingsOrCallback);
- return;
- }
- async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
- }
- exports.stat = stat;
- function statSync(path, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return sync.read(path, settings);
- }
- exports.statSync = statSync;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) return settingsOrOptions;
- return new settings_1.default(settingsOrOptions);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js
- var require_queue_microtask = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
- let promise;
- module.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
- throw err;
- }, 0));
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js
- var require_run_parallel = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
- module.exports = runParallel;
- const queueMicrotask = require_queue_microtask();
- function runParallel(tasks, cb) {
- let results, pending, keys;
- let isSync = true;
- if (Array.isArray(tasks)) {
- results = [];
- pending = tasks.length;
- } else {
- keys = Object.keys(tasks);
- results = {};
- pending = keys.length;
- }
- function done(err) {
- function end() {
- if (cb) cb(err, results);
- cb = null;
- }
- if (isSync) queueMicrotask(end);
- else end();
- }
- function each(i, err, result) {
- results[i] = result;
- if (--pending === 0 || err) done(err);
- }
- if (!pending) done(null);
- else if (keys) keys.forEach(function(key) {
- tasks[key](function(err, result) {
- each(key, err, result);
- });
- });
- else tasks.forEach(function(task, i) {
- task(function(err, result) {
- each(i, err, result);
- });
- });
- isSync = false;
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
- var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
- const NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
- if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
- const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
- const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
- const SUPPORTED_MAJOR_VERSION = 10;
- /**
- * IS `true` for Node.js 10.10 and greater.
- */
- exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION || MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= 10;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js
- var require_fs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.createDirentFromStats = void 0;
- var DirentFromStats = class {
- constructor(name, stats) {
- this.name = name;
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
- this.isDirectory = stats.isDirectory.bind(stats);
- this.isFIFO = stats.isFIFO.bind(stats);
- this.isFile = stats.isFile.bind(stats);
- this.isSocket = stats.isSocket.bind(stats);
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
- }
- };
- function createDirentFromStats(name, stats) {
- return new DirentFromStats(name, stats);
- }
- exports.createDirentFromStats = createDirentFromStats;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
- var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.fs = void 0;
- exports.fs = require_fs$1();
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
- var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.joinPathSegments = void 0;
- function joinPathSegments(a, b, separator) {
- /**
- * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
- */
- if (a.endsWith(separator)) return a + b;
- return a + separator + b;
- }
- exports.joinPathSegments = joinPathSegments;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js
- var require_async$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
- const fsStat = require_out$3();
- const rpl = require_run_parallel();
- const constants_1 = require_constants();
- const utils = require_utils();
- const common = require_common$1();
- function read(directory, settings, callback) {
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
- readdirWithFileTypes(directory, settings, callback);
- return;
- }
- readdir(directory, settings, callback);
- }
- exports.read = read;
- function readdirWithFileTypes(directory, settings, callback) {
- settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
- if (readdirError !== null) {
- callFailureCallback(callback, readdirError);
- return;
- }
- const entries = dirents.map((dirent) => ({
- dirent,
- name: dirent.name,
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
- }));
- if (!settings.followSymbolicLinks) {
- callSuccessCallback(callback, entries);
- return;
- }
- rpl(entries.map((entry) => makeRplTaskEntry(entry, settings)), (rplError, rplEntries) => {
- if (rplError !== null) {
- callFailureCallback(callback, rplError);
- return;
- }
- callSuccessCallback(callback, rplEntries);
- });
- });
- }
- exports.readdirWithFileTypes = readdirWithFileTypes;
- function makeRplTaskEntry(entry, settings) {
- return (done) => {
- if (!entry.dirent.isSymbolicLink()) {
- done(null, entry);
- return;
- }
- settings.fs.stat(entry.path, (statError, stats) => {
- if (statError !== null) {
- if (settings.throwErrorOnBrokenSymbolicLink) {
- done(statError);
- return;
- }
- done(null, entry);
- return;
- }
- entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
- done(null, entry);
- });
- };
- }
- function readdir(directory, settings, callback) {
- settings.fs.readdir(directory, (readdirError, names) => {
- if (readdirError !== null) {
- callFailureCallback(callback, readdirError);
- return;
- }
- rpl(names.map((name) => {
- const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
- return (done) => {
- fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
- if (error !== null) {
- done(error);
- return;
- }
- const entry = {
- name,
- path,
- dirent: utils.fs.createDirentFromStats(name, stats)
- };
- if (settings.stats) entry.stats = stats;
- done(null, entry);
- });
- };
- }), (rplError, entries) => {
- if (rplError !== null) {
- callFailureCallback(callback, rplError);
- return;
- }
- callSuccessCallback(callback, entries);
- });
- });
- }
- exports.readdir = readdir;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, result) {
- callback(null, result);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js
- var require_sync$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.readdir = exports.readdirWithFileTypes = exports.read = void 0;
- const fsStat = require_out$3();
- const constants_1 = require_constants();
- const utils = require_utils();
- const common = require_common$1();
- function read(directory, settings) {
- if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return readdirWithFileTypes(directory, settings);
- return readdir(directory, settings);
- }
- exports.read = read;
- function readdirWithFileTypes(directory, settings) {
- return settings.fs.readdirSync(directory, { withFileTypes: true }).map((dirent) => {
- const entry = {
- dirent,
- name: dirent.name,
- path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
- };
- if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) try {
- const stats = settings.fs.statSync(entry.path);
- entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
- } catch (error) {
- if (settings.throwErrorOnBrokenSymbolicLink) throw error;
- }
- return entry;
- });
- }
- exports.readdirWithFileTypes = readdirWithFileTypes;
- function readdir(directory, settings) {
- return settings.fs.readdirSync(directory).map((name) => {
- const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
- const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
- const entry = {
- name,
- path: entryPath,
- dirent: utils.fs.createDirentFromStats(name, stats)
- };
- if (settings.stats) entry.stats = stats;
- return entry;
- });
- }
- exports.readdir = readdir;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js
- var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
- const fs$2 = __require("fs");
- exports.FILE_SYSTEM_ADAPTER = {
- lstat: fs$2.lstat,
- stat: fs$2.stat,
- lstatSync: fs$2.lstatSync,
- statSync: fs$2.statSync,
- readdir: fs$2.readdir,
- readdirSync: fs$2.readdirSync
- };
- function createFileSystemAdapter(fsMethods) {
- if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
- return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
- }
- exports.createFileSystemAdapter = createFileSystemAdapter;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
- var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const path$4 = __require("path");
- const fsStat = require_out$3();
- const fs = require_fs();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
- this.fs = fs.createFileSystemAdapter(this._options.fs);
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
- this.stats = this._getValue(this._options.stats, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
- this.fsStatSettings = new fsStat.Settings({
- followSymbolicLink: this.followSymbolicLinks,
- fs: this.fs,
- throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
- });
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports.default = Settings;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js
- var require_out$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Settings = exports.scandirSync = exports.scandir = void 0;
- const async = require_async$4();
- const sync = require_sync$4();
- const settings_1 = require_settings$2();
- exports.Settings = settings_1.default;
- function scandir(path, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- async.read(path, getSettings(), optionsOrSettingsOrCallback);
- return;
- }
- async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
- }
- exports.scandir = scandir;
- function scandirSync(path, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return sync.read(path, settings);
- }
- exports.scandirSync = scandirSync;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) return settingsOrOptions;
- return new settings_1.default(settingsOrOptions);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js
- var require_reusify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- function reusify(Constructor) {
- var head = new Constructor();
- var tail = head;
- function get() {
- var current = head;
- if (current.next) head = current.next;
- else {
- head = new Constructor();
- tail = head;
- }
- current.next = null;
- return current;
- }
- function release(obj) {
- tail.next = obj;
- tail = obj;
- }
- return {
- get,
- release
- };
- }
- module.exports = reusify;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fastq@1.19.1/node_modules/fastq/queue.js
- var require_queue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
- var reusify = require_reusify();
- function fastqueue(context, worker, _concurrency) {
- if (typeof context === "function") {
- _concurrency = worker;
- worker = context;
- context = null;
- }
- if (!(_concurrency >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
- var cache = reusify(Task);
- var queueHead = null;
- var queueTail = null;
- var _running = 0;
- var errorHandler = null;
- var self = {
- push,
- drain: noop,
- saturated: noop,
- pause,
- paused: false,
- get concurrency() {
- return _concurrency;
- },
- set concurrency(value) {
- if (!(value >= 1)) throw new Error("fastqueue concurrency must be equal to or greater than 1");
- _concurrency = value;
- if (self.paused) return;
- for (; queueHead && _running < _concurrency;) {
- _running++;
- release();
- }
- },
- running,
- resume,
- idle,
- length,
- getQueue,
- unshift,
- empty: noop,
- kill,
- killAndDrain,
- error
- };
- return self;
- function running() {
- return _running;
- }
- function pause() {
- self.paused = true;
- }
- function length() {
- var current = queueHead;
- var counter = 0;
- while (current) {
- current = current.next;
- counter++;
- }
- return counter;
- }
- function getQueue() {
- var current = queueHead;
- var tasks = [];
- while (current) {
- tasks.push(current.value);
- current = current.next;
- }
- return tasks;
- }
- function resume() {
- if (!self.paused) return;
- self.paused = false;
- if (queueHead === null) {
- _running++;
- release();
- return;
- }
- for (; queueHead && _running < _concurrency;) {
- _running++;
- release();
- }
- }
- function idle() {
- return _running === 0 && self.length() === 0;
- }
- function push(value, done) {
- var current = cache.get();
- current.context = context;
- current.release = release;
- current.value = value;
- current.callback = done || noop;
- current.errorHandler = errorHandler;
- if (_running >= _concurrency || self.paused) if (queueTail) {
- queueTail.next = current;
- queueTail = current;
- } else {
- queueHead = current;
- queueTail = current;
- self.saturated();
- }
- else {
- _running++;
- worker.call(context, current.value, current.worked);
- }
- }
- function unshift(value, done) {
- var current = cache.get();
- current.context = context;
- current.release = release;
- current.value = value;
- current.callback = done || noop;
- current.errorHandler = errorHandler;
- if (_running >= _concurrency || self.paused) if (queueHead) {
- current.next = queueHead;
- queueHead = current;
- } else {
- queueHead = current;
- queueTail = current;
- self.saturated();
- }
- else {
- _running++;
- worker.call(context, current.value, current.worked);
- }
- }
- function release(holder) {
- if (holder) cache.release(holder);
- var next = queueHead;
- if (next && _running <= _concurrency) if (!self.paused) {
- if (queueTail === queueHead) queueTail = null;
- queueHead = next.next;
- next.next = null;
- worker.call(context, next.value, next.worked);
- if (queueTail === null) self.empty();
- } else _running--;
- else if (--_running === 0) self.drain();
- }
- function kill() {
- queueHead = null;
- queueTail = null;
- self.drain = noop;
- }
- function killAndDrain() {
- queueHead = null;
- queueTail = null;
- self.drain();
- self.drain = noop;
- }
- function error(handler) {
- errorHandler = handler;
- }
- }
- function noop() {}
- function Task() {
- this.value = null;
- this.callback = noop;
- this.next = null;
- this.release = noop;
- this.context = null;
- this.errorHandler = null;
- var self = this;
- this.worked = function worked(err, result) {
- var callback = self.callback;
- var errorHandler = self.errorHandler;
- var val = self.value;
- self.value = null;
- self.callback = noop;
- if (self.errorHandler) errorHandler(err, val);
- callback.call(self.context, err, result);
- self.release(self);
- };
- }
- function queueAsPromised(context, worker, _concurrency) {
- if (typeof context === "function") {
- _concurrency = worker;
- worker = context;
- context = null;
- }
- function asyncWrapper(arg, cb) {
- worker.call(this, arg).then(function(res) {
- cb(null, res);
- }, cb);
- }
- var queue = fastqueue(context, asyncWrapper, _concurrency);
- var pushCb = queue.push;
- var unshiftCb = queue.unshift;
- queue.push = push;
- queue.unshift = unshift;
- queue.drained = drained;
- return queue;
- function push(value) {
- var p = new Promise(function(resolve, reject) {
- pushCb(value, function(err, result) {
- if (err) {
- reject(err);
- return;
- }
- resolve(result);
- });
- });
- p.catch(noop);
- return p;
- }
- function unshift(value) {
- var p = new Promise(function(resolve, reject) {
- unshiftCb(value, function(err, result) {
- if (err) {
- reject(err);
- return;
- }
- resolve(result);
- });
- });
- p.catch(noop);
- return p;
- }
- function drained() {
- return new Promise(function(resolve) {
- process.nextTick(function() {
- if (queue.idle()) resolve();
- else {
- var previousDrain = queue.drain;
- queue.drain = function() {
- if (typeof previousDrain === "function") previousDrain();
- resolve();
- queue.drain = previousDrain;
- };
- }
- });
- });
- }
- }
- module.exports = fastqueue;
- module.exports.promise = queueAsPromised;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js
- var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
- function isFatalError(settings, error) {
- if (settings.errorFilter === null) return true;
- return !settings.errorFilter(error);
- }
- exports.isFatalError = isFatalError;
- function isAppliedFilter(filter, value) {
- return filter === null || filter(value);
- }
- exports.isAppliedFilter = isAppliedFilter;
- function replacePathSegmentSeparator(filepath, separator) {
- return filepath.split(/[/\\]/).join(separator);
- }
- exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
- function joinPathSegments(a, b, separator) {
- if (a === "") return b;
- /**
- * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
- */
- if (a.endsWith(separator)) return a + b;
- return a + separator + b;
- }
- exports.joinPathSegments = joinPathSegments;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js
- var require_reader$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const common = require_common();
- var Reader = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
- }
- };
- exports.default = Reader;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js
- var require_async$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const events_1 = __require("events");
- const fsScandir = require_out$2();
- const fastq = require_queue();
- const common = require_common();
- const reader_1 = require_reader$1();
- var AsyncReader = class extends reader_1.default {
- constructor(_root, _settings) {
- super(_root, _settings);
- this._settings = _settings;
- this._scandir = fsScandir.scandir;
- this._emitter = new events_1.EventEmitter();
- this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
- this._isFatalError = false;
- this._isDestroyed = false;
- this._queue.drain = () => {
- if (!this._isFatalError) this._emitter.emit("end");
- };
- }
- read() {
- this._isFatalError = false;
- this._isDestroyed = false;
- setImmediate(() => {
- this._pushToQueue(this._root, this._settings.basePath);
- });
- return this._emitter;
- }
- get isDestroyed() {
- return this._isDestroyed;
- }
- destroy() {
- if (this._isDestroyed) throw new Error("The reader is already destroyed");
- this._isDestroyed = true;
- this._queue.killAndDrain();
- }
- onEntry(callback) {
- this._emitter.on("entry", callback);
- }
- onError(callback) {
- this._emitter.once("error", callback);
- }
- onEnd(callback) {
- this._emitter.once("end", callback);
- }
- _pushToQueue(directory, base) {
- const queueItem = {
- directory,
- base
- };
- this._queue.push(queueItem, (error) => {
- if (error !== null) this._handleError(error);
- });
- }
- _worker(item, done) {
- this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
- if (error !== null) {
- done(error, void 0);
- return;
- }
- for (const entry of entries) this._handleEntry(entry, item.base);
- done(null, void 0);
- });
- }
- _handleError(error) {
- if (this._isDestroyed || !common.isFatalError(this._settings, error)) return;
- this._isFatalError = true;
- this._isDestroyed = true;
- this._emitter.emit("error", error);
- }
- _handleEntry(entry, base) {
- if (this._isDestroyed || this._isFatalError) return;
- const fullpath = entry.path;
- if (base !== void 0) entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
- if (common.isAppliedFilter(this._settings.entryFilter, entry)) this._emitEntry(entry);
- if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
- }
- _emitEntry(entry) {
- this._emitter.emit("entry", entry);
- }
- };
- exports.default = AsyncReader;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js
- var require_async$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const async_1 = require_async$3();
- var AsyncProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new async_1.default(this._root, this._settings);
- this._storage = [];
- }
- read(callback) {
- this._reader.onError((error) => {
- callFailureCallback(callback, error);
- });
- this._reader.onEntry((entry) => {
- this._storage.push(entry);
- });
- this._reader.onEnd(() => {
- callSuccessCallback(callback, this._storage);
- });
- this._reader.read();
- }
- };
- exports.default = AsyncProvider;
- function callFailureCallback(callback, error) {
- callback(error);
- }
- function callSuccessCallback(callback, entries) {
- callback(null, entries);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
- var require_stream$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const stream_1$2 = __require("stream");
- const async_1 = require_async$3();
- var StreamProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new async_1.default(this._root, this._settings);
- this._stream = new stream_1$2.Readable({
- objectMode: true,
- read: () => {},
- destroy: () => {
- if (!this._reader.isDestroyed) this._reader.destroy();
- }
- });
- }
- read() {
- this._reader.onError((error) => {
- this._stream.emit("error", error);
- });
- this._reader.onEntry((entry) => {
- this._stream.push(entry);
- });
- this._reader.onEnd(() => {
- this._stream.push(null);
- });
- this._reader.read();
- return this._stream;
- }
- };
- exports.default = StreamProvider;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js
- var require_sync$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const fsScandir = require_out$2();
- const common = require_common();
- const reader_1 = require_reader$1();
- var SyncReader = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._scandir = fsScandir.scandirSync;
- this._storage = [];
- this._queue = /* @__PURE__ */ new Set();
- }
- read() {
- this._pushToQueue(this._root, this._settings.basePath);
- this._handleQueue();
- return this._storage;
- }
- _pushToQueue(directory, base) {
- this._queue.add({
- directory,
- base
- });
- }
- _handleQueue() {
- for (const item of this._queue.values()) this._handleDirectory(item.directory, item.base);
- }
- _handleDirectory(directory, base) {
- try {
- const entries = this._scandir(directory, this._settings.fsScandirSettings);
- for (const entry of entries) this._handleEntry(entry, base);
- } catch (error) {
- this._handleError(error);
- }
- }
- _handleError(error) {
- if (!common.isFatalError(this._settings, error)) return;
- throw error;
- }
- _handleEntry(entry, base) {
- const fullpath = entry.path;
- if (base !== void 0) entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
- if (common.isAppliedFilter(this._settings.entryFilter, entry)) this._pushToStorage(entry);
- if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
- }
- _pushToStorage(entry) {
- this._storage.push(entry);
- }
- };
- exports.default = SyncReader;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js
- var require_sync$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const sync_1 = require_sync$3();
- var SyncProvider = class {
- constructor(_root, _settings) {
- this._root = _root;
- this._settings = _settings;
- this._reader = new sync_1.default(this._root, this._settings);
- }
- read() {
- return this._reader.read();
- }
- };
- exports.default = SyncProvider;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
- var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const path$3 = __require("path");
- const fsScandir = require_out$2();
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.basePath = this._getValue(this._options.basePath, void 0);
- this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
- this.deepFilter = this._getValue(this._options.deepFilter, null);
- this.entryFilter = this._getValue(this._options.entryFilter, null);
- this.errorFilter = this._getValue(this._options.errorFilter, null);
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
- this.fsScandirSettings = new fsScandir.Settings({
- followSymbolicLinks: this._options.followSymbolicLinks,
- fs: this._options.fs,
- pathSegmentSeparator: this._options.pathSegmentSeparator,
- stats: this._options.stats,
- throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
- });
- }
- _getValue(option, value) {
- return option !== null && option !== void 0 ? option : value;
- }
- };
- exports.default = Settings;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js
- var require_out$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
- const async_1 = require_async$2();
- const stream_1 = require_stream$2();
- const sync_1 = require_sync$2();
- const settings_1 = require_settings$1();
- exports.Settings = settings_1.default;
- function walk(directory, optionsOrSettingsOrCallback, callback) {
- if (typeof optionsOrSettingsOrCallback === "function") {
- new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
- return;
- }
- new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
- }
- exports.walk = walk;
- function walkSync(directory, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return new sync_1.default(directory, settings).read();
- }
- exports.walkSync = walkSync;
- function walkStream(directory, optionsOrSettings) {
- const settings = getSettings(optionsOrSettings);
- return new stream_1.default(directory, settings).read();
- }
- exports.walkStream = walkStream;
- function getSettings(settingsOrOptions = {}) {
- if (settingsOrOptions instanceof settings_1.default) return settingsOrOptions;
- return new settings_1.default(settingsOrOptions);
- }
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
- var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const path$2 = __require("path");
- const fsStat = require_out$3();
- const utils = require_utils$1();
- var Reader = class {
- constructor(_settings) {
- this._settings = _settings;
- this._fsStatSettings = new fsStat.Settings({
- followSymbolicLink: this._settings.followSymbolicLinks,
- fs: this._settings.fs,
- throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
- });
- }
- _getFullEntryPath(filepath) {
- return path$2.resolve(this._settings.cwd, filepath);
- }
- _makeEntry(stats, pattern) {
- const entry = {
- name: pattern,
- path: pattern,
- dirent: utils.fs.createDirentFromStats(pattern, stats)
- };
- if (this._settings.stats) entry.stats = stats;
- return entry;
- }
- _isFatalError(error) {
- return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
- }
- };
- exports.default = Reader;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/stream.js
- var require_stream$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const stream_1$1 = __require("stream");
- const fsStat = require_out$3();
- const fsWalk = require_out$1();
- const reader_1 = require_reader();
- var ReaderStream = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkStream = fsWalk.walkStream;
- this._stat = fsStat.stat;
- }
- dynamic(root, options) {
- return this._walkStream(root, options);
- }
- static(patterns, options) {
- const filepaths = patterns.map(this._getFullEntryPath, this);
- const stream = new stream_1$1.PassThrough({ objectMode: true });
- stream._write = (index, _enc, done) => {
- return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
- if (entry !== null && options.entryFilter(entry)) stream.push(entry);
- if (index === filepaths.length - 1) stream.end();
- done();
- }).catch(done);
- };
- for (let i = 0; i < filepaths.length; i++) stream.write(i);
- return stream;
- }
- _getEntry(filepath, pattern, options) {
- return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
- if (options.errorFilter(error)) return null;
- throw error;
- });
- }
- _getStat(filepath) {
- return new Promise((resolve, reject) => {
- this._stat(filepath, this._fsStatSettings, (error, stats) => {
- return error === null ? resolve(stats) : reject(error);
- });
- });
- }
- };
- exports.default = ReaderStream;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/async.js
- var require_async$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const fsWalk = require_out$1();
- const reader_1 = require_reader();
- const stream_1 = require_stream$1();
- var ReaderAsync = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkAsync = fsWalk.walk;
- this._readerStream = new stream_1.default(this._settings);
- }
- dynamic(root, options) {
- return new Promise((resolve, reject) => {
- this._walkAsync(root, options, (error, entries) => {
- if (error === null) resolve(entries);
- else reject(error);
- });
- });
- }
- async static(patterns, options) {
- const entries = [];
- const stream = this._readerStream.static(patterns, options);
- return new Promise((resolve, reject) => {
- stream.once("error", reject);
- stream.on("data", (entry) => entries.push(entry));
- stream.once("end", () => resolve(entries));
- });
- }
- };
- exports.default = ReaderAsync;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/matcher.js
- var require_matcher = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const utils = require_utils$1();
- var Matcher = class {
- constructor(_patterns, _settings, _micromatchOptions) {
- this._patterns = _patterns;
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- this._storage = [];
- this._fillStorage();
- }
- _fillStorage() {
- for (const pattern of this._patterns) {
- const segments = this._getPatternSegments(pattern);
- const sections = this._splitSegmentsIntoSections(segments);
- this._storage.push({
- complete: sections.length <= 1,
- pattern,
- segments,
- sections
- });
- }
- }
- _getPatternSegments(pattern) {
- return utils.pattern.getPatternParts(pattern, this._micromatchOptions).map((part) => {
- if (!utils.pattern.isDynamicPattern(part, this._settings)) return {
- dynamic: false,
- pattern: part
- };
- return {
- dynamic: true,
- pattern: part,
- patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
- };
- });
- }
- _splitSegmentsIntoSections(segments) {
- return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
- }
- };
- exports.default = Matcher;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/matchers/partial.js
- var require_partial = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const matcher_1 = require_matcher();
- var PartialMatcher = class extends matcher_1.default {
- match(filepath) {
- const parts = filepath.split("/");
- const levels = parts.length;
- const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
- for (const pattern of patterns) {
- const section = pattern.sections[0];
- /**
- * In this case, the pattern has a globstar and we must read all directories unconditionally,
- * but only if the level has reached the end of the first group.
- *
- * fixtures/{a,b}/**
- * ^ true/false ^ always true
- */
- if (!pattern.complete && levels > section.length) return true;
- if (parts.every((part, index) => {
- const segment = pattern.segments[index];
- if (segment.dynamic && segment.patternRe.test(part)) return true;
- if (!segment.dynamic && segment.pattern === part) return true;
- return false;
- })) return true;
- }
- return false;
- }
- };
- exports.default = PartialMatcher;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/deep.js
- var require_deep = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const utils = require_utils$1();
- const partial_1 = require_partial();
- var DeepFilter = class {
- constructor(_settings, _micromatchOptions) {
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- }
- getFilter(basePath, positive, negative) {
- const matcher = this._getMatcher(positive);
- const negativeRe = this._getNegativePatternsRe(negative);
- return (entry) => this._filter(basePath, entry, matcher, negativeRe);
- }
- _getMatcher(patterns) {
- return new partial_1.default(patterns, this._settings, this._micromatchOptions);
- }
- _getNegativePatternsRe(patterns) {
- const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
- return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
- }
- _filter(basePath, entry, matcher, negativeRe) {
- if (this._isSkippedByDeep(basePath, entry.path)) return false;
- if (this._isSkippedSymbolicLink(entry)) return false;
- const filepath = utils.path.removeLeadingDotSegment(entry.path);
- if (this._isSkippedByPositivePatterns(filepath, matcher)) return false;
- return this._isSkippedByNegativePatterns(filepath, negativeRe);
- }
- _isSkippedByDeep(basePath, entryPath) {
- /**
- * Avoid unnecessary depth calculations when it doesn't matter.
- */
- if (this._settings.deep === Infinity) return false;
- return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
- }
- _getEntryLevel(basePath, entryPath) {
- const entryPathDepth = entryPath.split("/").length;
- if (basePath === "") return entryPathDepth;
- return entryPathDepth - basePath.split("/").length;
- }
- _isSkippedSymbolicLink(entry) {
- return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
- }
- _isSkippedByPositivePatterns(entryPath, matcher) {
- return !this._settings.baseNameMatch && !matcher.match(entryPath);
- }
- _isSkippedByNegativePatterns(entryPath, patternsRe) {
- return !utils.pattern.matchAny(entryPath, patternsRe);
- }
- };
- exports.default = DeepFilter;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.js
- var require_entry$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const utils = require_utils$1();
- var EntryFilter = class {
- constructor(_settings, _micromatchOptions) {
- this._settings = _settings;
- this._micromatchOptions = _micromatchOptions;
- this.index = /* @__PURE__ */ new Map();
- }
- getFilter(positive, negative) {
- const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative);
- const patterns = {
- positive: { all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions) },
- negative: {
- absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
- relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
- }
- };
- return (entry) => this._filter(entry, patterns);
- }
- _filter(entry, patterns) {
- const filepath = utils.path.removeLeadingDotSegment(entry.path);
- if (this._settings.unique && this._isDuplicateEntry(filepath)) return false;
- if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) return false;
- const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
- if (this._settings.unique && isMatched) this._createIndexRecord(filepath);
- return isMatched;
- }
- _isDuplicateEntry(filepath) {
- return this.index.has(filepath);
- }
- _createIndexRecord(filepath) {
- this.index.set(filepath, void 0);
- }
- _onlyFileFilter(entry) {
- return this._settings.onlyFiles && !entry.dirent.isFile();
- }
- _onlyDirectoryFilter(entry) {
- return this._settings.onlyDirectories && !entry.dirent.isDirectory();
- }
- _isMatchToPatternsSet(filepath, patterns, isDirectory) {
- if (!this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory)) return false;
- if (this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory)) return false;
- if (this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory)) return false;
- return true;
- }
- _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
- if (patternsRe.length === 0) return false;
- const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);
- return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
- }
- _isMatchToPatterns(filepath, patternsRe, isDirectory) {
- if (patternsRe.length === 0) return false;
- const isMatched = utils.pattern.matchAny(filepath, patternsRe);
- if (!isMatched && isDirectory) return utils.pattern.matchAny(filepath + "/", patternsRe);
- return isMatched;
- }
- };
- exports.default = EntryFilter;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/error.js
- var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const utils = require_utils$1();
- var ErrorFilter = class {
- constructor(_settings) {
- this._settings = _settings;
- }
- getFilter() {
- return (error) => this._isNonFatalError(error);
- }
- _isNonFatalError(error) {
- return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
- }
- };
- exports.default = ErrorFilter;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/transformers/entry.js
- var require_entry = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const utils = require_utils$1();
- var EntryTransformer = class {
- constructor(_settings) {
- this._settings = _settings;
- }
- getTransformer() {
- return (entry) => this._transform(entry);
- }
- _transform(entry) {
- let filepath = entry.path;
- if (this._settings.absolute) {
- filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
- filepath = utils.path.unixify(filepath);
- }
- if (this._settings.markDirectories && entry.dirent.isDirectory()) filepath += "/";
- if (!this._settings.objectMode) return filepath;
- return Object.assign(Object.assign({}, entry), { path: filepath });
- }
- };
- exports.default = EntryTransformer;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
- var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const path$1 = __require("path");
- const deep_1 = require_deep();
- const entry_1 = require_entry$1();
- const error_1 = require_error();
- const entry_2 = require_entry();
- var Provider = class {
- constructor(_settings) {
- this._settings = _settings;
- this.errorFilter = new error_1.default(this._settings);
- this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
- this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
- this.entryTransformer = new entry_2.default(this._settings);
- }
- _getRootDirectory(task) {
- return path$1.resolve(this._settings.cwd, task.base);
- }
- _getReaderOptions(task) {
- const basePath = task.base === "." ? "" : task.base;
- return {
- basePath,
- pathSegmentSeparator: "/",
- concurrency: this._settings.concurrency,
- deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
- entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
- errorFilter: this.errorFilter.getFilter(),
- followSymbolicLinks: this._settings.followSymbolicLinks,
- fs: this._settings.fs,
- stats: this._settings.stats,
- throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
- transform: this.entryTransformer.getTransformer()
- };
- }
- _getMicromatchOptions() {
- return {
- dot: this._settings.dot,
- matchBase: this._settings.baseNameMatch,
- nobrace: !this._settings.braceExpansion,
- nocase: !this._settings.caseSensitiveMatch,
- noext: !this._settings.extglob,
- noglobstar: !this._settings.globstar,
- posix: true,
- strictSlashes: false
- };
- }
- };
- exports.default = Provider;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/async.js
- var require_async = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const async_1 = require_async$1();
- const provider_1 = require_provider();
- var ProviderAsync = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new async_1.default(this._settings);
- }
- async read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- return (await this.api(root, task, options)).map((entry) => options.transform(entry));
- }
- api(root, task, options) {
- if (task.dynamic) return this._reader.dynamic(root, options);
- return this._reader.static(task.patterns, options);
- }
- };
- exports.default = ProviderAsync;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/stream.js
- var require_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const stream_1 = __require("stream");
- const stream_2 = require_stream$1();
- const provider_1 = require_provider();
- var ProviderStream = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new stream_2.default(this._settings);
- }
- read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- const source = this.api(root, task, options);
- const destination = new stream_1.Readable({
- objectMode: true,
- read: () => {}
- });
- source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
- destination.once("close", () => source.destroy());
- return destination;
- }
- api(root, task, options) {
- if (task.dynamic) return this._reader.dynamic(root, options);
- return this._reader.static(task.patterns, options);
- }
- };
- exports.default = ProviderStream;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/sync.js
- var require_sync$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const fsStat = require_out$3();
- const fsWalk = require_out$1();
- const reader_1 = require_reader();
- var ReaderSync = class extends reader_1.default {
- constructor() {
- super(...arguments);
- this._walkSync = fsWalk.walkSync;
- this._statSync = fsStat.statSync;
- }
- dynamic(root, options) {
- return this._walkSync(root, options);
- }
- static(patterns, options) {
- const entries = [];
- for (const pattern of patterns) {
- const filepath = this._getFullEntryPath(pattern);
- const entry = this._getEntry(filepath, pattern, options);
- if (entry === null || !options.entryFilter(entry)) continue;
- entries.push(entry);
- }
- return entries;
- }
- _getEntry(filepath, pattern, options) {
- try {
- const stats = this._getStat(filepath);
- return this._makeEntry(stats, pattern);
- } catch (error) {
- if (options.errorFilter(error)) return null;
- throw error;
- }
- }
- _getStat(filepath) {
- return this._statSync(filepath, this._fsStatSettings);
- }
- };
- exports.default = ReaderSync;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/sync.js
- var require_sync = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- const sync_1 = require_sync$1();
- const provider_1 = require_provider();
- var ProviderSync = class extends provider_1.default {
- constructor() {
- super(...arguments);
- this._reader = new sync_1.default(this._settings);
- }
- read(task) {
- const root = this._getRootDirectory(task);
- const options = this._getReaderOptions(task);
- return this.api(root, task, options).map(options.transform);
- }
- api(root, task, options) {
- if (task.dynamic) return this._reader.dynamic(root, options);
- return this._reader.static(task.patterns, options);
- }
- };
- exports.default = ProviderSync;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js
- var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
- const fs$1 = __require("fs");
- const os = __require("os");
- /**
- * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
- * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
- */
- const CPU_COUNT = Math.max(os.cpus().length, 1);
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
- lstat: fs$1.lstat,
- lstatSync: fs$1.lstatSync,
- stat: fs$1.stat,
- statSync: fs$1.statSync,
- readdir: fs$1.readdir,
- readdirSync: fs$1.readdirSync
- };
- var Settings = class {
- constructor(_options = {}) {
- this._options = _options;
- this.absolute = this._getValue(this._options.absolute, false);
- this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
- this.braceExpansion = this._getValue(this._options.braceExpansion, true);
- this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
- this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
- this.cwd = this._getValue(this._options.cwd, process.cwd());
- this.deep = this._getValue(this._options.deep, Infinity);
- this.dot = this._getValue(this._options.dot, false);
- this.extglob = this._getValue(this._options.extglob, true);
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
- this.fs = this._getFileSystemMethods(this._options.fs);
- this.globstar = this._getValue(this._options.globstar, true);
- this.ignore = this._getValue(this._options.ignore, []);
- this.markDirectories = this._getValue(this._options.markDirectories, false);
- this.objectMode = this._getValue(this._options.objectMode, false);
- this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
- this.onlyFiles = this._getValue(this._options.onlyFiles, true);
- this.stats = this._getValue(this._options.stats, false);
- this.suppressErrors = this._getValue(this._options.suppressErrors, false);
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
- this.unique = this._getValue(this._options.unique, true);
- if (this.onlyDirectories) this.onlyFiles = false;
- if (this.stats) this.objectMode = true;
- this.ignore = [].concat(this.ignore);
- }
- _getValue(option, value) {
- return option === void 0 ? value : option;
- }
- _getFileSystemMethods(methods = {}) {
- return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
- }
- };
- exports.default = Settings;
- }));
- //#endregion
- //#region ../../node_modules/.pnpm/image-meta@0.2.2/node_modules/image-meta/dist/index.mjs
- var import_out = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
- const taskManager = require_tasks();
- const async_1 = require_async();
- const stream_1 = require_stream();
- const sync_1 = require_sync();
- const settings_1 = require_settings();
- const utils = require_utils$1();
- async function FastGlob(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, async_1.default, options);
- const result = await Promise.all(works);
- return utils.array.flatten(result);
- }
- (function(FastGlob) {
- FastGlob.glob = FastGlob;
- FastGlob.globSync = sync;
- FastGlob.globStream = stream;
- FastGlob.async = FastGlob;
- function sync(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, sync_1.default, options);
- return utils.array.flatten(works);
- }
- FastGlob.sync = sync;
- function stream(source, options) {
- assertPatternsInput(source);
- const works = getWorks(source, stream_1.default, options);
- /**
- * The stream returned by the provider cannot work with an asynchronous iterator.
- * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
- * This affects performance (+25%). I don't see best solution right now.
- */
- return utils.stream.merge(works);
- }
- FastGlob.stream = stream;
- function generateTasks(source, options) {
- assertPatternsInput(source);
- const patterns = [].concat(source);
- const settings = new settings_1.default(options);
- return taskManager.generate(patterns, settings);
- }
- FastGlob.generateTasks = generateTasks;
- function isDynamicPattern(source, options) {
- assertPatternsInput(source);
- const settings = new settings_1.default(options);
- return utils.pattern.isDynamicPattern(source, settings);
- }
- FastGlob.isDynamicPattern = isDynamicPattern;
- function escapePath(source) {
- assertPatternsInput(source);
- return utils.path.escape(source);
- }
- FastGlob.escapePath = escapePath;
- function convertPathToPattern(source) {
- assertPatternsInput(source);
- return utils.path.convertPathToPattern(source);
- }
- FastGlob.convertPathToPattern = convertPathToPattern;
- (function(posix) {
- function escapePath(source) {
- assertPatternsInput(source);
- return utils.path.escapePosixPath(source);
- }
- posix.escapePath = escapePath;
- function convertPathToPattern(source) {
- assertPatternsInput(source);
- return utils.path.convertPosixPathToPattern(source);
- }
- posix.convertPathToPattern = convertPathToPattern;
- })(FastGlob.posix || (FastGlob.posix = {}));
- (function(win32) {
- function escapePath(source) {
- assertPatternsInput(source);
- return utils.path.escapeWindowsPath(source);
- }
- win32.escapePath = escapePath;
- function convertPathToPattern(source) {
- assertPatternsInput(source);
- return utils.path.convertWindowsPathToPattern(source);
- }
- win32.convertPathToPattern = convertPathToPattern;
- })(FastGlob.win32 || (FastGlob.win32 = {}));
- })(FastGlob || (FastGlob = {}));
- function getWorks(source, _Provider, options) {
- const patterns = [].concat(source);
- const settings = new settings_1.default(options);
- const tasks = taskManager.generate(patterns, settings);
- const provider = new _Provider(settings);
- return tasks.map(provider.read, provider);
- }
- function assertPatternsInput(input) {
- if (![].concat(input).every((item) => utils.string.isString(item) && !utils.string.isEmpty(item))) throw new TypeError("Patterns must be a string (non empty) or an array of strings");
- }
- module.exports = FastGlob;
- })))(), 1);
- const decoder = new TextDecoder();
- const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
- const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
- const readInt16LE = (input, offset = 0) => {
- const val = input[offset] + input[offset + 1] * 2 ** 8;
- return val | (val & 2 ** 15) * 131070;
- };
- const readUInt16BE = (input, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1];
- const readUInt16LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8;
- const readUInt24LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16;
- const readInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24);
- const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
- const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
- const methods = {
- readUInt16BE,
- readUInt16LE,
- readUInt32BE,
- readUInt32LE
- };
- function readUInt(input, bits, offset, isBigEndian) {
- offset = offset || 0;
- const endian = isBigEndian ? "BE" : "LE";
- return methods["readUInt" + bits + endian](input, offset);
- }
- const BMP = {
- validate: (input) => toUTF8String(input, 0, 2) === "BM",
- calculate: (input) => ({
- height: Math.abs(readInt32LE(input, 22)),
- width: readUInt32LE(input, 18)
- })
- };
- const TYPE_ICON = 1;
- const SIZE_HEADER$1 = 6;
- const SIZE_IMAGE_ENTRY = 16;
- function getSizeFromOffset(input, offset) {
- const value = input[offset];
- return value === 0 ? 256 : value;
- }
- function getImageSize$1(input, imageIndex) {
- const offset = SIZE_HEADER$1 + imageIndex * SIZE_IMAGE_ENTRY;
- return {
- height: getSizeFromOffset(input, offset + 1),
- width: getSizeFromOffset(input, offset)
- };
- }
- const ICO = {
- validate(input) {
- const reserved = readUInt16LE(input, 0);
- const imageCount = readUInt16LE(input, 4);
- if (reserved !== 0 || imageCount === 0) return false;
- return readUInt16LE(input, 2) === TYPE_ICON;
- },
- calculate(input) {
- const nbImages = readUInt16LE(input, 4);
- const imageSize = getImageSize$1(input, 0);
- if (nbImages === 1) return imageSize;
- const imgs = [imageSize];
- for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) imgs.push(getImageSize$1(input, imageIndex));
- return {
- height: imageSize.height,
- images: imgs,
- width: imageSize.width
- };
- }
- };
- const TYPE_CURSOR = 2;
- const CUR = {
- validate(input) {
- const reserved = readUInt16LE(input, 0);
- const imageCount = readUInt16LE(input, 4);
- if (reserved !== 0 || imageCount === 0) return false;
- return readUInt16LE(input, 2) === TYPE_CURSOR;
- },
- calculate: (input) => ICO.calculate(input)
- };
- const DDS = {
- validate: (input) => readUInt32LE(input, 0) === 542327876,
- calculate: (input) => ({
- height: readUInt32LE(input, 12),
- width: readUInt32LE(input, 16)
- })
- };
- const gifRegexp = /^GIF8[79]a/;
- const GIF = {
- validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
- calculate: (input) => ({
- height: readUInt16LE(input, 8),
- width: readUInt16LE(input, 6)
- })
- };
- const HEIC = {
- validate: (input) => {
- const ftypBox = findBox$1(input, "ftyp");
- if (!ftypBox) return false;
- const majorBrand = toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12);
- return [
- "heic",
- "heix",
- "hevc",
- "hevx",
- "mif1",
- "msf1"
- ].includes(majorBrand);
- },
- calculate: (input) => {
- const metaBox = findBox$1(input, "meta");
- if (!metaBox) throw new TypeError("heic: meta box not found");
- const iprpBox = findBox$1(input, "iprp", metaBox.offset + 12, metaBox.offset + metaBox.size);
- if (!iprpBox) throw new TypeError("heic: iprp box not found");
- const ipcoBox = findBox$1(input, "ipco", iprpBox.offset + 8, iprpBox.offset + iprpBox.size);
- if (!ipcoBox) throw new TypeError("heic: ipco box not found");
- const dimensions = findAllBoxes(input, "ispe", ipcoBox.offset + 8, ipcoBox.offset + ipcoBox.size).map((box) => ({
- width: readUInt32BE(input, box.offset + 12),
- height: readUInt32BE(input, box.offset + 16)
- }));
- if (dimensions.length === 0) throw new TypeError("heic: ispe box not found");
- let largestDimension = dimensions[0];
- for (let i = 1; i < dimensions.length; i++) {
- const curr = dimensions[i];
- if (curr.width * curr.height > largestDimension.width * largestDimension.height) largestDimension = curr;
- }
- return largestDimension;
- }
- };
- function findBox$1(input, type, startOffset = 0, endOffset = input.length) {
- let offset = startOffset;
- while (offset < endOffset) {
- const size = readUInt32BE(input, offset);
- if (toUTF8String(input, offset + 4, offset + 8) === type) return {
- offset,
- size
- };
- if (size <= 0 || offset + size > endOffset) break;
- offset += size;
- }
- }
- function findAllBoxes(input, type, startOffset = 0, endOffset = input.length) {
- let offset = startOffset;
- const boxes = [];
- while (offset < endOffset) {
- const size = readUInt32BE(input, offset);
- if (toUTF8String(input, offset + 4, offset + 8) === type) boxes.push({
- offset,
- size
- });
- if (size <= 0 || offset + size > endOffset) break;
- offset += size;
- }
- return boxes;
- }
- const SIZE_HEADER = 8;
- const FILE_LENGTH_OFFSET = 4;
- const ENTRY_LENGTH_OFFSET = 4;
- const ICON_TYPE_SIZE = {
- ICON: 32,
- "ICN#": 32,
- "icm#": 16,
- icm4: 16,
- icm8: 16,
- "ics#": 16,
- ics4: 16,
- ics8: 16,
- is32: 16,
- s8mk: 16,
- icp4: 16,
- icl4: 32,
- icl8: 32,
- il32: 32,
- l8mk: 32,
- icp5: 32,
- ic11: 32,
- ich4: 48,
- ich8: 48,
- ih32: 48,
- h8mk: 48,
- icp6: 64,
- ic12: 32,
- it32: 128,
- t8mk: 128,
- ic07: 128,
- ic08: 256,
- ic13: 256,
- ic09: 512,
- ic14: 512,
- ic10: 1024
- };
- function readImageHeader(input, imageOffset) {
- const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET;
- return [toUTF8String(input, imageOffset, imageLengthOffset), readUInt32BE(input, imageLengthOffset)];
- }
- function getImageSize(type) {
- const size = ICON_TYPE_SIZE[type];
- return {
- width: size,
- height: size,
- type
- };
- }
- const ICNS = {
- validate: (input) => toUTF8String(input, 0, 4) === "icns",
- calculate(input) {
- const inputLength = input.length;
- const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET);
- let imageOffset = SIZE_HEADER;
- let imageHeader = readImageHeader(input, imageOffset);
- let imageSize = getImageSize(imageHeader[0]);
- imageOffset += imageHeader[1];
- if (imageOffset === fileLength) return imageSize;
- const result = {
- height: imageSize.height,
- images: [imageSize],
- width: imageSize.width
- };
- while (imageOffset < fileLength && imageOffset < inputLength) {
- imageHeader = readImageHeader(input, imageOffset);
- imageSize = getImageSize(imageHeader[0]);
- imageOffset += imageHeader[1];
- result.images.push(imageSize);
- }
- return result;
- }
- };
- const J2C = {
- validate: (input) => toHexString(input, 0, 4) === "ff4fff51",
- calculate: (input) => ({
- height: readUInt32BE(input, 12),
- width: readUInt32BE(input, 8)
- })
- };
- const BoxTypes = {
- ftyp: "66747970",
- jp2h: "6a703268",
- jp__: "6a502020",
- rreq: "72726571"
- };
- const calculateRREQLength = (box) => {
- const unit = box[0];
- let offset = 1 + 2 * unit;
- const flagsLength = readUInt16BE(box, offset) * (2 + unit);
- offset = offset + 2 + flagsLength;
- const featuresLength = readUInt16BE(box, offset) * (16 + unit);
- return offset + 2 + featuresLength;
- };
- const parseIHDR = (box) => {
- return {
- height: readUInt32BE(box, 4),
- width: readUInt32BE(box, 8)
- };
- };
- const JP2 = {
- validate(input) {
- const signature = toHexString(input, 4, 8);
- const signatureLength = readUInt32BE(input, 0);
- if (signature !== BoxTypes.jp__ || signatureLength < 1) return false;
- const ftypeBoxStart = signatureLength + 4;
- const ftypBoxLength = readUInt32BE(input, signatureLength);
- return toHexString(input.slice(ftypeBoxStart, ftypeBoxStart + ftypBoxLength), 0, 4) === BoxTypes.ftyp;
- },
- calculate(input) {
- const signatureLength = readUInt32BE(input, 0);
- const ftypBoxLength = readUInt16BE(input, signatureLength + 2);
- let offset = signatureLength + 4 + ftypBoxLength;
- switch (toHexString(input, offset, offset + 4)) {
- case BoxTypes.rreq:
- offset = offset + 4 + 4 + calculateRREQLength(input.slice(offset + 4));
- return parseIHDR(input.slice(offset + 8, offset + 24));
- case BoxTypes.jp2h: return parseIHDR(input.slice(offset + 8, offset + 24));
- default: throw new TypeError("Unsupported header found: " + toUTF8String(input, offset, offset + 4));
- }
- }
- };
- const EXIF_MARKER = "45786966";
- const APP1_DATA_SIZE_BYTES = 2;
- const EXIF_HEADER_BYTES = 6;
- const TIFF_BYTE_ALIGN_BYTES = 2;
- const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
- const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
- const IDF_ENTRY_BYTES = 12;
- const NUM_DIRECTORY_ENTRIES_BYTES = 2;
- function isEXIF(input) {
- return toHexString(input, 2, 6) === EXIF_MARKER;
- }
- function extractSize(input, index) {
- return {
- height: readUInt16BE(input, index),
- width: readUInt16BE(input, index + 2)
- };
- }
- function extractOrientation(exifBlock, isBigEndian) {
- const offset = EXIF_HEADER_BYTES + 8;
- const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian);
- for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
- const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES;
- const end = start + IDF_ENTRY_BYTES;
- if (start > exifBlock.length) return;
- const block = exifBlock.slice(start, end);
- if (readUInt(block, 16, 0, isBigEndian) === 274) {
- if (readUInt(block, 16, 2, isBigEndian) !== 3) return;
- if (readUInt(block, 32, 4, isBigEndian) !== 1) return;
- return readUInt(block, 16, 8, isBigEndian);
- }
- }
- }
- function validateExifBlock(input, index) {
- const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
- const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES);
- const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
- if (isBigEndian || byteAlign === LITTLE_ENDIAN_BYTE_ALIGN) return extractOrientation(exifBlock, isBigEndian);
- }
- function validateInput(input, index) {
- if (index > input.length) throw new TypeError("Corrupt JPG, exceeded buffer limits");
- if (input[index] !== 255) throw new TypeError("Invalid JPG, marker table corrupted");
- }
- const JPG = {
- validate: (input) => toHexString(input, 0, 2) === "ffd8",
- calculate(input) {
- input = input.slice(4);
- let orientation;
- let next;
- while (input.length > 0) {
- const i = readUInt16BE(input, 0);
- if (isEXIF(input)) orientation = validateExifBlock(input, i);
- validateInput(input, i);
- next = input[i + 1];
- if (next === 192 || next === 193 || next === 194) {
- const size = extractSize(input, i + 5);
- if (!orientation) return size;
- return {
- height: size.height,
- orientation,
- width: size.width
- };
- }
- input = input.slice(i + 2);
- }
- throw new TypeError("Invalid JPG, no size found");
- }
- };
- const KTX = {
- validate: (input) => toUTF8String(input, 1, 7) === "KTX 11",
- calculate: (input) => ({
- height: readUInt32LE(input, 40),
- width: readUInt32LE(input, 36)
- })
- };
- const pngSignature = "PNG\r\n\n";
- const pngImageHeaderChunkName = "IHDR";
- const pngFriedChunkName = "CgBI";
- const PNG = {
- validate(input) {
- if (pngSignature === toUTF8String(input, 1, 8)) {
- let chunkName = toUTF8String(input, 12, 16);
- if (chunkName === pngFriedChunkName) chunkName = toUTF8String(input, 28, 32);
- if (chunkName !== pngImageHeaderChunkName) throw new TypeError("Invalid PNG");
- return true;
- }
- return false;
- },
- calculate(input) {
- if (toUTF8String(input, 12, 16) === pngFriedChunkName) return {
- height: readUInt32BE(input, 36),
- width: readUInt32BE(input, 32)
- };
- return {
- height: readUInt32BE(input, 20),
- width: readUInt32BE(input, 16)
- };
- }
- };
- const PNMTypes = {
- P1: "pbm/ascii",
- P2: "pgm/ascii",
- P3: "ppm/ascii",
- P4: "pbm",
- P5: "pgm",
- P6: "ppm",
- P7: "pam",
- PF: "pfm"
- };
- const handlers = {
- default: (lines) => {
- let dimensions = [];
- while (lines.length > 0) {
- const line = lines.shift();
- if (line[0] === "#") continue;
- dimensions = line.split(" ");
- break;
- }
- if (dimensions.length === 2) return {
- height: Number.parseInt(dimensions[1], 10),
- width: Number.parseInt(dimensions[0], 10)
- };
- else throw new TypeError("Invalid PNM");
- },
- pam: (lines) => {
- const size = {};
- while (lines.length > 0) {
- const line = lines.shift();
- if (line.length > 16 || (line.codePointAt(0) || 0) > 128) continue;
- const [key, value] = line.split(" ");
- if (key && value) size[key.toLowerCase()] = Number.parseInt(value, 10);
- if (size.height && size.width) break;
- }
- if (size.height && size.width) return {
- height: size.height,
- width: size.width
- };
- else throw new TypeError("Invalid PAM");
- }
- };
- const PNM = {
- validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
- calculate(input) {
- const type = PNMTypes[toUTF8String(input, 0, 2)];
- const lines = toUTF8String(input, 3).split(/[\n\r]+/);
- return (handlers[type] || handlers.default)(lines);
- }
- };
- const PSD = {
- validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
- calculate: (input) => ({
- height: readUInt32BE(input, 14),
- width: readUInt32BE(input, 18)
- })
- };
- const svgReg = /<svg\s([^"'>]|"[^"]*"|'[^']*')*>/;
- const extractorRegExps = {
- height: /\sheight=(["'])([^%]+?)\1/,
- root: svgReg,
- viewbox: /\sviewbox=(["'])(.+?)\1/i,
- width: /\swidth=(["'])([^%]+?)\1/
- };
- const INCH_CM = 2.54;
- const units = {
- in: 96,
- cm: 96 / INCH_CM,
- em: 16,
- ex: 8,
- m: 96 / INCH_CM * 100,
- mm: 96 / INCH_CM / 10,
- pc: 96 / 72 / 12,
- pt: 96 / 72,
- px: 1
- };
- const unitsReg = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);
- function parseLength(len) {
- const m = unitsReg.exec(len);
- if (!m) return;
- return Math.round(Number(m[1]) * (units[m[2]] || 1));
- }
- function parseViewbox(viewbox) {
- const bounds = viewbox.split(" ");
- return {
- height: parseLength(bounds[3]),
- width: parseLength(bounds[2])
- };
- }
- function parseAttributes(root) {
- const width = root.match(extractorRegExps.width);
- const height = root.match(extractorRegExps.height);
- const viewbox = root.match(extractorRegExps.viewbox);
- return {
- height: height && parseLength(height[2]),
- viewbox: viewbox && parseViewbox(viewbox[2]),
- width: width && parseLength(width[2])
- };
- }
- function calculateByDimensions(attrs) {
- return {
- height: attrs.height,
- width: attrs.width
- };
- }
- function calculateByViewbox(attrs, viewbox) {
- const ratio = viewbox.width / viewbox.height;
- if (attrs.width) return {
- height: Math.floor(attrs.width / ratio),
- width: attrs.width
- };
- if (attrs.height) return {
- height: attrs.height,
- width: Math.floor(attrs.height * ratio)
- };
- return {
- height: viewbox.height,
- width: viewbox.width
- };
- }
- const SVG = {
- validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
- calculate(input) {
- const root = toUTF8String(input).match(extractorRegExps.root);
- if (root) {
- const attrs = parseAttributes(root[0]);
- if (attrs.width && attrs.height) return calculateByDimensions(attrs);
- if (attrs.viewbox) return calculateByViewbox(attrs, attrs.viewbox);
- }
- throw new TypeError("Invalid SVG");
- }
- };
- const TGA = {
- validate(input) {
- return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
- },
- calculate(input) {
- return {
- height: readUInt16LE(input, 14),
- width: readUInt16LE(input, 12)
- };
- }
- };
- function readIFD(buffer, isBigEndian) {
- const ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
- let bufferSize = 1024;
- const fileSize = buffer.length;
- if (ifdOffset + bufferSize > fileSize) bufferSize = fileSize - ifdOffset - 10;
- return buffer.slice(ifdOffset + 2, ifdOffset + 2 + bufferSize);
- }
- function readValue(buffer, isBigEndian) {
- const low = readUInt(buffer, 16, 8, isBigEndian);
- return (readUInt(buffer, 16, 10, isBigEndian) << 16) + low;
- }
- function nextTag(buffer) {
- if (buffer.length > 24) return buffer.slice(12);
- }
- function extractTags(buffer, isBigEndian) {
- const tags = {};
- let temp = buffer;
- while (temp && temp.length > 0) {
- const code = readUInt(temp, 16, 0, isBigEndian);
- const type = readUInt(temp, 16, 2, isBigEndian);
- const length = readUInt(temp, 32, 4, isBigEndian);
- if (code === 0) break;
- else {
- if (length === 1 && (type === 3 || type === 4)) tags[code] = readValue(temp, isBigEndian);
- temp = nextTag(temp);
- }
- }
- return tags;
- }
- function determineEndianness(input) {
- const signature = toUTF8String(input, 0, 2);
- if (signature === "II") return "LE";
- else if (signature === "MM") return "BE";
- }
- const signatures = /* @__PURE__ */ new Set(["49492a00", "4d4d002a"]);
- const TIFF = {
- validate: (input) => signatures.has(toHexString(input, 0, 4)),
- calculate(input) {
- const isBigEndian = determineEndianness(input) === "BE";
- const tags = extractTags(readIFD(input, isBigEndian), isBigEndian);
- const width = tags[256];
- const height = tags[257];
- if (!width || !height) throw new TypeError("Invalid Tiff. Missing tags");
- return {
- height,
- width
- };
- }
- };
- function calculateExtended(input) {
- return {
- height: 1 + readUInt24LE(input, 7),
- width: 1 + readUInt24LE(input, 4)
- };
- }
- function calculateLossless(input) {
- return {
- height: 1 + ((input[4] & 15) << 10 | input[3] << 2 | (input[2] & 192) >> 6),
- width: 1 + ((input[2] & 63) << 8 | input[1])
- };
- }
- function calculateLossy(input) {
- return {
- height: readInt16LE(input, 8) & 16383,
- width: readInt16LE(input, 6) & 16383
- };
- }
- const WEBP = {
- validate(input) {
- const riffHeader = toUTF8String(input, 0, 4) === "RIFF";
- const webpHeader = toUTF8String(input, 8, 12) === "WEBP";
- const vp8Header = toUTF8String(input, 12, 15) === "VP8";
- return riffHeader && webpHeader && vp8Header;
- },
- calculate(input) {
- const chunkHeader = toUTF8String(input, 12, 16);
- input = input.slice(20, 30);
- if (chunkHeader === "VP8X") {
- const extendedHeader = input[0];
- const validStart = (extendedHeader & 192) === 0;
- const validEnd = (extendedHeader & 1) === 0;
- if (validStart && validEnd) return calculateExtended(input);
- else throw new TypeError("Invalid WebP");
- }
- if (chunkHeader === "VP8 " && input[0] !== 47) return calculateLossy(input);
- const signature = toHexString(input, 3, 6);
- if (chunkHeader === "VP8L" && signature !== "9d012a") return calculateLossless(input);
- throw new TypeError("Invalid WebP");
- }
- };
- const AVIF = {
- validate: (input) => toUTF8String(input, 8, 12) === "avif",
- calculate: (input) => {
- const metaBox = findBox(input, "meta");
- const iprpBox = findBox(input, "iprp", metaBox.offset + 12, metaBox.offset + metaBox.size);
- const ipcoBox = findBox(input, "ipco", iprpBox.offset + 8, iprpBox.offset + iprpBox.size);
- const ispeBox = findBox(input, "ispe", ipcoBox.offset + 8, ipcoBox.offset + ipcoBox.size);
- return {
- width: readUInt32BE(input, ispeBox.offset + 12),
- height: readUInt32BE(input, ispeBox.offset + 16)
- };
- }
- };
- function findBox(input, type, startOffset = 0, endOffset = input.length) {
- for (let offset = startOffset; offset < endOffset;) {
- const size = readUInt32BE(input, offset);
- if (toUTF8String(input, offset + 4, offset + 8) === type) return {
- offset,
- size
- };
- if (size <= 0 || offset + size > endOffset) break;
- offset += size;
- }
- throw new Error(`${type} box not found`);
- }
- const typeHandlers = {
- bmp: BMP,
- cur: CUR,
- dds: DDS,
- gif: GIF,
- heic: HEIC,
- icns: ICNS,
- ico: ICO,
- j2c: J2C,
- jp2: JP2,
- jpg: JPG,
- ktx: KTX,
- png: PNG,
- pnm: PNM,
- psd: PSD,
- svg: SVG,
- tga: TGA,
- tiff: TIFF,
- webp: WEBP,
- avif: AVIF
- };
- const keys = Object.keys(typeHandlers);
- const firstBytes = {
- 56: "psd",
- 66: "bmp",
- 68: "dds",
- 71: "gif",
- 73: "tiff",
- 77: "tiff",
- 82: "webp",
- 105: "icns",
- 137: "png",
- 255: "jpg"
- };
- function detector(input) {
- const byte = input[0];
- if (byte in firstBytes) {
- const type = firstBytes[byte];
- if (type && typeHandlers[type].validate(input)) return type;
- }
- return keys.find((key) => typeHandlers[key].validate(input));
- }
- function imageMeta(input) {
- if (!(input instanceof Uint8Array)) throw new TypeError("Input should be a Uint8Array");
- const type = detector(input);
- if (type !== void 0 && type in typeHandlers) {
- const size = typeHandlers[type].calculate(input);
- if (size !== void 0) {
- size.type = type;
- return size;
- }
- }
- throw new TypeError(`Unsupported file type: ${type}`);
- }
- //#endregion
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
- function normalizeWindowsPath(input = "") {
- if (!input) return input;
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
- }
- const _UNC_REGEX = /^[/\\]{2}/;
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
- const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
- const normalize = function(path) {
- if (path.length === 0) return ".";
- path = normalizeWindowsPath(path);
- const isUNCPath = path.match(_UNC_REGEX);
- const isPathAbsolute = isAbsolute(path);
- const trailingSeparator = path[path.length - 1] === "/";
- path = normalizeString(path, !isPathAbsolute);
- if (path.length === 0) {
- if (isPathAbsolute) return "/";
- return trailingSeparator ? "./" : ".";
- }
- if (trailingSeparator) path += "/";
- if (_DRIVE_LETTER_RE.test(path)) path += "/";
- if (isUNCPath) {
- if (!isPathAbsolute) return `//./${path}`;
- return `//${path}`;
- }
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
- };
- const join = function(...segments) {
- let path = "";
- for (const seg of segments) {
- if (!seg) continue;
- if (path.length > 0) {
- const pathTrailing = path[path.length - 1] === "/";
- const segLeading = seg[0] === "/";
- if (pathTrailing && segLeading) path += seg.slice(1);
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
- } else path += seg;
- }
- return normalize(path);
- };
- function cwd() {
- if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
- return "/";
- }
- const resolve$1 = function(...arguments_) {
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
- let resolvedPath = "";
- let resolvedAbsolute = false;
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
- const path = index >= 0 ? arguments_[index] : cwd();
- if (!path || path.length === 0) continue;
- resolvedPath = `${path}/${resolvedPath}`;
- resolvedAbsolute = isAbsolute(path);
- }
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
- return resolvedPath.length > 0 ? resolvedPath : ".";
- };
- function normalizeString(path, allowAboveRoot) {
- let res = "";
- let lastSegmentLength = 0;
- let lastSlash = -1;
- let dots = 0;
- let char = null;
- for (let index = 0; index <= path.length; ++index) {
- if (index < path.length) char = path[index];
- else if (char === "/") break;
- else char = "/";
- if (char === "/") {
- if (lastSlash === index - 1 || dots === 1);
- else if (dots === 2) {
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
- if (res.length > 2) {
- const lastSlashIndex = res.lastIndexOf("/");
- if (lastSlashIndex === -1) {
- res = "";
- lastSegmentLength = 0;
- } else {
- res = res.slice(0, lastSlashIndex);
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
- }
- lastSlash = index;
- dots = 0;
- continue;
- } else if (res.length > 0) {
- res = "";
- lastSegmentLength = 0;
- lastSlash = index;
- dots = 0;
- continue;
- }
- }
- if (allowAboveRoot) {
- res += res.length > 0 ? "/.." : "..";
- lastSegmentLength = 2;
- }
- } else {
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
- else res = path.slice(lastSlash + 1, index);
- lastSegmentLength = index - lastSlash - 1;
- }
- lastSlash = index;
- dots = 0;
- } else if (char === "." && dots !== -1) ++dots;
- else dots = -1;
- }
- return res;
- }
- const isAbsolute = function(p) {
- return _IS_ABSOLUTE_RE.test(p);
- };
- const relative = function(from, to) {
- const _from = resolve$1(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
- const _to = resolve$1(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
- const _fromCopy = [..._from];
- for (const segment of _fromCopy) {
- if (_to[0] !== segment) break;
- _from.shift();
- _to.shift();
- }
- return [..._from.map(() => ".."), ..._to].join("/");
- };
- //#endregion
- //#region ../../node_modules/.pnpm/perfect-debounce@2.0.0/node_modules/perfect-debounce/dist/index.mjs
- const DEBOUNCE_DEFAULTS = { trailing: true };
- /**
- Debounce functions
- @param fn - Promise-returning/async function to debounce.
- @param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
- @returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
- @example
- ```
- import { debounce } from 'perfect-debounce';
- const expensiveCall = async input => input;
- const debouncedFn = debounce(expensiveCall, 200);
- for (const number of [1, 2, 3]) {
- console.log(await debouncedFn(number));
- }
- //=> 1
- //=> 2
- //=> 3
- ```
- */
- function debounce(fn, wait = 25, options = {}) {
- options = {
- ...DEBOUNCE_DEFAULTS,
- ...options
- };
- if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
- let leadingValue;
- let timeout;
- let resolveList = [];
- let currentPromise;
- let trailingArgs;
- const applyFn = (_this, args) => {
- currentPromise = _applyPromised(fn, _this, args);
- currentPromise.finally(() => {
- currentPromise = null;
- if (options.trailing && trailingArgs && !timeout) {
- const promise = applyFn(_this, trailingArgs);
- trailingArgs = null;
- return promise;
- }
- });
- return currentPromise;
- };
- const debounced = function(...args) {
- if (options.trailing) trailingArgs = args;
- if (currentPromise) return currentPromise;
- return new Promise((resolve) => {
- const shouldCallNow = !timeout && options.leading;
- clearTimeout(timeout);
- timeout = setTimeout(() => {
- timeout = null;
- const promise = options.leading ? leadingValue : applyFn(this, args);
- trailingArgs = null;
- for (const _resolve of resolveList) _resolve(promise);
- resolveList = [];
- }, wait);
- if (shouldCallNow) {
- leadingValue = applyFn(this, args);
- resolve(leadingValue);
- } else resolveList.push(resolve);
- });
- };
- const _clearTimeout = (timer) => {
- if (timer) {
- clearTimeout(timer);
- timeout = null;
- }
- };
- debounced.isPending = () => !!timeout;
- debounced.cancel = () => {
- _clearTimeout(timeout);
- resolveList = [];
- trailingArgs = null;
- };
- debounced.flush = () => {
- _clearTimeout(timeout);
- if (!trailingArgs || currentPromise) return;
- const args = trailingArgs;
- trailingArgs = null;
- return applyFn(this, args);
- };
- return debounced;
- }
- async function _applyPromised(fn, _this, args) {
- return await fn.apply(_this, args);
- }
- //#endregion
- //#region src/rpc/assets.ts
- function guessType(path) {
- if (/\.(?:png|jpe?g|jxl|gif|svg|webp|avif|ico|bmp|tiff?)$/i.test(path)) return "image";
- if (/\.(?:mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|ts|mts|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)$/i.test(path)) return "video";
- if (/\.(?:mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)$/i.test(path)) return "audio";
- if (/\.(?:woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)/i.test(path)) return "font";
- if (/\.(?:json[5c]?|te?xt|[mc]?[jt]sx?|md[cx]?|markdown|ya?ml|toml)/i.test(path)) return "text";
- if (/\.wasm/i.test(path)) return "wasm";
- return "other";
- }
- function getAssetsFunctions(ctx) {
- const { server, config } = ctx;
- const _imageMetaCache = /* @__PURE__ */ new Map();
- let cache = null;
- async function scan() {
- const dir = resolve$1(config.root);
- const baseURL = config.base;
- const publicDir = config.publicDir;
- const relativePublicDir = publicDir === "" ? "" : `${relative(dir, publicDir)}/`;
- const files = await (0, import_out.default)([
- "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
- "**/*.(mp4|webm|ogv|mov|avi|flv|wmv|mpg|mpeg|mkv|3gp|3g2|m2ts|vob|ogm|ogx|rm|rmvb|asf|amv|divx|m4v|svi|viv|f4v|f4p|f4a|f4b)",
- "**/*.(mp3|wav|ogg|flac|aac|wma|alac|ape|ac3|dts|tta|opus|amr|aiff|au|mid|midi|ra|rm|wv|weba|dss|spx|vox|tak|dsf|dff|dsd|cda)",
- "**/*.(woff2?|eot|ttf|otf|ttc|pfa|pfb|pfm|afm)",
- "**/*.(json|json5|jsonc|txt|text|tsx|jsx|md|mdx|mdc|markdown|yaml|yml|toml)",
- "**/*.wasm"
- ], {
- cwd: dir,
- onlyFiles: true,
- caseSensitiveMatch: false,
- ignore: [
- "**/node_modules/**",
- "**/dist/**",
- "**/package-lock.*",
- "**/pnpm-lock.*",
- "**/pnpm-workspace.*"
- ]
- });
- cache = await Promise.all(files.map(async (relativePath) => {
- const filePath = resolve$1(dir, relativePath);
- const stat = await fsp.lstat(filePath);
- const path = relativePath.replace(relativePublicDir, "");
- return {
- path,
- relativePath,
- publicPath: join(baseURL, path),
- filePath,
- type: guessType(relativePath),
- size: stat.size,
- mtime: stat.mtimeMs
- };
- }));
- return cache;
- }
- async function getAssetImporters(url) {
- const importers = [];
- const module = await server.moduleGraph.getModuleByUrl(url);
- if (module) for (const importer of module.importers) importers.push({
- url: importer.url,
- id: importer.id
- });
- return importers;
- }
- const debouncedAssetsUpdated = debounce(() => {
- var _ref;
- getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("assetsUpdated");
- }, 100);
- server.watcher.on("all", (event) => {
- if (event !== "change") debouncedAssetsUpdated();
- });
- return {
- async getStaticAssets() {
- return await scan();
- },
- async getAssetImporters(url) {
- return await getAssetImporters(url);
- },
- async getImageMeta(filepath) {
- if (_imageMetaCache.has(filepath)) return _imageMetaCache.get(filepath);
- try {
- const meta = imageMeta(await fsp.readFile(filepath));
- _imageMetaCache.set(filepath, meta);
- return meta;
- } catch (e) {
- _imageMetaCache.set(filepath, void 0);
- console.error(e);
- return;
- }
- },
- async getTextAssetContent(filepath, limit = 300) {
- try {
- return (await fsp.readFile(filepath, "utf-8")).slice(0, limit);
- } catch (e) {
- console.error(e);
- return;
- }
- }
- };
- }
- //#endregion
- //#region src/rpc/get-config.ts
- function getConfigFunctions(ctx) {
- return { getRoot() {
- return ctx.config.root;
- } };
- }
- //#endregion
- //#region src/rpc/graph.ts
- function getGraphFunctions(ctx) {
- const { rpc, server } = ctx;
- const debouncedModuleUpdated = debounce(() => {
- var _ref;
- getViteRpcServer === null || getViteRpcServer === void 0 || (_ref = getViteRpcServer()) === null || _ref === void 0 || (_ref = _ref.broadcast) === null || _ref === void 0 || _ref.emit("graphModuleUpdated");
- }, 100);
- server.middlewares.use((_, __, next) => {
- debouncedModuleUpdated();
- next();
- });
- return { async getGraphModules() {
- const meta = await rpc.getMetadata();
- const modules = (meta ? await rpc.getModulesList({
- vite: meta === null || meta === void 0 ? void 0 : meta.instances[0].vite,
- env: meta === null || meta === void 0 ? void 0 : meta.instances[0].environments[0]
- }) : null) || [];
- const filteredModules = modules.filter((m) => {
- return m.id.match(/\.(vue|js|ts|jsx|tsx|html|json)($|\?v=)/);
- });
- return filteredModules.map((i) => {
- function searchForVueDeps(id, seen = /* @__PURE__ */ new Set()) {
- if (seen.has(id)) return [];
- seen.add(id);
- const module = modules.find((m) => m.id === id);
- if (!module) return [];
- return module.deps.flatMap((i) => {
- if (filteredModules.find((m) => m.id === i)) return [i];
- return searchForVueDeps(i, seen);
- });
- }
- return {
- id: i.id,
- deps: searchForVueDeps(i.id)
- };
- });
- } };
- }
- //#endregion
- //#region src/rpc/index.ts
- function getRpcFunctions(ctx) {
- return {
- heartbeat() {
- return true;
- },
- ...getAssetsFunctions(ctx),
- ...getConfigFunctions(ctx),
- ...getGraphFunctions(ctx)
- };
- }
- //#endregion
- //#region src/utils.ts
- function removeUrlQuery(url) {
- return url.replace(/\?.*$/, "");
- }
- //#endregion
- //#region src/vite.ts
- function getVueDevtoolsPath() {
- return normalizePath(path.dirname(fileURLToPath(import.meta.url))).replace(/\/dist$/, "//src");
- }
- const toggleComboKeysMap = {
- option: process.platform === "darwin" ? "Option(⌥)" : "Alt(⌥)",
- meta: "Command(⌘)",
- shift: "Shift(⇧)"
- };
- function normalizeComboKeyPrint(toggleComboKey) {
- return toggleComboKey.split("-").map((key) => toggleComboKeysMap[key] || key[0].toUpperCase() + key.slice(1)).join(dim("+"));
- }
- const devtoolsNextResourceSymbol = "?__vue-devtools-next-resource";
- const defaultOptions = {
- appendTo: "",
- componentInspector: true,
- launchEditor: process.env.LAUNCH_EDITOR ?? "code"
- };
- function mergeOptions(options) {
- return Object.assign({}, defaultOptions, options);
- }
- function VitePluginVueDevTools(options) {
- const vueDevtoolsPath = getVueDevtoolsPath();
- const inspect = Inspect({ silent: true });
- const pluginOptions = mergeOptions(options ?? {});
- let config;
- function configureServer(server) {
- const base = server.config.base || "/";
- server.middlewares.use(`${base}__devtools__`, sirv(DIR_CLIENT, {
- single: true,
- dev: true,
- setHeaders(response) {
- if (config.server.headers == null) return;
- Object.entries(config.server.headers).forEach(([key, value]) => {
- if (value == null) return;
- response.setHeader(key, value);
- });
- }
- }));
- setViteServerContext(server);
- createViteServerRpc(getRpcFunctions({
- rpc: inspect.api.rpc,
- server,
- config
- }));
- const _printUrls = server.printUrls;
- const colorUrl = (url) => cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`));
- server.printUrls = () => {
- const urls = server.resolvedUrls;
- const keys = normalizeComboKeyPrint("option-shift-d");
- _printUrls();
- for (const url of urls.local) {
- const devtoolsUrl = url.endsWith("/") ? `${url}__devtools__/` : `${url}/__devtools__/`;
- console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Open ${colorUrl(`${devtoolsUrl}`)} as a separate window`)}`);
- }
- console.log(` ${green("➜")} ${bold("Vue DevTools")}: ${green(`Press ${yellow(keys)} in App to toggle the Vue DevTools`)}`);
- };
- }
- const devtoolsOptionsImportee = "virtual:vue-devtools-options";
- const resolvedDevtoolsOptions = `\0${devtoolsOptionsImportee}`;
- const plugin = {
- name: "vite-plugin-vue-devtools",
- enforce: "pre",
- apply: "serve",
- configResolved(resolvedConfig) {
- config = resolvedConfig;
- },
- configureServer(server) {
- configureServer(server);
- },
- async resolveId(importee) {
- if (importee === devtoolsOptionsImportee) return resolvedDevtoolsOptions;
- else if (importee.startsWith("virtual:vue-devtools-path:")) return `${importee.replace("virtual:vue-devtools-path:", `${vueDevtoolsPath}/`)}${devtoolsNextResourceSymbol}`;
- },
- async load(id) {
- if (id === resolvedDevtoolsOptions) return `export default ${JSON.stringify({
- base: config.base,
- componentInspector: pluginOptions.componentInspector
- })}`;
- else if (id.endsWith(devtoolsNextResourceSymbol)) {
- const filename = removeUrlQuery(id);
- return await fs.promises.readFile(filename, "utf-8");
- }
- },
- transform(code, id, options) {
- if (options === null || options === void 0 ? void 0 : options.ssr) return;
- const { appendTo } = pluginOptions;
- const [filename] = id.split("?", 2);
- if (appendTo && (typeof appendTo === "string" && filename.endsWith(appendTo) || appendTo instanceof RegExp && appendTo.test(filename))) code = `import 'virtual:vue-devtools-path:overlay.js';\n${code}`;
- return code;
- },
- transformIndexHtml(html) {
- if (pluginOptions.appendTo) return;
- return {
- html,
- tags: [{
- tag: "script",
- injectTo: "head-prepend",
- attrs: {
- type: "module",
- src: `${config.base || "/"}@id/virtual:vue-devtools-path:overlay.js`
- }
- }, pluginOptions.componentInspector && {
- tag: "script",
- injectTo: "head-prepend",
- launchEditor: pluginOptions.launchEditor,
- attrs: {
- type: "module",
- src: `${config.base || "/"}@id/virtual:vue-inspector-path:load.js`
- }
- }].filter(Boolean)
- };
- },
- async buildEnd() {}
- };
- return [
- inspect,
- pluginOptions.componentInspector && VueInspector({
- toggleComboKey: "",
- toggleButtonVisibility: "never",
- launchEditor: pluginOptions.launchEditor,
- ...typeof pluginOptions.componentInspector === "boolean" ? {} : pluginOptions.componentInspector,
- appendTo: pluginOptions.appendTo || "manually"
- }),
- plugin
- ].filter(Boolean);
- }
- //#endregion
- export { VitePluginVueDevTools as default };
|