cli.js 497 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364
  1. "use strict";
  2. var __getOwnPropNames = Object.getOwnPropertyNames;
  3. var __commonJS = (cb, mod) => function __require() {
  4. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  5. };
  6. // node_modules/core-js/internals/global.js
  7. var require_global = __commonJS({
  8. "node_modules/core-js/internals/global.js"(exports2, module2) {
  9. var check = function(it) {
  10. return it && it.Math == Math && it;
  11. };
  12. module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || function() {
  13. return this;
  14. }() || Function("return this")();
  15. }
  16. });
  17. // node_modules/core-js/internals/fails.js
  18. var require_fails = __commonJS({
  19. "node_modules/core-js/internals/fails.js"(exports2, module2) {
  20. module2.exports = function(exec) {
  21. try {
  22. return !!exec();
  23. } catch (error) {
  24. return true;
  25. }
  26. };
  27. }
  28. });
  29. // node_modules/core-js/internals/descriptors.js
  30. var require_descriptors = __commonJS({
  31. "node_modules/core-js/internals/descriptors.js"(exports2, module2) {
  32. var fails = require_fails();
  33. module2.exports = !fails(function() {
  34. return Object.defineProperty({}, 1, { get: function() {
  35. return 7;
  36. } })[1] != 7;
  37. });
  38. }
  39. });
  40. // node_modules/core-js/internals/function-bind-native.js
  41. var require_function_bind_native = __commonJS({
  42. "node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
  43. var fails = require_fails();
  44. module2.exports = !fails(function() {
  45. var test = function() {
  46. }.bind();
  47. return typeof test != "function" || test.hasOwnProperty("prototype");
  48. });
  49. }
  50. });
  51. // node_modules/core-js/internals/function-call.js
  52. var require_function_call = __commonJS({
  53. "node_modules/core-js/internals/function-call.js"(exports2, module2) {
  54. var NATIVE_BIND = require_function_bind_native();
  55. var call = Function.prototype.call;
  56. module2.exports = NATIVE_BIND ? call.bind(call) : function() {
  57. return call.apply(call, arguments);
  58. };
  59. }
  60. });
  61. // node_modules/core-js/internals/object-property-is-enumerable.js
  62. var require_object_property_is_enumerable = __commonJS({
  63. "node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
  64. "use strict";
  65. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  66. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  67. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  68. exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  69. var descriptor = getOwnPropertyDescriptor(this, V);
  70. return !!descriptor && descriptor.enumerable;
  71. } : $propertyIsEnumerable;
  72. }
  73. });
  74. // node_modules/core-js/internals/create-property-descriptor.js
  75. var require_create_property_descriptor = __commonJS({
  76. "node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
  77. module2.exports = function(bitmap, value) {
  78. return {
  79. enumerable: !(bitmap & 1),
  80. configurable: !(bitmap & 2),
  81. writable: !(bitmap & 4),
  82. value
  83. };
  84. };
  85. }
  86. });
  87. // node_modules/core-js/internals/function-uncurry-this.js
  88. var require_function_uncurry_this = __commonJS({
  89. "node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
  90. var NATIVE_BIND = require_function_bind_native();
  91. var FunctionPrototype = Function.prototype;
  92. var call = FunctionPrototype.call;
  93. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  94. module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
  95. return function() {
  96. return call.apply(fn, arguments);
  97. };
  98. };
  99. }
  100. });
  101. // node_modules/core-js/internals/classof-raw.js
  102. var require_classof_raw = __commonJS({
  103. "node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
  104. var uncurryThis = require_function_uncurry_this();
  105. var toString = uncurryThis({}.toString);
  106. var stringSlice = uncurryThis("".slice);
  107. module2.exports = function(it) {
  108. return stringSlice(toString(it), 8, -1);
  109. };
  110. }
  111. });
  112. // node_modules/core-js/internals/indexed-object.js
  113. var require_indexed_object = __commonJS({
  114. "node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
  115. var uncurryThis = require_function_uncurry_this();
  116. var fails = require_fails();
  117. var classof = require_classof_raw();
  118. var $Object = Object;
  119. var split = uncurryThis("".split);
  120. module2.exports = fails(function() {
  121. return !$Object("z").propertyIsEnumerable(0);
  122. }) ? function(it) {
  123. return classof(it) == "String" ? split(it, "") : $Object(it);
  124. } : $Object;
  125. }
  126. });
  127. // node_modules/core-js/internals/is-null-or-undefined.js
  128. var require_is_null_or_undefined = __commonJS({
  129. "node_modules/core-js/internals/is-null-or-undefined.js"(exports2, module2) {
  130. module2.exports = function(it) {
  131. return it === null || it === void 0;
  132. };
  133. }
  134. });
  135. // node_modules/core-js/internals/require-object-coercible.js
  136. var require_require_object_coercible = __commonJS({
  137. "node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
  138. var isNullOrUndefined = require_is_null_or_undefined();
  139. var $TypeError = TypeError;
  140. module2.exports = function(it) {
  141. if (isNullOrUndefined(it))
  142. throw $TypeError("Can't call method on " + it);
  143. return it;
  144. };
  145. }
  146. });
  147. // node_modules/core-js/internals/to-indexed-object.js
  148. var require_to_indexed_object = __commonJS({
  149. "node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
  150. var IndexedObject = require_indexed_object();
  151. var requireObjectCoercible = require_require_object_coercible();
  152. module2.exports = function(it) {
  153. return IndexedObject(requireObjectCoercible(it));
  154. };
  155. }
  156. });
  157. // node_modules/core-js/internals/document-all.js
  158. var require_document_all = __commonJS({
  159. "node_modules/core-js/internals/document-all.js"(exports2, module2) {
  160. var documentAll = typeof document == "object" && document.all;
  161. var IS_HTMLDDA = typeof documentAll == "undefined" && documentAll !== void 0;
  162. module2.exports = {
  163. all: documentAll,
  164. IS_HTMLDDA
  165. };
  166. }
  167. });
  168. // node_modules/core-js/internals/is-callable.js
  169. var require_is_callable = __commonJS({
  170. "node_modules/core-js/internals/is-callable.js"(exports2, module2) {
  171. var $documentAll = require_document_all();
  172. var documentAll = $documentAll.all;
  173. module2.exports = $documentAll.IS_HTMLDDA ? function(argument) {
  174. return typeof argument == "function" || argument === documentAll;
  175. } : function(argument) {
  176. return typeof argument == "function";
  177. };
  178. }
  179. });
  180. // node_modules/core-js/internals/is-object.js
  181. var require_is_object = __commonJS({
  182. "node_modules/core-js/internals/is-object.js"(exports2, module2) {
  183. var isCallable = require_is_callable();
  184. var $documentAll = require_document_all();
  185. var documentAll = $documentAll.all;
  186. module2.exports = $documentAll.IS_HTMLDDA ? function(it) {
  187. return typeof it == "object" ? it !== null : isCallable(it) || it === documentAll;
  188. } : function(it) {
  189. return typeof it == "object" ? it !== null : isCallable(it);
  190. };
  191. }
  192. });
  193. // node_modules/core-js/internals/get-built-in.js
  194. var require_get_built_in = __commonJS({
  195. "node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
  196. var global2 = require_global();
  197. var isCallable = require_is_callable();
  198. var aFunction = function(argument) {
  199. return isCallable(argument) ? argument : void 0;
  200. };
  201. module2.exports = function(namespace, method) {
  202. return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
  203. };
  204. }
  205. });
  206. // node_modules/core-js/internals/object-is-prototype-of.js
  207. var require_object_is_prototype_of = __commonJS({
  208. "node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
  209. var uncurryThis = require_function_uncurry_this();
  210. module2.exports = uncurryThis({}.isPrototypeOf);
  211. }
  212. });
  213. // node_modules/core-js/internals/engine-user-agent.js
  214. var require_engine_user_agent = __commonJS({
  215. "node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
  216. var getBuiltIn = require_get_built_in();
  217. module2.exports = getBuiltIn("navigator", "userAgent") || "";
  218. }
  219. });
  220. // node_modules/core-js/internals/engine-v8-version.js
  221. var require_engine_v8_version = __commonJS({
  222. "node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
  223. var global2 = require_global();
  224. var userAgent = require_engine_user_agent();
  225. var process2 = global2.process;
  226. var Deno = global2.Deno;
  227. var versions = process2 && process2.versions || Deno && Deno.version;
  228. var v8 = versions && versions.v8;
  229. var match;
  230. var version;
  231. if (v8) {
  232. match = v8.split(".");
  233. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  234. }
  235. if (!version && userAgent) {
  236. match = userAgent.match(/Edge\/(\d+)/);
  237. if (!match || match[1] >= 74) {
  238. match = userAgent.match(/Chrome\/(\d+)/);
  239. if (match)
  240. version = +match[1];
  241. }
  242. }
  243. module2.exports = version;
  244. }
  245. });
  246. // node_modules/core-js/internals/symbol-constructor-detection.js
  247. var require_symbol_constructor_detection = __commonJS({
  248. "node_modules/core-js/internals/symbol-constructor-detection.js"(exports2, module2) {
  249. var V8_VERSION = require_engine_v8_version();
  250. var fails = require_fails();
  251. module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
  252. var symbol = Symbol();
  253. return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  254. });
  255. }
  256. });
  257. // node_modules/core-js/internals/use-symbol-as-uid.js
  258. var require_use_symbol_as_uid = __commonJS({
  259. "node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
  260. var NATIVE_SYMBOL = require_symbol_constructor_detection();
  261. module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
  262. }
  263. });
  264. // node_modules/core-js/internals/is-symbol.js
  265. var require_is_symbol = __commonJS({
  266. "node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
  267. var getBuiltIn = require_get_built_in();
  268. var isCallable = require_is_callable();
  269. var isPrototypeOf = require_object_is_prototype_of();
  270. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  271. var $Object = Object;
  272. module2.exports = USE_SYMBOL_AS_UID ? function(it) {
  273. return typeof it == "symbol";
  274. } : function(it) {
  275. var $Symbol = getBuiltIn("Symbol");
  276. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  277. };
  278. }
  279. });
  280. // node_modules/core-js/internals/try-to-string.js
  281. var require_try_to_string = __commonJS({
  282. "node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
  283. var $String = String;
  284. module2.exports = function(argument) {
  285. try {
  286. return $String(argument);
  287. } catch (error) {
  288. return "Object";
  289. }
  290. };
  291. }
  292. });
  293. // node_modules/core-js/internals/a-callable.js
  294. var require_a_callable = __commonJS({
  295. "node_modules/core-js/internals/a-callable.js"(exports2, module2) {
  296. var isCallable = require_is_callable();
  297. var tryToString = require_try_to_string();
  298. var $TypeError = TypeError;
  299. module2.exports = function(argument) {
  300. if (isCallable(argument))
  301. return argument;
  302. throw $TypeError(tryToString(argument) + " is not a function");
  303. };
  304. }
  305. });
  306. // node_modules/core-js/internals/get-method.js
  307. var require_get_method = __commonJS({
  308. "node_modules/core-js/internals/get-method.js"(exports2, module2) {
  309. var aCallable = require_a_callable();
  310. var isNullOrUndefined = require_is_null_or_undefined();
  311. module2.exports = function(V, P) {
  312. var func = V[P];
  313. return isNullOrUndefined(func) ? void 0 : aCallable(func);
  314. };
  315. }
  316. });
  317. // node_modules/core-js/internals/ordinary-to-primitive.js
  318. var require_ordinary_to_primitive = __commonJS({
  319. "node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
  320. var call = require_function_call();
  321. var isCallable = require_is_callable();
  322. var isObject = require_is_object();
  323. var $TypeError = TypeError;
  324. module2.exports = function(input, pref) {
  325. var fn, val;
  326. if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  327. return val;
  328. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
  329. return val;
  330. if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  331. return val;
  332. throw $TypeError("Can't convert object to primitive value");
  333. };
  334. }
  335. });
  336. // node_modules/core-js/internals/is-pure.js
  337. var require_is_pure = __commonJS({
  338. "node_modules/core-js/internals/is-pure.js"(exports2, module2) {
  339. module2.exports = false;
  340. }
  341. });
  342. // node_modules/core-js/internals/define-global-property.js
  343. var require_define_global_property = __commonJS({
  344. "node_modules/core-js/internals/define-global-property.js"(exports2, module2) {
  345. var global2 = require_global();
  346. var defineProperty = Object.defineProperty;
  347. module2.exports = function(key, value) {
  348. try {
  349. defineProperty(global2, key, { value, configurable: true, writable: true });
  350. } catch (error) {
  351. global2[key] = value;
  352. }
  353. return value;
  354. };
  355. }
  356. });
  357. // node_modules/core-js/internals/shared-store.js
  358. var require_shared_store = __commonJS({
  359. "node_modules/core-js/internals/shared-store.js"(exports2, module2) {
  360. var global2 = require_global();
  361. var defineGlobalProperty = require_define_global_property();
  362. var SHARED = "__core-js_shared__";
  363. var store = global2[SHARED] || defineGlobalProperty(SHARED, {});
  364. module2.exports = store;
  365. }
  366. });
  367. // node_modules/core-js/internals/shared.js
  368. var require_shared = __commonJS({
  369. "node_modules/core-js/internals/shared.js"(exports2, module2) {
  370. var IS_PURE = require_is_pure();
  371. var store = require_shared_store();
  372. (module2.exports = function(key, value) {
  373. return store[key] || (store[key] = value !== void 0 ? value : {});
  374. })("versions", []).push({
  375. version: "3.26.1",
  376. mode: IS_PURE ? "pure" : "global",
  377. copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
  378. license: "https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",
  379. source: "https://github.com/zloirock/core-js"
  380. });
  381. }
  382. });
  383. // node_modules/core-js/internals/to-object.js
  384. var require_to_object = __commonJS({
  385. "node_modules/core-js/internals/to-object.js"(exports2, module2) {
  386. var requireObjectCoercible = require_require_object_coercible();
  387. var $Object = Object;
  388. module2.exports = function(argument) {
  389. return $Object(requireObjectCoercible(argument));
  390. };
  391. }
  392. });
  393. // node_modules/core-js/internals/has-own-property.js
  394. var require_has_own_property = __commonJS({
  395. "node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
  396. var uncurryThis = require_function_uncurry_this();
  397. var toObject = require_to_object();
  398. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  399. module2.exports = Object.hasOwn || function hasOwn(it, key) {
  400. return hasOwnProperty(toObject(it), key);
  401. };
  402. }
  403. });
  404. // node_modules/core-js/internals/uid.js
  405. var require_uid = __commonJS({
  406. "node_modules/core-js/internals/uid.js"(exports2, module2) {
  407. var uncurryThis = require_function_uncurry_this();
  408. var id = 0;
  409. var postfix = Math.random();
  410. var toString = uncurryThis(1 .toString);
  411. module2.exports = function(key) {
  412. return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
  413. };
  414. }
  415. });
  416. // node_modules/core-js/internals/well-known-symbol.js
  417. var require_well_known_symbol = __commonJS({
  418. "node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
  419. var global2 = require_global();
  420. var shared = require_shared();
  421. var hasOwn = require_has_own_property();
  422. var uid = require_uid();
  423. var NATIVE_SYMBOL = require_symbol_constructor_detection();
  424. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  425. var WellKnownSymbolsStore = shared("wks");
  426. var Symbol2 = global2.Symbol;
  427. var symbolFor = Symbol2 && Symbol2["for"];
  428. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
  429. module2.exports = function(name) {
  430. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
  431. var description = "Symbol." + name;
  432. if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
  433. WellKnownSymbolsStore[name] = Symbol2[name];
  434. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  435. WellKnownSymbolsStore[name] = symbolFor(description);
  436. } else {
  437. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  438. }
  439. }
  440. return WellKnownSymbolsStore[name];
  441. };
  442. }
  443. });
  444. // node_modules/core-js/internals/to-primitive.js
  445. var require_to_primitive = __commonJS({
  446. "node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
  447. var call = require_function_call();
  448. var isObject = require_is_object();
  449. var isSymbol = require_is_symbol();
  450. var getMethod = require_get_method();
  451. var ordinaryToPrimitive = require_ordinary_to_primitive();
  452. var wellKnownSymbol = require_well_known_symbol();
  453. var $TypeError = TypeError;
  454. var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
  455. module2.exports = function(input, pref) {
  456. if (!isObject(input) || isSymbol(input))
  457. return input;
  458. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  459. var result;
  460. if (exoticToPrim) {
  461. if (pref === void 0)
  462. pref = "default";
  463. result = call(exoticToPrim, input, pref);
  464. if (!isObject(result) || isSymbol(result))
  465. return result;
  466. throw $TypeError("Can't convert object to primitive value");
  467. }
  468. if (pref === void 0)
  469. pref = "number";
  470. return ordinaryToPrimitive(input, pref);
  471. };
  472. }
  473. });
  474. // node_modules/core-js/internals/to-property-key.js
  475. var require_to_property_key = __commonJS({
  476. "node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
  477. var toPrimitive = require_to_primitive();
  478. var isSymbol = require_is_symbol();
  479. module2.exports = function(argument) {
  480. var key = toPrimitive(argument, "string");
  481. return isSymbol(key) ? key : key + "";
  482. };
  483. }
  484. });
  485. // node_modules/core-js/internals/document-create-element.js
  486. var require_document_create_element = __commonJS({
  487. "node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
  488. var global2 = require_global();
  489. var isObject = require_is_object();
  490. var document2 = global2.document;
  491. var EXISTS = isObject(document2) && isObject(document2.createElement);
  492. module2.exports = function(it) {
  493. return EXISTS ? document2.createElement(it) : {};
  494. };
  495. }
  496. });
  497. // node_modules/core-js/internals/ie8-dom-define.js
  498. var require_ie8_dom_define = __commonJS({
  499. "node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
  500. var DESCRIPTORS = require_descriptors();
  501. var fails = require_fails();
  502. var createElement = require_document_create_element();
  503. module2.exports = !DESCRIPTORS && !fails(function() {
  504. return Object.defineProperty(createElement("div"), "a", {
  505. get: function() {
  506. return 7;
  507. }
  508. }).a != 7;
  509. });
  510. }
  511. });
  512. // node_modules/core-js/internals/object-get-own-property-descriptor.js
  513. var require_object_get_own_property_descriptor = __commonJS({
  514. "node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
  515. var DESCRIPTORS = require_descriptors();
  516. var call = require_function_call();
  517. var propertyIsEnumerableModule = require_object_property_is_enumerable();
  518. var createPropertyDescriptor = require_create_property_descriptor();
  519. var toIndexedObject = require_to_indexed_object();
  520. var toPropertyKey = require_to_property_key();
  521. var hasOwn = require_has_own_property();
  522. var IE8_DOM_DEFINE = require_ie8_dom_define();
  523. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  524. exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  525. O = toIndexedObject(O);
  526. P = toPropertyKey(P);
  527. if (IE8_DOM_DEFINE)
  528. try {
  529. return $getOwnPropertyDescriptor(O, P);
  530. } catch (error) {
  531. }
  532. if (hasOwn(O, P))
  533. return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  534. };
  535. }
  536. });
  537. // node_modules/core-js/internals/v8-prototype-define-bug.js
  538. var require_v8_prototype_define_bug = __commonJS({
  539. "node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
  540. var DESCRIPTORS = require_descriptors();
  541. var fails = require_fails();
  542. module2.exports = DESCRIPTORS && fails(function() {
  543. return Object.defineProperty(function() {
  544. }, "prototype", {
  545. value: 42,
  546. writable: false
  547. }).prototype != 42;
  548. });
  549. }
  550. });
  551. // node_modules/core-js/internals/an-object.js
  552. var require_an_object = __commonJS({
  553. "node_modules/core-js/internals/an-object.js"(exports2, module2) {
  554. var isObject = require_is_object();
  555. var $String = String;
  556. var $TypeError = TypeError;
  557. module2.exports = function(argument) {
  558. if (isObject(argument))
  559. return argument;
  560. throw $TypeError($String(argument) + " is not an object");
  561. };
  562. }
  563. });
  564. // node_modules/core-js/internals/object-define-property.js
  565. var require_object_define_property = __commonJS({
  566. "node_modules/core-js/internals/object-define-property.js"(exports2) {
  567. var DESCRIPTORS = require_descriptors();
  568. var IE8_DOM_DEFINE = require_ie8_dom_define();
  569. var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
  570. var anObject = require_an_object();
  571. var toPropertyKey = require_to_property_key();
  572. var $TypeError = TypeError;
  573. var $defineProperty = Object.defineProperty;
  574. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  575. var ENUMERABLE = "enumerable";
  576. var CONFIGURABLE = "configurable";
  577. var WRITABLE = "writable";
  578. exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  579. anObject(O);
  580. P = toPropertyKey(P);
  581. anObject(Attributes);
  582. if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  583. var current = $getOwnPropertyDescriptor(O, P);
  584. if (current && current[WRITABLE]) {
  585. O[P] = Attributes.value;
  586. Attributes = {
  587. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  588. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  589. writable: false
  590. };
  591. }
  592. }
  593. return $defineProperty(O, P, Attributes);
  594. } : $defineProperty : function defineProperty(O, P, Attributes) {
  595. anObject(O);
  596. P = toPropertyKey(P);
  597. anObject(Attributes);
  598. if (IE8_DOM_DEFINE)
  599. try {
  600. return $defineProperty(O, P, Attributes);
  601. } catch (error) {
  602. }
  603. if ("get" in Attributes || "set" in Attributes)
  604. throw $TypeError("Accessors not supported");
  605. if ("value" in Attributes)
  606. O[P] = Attributes.value;
  607. return O;
  608. };
  609. }
  610. });
  611. // node_modules/core-js/internals/create-non-enumerable-property.js
  612. var require_create_non_enumerable_property = __commonJS({
  613. "node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
  614. var DESCRIPTORS = require_descriptors();
  615. var definePropertyModule = require_object_define_property();
  616. var createPropertyDescriptor = require_create_property_descriptor();
  617. module2.exports = DESCRIPTORS ? function(object, key, value) {
  618. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  619. } : function(object, key, value) {
  620. object[key] = value;
  621. return object;
  622. };
  623. }
  624. });
  625. // node_modules/core-js/internals/function-name.js
  626. var require_function_name = __commonJS({
  627. "node_modules/core-js/internals/function-name.js"(exports2, module2) {
  628. var DESCRIPTORS = require_descriptors();
  629. var hasOwn = require_has_own_property();
  630. var FunctionPrototype = Function.prototype;
  631. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  632. var EXISTS = hasOwn(FunctionPrototype, "name");
  633. var PROPER = EXISTS && function something() {
  634. }.name === "something";
  635. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
  636. module2.exports = {
  637. EXISTS,
  638. PROPER,
  639. CONFIGURABLE
  640. };
  641. }
  642. });
  643. // node_modules/core-js/internals/inspect-source.js
  644. var require_inspect_source = __commonJS({
  645. "node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
  646. var uncurryThis = require_function_uncurry_this();
  647. var isCallable = require_is_callable();
  648. var store = require_shared_store();
  649. var functionToString = uncurryThis(Function.toString);
  650. if (!isCallable(store.inspectSource)) {
  651. store.inspectSource = function(it) {
  652. return functionToString(it);
  653. };
  654. }
  655. module2.exports = store.inspectSource;
  656. }
  657. });
  658. // node_modules/core-js/internals/weak-map-basic-detection.js
  659. var require_weak_map_basic_detection = __commonJS({
  660. "node_modules/core-js/internals/weak-map-basic-detection.js"(exports2, module2) {
  661. var global2 = require_global();
  662. var isCallable = require_is_callable();
  663. var WeakMap2 = global2.WeakMap;
  664. module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
  665. }
  666. });
  667. // node_modules/core-js/internals/shared-key.js
  668. var require_shared_key = __commonJS({
  669. "node_modules/core-js/internals/shared-key.js"(exports2, module2) {
  670. var shared = require_shared();
  671. var uid = require_uid();
  672. var keys = shared("keys");
  673. module2.exports = function(key) {
  674. return keys[key] || (keys[key] = uid(key));
  675. };
  676. }
  677. });
  678. // node_modules/core-js/internals/hidden-keys.js
  679. var require_hidden_keys = __commonJS({
  680. "node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
  681. module2.exports = {};
  682. }
  683. });
  684. // node_modules/core-js/internals/internal-state.js
  685. var require_internal_state = __commonJS({
  686. "node_modules/core-js/internals/internal-state.js"(exports2, module2) {
  687. var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
  688. var global2 = require_global();
  689. var isObject = require_is_object();
  690. var createNonEnumerableProperty = require_create_non_enumerable_property();
  691. var hasOwn = require_has_own_property();
  692. var shared = require_shared_store();
  693. var sharedKey = require_shared_key();
  694. var hiddenKeys = require_hidden_keys();
  695. var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
  696. var TypeError2 = global2.TypeError;
  697. var WeakMap2 = global2.WeakMap;
  698. var set;
  699. var get;
  700. var has;
  701. var enforce = function(it) {
  702. return has(it) ? get(it) : set(it, {});
  703. };
  704. var getterFor = function(TYPE) {
  705. return function(it) {
  706. var state;
  707. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  708. throw TypeError2("Incompatible receiver, " + TYPE + " required");
  709. }
  710. return state;
  711. };
  712. };
  713. if (NATIVE_WEAK_MAP || shared.state) {
  714. store = shared.state || (shared.state = new WeakMap2());
  715. store.get = store.get;
  716. store.has = store.has;
  717. store.set = store.set;
  718. set = function(it, metadata) {
  719. if (store.has(it))
  720. throw TypeError2(OBJECT_ALREADY_INITIALIZED);
  721. metadata.facade = it;
  722. store.set(it, metadata);
  723. return metadata;
  724. };
  725. get = function(it) {
  726. return store.get(it) || {};
  727. };
  728. has = function(it) {
  729. return store.has(it);
  730. };
  731. } else {
  732. STATE = sharedKey("state");
  733. hiddenKeys[STATE] = true;
  734. set = function(it, metadata) {
  735. if (hasOwn(it, STATE))
  736. throw TypeError2(OBJECT_ALREADY_INITIALIZED);
  737. metadata.facade = it;
  738. createNonEnumerableProperty(it, STATE, metadata);
  739. return metadata;
  740. };
  741. get = function(it) {
  742. return hasOwn(it, STATE) ? it[STATE] : {};
  743. };
  744. has = function(it) {
  745. return hasOwn(it, STATE);
  746. };
  747. }
  748. var store;
  749. var STATE;
  750. module2.exports = {
  751. set,
  752. get,
  753. has,
  754. enforce,
  755. getterFor
  756. };
  757. }
  758. });
  759. // node_modules/core-js/internals/make-built-in.js
  760. var require_make_built_in = __commonJS({
  761. "node_modules/core-js/internals/make-built-in.js"(exports2, module2) {
  762. var fails = require_fails();
  763. var isCallable = require_is_callable();
  764. var hasOwn = require_has_own_property();
  765. var DESCRIPTORS = require_descriptors();
  766. var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
  767. var inspectSource = require_inspect_source();
  768. var InternalStateModule = require_internal_state();
  769. var enforceInternalState = InternalStateModule.enforce;
  770. var getInternalState = InternalStateModule.get;
  771. var defineProperty = Object.defineProperty;
  772. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
  773. return defineProperty(function() {
  774. }, "length", { value: 8 }).length !== 8;
  775. });
  776. var TEMPLATE = String(String).split("String");
  777. var makeBuiltIn = module2.exports = function(value, name, options) {
  778. if (String(name).slice(0, 7) === "Symbol(") {
  779. name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
  780. }
  781. if (options && options.getter)
  782. name = "get " + name;
  783. if (options && options.setter)
  784. name = "set " + name;
  785. if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  786. if (DESCRIPTORS)
  787. defineProperty(value, "name", { value: name, configurable: true });
  788. else
  789. value.name = name;
  790. }
  791. if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
  792. defineProperty(value, "length", { value: options.arity });
  793. }
  794. try {
  795. if (options && hasOwn(options, "constructor") && options.constructor) {
  796. if (DESCRIPTORS)
  797. defineProperty(value, "prototype", { writable: false });
  798. } else if (value.prototype)
  799. value.prototype = void 0;
  800. } catch (error) {
  801. }
  802. var state = enforceInternalState(value);
  803. if (!hasOwn(state, "source")) {
  804. state.source = TEMPLATE.join(typeof name == "string" ? name : "");
  805. }
  806. return value;
  807. };
  808. Function.prototype.toString = makeBuiltIn(function toString() {
  809. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  810. }, "toString");
  811. }
  812. });
  813. // node_modules/core-js/internals/define-built-in.js
  814. var require_define_built_in = __commonJS({
  815. "node_modules/core-js/internals/define-built-in.js"(exports2, module2) {
  816. var isCallable = require_is_callable();
  817. var definePropertyModule = require_object_define_property();
  818. var makeBuiltIn = require_make_built_in();
  819. var defineGlobalProperty = require_define_global_property();
  820. module2.exports = function(O, key, value, options) {
  821. if (!options)
  822. options = {};
  823. var simple = options.enumerable;
  824. var name = options.name !== void 0 ? options.name : key;
  825. if (isCallable(value))
  826. makeBuiltIn(value, name, options);
  827. if (options.global) {
  828. if (simple)
  829. O[key] = value;
  830. else
  831. defineGlobalProperty(key, value);
  832. } else {
  833. try {
  834. if (!options.unsafe)
  835. delete O[key];
  836. else if (O[key])
  837. simple = true;
  838. } catch (error) {
  839. }
  840. if (simple)
  841. O[key] = value;
  842. else
  843. definePropertyModule.f(O, key, {
  844. value,
  845. enumerable: false,
  846. configurable: !options.nonConfigurable,
  847. writable: !options.nonWritable
  848. });
  849. }
  850. return O;
  851. };
  852. }
  853. });
  854. // node_modules/core-js/internals/math-trunc.js
  855. var require_math_trunc = __commonJS({
  856. "node_modules/core-js/internals/math-trunc.js"(exports2, module2) {
  857. var ceil = Math.ceil;
  858. var floor = Math.floor;
  859. module2.exports = Math.trunc || function trunc(x) {
  860. var n = +x;
  861. return (n > 0 ? floor : ceil)(n);
  862. };
  863. }
  864. });
  865. // node_modules/core-js/internals/to-integer-or-infinity.js
  866. var require_to_integer_or_infinity = __commonJS({
  867. "node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
  868. var trunc = require_math_trunc();
  869. module2.exports = function(argument) {
  870. var number = +argument;
  871. return number !== number || number === 0 ? 0 : trunc(number);
  872. };
  873. }
  874. });
  875. // node_modules/core-js/internals/to-absolute-index.js
  876. var require_to_absolute_index = __commonJS({
  877. "node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
  878. var toIntegerOrInfinity = require_to_integer_or_infinity();
  879. var max = Math.max;
  880. var min = Math.min;
  881. module2.exports = function(index, length) {
  882. var integer = toIntegerOrInfinity(index);
  883. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  884. };
  885. }
  886. });
  887. // node_modules/core-js/internals/to-length.js
  888. var require_to_length = __commonJS({
  889. "node_modules/core-js/internals/to-length.js"(exports2, module2) {
  890. var toIntegerOrInfinity = require_to_integer_or_infinity();
  891. var min = Math.min;
  892. module2.exports = function(argument) {
  893. return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
  894. };
  895. }
  896. });
  897. // node_modules/core-js/internals/length-of-array-like.js
  898. var require_length_of_array_like = __commonJS({
  899. "node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
  900. var toLength = require_to_length();
  901. module2.exports = function(obj) {
  902. return toLength(obj.length);
  903. };
  904. }
  905. });
  906. // node_modules/core-js/internals/array-includes.js
  907. var require_array_includes = __commonJS({
  908. "node_modules/core-js/internals/array-includes.js"(exports2, module2) {
  909. var toIndexedObject = require_to_indexed_object();
  910. var toAbsoluteIndex = require_to_absolute_index();
  911. var lengthOfArrayLike = require_length_of_array_like();
  912. var createMethod = function(IS_INCLUDES) {
  913. return function($this, el, fromIndex) {
  914. var O = toIndexedObject($this);
  915. var length = lengthOfArrayLike(O);
  916. var index = toAbsoluteIndex(fromIndex, length);
  917. var value;
  918. if (IS_INCLUDES && el != el)
  919. while (length > index) {
  920. value = O[index++];
  921. if (value != value)
  922. return true;
  923. }
  924. else
  925. for (; length > index; index++) {
  926. if ((IS_INCLUDES || index in O) && O[index] === el)
  927. return IS_INCLUDES || index || 0;
  928. }
  929. return !IS_INCLUDES && -1;
  930. };
  931. };
  932. module2.exports = {
  933. includes: createMethod(true),
  934. indexOf: createMethod(false)
  935. };
  936. }
  937. });
  938. // node_modules/core-js/internals/object-keys-internal.js
  939. var require_object_keys_internal = __commonJS({
  940. "node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
  941. var uncurryThis = require_function_uncurry_this();
  942. var hasOwn = require_has_own_property();
  943. var toIndexedObject = require_to_indexed_object();
  944. var indexOf = require_array_includes().indexOf;
  945. var hiddenKeys = require_hidden_keys();
  946. var push = uncurryThis([].push);
  947. module2.exports = function(object, names) {
  948. var O = toIndexedObject(object);
  949. var i = 0;
  950. var result = [];
  951. var key;
  952. for (key in O)
  953. !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  954. while (names.length > i)
  955. if (hasOwn(O, key = names[i++])) {
  956. ~indexOf(result, key) || push(result, key);
  957. }
  958. return result;
  959. };
  960. }
  961. });
  962. // node_modules/core-js/internals/enum-bug-keys.js
  963. var require_enum_bug_keys = __commonJS({
  964. "node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
  965. module2.exports = [
  966. "constructor",
  967. "hasOwnProperty",
  968. "isPrototypeOf",
  969. "propertyIsEnumerable",
  970. "toLocaleString",
  971. "toString",
  972. "valueOf"
  973. ];
  974. }
  975. });
  976. // node_modules/core-js/internals/object-get-own-property-names.js
  977. var require_object_get_own_property_names = __commonJS({
  978. "node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
  979. var internalObjectKeys = require_object_keys_internal();
  980. var enumBugKeys = require_enum_bug_keys();
  981. var hiddenKeys = enumBugKeys.concat("length", "prototype");
  982. exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  983. return internalObjectKeys(O, hiddenKeys);
  984. };
  985. }
  986. });
  987. // node_modules/core-js/internals/object-get-own-property-symbols.js
  988. var require_object_get_own_property_symbols = __commonJS({
  989. "node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
  990. exports2.f = Object.getOwnPropertySymbols;
  991. }
  992. });
  993. // node_modules/core-js/internals/own-keys.js
  994. var require_own_keys = __commonJS({
  995. "node_modules/core-js/internals/own-keys.js"(exports2, module2) {
  996. var getBuiltIn = require_get_built_in();
  997. var uncurryThis = require_function_uncurry_this();
  998. var getOwnPropertyNamesModule = require_object_get_own_property_names();
  999. var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
  1000. var anObject = require_an_object();
  1001. var concat = uncurryThis([].concat);
  1002. module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
  1003. var keys = getOwnPropertyNamesModule.f(anObject(it));
  1004. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1005. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  1006. };
  1007. }
  1008. });
  1009. // node_modules/core-js/internals/copy-constructor-properties.js
  1010. var require_copy_constructor_properties = __commonJS({
  1011. "node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
  1012. var hasOwn = require_has_own_property();
  1013. var ownKeys = require_own_keys();
  1014. var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
  1015. var definePropertyModule = require_object_define_property();
  1016. module2.exports = function(target, source, exceptions) {
  1017. var keys = ownKeys(source);
  1018. var defineProperty = definePropertyModule.f;
  1019. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  1020. for (var i = 0; i < keys.length; i++) {
  1021. var key = keys[i];
  1022. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  1023. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  1024. }
  1025. }
  1026. };
  1027. }
  1028. });
  1029. // node_modules/core-js/internals/is-forced.js
  1030. var require_is_forced = __commonJS({
  1031. "node_modules/core-js/internals/is-forced.js"(exports2, module2) {
  1032. var fails = require_fails();
  1033. var isCallable = require_is_callable();
  1034. var replacement = /#|\.prototype\./;
  1035. var isForced = function(feature, detection) {
  1036. var value = data[normalize(feature)];
  1037. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  1038. };
  1039. var normalize = isForced.normalize = function(string) {
  1040. return String(string).replace(replacement, ".").toLowerCase();
  1041. };
  1042. var data = isForced.data = {};
  1043. var NATIVE = isForced.NATIVE = "N";
  1044. var POLYFILL = isForced.POLYFILL = "P";
  1045. module2.exports = isForced;
  1046. }
  1047. });
  1048. // node_modules/core-js/internals/export.js
  1049. var require_export = __commonJS({
  1050. "node_modules/core-js/internals/export.js"(exports2, module2) {
  1051. var global2 = require_global();
  1052. var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  1053. var createNonEnumerableProperty = require_create_non_enumerable_property();
  1054. var defineBuiltIn = require_define_built_in();
  1055. var defineGlobalProperty = require_define_global_property();
  1056. var copyConstructorProperties = require_copy_constructor_properties();
  1057. var isForced = require_is_forced();
  1058. module2.exports = function(options, source) {
  1059. var TARGET = options.target;
  1060. var GLOBAL = options.global;
  1061. var STATIC = options.stat;
  1062. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  1063. if (GLOBAL) {
  1064. target = global2;
  1065. } else if (STATIC) {
  1066. target = global2[TARGET] || defineGlobalProperty(TARGET, {});
  1067. } else {
  1068. target = (global2[TARGET] || {}).prototype;
  1069. }
  1070. if (target)
  1071. for (key in source) {
  1072. sourceProperty = source[key];
  1073. if (options.dontCallGetSet) {
  1074. descriptor = getOwnPropertyDescriptor(target, key);
  1075. targetProperty = descriptor && descriptor.value;
  1076. } else
  1077. targetProperty = target[key];
  1078. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
  1079. if (!FORCED && targetProperty !== void 0) {
  1080. if (typeof sourceProperty == typeof targetProperty)
  1081. continue;
  1082. copyConstructorProperties(sourceProperty, targetProperty);
  1083. }
  1084. if (options.sham || targetProperty && targetProperty.sham) {
  1085. createNonEnumerableProperty(sourceProperty, "sham", true);
  1086. }
  1087. defineBuiltIn(target, key, sourceProperty, options);
  1088. }
  1089. };
  1090. }
  1091. });
  1092. // node_modules/core-js/internals/function-uncurry-this-clause.js
  1093. var require_function_uncurry_this_clause = __commonJS({
  1094. "node_modules/core-js/internals/function-uncurry-this-clause.js"(exports2, module2) {
  1095. var classofRaw = require_classof_raw();
  1096. var uncurryThis = require_function_uncurry_this();
  1097. module2.exports = function(fn) {
  1098. if (classofRaw(fn) === "Function")
  1099. return uncurryThis(fn);
  1100. };
  1101. }
  1102. });
  1103. // node_modules/core-js/internals/function-bind-context.js
  1104. var require_function_bind_context = __commonJS({
  1105. "node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
  1106. var uncurryThis = require_function_uncurry_this_clause();
  1107. var aCallable = require_a_callable();
  1108. var NATIVE_BIND = require_function_bind_native();
  1109. var bind = uncurryThis(uncurryThis.bind);
  1110. module2.exports = function(fn, that) {
  1111. aCallable(fn);
  1112. return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
  1113. return fn.apply(that, arguments);
  1114. };
  1115. };
  1116. }
  1117. });
  1118. // node_modules/core-js/internals/iterators.js
  1119. var require_iterators = __commonJS({
  1120. "node_modules/core-js/internals/iterators.js"(exports2, module2) {
  1121. module2.exports = {};
  1122. }
  1123. });
  1124. // node_modules/core-js/internals/is-array-iterator-method.js
  1125. var require_is_array_iterator_method = __commonJS({
  1126. "node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
  1127. var wellKnownSymbol = require_well_known_symbol();
  1128. var Iterators = require_iterators();
  1129. var ITERATOR = wellKnownSymbol("iterator");
  1130. var ArrayPrototype = Array.prototype;
  1131. module2.exports = function(it) {
  1132. return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  1133. };
  1134. }
  1135. });
  1136. // node_modules/core-js/internals/to-string-tag-support.js
  1137. var require_to_string_tag_support = __commonJS({
  1138. "node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
  1139. var wellKnownSymbol = require_well_known_symbol();
  1140. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1141. var test = {};
  1142. test[TO_STRING_TAG] = "z";
  1143. module2.exports = String(test) === "[object z]";
  1144. }
  1145. });
  1146. // node_modules/core-js/internals/classof.js
  1147. var require_classof = __commonJS({
  1148. "node_modules/core-js/internals/classof.js"(exports2, module2) {
  1149. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  1150. var isCallable = require_is_callable();
  1151. var classofRaw = require_classof_raw();
  1152. var wellKnownSymbol = require_well_known_symbol();
  1153. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1154. var $Object = Object;
  1155. var CORRECT_ARGUMENTS = classofRaw(function() {
  1156. return arguments;
  1157. }()) == "Arguments";
  1158. var tryGet = function(it, key) {
  1159. try {
  1160. return it[key];
  1161. } catch (error) {
  1162. }
  1163. };
  1164. module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
  1165. var O, tag, result;
  1166. return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
  1167. };
  1168. }
  1169. });
  1170. // node_modules/core-js/internals/get-iterator-method.js
  1171. var require_get_iterator_method = __commonJS({
  1172. "node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
  1173. var classof = require_classof();
  1174. var getMethod = require_get_method();
  1175. var isNullOrUndefined = require_is_null_or_undefined();
  1176. var Iterators = require_iterators();
  1177. var wellKnownSymbol = require_well_known_symbol();
  1178. var ITERATOR = wellKnownSymbol("iterator");
  1179. module2.exports = function(it) {
  1180. if (!isNullOrUndefined(it))
  1181. return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
  1182. };
  1183. }
  1184. });
  1185. // node_modules/core-js/internals/get-iterator.js
  1186. var require_get_iterator = __commonJS({
  1187. "node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
  1188. var call = require_function_call();
  1189. var aCallable = require_a_callable();
  1190. var anObject = require_an_object();
  1191. var tryToString = require_try_to_string();
  1192. var getIteratorMethod = require_get_iterator_method();
  1193. var $TypeError = TypeError;
  1194. module2.exports = function(argument, usingIterator) {
  1195. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  1196. if (aCallable(iteratorMethod))
  1197. return anObject(call(iteratorMethod, argument));
  1198. throw $TypeError(tryToString(argument) + " is not iterable");
  1199. };
  1200. }
  1201. });
  1202. // node_modules/core-js/internals/iterator-close.js
  1203. var require_iterator_close = __commonJS({
  1204. "node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
  1205. var call = require_function_call();
  1206. var anObject = require_an_object();
  1207. var getMethod = require_get_method();
  1208. module2.exports = function(iterator, kind, value) {
  1209. var innerResult, innerError;
  1210. anObject(iterator);
  1211. try {
  1212. innerResult = getMethod(iterator, "return");
  1213. if (!innerResult) {
  1214. if (kind === "throw")
  1215. throw value;
  1216. return value;
  1217. }
  1218. innerResult = call(innerResult, iterator);
  1219. } catch (error) {
  1220. innerError = true;
  1221. innerResult = error;
  1222. }
  1223. if (kind === "throw")
  1224. throw value;
  1225. if (innerError)
  1226. throw innerResult;
  1227. anObject(innerResult);
  1228. return value;
  1229. };
  1230. }
  1231. });
  1232. // node_modules/core-js/internals/iterate.js
  1233. var require_iterate = __commonJS({
  1234. "node_modules/core-js/internals/iterate.js"(exports2, module2) {
  1235. var bind = require_function_bind_context();
  1236. var call = require_function_call();
  1237. var anObject = require_an_object();
  1238. var tryToString = require_try_to_string();
  1239. var isArrayIteratorMethod = require_is_array_iterator_method();
  1240. var lengthOfArrayLike = require_length_of_array_like();
  1241. var isPrototypeOf = require_object_is_prototype_of();
  1242. var getIterator = require_get_iterator();
  1243. var getIteratorMethod = require_get_iterator_method();
  1244. var iteratorClose = require_iterator_close();
  1245. var $TypeError = TypeError;
  1246. var Result = function(stopped, result) {
  1247. this.stopped = stopped;
  1248. this.result = result;
  1249. };
  1250. var ResultPrototype = Result.prototype;
  1251. module2.exports = function(iterable, unboundFunction, options) {
  1252. var that = options && options.that;
  1253. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  1254. var IS_RECORD = !!(options && options.IS_RECORD);
  1255. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  1256. var INTERRUPTED = !!(options && options.INTERRUPTED);
  1257. var fn = bind(unboundFunction, that);
  1258. var iterator, iterFn, index, length, result, next, step;
  1259. var stop = function(condition) {
  1260. if (iterator)
  1261. iteratorClose(iterator, "normal", condition);
  1262. return new Result(true, condition);
  1263. };
  1264. var callFn = function(value) {
  1265. if (AS_ENTRIES) {
  1266. anObject(value);
  1267. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  1268. }
  1269. return INTERRUPTED ? fn(value, stop) : fn(value);
  1270. };
  1271. if (IS_RECORD) {
  1272. iterator = iterable.iterator;
  1273. } else if (IS_ITERATOR) {
  1274. iterator = iterable;
  1275. } else {
  1276. iterFn = getIteratorMethod(iterable);
  1277. if (!iterFn)
  1278. throw $TypeError(tryToString(iterable) + " is not iterable");
  1279. if (isArrayIteratorMethod(iterFn)) {
  1280. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  1281. result = callFn(iterable[index]);
  1282. if (result && isPrototypeOf(ResultPrototype, result))
  1283. return result;
  1284. }
  1285. return new Result(false);
  1286. }
  1287. iterator = getIterator(iterable, iterFn);
  1288. }
  1289. next = IS_RECORD ? iterable.next : iterator.next;
  1290. while (!(step = call(next, iterator)).done) {
  1291. try {
  1292. result = callFn(step.value);
  1293. } catch (error) {
  1294. iteratorClose(iterator, "throw", error);
  1295. }
  1296. if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
  1297. return result;
  1298. }
  1299. return new Result(false);
  1300. };
  1301. }
  1302. });
  1303. // node_modules/core-js/internals/create-property.js
  1304. var require_create_property = __commonJS({
  1305. "node_modules/core-js/internals/create-property.js"(exports2, module2) {
  1306. "use strict";
  1307. var toPropertyKey = require_to_property_key();
  1308. var definePropertyModule = require_object_define_property();
  1309. var createPropertyDescriptor = require_create_property_descriptor();
  1310. module2.exports = function(object, key, value) {
  1311. var propertyKey = toPropertyKey(key);
  1312. if (propertyKey in object)
  1313. definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  1314. else
  1315. object[propertyKey] = value;
  1316. };
  1317. }
  1318. });
  1319. // node_modules/core-js/modules/es.object.from-entries.js
  1320. var require_es_object_from_entries = __commonJS({
  1321. "node_modules/core-js/modules/es.object.from-entries.js"() {
  1322. var $ = require_export();
  1323. var iterate = require_iterate();
  1324. var createProperty = require_create_property();
  1325. $({ target: "Object", stat: true }, {
  1326. fromEntries: function fromEntries(iterable) {
  1327. var obj = {};
  1328. iterate(iterable, function(k, v) {
  1329. createProperty(obj, k, v);
  1330. }, { AS_ENTRIES: true });
  1331. return obj;
  1332. }
  1333. });
  1334. }
  1335. });
  1336. // node_modules/core-js/internals/is-array.js
  1337. var require_is_array = __commonJS({
  1338. "node_modules/core-js/internals/is-array.js"(exports2, module2) {
  1339. var classof = require_classof_raw();
  1340. module2.exports = Array.isArray || function isArray(argument) {
  1341. return classof(argument) == "Array";
  1342. };
  1343. }
  1344. });
  1345. // node_modules/core-js/internals/does-not-exceed-safe-integer.js
  1346. var require_does_not_exceed_safe_integer = __commonJS({
  1347. "node_modules/core-js/internals/does-not-exceed-safe-integer.js"(exports2, module2) {
  1348. var $TypeError = TypeError;
  1349. var MAX_SAFE_INTEGER = 9007199254740991;
  1350. module2.exports = function(it) {
  1351. if (it > MAX_SAFE_INTEGER)
  1352. throw $TypeError("Maximum allowed index exceeded");
  1353. return it;
  1354. };
  1355. }
  1356. });
  1357. // node_modules/core-js/internals/flatten-into-array.js
  1358. var require_flatten_into_array = __commonJS({
  1359. "node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
  1360. "use strict";
  1361. var isArray = require_is_array();
  1362. var lengthOfArrayLike = require_length_of_array_like();
  1363. var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
  1364. var bind = require_function_bind_context();
  1365. var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  1366. var targetIndex = start;
  1367. var sourceIndex = 0;
  1368. var mapFn = mapper ? bind(mapper, thisArg) : false;
  1369. var element, elementLen;
  1370. while (sourceIndex < sourceLen) {
  1371. if (sourceIndex in source) {
  1372. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  1373. if (depth > 0 && isArray(element)) {
  1374. elementLen = lengthOfArrayLike(element);
  1375. targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
  1376. } else {
  1377. doesNotExceedSafeInteger(targetIndex + 1);
  1378. target[targetIndex] = element;
  1379. }
  1380. targetIndex++;
  1381. }
  1382. sourceIndex++;
  1383. }
  1384. return targetIndex;
  1385. };
  1386. module2.exports = flattenIntoArray;
  1387. }
  1388. });
  1389. // node_modules/core-js/internals/is-constructor.js
  1390. var require_is_constructor = __commonJS({
  1391. "node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
  1392. var uncurryThis = require_function_uncurry_this();
  1393. var fails = require_fails();
  1394. var isCallable = require_is_callable();
  1395. var classof = require_classof();
  1396. var getBuiltIn = require_get_built_in();
  1397. var inspectSource = require_inspect_source();
  1398. var noop = function() {
  1399. };
  1400. var empty = [];
  1401. var construct = getBuiltIn("Reflect", "construct");
  1402. var constructorRegExp = /^\s*(?:class|function)\b/;
  1403. var exec = uncurryThis(constructorRegExp.exec);
  1404. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1405. var isConstructorModern = function isConstructor(argument) {
  1406. if (!isCallable(argument))
  1407. return false;
  1408. try {
  1409. construct(noop, empty, argument);
  1410. return true;
  1411. } catch (error) {
  1412. return false;
  1413. }
  1414. };
  1415. var isConstructorLegacy = function isConstructor(argument) {
  1416. if (!isCallable(argument))
  1417. return false;
  1418. switch (classof(argument)) {
  1419. case "AsyncFunction":
  1420. case "GeneratorFunction":
  1421. case "AsyncGeneratorFunction":
  1422. return false;
  1423. }
  1424. try {
  1425. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  1426. } catch (error) {
  1427. return true;
  1428. }
  1429. };
  1430. isConstructorLegacy.sham = true;
  1431. module2.exports = !construct || fails(function() {
  1432. var called;
  1433. return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
  1434. called = true;
  1435. }) || called;
  1436. }) ? isConstructorLegacy : isConstructorModern;
  1437. }
  1438. });
  1439. // node_modules/core-js/internals/array-species-constructor.js
  1440. var require_array_species_constructor = __commonJS({
  1441. "node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
  1442. var isArray = require_is_array();
  1443. var isConstructor = require_is_constructor();
  1444. var isObject = require_is_object();
  1445. var wellKnownSymbol = require_well_known_symbol();
  1446. var SPECIES = wellKnownSymbol("species");
  1447. var $Array = Array;
  1448. module2.exports = function(originalArray) {
  1449. var C;
  1450. if (isArray(originalArray)) {
  1451. C = originalArray.constructor;
  1452. if (isConstructor(C) && (C === $Array || isArray(C.prototype)))
  1453. C = void 0;
  1454. else if (isObject(C)) {
  1455. C = C[SPECIES];
  1456. if (C === null)
  1457. C = void 0;
  1458. }
  1459. }
  1460. return C === void 0 ? $Array : C;
  1461. };
  1462. }
  1463. });
  1464. // node_modules/core-js/internals/array-species-create.js
  1465. var require_array_species_create = __commonJS({
  1466. "node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
  1467. var arraySpeciesConstructor = require_array_species_constructor();
  1468. module2.exports = function(originalArray, length) {
  1469. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1470. };
  1471. }
  1472. });
  1473. // node_modules/core-js/modules/es.array.flat-map.js
  1474. var require_es_array_flat_map = __commonJS({
  1475. "node_modules/core-js/modules/es.array.flat-map.js"() {
  1476. "use strict";
  1477. var $ = require_export();
  1478. var flattenIntoArray = require_flatten_into_array();
  1479. var aCallable = require_a_callable();
  1480. var toObject = require_to_object();
  1481. var lengthOfArrayLike = require_length_of_array_like();
  1482. var arraySpeciesCreate = require_array_species_create();
  1483. $({ target: "Array", proto: true }, {
  1484. flatMap: function flatMap(callbackfn) {
  1485. var O = toObject(this);
  1486. var sourceLen = lengthOfArrayLike(O);
  1487. var A;
  1488. aCallable(callbackfn);
  1489. A = arraySpeciesCreate(O, 0);
  1490. A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  1491. return A;
  1492. }
  1493. });
  1494. }
  1495. });
  1496. // node_modules/core-js/modules/es.array.flat.js
  1497. var require_es_array_flat = __commonJS({
  1498. "node_modules/core-js/modules/es.array.flat.js"() {
  1499. "use strict";
  1500. var $ = require_export();
  1501. var flattenIntoArray = require_flatten_into_array();
  1502. var toObject = require_to_object();
  1503. var lengthOfArrayLike = require_length_of_array_like();
  1504. var toIntegerOrInfinity = require_to_integer_or_infinity();
  1505. var arraySpeciesCreate = require_array_species_create();
  1506. $({ target: "Array", proto: true }, {
  1507. flat: function flat() {
  1508. var depthArg = arguments.length ? arguments[0] : void 0;
  1509. var O = toObject(this);
  1510. var sourceLen = lengthOfArrayLike(O);
  1511. var A = arraySpeciesCreate(O, 0);
  1512. A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
  1513. return A;
  1514. }
  1515. });
  1516. }
  1517. });
  1518. // node_modules/core-js/internals/define-built-in-accessor.js
  1519. var require_define_built_in_accessor = __commonJS({
  1520. "node_modules/core-js/internals/define-built-in-accessor.js"(exports2, module2) {
  1521. var makeBuiltIn = require_make_built_in();
  1522. var defineProperty = require_object_define_property();
  1523. module2.exports = function(target, name, descriptor) {
  1524. if (descriptor.get)
  1525. makeBuiltIn(descriptor.get, name, { getter: true });
  1526. if (descriptor.set)
  1527. makeBuiltIn(descriptor.set, name, { setter: true });
  1528. return defineProperty.f(target, name, descriptor);
  1529. };
  1530. }
  1531. });
  1532. // node_modules/core-js/internals/regexp-flags.js
  1533. var require_regexp_flags = __commonJS({
  1534. "node_modules/core-js/internals/regexp-flags.js"(exports2, module2) {
  1535. "use strict";
  1536. var anObject = require_an_object();
  1537. module2.exports = function() {
  1538. var that = anObject(this);
  1539. var result = "";
  1540. if (that.hasIndices)
  1541. result += "d";
  1542. if (that.global)
  1543. result += "g";
  1544. if (that.ignoreCase)
  1545. result += "i";
  1546. if (that.multiline)
  1547. result += "m";
  1548. if (that.dotAll)
  1549. result += "s";
  1550. if (that.unicode)
  1551. result += "u";
  1552. if (that.unicodeSets)
  1553. result += "v";
  1554. if (that.sticky)
  1555. result += "y";
  1556. return result;
  1557. };
  1558. }
  1559. });
  1560. // node_modules/core-js/modules/es.regexp.flags.js
  1561. var require_es_regexp_flags = __commonJS({
  1562. "node_modules/core-js/modules/es.regexp.flags.js"() {
  1563. var global2 = require_global();
  1564. var DESCRIPTORS = require_descriptors();
  1565. var defineBuiltInAccessor = require_define_built_in_accessor();
  1566. var regExpFlags = require_regexp_flags();
  1567. var fails = require_fails();
  1568. var RegExp2 = global2.RegExp;
  1569. var RegExpPrototype = RegExp2.prototype;
  1570. var FORCED = DESCRIPTORS && fails(function() {
  1571. var INDICES_SUPPORT = true;
  1572. try {
  1573. RegExp2(".", "d");
  1574. } catch (error) {
  1575. INDICES_SUPPORT = false;
  1576. }
  1577. var O = {};
  1578. var calls = "";
  1579. var expected = INDICES_SUPPORT ? "dgimsy" : "gimsy";
  1580. var addGetter = function(key2, chr) {
  1581. Object.defineProperty(O, key2, { get: function() {
  1582. calls += chr;
  1583. return true;
  1584. } });
  1585. };
  1586. var pairs = {
  1587. dotAll: "s",
  1588. global: "g",
  1589. ignoreCase: "i",
  1590. multiline: "m",
  1591. sticky: "y"
  1592. };
  1593. if (INDICES_SUPPORT)
  1594. pairs.hasIndices = "d";
  1595. for (var key in pairs)
  1596. addGetter(key, pairs[key]);
  1597. var result = Object.getOwnPropertyDescriptor(RegExpPrototype, "flags").get.call(O);
  1598. return result !== expected || calls !== expected;
  1599. });
  1600. if (FORCED)
  1601. defineBuiltInAccessor(RegExpPrototype, "flags", {
  1602. configurable: true,
  1603. get: regExpFlags
  1604. });
  1605. }
  1606. });
  1607. // dist/_cli.js.cjs.js
  1608. require_es_object_from_entries();
  1609. require_es_array_flat_map();
  1610. require_es_array_flat();
  1611. require_es_regexp_flags();
  1612. var __create = Object.create;
  1613. var __defProp = Object.defineProperty;
  1614. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1615. var __getOwnPropNames2 = Object.getOwnPropertyNames;
  1616. var __getProtoOf = Object.getPrototypeOf;
  1617. var __hasOwnProp = Object.prototype.hasOwnProperty;
  1618. var __esm = (fn, res) => function __init() {
  1619. return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
  1620. };
  1621. var __commonJS2 = (cb, mod) => function __require() {
  1622. return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = {
  1623. exports: {}
  1624. }).exports, mod), mod.exports;
  1625. };
  1626. var __export = (target, all) => {
  1627. for (var name in all)
  1628. __defProp(target, name, {
  1629. get: all[name],
  1630. enumerable: true
  1631. });
  1632. };
  1633. var __copyProps = (to, from, except, desc) => {
  1634. if (from && typeof from === "object" || typeof from === "function") {
  1635. for (let key of __getOwnPropNames2(from))
  1636. if (!__hasOwnProp.call(to, key) && key !== except)
  1637. __defProp(to, key, {
  1638. get: () => from[key],
  1639. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  1640. });
  1641. }
  1642. return to;
  1643. };
  1644. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  1645. value: mod,
  1646. enumerable: true
  1647. }) : target, mod));
  1648. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
  1649. value: true
  1650. }), mod);
  1651. var require_fast_json_stable_stringify = __commonJS2({
  1652. "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
  1653. "use strict";
  1654. module2.exports = function(data, opts) {
  1655. if (!opts)
  1656. opts = {};
  1657. if (typeof opts === "function")
  1658. opts = {
  1659. cmp: opts
  1660. };
  1661. var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
  1662. var cmp = opts.cmp && function(f) {
  1663. return function(node) {
  1664. return function(a, b) {
  1665. var aobj = {
  1666. key: a,
  1667. value: node[a]
  1668. };
  1669. var bobj = {
  1670. key: b,
  1671. value: node[b]
  1672. };
  1673. return f(aobj, bobj);
  1674. };
  1675. };
  1676. }(opts.cmp);
  1677. var seen = [];
  1678. return function stringify2(node) {
  1679. if (node && node.toJSON && typeof node.toJSON === "function") {
  1680. node = node.toJSON();
  1681. }
  1682. if (node === void 0)
  1683. return;
  1684. if (typeof node == "number")
  1685. return isFinite(node) ? "" + node : "null";
  1686. if (typeof node !== "object")
  1687. return JSON.stringify(node);
  1688. var i, out;
  1689. if (Array.isArray(node)) {
  1690. out = "[";
  1691. for (i = 0; i < node.length; i++) {
  1692. if (i)
  1693. out += ",";
  1694. out += stringify2(node[i]) || "null";
  1695. }
  1696. return out + "]";
  1697. }
  1698. if (node === null)
  1699. return "null";
  1700. if (seen.indexOf(node) !== -1) {
  1701. if (cycles)
  1702. return JSON.stringify("__cycle__");
  1703. throw new TypeError("Converting circular structure to JSON");
  1704. }
  1705. var seenIndex = seen.push(node) - 1;
  1706. var keys = Object.keys(node).sort(cmp && cmp(node));
  1707. out = "";
  1708. for (i = 0; i < keys.length; i++) {
  1709. var key = keys[i];
  1710. var value = stringify2(node[key]);
  1711. if (!value)
  1712. continue;
  1713. if (out)
  1714. out += ",";
  1715. out += JSON.stringify(key) + ":" + value;
  1716. }
  1717. seen.splice(seenIndex, 1);
  1718. return "{" + out + "}";
  1719. }(data);
  1720. };
  1721. }
  1722. });
  1723. var require_clone = __commonJS2({
  1724. "node_modules/clone/clone.js"(exports2, module2) {
  1725. var clone = function() {
  1726. "use strict";
  1727. function clone2(parent, circular, depth, prototype) {
  1728. var filter;
  1729. if (typeof circular === "object") {
  1730. depth = circular.depth;
  1731. prototype = circular.prototype;
  1732. filter = circular.filter;
  1733. circular = circular.circular;
  1734. }
  1735. var allParents = [];
  1736. var allChildren = [];
  1737. var useBuffer = typeof Buffer != "undefined";
  1738. if (typeof circular == "undefined")
  1739. circular = true;
  1740. if (typeof depth == "undefined")
  1741. depth = Infinity;
  1742. function _clone(parent2, depth2) {
  1743. if (parent2 === null)
  1744. return null;
  1745. if (depth2 == 0)
  1746. return parent2;
  1747. var child;
  1748. var proto2;
  1749. if (typeof parent2 != "object") {
  1750. return parent2;
  1751. }
  1752. if (clone2.__isArray(parent2)) {
  1753. child = [];
  1754. } else if (clone2.__isRegExp(parent2)) {
  1755. child = new RegExp(parent2.source, __getRegExpFlags(parent2));
  1756. if (parent2.lastIndex)
  1757. child.lastIndex = parent2.lastIndex;
  1758. } else if (clone2.__isDate(parent2)) {
  1759. child = new Date(parent2.getTime());
  1760. } else if (useBuffer && Buffer.isBuffer(parent2)) {
  1761. if (Buffer.allocUnsafe) {
  1762. child = Buffer.allocUnsafe(parent2.length);
  1763. } else {
  1764. child = new Buffer(parent2.length);
  1765. }
  1766. parent2.copy(child);
  1767. return child;
  1768. } else {
  1769. if (typeof prototype == "undefined") {
  1770. proto2 = Object.getPrototypeOf(parent2);
  1771. child = Object.create(proto2);
  1772. } else {
  1773. child = Object.create(prototype);
  1774. proto2 = prototype;
  1775. }
  1776. }
  1777. if (circular) {
  1778. var index = allParents.indexOf(parent2);
  1779. if (index != -1) {
  1780. return allChildren[index];
  1781. }
  1782. allParents.push(parent2);
  1783. allChildren.push(child);
  1784. }
  1785. for (var i in parent2) {
  1786. var attrs;
  1787. if (proto2) {
  1788. attrs = Object.getOwnPropertyDescriptor(proto2, i);
  1789. }
  1790. if (attrs && attrs.set == null) {
  1791. continue;
  1792. }
  1793. child[i] = _clone(parent2[i], depth2 - 1);
  1794. }
  1795. return child;
  1796. }
  1797. return _clone(parent, depth);
  1798. }
  1799. clone2.clonePrototype = function clonePrototype(parent) {
  1800. if (parent === null)
  1801. return null;
  1802. var c = function() {
  1803. };
  1804. c.prototype = parent;
  1805. return new c();
  1806. };
  1807. function __objToStr(o) {
  1808. return Object.prototype.toString.call(o);
  1809. }
  1810. ;
  1811. clone2.__objToStr = __objToStr;
  1812. function __isDate(o) {
  1813. return typeof o === "object" && __objToStr(o) === "[object Date]";
  1814. }
  1815. ;
  1816. clone2.__isDate = __isDate;
  1817. function __isArray(o) {
  1818. return typeof o === "object" && __objToStr(o) === "[object Array]";
  1819. }
  1820. ;
  1821. clone2.__isArray = __isArray;
  1822. function __isRegExp(o) {
  1823. return typeof o === "object" && __objToStr(o) === "[object RegExp]";
  1824. }
  1825. ;
  1826. clone2.__isRegExp = __isRegExp;
  1827. function __getRegExpFlags(re) {
  1828. var flags = "";
  1829. if (re.global)
  1830. flags += "g";
  1831. if (re.ignoreCase)
  1832. flags += "i";
  1833. if (re.multiline)
  1834. flags += "m";
  1835. return flags;
  1836. }
  1837. ;
  1838. clone2.__getRegExpFlags = __getRegExpFlags;
  1839. return clone2;
  1840. }();
  1841. if (typeof module2 === "object" && module2.exports) {
  1842. module2.exports = clone;
  1843. }
  1844. }
  1845. });
  1846. var require_defaults = __commonJS2({
  1847. "node_modules/defaults/index.js"(exports2, module2) {
  1848. var clone = require_clone();
  1849. module2.exports = function(options, defaults) {
  1850. options = options || {};
  1851. Object.keys(defaults).forEach(function(key) {
  1852. if (typeof options[key] === "undefined") {
  1853. options[key] = clone(defaults[key]);
  1854. }
  1855. });
  1856. return options;
  1857. };
  1858. }
  1859. });
  1860. var require_combining = __commonJS2({
  1861. "node_modules/wcwidth/combining.js"(exports2, module2) {
  1862. module2.exports = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531], [68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]];
  1863. }
  1864. });
  1865. var require_wcwidth = __commonJS2({
  1866. "node_modules/wcwidth/index.js"(exports2, module2) {
  1867. "use strict";
  1868. var defaults = require_defaults();
  1869. var combining = require_combining();
  1870. var DEFAULTS = {
  1871. nul: 0,
  1872. control: 0
  1873. };
  1874. module2.exports = function wcwidth2(str) {
  1875. return wcswidth(str, DEFAULTS);
  1876. };
  1877. module2.exports.config = function(opts) {
  1878. opts = defaults(opts || {}, DEFAULTS);
  1879. return function wcwidth2(str) {
  1880. return wcswidth(str, opts);
  1881. };
  1882. };
  1883. function wcswidth(str, opts) {
  1884. if (typeof str !== "string")
  1885. return wcwidth(str, opts);
  1886. var s = 0;
  1887. for (var i = 0; i < str.length; i++) {
  1888. var n = wcwidth(str.charCodeAt(i), opts);
  1889. if (n < 0)
  1890. return -1;
  1891. s += n;
  1892. }
  1893. return s;
  1894. }
  1895. function wcwidth(ucs, opts) {
  1896. if (ucs === 0)
  1897. return opts.nul;
  1898. if (ucs < 32 || ucs >= 127 && ucs < 160)
  1899. return opts.control;
  1900. if (bisearch(ucs))
  1901. return 0;
  1902. return 1 + (ucs >= 4352 && (ucs <= 4447 || ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || ucs >= 44032 && ucs <= 55203 || ucs >= 63744 && ucs <= 64255 || ucs >= 65040 && ucs <= 65049 || ucs >= 65072 && ucs <= 65135 || ucs >= 65280 && ucs <= 65376 || ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141));
  1903. }
  1904. function bisearch(ucs) {
  1905. var min = 0;
  1906. var max = combining.length - 1;
  1907. var mid;
  1908. if (ucs < combining[0][0] || ucs > combining[max][1])
  1909. return false;
  1910. while (max >= min) {
  1911. mid = Math.floor((min + max) / 2);
  1912. if (ucs > combining[mid][1])
  1913. min = mid + 1;
  1914. else if (ucs < combining[mid][0])
  1915. max = mid - 1;
  1916. else
  1917. return true;
  1918. }
  1919. return false;
  1920. }
  1921. }
  1922. });
  1923. function ansiRegex({
  1924. onlyFirst = false
  1925. } = {}) {
  1926. const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
  1927. return new RegExp(pattern, onlyFirst ? void 0 : "g");
  1928. }
  1929. var init_ansi_regex = __esm({
  1930. "node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
  1931. }
  1932. });
  1933. var strip_ansi_exports = {};
  1934. __export(strip_ansi_exports, {
  1935. default: () => stripAnsi
  1936. });
  1937. function stripAnsi(string) {
  1938. if (typeof string !== "string") {
  1939. throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
  1940. }
  1941. return string.replace(ansiRegex(), "");
  1942. }
  1943. var init_strip_ansi = __esm({
  1944. "node_modules/strip-ansi/index.js"() {
  1945. init_ansi_regex();
  1946. }
  1947. });
  1948. function assembleStyles() {
  1949. const codes = /* @__PURE__ */ new Map();
  1950. const styles2 = {
  1951. modifier: {
  1952. reset: [0, 0],
  1953. bold: [1, 22],
  1954. dim: [2, 22],
  1955. italic: [3, 23],
  1956. underline: [4, 24],
  1957. overline: [53, 55],
  1958. inverse: [7, 27],
  1959. hidden: [8, 28],
  1960. strikethrough: [9, 29]
  1961. },
  1962. color: {
  1963. black: [30, 39],
  1964. red: [31, 39],
  1965. green: [32, 39],
  1966. yellow: [33, 39],
  1967. blue: [34, 39],
  1968. magenta: [35, 39],
  1969. cyan: [36, 39],
  1970. white: [37, 39],
  1971. blackBright: [90, 39],
  1972. redBright: [91, 39],
  1973. greenBright: [92, 39],
  1974. yellowBright: [93, 39],
  1975. blueBright: [94, 39],
  1976. magentaBright: [95, 39],
  1977. cyanBright: [96, 39],
  1978. whiteBright: [97, 39]
  1979. },
  1980. bgColor: {
  1981. bgBlack: [40, 49],
  1982. bgRed: [41, 49],
  1983. bgGreen: [42, 49],
  1984. bgYellow: [43, 49],
  1985. bgBlue: [44, 49],
  1986. bgMagenta: [45, 49],
  1987. bgCyan: [46, 49],
  1988. bgWhite: [47, 49],
  1989. bgBlackBright: [100, 49],
  1990. bgRedBright: [101, 49],
  1991. bgGreenBright: [102, 49],
  1992. bgYellowBright: [103, 49],
  1993. bgBlueBright: [104, 49],
  1994. bgMagentaBright: [105, 49],
  1995. bgCyanBright: [106, 49],
  1996. bgWhiteBright: [107, 49]
  1997. }
  1998. };
  1999. styles2.color.gray = styles2.color.blackBright;
  2000. styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
  2001. styles2.color.grey = styles2.color.blackBright;
  2002. styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
  2003. for (const [groupName, group] of Object.entries(styles2)) {
  2004. for (const [styleName, style] of Object.entries(group)) {
  2005. styles2[styleName] = {
  2006. open: `\x1B[${style[0]}m`,
  2007. close: `\x1B[${style[1]}m`
  2008. };
  2009. group[styleName] = styles2[styleName];
  2010. codes.set(style[0], style[1]);
  2011. }
  2012. Object.defineProperty(styles2, groupName, {
  2013. value: group,
  2014. enumerable: false
  2015. });
  2016. }
  2017. Object.defineProperty(styles2, "codes", {
  2018. value: codes,
  2019. enumerable: false
  2020. });
  2021. styles2.color.close = "\x1B[39m";
  2022. styles2.bgColor.close = "\x1B[49m";
  2023. styles2.color.ansi = wrapAnsi16();
  2024. styles2.color.ansi256 = wrapAnsi256();
  2025. styles2.color.ansi16m = wrapAnsi16m();
  2026. styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
  2027. styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
  2028. styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
  2029. Object.defineProperties(styles2, {
  2030. rgbToAnsi256: {
  2031. value: (red, green, blue) => {
  2032. if (red === green && green === blue) {
  2033. if (red < 8) {
  2034. return 16;
  2035. }
  2036. if (red > 248) {
  2037. return 231;
  2038. }
  2039. return Math.round((red - 8) / 247 * 24) + 232;
  2040. }
  2041. return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
  2042. },
  2043. enumerable: false
  2044. },
  2045. hexToRgb: {
  2046. value: (hex) => {
  2047. const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
  2048. if (!matches) {
  2049. return [0, 0, 0];
  2050. }
  2051. let {
  2052. colorString
  2053. } = matches.groups;
  2054. if (colorString.length === 3) {
  2055. colorString = [...colorString].map((character) => character + character).join("");
  2056. }
  2057. const integer = Number.parseInt(colorString, 16);
  2058. return [integer >> 16 & 255, integer >> 8 & 255, integer & 255];
  2059. },
  2060. enumerable: false
  2061. },
  2062. hexToAnsi256: {
  2063. value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
  2064. enumerable: false
  2065. },
  2066. ansi256ToAnsi: {
  2067. value: (code) => {
  2068. if (code < 8) {
  2069. return 30 + code;
  2070. }
  2071. if (code < 16) {
  2072. return 90 + (code - 8);
  2073. }
  2074. let red;
  2075. let green;
  2076. let blue;
  2077. if (code >= 232) {
  2078. red = ((code - 232) * 10 + 8) / 255;
  2079. green = red;
  2080. blue = red;
  2081. } else {
  2082. code -= 16;
  2083. const remainder = code % 36;
  2084. red = Math.floor(code / 36) / 5;
  2085. green = Math.floor(remainder / 6) / 5;
  2086. blue = remainder % 6 / 5;
  2087. }
  2088. const value = Math.max(red, green, blue) * 2;
  2089. if (value === 0) {
  2090. return 30;
  2091. }
  2092. let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
  2093. if (value === 2) {
  2094. result += 60;
  2095. }
  2096. return result;
  2097. },
  2098. enumerable: false
  2099. },
  2100. rgbToAnsi: {
  2101. value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
  2102. enumerable: false
  2103. },
  2104. hexToAnsi: {
  2105. value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
  2106. enumerable: false
  2107. }
  2108. });
  2109. return styles2;
  2110. }
  2111. var ANSI_BACKGROUND_OFFSET;
  2112. var wrapAnsi16;
  2113. var wrapAnsi256;
  2114. var wrapAnsi16m;
  2115. var ansiStyles;
  2116. var ansi_styles_default;
  2117. var init_ansi_styles = __esm({
  2118. "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
  2119. ANSI_BACKGROUND_OFFSET = 10;
  2120. wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
  2121. wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
  2122. wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
  2123. ansiStyles = assembleStyles();
  2124. ansi_styles_default = ansiStyles;
  2125. }
  2126. });
  2127. function hasFlag(flag, argv = import_node_process.default.argv) {
  2128. const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  2129. const position = argv.indexOf(prefix + flag);
  2130. const terminatorPosition = argv.indexOf("--");
  2131. return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
  2132. }
  2133. function envForceColor() {
  2134. if ("FORCE_COLOR" in env) {
  2135. if (env.FORCE_COLOR === "true") {
  2136. return 1;
  2137. }
  2138. if (env.FORCE_COLOR === "false") {
  2139. return 0;
  2140. }
  2141. return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
  2142. }
  2143. }
  2144. function translateLevel(level) {
  2145. if (level === 0) {
  2146. return false;
  2147. }
  2148. return {
  2149. level,
  2150. hasBasic: true,
  2151. has256: level >= 2,
  2152. has16m: level >= 3
  2153. };
  2154. }
  2155. function _supportsColor(haveStream, {
  2156. streamIsTTY,
  2157. sniffFlags = true
  2158. } = {}) {
  2159. const noFlagForceColor = envForceColor();
  2160. if (noFlagForceColor !== void 0) {
  2161. flagForceColor = noFlagForceColor;
  2162. }
  2163. const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
  2164. if (forceColor === 0) {
  2165. return 0;
  2166. }
  2167. if (sniffFlags) {
  2168. if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
  2169. return 3;
  2170. }
  2171. if (hasFlag("color=256")) {
  2172. return 2;
  2173. }
  2174. }
  2175. if (haveStream && !streamIsTTY && forceColor === void 0) {
  2176. return 0;
  2177. }
  2178. const min = forceColor || 0;
  2179. if (env.TERM === "dumb") {
  2180. return min;
  2181. }
  2182. if (import_node_process.default.platform === "win32") {
  2183. const osRelease = import_node_os.default.release().split(".");
  2184. if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
  2185. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  2186. }
  2187. return 1;
  2188. }
  2189. if ("CI" in env) {
  2190. if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
  2191. return 1;
  2192. }
  2193. return min;
  2194. }
  2195. if ("TEAMCITY_VERSION" in env) {
  2196. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  2197. }
  2198. if ("TF_BUILD" in env && "AGENT_NAME" in env) {
  2199. return 1;
  2200. }
  2201. if (env.COLORTERM === "truecolor") {
  2202. return 3;
  2203. }
  2204. if ("TERM_PROGRAM" in env) {
  2205. const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
  2206. switch (env.TERM_PROGRAM) {
  2207. case "iTerm.app":
  2208. return version >= 3 ? 3 : 2;
  2209. case "Apple_Terminal":
  2210. return 2;
  2211. }
  2212. }
  2213. if (/-256(color)?$/i.test(env.TERM)) {
  2214. return 2;
  2215. }
  2216. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  2217. return 1;
  2218. }
  2219. if ("COLORTERM" in env) {
  2220. return 1;
  2221. }
  2222. return min;
  2223. }
  2224. function createSupportsColor(stream, options = {}) {
  2225. const level = _supportsColor(stream, Object.assign({
  2226. streamIsTTY: stream && stream.isTTY
  2227. }, options));
  2228. return translateLevel(level);
  2229. }
  2230. var import_node_process;
  2231. var import_node_os;
  2232. var import_node_tty;
  2233. var env;
  2234. var flagForceColor;
  2235. var supportsColor;
  2236. var supports_color_default;
  2237. var init_supports_color = __esm({
  2238. "node_modules/chalk/source/vendor/supports-color/index.js"() {
  2239. import_node_process = __toESM(require("process"), 1);
  2240. import_node_os = __toESM(require("os"), 1);
  2241. import_node_tty = __toESM(require("tty"), 1);
  2242. ({
  2243. env
  2244. } = import_node_process.default);
  2245. if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
  2246. flagForceColor = 0;
  2247. } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
  2248. flagForceColor = 1;
  2249. }
  2250. supportsColor = {
  2251. stdout: createSupportsColor({
  2252. isTTY: import_node_tty.default.isatty(1)
  2253. }),
  2254. stderr: createSupportsColor({
  2255. isTTY: import_node_tty.default.isatty(2)
  2256. })
  2257. };
  2258. supports_color_default = supportsColor;
  2259. }
  2260. });
  2261. function stringReplaceAll(string, substring, replacer) {
  2262. let index = string.indexOf(substring);
  2263. if (index === -1) {
  2264. return string;
  2265. }
  2266. const substringLength = substring.length;
  2267. let endIndex = 0;
  2268. let returnValue = "";
  2269. do {
  2270. returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
  2271. endIndex = index + substringLength;
  2272. index = string.indexOf(substring, endIndex);
  2273. } while (index !== -1);
  2274. returnValue += string.slice(endIndex);
  2275. return returnValue;
  2276. }
  2277. function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
  2278. let endIndex = 0;
  2279. let returnValue = "";
  2280. do {
  2281. const gotCR = string[index - 1] === "\r";
  2282. returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
  2283. endIndex = index + 1;
  2284. index = string.indexOf("\n", endIndex);
  2285. } while (index !== -1);
  2286. returnValue += string.slice(endIndex);
  2287. return returnValue;
  2288. }
  2289. var init_utilities = __esm({
  2290. "node_modules/chalk/source/utilities.js"() {
  2291. }
  2292. });
  2293. var source_exports = {};
  2294. __export(source_exports, {
  2295. Chalk: () => Chalk,
  2296. chalkStderr: () => chalkStderr,
  2297. default: () => source_default,
  2298. supportsColor: () => stdoutColor,
  2299. supportsColorStderr: () => stderrColor
  2300. });
  2301. function createChalk(options) {
  2302. return chalkFactory(options);
  2303. }
  2304. var stdoutColor;
  2305. var stderrColor;
  2306. var GENERATOR;
  2307. var STYLER;
  2308. var IS_EMPTY;
  2309. var levelMapping;
  2310. var styles;
  2311. var applyOptions;
  2312. var Chalk;
  2313. var chalkFactory;
  2314. var getModelAnsi;
  2315. var usedModels;
  2316. var proto;
  2317. var createStyler;
  2318. var createBuilder;
  2319. var applyStyle;
  2320. var chalk;
  2321. var chalkStderr;
  2322. var source_default;
  2323. var init_source = __esm({
  2324. "node_modules/chalk/source/index.js"() {
  2325. init_ansi_styles();
  2326. init_supports_color();
  2327. init_utilities();
  2328. ({
  2329. stdout: stdoutColor,
  2330. stderr: stderrColor
  2331. } = supports_color_default);
  2332. GENERATOR = Symbol("GENERATOR");
  2333. STYLER = Symbol("STYLER");
  2334. IS_EMPTY = Symbol("IS_EMPTY");
  2335. levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
  2336. styles = /* @__PURE__ */ Object.create(null);
  2337. applyOptions = (object, options = {}) => {
  2338. if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
  2339. throw new Error("The `level` option should be an integer from 0 to 3");
  2340. }
  2341. const colorLevel = stdoutColor ? stdoutColor.level : 0;
  2342. object.level = options.level === void 0 ? colorLevel : options.level;
  2343. };
  2344. Chalk = class {
  2345. constructor(options) {
  2346. return chalkFactory(options);
  2347. }
  2348. };
  2349. chalkFactory = (options) => {
  2350. const chalk2 = (...strings) => strings.join(" ");
  2351. applyOptions(chalk2, options);
  2352. Object.setPrototypeOf(chalk2, createChalk.prototype);
  2353. return chalk2;
  2354. };
  2355. Object.setPrototypeOf(createChalk.prototype, Function.prototype);
  2356. for (const [styleName, style] of Object.entries(ansi_styles_default)) {
  2357. styles[styleName] = {
  2358. get() {
  2359. const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
  2360. Object.defineProperty(this, styleName, {
  2361. value: builder
  2362. });
  2363. return builder;
  2364. }
  2365. };
  2366. }
  2367. styles.visible = {
  2368. get() {
  2369. const builder = createBuilder(this, this[STYLER], true);
  2370. Object.defineProperty(this, "visible", {
  2371. value: builder
  2372. });
  2373. return builder;
  2374. }
  2375. };
  2376. getModelAnsi = (model, level, type, ...arguments_) => {
  2377. if (model === "rgb") {
  2378. if (level === "ansi16m") {
  2379. return ansi_styles_default[type].ansi16m(...arguments_);
  2380. }
  2381. if (level === "ansi256") {
  2382. return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
  2383. }
  2384. return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
  2385. }
  2386. if (model === "hex") {
  2387. return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
  2388. }
  2389. return ansi_styles_default[type][model](...arguments_);
  2390. };
  2391. usedModels = ["rgb", "hex", "ansi256"];
  2392. for (const model of usedModels) {
  2393. styles[model] = {
  2394. get() {
  2395. const {
  2396. level
  2397. } = this;
  2398. return function(...arguments_) {
  2399. const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
  2400. return createBuilder(this, styler, this[IS_EMPTY]);
  2401. };
  2402. }
  2403. };
  2404. const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
  2405. styles[bgModel] = {
  2406. get() {
  2407. const {
  2408. level
  2409. } = this;
  2410. return function(...arguments_) {
  2411. const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
  2412. return createBuilder(this, styler, this[IS_EMPTY]);
  2413. };
  2414. }
  2415. };
  2416. }
  2417. proto = Object.defineProperties(() => {
  2418. }, Object.assign(Object.assign({}, styles), {}, {
  2419. level: {
  2420. enumerable: true,
  2421. get() {
  2422. return this[GENERATOR].level;
  2423. },
  2424. set(level) {
  2425. this[GENERATOR].level = level;
  2426. }
  2427. }
  2428. }));
  2429. createStyler = (open, close, parent) => {
  2430. let openAll;
  2431. let closeAll;
  2432. if (parent === void 0) {
  2433. openAll = open;
  2434. closeAll = close;
  2435. } else {
  2436. openAll = parent.openAll + open;
  2437. closeAll = close + parent.closeAll;
  2438. }
  2439. return {
  2440. open,
  2441. close,
  2442. openAll,
  2443. closeAll,
  2444. parent
  2445. };
  2446. };
  2447. createBuilder = (self2, _styler, _isEmpty) => {
  2448. const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
  2449. Object.setPrototypeOf(builder, proto);
  2450. builder[GENERATOR] = self2;
  2451. builder[STYLER] = _styler;
  2452. builder[IS_EMPTY] = _isEmpty;
  2453. return builder;
  2454. };
  2455. applyStyle = (self2, string) => {
  2456. if (self2.level <= 0 || !string) {
  2457. return self2[IS_EMPTY] ? "" : string;
  2458. }
  2459. let styler = self2[STYLER];
  2460. if (styler === void 0) {
  2461. return string;
  2462. }
  2463. const {
  2464. openAll,
  2465. closeAll
  2466. } = styler;
  2467. if (string.includes("\x1B")) {
  2468. while (styler !== void 0) {
  2469. string = stringReplaceAll(string, styler.close, styler.open);
  2470. styler = styler.parent;
  2471. }
  2472. }
  2473. const lfIndex = string.indexOf("\n");
  2474. if (lfIndex !== -1) {
  2475. string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
  2476. }
  2477. return openAll + string + closeAll;
  2478. };
  2479. Object.defineProperties(createChalk.prototype, styles);
  2480. chalk = createChalk();
  2481. chalkStderr = createChalk({
  2482. level: stderrColor ? stderrColor.level : 0
  2483. });
  2484. source_default = chalk;
  2485. }
  2486. });
  2487. var require_logger = __commonJS2({
  2488. "src/cli/logger.js"(exports2, module2) {
  2489. "use strict";
  2490. var readline = require("readline");
  2491. var wcwidth = require_wcwidth();
  2492. var {
  2493. default: stripAnsi2
  2494. } = (init_strip_ansi(), __toCommonJS(strip_ansi_exports));
  2495. var {
  2496. default: chalk2,
  2497. chalkStderr: chalkStderr2
  2498. } = (init_source(), __toCommonJS(source_exports));
  2499. var countLines = (stream, text) => {
  2500. const columns = stream.columns || 80;
  2501. let lineCount = 0;
  2502. for (const line of stripAnsi2(text).split("\n")) {
  2503. lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
  2504. }
  2505. return lineCount;
  2506. };
  2507. var clear = (stream, text) => () => {
  2508. const lineCount = countLines(stream, text);
  2509. for (let line = 0; line < lineCount; line++) {
  2510. if (line > 0) {
  2511. readline.moveCursor(stream, 0, -1);
  2512. }
  2513. readline.clearLine(stream, 0);
  2514. readline.cursorTo(stream, 0);
  2515. }
  2516. };
  2517. var emptyLogResult = {
  2518. clear() {
  2519. }
  2520. };
  2521. function createLogger2(logLevel = "log") {
  2522. return {
  2523. logLevel,
  2524. warn: createLogFunc("warn", "yellow"),
  2525. error: createLogFunc("error", "red"),
  2526. debug: createLogFunc("debug", "blue"),
  2527. log: createLogFunc("log")
  2528. };
  2529. function createLogFunc(loggerName, color) {
  2530. if (!shouldLog(loggerName)) {
  2531. return () => emptyLogResult;
  2532. }
  2533. const stream = process[loggerName === "log" ? "stdout" : "stderr"];
  2534. const chalkInstance = loggerName === "log" ? chalk2 : chalkStderr2;
  2535. const prefix = color ? `[${chalkInstance[color](loggerName)}] ` : "";
  2536. return (message, options) => {
  2537. options = Object.assign({
  2538. newline: true,
  2539. clearable: false
  2540. }, options);
  2541. message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
  2542. stream.write(message);
  2543. if (options.clearable) {
  2544. return {
  2545. clear: clear(stream, message)
  2546. };
  2547. }
  2548. };
  2549. }
  2550. function shouldLog(loggerName) {
  2551. switch (logLevel) {
  2552. case "silent":
  2553. return false;
  2554. case "debug":
  2555. if (loggerName === "debug") {
  2556. return true;
  2557. }
  2558. case "log":
  2559. if (loggerName === "log") {
  2560. return true;
  2561. }
  2562. case "warn":
  2563. if (loggerName === "warn") {
  2564. return true;
  2565. }
  2566. case "error":
  2567. return loggerName === "error";
  2568. }
  2569. }
  2570. }
  2571. module2.exports = createLogger2;
  2572. }
  2573. });
  2574. var require_prettier_internal = __commonJS2({
  2575. "src/cli/prettier-internal.js"(exports2, module2) {
  2576. "use strict";
  2577. module2.exports = require("./index.js").__internal;
  2578. }
  2579. });
  2580. var require_lib = __commonJS2({
  2581. "node_modules/outdent/lib/index.js"(exports2, module2) {
  2582. "use strict";
  2583. Object.defineProperty(exports2, "__esModule", {
  2584. value: true
  2585. });
  2586. exports2.outdent = void 0;
  2587. function noop() {
  2588. var args = [];
  2589. for (var _i = 0; _i < arguments.length; _i++) {
  2590. args[_i] = arguments[_i];
  2591. }
  2592. }
  2593. function createWeakMap() {
  2594. if (typeof WeakMap !== "undefined") {
  2595. return /* @__PURE__ */ new WeakMap();
  2596. } else {
  2597. return fakeSetOrMap();
  2598. }
  2599. }
  2600. function fakeSetOrMap() {
  2601. return {
  2602. add: noop,
  2603. delete: noop,
  2604. get: noop,
  2605. set: noop,
  2606. has: function(k) {
  2607. return false;
  2608. }
  2609. };
  2610. }
  2611. var hop = Object.prototype.hasOwnProperty;
  2612. var has = function(obj, prop) {
  2613. return hop.call(obj, prop);
  2614. };
  2615. function extend(target, source) {
  2616. for (var prop in source) {
  2617. if (has(source, prop)) {
  2618. target[prop] = source[prop];
  2619. }
  2620. }
  2621. return target;
  2622. }
  2623. var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
  2624. var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
  2625. var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
  2626. var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
  2627. var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
  2628. function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
  2629. var indentationLevel = 0;
  2630. var match = strings[0].match(reDetectIndentation);
  2631. if (match) {
  2632. indentationLevel = match[1].length;
  2633. }
  2634. var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
  2635. var reMatchIndent = new RegExp(reSource, "g");
  2636. if (firstInterpolatedValueSetsIndentationLevel) {
  2637. strings = strings.slice(1);
  2638. }
  2639. var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
  2640. var normalizeNewlines = typeof newline === "string";
  2641. var l = strings.length;
  2642. var outdentedStrings = strings.map(function(v, i) {
  2643. v = v.replace(reMatchIndent, "$1");
  2644. if (i === 0 && trimLeadingNewline) {
  2645. v = v.replace(reLeadingNewline, "");
  2646. }
  2647. if (i === l - 1 && trimTrailingNewline) {
  2648. v = v.replace(reTrailingNewline, "");
  2649. }
  2650. if (normalizeNewlines) {
  2651. v = v.replace(/\r\n|\n|\r/g, function(_) {
  2652. return newline;
  2653. });
  2654. }
  2655. return v;
  2656. });
  2657. return outdentedStrings;
  2658. }
  2659. function concatStringsAndValues(strings, values) {
  2660. var ret = "";
  2661. for (var i = 0, l = strings.length; i < l; i++) {
  2662. ret += strings[i];
  2663. if (i < l - 1) {
  2664. ret += values[i];
  2665. }
  2666. }
  2667. return ret;
  2668. }
  2669. function isTemplateStringsArray(v) {
  2670. return has(v, "raw") && has(v, "length");
  2671. }
  2672. function createInstance(options) {
  2673. var arrayAutoIndentCache = createWeakMap();
  2674. var arrayFirstInterpSetsIndentCache = createWeakMap();
  2675. function outdent(stringsOrOptions) {
  2676. var values = [];
  2677. for (var _i = 1; _i < arguments.length; _i++) {
  2678. values[_i - 1] = arguments[_i];
  2679. }
  2680. if (isTemplateStringsArray(stringsOrOptions)) {
  2681. var strings = stringsOrOptions;
  2682. var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
  2683. var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
  2684. var renderedArray = cache.get(strings);
  2685. if (!renderedArray) {
  2686. renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
  2687. cache.set(strings, renderedArray);
  2688. }
  2689. if (values.length === 0) {
  2690. return renderedArray[0];
  2691. }
  2692. var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
  2693. return rendered;
  2694. } else {
  2695. return createInstance(extend(extend({}, options), stringsOrOptions || {}));
  2696. }
  2697. }
  2698. var fullOutdent = extend(outdent, {
  2699. string: function(str) {
  2700. return _outdentArray([str], false, options)[0];
  2701. }
  2702. });
  2703. return fullOutdent;
  2704. }
  2705. var defaultOutdent = createInstance({
  2706. trimLeadingNewline: true,
  2707. trimTrailingNewline: true
  2708. });
  2709. exports2.outdent = defaultOutdent;
  2710. exports2.default = defaultOutdent;
  2711. if (typeof module2 !== "undefined") {
  2712. try {
  2713. module2.exports = defaultOutdent;
  2714. Object.defineProperty(defaultOutdent, "__esModule", {
  2715. value: true
  2716. });
  2717. defaultOutdent.default = defaultOutdent;
  2718. defaultOutdent.outdent = defaultOutdent;
  2719. } catch (e) {
  2720. }
  2721. }
  2722. }
  2723. });
  2724. var require_constant = __commonJS2({
  2725. "src/cli/constant.js"(exports2, module2) {
  2726. "use strict";
  2727. var {
  2728. outdent
  2729. } = require_lib();
  2730. var {
  2731. coreOptions
  2732. } = require_prettier_internal();
  2733. var categoryOrder = [coreOptions.CATEGORY_OUTPUT, coreOptions.CATEGORY_FORMAT, coreOptions.CATEGORY_CONFIG, coreOptions.CATEGORY_EDITOR, coreOptions.CATEGORY_OTHER];
  2734. var options = {
  2735. cache: {
  2736. default: false,
  2737. description: "Only format changed files. Cannot use with --stdin-filepath.",
  2738. type: "boolean"
  2739. },
  2740. "cache-location": {
  2741. description: "Path to the cache file.",
  2742. type: "path"
  2743. },
  2744. "cache-strategy": {
  2745. choices: [{
  2746. description: "Use the file metadata such as timestamps as cache keys",
  2747. value: "metadata"
  2748. }, {
  2749. description: "Use the file content as cache keys",
  2750. value: "content"
  2751. }],
  2752. description: "Strategy for the cache to use for detecting changed files.",
  2753. type: "choice"
  2754. },
  2755. check: {
  2756. alias: "c",
  2757. category: coreOptions.CATEGORY_OUTPUT,
  2758. description: outdent`
  2759. Check if the given files are formatted, print a human-friendly summary
  2760. message and paths to unformatted files (see also --list-different).
  2761. `,
  2762. type: "boolean"
  2763. },
  2764. color: {
  2765. default: true,
  2766. description: "Colorize error messages.",
  2767. oppositeDescription: "Do not colorize error messages.",
  2768. type: "boolean"
  2769. },
  2770. config: {
  2771. category: coreOptions.CATEGORY_CONFIG,
  2772. description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
  2773. exception: (value) => value === false,
  2774. oppositeDescription: "Do not look for a configuration file.",
  2775. type: "path"
  2776. },
  2777. "config-precedence": {
  2778. category: coreOptions.CATEGORY_CONFIG,
  2779. choices: [{
  2780. description: "CLI options take precedence over config file",
  2781. value: "cli-override"
  2782. }, {
  2783. description: "Config file take precedence over CLI options",
  2784. value: "file-override"
  2785. }, {
  2786. description: outdent`
  2787. If a config file is found will evaluate it and ignore other CLI options.
  2788. If no config file is found CLI options will evaluate as normal.
  2789. `,
  2790. value: "prefer-file"
  2791. }],
  2792. default: "cli-override",
  2793. description: "Define in which order config files and CLI options should be evaluated.",
  2794. type: "choice"
  2795. },
  2796. "debug-benchmark": {
  2797. type: "boolean"
  2798. },
  2799. "debug-check": {
  2800. type: "boolean"
  2801. },
  2802. "debug-print-ast": {
  2803. type: "boolean"
  2804. },
  2805. "debug-print-comments": {
  2806. type: "boolean"
  2807. },
  2808. "debug-print-doc": {
  2809. type: "boolean"
  2810. },
  2811. "debug-repeat": {
  2812. default: 0,
  2813. type: "int"
  2814. },
  2815. editorconfig: {
  2816. category: coreOptions.CATEGORY_CONFIG,
  2817. default: true,
  2818. description: "Take .editorconfig into account when parsing configuration.",
  2819. oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
  2820. type: "boolean"
  2821. },
  2822. "error-on-unmatched-pattern": {
  2823. oppositeDescription: "Prevent errors when pattern is unmatched.",
  2824. type: "boolean"
  2825. },
  2826. "file-info": {
  2827. description: outdent`
  2828. Extract the following info (as JSON) for a given file path. Reported fields:
  2829. * ignored (boolean) - true if file path is filtered by --ignore-path
  2830. * inferredParser (string | null) - name of parser inferred from file path
  2831. `,
  2832. type: "path"
  2833. },
  2834. "find-config-path": {
  2835. category: coreOptions.CATEGORY_CONFIG,
  2836. description: "Find and print the path to a configuration file for the given input file.",
  2837. type: "path"
  2838. },
  2839. help: {
  2840. alias: "h",
  2841. description: outdent`
  2842. Show CLI usage, or details about the given flag.
  2843. Example: --help write
  2844. `,
  2845. exception: (value) => value === "",
  2846. type: "flag"
  2847. },
  2848. "ignore-path": {
  2849. category: coreOptions.CATEGORY_CONFIG,
  2850. default: ".prettierignore",
  2851. description: "Path to a file with patterns describing files to ignore.",
  2852. type: "path"
  2853. },
  2854. "ignore-unknown": {
  2855. alias: "u",
  2856. description: "Ignore unknown files.",
  2857. type: "boolean"
  2858. },
  2859. "list-different": {
  2860. alias: "l",
  2861. category: coreOptions.CATEGORY_OUTPUT,
  2862. description: "Print the names of files that are different from Prettier's formatting (see also --check).",
  2863. type: "boolean"
  2864. },
  2865. loglevel: {
  2866. choices: ["silent", "error", "warn", "log", "debug"],
  2867. default: "log",
  2868. description: "What level of logs to report.",
  2869. type: "choice"
  2870. },
  2871. "plugin-search": {
  2872. oppositeDescription: "Disable plugin autoloading.",
  2873. type: "boolean"
  2874. },
  2875. "support-info": {
  2876. description: "Print support information as JSON.",
  2877. type: "boolean"
  2878. },
  2879. version: {
  2880. alias: "v",
  2881. description: "Print Prettier version.",
  2882. type: "boolean"
  2883. },
  2884. "with-node-modules": {
  2885. category: coreOptions.CATEGORY_CONFIG,
  2886. description: "Process files inside 'node_modules' directory.",
  2887. type: "boolean"
  2888. },
  2889. write: {
  2890. alias: "w",
  2891. category: coreOptions.CATEGORY_OUTPUT,
  2892. description: "Edit files in-place. (Beware!)",
  2893. type: "boolean"
  2894. }
  2895. };
  2896. var usageSummary = outdent`
  2897. Usage: prettier [options] [file/dir/glob ...]
  2898. By default, output is written to stdout.
  2899. Stdin is read if it is piped to Prettier and no files are given.
  2900. `;
  2901. module2.exports = {
  2902. categoryOrder,
  2903. options,
  2904. usageSummary
  2905. };
  2906. }
  2907. });
  2908. var require_dashify = __commonJS2({
  2909. "node_modules/dashify/index.js"(exports2, module2) {
  2910. "use strict";
  2911. module2.exports = (str, options) => {
  2912. if (typeof str !== "string")
  2913. throw new TypeError("expected a string");
  2914. return str.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/\W/g, (m) => /[À-ž]/.test(m) ? m : "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, (m) => options && options.condense ? "-" : m).toLowerCase();
  2915. };
  2916. }
  2917. });
  2918. var require_option_map = __commonJS2({
  2919. "src/cli/options/option-map.js"(exports2, module2) {
  2920. "use strict";
  2921. var dashify = require_dashify();
  2922. var {
  2923. coreOptions
  2924. } = require_prettier_internal();
  2925. function normalizeDetailedOption(name, option) {
  2926. return Object.assign(Object.assign({
  2927. category: coreOptions.CATEGORY_OTHER
  2928. }, option), {}, {
  2929. choices: option.choices && option.choices.map((choice) => {
  2930. const newChoice = Object.assign({
  2931. description: "",
  2932. deprecated: false
  2933. }, typeof choice === "object" ? choice : {
  2934. value: choice
  2935. });
  2936. if (newChoice.value === true) {
  2937. newChoice.value = "";
  2938. }
  2939. return newChoice;
  2940. })
  2941. });
  2942. }
  2943. function normalizeDetailedOptionMap(detailedOptionMap) {
  2944. return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
  2945. }
  2946. function createDetailedOptionMap(supportOptions) {
  2947. return Object.fromEntries(supportOptions.map((option) => {
  2948. const newOption = Object.assign(Object.assign({}, option), {}, {
  2949. name: option.cliName || dashify(option.name),
  2950. description: option.cliDescription || option.description,
  2951. category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
  2952. forwardToApi: option.name
  2953. });
  2954. if (option.deprecated) {
  2955. delete newOption.forwardToApi;
  2956. delete newOption.description;
  2957. delete newOption.oppositeDescription;
  2958. newOption.deprecated = true;
  2959. }
  2960. return [newOption.name, newOption];
  2961. }));
  2962. }
  2963. module2.exports = {
  2964. normalizeDetailedOptionMap,
  2965. createDetailedOptionMap
  2966. };
  2967. }
  2968. });
  2969. var require_get_context_options = __commonJS2({
  2970. "src/cli/options/get-context-options.js"(exports2, module2) {
  2971. "use strict";
  2972. var prettier2 = require("./index.js");
  2973. var {
  2974. optionsModule,
  2975. utils: {
  2976. arrayify
  2977. }
  2978. } = require_prettier_internal();
  2979. var constant = require_constant();
  2980. var {
  2981. normalizeDetailedOptionMap,
  2982. createDetailedOptionMap
  2983. } = require_option_map();
  2984. function getContextOptions(plugins, pluginSearchDirs) {
  2985. const {
  2986. options: supportOptions,
  2987. languages
  2988. } = prettier2.getSupportInfo({
  2989. showDeprecated: true,
  2990. showUnreleased: true,
  2991. showInternal: true,
  2992. plugins,
  2993. pluginSearchDirs
  2994. });
  2995. const detailedOptionMap = normalizeDetailedOptionMap(Object.assign(Object.assign({}, createDetailedOptionMap(supportOptions)), constant.options));
  2996. const detailedOptions = arrayify(detailedOptionMap, "name");
  2997. const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
  2998. deprecated
  2999. }) => !deprecated).map((option) => [option.name, option.default])));
  3000. return {
  3001. supportOptions,
  3002. detailedOptions,
  3003. detailedOptionMap,
  3004. apiDefaultOptions,
  3005. languages
  3006. };
  3007. }
  3008. module2.exports = getContextOptions;
  3009. }
  3010. });
  3011. var require_camelcase = __commonJS2({
  3012. "node_modules/camelcase/index.js"(exports2, module2) {
  3013. "use strict";
  3014. var UPPERCASE = /[\p{Lu}]/u;
  3015. var LOWERCASE = /[\p{Ll}]/u;
  3016. var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
  3017. var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
  3018. var SEPARATORS = /[_.\- ]+/;
  3019. var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
  3020. var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
  3021. var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
  3022. var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
  3023. let isLastCharLower = false;
  3024. let isLastCharUpper = false;
  3025. let isLastLastCharUpper = false;
  3026. for (let i = 0; i < string.length; i++) {
  3027. const character = string[i];
  3028. if (isLastCharLower && UPPERCASE.test(character)) {
  3029. string = string.slice(0, i) + "-" + string.slice(i);
  3030. isLastCharLower = false;
  3031. isLastLastCharUpper = isLastCharUpper;
  3032. isLastCharUpper = true;
  3033. i++;
  3034. } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
  3035. string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
  3036. isLastLastCharUpper = isLastCharUpper;
  3037. isLastCharUpper = false;
  3038. isLastCharLower = true;
  3039. } else {
  3040. isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
  3041. isLastLastCharUpper = isLastCharUpper;
  3042. isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
  3043. }
  3044. }
  3045. return string;
  3046. };
  3047. var preserveConsecutiveUppercase = (input, toLowerCase) => {
  3048. LEADING_CAPITAL.lastIndex = 0;
  3049. return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
  3050. };
  3051. var postProcess = (input, toUpperCase) => {
  3052. SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
  3053. NUMBERS_AND_IDENTIFIER.lastIndex = 0;
  3054. return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
  3055. };
  3056. var camelCase = (input, options) => {
  3057. if (!(typeof input === "string" || Array.isArray(input))) {
  3058. throw new TypeError("Expected the input to be `string | string[]`");
  3059. }
  3060. options = Object.assign({
  3061. pascalCase: false,
  3062. preserveConsecutiveUppercase: false
  3063. }, options);
  3064. if (Array.isArray(input)) {
  3065. input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
  3066. } else {
  3067. input = input.trim();
  3068. }
  3069. if (input.length === 0) {
  3070. return "";
  3071. }
  3072. const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
  3073. const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
  3074. if (input.length === 1) {
  3075. return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
  3076. }
  3077. const hasUpperCase = input !== toLowerCase(input);
  3078. if (hasUpperCase) {
  3079. input = preserveCamelCase(input, toLowerCase, toUpperCase);
  3080. }
  3081. input = input.replace(LEADING_SEPARATORS, "");
  3082. if (options.preserveConsecutiveUppercase) {
  3083. input = preserveConsecutiveUppercase(input, toLowerCase);
  3084. } else {
  3085. input = toLowerCase(input);
  3086. }
  3087. if (options.pascalCase) {
  3088. input = toUpperCase(input.charAt(0)) + input.slice(1);
  3089. }
  3090. return postProcess(input, toUpperCase);
  3091. };
  3092. module2.exports = camelCase;
  3093. module2.exports.default = camelCase;
  3094. }
  3095. });
  3096. var sdbm_exports = {};
  3097. __export(sdbm_exports, {
  3098. default: () => sdbm
  3099. });
  3100. function sdbm(string) {
  3101. let hash = 0;
  3102. for (let i = 0; i < string.length; i++) {
  3103. hash = string.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
  3104. }
  3105. return hash >>> 0;
  3106. }
  3107. var init_sdbm = __esm({
  3108. "node_modules/sdbm/index.js"() {
  3109. }
  3110. });
  3111. var require_utils = __commonJS2({
  3112. "src/cli/utils.js"(exports2, module2) {
  3113. "use strict";
  3114. var {
  3115. promises: fs
  3116. } = require("fs");
  3117. var {
  3118. default: sdbm2
  3119. } = (init_sdbm(), __toCommonJS(sdbm_exports));
  3120. var printToScreen2 = console.log.bind(console);
  3121. function groupBy(array2, iteratee) {
  3122. const result = /* @__PURE__ */ Object.create(null);
  3123. for (const value of array2) {
  3124. const key = iteratee(value);
  3125. if (Array.isArray(result[key])) {
  3126. result[key].push(value);
  3127. } else {
  3128. result[key] = [value];
  3129. }
  3130. }
  3131. return result;
  3132. }
  3133. function pick(object, keys) {
  3134. const entries = keys.map((key) => [key, object[key]]);
  3135. return Object.fromEntries(entries);
  3136. }
  3137. function createHash(source) {
  3138. return String(sdbm2(source));
  3139. }
  3140. async function statSafe(filePath) {
  3141. try {
  3142. return await fs.stat(filePath);
  3143. } catch (error) {
  3144. if (error.code !== "ENOENT") {
  3145. throw error;
  3146. }
  3147. }
  3148. }
  3149. function isJson(value) {
  3150. try {
  3151. JSON.parse(value);
  3152. return true;
  3153. } catch {
  3154. return false;
  3155. }
  3156. }
  3157. module2.exports = {
  3158. printToScreen: printToScreen2,
  3159. groupBy,
  3160. pick,
  3161. createHash,
  3162. statSafe,
  3163. isJson
  3164. };
  3165. }
  3166. });
  3167. var require_minimist = __commonJS2({
  3168. "node_modules/minimist/index.js"(exports2, module2) {
  3169. module2.exports = function(args, opts) {
  3170. if (!opts)
  3171. opts = {};
  3172. var flags = {
  3173. bools: {},
  3174. strings: {},
  3175. unknownFn: null
  3176. };
  3177. if (typeof opts["unknown"] === "function") {
  3178. flags.unknownFn = opts["unknown"];
  3179. }
  3180. if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
  3181. flags.allBools = true;
  3182. } else {
  3183. [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
  3184. flags.bools[key2] = true;
  3185. });
  3186. }
  3187. var aliases = {};
  3188. Object.keys(opts.alias || {}).forEach(function(key2) {
  3189. aliases[key2] = [].concat(opts.alias[key2]);
  3190. aliases[key2].forEach(function(x) {
  3191. aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
  3192. return x !== y;
  3193. }));
  3194. });
  3195. });
  3196. [].concat(opts.string).filter(Boolean).forEach(function(key2) {
  3197. flags.strings[key2] = true;
  3198. if (aliases[key2]) {
  3199. flags.strings[aliases[key2]] = true;
  3200. }
  3201. });
  3202. var defaults = opts["default"] || {};
  3203. var argv = {
  3204. _: []
  3205. };
  3206. Object.keys(flags.bools).forEach(function(key2) {
  3207. setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
  3208. });
  3209. var notFlags = [];
  3210. if (args.indexOf("--") !== -1) {
  3211. notFlags = args.slice(args.indexOf("--") + 1);
  3212. args = args.slice(0, args.indexOf("--"));
  3213. }
  3214. function argDefined(key2, arg2) {
  3215. return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
  3216. }
  3217. function setArg(key2, val, arg2) {
  3218. if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
  3219. if (flags.unknownFn(arg2) === false)
  3220. return;
  3221. }
  3222. var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
  3223. setKey(argv, key2.split("."), value2);
  3224. (aliases[key2] || []).forEach(function(x) {
  3225. setKey(argv, x.split("."), value2);
  3226. });
  3227. }
  3228. function setKey(obj, keys, value2) {
  3229. var o = obj;
  3230. for (var i2 = 0; i2 < keys.length - 1; i2++) {
  3231. var key2 = keys[i2];
  3232. if (isConstructorOrProto(o, key2))
  3233. return;
  3234. if (o[key2] === void 0)
  3235. o[key2] = {};
  3236. if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
  3237. o[key2] = {};
  3238. if (o[key2] === Array.prototype)
  3239. o[key2] = [];
  3240. o = o[key2];
  3241. }
  3242. var key2 = keys[keys.length - 1];
  3243. if (isConstructorOrProto(o, key2))
  3244. return;
  3245. if (o === Object.prototype || o === Number.prototype || o === String.prototype)
  3246. o = {};
  3247. if (o === Array.prototype)
  3248. o = [];
  3249. if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
  3250. o[key2] = value2;
  3251. } else if (Array.isArray(o[key2])) {
  3252. o[key2].push(value2);
  3253. } else {
  3254. o[key2] = [o[key2], value2];
  3255. }
  3256. }
  3257. function aliasIsBoolean(key2) {
  3258. return aliases[key2].some(function(x) {
  3259. return flags.bools[x];
  3260. });
  3261. }
  3262. for (var i = 0; i < args.length; i++) {
  3263. var arg = args[i];
  3264. if (/^--.+=/.test(arg)) {
  3265. var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
  3266. var key = m[1];
  3267. var value = m[2];
  3268. if (flags.bools[key]) {
  3269. value = value !== "false";
  3270. }
  3271. setArg(key, value, arg);
  3272. } else if (/^--no-.+/.test(arg)) {
  3273. var key = arg.match(/^--no-(.+)/)[1];
  3274. setArg(key, false, arg);
  3275. } else if (/^--.+/.test(arg)) {
  3276. var key = arg.match(/^--(.+)/)[1];
  3277. var next = args[i + 1];
  3278. if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3279. setArg(key, next, arg);
  3280. i++;
  3281. } else if (/^(true|false)$/.test(next)) {
  3282. setArg(key, next === "true", arg);
  3283. i++;
  3284. } else {
  3285. setArg(key, flags.strings[key] ? "" : true, arg);
  3286. }
  3287. } else if (/^-[^-]+/.test(arg)) {
  3288. var letters = arg.slice(1, -1).split("");
  3289. var broken = false;
  3290. for (var j = 0; j < letters.length; j++) {
  3291. var next = arg.slice(j + 2);
  3292. if (next === "-") {
  3293. setArg(letters[j], next, arg);
  3294. continue;
  3295. }
  3296. if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
  3297. setArg(letters[j], next.split("=")[1], arg);
  3298. broken = true;
  3299. break;
  3300. }
  3301. if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
  3302. setArg(letters[j], next, arg);
  3303. broken = true;
  3304. break;
  3305. }
  3306. if (letters[j + 1] && letters[j + 1].match(/\W/)) {
  3307. setArg(letters[j], arg.slice(j + 2), arg);
  3308. broken = true;
  3309. break;
  3310. } else {
  3311. setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
  3312. }
  3313. }
  3314. var key = arg.slice(-1)[0];
  3315. if (!broken && key !== "-") {
  3316. if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3317. setArg(key, args[i + 1], arg);
  3318. i++;
  3319. } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
  3320. setArg(key, args[i + 1] === "true", arg);
  3321. i++;
  3322. } else {
  3323. setArg(key, flags.strings[key] ? "" : true, arg);
  3324. }
  3325. }
  3326. } else {
  3327. if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
  3328. argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
  3329. }
  3330. if (opts.stopEarly) {
  3331. argv._.push.apply(argv._, args.slice(i + 1));
  3332. break;
  3333. }
  3334. }
  3335. }
  3336. Object.keys(defaults).forEach(function(key2) {
  3337. if (!hasKey(argv, key2.split("."))) {
  3338. setKey(argv, key2.split("."), defaults[key2]);
  3339. (aliases[key2] || []).forEach(function(x) {
  3340. setKey(argv, x.split("."), defaults[key2]);
  3341. });
  3342. }
  3343. });
  3344. if (opts["--"]) {
  3345. argv["--"] = new Array();
  3346. notFlags.forEach(function(key2) {
  3347. argv["--"].push(key2);
  3348. });
  3349. } else {
  3350. notFlags.forEach(function(key2) {
  3351. argv._.push(key2);
  3352. });
  3353. }
  3354. return argv;
  3355. };
  3356. function hasKey(obj, keys) {
  3357. var o = obj;
  3358. keys.slice(0, -1).forEach(function(key2) {
  3359. o = o[key2] || {};
  3360. });
  3361. var key = keys[keys.length - 1];
  3362. return key in o;
  3363. }
  3364. function isNumber(x) {
  3365. if (typeof x === "number")
  3366. return true;
  3367. if (/^0x[0-9a-f]+$/i.test(x))
  3368. return true;
  3369. return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
  3370. }
  3371. function isConstructorOrProto(obj, key) {
  3372. return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
  3373. }
  3374. }
  3375. });
  3376. var require_minimist2 = __commonJS2({
  3377. "src/cli/options/minimist.js"(exports2, module2) {
  3378. "use strict";
  3379. var minimist = require_minimist();
  3380. var PLACEHOLDER = null;
  3381. module2.exports = function(args, options) {
  3382. const boolean = options.boolean || [];
  3383. const defaults = options.default || {};
  3384. const booleanWithoutDefault = boolean.filter((key) => !(key in defaults));
  3385. const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map((key) => [key, PLACEHOLDER])));
  3386. const parsed = minimist(args, Object.assign(Object.assign({}, options), {}, {
  3387. default: newDefaults
  3388. }));
  3389. return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
  3390. };
  3391. }
  3392. });
  3393. var require_create_minimist_options = __commonJS2({
  3394. "src/cli/options/create-minimist-options.js"(exports2, module2) {
  3395. "use strict";
  3396. var {
  3397. utils: {
  3398. partition
  3399. }
  3400. } = require_prettier_internal();
  3401. module2.exports = function createMinimistOptions(detailedOptions) {
  3402. const [boolean, string] = partition(detailedOptions, ({
  3403. type
  3404. }) => type === "boolean").map((detailedOptions2) => detailedOptions2.flatMap(({
  3405. name,
  3406. alias
  3407. }) => alias ? [name, alias] : [name]));
  3408. const defaults = Object.fromEntries(detailedOptions.filter((option) => !option.deprecated && (!option.forwardToApi || option.name === "plugin" || option.name === "plugin-search-dir") && option.default !== void 0).map((option) => [option.name, option.default]));
  3409. return {
  3410. alias: {},
  3411. boolean,
  3412. string,
  3413. default: defaults
  3414. };
  3415. };
  3416. }
  3417. });
  3418. var leven_exports = {};
  3419. __export(leven_exports, {
  3420. default: () => leven
  3421. });
  3422. function leven(first, second) {
  3423. if (first === second) {
  3424. return 0;
  3425. }
  3426. const swap = first;
  3427. if (first.length > second.length) {
  3428. first = second;
  3429. second = swap;
  3430. }
  3431. let firstLength = first.length;
  3432. let secondLength = second.length;
  3433. while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
  3434. firstLength--;
  3435. secondLength--;
  3436. }
  3437. let start = 0;
  3438. while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
  3439. start++;
  3440. }
  3441. firstLength -= start;
  3442. secondLength -= start;
  3443. if (firstLength === 0) {
  3444. return secondLength;
  3445. }
  3446. let bCharacterCode;
  3447. let result;
  3448. let temporary;
  3449. let temporary2;
  3450. let index = 0;
  3451. let index2 = 0;
  3452. while (index < firstLength) {
  3453. characterCodeCache[index] = first.charCodeAt(start + index);
  3454. array[index] = ++index;
  3455. }
  3456. while (index2 < secondLength) {
  3457. bCharacterCode = second.charCodeAt(start + index2);
  3458. temporary = index2++;
  3459. result = index2;
  3460. for (index = 0; index < firstLength; index++) {
  3461. temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
  3462. temporary = array[index];
  3463. result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
  3464. }
  3465. }
  3466. return result;
  3467. }
  3468. var array;
  3469. var characterCodeCache;
  3470. var init_leven = __esm({
  3471. "node_modules/leven/index.js"() {
  3472. array = [];
  3473. characterCodeCache = [];
  3474. }
  3475. });
  3476. var require_normalize_cli_options = __commonJS2({
  3477. "src/cli/options/normalize-cli-options.js"(exports2, module2) {
  3478. "use strict";
  3479. var {
  3480. default: chalk2
  3481. } = (init_source(), __toCommonJS(source_exports));
  3482. var {
  3483. default: leven2
  3484. } = (init_leven(), __toCommonJS(leven_exports));
  3485. var {
  3486. optionsNormalizer
  3487. } = require_prettier_internal();
  3488. function normalizeCliOptions(options, optionInfos, opts) {
  3489. return optionsNormalizer.normalizeCliOptions(options, optionInfos, Object.assign({
  3490. colorsModule: chalk2,
  3491. levenshteinDistance: leven2
  3492. }, opts));
  3493. }
  3494. module2.exports = normalizeCliOptions;
  3495. }
  3496. });
  3497. var require_parse_cli_arguments = __commonJS2({
  3498. "src/cli/options/parse-cli-arguments.js"(exports2, module2) {
  3499. "use strict";
  3500. var camelCase = require_camelcase();
  3501. var {
  3502. pick
  3503. } = require_utils();
  3504. var getContextOptions = require_get_context_options();
  3505. var minimist = require_minimist2();
  3506. var createMinimistOptions = require_create_minimist_options();
  3507. var normalizeCliOptions = require_normalize_cli_options();
  3508. function parseArgv(rawArguments, detailedOptions, logger, keys) {
  3509. const minimistOptions = createMinimistOptions(detailedOptions);
  3510. let argv = minimist(rawArguments, minimistOptions);
  3511. if (keys) {
  3512. if (keys.includes("plugin-search-dir") && !keys.includes("plugin-search")) {
  3513. keys.push("plugin-search");
  3514. }
  3515. detailedOptions = detailedOptions.filter((option) => keys.includes(option.name));
  3516. argv = pick(argv, keys);
  3517. }
  3518. const normalized = normalizeCliOptions(argv, detailedOptions, {
  3519. logger
  3520. });
  3521. return Object.assign(Object.assign({}, Object.fromEntries(Object.entries(normalized).map(([key, value]) => {
  3522. const option = detailedOptions.find(({
  3523. name
  3524. }) => name === key) || {};
  3525. return [option.forwardToApi || camelCase(key), value];
  3526. }))), {}, {
  3527. get __raw() {
  3528. return argv;
  3529. }
  3530. });
  3531. }
  3532. var detailedOptionsWithoutPlugins = getContextOptions([], false).detailedOptions;
  3533. function parseArgvWithoutPlugins2(rawArguments, logger, keys) {
  3534. return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
  3535. }
  3536. module2.exports = {
  3537. parseArgv,
  3538. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3539. };
  3540. }
  3541. });
  3542. var require_context = __commonJS2({
  3543. "src/cli/context.js"(exports2, module2) {
  3544. "use strict";
  3545. var {
  3546. utils: {
  3547. getLast
  3548. }
  3549. } = require_prettier_internal();
  3550. var getContextOptions = require_get_context_options();
  3551. var {
  3552. parseArgv,
  3553. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3554. } = require_parse_cli_arguments();
  3555. var Context2 = class {
  3556. constructor({
  3557. rawArguments,
  3558. logger
  3559. }) {
  3560. this.rawArguments = rawArguments;
  3561. this.logger = logger;
  3562. this.stack = [];
  3563. const {
  3564. plugins,
  3565. pluginSearchDirs
  3566. } = parseArgvWithoutPlugins2(rawArguments, logger, ["plugin", "plugin-search-dir"]);
  3567. this.pushContextPlugins(plugins, pluginSearchDirs);
  3568. const argv = parseArgv(rawArguments, this.detailedOptions, logger);
  3569. this.argv = argv;
  3570. this.filePatterns = argv._.map(String);
  3571. }
  3572. pushContextPlugins(plugins, pluginSearchDirs) {
  3573. const options = getContextOptions(plugins, pluginSearchDirs);
  3574. this.stack.push(options);
  3575. Object.assign(this, options);
  3576. }
  3577. popContextPlugins() {
  3578. this.stack.pop();
  3579. Object.assign(this, getLast(this.stack));
  3580. }
  3581. get performanceTestFlag() {
  3582. const {
  3583. debugBenchmark,
  3584. debugRepeat
  3585. } = this.argv;
  3586. if (debugBenchmark) {
  3587. return {
  3588. name: "--debug-benchmark",
  3589. debugBenchmark: true
  3590. };
  3591. }
  3592. if (debugRepeat > 0) {
  3593. return {
  3594. name: "--debug-repeat",
  3595. debugRepeat
  3596. };
  3597. }
  3598. const {
  3599. PRETTIER_PERF_REPEAT
  3600. } = process.env;
  3601. if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
  3602. return {
  3603. name: "PRETTIER_PERF_REPEAT (environment variable)",
  3604. debugRepeat: Number(PRETTIER_PERF_REPEAT)
  3605. };
  3606. }
  3607. }
  3608. };
  3609. module2.exports = Context2;
  3610. }
  3611. });
  3612. var require_usage = __commonJS2({
  3613. "src/cli/usage.js"(exports2, module2) {
  3614. "use strict";
  3615. var camelCase = require_camelcase();
  3616. var constant = require_constant();
  3617. var {
  3618. groupBy
  3619. } = require_utils();
  3620. var OPTION_USAGE_THRESHOLD = 25;
  3621. var CHOICE_USAGE_MARGIN = 3;
  3622. var CHOICE_USAGE_INDENTATION = 2;
  3623. function indent(str, spaces) {
  3624. return str.replace(/^/gm, " ".repeat(spaces));
  3625. }
  3626. function createDefaultValueDisplay(value) {
  3627. return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
  3628. }
  3629. function getOptionDefaultValue(context, optionName) {
  3630. if (!(optionName in context.detailedOptionMap)) {
  3631. return;
  3632. }
  3633. const option = context.detailedOptionMap[optionName];
  3634. if (option.default !== void 0) {
  3635. return option.default;
  3636. }
  3637. const optionCamelName = camelCase(optionName);
  3638. if (optionCamelName in context.apiDefaultOptions) {
  3639. return context.apiDefaultOptions[optionCamelName];
  3640. }
  3641. }
  3642. function createOptionUsageHeader(option) {
  3643. const name = `--${option.name}`;
  3644. const alias = option.alias ? `-${option.alias},` : null;
  3645. const type = createOptionUsageType(option);
  3646. return [alias, name, type].filter(Boolean).join(" ");
  3647. }
  3648. function createOptionUsageRow(header, content, threshold) {
  3649. const separator = header.length >= threshold ? `
  3650. ${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
  3651. const description = content.replace(/\n/g, `
  3652. ${" ".repeat(threshold)}`);
  3653. return `${header}${separator}${description}`;
  3654. }
  3655. function createOptionUsageType(option) {
  3656. switch (option.type) {
  3657. case "boolean":
  3658. return null;
  3659. case "choice":
  3660. return `<${option.choices.filter((choice) => !choice.deprecated && choice.since !== null).map((choice) => choice.value).join("|")}>`;
  3661. default:
  3662. return `<${option.type}>`;
  3663. }
  3664. }
  3665. function createChoiceUsages(choices, margin, indentation) {
  3666. const activeChoices = choices.filter((choice) => !choice.deprecated && choice.since !== null);
  3667. const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
  3668. return activeChoices.map((choice) => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
  3669. }
  3670. function createOptionUsage(context, option, threshold) {
  3671. const header = createOptionUsageHeader(option);
  3672. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3673. return createOptionUsageRow(header, `${option.description}${optionDefaultValue === void 0 ? "" : `
  3674. Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
  3675. }
  3676. function getOptionsWithOpposites(options) {
  3677. const optionsWithOpposites = options.map((option) => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
  3678. name: `no-${option.name}`,
  3679. type: "boolean",
  3680. description: option.oppositeDescription
  3681. }) : null]);
  3682. return optionsWithOpposites.flat().filter(Boolean);
  3683. }
  3684. function createUsage2(context) {
  3685. const options = getOptionsWithOpposites(context.detailedOptions).filter((option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
  3686. const groupedOptions = groupBy(options, (option) => option.category);
  3687. const firstCategories = constant.categoryOrder.slice(0, -1);
  3688. const lastCategories = constant.categoryOrder.slice(-1);
  3689. const restCategories = Object.keys(groupedOptions).filter((category) => !constant.categoryOrder.includes(category));
  3690. const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
  3691. const optionsUsage = allCategories.map((category) => {
  3692. const categoryOptions = groupedOptions[category].map((option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
  3693. return `${category} options:
  3694. ${indent(categoryOptions, 2)}`;
  3695. });
  3696. return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
  3697. }
  3698. function createDetailedUsage2(context, flag) {
  3699. const option = getOptionsWithOpposites(context.detailedOptions).find((option2) => option2.name === flag || option2.alias === flag);
  3700. const header = createOptionUsageHeader(option);
  3701. const description = `
  3702. ${indent(option.description, 2)}`;
  3703. const choices = option.type !== "choice" ? "" : `
  3704. Valid options:
  3705. ${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
  3706. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3707. const defaults = optionDefaultValue !== void 0 ? `
  3708. Default: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
  3709. const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `
  3710. Plugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `
  3711. * ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
  3712. return `${header}${description}${choices}${defaults}${pluginDefaults}`;
  3713. }
  3714. module2.exports = {
  3715. createUsage: createUsage2,
  3716. createDetailedUsage: createDetailedUsage2
  3717. };
  3718. }
  3719. });
  3720. var require_array = __commonJS2({
  3721. "node_modules/fast-glob/out/utils/array.js"(exports2) {
  3722. "use strict";
  3723. Object.defineProperty(exports2, "__esModule", {
  3724. value: true
  3725. });
  3726. exports2.splitWhen = exports2.flatten = void 0;
  3727. function flatten(items) {
  3728. return items.reduce((collection, item) => [].concat(collection, item), []);
  3729. }
  3730. exports2.flatten = flatten;
  3731. function splitWhen(items, predicate) {
  3732. const result = [[]];
  3733. let groupIndex = 0;
  3734. for (const item of items) {
  3735. if (predicate(item)) {
  3736. groupIndex++;
  3737. result[groupIndex] = [];
  3738. } else {
  3739. result[groupIndex].push(item);
  3740. }
  3741. }
  3742. return result;
  3743. }
  3744. exports2.splitWhen = splitWhen;
  3745. }
  3746. });
  3747. var require_errno = __commonJS2({
  3748. "node_modules/fast-glob/out/utils/errno.js"(exports2) {
  3749. "use strict";
  3750. Object.defineProperty(exports2, "__esModule", {
  3751. value: true
  3752. });
  3753. exports2.isEnoentCodeError = void 0;
  3754. function isEnoentCodeError(error) {
  3755. return error.code === "ENOENT";
  3756. }
  3757. exports2.isEnoentCodeError = isEnoentCodeError;
  3758. }
  3759. });
  3760. var require_fs = __commonJS2({
  3761. "node_modules/fast-glob/out/utils/fs.js"(exports2) {
  3762. "use strict";
  3763. Object.defineProperty(exports2, "__esModule", {
  3764. value: true
  3765. });
  3766. exports2.createDirentFromStats = void 0;
  3767. var DirentFromStats = class {
  3768. constructor(name, stats) {
  3769. this.name = name;
  3770. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  3771. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  3772. this.isDirectory = stats.isDirectory.bind(stats);
  3773. this.isFIFO = stats.isFIFO.bind(stats);
  3774. this.isFile = stats.isFile.bind(stats);
  3775. this.isSocket = stats.isSocket.bind(stats);
  3776. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  3777. }
  3778. };
  3779. function createDirentFromStats(name, stats) {
  3780. return new DirentFromStats(name, stats);
  3781. }
  3782. exports2.createDirentFromStats = createDirentFromStats;
  3783. }
  3784. });
  3785. var require_path = __commonJS2({
  3786. "node_modules/fast-glob/out/utils/path.js"(exports2) {
  3787. "use strict";
  3788. Object.defineProperty(exports2, "__esModule", {
  3789. value: true
  3790. });
  3791. exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
  3792. var path = require("path");
  3793. var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  3794. var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
  3795. function unixify(filepath) {
  3796. return filepath.replace(/\\/g, "/");
  3797. }
  3798. exports2.unixify = unixify;
  3799. function makeAbsolute(cwd, filepath) {
  3800. return path.resolve(cwd, filepath);
  3801. }
  3802. exports2.makeAbsolute = makeAbsolute;
  3803. function escape(pattern) {
  3804. return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  3805. }
  3806. exports2.escape = escape;
  3807. function removeLeadingDotSegment(entry) {
  3808. if (entry.charAt(0) === ".") {
  3809. const secondCharactery = entry.charAt(1);
  3810. if (secondCharactery === "/" || secondCharactery === "\\") {
  3811. return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  3812. }
  3813. }
  3814. return entry;
  3815. }
  3816. exports2.removeLeadingDotSegment = removeLeadingDotSegment;
  3817. }
  3818. });
  3819. var require_is_extglob = __commonJS2({
  3820. "node_modules/is-extglob/index.js"(exports2, module2) {
  3821. module2.exports = function isExtglob(str) {
  3822. if (typeof str !== "string" || str === "") {
  3823. return false;
  3824. }
  3825. var match;
  3826. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  3827. if (match[2])
  3828. return true;
  3829. str = str.slice(match.index + match[0].length);
  3830. }
  3831. return false;
  3832. };
  3833. }
  3834. });
  3835. var require_is_glob = __commonJS2({
  3836. "node_modules/is-glob/index.js"(exports2, module2) {
  3837. var isExtglob = require_is_extglob();
  3838. var chars = {
  3839. "{": "}",
  3840. "(": ")",
  3841. "[": "]"
  3842. };
  3843. var strictCheck = function(str) {
  3844. if (str[0] === "!") {
  3845. return true;
  3846. }
  3847. var index = 0;
  3848. var pipeIndex = -2;
  3849. var closeSquareIndex = -2;
  3850. var closeCurlyIndex = -2;
  3851. var closeParenIndex = -2;
  3852. var backSlashIndex = -2;
  3853. while (index < str.length) {
  3854. if (str[index] === "*") {
  3855. return true;
  3856. }
  3857. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
  3858. return true;
  3859. }
  3860. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  3861. if (closeSquareIndex < index) {
  3862. closeSquareIndex = str.indexOf("]", index);
  3863. }
  3864. if (closeSquareIndex > index) {
  3865. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3866. return true;
  3867. }
  3868. backSlashIndex = str.indexOf("\\", index);
  3869. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3870. return true;
  3871. }
  3872. }
  3873. }
  3874. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  3875. closeCurlyIndex = str.indexOf("}", index);
  3876. if (closeCurlyIndex > index) {
  3877. backSlashIndex = str.indexOf("\\", index);
  3878. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
  3879. return true;
  3880. }
  3881. }
  3882. }
  3883. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  3884. closeParenIndex = str.indexOf(")", index);
  3885. if (closeParenIndex > index) {
  3886. backSlashIndex = str.indexOf("\\", index);
  3887. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3888. return true;
  3889. }
  3890. }
  3891. }
  3892. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  3893. if (pipeIndex < index) {
  3894. pipeIndex = str.indexOf("|", index);
  3895. }
  3896. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  3897. closeParenIndex = str.indexOf(")", pipeIndex);
  3898. if (closeParenIndex > pipeIndex) {
  3899. backSlashIndex = str.indexOf("\\", pipeIndex);
  3900. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3901. return true;
  3902. }
  3903. }
  3904. }
  3905. }
  3906. if (str[index] === "\\") {
  3907. var open = str[index + 1];
  3908. index += 2;
  3909. var close = chars[open];
  3910. if (close) {
  3911. var n = str.indexOf(close, index);
  3912. if (n !== -1) {
  3913. index = n + 1;
  3914. }
  3915. }
  3916. if (str[index] === "!") {
  3917. return true;
  3918. }
  3919. } else {
  3920. index++;
  3921. }
  3922. }
  3923. return false;
  3924. };
  3925. var relaxedCheck = function(str) {
  3926. if (str[0] === "!") {
  3927. return true;
  3928. }
  3929. var index = 0;
  3930. while (index < str.length) {
  3931. if (/[*?{}()[\]]/.test(str[index])) {
  3932. return true;
  3933. }
  3934. if (str[index] === "\\") {
  3935. var open = str[index + 1];
  3936. index += 2;
  3937. var close = chars[open];
  3938. if (close) {
  3939. var n = str.indexOf(close, index);
  3940. if (n !== -1) {
  3941. index = n + 1;
  3942. }
  3943. }
  3944. if (str[index] === "!") {
  3945. return true;
  3946. }
  3947. } else {
  3948. index++;
  3949. }
  3950. }
  3951. return false;
  3952. };
  3953. module2.exports = function isGlob(str, options) {
  3954. if (typeof str !== "string" || str === "") {
  3955. return false;
  3956. }
  3957. if (isExtglob(str)) {
  3958. return true;
  3959. }
  3960. var check = strictCheck;
  3961. if (options && options.strict === false) {
  3962. check = relaxedCheck;
  3963. }
  3964. return check(str);
  3965. };
  3966. }
  3967. });
  3968. var require_glob_parent = __commonJS2({
  3969. "node_modules/glob-parent/index.js"(exports2, module2) {
  3970. "use strict";
  3971. var isGlob = require_is_glob();
  3972. var pathPosixDirname = require("path").posix.dirname;
  3973. var isWin32 = require("os").platform() === "win32";
  3974. var slash = "/";
  3975. var backslash = /\\/g;
  3976. var enclosure = /[\{\[].*[\}\]]$/;
  3977. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  3978. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  3979. module2.exports = function globParent(str, opts) {
  3980. var options = Object.assign({
  3981. flipBackslashes: true
  3982. }, opts);
  3983. if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
  3984. str = str.replace(backslash, slash);
  3985. }
  3986. if (enclosure.test(str)) {
  3987. str += slash;
  3988. }
  3989. str += "a";
  3990. do {
  3991. str = pathPosixDirname(str);
  3992. } while (isGlob(str) || globby.test(str));
  3993. return str.replace(escaped, "$1");
  3994. };
  3995. }
  3996. });
  3997. var require_utils2 = __commonJS2({
  3998. "node_modules/braces/lib/utils.js"(exports2) {
  3999. "use strict";
  4000. exports2.isInteger = (num) => {
  4001. if (typeof num === "number") {
  4002. return Number.isInteger(num);
  4003. }
  4004. if (typeof num === "string" && num.trim() !== "") {
  4005. return Number.isInteger(Number(num));
  4006. }
  4007. return false;
  4008. };
  4009. exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
  4010. exports2.exceedsLimit = (min, max, step = 1, limit) => {
  4011. if (limit === false)
  4012. return false;
  4013. if (!exports2.isInteger(min) || !exports2.isInteger(max))
  4014. return false;
  4015. return (Number(max) - Number(min)) / Number(step) >= limit;
  4016. };
  4017. exports2.escapeNode = (block, n = 0, type) => {
  4018. let node = block.nodes[n];
  4019. if (!node)
  4020. return;
  4021. if (type && node.type === type || node.type === "open" || node.type === "close") {
  4022. if (node.escaped !== true) {
  4023. node.value = "\\" + node.value;
  4024. node.escaped = true;
  4025. }
  4026. }
  4027. };
  4028. exports2.encloseBrace = (node) => {
  4029. if (node.type !== "brace")
  4030. return false;
  4031. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  4032. node.invalid = true;
  4033. return true;
  4034. }
  4035. return false;
  4036. };
  4037. exports2.isInvalidBrace = (block) => {
  4038. if (block.type !== "brace")
  4039. return false;
  4040. if (block.invalid === true || block.dollar)
  4041. return true;
  4042. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  4043. block.invalid = true;
  4044. return true;
  4045. }
  4046. if (block.open !== true || block.close !== true) {
  4047. block.invalid = true;
  4048. return true;
  4049. }
  4050. return false;
  4051. };
  4052. exports2.isOpenOrClose = (node) => {
  4053. if (node.type === "open" || node.type === "close") {
  4054. return true;
  4055. }
  4056. return node.open === true || node.close === true;
  4057. };
  4058. exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
  4059. if (node.type === "text")
  4060. acc.push(node.value);
  4061. if (node.type === "range")
  4062. node.type = "text";
  4063. return acc;
  4064. }, []);
  4065. exports2.flatten = (...args) => {
  4066. const result = [];
  4067. const flat = (arr) => {
  4068. for (let i = 0; i < arr.length; i++) {
  4069. let ele = arr[i];
  4070. Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
  4071. }
  4072. return result;
  4073. };
  4074. flat(args);
  4075. return result;
  4076. };
  4077. }
  4078. });
  4079. var require_stringify = __commonJS2({
  4080. "node_modules/braces/lib/stringify.js"(exports2, module2) {
  4081. "use strict";
  4082. var utils = require_utils2();
  4083. module2.exports = (ast, options = {}) => {
  4084. let stringify2 = (node, parent = {}) => {
  4085. let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
  4086. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  4087. let output = "";
  4088. if (node.value) {
  4089. if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
  4090. return "\\" + node.value;
  4091. }
  4092. return node.value;
  4093. }
  4094. if (node.value) {
  4095. return node.value;
  4096. }
  4097. if (node.nodes) {
  4098. for (let child of node.nodes) {
  4099. output += stringify2(child);
  4100. }
  4101. }
  4102. return output;
  4103. };
  4104. return stringify2(ast);
  4105. };
  4106. }
  4107. });
  4108. var require_is_number = __commonJS2({
  4109. "node_modules/is-number/index.js"(exports2, module2) {
  4110. "use strict";
  4111. module2.exports = function(num) {
  4112. if (typeof num === "number") {
  4113. return num - num === 0;
  4114. }
  4115. if (typeof num === "string" && num.trim() !== "") {
  4116. return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  4117. }
  4118. return false;
  4119. };
  4120. }
  4121. });
  4122. var require_to_regex_range = __commonJS2({
  4123. "node_modules/to-regex-range/index.js"(exports2, module2) {
  4124. "use strict";
  4125. var isNumber = require_is_number();
  4126. var toRegexRange = (min, max, options) => {
  4127. if (isNumber(min) === false) {
  4128. throw new TypeError("toRegexRange: expected the first argument to be a number");
  4129. }
  4130. if (max === void 0 || min === max) {
  4131. return String(min);
  4132. }
  4133. if (isNumber(max) === false) {
  4134. throw new TypeError("toRegexRange: expected the second argument to be a number.");
  4135. }
  4136. let opts = Object.assign({
  4137. relaxZeros: true
  4138. }, options);
  4139. if (typeof opts.strictZeros === "boolean") {
  4140. opts.relaxZeros = opts.strictZeros === false;
  4141. }
  4142. let relax = String(opts.relaxZeros);
  4143. let shorthand = String(opts.shorthand);
  4144. let capture = String(opts.capture);
  4145. let wrap = String(opts.wrap);
  4146. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  4147. if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
  4148. return toRegexRange.cache[cacheKey].result;
  4149. }
  4150. let a = Math.min(min, max);
  4151. let b = Math.max(min, max);
  4152. if (Math.abs(a - b) === 1) {
  4153. let result = min + "|" + max;
  4154. if (opts.capture) {
  4155. return `(${result})`;
  4156. }
  4157. if (opts.wrap === false) {
  4158. return result;
  4159. }
  4160. return `(?:${result})`;
  4161. }
  4162. let isPadded = hasPadding(min) || hasPadding(max);
  4163. let state = {
  4164. min,
  4165. max,
  4166. a,
  4167. b
  4168. };
  4169. let positives = [];
  4170. let negatives = [];
  4171. if (isPadded) {
  4172. state.isPadded = isPadded;
  4173. state.maxLen = String(state.max).length;
  4174. }
  4175. if (a < 0) {
  4176. let newMin = b < 0 ? Math.abs(b) : 1;
  4177. negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
  4178. a = state.a = 0;
  4179. }
  4180. if (b >= 0) {
  4181. positives = splitToPatterns(a, b, state, opts);
  4182. }
  4183. state.negatives = negatives;
  4184. state.positives = positives;
  4185. state.result = collatePatterns(negatives, positives, opts);
  4186. if (opts.capture === true) {
  4187. state.result = `(${state.result})`;
  4188. } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
  4189. state.result = `(?:${state.result})`;
  4190. }
  4191. toRegexRange.cache[cacheKey] = state;
  4192. return state.result;
  4193. };
  4194. function collatePatterns(neg, pos, options) {
  4195. let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
  4196. let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
  4197. let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
  4198. let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
  4199. return subpatterns.join("|");
  4200. }
  4201. function splitToRanges(min, max) {
  4202. let nines = 1;
  4203. let zeros = 1;
  4204. let stop = countNines(min, nines);
  4205. let stops = /* @__PURE__ */ new Set([max]);
  4206. while (min <= stop && stop <= max) {
  4207. stops.add(stop);
  4208. nines += 1;
  4209. stop = countNines(min, nines);
  4210. }
  4211. stop = countZeros(max + 1, zeros) - 1;
  4212. while (min < stop && stop <= max) {
  4213. stops.add(stop);
  4214. zeros += 1;
  4215. stop = countZeros(max + 1, zeros) - 1;
  4216. }
  4217. stops = [...stops];
  4218. stops.sort(compare);
  4219. return stops;
  4220. }
  4221. function rangeToPattern(start, stop, options) {
  4222. if (start === stop) {
  4223. return {
  4224. pattern: start,
  4225. count: [],
  4226. digits: 0
  4227. };
  4228. }
  4229. let zipped = zip(start, stop);
  4230. let digits = zipped.length;
  4231. let pattern = "";
  4232. let count = 0;
  4233. for (let i = 0; i < digits; i++) {
  4234. let [startDigit, stopDigit] = zipped[i];
  4235. if (startDigit === stopDigit) {
  4236. pattern += startDigit;
  4237. } else if (startDigit !== "0" || stopDigit !== "9") {
  4238. pattern += toCharacterClass(startDigit, stopDigit, options);
  4239. } else {
  4240. count++;
  4241. }
  4242. }
  4243. if (count) {
  4244. pattern += options.shorthand === true ? "\\d" : "[0-9]";
  4245. }
  4246. return {
  4247. pattern,
  4248. count: [count],
  4249. digits
  4250. };
  4251. }
  4252. function splitToPatterns(min, max, tok, options) {
  4253. let ranges = splitToRanges(min, max);
  4254. let tokens = [];
  4255. let start = min;
  4256. let prev;
  4257. for (let i = 0; i < ranges.length; i++) {
  4258. let max2 = ranges[i];
  4259. let obj = rangeToPattern(String(start), String(max2), options);
  4260. let zeros = "";
  4261. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  4262. if (prev.count.length > 1) {
  4263. prev.count.pop();
  4264. }
  4265. prev.count.push(obj.count[0]);
  4266. prev.string = prev.pattern + toQuantifier(prev.count);
  4267. start = max2 + 1;
  4268. continue;
  4269. }
  4270. if (tok.isPadded) {
  4271. zeros = padZeros(max2, tok, options);
  4272. }
  4273. obj.string = zeros + obj.pattern + toQuantifier(obj.count);
  4274. tokens.push(obj);
  4275. start = max2 + 1;
  4276. prev = obj;
  4277. }
  4278. return tokens;
  4279. }
  4280. function filterPatterns(arr, comparison, prefix, intersection, options) {
  4281. let result = [];
  4282. for (let ele of arr) {
  4283. let {
  4284. string
  4285. } = ele;
  4286. if (!intersection && !contains(comparison, "string", string)) {
  4287. result.push(prefix + string);
  4288. }
  4289. if (intersection && contains(comparison, "string", string)) {
  4290. result.push(prefix + string);
  4291. }
  4292. }
  4293. return result;
  4294. }
  4295. function zip(a, b) {
  4296. let arr = [];
  4297. for (let i = 0; i < a.length; i++)
  4298. arr.push([a[i], b[i]]);
  4299. return arr;
  4300. }
  4301. function compare(a, b) {
  4302. return a > b ? 1 : b > a ? -1 : 0;
  4303. }
  4304. function contains(arr, key, val) {
  4305. return arr.some((ele) => ele[key] === val);
  4306. }
  4307. function countNines(min, len) {
  4308. return Number(String(min).slice(0, -len) + "9".repeat(len));
  4309. }
  4310. function countZeros(integer, zeros) {
  4311. return integer - integer % Math.pow(10, zeros);
  4312. }
  4313. function toQuantifier(digits) {
  4314. let [start = 0, stop = ""] = digits;
  4315. if (stop || start > 1) {
  4316. return `{${start + (stop ? "," + stop : "")}}`;
  4317. }
  4318. return "";
  4319. }
  4320. function toCharacterClass(a, b, options) {
  4321. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  4322. }
  4323. function hasPadding(str) {
  4324. return /^-?(0+)\d/.test(str);
  4325. }
  4326. function padZeros(value, tok, options) {
  4327. if (!tok.isPadded) {
  4328. return value;
  4329. }
  4330. let diff = Math.abs(tok.maxLen - String(value).length);
  4331. let relax = options.relaxZeros !== false;
  4332. switch (diff) {
  4333. case 0:
  4334. return "";
  4335. case 1:
  4336. return relax ? "0?" : "0";
  4337. case 2:
  4338. return relax ? "0{0,2}" : "00";
  4339. default: {
  4340. return relax ? `0{0,${diff}}` : `0{${diff}}`;
  4341. }
  4342. }
  4343. }
  4344. toRegexRange.cache = {};
  4345. toRegexRange.clearCache = () => toRegexRange.cache = {};
  4346. module2.exports = toRegexRange;
  4347. }
  4348. });
  4349. var require_fill_range = __commonJS2({
  4350. "node_modules/fill-range/index.js"(exports2, module2) {
  4351. "use strict";
  4352. var util = require("util");
  4353. var toRegexRange = require_to_regex_range();
  4354. var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  4355. var transform = (toNumber) => {
  4356. return (value) => toNumber === true ? Number(value) : String(value);
  4357. };
  4358. var isValidValue = (value) => {
  4359. return typeof value === "number" || typeof value === "string" && value !== "";
  4360. };
  4361. var isNumber = (num) => Number.isInteger(+num);
  4362. var zeros = (input) => {
  4363. let value = `${input}`;
  4364. let index = -1;
  4365. if (value[0] === "-")
  4366. value = value.slice(1);
  4367. if (value === "0")
  4368. return false;
  4369. while (value[++index] === "0")
  4370. ;
  4371. return index > 0;
  4372. };
  4373. var stringify2 = (start, end, options) => {
  4374. if (typeof start === "string" || typeof end === "string") {
  4375. return true;
  4376. }
  4377. return options.stringify === true;
  4378. };
  4379. var pad = (input, maxLength, toNumber) => {
  4380. if (maxLength > 0) {
  4381. let dash = input[0] === "-" ? "-" : "";
  4382. if (dash)
  4383. input = input.slice(1);
  4384. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  4385. }
  4386. if (toNumber === false) {
  4387. return String(input);
  4388. }
  4389. return input;
  4390. };
  4391. var toMaxLen = (input, maxLength) => {
  4392. let negative = input[0] === "-" ? "-" : "";
  4393. if (negative) {
  4394. input = input.slice(1);
  4395. maxLength--;
  4396. }
  4397. while (input.length < maxLength)
  4398. input = "0" + input;
  4399. return negative ? "-" + input : input;
  4400. };
  4401. var toSequence = (parts, options) => {
  4402. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4403. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4404. let prefix = options.capture ? "" : "?:";
  4405. let positives = "";
  4406. let negatives = "";
  4407. let result;
  4408. if (parts.positives.length) {
  4409. positives = parts.positives.join("|");
  4410. }
  4411. if (parts.negatives.length) {
  4412. negatives = `-(${prefix}${parts.negatives.join("|")})`;
  4413. }
  4414. if (positives && negatives) {
  4415. result = `${positives}|${negatives}`;
  4416. } else {
  4417. result = positives || negatives;
  4418. }
  4419. if (options.wrap) {
  4420. return `(${prefix}${result})`;
  4421. }
  4422. return result;
  4423. };
  4424. var toRange = (a, b, isNumbers, options) => {
  4425. if (isNumbers) {
  4426. return toRegexRange(a, b, Object.assign({
  4427. wrap: false
  4428. }, options));
  4429. }
  4430. let start = String.fromCharCode(a);
  4431. if (a === b)
  4432. return start;
  4433. let stop = String.fromCharCode(b);
  4434. return `[${start}-${stop}]`;
  4435. };
  4436. var toRegex = (start, end, options) => {
  4437. if (Array.isArray(start)) {
  4438. let wrap = options.wrap === true;
  4439. let prefix = options.capture ? "" : "?:";
  4440. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  4441. }
  4442. return toRegexRange(start, end, options);
  4443. };
  4444. var rangeError = (...args) => {
  4445. return new RangeError("Invalid range arguments: " + util.inspect(...args));
  4446. };
  4447. var invalidRange = (start, end, options) => {
  4448. if (options.strictRanges === true)
  4449. throw rangeError([start, end]);
  4450. return [];
  4451. };
  4452. var invalidStep = (step, options) => {
  4453. if (options.strictRanges === true) {
  4454. throw new TypeError(`Expected step "${step}" to be a number`);
  4455. }
  4456. return [];
  4457. };
  4458. var fillNumbers = (start, end, step = 1, options = {}) => {
  4459. let a = Number(start);
  4460. let b = Number(end);
  4461. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  4462. if (options.strictRanges === true)
  4463. throw rangeError([start, end]);
  4464. return [];
  4465. }
  4466. if (a === 0)
  4467. a = 0;
  4468. if (b === 0)
  4469. b = 0;
  4470. let descending = a > b;
  4471. let startString = String(start);
  4472. let endString = String(end);
  4473. let stepString = String(step);
  4474. step = Math.max(Math.abs(step), 1);
  4475. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  4476. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  4477. let toNumber = padded === false && stringify2(start, end, options) === false;
  4478. let format = options.transform || transform(toNumber);
  4479. if (options.toRegex && step === 1) {
  4480. return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
  4481. }
  4482. let parts = {
  4483. negatives: [],
  4484. positives: []
  4485. };
  4486. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  4487. let range = [];
  4488. let index = 0;
  4489. while (descending ? a >= b : a <= b) {
  4490. if (options.toRegex === true && step > 1) {
  4491. push(a);
  4492. } else {
  4493. range.push(pad(format(a, index), maxLen, toNumber));
  4494. }
  4495. a = descending ? a - step : a + step;
  4496. index++;
  4497. }
  4498. if (options.toRegex === true) {
  4499. return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
  4500. wrap: false
  4501. }, options));
  4502. }
  4503. return range;
  4504. };
  4505. var fillLetters = (start, end, step = 1, options = {}) => {
  4506. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
  4507. return invalidRange(start, end, options);
  4508. }
  4509. let format = options.transform || ((val) => String.fromCharCode(val));
  4510. let a = `${start}`.charCodeAt(0);
  4511. let b = `${end}`.charCodeAt(0);
  4512. let descending = a > b;
  4513. let min = Math.min(a, b);
  4514. let max = Math.max(a, b);
  4515. if (options.toRegex && step === 1) {
  4516. return toRange(min, max, false, options);
  4517. }
  4518. let range = [];
  4519. let index = 0;
  4520. while (descending ? a >= b : a <= b) {
  4521. range.push(format(a, index));
  4522. a = descending ? a - step : a + step;
  4523. index++;
  4524. }
  4525. if (options.toRegex === true) {
  4526. return toRegex(range, null, {
  4527. wrap: false,
  4528. options
  4529. });
  4530. }
  4531. return range;
  4532. };
  4533. var fill = (start, end, step, options = {}) => {
  4534. if (end == null && isValidValue(start)) {
  4535. return [start];
  4536. }
  4537. if (!isValidValue(start) || !isValidValue(end)) {
  4538. return invalidRange(start, end, options);
  4539. }
  4540. if (typeof step === "function") {
  4541. return fill(start, end, 1, {
  4542. transform: step
  4543. });
  4544. }
  4545. if (isObject(step)) {
  4546. return fill(start, end, 0, step);
  4547. }
  4548. let opts = Object.assign({}, options);
  4549. if (opts.capture === true)
  4550. opts.wrap = true;
  4551. step = step || opts.step || 1;
  4552. if (!isNumber(step)) {
  4553. if (step != null && !isObject(step))
  4554. return invalidStep(step, opts);
  4555. return fill(start, end, 1, step);
  4556. }
  4557. if (isNumber(start) && isNumber(end)) {
  4558. return fillNumbers(start, end, step, opts);
  4559. }
  4560. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  4561. };
  4562. module2.exports = fill;
  4563. }
  4564. });
  4565. var require_compile = __commonJS2({
  4566. "node_modules/braces/lib/compile.js"(exports2, module2) {
  4567. "use strict";
  4568. var fill = require_fill_range();
  4569. var utils = require_utils2();
  4570. var compile = (ast, options = {}) => {
  4571. let walk = (node, parent = {}) => {
  4572. let invalidBlock = utils.isInvalidBrace(parent);
  4573. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  4574. let invalid = invalidBlock === true || invalidNode === true;
  4575. let prefix = options.escapeInvalid === true ? "\\" : "";
  4576. let output = "";
  4577. if (node.isOpen === true) {
  4578. return prefix + node.value;
  4579. }
  4580. if (node.isClose === true) {
  4581. return prefix + node.value;
  4582. }
  4583. if (node.type === "open") {
  4584. return invalid ? prefix + node.value : "(";
  4585. }
  4586. if (node.type === "close") {
  4587. return invalid ? prefix + node.value : ")";
  4588. }
  4589. if (node.type === "comma") {
  4590. return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  4591. }
  4592. if (node.value) {
  4593. return node.value;
  4594. }
  4595. if (node.nodes && node.ranges > 0) {
  4596. let args = utils.reduce(node.nodes);
  4597. let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
  4598. wrap: false,
  4599. toRegex: true
  4600. }));
  4601. if (range.length !== 0) {
  4602. return args.length > 1 && range.length > 1 ? `(${range})` : range;
  4603. }
  4604. }
  4605. if (node.nodes) {
  4606. for (let child of node.nodes) {
  4607. output += walk(child, node);
  4608. }
  4609. }
  4610. return output;
  4611. };
  4612. return walk(ast);
  4613. };
  4614. module2.exports = compile;
  4615. }
  4616. });
  4617. var require_expand = __commonJS2({
  4618. "node_modules/braces/lib/expand.js"(exports2, module2) {
  4619. "use strict";
  4620. var fill = require_fill_range();
  4621. var stringify2 = require_stringify();
  4622. var utils = require_utils2();
  4623. var append = (queue = "", stash = "", enclose = false) => {
  4624. let result = [];
  4625. queue = [].concat(queue);
  4626. stash = [].concat(stash);
  4627. if (!stash.length)
  4628. return queue;
  4629. if (!queue.length) {
  4630. return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
  4631. }
  4632. for (let item of queue) {
  4633. if (Array.isArray(item)) {
  4634. for (let value of item) {
  4635. result.push(append(value, stash, enclose));
  4636. }
  4637. } else {
  4638. for (let ele of stash) {
  4639. if (enclose === true && typeof ele === "string")
  4640. ele = `{${ele}}`;
  4641. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  4642. }
  4643. }
  4644. }
  4645. return utils.flatten(result);
  4646. };
  4647. var expand = (ast, options = {}) => {
  4648. let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
  4649. let walk = (node, parent = {}) => {
  4650. node.queue = [];
  4651. let p = parent;
  4652. let q = parent.queue;
  4653. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  4654. p = p.parent;
  4655. q = p.queue;
  4656. }
  4657. if (node.invalid || node.dollar) {
  4658. q.push(append(q.pop(), stringify2(node, options)));
  4659. return;
  4660. }
  4661. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  4662. q.push(append(q.pop(), ["{}"]));
  4663. return;
  4664. }
  4665. if (node.nodes && node.ranges > 0) {
  4666. let args = utils.reduce(node.nodes);
  4667. if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
  4668. throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
  4669. }
  4670. let range = fill(...args, options);
  4671. if (range.length === 0) {
  4672. range = stringify2(node, options);
  4673. }
  4674. q.push(append(q.pop(), range));
  4675. node.nodes = [];
  4676. return;
  4677. }
  4678. let enclose = utils.encloseBrace(node);
  4679. let queue = node.queue;
  4680. let block = node;
  4681. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  4682. block = block.parent;
  4683. queue = block.queue;
  4684. }
  4685. for (let i = 0; i < node.nodes.length; i++) {
  4686. let child = node.nodes[i];
  4687. if (child.type === "comma" && node.type === "brace") {
  4688. if (i === 1)
  4689. queue.push("");
  4690. queue.push("");
  4691. continue;
  4692. }
  4693. if (child.type === "close") {
  4694. q.push(append(q.pop(), queue, enclose));
  4695. continue;
  4696. }
  4697. if (child.value && child.type !== "open") {
  4698. queue.push(append(queue.pop(), child.value));
  4699. continue;
  4700. }
  4701. if (child.nodes) {
  4702. walk(child, node);
  4703. }
  4704. }
  4705. return queue;
  4706. };
  4707. return utils.flatten(walk(ast));
  4708. };
  4709. module2.exports = expand;
  4710. }
  4711. });
  4712. var require_constants = __commonJS2({
  4713. "node_modules/braces/lib/constants.js"(exports2, module2) {
  4714. "use strict";
  4715. module2.exports = {
  4716. MAX_LENGTH: 1024 * 64,
  4717. CHAR_0: "0",
  4718. CHAR_9: "9",
  4719. CHAR_UPPERCASE_A: "A",
  4720. CHAR_LOWERCASE_A: "a",
  4721. CHAR_UPPERCASE_Z: "Z",
  4722. CHAR_LOWERCASE_Z: "z",
  4723. CHAR_LEFT_PARENTHESES: "(",
  4724. CHAR_RIGHT_PARENTHESES: ")",
  4725. CHAR_ASTERISK: "*",
  4726. CHAR_AMPERSAND: "&",
  4727. CHAR_AT: "@",
  4728. CHAR_BACKSLASH: "\\",
  4729. CHAR_BACKTICK: "`",
  4730. CHAR_CARRIAGE_RETURN: "\r",
  4731. CHAR_CIRCUMFLEX_ACCENT: "^",
  4732. CHAR_COLON: ":",
  4733. CHAR_COMMA: ",",
  4734. CHAR_DOLLAR: "$",
  4735. CHAR_DOT: ".",
  4736. CHAR_DOUBLE_QUOTE: '"',
  4737. CHAR_EQUAL: "=",
  4738. CHAR_EXCLAMATION_MARK: "!",
  4739. CHAR_FORM_FEED: "\f",
  4740. CHAR_FORWARD_SLASH: "/",
  4741. CHAR_HASH: "#",
  4742. CHAR_HYPHEN_MINUS: "-",
  4743. CHAR_LEFT_ANGLE_BRACKET: "<",
  4744. CHAR_LEFT_CURLY_BRACE: "{",
  4745. CHAR_LEFT_SQUARE_BRACKET: "[",
  4746. CHAR_LINE_FEED: "\n",
  4747. CHAR_NO_BREAK_SPACE: "\xA0",
  4748. CHAR_PERCENT: "%",
  4749. CHAR_PLUS: "+",
  4750. CHAR_QUESTION_MARK: "?",
  4751. CHAR_RIGHT_ANGLE_BRACKET: ">",
  4752. CHAR_RIGHT_CURLY_BRACE: "}",
  4753. CHAR_RIGHT_SQUARE_BRACKET: "]",
  4754. CHAR_SEMICOLON: ";",
  4755. CHAR_SINGLE_QUOTE: "'",
  4756. CHAR_SPACE: " ",
  4757. CHAR_TAB: " ",
  4758. CHAR_UNDERSCORE: "_",
  4759. CHAR_VERTICAL_LINE: "|",
  4760. CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
  4761. };
  4762. }
  4763. });
  4764. var require_parse = __commonJS2({
  4765. "node_modules/braces/lib/parse.js"(exports2, module2) {
  4766. "use strict";
  4767. var stringify2 = require_stringify();
  4768. var {
  4769. MAX_LENGTH,
  4770. CHAR_BACKSLASH,
  4771. CHAR_BACKTICK,
  4772. CHAR_COMMA,
  4773. CHAR_DOT,
  4774. CHAR_LEFT_PARENTHESES,
  4775. CHAR_RIGHT_PARENTHESES,
  4776. CHAR_LEFT_CURLY_BRACE,
  4777. CHAR_RIGHT_CURLY_BRACE,
  4778. CHAR_LEFT_SQUARE_BRACKET,
  4779. CHAR_RIGHT_SQUARE_BRACKET,
  4780. CHAR_DOUBLE_QUOTE,
  4781. CHAR_SINGLE_QUOTE,
  4782. CHAR_NO_BREAK_SPACE,
  4783. CHAR_ZERO_WIDTH_NOBREAK_SPACE
  4784. } = require_constants();
  4785. var parse = (input, options = {}) => {
  4786. if (typeof input !== "string") {
  4787. throw new TypeError("Expected a string");
  4788. }
  4789. let opts = options || {};
  4790. let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  4791. if (input.length > max) {
  4792. throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  4793. }
  4794. let ast = {
  4795. type: "root",
  4796. input,
  4797. nodes: []
  4798. };
  4799. let stack = [ast];
  4800. let block = ast;
  4801. let prev = ast;
  4802. let brackets = 0;
  4803. let length = input.length;
  4804. let index = 0;
  4805. let depth = 0;
  4806. let value;
  4807. let memo = {};
  4808. const advance = () => input[index++];
  4809. const push = (node) => {
  4810. if (node.type === "text" && prev.type === "dot") {
  4811. prev.type = "text";
  4812. }
  4813. if (prev && prev.type === "text" && node.type === "text") {
  4814. prev.value += node.value;
  4815. return;
  4816. }
  4817. block.nodes.push(node);
  4818. node.parent = block;
  4819. node.prev = prev;
  4820. prev = node;
  4821. return node;
  4822. };
  4823. push({
  4824. type: "bos"
  4825. });
  4826. while (index < length) {
  4827. block = stack[stack.length - 1];
  4828. value = advance();
  4829. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
  4830. continue;
  4831. }
  4832. if (value === CHAR_BACKSLASH) {
  4833. push({
  4834. type: "text",
  4835. value: (options.keepEscaping ? value : "") + advance()
  4836. });
  4837. continue;
  4838. }
  4839. if (value === CHAR_RIGHT_SQUARE_BRACKET) {
  4840. push({
  4841. type: "text",
  4842. value: "\\" + value
  4843. });
  4844. continue;
  4845. }
  4846. if (value === CHAR_LEFT_SQUARE_BRACKET) {
  4847. brackets++;
  4848. let closed = true;
  4849. let next;
  4850. while (index < length && (next = advance())) {
  4851. value += next;
  4852. if (next === CHAR_LEFT_SQUARE_BRACKET) {
  4853. brackets++;
  4854. continue;
  4855. }
  4856. if (next === CHAR_BACKSLASH) {
  4857. value += advance();
  4858. continue;
  4859. }
  4860. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  4861. brackets--;
  4862. if (brackets === 0) {
  4863. break;
  4864. }
  4865. }
  4866. }
  4867. push({
  4868. type: "text",
  4869. value
  4870. });
  4871. continue;
  4872. }
  4873. if (value === CHAR_LEFT_PARENTHESES) {
  4874. block = push({
  4875. type: "paren",
  4876. nodes: []
  4877. });
  4878. stack.push(block);
  4879. push({
  4880. type: "text",
  4881. value
  4882. });
  4883. continue;
  4884. }
  4885. if (value === CHAR_RIGHT_PARENTHESES) {
  4886. if (block.type !== "paren") {
  4887. push({
  4888. type: "text",
  4889. value
  4890. });
  4891. continue;
  4892. }
  4893. block = stack.pop();
  4894. push({
  4895. type: "text",
  4896. value
  4897. });
  4898. block = stack[stack.length - 1];
  4899. continue;
  4900. }
  4901. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  4902. let open = value;
  4903. let next;
  4904. if (options.keepQuotes !== true) {
  4905. value = "";
  4906. }
  4907. while (index < length && (next = advance())) {
  4908. if (next === CHAR_BACKSLASH) {
  4909. value += next + advance();
  4910. continue;
  4911. }
  4912. if (next === open) {
  4913. if (options.keepQuotes === true)
  4914. value += next;
  4915. break;
  4916. }
  4917. value += next;
  4918. }
  4919. push({
  4920. type: "text",
  4921. value
  4922. });
  4923. continue;
  4924. }
  4925. if (value === CHAR_LEFT_CURLY_BRACE) {
  4926. depth++;
  4927. let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
  4928. let brace = {
  4929. type: "brace",
  4930. open: true,
  4931. close: false,
  4932. dollar,
  4933. depth,
  4934. commas: 0,
  4935. ranges: 0,
  4936. nodes: []
  4937. };
  4938. block = push(brace);
  4939. stack.push(block);
  4940. push({
  4941. type: "open",
  4942. value
  4943. });
  4944. continue;
  4945. }
  4946. if (value === CHAR_RIGHT_CURLY_BRACE) {
  4947. if (block.type !== "brace") {
  4948. push({
  4949. type: "text",
  4950. value
  4951. });
  4952. continue;
  4953. }
  4954. let type = "close";
  4955. block = stack.pop();
  4956. block.close = true;
  4957. push({
  4958. type,
  4959. value
  4960. });
  4961. depth--;
  4962. block = stack[stack.length - 1];
  4963. continue;
  4964. }
  4965. if (value === CHAR_COMMA && depth > 0) {
  4966. if (block.ranges > 0) {
  4967. block.ranges = 0;
  4968. let open = block.nodes.shift();
  4969. block.nodes = [open, {
  4970. type: "text",
  4971. value: stringify2(block)
  4972. }];
  4973. }
  4974. push({
  4975. type: "comma",
  4976. value
  4977. });
  4978. block.commas++;
  4979. continue;
  4980. }
  4981. if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
  4982. let siblings = block.nodes;
  4983. if (depth === 0 || siblings.length === 0) {
  4984. push({
  4985. type: "text",
  4986. value
  4987. });
  4988. continue;
  4989. }
  4990. if (prev.type === "dot") {
  4991. block.range = [];
  4992. prev.value += value;
  4993. prev.type = "range";
  4994. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  4995. block.invalid = true;
  4996. block.ranges = 0;
  4997. prev.type = "text";
  4998. continue;
  4999. }
  5000. block.ranges++;
  5001. block.args = [];
  5002. continue;
  5003. }
  5004. if (prev.type === "range") {
  5005. siblings.pop();
  5006. let before = siblings[siblings.length - 1];
  5007. before.value += prev.value + value;
  5008. prev = before;
  5009. block.ranges--;
  5010. continue;
  5011. }
  5012. push({
  5013. type: "dot",
  5014. value
  5015. });
  5016. continue;
  5017. }
  5018. push({
  5019. type: "text",
  5020. value
  5021. });
  5022. }
  5023. do {
  5024. block = stack.pop();
  5025. if (block.type !== "root") {
  5026. block.nodes.forEach((node) => {
  5027. if (!node.nodes) {
  5028. if (node.type === "open")
  5029. node.isOpen = true;
  5030. if (node.type === "close")
  5031. node.isClose = true;
  5032. if (!node.nodes)
  5033. node.type = "text";
  5034. node.invalid = true;
  5035. }
  5036. });
  5037. let parent = stack[stack.length - 1];
  5038. let index2 = parent.nodes.indexOf(block);
  5039. parent.nodes.splice(index2, 1, ...block.nodes);
  5040. }
  5041. } while (stack.length > 0);
  5042. push({
  5043. type: "eos"
  5044. });
  5045. return ast;
  5046. };
  5047. module2.exports = parse;
  5048. }
  5049. });
  5050. var require_braces = __commonJS2({
  5051. "node_modules/braces/index.js"(exports2, module2) {
  5052. "use strict";
  5053. var stringify2 = require_stringify();
  5054. var compile = require_compile();
  5055. var expand = require_expand();
  5056. var parse = require_parse();
  5057. var braces = (input, options = {}) => {
  5058. let output = [];
  5059. if (Array.isArray(input)) {
  5060. for (let pattern of input) {
  5061. let result = braces.create(pattern, options);
  5062. if (Array.isArray(result)) {
  5063. output.push(...result);
  5064. } else {
  5065. output.push(result);
  5066. }
  5067. }
  5068. } else {
  5069. output = [].concat(braces.create(input, options));
  5070. }
  5071. if (options && options.expand === true && options.nodupes === true) {
  5072. output = [...new Set(output)];
  5073. }
  5074. return output;
  5075. };
  5076. braces.parse = (input, options = {}) => parse(input, options);
  5077. braces.stringify = (input, options = {}) => {
  5078. if (typeof input === "string") {
  5079. return stringify2(braces.parse(input, options), options);
  5080. }
  5081. return stringify2(input, options);
  5082. };
  5083. braces.compile = (input, options = {}) => {
  5084. if (typeof input === "string") {
  5085. input = braces.parse(input, options);
  5086. }
  5087. return compile(input, options);
  5088. };
  5089. braces.expand = (input, options = {}) => {
  5090. if (typeof input === "string") {
  5091. input = braces.parse(input, options);
  5092. }
  5093. let result = expand(input, options);
  5094. if (options.noempty === true) {
  5095. result = result.filter(Boolean);
  5096. }
  5097. if (options.nodupes === true) {
  5098. result = [...new Set(result)];
  5099. }
  5100. return result;
  5101. };
  5102. braces.create = (input, options = {}) => {
  5103. if (input === "" || input.length < 3) {
  5104. return [input];
  5105. }
  5106. return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
  5107. };
  5108. module2.exports = braces;
  5109. }
  5110. });
  5111. var require_constants2 = __commonJS2({
  5112. "node_modules/picomatch/lib/constants.js"(exports2, module2) {
  5113. "use strict";
  5114. var path = require("path");
  5115. var WIN_SLASH = "\\\\/";
  5116. var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  5117. var DOT_LITERAL = "\\.";
  5118. var PLUS_LITERAL = "\\+";
  5119. var QMARK_LITERAL = "\\?";
  5120. var SLASH_LITERAL = "\\/";
  5121. var ONE_CHAR = "(?=.)";
  5122. var QMARK = "[^/]";
  5123. var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  5124. var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  5125. var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  5126. var NO_DOT = `(?!${DOT_LITERAL})`;
  5127. var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  5128. var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  5129. var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  5130. var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  5131. var STAR = `${QMARK}*?`;
  5132. var POSIX_CHARS = {
  5133. DOT_LITERAL,
  5134. PLUS_LITERAL,
  5135. QMARK_LITERAL,
  5136. SLASH_LITERAL,
  5137. ONE_CHAR,
  5138. QMARK,
  5139. END_ANCHOR,
  5140. DOTS_SLASH,
  5141. NO_DOT,
  5142. NO_DOTS,
  5143. NO_DOT_SLASH,
  5144. NO_DOTS_SLASH,
  5145. QMARK_NO_DOT,
  5146. STAR,
  5147. START_ANCHOR
  5148. };
  5149. var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
  5150. SLASH_LITERAL: `[${WIN_SLASH}]`,
  5151. QMARK: WIN_NO_SLASH,
  5152. STAR: `${WIN_NO_SLASH}*?`,
  5153. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  5154. NO_DOT: `(?!${DOT_LITERAL})`,
  5155. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  5156. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  5157. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  5158. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  5159. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  5160. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  5161. });
  5162. var POSIX_REGEX_SOURCE = {
  5163. alnum: "a-zA-Z0-9",
  5164. alpha: "a-zA-Z",
  5165. ascii: "\\x00-\\x7F",
  5166. blank: " \\t",
  5167. cntrl: "\\x00-\\x1F\\x7F",
  5168. digit: "0-9",
  5169. graph: "\\x21-\\x7E",
  5170. lower: "a-z",
  5171. print: "\\x20-\\x7E ",
  5172. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  5173. space: " \\t\\r\\n\\v\\f",
  5174. upper: "A-Z",
  5175. word: "A-Za-z0-9_",
  5176. xdigit: "A-Fa-f0-9"
  5177. };
  5178. module2.exports = {
  5179. MAX_LENGTH: 1024 * 64,
  5180. POSIX_REGEX_SOURCE,
  5181. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  5182. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  5183. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  5184. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  5185. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  5186. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  5187. REPLACEMENTS: {
  5188. "***": "*",
  5189. "**/**": "**",
  5190. "**/**/**": "**"
  5191. },
  5192. CHAR_0: 48,
  5193. CHAR_9: 57,
  5194. CHAR_UPPERCASE_A: 65,
  5195. CHAR_LOWERCASE_A: 97,
  5196. CHAR_UPPERCASE_Z: 90,
  5197. CHAR_LOWERCASE_Z: 122,
  5198. CHAR_LEFT_PARENTHESES: 40,
  5199. CHAR_RIGHT_PARENTHESES: 41,
  5200. CHAR_ASTERISK: 42,
  5201. CHAR_AMPERSAND: 38,
  5202. CHAR_AT: 64,
  5203. CHAR_BACKWARD_SLASH: 92,
  5204. CHAR_CARRIAGE_RETURN: 13,
  5205. CHAR_CIRCUMFLEX_ACCENT: 94,
  5206. CHAR_COLON: 58,
  5207. CHAR_COMMA: 44,
  5208. CHAR_DOT: 46,
  5209. CHAR_DOUBLE_QUOTE: 34,
  5210. CHAR_EQUAL: 61,
  5211. CHAR_EXCLAMATION_MARK: 33,
  5212. CHAR_FORM_FEED: 12,
  5213. CHAR_FORWARD_SLASH: 47,
  5214. CHAR_GRAVE_ACCENT: 96,
  5215. CHAR_HASH: 35,
  5216. CHAR_HYPHEN_MINUS: 45,
  5217. CHAR_LEFT_ANGLE_BRACKET: 60,
  5218. CHAR_LEFT_CURLY_BRACE: 123,
  5219. CHAR_LEFT_SQUARE_BRACKET: 91,
  5220. CHAR_LINE_FEED: 10,
  5221. CHAR_NO_BREAK_SPACE: 160,
  5222. CHAR_PERCENT: 37,
  5223. CHAR_PLUS: 43,
  5224. CHAR_QUESTION_MARK: 63,
  5225. CHAR_RIGHT_ANGLE_BRACKET: 62,
  5226. CHAR_RIGHT_CURLY_BRACE: 125,
  5227. CHAR_RIGHT_SQUARE_BRACKET: 93,
  5228. CHAR_SEMICOLON: 59,
  5229. CHAR_SINGLE_QUOTE: 39,
  5230. CHAR_SPACE: 32,
  5231. CHAR_TAB: 9,
  5232. CHAR_UNDERSCORE: 95,
  5233. CHAR_VERTICAL_LINE: 124,
  5234. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  5235. SEP: path.sep,
  5236. extglobChars(chars) {
  5237. return {
  5238. "!": {
  5239. type: "negate",
  5240. open: "(?:(?!(?:",
  5241. close: `))${chars.STAR})`
  5242. },
  5243. "?": {
  5244. type: "qmark",
  5245. open: "(?:",
  5246. close: ")?"
  5247. },
  5248. "+": {
  5249. type: "plus",
  5250. open: "(?:",
  5251. close: ")+"
  5252. },
  5253. "*": {
  5254. type: "star",
  5255. open: "(?:",
  5256. close: ")*"
  5257. },
  5258. "@": {
  5259. type: "at",
  5260. open: "(?:",
  5261. close: ")"
  5262. }
  5263. };
  5264. },
  5265. globChars(win32) {
  5266. return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  5267. }
  5268. };
  5269. }
  5270. });
  5271. var require_utils3 = __commonJS2({
  5272. "node_modules/picomatch/lib/utils.js"(exports2) {
  5273. "use strict";
  5274. var path = require("path");
  5275. var win32 = process.platform === "win32";
  5276. var {
  5277. REGEX_BACKSLASH,
  5278. REGEX_REMOVE_BACKSLASH,
  5279. REGEX_SPECIAL_CHARS,
  5280. REGEX_SPECIAL_CHARS_GLOBAL
  5281. } = require_constants2();
  5282. exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  5283. exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  5284. exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
  5285. exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  5286. exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  5287. exports2.removeBackslashes = (str) => {
  5288. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  5289. return match === "\\" ? "" : match;
  5290. });
  5291. };
  5292. exports2.supportsLookbehinds = () => {
  5293. const segs = process.version.slice(1).split(".").map(Number);
  5294. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
  5295. return true;
  5296. }
  5297. return false;
  5298. };
  5299. exports2.isWindows = (options) => {
  5300. if (options && typeof options.windows === "boolean") {
  5301. return options.windows;
  5302. }
  5303. return win32 === true || path.sep === "\\";
  5304. };
  5305. exports2.escapeLast = (input, char, lastIdx) => {
  5306. const idx = input.lastIndexOf(char, lastIdx);
  5307. if (idx === -1)
  5308. return input;
  5309. if (input[idx - 1] === "\\")
  5310. return exports2.escapeLast(input, char, idx - 1);
  5311. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  5312. };
  5313. exports2.removePrefix = (input, state = {}) => {
  5314. let output = input;
  5315. if (output.startsWith("./")) {
  5316. output = output.slice(2);
  5317. state.prefix = "./";
  5318. }
  5319. return output;
  5320. };
  5321. exports2.wrapOutput = (input, state = {}, options = {}) => {
  5322. const prepend = options.contains ? "" : "^";
  5323. const append = options.contains ? "" : "$";
  5324. let output = `${prepend}(?:${input})${append}`;
  5325. if (state.negated === true) {
  5326. output = `(?:^(?!${output}).*$)`;
  5327. }
  5328. return output;
  5329. };
  5330. }
  5331. });
  5332. var require_scan = __commonJS2({
  5333. "node_modules/picomatch/lib/scan.js"(exports2, module2) {
  5334. "use strict";
  5335. var utils = require_utils3();
  5336. var {
  5337. CHAR_ASTERISK,
  5338. CHAR_AT,
  5339. CHAR_BACKWARD_SLASH,
  5340. CHAR_COMMA,
  5341. CHAR_DOT,
  5342. CHAR_EXCLAMATION_MARK,
  5343. CHAR_FORWARD_SLASH,
  5344. CHAR_LEFT_CURLY_BRACE,
  5345. CHAR_LEFT_PARENTHESES,
  5346. CHAR_LEFT_SQUARE_BRACKET,
  5347. CHAR_PLUS,
  5348. CHAR_QUESTION_MARK,
  5349. CHAR_RIGHT_CURLY_BRACE,
  5350. CHAR_RIGHT_PARENTHESES,
  5351. CHAR_RIGHT_SQUARE_BRACKET
  5352. } = require_constants2();
  5353. var isPathSeparator = (code) => {
  5354. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  5355. };
  5356. var depth = (token) => {
  5357. if (token.isPrefix !== true) {
  5358. token.depth = token.isGlobstar ? Infinity : 1;
  5359. }
  5360. };
  5361. var scan = (input, options) => {
  5362. const opts = options || {};
  5363. const length = input.length - 1;
  5364. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  5365. const slashes = [];
  5366. const tokens = [];
  5367. const parts = [];
  5368. let str = input;
  5369. let index = -1;
  5370. let start = 0;
  5371. let lastIndex = 0;
  5372. let isBrace = false;
  5373. let isBracket = false;
  5374. let isGlob = false;
  5375. let isExtglob = false;
  5376. let isGlobstar = false;
  5377. let braceEscaped = false;
  5378. let backslashes = false;
  5379. let negated = false;
  5380. let negatedExtglob = false;
  5381. let finished = false;
  5382. let braces = 0;
  5383. let prev;
  5384. let code;
  5385. let token = {
  5386. value: "",
  5387. depth: 0,
  5388. isGlob: false
  5389. };
  5390. const eos = () => index >= length;
  5391. const peek = () => str.charCodeAt(index + 1);
  5392. const advance = () => {
  5393. prev = code;
  5394. return str.charCodeAt(++index);
  5395. };
  5396. while (index < length) {
  5397. code = advance();
  5398. let next;
  5399. if (code === CHAR_BACKWARD_SLASH) {
  5400. backslashes = token.backslashes = true;
  5401. code = advance();
  5402. if (code === CHAR_LEFT_CURLY_BRACE) {
  5403. braceEscaped = true;
  5404. }
  5405. continue;
  5406. }
  5407. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  5408. braces++;
  5409. while (eos() !== true && (code = advance())) {
  5410. if (code === CHAR_BACKWARD_SLASH) {
  5411. backslashes = token.backslashes = true;
  5412. advance();
  5413. continue;
  5414. }
  5415. if (code === CHAR_LEFT_CURLY_BRACE) {
  5416. braces++;
  5417. continue;
  5418. }
  5419. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  5420. isBrace = token.isBrace = true;
  5421. isGlob = token.isGlob = true;
  5422. finished = true;
  5423. if (scanToEnd === true) {
  5424. continue;
  5425. }
  5426. break;
  5427. }
  5428. if (braceEscaped !== true && code === CHAR_COMMA) {
  5429. isBrace = token.isBrace = true;
  5430. isGlob = token.isGlob = true;
  5431. finished = true;
  5432. if (scanToEnd === true) {
  5433. continue;
  5434. }
  5435. break;
  5436. }
  5437. if (code === CHAR_RIGHT_CURLY_BRACE) {
  5438. braces--;
  5439. if (braces === 0) {
  5440. braceEscaped = false;
  5441. isBrace = token.isBrace = true;
  5442. finished = true;
  5443. break;
  5444. }
  5445. }
  5446. }
  5447. if (scanToEnd === true) {
  5448. continue;
  5449. }
  5450. break;
  5451. }
  5452. if (code === CHAR_FORWARD_SLASH) {
  5453. slashes.push(index);
  5454. tokens.push(token);
  5455. token = {
  5456. value: "",
  5457. depth: 0,
  5458. isGlob: false
  5459. };
  5460. if (finished === true)
  5461. continue;
  5462. if (prev === CHAR_DOT && index === start + 1) {
  5463. start += 2;
  5464. continue;
  5465. }
  5466. lastIndex = index + 1;
  5467. continue;
  5468. }
  5469. if (opts.noext !== true) {
  5470. const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
  5471. if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
  5472. isGlob = token.isGlob = true;
  5473. isExtglob = token.isExtglob = true;
  5474. finished = true;
  5475. if (code === CHAR_EXCLAMATION_MARK && index === start) {
  5476. negatedExtglob = true;
  5477. }
  5478. if (scanToEnd === true) {
  5479. while (eos() !== true && (code = advance())) {
  5480. if (code === CHAR_BACKWARD_SLASH) {
  5481. backslashes = token.backslashes = true;
  5482. code = advance();
  5483. continue;
  5484. }
  5485. if (code === CHAR_RIGHT_PARENTHESES) {
  5486. isGlob = token.isGlob = true;
  5487. finished = true;
  5488. break;
  5489. }
  5490. }
  5491. continue;
  5492. }
  5493. break;
  5494. }
  5495. }
  5496. if (code === CHAR_ASTERISK) {
  5497. if (prev === CHAR_ASTERISK)
  5498. isGlobstar = token.isGlobstar = true;
  5499. isGlob = token.isGlob = true;
  5500. finished = true;
  5501. if (scanToEnd === true) {
  5502. continue;
  5503. }
  5504. break;
  5505. }
  5506. if (code === CHAR_QUESTION_MARK) {
  5507. isGlob = token.isGlob = true;
  5508. finished = true;
  5509. if (scanToEnd === true) {
  5510. continue;
  5511. }
  5512. break;
  5513. }
  5514. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  5515. while (eos() !== true && (next = advance())) {
  5516. if (next === CHAR_BACKWARD_SLASH) {
  5517. backslashes = token.backslashes = true;
  5518. advance();
  5519. continue;
  5520. }
  5521. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  5522. isBracket = token.isBracket = true;
  5523. isGlob = token.isGlob = true;
  5524. finished = true;
  5525. break;
  5526. }
  5527. }
  5528. if (scanToEnd === true) {
  5529. continue;
  5530. }
  5531. break;
  5532. }
  5533. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  5534. negated = token.negated = true;
  5535. start++;
  5536. continue;
  5537. }
  5538. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  5539. isGlob = token.isGlob = true;
  5540. if (scanToEnd === true) {
  5541. while (eos() !== true && (code = advance())) {
  5542. if (code === CHAR_LEFT_PARENTHESES) {
  5543. backslashes = token.backslashes = true;
  5544. code = advance();
  5545. continue;
  5546. }
  5547. if (code === CHAR_RIGHT_PARENTHESES) {
  5548. finished = true;
  5549. break;
  5550. }
  5551. }
  5552. continue;
  5553. }
  5554. break;
  5555. }
  5556. if (isGlob === true) {
  5557. finished = true;
  5558. if (scanToEnd === true) {
  5559. continue;
  5560. }
  5561. break;
  5562. }
  5563. }
  5564. if (opts.noext === true) {
  5565. isExtglob = false;
  5566. isGlob = false;
  5567. }
  5568. let base = str;
  5569. let prefix = "";
  5570. let glob = "";
  5571. if (start > 0) {
  5572. prefix = str.slice(0, start);
  5573. str = str.slice(start);
  5574. lastIndex -= start;
  5575. }
  5576. if (base && isGlob === true && lastIndex > 0) {
  5577. base = str.slice(0, lastIndex);
  5578. glob = str.slice(lastIndex);
  5579. } else if (isGlob === true) {
  5580. base = "";
  5581. glob = str;
  5582. } else {
  5583. base = str;
  5584. }
  5585. if (base && base !== "" && base !== "/" && base !== str) {
  5586. if (isPathSeparator(base.charCodeAt(base.length - 1))) {
  5587. base = base.slice(0, -1);
  5588. }
  5589. }
  5590. if (opts.unescape === true) {
  5591. if (glob)
  5592. glob = utils.removeBackslashes(glob);
  5593. if (base && backslashes === true) {
  5594. base = utils.removeBackslashes(base);
  5595. }
  5596. }
  5597. const state = {
  5598. prefix,
  5599. input,
  5600. start,
  5601. base,
  5602. glob,
  5603. isBrace,
  5604. isBracket,
  5605. isGlob,
  5606. isExtglob,
  5607. isGlobstar,
  5608. negated,
  5609. negatedExtglob
  5610. };
  5611. if (opts.tokens === true) {
  5612. state.maxDepth = 0;
  5613. if (!isPathSeparator(code)) {
  5614. tokens.push(token);
  5615. }
  5616. state.tokens = tokens;
  5617. }
  5618. if (opts.parts === true || opts.tokens === true) {
  5619. let prevIndex;
  5620. for (let idx = 0; idx < slashes.length; idx++) {
  5621. const n = prevIndex ? prevIndex + 1 : start;
  5622. const i = slashes[idx];
  5623. const value = input.slice(n, i);
  5624. if (opts.tokens) {
  5625. if (idx === 0 && start !== 0) {
  5626. tokens[idx].isPrefix = true;
  5627. tokens[idx].value = prefix;
  5628. } else {
  5629. tokens[idx].value = value;
  5630. }
  5631. depth(tokens[idx]);
  5632. state.maxDepth += tokens[idx].depth;
  5633. }
  5634. if (idx !== 0 || value !== "") {
  5635. parts.push(value);
  5636. }
  5637. prevIndex = i;
  5638. }
  5639. if (prevIndex && prevIndex + 1 < input.length) {
  5640. const value = input.slice(prevIndex + 1);
  5641. parts.push(value);
  5642. if (opts.tokens) {
  5643. tokens[tokens.length - 1].value = value;
  5644. depth(tokens[tokens.length - 1]);
  5645. state.maxDepth += tokens[tokens.length - 1].depth;
  5646. }
  5647. }
  5648. state.slashes = slashes;
  5649. state.parts = parts;
  5650. }
  5651. return state;
  5652. };
  5653. module2.exports = scan;
  5654. }
  5655. });
  5656. var require_parse2 = __commonJS2({
  5657. "node_modules/picomatch/lib/parse.js"(exports2, module2) {
  5658. "use strict";
  5659. var constants = require_constants2();
  5660. var utils = require_utils3();
  5661. var {
  5662. MAX_LENGTH,
  5663. POSIX_REGEX_SOURCE,
  5664. REGEX_NON_SPECIAL_CHARS,
  5665. REGEX_SPECIAL_CHARS_BACKREF,
  5666. REPLACEMENTS
  5667. } = constants;
  5668. var expandRange = (args, options) => {
  5669. if (typeof options.expandRange === "function") {
  5670. return options.expandRange(...args, options);
  5671. }
  5672. args.sort();
  5673. const value = `[${args.join("-")}]`;
  5674. try {
  5675. new RegExp(value);
  5676. } catch (ex) {
  5677. return args.map((v) => utils.escapeRegex(v)).join("..");
  5678. }
  5679. return value;
  5680. };
  5681. var syntaxError = (type, char) => {
  5682. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  5683. };
  5684. var parse = (input, options) => {
  5685. if (typeof input !== "string") {
  5686. throw new TypeError("Expected a string");
  5687. }
  5688. input = REPLACEMENTS[input] || input;
  5689. const opts = Object.assign({}, options);
  5690. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  5691. let len = input.length;
  5692. if (len > max) {
  5693. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  5694. }
  5695. const bos = {
  5696. type: "bos",
  5697. value: "",
  5698. output: opts.prepend || ""
  5699. };
  5700. const tokens = [bos];
  5701. const capture = opts.capture ? "" : "?:";
  5702. const win32 = utils.isWindows(options);
  5703. const PLATFORM_CHARS = constants.globChars(win32);
  5704. const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
  5705. const {
  5706. DOT_LITERAL,
  5707. PLUS_LITERAL,
  5708. SLASH_LITERAL,
  5709. ONE_CHAR,
  5710. DOTS_SLASH,
  5711. NO_DOT,
  5712. NO_DOT_SLASH,
  5713. NO_DOTS_SLASH,
  5714. QMARK,
  5715. QMARK_NO_DOT,
  5716. STAR,
  5717. START_ANCHOR
  5718. } = PLATFORM_CHARS;
  5719. const globstar = (opts2) => {
  5720. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  5721. };
  5722. const nodot = opts.dot ? "" : NO_DOT;
  5723. const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  5724. let star = opts.bash === true ? globstar(opts) : STAR;
  5725. if (opts.capture) {
  5726. star = `(${star})`;
  5727. }
  5728. if (typeof opts.noext === "boolean") {
  5729. opts.noextglob = opts.noext;
  5730. }
  5731. const state = {
  5732. input,
  5733. index: -1,
  5734. start: 0,
  5735. dot: opts.dot === true,
  5736. consumed: "",
  5737. output: "",
  5738. prefix: "",
  5739. backtrack: false,
  5740. negated: false,
  5741. brackets: 0,
  5742. braces: 0,
  5743. parens: 0,
  5744. quotes: 0,
  5745. globstar: false,
  5746. tokens
  5747. };
  5748. input = utils.removePrefix(input, state);
  5749. len = input.length;
  5750. const extglobs = [];
  5751. const braces = [];
  5752. const stack = [];
  5753. let prev = bos;
  5754. let value;
  5755. const eos = () => state.index === len - 1;
  5756. const peek = state.peek = (n = 1) => input[state.index + n];
  5757. const advance = state.advance = () => input[++state.index] || "";
  5758. const remaining = () => input.slice(state.index + 1);
  5759. const consume = (value2 = "", num = 0) => {
  5760. state.consumed += value2;
  5761. state.index += num;
  5762. };
  5763. const append = (token) => {
  5764. state.output += token.output != null ? token.output : token.value;
  5765. consume(token.value);
  5766. };
  5767. const negate = () => {
  5768. let count = 1;
  5769. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  5770. advance();
  5771. state.start++;
  5772. count++;
  5773. }
  5774. if (count % 2 === 0) {
  5775. return false;
  5776. }
  5777. state.negated = true;
  5778. state.start++;
  5779. return true;
  5780. };
  5781. const increment = (type) => {
  5782. state[type]++;
  5783. stack.push(type);
  5784. };
  5785. const decrement = (type) => {
  5786. state[type]--;
  5787. stack.pop();
  5788. };
  5789. const push = (tok) => {
  5790. if (prev.type === "globstar") {
  5791. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  5792. const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  5793. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
  5794. state.output = state.output.slice(0, -prev.output.length);
  5795. prev.type = "star";
  5796. prev.value = "*";
  5797. prev.output = star;
  5798. state.output += prev.output;
  5799. }
  5800. }
  5801. if (extglobs.length && tok.type !== "paren") {
  5802. extglobs[extglobs.length - 1].inner += tok.value;
  5803. }
  5804. if (tok.value || tok.output)
  5805. append(tok);
  5806. if (prev && prev.type === "text" && tok.type === "text") {
  5807. prev.value += tok.value;
  5808. prev.output = (prev.output || "") + tok.value;
  5809. return;
  5810. }
  5811. tok.prev = prev;
  5812. tokens.push(tok);
  5813. prev = tok;
  5814. };
  5815. const extglobOpen = (type, value2) => {
  5816. const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
  5817. conditions: 1,
  5818. inner: ""
  5819. });
  5820. token.prev = prev;
  5821. token.parens = state.parens;
  5822. token.output = state.output;
  5823. const output = (opts.capture ? "(" : "") + token.open;
  5824. increment("parens");
  5825. push({
  5826. type,
  5827. value: value2,
  5828. output: state.output ? "" : ONE_CHAR
  5829. });
  5830. push({
  5831. type: "paren",
  5832. extglob: true,
  5833. value: advance(),
  5834. output
  5835. });
  5836. extglobs.push(token);
  5837. };
  5838. const extglobClose = (token) => {
  5839. let output = token.close + (opts.capture ? ")" : "");
  5840. let rest;
  5841. if (token.type === "negate") {
  5842. let extglobStar = star;
  5843. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
  5844. extglobStar = globstar(opts);
  5845. }
  5846. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
  5847. output = token.close = `)$))${extglobStar}`;
  5848. }
  5849. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
  5850. const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
  5851. fastpaths: false
  5852. })).output;
  5853. output = token.close = `)${expression})${extglobStar})`;
  5854. }
  5855. if (token.prev.type === "bos") {
  5856. state.negatedExtglob = true;
  5857. }
  5858. }
  5859. push({
  5860. type: "paren",
  5861. extglob: true,
  5862. value,
  5863. output
  5864. });
  5865. decrement("parens");
  5866. };
  5867. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  5868. let backslashes = false;
  5869. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
  5870. if (first === "\\") {
  5871. backslashes = true;
  5872. return m;
  5873. }
  5874. if (first === "?") {
  5875. if (esc) {
  5876. return esc + first + (rest ? QMARK.repeat(rest.length) : "");
  5877. }
  5878. if (index === 0) {
  5879. return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
  5880. }
  5881. return QMARK.repeat(chars.length);
  5882. }
  5883. if (first === ".") {
  5884. return DOT_LITERAL.repeat(chars.length);
  5885. }
  5886. if (first === "*") {
  5887. if (esc) {
  5888. return esc + first + (rest ? star : "");
  5889. }
  5890. return star;
  5891. }
  5892. return esc ? m : `\\${m}`;
  5893. });
  5894. if (backslashes === true) {
  5895. if (opts.unescape === true) {
  5896. output = output.replace(/\\/g, "");
  5897. } else {
  5898. output = output.replace(/\\+/g, (m) => {
  5899. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  5900. });
  5901. }
  5902. }
  5903. if (output === input && opts.contains === true) {
  5904. state.output = input;
  5905. return state;
  5906. }
  5907. state.output = utils.wrapOutput(output, state, options);
  5908. return state;
  5909. }
  5910. while (!eos()) {
  5911. value = advance();
  5912. if (value === "\0") {
  5913. continue;
  5914. }
  5915. if (value === "\\") {
  5916. const next = peek();
  5917. if (next === "/" && opts.bash !== true) {
  5918. continue;
  5919. }
  5920. if (next === "." || next === ";") {
  5921. continue;
  5922. }
  5923. if (!next) {
  5924. value += "\\";
  5925. push({
  5926. type: "text",
  5927. value
  5928. });
  5929. continue;
  5930. }
  5931. const match = /^\\+/.exec(remaining());
  5932. let slashes = 0;
  5933. if (match && match[0].length > 2) {
  5934. slashes = match[0].length;
  5935. state.index += slashes;
  5936. if (slashes % 2 !== 0) {
  5937. value += "\\";
  5938. }
  5939. }
  5940. if (opts.unescape === true) {
  5941. value = advance();
  5942. } else {
  5943. value += advance();
  5944. }
  5945. if (state.brackets === 0) {
  5946. push({
  5947. type: "text",
  5948. value
  5949. });
  5950. continue;
  5951. }
  5952. }
  5953. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  5954. if (opts.posix !== false && value === ":") {
  5955. const inner = prev.value.slice(1);
  5956. if (inner.includes("[")) {
  5957. prev.posix = true;
  5958. if (inner.includes(":")) {
  5959. const idx = prev.value.lastIndexOf("[");
  5960. const pre = prev.value.slice(0, idx);
  5961. const rest2 = prev.value.slice(idx + 2);
  5962. const posix = POSIX_REGEX_SOURCE[rest2];
  5963. if (posix) {
  5964. prev.value = pre + posix;
  5965. state.backtrack = true;
  5966. advance();
  5967. if (!bos.output && tokens.indexOf(prev) === 1) {
  5968. bos.output = ONE_CHAR;
  5969. }
  5970. continue;
  5971. }
  5972. }
  5973. }
  5974. }
  5975. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
  5976. value = `\\${value}`;
  5977. }
  5978. if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
  5979. value = `\\${value}`;
  5980. }
  5981. if (opts.posix === true && value === "!" && prev.value === "[") {
  5982. value = "^";
  5983. }
  5984. prev.value += value;
  5985. append({
  5986. value
  5987. });
  5988. continue;
  5989. }
  5990. if (state.quotes === 1 && value !== '"') {
  5991. value = utils.escapeRegex(value);
  5992. prev.value += value;
  5993. append({
  5994. value
  5995. });
  5996. continue;
  5997. }
  5998. if (value === '"') {
  5999. state.quotes = state.quotes === 1 ? 0 : 1;
  6000. if (opts.keepQuotes === true) {
  6001. push({
  6002. type: "text",
  6003. value
  6004. });
  6005. }
  6006. continue;
  6007. }
  6008. if (value === "(") {
  6009. increment("parens");
  6010. push({
  6011. type: "paren",
  6012. value
  6013. });
  6014. continue;
  6015. }
  6016. if (value === ")") {
  6017. if (state.parens === 0 && opts.strictBrackets === true) {
  6018. throw new SyntaxError(syntaxError("opening", "("));
  6019. }
  6020. const extglob = extglobs[extglobs.length - 1];
  6021. if (extglob && state.parens === extglob.parens + 1) {
  6022. extglobClose(extglobs.pop());
  6023. continue;
  6024. }
  6025. push({
  6026. type: "paren",
  6027. value,
  6028. output: state.parens ? ")" : "\\)"
  6029. });
  6030. decrement("parens");
  6031. continue;
  6032. }
  6033. if (value === "[") {
  6034. if (opts.nobracket === true || !remaining().includes("]")) {
  6035. if (opts.nobracket !== true && opts.strictBrackets === true) {
  6036. throw new SyntaxError(syntaxError("closing", "]"));
  6037. }
  6038. value = `\\${value}`;
  6039. } else {
  6040. increment("brackets");
  6041. }
  6042. push({
  6043. type: "bracket",
  6044. value
  6045. });
  6046. continue;
  6047. }
  6048. if (value === "]") {
  6049. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  6050. push({
  6051. type: "text",
  6052. value,
  6053. output: `\\${value}`
  6054. });
  6055. continue;
  6056. }
  6057. if (state.brackets === 0) {
  6058. if (opts.strictBrackets === true) {
  6059. throw new SyntaxError(syntaxError("opening", "["));
  6060. }
  6061. push({
  6062. type: "text",
  6063. value,
  6064. output: `\\${value}`
  6065. });
  6066. continue;
  6067. }
  6068. decrement("brackets");
  6069. const prevValue = prev.value.slice(1);
  6070. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
  6071. value = `/${value}`;
  6072. }
  6073. prev.value += value;
  6074. append({
  6075. value
  6076. });
  6077. if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
  6078. continue;
  6079. }
  6080. const escaped = utils.escapeRegex(prev.value);
  6081. state.output = state.output.slice(0, -prev.value.length);
  6082. if (opts.literalBrackets === true) {
  6083. state.output += escaped;
  6084. prev.value = escaped;
  6085. continue;
  6086. }
  6087. prev.value = `(${capture}${escaped}|${prev.value})`;
  6088. state.output += prev.value;
  6089. continue;
  6090. }
  6091. if (value === "{" && opts.nobrace !== true) {
  6092. increment("braces");
  6093. const open = {
  6094. type: "brace",
  6095. value,
  6096. output: "(",
  6097. outputIndex: state.output.length,
  6098. tokensIndex: state.tokens.length
  6099. };
  6100. braces.push(open);
  6101. push(open);
  6102. continue;
  6103. }
  6104. if (value === "}") {
  6105. const brace = braces[braces.length - 1];
  6106. if (opts.nobrace === true || !brace) {
  6107. push({
  6108. type: "text",
  6109. value,
  6110. output: value
  6111. });
  6112. continue;
  6113. }
  6114. let output = ")";
  6115. if (brace.dots === true) {
  6116. const arr = tokens.slice();
  6117. const range = [];
  6118. for (let i = arr.length - 1; i >= 0; i--) {
  6119. tokens.pop();
  6120. if (arr[i].type === "brace") {
  6121. break;
  6122. }
  6123. if (arr[i].type !== "dots") {
  6124. range.unshift(arr[i].value);
  6125. }
  6126. }
  6127. output = expandRange(range, opts);
  6128. state.backtrack = true;
  6129. }
  6130. if (brace.comma !== true && brace.dots !== true) {
  6131. const out = state.output.slice(0, brace.outputIndex);
  6132. const toks = state.tokens.slice(brace.tokensIndex);
  6133. brace.value = brace.output = "\\{";
  6134. value = output = "\\}";
  6135. state.output = out;
  6136. for (const t of toks) {
  6137. state.output += t.output || t.value;
  6138. }
  6139. }
  6140. push({
  6141. type: "brace",
  6142. value,
  6143. output
  6144. });
  6145. decrement("braces");
  6146. braces.pop();
  6147. continue;
  6148. }
  6149. if (value === "|") {
  6150. if (extglobs.length > 0) {
  6151. extglobs[extglobs.length - 1].conditions++;
  6152. }
  6153. push({
  6154. type: "text",
  6155. value
  6156. });
  6157. continue;
  6158. }
  6159. if (value === ",") {
  6160. let output = value;
  6161. const brace = braces[braces.length - 1];
  6162. if (brace && stack[stack.length - 1] === "braces") {
  6163. brace.comma = true;
  6164. output = "|";
  6165. }
  6166. push({
  6167. type: "comma",
  6168. value,
  6169. output
  6170. });
  6171. continue;
  6172. }
  6173. if (value === "/") {
  6174. if (prev.type === "dot" && state.index === state.start + 1) {
  6175. state.start = state.index + 1;
  6176. state.consumed = "";
  6177. state.output = "";
  6178. tokens.pop();
  6179. prev = bos;
  6180. continue;
  6181. }
  6182. push({
  6183. type: "slash",
  6184. value,
  6185. output: SLASH_LITERAL
  6186. });
  6187. continue;
  6188. }
  6189. if (value === ".") {
  6190. if (state.braces > 0 && prev.type === "dot") {
  6191. if (prev.value === ".")
  6192. prev.output = DOT_LITERAL;
  6193. const brace = braces[braces.length - 1];
  6194. prev.type = "dots";
  6195. prev.output += value;
  6196. prev.value += value;
  6197. brace.dots = true;
  6198. continue;
  6199. }
  6200. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  6201. push({
  6202. type: "text",
  6203. value,
  6204. output: DOT_LITERAL
  6205. });
  6206. continue;
  6207. }
  6208. push({
  6209. type: "dot",
  6210. value,
  6211. output: DOT_LITERAL
  6212. });
  6213. continue;
  6214. }
  6215. if (value === "?") {
  6216. const isGroup = prev && prev.value === "(";
  6217. if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6218. extglobOpen("qmark", value);
  6219. continue;
  6220. }
  6221. if (prev && prev.type === "paren") {
  6222. const next = peek();
  6223. let output = value;
  6224. if (next === "<" && !utils.supportsLookbehinds()) {
  6225. throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  6226. }
  6227. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
  6228. output = `\\${value}`;
  6229. }
  6230. push({
  6231. type: "text",
  6232. value,
  6233. output
  6234. });
  6235. continue;
  6236. }
  6237. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  6238. push({
  6239. type: "qmark",
  6240. value,
  6241. output: QMARK_NO_DOT
  6242. });
  6243. continue;
  6244. }
  6245. push({
  6246. type: "qmark",
  6247. value,
  6248. output: QMARK
  6249. });
  6250. continue;
  6251. }
  6252. if (value === "!") {
  6253. if (opts.noextglob !== true && peek() === "(") {
  6254. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  6255. extglobOpen("negate", value);
  6256. continue;
  6257. }
  6258. }
  6259. if (opts.nonegate !== true && state.index === 0) {
  6260. negate();
  6261. continue;
  6262. }
  6263. }
  6264. if (value === "+") {
  6265. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6266. extglobOpen("plus", value);
  6267. continue;
  6268. }
  6269. if (prev && prev.value === "(" || opts.regex === false) {
  6270. push({
  6271. type: "plus",
  6272. value,
  6273. output: PLUS_LITERAL
  6274. });
  6275. continue;
  6276. }
  6277. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  6278. push({
  6279. type: "plus",
  6280. value
  6281. });
  6282. continue;
  6283. }
  6284. push({
  6285. type: "plus",
  6286. value: PLUS_LITERAL
  6287. });
  6288. continue;
  6289. }
  6290. if (value === "@") {
  6291. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6292. push({
  6293. type: "at",
  6294. extglob: true,
  6295. value,
  6296. output: ""
  6297. });
  6298. continue;
  6299. }
  6300. push({
  6301. type: "text",
  6302. value
  6303. });
  6304. continue;
  6305. }
  6306. if (value !== "*") {
  6307. if (value === "$" || value === "^") {
  6308. value = `\\${value}`;
  6309. }
  6310. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  6311. if (match) {
  6312. value += match[0];
  6313. state.index += match[0].length;
  6314. }
  6315. push({
  6316. type: "text",
  6317. value
  6318. });
  6319. continue;
  6320. }
  6321. if (prev && (prev.type === "globstar" || prev.star === true)) {
  6322. prev.type = "star";
  6323. prev.star = true;
  6324. prev.value += value;
  6325. prev.output = star;
  6326. state.backtrack = true;
  6327. state.globstar = true;
  6328. consume(value);
  6329. continue;
  6330. }
  6331. let rest = remaining();
  6332. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  6333. extglobOpen("star", value);
  6334. continue;
  6335. }
  6336. if (prev.type === "star") {
  6337. if (opts.noglobstar === true) {
  6338. consume(value);
  6339. continue;
  6340. }
  6341. const prior = prev.prev;
  6342. const before = prior.prev;
  6343. const isStart = prior.type === "slash" || prior.type === "bos";
  6344. const afterStar = before && (before.type === "star" || before.type === "globstar");
  6345. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  6346. push({
  6347. type: "star",
  6348. value,
  6349. output: ""
  6350. });
  6351. continue;
  6352. }
  6353. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  6354. const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  6355. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
  6356. push({
  6357. type: "star",
  6358. value,
  6359. output: ""
  6360. });
  6361. continue;
  6362. }
  6363. while (rest.slice(0, 3) === "/**") {
  6364. const after = input[state.index + 4];
  6365. if (after && after !== "/") {
  6366. break;
  6367. }
  6368. rest = rest.slice(3);
  6369. consume("/**", 3);
  6370. }
  6371. if (prior.type === "bos" && eos()) {
  6372. prev.type = "globstar";
  6373. prev.value += value;
  6374. prev.output = globstar(opts);
  6375. state.output = prev.output;
  6376. state.globstar = true;
  6377. consume(value);
  6378. continue;
  6379. }
  6380. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  6381. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6382. prior.output = `(?:${prior.output}`;
  6383. prev.type = "globstar";
  6384. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  6385. prev.value += value;
  6386. state.globstar = true;
  6387. state.output += prior.output + prev.output;
  6388. consume(value);
  6389. continue;
  6390. }
  6391. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  6392. const end = rest[1] !== void 0 ? "|$" : "";
  6393. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6394. prior.output = `(?:${prior.output}`;
  6395. prev.type = "globstar";
  6396. prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
  6397. prev.value += value;
  6398. state.output += prior.output + prev.output;
  6399. state.globstar = true;
  6400. consume(value + advance());
  6401. push({
  6402. type: "slash",
  6403. value: "/",
  6404. output: ""
  6405. });
  6406. continue;
  6407. }
  6408. if (prior.type === "bos" && rest[0] === "/") {
  6409. prev.type = "globstar";
  6410. prev.value += value;
  6411. prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
  6412. state.output = prev.output;
  6413. state.globstar = true;
  6414. consume(value + advance());
  6415. push({
  6416. type: "slash",
  6417. value: "/",
  6418. output: ""
  6419. });
  6420. continue;
  6421. }
  6422. state.output = state.output.slice(0, -prev.output.length);
  6423. prev.type = "globstar";
  6424. prev.output = globstar(opts);
  6425. prev.value += value;
  6426. state.output += prev.output;
  6427. state.globstar = true;
  6428. consume(value);
  6429. continue;
  6430. }
  6431. const token = {
  6432. type: "star",
  6433. value,
  6434. output: star
  6435. };
  6436. if (opts.bash === true) {
  6437. token.output = ".*?";
  6438. if (prev.type === "bos" || prev.type === "slash") {
  6439. token.output = nodot + token.output;
  6440. }
  6441. push(token);
  6442. continue;
  6443. }
  6444. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  6445. token.output = value;
  6446. push(token);
  6447. continue;
  6448. }
  6449. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  6450. if (prev.type === "dot") {
  6451. state.output += NO_DOT_SLASH;
  6452. prev.output += NO_DOT_SLASH;
  6453. } else if (opts.dot === true) {
  6454. state.output += NO_DOTS_SLASH;
  6455. prev.output += NO_DOTS_SLASH;
  6456. } else {
  6457. state.output += nodot;
  6458. prev.output += nodot;
  6459. }
  6460. if (peek() !== "*") {
  6461. state.output += ONE_CHAR;
  6462. prev.output += ONE_CHAR;
  6463. }
  6464. }
  6465. push(token);
  6466. }
  6467. while (state.brackets > 0) {
  6468. if (opts.strictBrackets === true)
  6469. throw new SyntaxError(syntaxError("closing", "]"));
  6470. state.output = utils.escapeLast(state.output, "[");
  6471. decrement("brackets");
  6472. }
  6473. while (state.parens > 0) {
  6474. if (opts.strictBrackets === true)
  6475. throw new SyntaxError(syntaxError("closing", ")"));
  6476. state.output = utils.escapeLast(state.output, "(");
  6477. decrement("parens");
  6478. }
  6479. while (state.braces > 0) {
  6480. if (opts.strictBrackets === true)
  6481. throw new SyntaxError(syntaxError("closing", "}"));
  6482. state.output = utils.escapeLast(state.output, "{");
  6483. decrement("braces");
  6484. }
  6485. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
  6486. push({
  6487. type: "maybe_slash",
  6488. value: "",
  6489. output: `${SLASH_LITERAL}?`
  6490. });
  6491. }
  6492. if (state.backtrack === true) {
  6493. state.output = "";
  6494. for (const token of state.tokens) {
  6495. state.output += token.output != null ? token.output : token.value;
  6496. if (token.suffix) {
  6497. state.output += token.suffix;
  6498. }
  6499. }
  6500. }
  6501. return state;
  6502. };
  6503. parse.fastpaths = (input, options) => {
  6504. const opts = Object.assign({}, options);
  6505. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  6506. const len = input.length;
  6507. if (len > max) {
  6508. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  6509. }
  6510. input = REPLACEMENTS[input] || input;
  6511. const win32 = utils.isWindows(options);
  6512. const {
  6513. DOT_LITERAL,
  6514. SLASH_LITERAL,
  6515. ONE_CHAR,
  6516. DOTS_SLASH,
  6517. NO_DOT,
  6518. NO_DOTS,
  6519. NO_DOTS_SLASH,
  6520. STAR,
  6521. START_ANCHOR
  6522. } = constants.globChars(win32);
  6523. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  6524. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  6525. const capture = opts.capture ? "" : "?:";
  6526. const state = {
  6527. negated: false,
  6528. prefix: ""
  6529. };
  6530. let star = opts.bash === true ? ".*?" : STAR;
  6531. if (opts.capture) {
  6532. star = `(${star})`;
  6533. }
  6534. const globstar = (opts2) => {
  6535. if (opts2.noglobstar === true)
  6536. return star;
  6537. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  6538. };
  6539. const create = (str) => {
  6540. switch (str) {
  6541. case "*":
  6542. return `${nodot}${ONE_CHAR}${star}`;
  6543. case ".*":
  6544. return `${DOT_LITERAL}${ONE_CHAR}${star}`;
  6545. case "*.*":
  6546. return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6547. case "*/*":
  6548. return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
  6549. case "**":
  6550. return nodot + globstar(opts);
  6551. case "**/*":
  6552. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
  6553. case "**/*.*":
  6554. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6555. case "**/.*":
  6556. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
  6557. default: {
  6558. const match = /^(.*?)\.(\w+)$/.exec(str);
  6559. if (!match)
  6560. return;
  6561. const source2 = create(match[1]);
  6562. if (!source2)
  6563. return;
  6564. return source2 + DOT_LITERAL + match[2];
  6565. }
  6566. }
  6567. };
  6568. const output = utils.removePrefix(input, state);
  6569. let source = create(output);
  6570. if (source && opts.strictSlashes !== true) {
  6571. source += `${SLASH_LITERAL}?`;
  6572. }
  6573. return source;
  6574. };
  6575. module2.exports = parse;
  6576. }
  6577. });
  6578. var require_picomatch = __commonJS2({
  6579. "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
  6580. "use strict";
  6581. var path = require("path");
  6582. var scan = require_scan();
  6583. var parse = require_parse2();
  6584. var utils = require_utils3();
  6585. var constants = require_constants2();
  6586. var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  6587. var picomatch = (glob, options, returnState = false) => {
  6588. if (Array.isArray(glob)) {
  6589. const fns = glob.map((input) => picomatch(input, options, returnState));
  6590. const arrayMatcher = (str) => {
  6591. for (const isMatch of fns) {
  6592. const state2 = isMatch(str);
  6593. if (state2)
  6594. return state2;
  6595. }
  6596. return false;
  6597. };
  6598. return arrayMatcher;
  6599. }
  6600. const isState = isObject(glob) && glob.tokens && glob.input;
  6601. if (glob === "" || typeof glob !== "string" && !isState) {
  6602. throw new TypeError("Expected pattern to be a non-empty string");
  6603. }
  6604. const opts = options || {};
  6605. const posix = utils.isWindows(options);
  6606. const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
  6607. const state = regex.state;
  6608. delete regex.state;
  6609. let isIgnored = () => false;
  6610. if (opts.ignore) {
  6611. const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
  6612. ignore: null,
  6613. onMatch: null,
  6614. onResult: null
  6615. });
  6616. isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
  6617. }
  6618. const matcher = (input, returnObject = false) => {
  6619. const {
  6620. isMatch,
  6621. match,
  6622. output
  6623. } = picomatch.test(input, regex, options, {
  6624. glob,
  6625. posix
  6626. });
  6627. const result = {
  6628. glob,
  6629. state,
  6630. regex,
  6631. posix,
  6632. input,
  6633. output,
  6634. match,
  6635. isMatch
  6636. };
  6637. if (typeof opts.onResult === "function") {
  6638. opts.onResult(result);
  6639. }
  6640. if (isMatch === false) {
  6641. result.isMatch = false;
  6642. return returnObject ? result : false;
  6643. }
  6644. if (isIgnored(input)) {
  6645. if (typeof opts.onIgnore === "function") {
  6646. opts.onIgnore(result);
  6647. }
  6648. result.isMatch = false;
  6649. return returnObject ? result : false;
  6650. }
  6651. if (typeof opts.onMatch === "function") {
  6652. opts.onMatch(result);
  6653. }
  6654. return returnObject ? result : true;
  6655. };
  6656. if (returnState) {
  6657. matcher.state = state;
  6658. }
  6659. return matcher;
  6660. };
  6661. picomatch.test = (input, regex, options, {
  6662. glob,
  6663. posix
  6664. } = {}) => {
  6665. if (typeof input !== "string") {
  6666. throw new TypeError("Expected input to be a string");
  6667. }
  6668. if (input === "") {
  6669. return {
  6670. isMatch: false,
  6671. output: ""
  6672. };
  6673. }
  6674. const opts = options || {};
  6675. const format = opts.format || (posix ? utils.toPosixSlashes : null);
  6676. let match = input === glob;
  6677. let output = match && format ? format(input) : input;
  6678. if (match === false) {
  6679. output = format ? format(input) : input;
  6680. match = output === glob;
  6681. }
  6682. if (match === false || opts.capture === true) {
  6683. if (opts.matchBase === true || opts.basename === true) {
  6684. match = picomatch.matchBase(input, regex, options, posix);
  6685. } else {
  6686. match = regex.exec(output);
  6687. }
  6688. }
  6689. return {
  6690. isMatch: Boolean(match),
  6691. match,
  6692. output
  6693. };
  6694. };
  6695. picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
  6696. const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
  6697. return regex.test(path.basename(input));
  6698. };
  6699. picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6700. picomatch.parse = (pattern, options) => {
  6701. if (Array.isArray(pattern))
  6702. return pattern.map((p) => picomatch.parse(p, options));
  6703. return parse(pattern, Object.assign(Object.assign({}, options), {}, {
  6704. fastpaths: false
  6705. }));
  6706. };
  6707. picomatch.scan = (input, options) => scan(input, options);
  6708. picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
  6709. if (returnOutput === true) {
  6710. return state.output;
  6711. }
  6712. const opts = options || {};
  6713. const prepend = opts.contains ? "" : "^";
  6714. const append = opts.contains ? "" : "$";
  6715. let source = `${prepend}(?:${state.output})${append}`;
  6716. if (state && state.negated === true) {
  6717. source = `^(?!${source}).*$`;
  6718. }
  6719. const regex = picomatch.toRegex(source, options);
  6720. if (returnState === true) {
  6721. regex.state = state;
  6722. }
  6723. return regex;
  6724. };
  6725. picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  6726. if (!input || typeof input !== "string") {
  6727. throw new TypeError("Expected a non-empty string");
  6728. }
  6729. let parsed = {
  6730. negated: false,
  6731. fastpaths: true
  6732. };
  6733. if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
  6734. parsed.output = parse.fastpaths(input, options);
  6735. }
  6736. if (!parsed.output) {
  6737. parsed = parse(input, options);
  6738. }
  6739. return picomatch.compileRe(parsed, options, returnOutput, returnState);
  6740. };
  6741. picomatch.toRegex = (source, options) => {
  6742. try {
  6743. const opts = options || {};
  6744. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  6745. } catch (err) {
  6746. if (options && options.debug === true)
  6747. throw err;
  6748. return /$^/;
  6749. }
  6750. };
  6751. picomatch.constants = constants;
  6752. module2.exports = picomatch;
  6753. }
  6754. });
  6755. var require_picomatch2 = __commonJS2({
  6756. "node_modules/picomatch/index.js"(exports2, module2) {
  6757. "use strict";
  6758. module2.exports = require_picomatch();
  6759. }
  6760. });
  6761. var require_micromatch = __commonJS2({
  6762. "node_modules/micromatch/index.js"(exports2, module2) {
  6763. "use strict";
  6764. var util = require("util");
  6765. var braces = require_braces();
  6766. var picomatch = require_picomatch2();
  6767. var utils = require_utils3();
  6768. var isEmptyString = (val) => val === "" || val === "./";
  6769. var micromatch = (list, patterns, options) => {
  6770. patterns = [].concat(patterns);
  6771. list = [].concat(list);
  6772. let omit = /* @__PURE__ */ new Set();
  6773. let keep = /* @__PURE__ */ new Set();
  6774. let items = /* @__PURE__ */ new Set();
  6775. let negatives = 0;
  6776. let onResult = (state) => {
  6777. items.add(state.output);
  6778. if (options && options.onResult) {
  6779. options.onResult(state);
  6780. }
  6781. };
  6782. for (let i = 0; i < patterns.length; i++) {
  6783. let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
  6784. onResult
  6785. }), true);
  6786. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  6787. if (negated)
  6788. negatives++;
  6789. for (let item of list) {
  6790. let matched = isMatch(item, true);
  6791. let match = negated ? !matched.isMatch : matched.isMatch;
  6792. if (!match)
  6793. continue;
  6794. if (negated) {
  6795. omit.add(matched.output);
  6796. } else {
  6797. omit.delete(matched.output);
  6798. keep.add(matched.output);
  6799. }
  6800. }
  6801. }
  6802. let result = negatives === patterns.length ? [...items] : [...keep];
  6803. let matches = result.filter((item) => !omit.has(item));
  6804. if (options && matches.length === 0) {
  6805. if (options.failglob === true) {
  6806. throw new Error(`No matches found for "${patterns.join(", ")}"`);
  6807. }
  6808. if (options.nonull === true || options.nullglob === true) {
  6809. return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  6810. }
  6811. }
  6812. return matches;
  6813. };
  6814. micromatch.match = micromatch;
  6815. micromatch.matcher = (pattern, options) => picomatch(pattern, options);
  6816. micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6817. micromatch.any = micromatch.isMatch;
  6818. micromatch.not = (list, patterns, options = {}) => {
  6819. patterns = [].concat(patterns).map(String);
  6820. let result = /* @__PURE__ */ new Set();
  6821. let items = [];
  6822. let onResult = (state) => {
  6823. if (options.onResult)
  6824. options.onResult(state);
  6825. items.push(state.output);
  6826. };
  6827. let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
  6828. onResult
  6829. })));
  6830. for (let item of items) {
  6831. if (!matches.has(item)) {
  6832. result.add(item);
  6833. }
  6834. }
  6835. return [...result];
  6836. };
  6837. micromatch.contains = (str, pattern, options) => {
  6838. if (typeof str !== "string") {
  6839. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6840. }
  6841. if (Array.isArray(pattern)) {
  6842. return pattern.some((p) => micromatch.contains(str, p, options));
  6843. }
  6844. if (typeof pattern === "string") {
  6845. if (isEmptyString(str) || isEmptyString(pattern)) {
  6846. return false;
  6847. }
  6848. if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
  6849. return true;
  6850. }
  6851. }
  6852. return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
  6853. contains: true
  6854. }));
  6855. };
  6856. micromatch.matchKeys = (obj, patterns, options) => {
  6857. if (!utils.isObject(obj)) {
  6858. throw new TypeError("Expected the first argument to be an object");
  6859. }
  6860. let keys = micromatch(Object.keys(obj), patterns, options);
  6861. let res = {};
  6862. for (let key of keys)
  6863. res[key] = obj[key];
  6864. return res;
  6865. };
  6866. micromatch.some = (list, patterns, options) => {
  6867. let items = [].concat(list);
  6868. for (let pattern of [].concat(patterns)) {
  6869. let isMatch = picomatch(String(pattern), options);
  6870. if (items.some((item) => isMatch(item))) {
  6871. return true;
  6872. }
  6873. }
  6874. return false;
  6875. };
  6876. micromatch.every = (list, patterns, options) => {
  6877. let items = [].concat(list);
  6878. for (let pattern of [].concat(patterns)) {
  6879. let isMatch = picomatch(String(pattern), options);
  6880. if (!items.every((item) => isMatch(item))) {
  6881. return false;
  6882. }
  6883. }
  6884. return true;
  6885. };
  6886. micromatch.all = (str, patterns, options) => {
  6887. if (typeof str !== "string") {
  6888. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6889. }
  6890. return [].concat(patterns).every((p) => picomatch(p, options)(str));
  6891. };
  6892. micromatch.capture = (glob, input, options) => {
  6893. let posix = utils.isWindows(options);
  6894. let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
  6895. capture: true
  6896. }));
  6897. let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
  6898. if (match) {
  6899. return match.slice(1).map((v) => v === void 0 ? "" : v);
  6900. }
  6901. };
  6902. micromatch.makeRe = (...args) => picomatch.makeRe(...args);
  6903. micromatch.scan = (...args) => picomatch.scan(...args);
  6904. micromatch.parse = (patterns, options) => {
  6905. let res = [];
  6906. for (let pattern of [].concat(patterns || [])) {
  6907. for (let str of braces(String(pattern), options)) {
  6908. res.push(picomatch.parse(str, options));
  6909. }
  6910. }
  6911. return res;
  6912. };
  6913. micromatch.braces = (pattern, options) => {
  6914. if (typeof pattern !== "string")
  6915. throw new TypeError("Expected a string");
  6916. if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
  6917. return [pattern];
  6918. }
  6919. return braces(pattern, options);
  6920. };
  6921. micromatch.braceExpand = (pattern, options) => {
  6922. if (typeof pattern !== "string")
  6923. throw new TypeError("Expected a string");
  6924. return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
  6925. expand: true
  6926. }));
  6927. };
  6928. module2.exports = micromatch;
  6929. }
  6930. });
  6931. var require_pattern = __commonJS2({
  6932. "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
  6933. "use strict";
  6934. Object.defineProperty(exports2, "__esModule", {
  6935. value: true
  6936. });
  6937. exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
  6938. var path = require("path");
  6939. var globParent = require_glob_parent();
  6940. var micromatch = require_micromatch();
  6941. var GLOBSTAR = "**";
  6942. var ESCAPE_SYMBOL = "\\";
  6943. var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  6944. var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  6945. var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  6946. var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  6947. var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  6948. function isStaticPattern(pattern, options = {}) {
  6949. return !isDynamicPattern(pattern, options);
  6950. }
  6951. exports2.isStaticPattern = isStaticPattern;
  6952. function isDynamicPattern(pattern, options = {}) {
  6953. if (pattern === "") {
  6954. return false;
  6955. }
  6956. if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
  6957. return true;
  6958. }
  6959. if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
  6960. return true;
  6961. }
  6962. if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
  6963. return true;
  6964. }
  6965. if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
  6966. return true;
  6967. }
  6968. return false;
  6969. }
  6970. exports2.isDynamicPattern = isDynamicPattern;
  6971. function hasBraceExpansion(pattern) {
  6972. const openingBraceIndex = pattern.indexOf("{");
  6973. if (openingBraceIndex === -1) {
  6974. return false;
  6975. }
  6976. const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
  6977. if (closingBraceIndex === -1) {
  6978. return false;
  6979. }
  6980. const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
  6981. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  6982. }
  6983. function convertToPositivePattern(pattern) {
  6984. return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
  6985. }
  6986. exports2.convertToPositivePattern = convertToPositivePattern;
  6987. function convertToNegativePattern(pattern) {
  6988. return "!" + pattern;
  6989. }
  6990. exports2.convertToNegativePattern = convertToNegativePattern;
  6991. function isNegativePattern(pattern) {
  6992. return pattern.startsWith("!") && pattern[1] !== "(";
  6993. }
  6994. exports2.isNegativePattern = isNegativePattern;
  6995. function isPositivePattern(pattern) {
  6996. return !isNegativePattern(pattern);
  6997. }
  6998. exports2.isPositivePattern = isPositivePattern;
  6999. function getNegativePatterns(patterns) {
  7000. return patterns.filter(isNegativePattern);
  7001. }
  7002. exports2.getNegativePatterns = getNegativePatterns;
  7003. function getPositivePatterns(patterns) {
  7004. return patterns.filter(isPositivePattern);
  7005. }
  7006. exports2.getPositivePatterns = getPositivePatterns;
  7007. function getPatternsInsideCurrentDirectory(patterns) {
  7008. return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
  7009. }
  7010. exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  7011. function getPatternsOutsideCurrentDirectory(patterns) {
  7012. return patterns.filter(isPatternRelatedToParentDirectory);
  7013. }
  7014. exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  7015. function isPatternRelatedToParentDirectory(pattern) {
  7016. return pattern.startsWith("..") || pattern.startsWith("./..");
  7017. }
  7018. exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  7019. function getBaseDirectory(pattern) {
  7020. return globParent(pattern, {
  7021. flipBackslashes: false
  7022. });
  7023. }
  7024. exports2.getBaseDirectory = getBaseDirectory;
  7025. function hasGlobStar(pattern) {
  7026. return pattern.includes(GLOBSTAR);
  7027. }
  7028. exports2.hasGlobStar = hasGlobStar;
  7029. function endsWithSlashGlobStar(pattern) {
  7030. return pattern.endsWith("/" + GLOBSTAR);
  7031. }
  7032. exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
  7033. function isAffectDepthOfReadingPattern(pattern) {
  7034. const basename = path.basename(pattern);
  7035. return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
  7036. }
  7037. exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  7038. function expandPatternsWithBraceExpansion(patterns) {
  7039. return patterns.reduce((collection, pattern) => {
  7040. return collection.concat(expandBraceExpansion(pattern));
  7041. }, []);
  7042. }
  7043. exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  7044. function expandBraceExpansion(pattern) {
  7045. return micromatch.braces(pattern, {
  7046. expand: true,
  7047. nodupes: true
  7048. });
  7049. }
  7050. exports2.expandBraceExpansion = expandBraceExpansion;
  7051. function getPatternParts(pattern, options) {
  7052. let {
  7053. parts
  7054. } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
  7055. parts: true
  7056. }));
  7057. if (parts.length === 0) {
  7058. parts = [pattern];
  7059. }
  7060. if (parts[0].startsWith("/")) {
  7061. parts[0] = parts[0].slice(1);
  7062. parts.unshift("");
  7063. }
  7064. return parts;
  7065. }
  7066. exports2.getPatternParts = getPatternParts;
  7067. function makeRe(pattern, options) {
  7068. return micromatch.makeRe(pattern, options);
  7069. }
  7070. exports2.makeRe = makeRe;
  7071. function convertPatternsToRe(patterns, options) {
  7072. return patterns.map((pattern) => makeRe(pattern, options));
  7073. }
  7074. exports2.convertPatternsToRe = convertPatternsToRe;
  7075. function matchAny(entry, patternsRe) {
  7076. return patternsRe.some((patternRe) => patternRe.test(entry));
  7077. }
  7078. exports2.matchAny = matchAny;
  7079. }
  7080. });
  7081. var require_merge2 = __commonJS2({
  7082. "node_modules/merge2/index.js"(exports2, module2) {
  7083. "use strict";
  7084. var Stream = require("stream");
  7085. var PassThrough = Stream.PassThrough;
  7086. var slice = Array.prototype.slice;
  7087. module2.exports = merge2;
  7088. function merge2() {
  7089. const streamsQueue = [];
  7090. const args = slice.call(arguments);
  7091. let merging = false;
  7092. let options = args[args.length - 1];
  7093. if (options && !Array.isArray(options) && options.pipe == null) {
  7094. args.pop();
  7095. } else {
  7096. options = {};
  7097. }
  7098. const doEnd = options.end !== false;
  7099. const doPipeError = options.pipeError === true;
  7100. if (options.objectMode == null) {
  7101. options.objectMode = true;
  7102. }
  7103. if (options.highWaterMark == null) {
  7104. options.highWaterMark = 64 * 1024;
  7105. }
  7106. const mergedStream = PassThrough(options);
  7107. function addStream() {
  7108. for (let i = 0, len = arguments.length; i < len; i++) {
  7109. streamsQueue.push(pauseStreams(arguments[i], options));
  7110. }
  7111. mergeStream();
  7112. return this;
  7113. }
  7114. function mergeStream() {
  7115. if (merging) {
  7116. return;
  7117. }
  7118. merging = true;
  7119. let streams = streamsQueue.shift();
  7120. if (!streams) {
  7121. process.nextTick(endStream);
  7122. return;
  7123. }
  7124. if (!Array.isArray(streams)) {
  7125. streams = [streams];
  7126. }
  7127. let pipesCount = streams.length + 1;
  7128. function next() {
  7129. if (--pipesCount > 0) {
  7130. return;
  7131. }
  7132. merging = false;
  7133. mergeStream();
  7134. }
  7135. function pipe(stream) {
  7136. function onend() {
  7137. stream.removeListener("merge2UnpipeEnd", onend);
  7138. stream.removeListener("end", onend);
  7139. if (doPipeError) {
  7140. stream.removeListener("error", onerror);
  7141. }
  7142. next();
  7143. }
  7144. function onerror(err) {
  7145. mergedStream.emit("error", err);
  7146. }
  7147. if (stream._readableState.endEmitted) {
  7148. return next();
  7149. }
  7150. stream.on("merge2UnpipeEnd", onend);
  7151. stream.on("end", onend);
  7152. if (doPipeError) {
  7153. stream.on("error", onerror);
  7154. }
  7155. stream.pipe(mergedStream, {
  7156. end: false
  7157. });
  7158. stream.resume();
  7159. }
  7160. for (let i = 0; i < streams.length; i++) {
  7161. pipe(streams[i]);
  7162. }
  7163. next();
  7164. }
  7165. function endStream() {
  7166. merging = false;
  7167. mergedStream.emit("queueDrain");
  7168. if (doEnd) {
  7169. mergedStream.end();
  7170. }
  7171. }
  7172. mergedStream.setMaxListeners(0);
  7173. mergedStream.add = addStream;
  7174. mergedStream.on("unpipe", function(stream) {
  7175. stream.emit("merge2UnpipeEnd");
  7176. });
  7177. if (args.length) {
  7178. addStream.apply(null, args);
  7179. }
  7180. return mergedStream;
  7181. }
  7182. function pauseStreams(streams, options) {
  7183. if (!Array.isArray(streams)) {
  7184. if (!streams._readableState && streams.pipe) {
  7185. streams = streams.pipe(PassThrough(options));
  7186. }
  7187. if (!streams._readableState || !streams.pause || !streams.pipe) {
  7188. throw new Error("Only readable stream can be merged.");
  7189. }
  7190. streams.pause();
  7191. } else {
  7192. for (let i = 0, len = streams.length; i < len; i++) {
  7193. streams[i] = pauseStreams(streams[i], options);
  7194. }
  7195. }
  7196. return streams;
  7197. }
  7198. }
  7199. });
  7200. var require_stream = __commonJS2({
  7201. "node_modules/fast-glob/out/utils/stream.js"(exports2) {
  7202. "use strict";
  7203. Object.defineProperty(exports2, "__esModule", {
  7204. value: true
  7205. });
  7206. exports2.merge = void 0;
  7207. var merge2 = require_merge2();
  7208. function merge(streams) {
  7209. const mergedStream = merge2(streams);
  7210. streams.forEach((stream) => {
  7211. stream.once("error", (error) => mergedStream.emit("error", error));
  7212. });
  7213. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  7214. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  7215. return mergedStream;
  7216. }
  7217. exports2.merge = merge;
  7218. function propagateCloseEventToSources(streams) {
  7219. streams.forEach((stream) => stream.emit("close"));
  7220. }
  7221. }
  7222. });
  7223. var require_string = __commonJS2({
  7224. "node_modules/fast-glob/out/utils/string.js"(exports2) {
  7225. "use strict";
  7226. Object.defineProperty(exports2, "__esModule", {
  7227. value: true
  7228. });
  7229. exports2.isEmpty = exports2.isString = void 0;
  7230. function isString(input) {
  7231. return typeof input === "string";
  7232. }
  7233. exports2.isString = isString;
  7234. function isEmpty(input) {
  7235. return input === "";
  7236. }
  7237. exports2.isEmpty = isEmpty;
  7238. }
  7239. });
  7240. var require_utils4 = __commonJS2({
  7241. "node_modules/fast-glob/out/utils/index.js"(exports2) {
  7242. "use strict";
  7243. Object.defineProperty(exports2, "__esModule", {
  7244. value: true
  7245. });
  7246. exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
  7247. var array2 = require_array();
  7248. exports2.array = array2;
  7249. var errno = require_errno();
  7250. exports2.errno = errno;
  7251. var fs = require_fs();
  7252. exports2.fs = fs;
  7253. var path = require_path();
  7254. exports2.path = path;
  7255. var pattern = require_pattern();
  7256. exports2.pattern = pattern;
  7257. var stream = require_stream();
  7258. exports2.stream = stream;
  7259. var string = require_string();
  7260. exports2.string = string;
  7261. }
  7262. });
  7263. var require_tasks = __commonJS2({
  7264. "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
  7265. "use strict";
  7266. Object.defineProperty(exports2, "__esModule", {
  7267. value: true
  7268. });
  7269. exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
  7270. var utils = require_utils4();
  7271. function generate(patterns, settings) {
  7272. const positivePatterns = getPositivePatterns(patterns);
  7273. const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
  7274. const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
  7275. const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
  7276. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  7277. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  7278. return staticTasks.concat(dynamicTasks);
  7279. }
  7280. exports2.generate = generate;
  7281. function convertPatternsToTasks(positive, negative, dynamic) {
  7282. const tasks = [];
  7283. const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
  7284. const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
  7285. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  7286. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  7287. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  7288. if ("." in insideCurrentDirectoryGroup) {
  7289. tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  7290. } else {
  7291. tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  7292. }
  7293. return tasks;
  7294. }
  7295. exports2.convertPatternsToTasks = convertPatternsToTasks;
  7296. function getPositivePatterns(patterns) {
  7297. return utils.pattern.getPositivePatterns(patterns);
  7298. }
  7299. exports2.getPositivePatterns = getPositivePatterns;
  7300. function getNegativePatternsAsPositive(patterns, ignore) {
  7301. const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
  7302. const positive = negative.map(utils.pattern.convertToPositivePattern);
  7303. return positive;
  7304. }
  7305. exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  7306. function groupPatternsByBaseDirectory(patterns) {
  7307. const group = {};
  7308. return patterns.reduce((collection, pattern) => {
  7309. const base = utils.pattern.getBaseDirectory(pattern);
  7310. if (base in collection) {
  7311. collection[base].push(pattern);
  7312. } else {
  7313. collection[base] = [pattern];
  7314. }
  7315. return collection;
  7316. }, group);
  7317. }
  7318. exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  7319. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  7320. return Object.keys(positive).map((base) => {
  7321. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  7322. });
  7323. }
  7324. exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  7325. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  7326. return {
  7327. dynamic,
  7328. positive,
  7329. negative,
  7330. base,
  7331. patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
  7332. };
  7333. }
  7334. exports2.convertPatternGroupToTask = convertPatternGroupToTask;
  7335. }
  7336. });
  7337. var require_patterns = __commonJS2({
  7338. "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
  7339. "use strict";
  7340. Object.defineProperty(exports2, "__esModule", {
  7341. value: true
  7342. });
  7343. exports2.removeDuplicateSlashes = exports2.transform = void 0;
  7344. var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  7345. function transform(patterns) {
  7346. return patterns.map((pattern) => removeDuplicateSlashes(pattern));
  7347. }
  7348. exports2.transform = transform;
  7349. function removeDuplicateSlashes(pattern) {
  7350. return pattern.replace(DOUBLE_SLASH_RE, "/");
  7351. }
  7352. exports2.removeDuplicateSlashes = removeDuplicateSlashes;
  7353. }
  7354. });
  7355. var require_async = __commonJS2({
  7356. "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
  7357. "use strict";
  7358. Object.defineProperty(exports2, "__esModule", {
  7359. value: true
  7360. });
  7361. exports2.read = void 0;
  7362. function read(path, settings, callback) {
  7363. settings.fs.lstat(path, (lstatError, lstat) => {
  7364. if (lstatError !== null) {
  7365. callFailureCallback(callback, lstatError);
  7366. return;
  7367. }
  7368. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7369. callSuccessCallback(callback, lstat);
  7370. return;
  7371. }
  7372. settings.fs.stat(path, (statError, stat) => {
  7373. if (statError !== null) {
  7374. if (settings.throwErrorOnBrokenSymbolicLink) {
  7375. callFailureCallback(callback, statError);
  7376. return;
  7377. }
  7378. callSuccessCallback(callback, lstat);
  7379. return;
  7380. }
  7381. if (settings.markSymbolicLink) {
  7382. stat.isSymbolicLink = () => true;
  7383. }
  7384. callSuccessCallback(callback, stat);
  7385. });
  7386. });
  7387. }
  7388. exports2.read = read;
  7389. function callFailureCallback(callback, error) {
  7390. callback(error);
  7391. }
  7392. function callSuccessCallback(callback, result) {
  7393. callback(null, result);
  7394. }
  7395. }
  7396. });
  7397. var require_sync = __commonJS2({
  7398. "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
  7399. "use strict";
  7400. Object.defineProperty(exports2, "__esModule", {
  7401. value: true
  7402. });
  7403. exports2.read = void 0;
  7404. function read(path, settings) {
  7405. const lstat = settings.fs.lstatSync(path);
  7406. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7407. return lstat;
  7408. }
  7409. try {
  7410. const stat = settings.fs.statSync(path);
  7411. if (settings.markSymbolicLink) {
  7412. stat.isSymbolicLink = () => true;
  7413. }
  7414. return stat;
  7415. } catch (error) {
  7416. if (!settings.throwErrorOnBrokenSymbolicLink) {
  7417. return lstat;
  7418. }
  7419. throw error;
  7420. }
  7421. }
  7422. exports2.read = read;
  7423. }
  7424. });
  7425. var require_fs2 = __commonJS2({
  7426. "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
  7427. "use strict";
  7428. Object.defineProperty(exports2, "__esModule", {
  7429. value: true
  7430. });
  7431. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7432. var fs = require("fs");
  7433. exports2.FILE_SYSTEM_ADAPTER = {
  7434. lstat: fs.lstat,
  7435. stat: fs.stat,
  7436. lstatSync: fs.lstatSync,
  7437. statSync: fs.statSync
  7438. };
  7439. function createFileSystemAdapter(fsMethods) {
  7440. if (fsMethods === void 0) {
  7441. return exports2.FILE_SYSTEM_ADAPTER;
  7442. }
  7443. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7444. }
  7445. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7446. }
  7447. });
  7448. var require_settings = __commonJS2({
  7449. "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
  7450. "use strict";
  7451. Object.defineProperty(exports2, "__esModule", {
  7452. value: true
  7453. });
  7454. var fs = require_fs2();
  7455. var Settings = class {
  7456. constructor(_options = {}) {
  7457. this._options = _options;
  7458. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  7459. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7460. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  7461. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7462. }
  7463. _getValue(option, value) {
  7464. return option !== null && option !== void 0 ? option : value;
  7465. }
  7466. };
  7467. exports2.default = Settings;
  7468. }
  7469. });
  7470. var require_out = __commonJS2({
  7471. "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
  7472. "use strict";
  7473. Object.defineProperty(exports2, "__esModule", {
  7474. value: true
  7475. });
  7476. exports2.statSync = exports2.stat = exports2.Settings = void 0;
  7477. var async = require_async();
  7478. var sync = require_sync();
  7479. var settings_1 = require_settings();
  7480. exports2.Settings = settings_1.default;
  7481. function stat(path, optionsOrSettingsOrCallback, callback) {
  7482. if (typeof optionsOrSettingsOrCallback === "function") {
  7483. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7484. return;
  7485. }
  7486. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7487. }
  7488. exports2.stat = stat;
  7489. function statSync(path, optionsOrSettings) {
  7490. const settings = getSettings(optionsOrSettings);
  7491. return sync.read(path, settings);
  7492. }
  7493. exports2.statSync = statSync;
  7494. function getSettings(settingsOrOptions = {}) {
  7495. if (settingsOrOptions instanceof settings_1.default) {
  7496. return settingsOrOptions;
  7497. }
  7498. return new settings_1.default(settingsOrOptions);
  7499. }
  7500. }
  7501. });
  7502. var require_queue_microtask = __commonJS2({
  7503. "node_modules/queue-microtask/index.js"(exports2, module2) {
  7504. var promise;
  7505. module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  7506. throw err;
  7507. }, 0));
  7508. }
  7509. });
  7510. var require_run_parallel = __commonJS2({
  7511. "node_modules/run-parallel/index.js"(exports2, module2) {
  7512. module2.exports = runParallel;
  7513. var queueMicrotask2 = require_queue_microtask();
  7514. function runParallel(tasks, cb) {
  7515. let results, pending, keys;
  7516. let isSync = true;
  7517. if (Array.isArray(tasks)) {
  7518. results = [];
  7519. pending = tasks.length;
  7520. } else {
  7521. keys = Object.keys(tasks);
  7522. results = {};
  7523. pending = keys.length;
  7524. }
  7525. function done(err) {
  7526. function end() {
  7527. if (cb)
  7528. cb(err, results);
  7529. cb = null;
  7530. }
  7531. if (isSync)
  7532. queueMicrotask2(end);
  7533. else
  7534. end();
  7535. }
  7536. function each(i, err, result) {
  7537. results[i] = result;
  7538. if (--pending === 0 || err) {
  7539. done(err);
  7540. }
  7541. }
  7542. if (!pending) {
  7543. done(null);
  7544. } else if (keys) {
  7545. keys.forEach(function(key) {
  7546. tasks[key](function(err, result) {
  7547. each(key, err, result);
  7548. });
  7549. });
  7550. } else {
  7551. tasks.forEach(function(task, i) {
  7552. task(function(err, result) {
  7553. each(i, err, result);
  7554. });
  7555. });
  7556. }
  7557. isSync = false;
  7558. }
  7559. }
  7560. });
  7561. var require_constants3 = __commonJS2({
  7562. "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
  7563. "use strict";
  7564. Object.defineProperty(exports2, "__esModule", {
  7565. value: true
  7566. });
  7567. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
  7568. var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  7569. if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
  7570. throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
  7571. }
  7572. var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  7573. var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  7574. var SUPPORTED_MAJOR_VERSION = 10;
  7575. var SUPPORTED_MINOR_VERSION = 10;
  7576. var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  7577. var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  7578. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  7579. }
  7580. });
  7581. var require_fs3 = __commonJS2({
  7582. "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
  7583. "use strict";
  7584. Object.defineProperty(exports2, "__esModule", {
  7585. value: true
  7586. });
  7587. exports2.createDirentFromStats = void 0;
  7588. var DirentFromStats = class {
  7589. constructor(name, stats) {
  7590. this.name = name;
  7591. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  7592. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  7593. this.isDirectory = stats.isDirectory.bind(stats);
  7594. this.isFIFO = stats.isFIFO.bind(stats);
  7595. this.isFile = stats.isFile.bind(stats);
  7596. this.isSocket = stats.isSocket.bind(stats);
  7597. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  7598. }
  7599. };
  7600. function createDirentFromStats(name, stats) {
  7601. return new DirentFromStats(name, stats);
  7602. }
  7603. exports2.createDirentFromStats = createDirentFromStats;
  7604. }
  7605. });
  7606. var require_utils5 = __commonJS2({
  7607. "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
  7608. "use strict";
  7609. Object.defineProperty(exports2, "__esModule", {
  7610. value: true
  7611. });
  7612. exports2.fs = void 0;
  7613. var fs = require_fs3();
  7614. exports2.fs = fs;
  7615. }
  7616. });
  7617. var require_common = __commonJS2({
  7618. "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
  7619. "use strict";
  7620. Object.defineProperty(exports2, "__esModule", {
  7621. value: true
  7622. });
  7623. exports2.joinPathSegments = void 0;
  7624. function joinPathSegments(a, b, separator) {
  7625. if (a.endsWith(separator)) {
  7626. return a + b;
  7627. }
  7628. return a + separator + b;
  7629. }
  7630. exports2.joinPathSegments = joinPathSegments;
  7631. }
  7632. });
  7633. var require_async2 = __commonJS2({
  7634. "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
  7635. "use strict";
  7636. Object.defineProperty(exports2, "__esModule", {
  7637. value: true
  7638. });
  7639. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7640. var fsStat = require_out();
  7641. var rpl = require_run_parallel();
  7642. var constants_1 = require_constants3();
  7643. var utils = require_utils5();
  7644. var common = require_common();
  7645. function read(directory, settings, callback) {
  7646. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7647. readdirWithFileTypes(directory, settings, callback);
  7648. return;
  7649. }
  7650. readdir(directory, settings, callback);
  7651. }
  7652. exports2.read = read;
  7653. function readdirWithFileTypes(directory, settings, callback) {
  7654. settings.fs.readdir(directory, {
  7655. withFileTypes: true
  7656. }, (readdirError, dirents) => {
  7657. if (readdirError !== null) {
  7658. callFailureCallback(callback, readdirError);
  7659. return;
  7660. }
  7661. const entries = dirents.map((dirent) => ({
  7662. dirent,
  7663. name: dirent.name,
  7664. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7665. }));
  7666. if (!settings.followSymbolicLinks) {
  7667. callSuccessCallback(callback, entries);
  7668. return;
  7669. }
  7670. const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
  7671. rpl(tasks, (rplError, rplEntries) => {
  7672. if (rplError !== null) {
  7673. callFailureCallback(callback, rplError);
  7674. return;
  7675. }
  7676. callSuccessCallback(callback, rplEntries);
  7677. });
  7678. });
  7679. }
  7680. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7681. function makeRplTaskEntry(entry, settings) {
  7682. return (done) => {
  7683. if (!entry.dirent.isSymbolicLink()) {
  7684. done(null, entry);
  7685. return;
  7686. }
  7687. settings.fs.stat(entry.path, (statError, stats) => {
  7688. if (statError !== null) {
  7689. if (settings.throwErrorOnBrokenSymbolicLink) {
  7690. done(statError);
  7691. return;
  7692. }
  7693. done(null, entry);
  7694. return;
  7695. }
  7696. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7697. done(null, entry);
  7698. });
  7699. };
  7700. }
  7701. function readdir(directory, settings, callback) {
  7702. settings.fs.readdir(directory, (readdirError, names) => {
  7703. if (readdirError !== null) {
  7704. callFailureCallback(callback, readdirError);
  7705. return;
  7706. }
  7707. const tasks = names.map((name) => {
  7708. const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7709. return (done) => {
  7710. fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
  7711. if (error !== null) {
  7712. done(error);
  7713. return;
  7714. }
  7715. const entry = {
  7716. name,
  7717. path,
  7718. dirent: utils.fs.createDirentFromStats(name, stats)
  7719. };
  7720. if (settings.stats) {
  7721. entry.stats = stats;
  7722. }
  7723. done(null, entry);
  7724. });
  7725. };
  7726. });
  7727. rpl(tasks, (rplError, entries) => {
  7728. if (rplError !== null) {
  7729. callFailureCallback(callback, rplError);
  7730. return;
  7731. }
  7732. callSuccessCallback(callback, entries);
  7733. });
  7734. });
  7735. }
  7736. exports2.readdir = readdir;
  7737. function callFailureCallback(callback, error) {
  7738. callback(error);
  7739. }
  7740. function callSuccessCallback(callback, result) {
  7741. callback(null, result);
  7742. }
  7743. }
  7744. });
  7745. var require_sync2 = __commonJS2({
  7746. "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
  7747. "use strict";
  7748. Object.defineProperty(exports2, "__esModule", {
  7749. value: true
  7750. });
  7751. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7752. var fsStat = require_out();
  7753. var constants_1 = require_constants3();
  7754. var utils = require_utils5();
  7755. var common = require_common();
  7756. function read(directory, settings) {
  7757. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7758. return readdirWithFileTypes(directory, settings);
  7759. }
  7760. return readdir(directory, settings);
  7761. }
  7762. exports2.read = read;
  7763. function readdirWithFileTypes(directory, settings) {
  7764. const dirents = settings.fs.readdirSync(directory, {
  7765. withFileTypes: true
  7766. });
  7767. return dirents.map((dirent) => {
  7768. const entry = {
  7769. dirent,
  7770. name: dirent.name,
  7771. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7772. };
  7773. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
  7774. try {
  7775. const stats = settings.fs.statSync(entry.path);
  7776. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7777. } catch (error) {
  7778. if (settings.throwErrorOnBrokenSymbolicLink) {
  7779. throw error;
  7780. }
  7781. }
  7782. }
  7783. return entry;
  7784. });
  7785. }
  7786. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7787. function readdir(directory, settings) {
  7788. const names = settings.fs.readdirSync(directory);
  7789. return names.map((name) => {
  7790. const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7791. const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
  7792. const entry = {
  7793. name,
  7794. path: entryPath,
  7795. dirent: utils.fs.createDirentFromStats(name, stats)
  7796. };
  7797. if (settings.stats) {
  7798. entry.stats = stats;
  7799. }
  7800. return entry;
  7801. });
  7802. }
  7803. exports2.readdir = readdir;
  7804. }
  7805. });
  7806. var require_fs4 = __commonJS2({
  7807. "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
  7808. "use strict";
  7809. Object.defineProperty(exports2, "__esModule", {
  7810. value: true
  7811. });
  7812. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7813. var fs = require("fs");
  7814. exports2.FILE_SYSTEM_ADAPTER = {
  7815. lstat: fs.lstat,
  7816. stat: fs.stat,
  7817. lstatSync: fs.lstatSync,
  7818. statSync: fs.statSync,
  7819. readdir: fs.readdir,
  7820. readdirSync: fs.readdirSync
  7821. };
  7822. function createFileSystemAdapter(fsMethods) {
  7823. if (fsMethods === void 0) {
  7824. return exports2.FILE_SYSTEM_ADAPTER;
  7825. }
  7826. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7827. }
  7828. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7829. }
  7830. });
  7831. var require_settings2 = __commonJS2({
  7832. "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
  7833. "use strict";
  7834. Object.defineProperty(exports2, "__esModule", {
  7835. value: true
  7836. });
  7837. var path = require("path");
  7838. var fsStat = require_out();
  7839. var fs = require_fs4();
  7840. var Settings = class {
  7841. constructor(_options = {}) {
  7842. this._options = _options;
  7843. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  7844. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7845. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  7846. this.stats = this._getValue(this._options.stats, false);
  7847. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7848. this.fsStatSettings = new fsStat.Settings({
  7849. followSymbolicLink: this.followSymbolicLinks,
  7850. fs: this.fs,
  7851. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  7852. });
  7853. }
  7854. _getValue(option, value) {
  7855. return option !== null && option !== void 0 ? option : value;
  7856. }
  7857. };
  7858. exports2.default = Settings;
  7859. }
  7860. });
  7861. var require_out2 = __commonJS2({
  7862. "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
  7863. "use strict";
  7864. Object.defineProperty(exports2, "__esModule", {
  7865. value: true
  7866. });
  7867. exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
  7868. var async = require_async2();
  7869. var sync = require_sync2();
  7870. var settings_1 = require_settings2();
  7871. exports2.Settings = settings_1.default;
  7872. function scandir(path, optionsOrSettingsOrCallback, callback) {
  7873. if (typeof optionsOrSettingsOrCallback === "function") {
  7874. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7875. return;
  7876. }
  7877. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7878. }
  7879. exports2.scandir = scandir;
  7880. function scandirSync(path, optionsOrSettings) {
  7881. const settings = getSettings(optionsOrSettings);
  7882. return sync.read(path, settings);
  7883. }
  7884. exports2.scandirSync = scandirSync;
  7885. function getSettings(settingsOrOptions = {}) {
  7886. if (settingsOrOptions instanceof settings_1.default) {
  7887. return settingsOrOptions;
  7888. }
  7889. return new settings_1.default(settingsOrOptions);
  7890. }
  7891. }
  7892. });
  7893. var require_reusify = __commonJS2({
  7894. "node_modules/reusify/reusify.js"(exports2, module2) {
  7895. "use strict";
  7896. function reusify(Constructor) {
  7897. var head = new Constructor();
  7898. var tail = head;
  7899. function get() {
  7900. var current = head;
  7901. if (current.next) {
  7902. head = current.next;
  7903. } else {
  7904. head = new Constructor();
  7905. tail = head;
  7906. }
  7907. current.next = null;
  7908. return current;
  7909. }
  7910. function release(obj) {
  7911. tail.next = obj;
  7912. tail = obj;
  7913. }
  7914. return {
  7915. get,
  7916. release
  7917. };
  7918. }
  7919. module2.exports = reusify;
  7920. }
  7921. });
  7922. var require_queue = __commonJS2({
  7923. "node_modules/fastq/queue.js"(exports2, module2) {
  7924. "use strict";
  7925. var reusify = require_reusify();
  7926. function fastqueue(context, worker, concurrency) {
  7927. if (typeof context === "function") {
  7928. concurrency = worker;
  7929. worker = context;
  7930. context = null;
  7931. }
  7932. if (concurrency < 1) {
  7933. throw new Error("fastqueue concurrency must be greater than 1");
  7934. }
  7935. var cache = reusify(Task);
  7936. var queueHead = null;
  7937. var queueTail = null;
  7938. var _running = 0;
  7939. var errorHandler = null;
  7940. var self2 = {
  7941. push,
  7942. drain: noop,
  7943. saturated: noop,
  7944. pause,
  7945. paused: false,
  7946. concurrency,
  7947. running,
  7948. resume,
  7949. idle,
  7950. length,
  7951. getQueue,
  7952. unshift,
  7953. empty: noop,
  7954. kill,
  7955. killAndDrain,
  7956. error
  7957. };
  7958. return self2;
  7959. function running() {
  7960. return _running;
  7961. }
  7962. function pause() {
  7963. self2.paused = true;
  7964. }
  7965. function length() {
  7966. var current = queueHead;
  7967. var counter = 0;
  7968. while (current) {
  7969. current = current.next;
  7970. counter++;
  7971. }
  7972. return counter;
  7973. }
  7974. function getQueue() {
  7975. var current = queueHead;
  7976. var tasks = [];
  7977. while (current) {
  7978. tasks.push(current.value);
  7979. current = current.next;
  7980. }
  7981. return tasks;
  7982. }
  7983. function resume() {
  7984. if (!self2.paused)
  7985. return;
  7986. self2.paused = false;
  7987. for (var i = 0; i < self2.concurrency; i++) {
  7988. _running++;
  7989. release();
  7990. }
  7991. }
  7992. function idle() {
  7993. return _running === 0 && self2.length() === 0;
  7994. }
  7995. function push(value, done) {
  7996. var current = cache.get();
  7997. current.context = context;
  7998. current.release = release;
  7999. current.value = value;
  8000. current.callback = done || noop;
  8001. current.errorHandler = errorHandler;
  8002. if (_running === self2.concurrency || self2.paused) {
  8003. if (queueTail) {
  8004. queueTail.next = current;
  8005. queueTail = current;
  8006. } else {
  8007. queueHead = current;
  8008. queueTail = current;
  8009. self2.saturated();
  8010. }
  8011. } else {
  8012. _running++;
  8013. worker.call(context, current.value, current.worked);
  8014. }
  8015. }
  8016. function unshift(value, done) {
  8017. var current = cache.get();
  8018. current.context = context;
  8019. current.release = release;
  8020. current.value = value;
  8021. current.callback = done || noop;
  8022. if (_running === self2.concurrency || self2.paused) {
  8023. if (queueHead) {
  8024. current.next = queueHead;
  8025. queueHead = current;
  8026. } else {
  8027. queueHead = current;
  8028. queueTail = current;
  8029. self2.saturated();
  8030. }
  8031. } else {
  8032. _running++;
  8033. worker.call(context, current.value, current.worked);
  8034. }
  8035. }
  8036. function release(holder) {
  8037. if (holder) {
  8038. cache.release(holder);
  8039. }
  8040. var next = queueHead;
  8041. if (next) {
  8042. if (!self2.paused) {
  8043. if (queueTail === queueHead) {
  8044. queueTail = null;
  8045. }
  8046. queueHead = next.next;
  8047. next.next = null;
  8048. worker.call(context, next.value, next.worked);
  8049. if (queueTail === null) {
  8050. self2.empty();
  8051. }
  8052. } else {
  8053. _running--;
  8054. }
  8055. } else if (--_running === 0) {
  8056. self2.drain();
  8057. }
  8058. }
  8059. function kill() {
  8060. queueHead = null;
  8061. queueTail = null;
  8062. self2.drain = noop;
  8063. }
  8064. function killAndDrain() {
  8065. queueHead = null;
  8066. queueTail = null;
  8067. self2.drain();
  8068. self2.drain = noop;
  8069. }
  8070. function error(handler) {
  8071. errorHandler = handler;
  8072. }
  8073. }
  8074. function noop() {
  8075. }
  8076. function Task() {
  8077. this.value = null;
  8078. this.callback = noop;
  8079. this.next = null;
  8080. this.release = noop;
  8081. this.context = null;
  8082. this.errorHandler = null;
  8083. var self2 = this;
  8084. this.worked = function worked(err, result) {
  8085. var callback = self2.callback;
  8086. var errorHandler = self2.errorHandler;
  8087. var val = self2.value;
  8088. self2.value = null;
  8089. self2.callback = noop;
  8090. if (self2.errorHandler) {
  8091. errorHandler(err, val);
  8092. }
  8093. callback.call(self2.context, err, result);
  8094. self2.release(self2);
  8095. };
  8096. }
  8097. function queueAsPromised(context, worker, concurrency) {
  8098. if (typeof context === "function") {
  8099. concurrency = worker;
  8100. worker = context;
  8101. context = null;
  8102. }
  8103. function asyncWrapper(arg, cb) {
  8104. worker.call(this, arg).then(function(res) {
  8105. cb(null, res);
  8106. }, cb);
  8107. }
  8108. var queue = fastqueue(context, asyncWrapper, concurrency);
  8109. var pushCb = queue.push;
  8110. var unshiftCb = queue.unshift;
  8111. queue.push = push;
  8112. queue.unshift = unshift;
  8113. queue.drained = drained;
  8114. return queue;
  8115. function push(value) {
  8116. var p = new Promise(function(resolve, reject) {
  8117. pushCb(value, function(err, result) {
  8118. if (err) {
  8119. reject(err);
  8120. return;
  8121. }
  8122. resolve(result);
  8123. });
  8124. });
  8125. p.catch(noop);
  8126. return p;
  8127. }
  8128. function unshift(value) {
  8129. var p = new Promise(function(resolve, reject) {
  8130. unshiftCb(value, function(err, result) {
  8131. if (err) {
  8132. reject(err);
  8133. return;
  8134. }
  8135. resolve(result);
  8136. });
  8137. });
  8138. p.catch(noop);
  8139. return p;
  8140. }
  8141. function drained() {
  8142. var previousDrain = queue.drain;
  8143. var p = new Promise(function(resolve) {
  8144. queue.drain = function() {
  8145. previousDrain();
  8146. resolve();
  8147. };
  8148. });
  8149. return p;
  8150. }
  8151. }
  8152. module2.exports = fastqueue;
  8153. module2.exports.promise = queueAsPromised;
  8154. }
  8155. });
  8156. var require_common2 = __commonJS2({
  8157. "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
  8158. "use strict";
  8159. Object.defineProperty(exports2, "__esModule", {
  8160. value: true
  8161. });
  8162. exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
  8163. function isFatalError(settings, error) {
  8164. if (settings.errorFilter === null) {
  8165. return true;
  8166. }
  8167. return !settings.errorFilter(error);
  8168. }
  8169. exports2.isFatalError = isFatalError;
  8170. function isAppliedFilter(filter, value) {
  8171. return filter === null || filter(value);
  8172. }
  8173. exports2.isAppliedFilter = isAppliedFilter;
  8174. function replacePathSegmentSeparator(filepath, separator) {
  8175. return filepath.split(/[/\\]/).join(separator);
  8176. }
  8177. exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
  8178. function joinPathSegments(a, b, separator) {
  8179. if (a === "") {
  8180. return b;
  8181. }
  8182. if (a.endsWith(separator)) {
  8183. return a + b;
  8184. }
  8185. return a + separator + b;
  8186. }
  8187. exports2.joinPathSegments = joinPathSegments;
  8188. }
  8189. });
  8190. var require_reader = __commonJS2({
  8191. "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
  8192. "use strict";
  8193. Object.defineProperty(exports2, "__esModule", {
  8194. value: true
  8195. });
  8196. var common = require_common2();
  8197. var Reader = class {
  8198. constructor(_root, _settings) {
  8199. this._root = _root;
  8200. this._settings = _settings;
  8201. this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  8202. }
  8203. };
  8204. exports2.default = Reader;
  8205. }
  8206. });
  8207. var require_async3 = __commonJS2({
  8208. "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
  8209. "use strict";
  8210. Object.defineProperty(exports2, "__esModule", {
  8211. value: true
  8212. });
  8213. var events_1 = require("events");
  8214. var fsScandir = require_out2();
  8215. var fastq = require_queue();
  8216. var common = require_common2();
  8217. var reader_1 = require_reader();
  8218. var AsyncReader = class extends reader_1.default {
  8219. constructor(_root, _settings) {
  8220. super(_root, _settings);
  8221. this._settings = _settings;
  8222. this._scandir = fsScandir.scandir;
  8223. this._emitter = new events_1.EventEmitter();
  8224. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  8225. this._isFatalError = false;
  8226. this._isDestroyed = false;
  8227. this._queue.drain = () => {
  8228. if (!this._isFatalError) {
  8229. this._emitter.emit("end");
  8230. }
  8231. };
  8232. }
  8233. read() {
  8234. this._isFatalError = false;
  8235. this._isDestroyed = false;
  8236. setImmediate(() => {
  8237. this._pushToQueue(this._root, this._settings.basePath);
  8238. });
  8239. return this._emitter;
  8240. }
  8241. get isDestroyed() {
  8242. return this._isDestroyed;
  8243. }
  8244. destroy() {
  8245. if (this._isDestroyed) {
  8246. throw new Error("The reader is already destroyed");
  8247. }
  8248. this._isDestroyed = true;
  8249. this._queue.killAndDrain();
  8250. }
  8251. onEntry(callback) {
  8252. this._emitter.on("entry", callback);
  8253. }
  8254. onError(callback) {
  8255. this._emitter.once("error", callback);
  8256. }
  8257. onEnd(callback) {
  8258. this._emitter.once("end", callback);
  8259. }
  8260. _pushToQueue(directory, base) {
  8261. const queueItem = {
  8262. directory,
  8263. base
  8264. };
  8265. this._queue.push(queueItem, (error) => {
  8266. if (error !== null) {
  8267. this._handleError(error);
  8268. }
  8269. });
  8270. }
  8271. _worker(item, done) {
  8272. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  8273. if (error !== null) {
  8274. done(error, void 0);
  8275. return;
  8276. }
  8277. for (const entry of entries) {
  8278. this._handleEntry(entry, item.base);
  8279. }
  8280. done(null, void 0);
  8281. });
  8282. }
  8283. _handleError(error) {
  8284. if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
  8285. return;
  8286. }
  8287. this._isFatalError = true;
  8288. this._isDestroyed = true;
  8289. this._emitter.emit("error", error);
  8290. }
  8291. _handleEntry(entry, base) {
  8292. if (this._isDestroyed || this._isFatalError) {
  8293. return;
  8294. }
  8295. const fullpath = entry.path;
  8296. if (base !== void 0) {
  8297. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8298. }
  8299. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8300. this._emitEntry(entry);
  8301. }
  8302. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8303. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8304. }
  8305. }
  8306. _emitEntry(entry) {
  8307. this._emitter.emit("entry", entry);
  8308. }
  8309. };
  8310. exports2.default = AsyncReader;
  8311. }
  8312. });
  8313. var require_async4 = __commonJS2({
  8314. "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
  8315. "use strict";
  8316. Object.defineProperty(exports2, "__esModule", {
  8317. value: true
  8318. });
  8319. var async_1 = require_async3();
  8320. var AsyncProvider = class {
  8321. constructor(_root, _settings) {
  8322. this._root = _root;
  8323. this._settings = _settings;
  8324. this._reader = new async_1.default(this._root, this._settings);
  8325. this._storage = [];
  8326. }
  8327. read(callback) {
  8328. this._reader.onError((error) => {
  8329. callFailureCallback(callback, error);
  8330. });
  8331. this._reader.onEntry((entry) => {
  8332. this._storage.push(entry);
  8333. });
  8334. this._reader.onEnd(() => {
  8335. callSuccessCallback(callback, this._storage);
  8336. });
  8337. this._reader.read();
  8338. }
  8339. };
  8340. exports2.default = AsyncProvider;
  8341. function callFailureCallback(callback, error) {
  8342. callback(error);
  8343. }
  8344. function callSuccessCallback(callback, entries) {
  8345. callback(null, entries);
  8346. }
  8347. }
  8348. });
  8349. var require_stream2 = __commonJS2({
  8350. "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
  8351. "use strict";
  8352. Object.defineProperty(exports2, "__esModule", {
  8353. value: true
  8354. });
  8355. var stream_1 = require("stream");
  8356. var async_1 = require_async3();
  8357. var StreamProvider = class {
  8358. constructor(_root, _settings) {
  8359. this._root = _root;
  8360. this._settings = _settings;
  8361. this._reader = new async_1.default(this._root, this._settings);
  8362. this._stream = new stream_1.Readable({
  8363. objectMode: true,
  8364. read: () => {
  8365. },
  8366. destroy: () => {
  8367. if (!this._reader.isDestroyed) {
  8368. this._reader.destroy();
  8369. }
  8370. }
  8371. });
  8372. }
  8373. read() {
  8374. this._reader.onError((error) => {
  8375. this._stream.emit("error", error);
  8376. });
  8377. this._reader.onEntry((entry) => {
  8378. this._stream.push(entry);
  8379. });
  8380. this._reader.onEnd(() => {
  8381. this._stream.push(null);
  8382. });
  8383. this._reader.read();
  8384. return this._stream;
  8385. }
  8386. };
  8387. exports2.default = StreamProvider;
  8388. }
  8389. });
  8390. var require_sync3 = __commonJS2({
  8391. "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
  8392. "use strict";
  8393. Object.defineProperty(exports2, "__esModule", {
  8394. value: true
  8395. });
  8396. var fsScandir = require_out2();
  8397. var common = require_common2();
  8398. var reader_1 = require_reader();
  8399. var SyncReader = class extends reader_1.default {
  8400. constructor() {
  8401. super(...arguments);
  8402. this._scandir = fsScandir.scandirSync;
  8403. this._storage = [];
  8404. this._queue = /* @__PURE__ */ new Set();
  8405. }
  8406. read() {
  8407. this._pushToQueue(this._root, this._settings.basePath);
  8408. this._handleQueue();
  8409. return this._storage;
  8410. }
  8411. _pushToQueue(directory, base) {
  8412. this._queue.add({
  8413. directory,
  8414. base
  8415. });
  8416. }
  8417. _handleQueue() {
  8418. for (const item of this._queue.values()) {
  8419. this._handleDirectory(item.directory, item.base);
  8420. }
  8421. }
  8422. _handleDirectory(directory, base) {
  8423. try {
  8424. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  8425. for (const entry of entries) {
  8426. this._handleEntry(entry, base);
  8427. }
  8428. } catch (error) {
  8429. this._handleError(error);
  8430. }
  8431. }
  8432. _handleError(error) {
  8433. if (!common.isFatalError(this._settings, error)) {
  8434. return;
  8435. }
  8436. throw error;
  8437. }
  8438. _handleEntry(entry, base) {
  8439. const fullpath = entry.path;
  8440. if (base !== void 0) {
  8441. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8442. }
  8443. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8444. this._pushToStorage(entry);
  8445. }
  8446. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8447. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8448. }
  8449. }
  8450. _pushToStorage(entry) {
  8451. this._storage.push(entry);
  8452. }
  8453. };
  8454. exports2.default = SyncReader;
  8455. }
  8456. });
  8457. var require_sync4 = __commonJS2({
  8458. "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
  8459. "use strict";
  8460. Object.defineProperty(exports2, "__esModule", {
  8461. value: true
  8462. });
  8463. var sync_1 = require_sync3();
  8464. var SyncProvider = class {
  8465. constructor(_root, _settings) {
  8466. this._root = _root;
  8467. this._settings = _settings;
  8468. this._reader = new sync_1.default(this._root, this._settings);
  8469. }
  8470. read() {
  8471. return this._reader.read();
  8472. }
  8473. };
  8474. exports2.default = SyncProvider;
  8475. }
  8476. });
  8477. var require_settings3 = __commonJS2({
  8478. "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
  8479. "use strict";
  8480. Object.defineProperty(exports2, "__esModule", {
  8481. value: true
  8482. });
  8483. var path = require("path");
  8484. var fsScandir = require_out2();
  8485. var Settings = class {
  8486. constructor(_options = {}) {
  8487. this._options = _options;
  8488. this.basePath = this._getValue(this._options.basePath, void 0);
  8489. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  8490. this.deepFilter = this._getValue(this._options.deepFilter, null);
  8491. this.entryFilter = this._getValue(this._options.entryFilter, null);
  8492. this.errorFilter = this._getValue(this._options.errorFilter, null);
  8493. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  8494. this.fsScandirSettings = new fsScandir.Settings({
  8495. followSymbolicLinks: this._options.followSymbolicLinks,
  8496. fs: this._options.fs,
  8497. pathSegmentSeparator: this._options.pathSegmentSeparator,
  8498. stats: this._options.stats,
  8499. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  8500. });
  8501. }
  8502. _getValue(option, value) {
  8503. return option !== null && option !== void 0 ? option : value;
  8504. }
  8505. };
  8506. exports2.default = Settings;
  8507. }
  8508. });
  8509. var require_out3 = __commonJS2({
  8510. "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
  8511. "use strict";
  8512. Object.defineProperty(exports2, "__esModule", {
  8513. value: true
  8514. });
  8515. exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
  8516. var async_1 = require_async4();
  8517. var stream_1 = require_stream2();
  8518. var sync_1 = require_sync4();
  8519. var settings_1 = require_settings3();
  8520. exports2.Settings = settings_1.default;
  8521. function walk(directory, optionsOrSettingsOrCallback, callback) {
  8522. if (typeof optionsOrSettingsOrCallback === "function") {
  8523. new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  8524. return;
  8525. }
  8526. new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  8527. }
  8528. exports2.walk = walk;
  8529. function walkSync(directory, optionsOrSettings) {
  8530. const settings = getSettings(optionsOrSettings);
  8531. const provider = new sync_1.default(directory, settings);
  8532. return provider.read();
  8533. }
  8534. exports2.walkSync = walkSync;
  8535. function walkStream(directory, optionsOrSettings) {
  8536. const settings = getSettings(optionsOrSettings);
  8537. const provider = new stream_1.default(directory, settings);
  8538. return provider.read();
  8539. }
  8540. exports2.walkStream = walkStream;
  8541. function getSettings(settingsOrOptions = {}) {
  8542. if (settingsOrOptions instanceof settings_1.default) {
  8543. return settingsOrOptions;
  8544. }
  8545. return new settings_1.default(settingsOrOptions);
  8546. }
  8547. }
  8548. });
  8549. var require_reader2 = __commonJS2({
  8550. "node_modules/fast-glob/out/readers/reader.js"(exports2) {
  8551. "use strict";
  8552. Object.defineProperty(exports2, "__esModule", {
  8553. value: true
  8554. });
  8555. var path = require("path");
  8556. var fsStat = require_out();
  8557. var utils = require_utils4();
  8558. var Reader = class {
  8559. constructor(_settings) {
  8560. this._settings = _settings;
  8561. this._fsStatSettings = new fsStat.Settings({
  8562. followSymbolicLink: this._settings.followSymbolicLinks,
  8563. fs: this._settings.fs,
  8564. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  8565. });
  8566. }
  8567. _getFullEntryPath(filepath) {
  8568. return path.resolve(this._settings.cwd, filepath);
  8569. }
  8570. _makeEntry(stats, pattern) {
  8571. const entry = {
  8572. name: pattern,
  8573. path: pattern,
  8574. dirent: utils.fs.createDirentFromStats(pattern, stats)
  8575. };
  8576. if (this._settings.stats) {
  8577. entry.stats = stats;
  8578. }
  8579. return entry;
  8580. }
  8581. _isFatalError(error) {
  8582. return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  8583. }
  8584. };
  8585. exports2.default = Reader;
  8586. }
  8587. });
  8588. var require_stream3 = __commonJS2({
  8589. "node_modules/fast-glob/out/readers/stream.js"(exports2) {
  8590. "use strict";
  8591. Object.defineProperty(exports2, "__esModule", {
  8592. value: true
  8593. });
  8594. var stream_1 = require("stream");
  8595. var fsStat = require_out();
  8596. var fsWalk = require_out3();
  8597. var reader_1 = require_reader2();
  8598. var ReaderStream = class extends reader_1.default {
  8599. constructor() {
  8600. super(...arguments);
  8601. this._walkStream = fsWalk.walkStream;
  8602. this._stat = fsStat.stat;
  8603. }
  8604. dynamic(root, options) {
  8605. return this._walkStream(root, options);
  8606. }
  8607. static(patterns, options) {
  8608. const filepaths = patterns.map(this._getFullEntryPath, this);
  8609. const stream = new stream_1.PassThrough({
  8610. objectMode: true
  8611. });
  8612. stream._write = (index, _enc, done) => {
  8613. return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
  8614. if (entry !== null && options.entryFilter(entry)) {
  8615. stream.push(entry);
  8616. }
  8617. if (index === filepaths.length - 1) {
  8618. stream.end();
  8619. }
  8620. done();
  8621. }).catch(done);
  8622. };
  8623. for (let i = 0; i < filepaths.length; i++) {
  8624. stream.write(i);
  8625. }
  8626. return stream;
  8627. }
  8628. _getEntry(filepath, pattern, options) {
  8629. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
  8630. if (options.errorFilter(error)) {
  8631. return null;
  8632. }
  8633. throw error;
  8634. });
  8635. }
  8636. _getStat(filepath) {
  8637. return new Promise((resolve, reject) => {
  8638. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  8639. return error === null ? resolve(stats) : reject(error);
  8640. });
  8641. });
  8642. }
  8643. };
  8644. exports2.default = ReaderStream;
  8645. }
  8646. });
  8647. var require_async5 = __commonJS2({
  8648. "node_modules/fast-glob/out/readers/async.js"(exports2) {
  8649. "use strict";
  8650. Object.defineProperty(exports2, "__esModule", {
  8651. value: true
  8652. });
  8653. var fsWalk = require_out3();
  8654. var reader_1 = require_reader2();
  8655. var stream_1 = require_stream3();
  8656. var ReaderAsync = class extends reader_1.default {
  8657. constructor() {
  8658. super(...arguments);
  8659. this._walkAsync = fsWalk.walk;
  8660. this._readerStream = new stream_1.default(this._settings);
  8661. }
  8662. dynamic(root, options) {
  8663. return new Promise((resolve, reject) => {
  8664. this._walkAsync(root, options, (error, entries) => {
  8665. if (error === null) {
  8666. resolve(entries);
  8667. } else {
  8668. reject(error);
  8669. }
  8670. });
  8671. });
  8672. }
  8673. async static(patterns, options) {
  8674. const entries = [];
  8675. const stream = this._readerStream.static(patterns, options);
  8676. return new Promise((resolve, reject) => {
  8677. stream.once("error", reject);
  8678. stream.on("data", (entry) => entries.push(entry));
  8679. stream.once("end", () => resolve(entries));
  8680. });
  8681. }
  8682. };
  8683. exports2.default = ReaderAsync;
  8684. }
  8685. });
  8686. var require_matcher = __commonJS2({
  8687. "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
  8688. "use strict";
  8689. Object.defineProperty(exports2, "__esModule", {
  8690. value: true
  8691. });
  8692. var utils = require_utils4();
  8693. var Matcher = class {
  8694. constructor(_patterns, _settings, _micromatchOptions) {
  8695. this._patterns = _patterns;
  8696. this._settings = _settings;
  8697. this._micromatchOptions = _micromatchOptions;
  8698. this._storage = [];
  8699. this._fillStorage();
  8700. }
  8701. _fillStorage() {
  8702. const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
  8703. for (const pattern of patterns) {
  8704. const segments = this._getPatternSegments(pattern);
  8705. const sections = this._splitSegmentsIntoSections(segments);
  8706. this._storage.push({
  8707. complete: sections.length <= 1,
  8708. pattern,
  8709. segments,
  8710. sections
  8711. });
  8712. }
  8713. }
  8714. _getPatternSegments(pattern) {
  8715. const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
  8716. return parts.map((part) => {
  8717. const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
  8718. if (!dynamic) {
  8719. return {
  8720. dynamic: false,
  8721. pattern: part
  8722. };
  8723. }
  8724. return {
  8725. dynamic: true,
  8726. pattern: part,
  8727. patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
  8728. };
  8729. });
  8730. }
  8731. _splitSegmentsIntoSections(segments) {
  8732. return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
  8733. }
  8734. };
  8735. exports2.default = Matcher;
  8736. }
  8737. });
  8738. var require_partial = __commonJS2({
  8739. "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
  8740. "use strict";
  8741. Object.defineProperty(exports2, "__esModule", {
  8742. value: true
  8743. });
  8744. var matcher_1 = require_matcher();
  8745. var PartialMatcher = class extends matcher_1.default {
  8746. match(filepath) {
  8747. const parts = filepath.split("/");
  8748. const levels = parts.length;
  8749. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  8750. for (const pattern of patterns) {
  8751. const section = pattern.sections[0];
  8752. if (!pattern.complete && levels > section.length) {
  8753. return true;
  8754. }
  8755. const match = parts.every((part, index) => {
  8756. const segment = pattern.segments[index];
  8757. if (segment.dynamic && segment.patternRe.test(part)) {
  8758. return true;
  8759. }
  8760. if (!segment.dynamic && segment.pattern === part) {
  8761. return true;
  8762. }
  8763. return false;
  8764. });
  8765. if (match) {
  8766. return true;
  8767. }
  8768. }
  8769. return false;
  8770. }
  8771. };
  8772. exports2.default = PartialMatcher;
  8773. }
  8774. });
  8775. var require_deep = __commonJS2({
  8776. "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
  8777. "use strict";
  8778. Object.defineProperty(exports2, "__esModule", {
  8779. value: true
  8780. });
  8781. var utils = require_utils4();
  8782. var partial_1 = require_partial();
  8783. var DeepFilter = class {
  8784. constructor(_settings, _micromatchOptions) {
  8785. this._settings = _settings;
  8786. this._micromatchOptions = _micromatchOptions;
  8787. }
  8788. getFilter(basePath, positive, negative) {
  8789. const matcher = this._getMatcher(positive);
  8790. const negativeRe = this._getNegativePatternsRe(negative);
  8791. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  8792. }
  8793. _getMatcher(patterns) {
  8794. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  8795. }
  8796. _getNegativePatternsRe(patterns) {
  8797. const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
  8798. return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  8799. }
  8800. _filter(basePath, entry, matcher, negativeRe) {
  8801. if (this._isSkippedByDeep(basePath, entry.path)) {
  8802. return false;
  8803. }
  8804. if (this._isSkippedSymbolicLink(entry)) {
  8805. return false;
  8806. }
  8807. const filepath = utils.path.removeLeadingDotSegment(entry.path);
  8808. if (this._isSkippedByPositivePatterns(filepath, matcher)) {
  8809. return false;
  8810. }
  8811. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  8812. }
  8813. _isSkippedByDeep(basePath, entryPath) {
  8814. if (this._settings.deep === Infinity) {
  8815. return false;
  8816. }
  8817. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  8818. }
  8819. _getEntryLevel(basePath, entryPath) {
  8820. const entryPathDepth = entryPath.split("/").length;
  8821. if (basePath === "") {
  8822. return entryPathDepth;
  8823. }
  8824. const basePathDepth = basePath.split("/").length;
  8825. return entryPathDepth - basePathDepth;
  8826. }
  8827. _isSkippedSymbolicLink(entry) {
  8828. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  8829. }
  8830. _isSkippedByPositivePatterns(entryPath, matcher) {
  8831. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  8832. }
  8833. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  8834. return !utils.pattern.matchAny(entryPath, patternsRe);
  8835. }
  8836. };
  8837. exports2.default = DeepFilter;
  8838. }
  8839. });
  8840. var require_entry = __commonJS2({
  8841. "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
  8842. "use strict";
  8843. Object.defineProperty(exports2, "__esModule", {
  8844. value: true
  8845. });
  8846. var utils = require_utils4();
  8847. var EntryFilter = class {
  8848. constructor(_settings, _micromatchOptions) {
  8849. this._settings = _settings;
  8850. this._micromatchOptions = _micromatchOptions;
  8851. this.index = /* @__PURE__ */ new Map();
  8852. }
  8853. getFilter(positive, negative) {
  8854. const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
  8855. const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
  8856. return (entry) => this._filter(entry, positiveRe, negativeRe);
  8857. }
  8858. _filter(entry, positiveRe, negativeRe) {
  8859. if (this._settings.unique && this._isDuplicateEntry(entry)) {
  8860. return false;
  8861. }
  8862. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
  8863. return false;
  8864. }
  8865. if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
  8866. return false;
  8867. }
  8868. const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
  8869. const isDirectory = entry.dirent.isDirectory();
  8870. const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
  8871. if (this._settings.unique && isMatched) {
  8872. this._createIndexRecord(entry);
  8873. }
  8874. return isMatched;
  8875. }
  8876. _isDuplicateEntry(entry) {
  8877. return this.index.has(entry.path);
  8878. }
  8879. _createIndexRecord(entry) {
  8880. this.index.set(entry.path, void 0);
  8881. }
  8882. _onlyFileFilter(entry) {
  8883. return this._settings.onlyFiles && !entry.dirent.isFile();
  8884. }
  8885. _onlyDirectoryFilter(entry) {
  8886. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  8887. }
  8888. _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
  8889. if (!this._settings.absolute) {
  8890. return false;
  8891. }
  8892. const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
  8893. return utils.pattern.matchAny(fullpath, patternsRe);
  8894. }
  8895. _isMatchToPatterns(entryPath, patternsRe, isDirectory) {
  8896. const filepath = utils.path.removeLeadingDotSegment(entryPath);
  8897. const isMatched = utils.pattern.matchAny(filepath, patternsRe);
  8898. if (!isMatched && isDirectory) {
  8899. return utils.pattern.matchAny(filepath + "/", patternsRe);
  8900. }
  8901. return isMatched;
  8902. }
  8903. };
  8904. exports2.default = EntryFilter;
  8905. }
  8906. });
  8907. var require_error = __commonJS2({
  8908. "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
  8909. "use strict";
  8910. Object.defineProperty(exports2, "__esModule", {
  8911. value: true
  8912. });
  8913. var utils = require_utils4();
  8914. var ErrorFilter = class {
  8915. constructor(_settings) {
  8916. this._settings = _settings;
  8917. }
  8918. getFilter() {
  8919. return (error) => this._isNonFatalError(error);
  8920. }
  8921. _isNonFatalError(error) {
  8922. return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  8923. }
  8924. };
  8925. exports2.default = ErrorFilter;
  8926. }
  8927. });
  8928. var require_entry2 = __commonJS2({
  8929. "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
  8930. "use strict";
  8931. Object.defineProperty(exports2, "__esModule", {
  8932. value: true
  8933. });
  8934. var utils = require_utils4();
  8935. var EntryTransformer = class {
  8936. constructor(_settings) {
  8937. this._settings = _settings;
  8938. }
  8939. getTransformer() {
  8940. return (entry) => this._transform(entry);
  8941. }
  8942. _transform(entry) {
  8943. let filepath = entry.path;
  8944. if (this._settings.absolute) {
  8945. filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
  8946. filepath = utils.path.unixify(filepath);
  8947. }
  8948. if (this._settings.markDirectories && entry.dirent.isDirectory()) {
  8949. filepath += "/";
  8950. }
  8951. if (!this._settings.objectMode) {
  8952. return filepath;
  8953. }
  8954. return Object.assign(Object.assign({}, entry), {
  8955. path: filepath
  8956. });
  8957. }
  8958. };
  8959. exports2.default = EntryTransformer;
  8960. }
  8961. });
  8962. var require_provider = __commonJS2({
  8963. "node_modules/fast-glob/out/providers/provider.js"(exports2) {
  8964. "use strict";
  8965. Object.defineProperty(exports2, "__esModule", {
  8966. value: true
  8967. });
  8968. var path = require("path");
  8969. var deep_1 = require_deep();
  8970. var entry_1 = require_entry();
  8971. var error_1 = require_error();
  8972. var entry_2 = require_entry2();
  8973. var Provider = class {
  8974. constructor(_settings) {
  8975. this._settings = _settings;
  8976. this.errorFilter = new error_1.default(this._settings);
  8977. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  8978. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  8979. this.entryTransformer = new entry_2.default(this._settings);
  8980. }
  8981. _getRootDirectory(task) {
  8982. return path.resolve(this._settings.cwd, task.base);
  8983. }
  8984. _getReaderOptions(task) {
  8985. const basePath = task.base === "." ? "" : task.base;
  8986. return {
  8987. basePath,
  8988. pathSegmentSeparator: "/",
  8989. concurrency: this._settings.concurrency,
  8990. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  8991. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  8992. errorFilter: this.errorFilter.getFilter(),
  8993. followSymbolicLinks: this._settings.followSymbolicLinks,
  8994. fs: this._settings.fs,
  8995. stats: this._settings.stats,
  8996. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  8997. transform: this.entryTransformer.getTransformer()
  8998. };
  8999. }
  9000. _getMicromatchOptions() {
  9001. return {
  9002. dot: this._settings.dot,
  9003. matchBase: this._settings.baseNameMatch,
  9004. nobrace: !this._settings.braceExpansion,
  9005. nocase: !this._settings.caseSensitiveMatch,
  9006. noext: !this._settings.extglob,
  9007. noglobstar: !this._settings.globstar,
  9008. posix: true,
  9009. strictSlashes: false
  9010. };
  9011. }
  9012. };
  9013. exports2.default = Provider;
  9014. }
  9015. });
  9016. var require_async6 = __commonJS2({
  9017. "node_modules/fast-glob/out/providers/async.js"(exports2) {
  9018. "use strict";
  9019. Object.defineProperty(exports2, "__esModule", {
  9020. value: true
  9021. });
  9022. var async_1 = require_async5();
  9023. var provider_1 = require_provider();
  9024. var ProviderAsync = class extends provider_1.default {
  9025. constructor() {
  9026. super(...arguments);
  9027. this._reader = new async_1.default(this._settings);
  9028. }
  9029. async read(task) {
  9030. const root = this._getRootDirectory(task);
  9031. const options = this._getReaderOptions(task);
  9032. const entries = await this.api(root, task, options);
  9033. return entries.map((entry) => options.transform(entry));
  9034. }
  9035. api(root, task, options) {
  9036. if (task.dynamic) {
  9037. return this._reader.dynamic(root, options);
  9038. }
  9039. return this._reader.static(task.patterns, options);
  9040. }
  9041. };
  9042. exports2.default = ProviderAsync;
  9043. }
  9044. });
  9045. var require_stream4 = __commonJS2({
  9046. "node_modules/fast-glob/out/providers/stream.js"(exports2) {
  9047. "use strict";
  9048. Object.defineProperty(exports2, "__esModule", {
  9049. value: true
  9050. });
  9051. var stream_1 = require("stream");
  9052. var stream_2 = require_stream3();
  9053. var provider_1 = require_provider();
  9054. var ProviderStream = class extends provider_1.default {
  9055. constructor() {
  9056. super(...arguments);
  9057. this._reader = new stream_2.default(this._settings);
  9058. }
  9059. read(task) {
  9060. const root = this._getRootDirectory(task);
  9061. const options = this._getReaderOptions(task);
  9062. const source = this.api(root, task, options);
  9063. const destination = new stream_1.Readable({
  9064. objectMode: true,
  9065. read: () => {
  9066. }
  9067. });
  9068. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
  9069. destination.once("close", () => source.destroy());
  9070. return destination;
  9071. }
  9072. api(root, task, options) {
  9073. if (task.dynamic) {
  9074. return this._reader.dynamic(root, options);
  9075. }
  9076. return this._reader.static(task.patterns, options);
  9077. }
  9078. };
  9079. exports2.default = ProviderStream;
  9080. }
  9081. });
  9082. var require_sync5 = __commonJS2({
  9083. "node_modules/fast-glob/out/readers/sync.js"(exports2) {
  9084. "use strict";
  9085. Object.defineProperty(exports2, "__esModule", {
  9086. value: true
  9087. });
  9088. var fsStat = require_out();
  9089. var fsWalk = require_out3();
  9090. var reader_1 = require_reader2();
  9091. var ReaderSync = class extends reader_1.default {
  9092. constructor() {
  9093. super(...arguments);
  9094. this._walkSync = fsWalk.walkSync;
  9095. this._statSync = fsStat.statSync;
  9096. }
  9097. dynamic(root, options) {
  9098. return this._walkSync(root, options);
  9099. }
  9100. static(patterns, options) {
  9101. const entries = [];
  9102. for (const pattern of patterns) {
  9103. const filepath = this._getFullEntryPath(pattern);
  9104. const entry = this._getEntry(filepath, pattern, options);
  9105. if (entry === null || !options.entryFilter(entry)) {
  9106. continue;
  9107. }
  9108. entries.push(entry);
  9109. }
  9110. return entries;
  9111. }
  9112. _getEntry(filepath, pattern, options) {
  9113. try {
  9114. const stats = this._getStat(filepath);
  9115. return this._makeEntry(stats, pattern);
  9116. } catch (error) {
  9117. if (options.errorFilter(error)) {
  9118. return null;
  9119. }
  9120. throw error;
  9121. }
  9122. }
  9123. _getStat(filepath) {
  9124. return this._statSync(filepath, this._fsStatSettings);
  9125. }
  9126. };
  9127. exports2.default = ReaderSync;
  9128. }
  9129. });
  9130. var require_sync6 = __commonJS2({
  9131. "node_modules/fast-glob/out/providers/sync.js"(exports2) {
  9132. "use strict";
  9133. Object.defineProperty(exports2, "__esModule", {
  9134. value: true
  9135. });
  9136. var sync_1 = require_sync5();
  9137. var provider_1 = require_provider();
  9138. var ProviderSync = class extends provider_1.default {
  9139. constructor() {
  9140. super(...arguments);
  9141. this._reader = new sync_1.default(this._settings);
  9142. }
  9143. read(task) {
  9144. const root = this._getRootDirectory(task);
  9145. const options = this._getReaderOptions(task);
  9146. const entries = this.api(root, task, options);
  9147. return entries.map(options.transform);
  9148. }
  9149. api(root, task, options) {
  9150. if (task.dynamic) {
  9151. return this._reader.dynamic(root, options);
  9152. }
  9153. return this._reader.static(task.patterns, options);
  9154. }
  9155. };
  9156. exports2.default = ProviderSync;
  9157. }
  9158. });
  9159. var require_settings4 = __commonJS2({
  9160. "node_modules/fast-glob/out/settings.js"(exports2) {
  9161. "use strict";
  9162. Object.defineProperty(exports2, "__esModule", {
  9163. value: true
  9164. });
  9165. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
  9166. var fs = require("fs");
  9167. var os2 = require("os");
  9168. var CPU_COUNT = Math.max(os2.cpus().length, 1);
  9169. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
  9170. lstat: fs.lstat,
  9171. lstatSync: fs.lstatSync,
  9172. stat: fs.stat,
  9173. statSync: fs.statSync,
  9174. readdir: fs.readdir,
  9175. readdirSync: fs.readdirSync
  9176. };
  9177. var Settings = class {
  9178. constructor(_options = {}) {
  9179. this._options = _options;
  9180. this.absolute = this._getValue(this._options.absolute, false);
  9181. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  9182. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  9183. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  9184. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  9185. this.cwd = this._getValue(this._options.cwd, process.cwd());
  9186. this.deep = this._getValue(this._options.deep, Infinity);
  9187. this.dot = this._getValue(this._options.dot, false);
  9188. this.extglob = this._getValue(this._options.extglob, true);
  9189. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  9190. this.fs = this._getFileSystemMethods(this._options.fs);
  9191. this.globstar = this._getValue(this._options.globstar, true);
  9192. this.ignore = this._getValue(this._options.ignore, []);
  9193. this.markDirectories = this._getValue(this._options.markDirectories, false);
  9194. this.objectMode = this._getValue(this._options.objectMode, false);
  9195. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  9196. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  9197. this.stats = this._getValue(this._options.stats, false);
  9198. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  9199. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  9200. this.unique = this._getValue(this._options.unique, true);
  9201. if (this.onlyDirectories) {
  9202. this.onlyFiles = false;
  9203. }
  9204. if (this.stats) {
  9205. this.objectMode = true;
  9206. }
  9207. }
  9208. _getValue(option, value) {
  9209. return option === void 0 ? value : option;
  9210. }
  9211. _getFileSystemMethods(methods = {}) {
  9212. return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
  9213. }
  9214. };
  9215. exports2.default = Settings;
  9216. }
  9217. });
  9218. var require_out4 = __commonJS2({
  9219. "node_modules/fast-glob/out/index.js"(exports2, module2) {
  9220. "use strict";
  9221. var taskManager = require_tasks();
  9222. var patternManager = require_patterns();
  9223. var async_1 = require_async6();
  9224. var stream_1 = require_stream4();
  9225. var sync_1 = require_sync6();
  9226. var settings_1 = require_settings4();
  9227. var utils = require_utils4();
  9228. async function FastGlob(source, options) {
  9229. assertPatternsInput(source);
  9230. const works = getWorks(source, async_1.default, options);
  9231. const result = await Promise.all(works);
  9232. return utils.array.flatten(result);
  9233. }
  9234. (function(FastGlob2) {
  9235. function sync(source, options) {
  9236. assertPatternsInput(source);
  9237. const works = getWorks(source, sync_1.default, options);
  9238. return utils.array.flatten(works);
  9239. }
  9240. FastGlob2.sync = sync;
  9241. function stream(source, options) {
  9242. assertPatternsInput(source);
  9243. const works = getWorks(source, stream_1.default, options);
  9244. return utils.stream.merge(works);
  9245. }
  9246. FastGlob2.stream = stream;
  9247. function generateTasks(source, options) {
  9248. assertPatternsInput(source);
  9249. const patterns = patternManager.transform([].concat(source));
  9250. const settings = new settings_1.default(options);
  9251. return taskManager.generate(patterns, settings);
  9252. }
  9253. FastGlob2.generateTasks = generateTasks;
  9254. function isDynamicPattern(source, options) {
  9255. assertPatternsInput(source);
  9256. const settings = new settings_1.default(options);
  9257. return utils.pattern.isDynamicPattern(source, settings);
  9258. }
  9259. FastGlob2.isDynamicPattern = isDynamicPattern;
  9260. function escapePath(source) {
  9261. assertPatternsInput(source);
  9262. return utils.path.escape(source);
  9263. }
  9264. FastGlob2.escapePath = escapePath;
  9265. })(FastGlob || (FastGlob = {}));
  9266. function getWorks(source, _Provider, options) {
  9267. const patterns = patternManager.transform([].concat(source));
  9268. const settings = new settings_1.default(options);
  9269. const tasks = taskManager.generate(patterns, settings);
  9270. const provider = new _Provider(settings);
  9271. return tasks.map(provider.read, provider);
  9272. }
  9273. function assertPatternsInput(input) {
  9274. const source = [].concat(input);
  9275. const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
  9276. if (!isValidSource) {
  9277. throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  9278. }
  9279. }
  9280. module2.exports = FastGlob;
  9281. }
  9282. });
  9283. var require_expand_patterns = __commonJS2({
  9284. "src/cli/expand-patterns.js"(exports2, module2) {
  9285. "use strict";
  9286. var path = require("path");
  9287. var fastGlob = require_out4();
  9288. var {
  9289. statSafe
  9290. } = require_utils();
  9291. async function* expandPatterns(context) {
  9292. const cwd = process.cwd();
  9293. const seen = /* @__PURE__ */ new Set();
  9294. let noResults = true;
  9295. for await (const pathOrError of expandPatternsInternal(context)) {
  9296. noResults = false;
  9297. if (typeof pathOrError !== "string") {
  9298. yield pathOrError;
  9299. continue;
  9300. }
  9301. const relativePath = path.relative(cwd, pathOrError);
  9302. if (seen.has(relativePath)) {
  9303. continue;
  9304. }
  9305. seen.add(relativePath);
  9306. yield relativePath;
  9307. }
  9308. if (noResults && context.argv.errorOnUnmatchedPattern !== false) {
  9309. yield {
  9310. error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
  9311. };
  9312. }
  9313. }
  9314. async function* expandPatternsInternal(context) {
  9315. const silentlyIgnoredDirs = [".git", ".sl", ".svn", ".hg"];
  9316. if (context.argv.withNodeModules !== true) {
  9317. silentlyIgnoredDirs.push("node_modules");
  9318. }
  9319. const globOptions = {
  9320. dot: true,
  9321. ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir)
  9322. };
  9323. let supportedFilesGlob;
  9324. const cwd = process.cwd();
  9325. const entries = [];
  9326. for (const pattern of context.filePatterns) {
  9327. const absolutePath = path.resolve(cwd, pattern);
  9328. if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
  9329. continue;
  9330. }
  9331. const stat = await statSafe(absolutePath);
  9332. if (stat) {
  9333. if (stat.isFile()) {
  9334. entries.push({
  9335. type: "file",
  9336. glob: escapePathForGlob(fixWindowsSlashes(pattern)),
  9337. input: pattern
  9338. });
  9339. } else if (stat.isDirectory()) {
  9340. const relativePath = path.relative(cwd, absolutePath) || ".";
  9341. entries.push({
  9342. type: "dir",
  9343. glob: escapePathForGlob(fixWindowsSlashes(relativePath)) + "/" + getSupportedFilesGlob(),
  9344. input: pattern
  9345. });
  9346. }
  9347. } else if (pattern[0] === "!") {
  9348. globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1)));
  9349. } else {
  9350. entries.push({
  9351. type: "glob",
  9352. glob: fixWindowsSlashes(pattern),
  9353. input: pattern
  9354. });
  9355. }
  9356. }
  9357. for (const {
  9358. type,
  9359. glob,
  9360. input
  9361. } of entries) {
  9362. let result;
  9363. try {
  9364. result = await fastGlob(glob, globOptions);
  9365. } catch ({
  9366. message
  9367. }) {
  9368. yield {
  9369. error: `${errorMessages.globError[type]}: ${input}
  9370. ${message}`
  9371. };
  9372. continue;
  9373. }
  9374. if (result.length === 0) {
  9375. if (context.argv.errorOnUnmatchedPattern !== false) {
  9376. yield {
  9377. error: `${errorMessages.emptyResults[type]}: "${input}".`
  9378. };
  9379. }
  9380. } else {
  9381. yield* sortPaths(result);
  9382. }
  9383. }
  9384. function getSupportedFilesGlob() {
  9385. if (!supportedFilesGlob) {
  9386. const extensions = context.languages.flatMap((lang) => lang.extensions || []);
  9387. const filenames = context.languages.flatMap((lang) => lang.filenames || []);
  9388. supportedFilesGlob = `**/{${[...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
  9389. }
  9390. return supportedFilesGlob;
  9391. }
  9392. }
  9393. var errorMessages = {
  9394. globError: {
  9395. file: "Unable to resolve file",
  9396. dir: "Unable to expand directory",
  9397. glob: "Unable to expand glob pattern"
  9398. },
  9399. emptyResults: {
  9400. file: "Explicitly specified file was ignored due to negative glob patterns",
  9401. dir: "No supported files were found in the directory",
  9402. glob: "No files matching the pattern were found"
  9403. }
  9404. };
  9405. function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
  9406. return path.relative(cwd, absolutePath).split(path.sep).some((dir) => ignoredDirectories.includes(dir));
  9407. }
  9408. function sortPaths(paths) {
  9409. return paths.sort((a, b) => a.localeCompare(b));
  9410. }
  9411. function escapePathForGlob(path2) {
  9412. return fastGlob.escapePath(path2.replace(/\\/g, "\0")).replace(/\\!/g, "@(!)").replace(/\0/g, "@(\\\\)");
  9413. }
  9414. var isWindows = path.sep === "\\";
  9415. function fixWindowsSlashes(pattern) {
  9416. return isWindows ? pattern.replace(/\\/g, "/") : pattern;
  9417. }
  9418. module2.exports = {
  9419. expandPatterns,
  9420. fixWindowsSlashes
  9421. };
  9422. }
  9423. });
  9424. var require_get_options_for_file = __commonJS2({
  9425. "src/cli/options/get-options-for-file.js"(exports2, module2) {
  9426. "use strict";
  9427. var dashify = require_dashify();
  9428. var prettier2 = require("./index.js");
  9429. var {
  9430. optionsNormalizer
  9431. } = require_prettier_internal();
  9432. var minimist = require_minimist2();
  9433. var createMinimistOptions = require_create_minimist_options();
  9434. var normalizeCliOptions = require_normalize_cli_options();
  9435. function getOptions(argv, detailedOptions) {
  9436. return Object.fromEntries(detailedOptions.filter(({
  9437. forwardToApi
  9438. }) => forwardToApi).map(({
  9439. forwardToApi,
  9440. name
  9441. }) => [forwardToApi, argv[name]]));
  9442. }
  9443. function cliifyOptions(object, apiDetailedOptionMap) {
  9444. return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
  9445. const apiOption = apiDetailedOptionMap[key];
  9446. const cliKey = apiOption ? apiOption.name : key;
  9447. return [dashify(cliKey), value];
  9448. }));
  9449. }
  9450. function createApiDetailedOptionMap(detailedOptions) {
  9451. return Object.fromEntries(detailedOptions.filter((option) => option.forwardToApi && option.forwardToApi !== option.name).map((option) => [option.forwardToApi, option]));
  9452. }
  9453. function parseArgsToOptions(context, overrideDefaults) {
  9454. const minimistOptions = createMinimistOptions(context.detailedOptions);
  9455. const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
  9456. return getOptions(normalizeCliOptions(minimist(context.rawArguments, {
  9457. string: minimistOptions.string,
  9458. boolean: minimistOptions.boolean,
  9459. default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
  9460. }), context.detailedOptions, {
  9461. logger: false
  9462. }), context.detailedOptions);
  9463. }
  9464. async function getOptionsOrDie(context, filePath) {
  9465. try {
  9466. if (context.argv.config === false) {
  9467. context.logger.debug("'--no-config' option found, skip loading config file.");
  9468. return null;
  9469. }
  9470. context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
  9471. const options = await prettier2.resolveConfig(filePath, {
  9472. editorconfig: context.argv.editorconfig,
  9473. config: context.argv.config
  9474. });
  9475. context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
  9476. return options;
  9477. } catch (error) {
  9478. context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
  9479. process.exit(2);
  9480. }
  9481. }
  9482. function applyConfigPrecedence(context, options) {
  9483. try {
  9484. switch (context.argv.configPrecedence) {
  9485. case "cli-override":
  9486. return parseArgsToOptions(context, options);
  9487. case "file-override":
  9488. return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
  9489. case "prefer-file":
  9490. return options || parseArgsToOptions(context);
  9491. }
  9492. } catch (error) {
  9493. context.logger.error(error.toString());
  9494. process.exit(2);
  9495. }
  9496. }
  9497. async function getOptionsForFile(context, filepath) {
  9498. const options = await getOptionsOrDie(context, filepath);
  9499. const hasPlugins = options && options.plugins;
  9500. if (hasPlugins) {
  9501. context.pushContextPlugins(options.plugins);
  9502. }
  9503. const appliedOptions = Object.assign({
  9504. filepath
  9505. }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
  9506. logger: context.logger
  9507. })));
  9508. context.logger.debug(`applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}`);
  9509. if (hasPlugins) {
  9510. context.popContextPlugins();
  9511. }
  9512. return appliedOptions;
  9513. }
  9514. module2.exports = getOptionsForFile;
  9515. }
  9516. });
  9517. var require_is_tty = __commonJS2({
  9518. "src/cli/is-tty.js"(exports2, module2) {
  9519. "use strict";
  9520. var {
  9521. isCI
  9522. } = require("./third-party.js");
  9523. module2.exports = function isTTY() {
  9524. return process.stdout.isTTY && !isCI();
  9525. };
  9526. }
  9527. });
  9528. var require_commondir = __commonJS2({
  9529. "node_modules/commondir/index.js"(exports2, module2) {
  9530. var path = require("path");
  9531. module2.exports = function(basedir, relfiles) {
  9532. if (relfiles) {
  9533. var files = relfiles.map(function(r) {
  9534. return path.resolve(basedir, r);
  9535. });
  9536. } else {
  9537. var files = basedir;
  9538. }
  9539. var res = files.slice(1).reduce(function(ps, file) {
  9540. if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
  9541. throw new Error("relative path without a basedir");
  9542. }
  9543. var xs = file.split(/\/+|\\+/);
  9544. for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
  9545. ;
  9546. return ps.slice(0, i);
  9547. }, files[0].split(/\/+|\\+/));
  9548. return res.length > 1 ? res.join("/") : "/";
  9549. };
  9550. }
  9551. });
  9552. var require_p_try = __commonJS2({
  9553. "node_modules/p-try/index.js"(exports2, module2) {
  9554. "use strict";
  9555. var pTry = (fn, ...arguments_) => new Promise((resolve) => {
  9556. resolve(fn(...arguments_));
  9557. });
  9558. module2.exports = pTry;
  9559. module2.exports.default = pTry;
  9560. }
  9561. });
  9562. var require_p_limit = __commonJS2({
  9563. "node_modules/pkg-dir/node_modules/p-limit/index.js"(exports2, module2) {
  9564. "use strict";
  9565. var pTry = require_p_try();
  9566. var pLimit = (concurrency) => {
  9567. if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
  9568. return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
  9569. }
  9570. const queue = [];
  9571. let activeCount = 0;
  9572. const next = () => {
  9573. activeCount--;
  9574. if (queue.length > 0) {
  9575. queue.shift()();
  9576. }
  9577. };
  9578. const run2 = (fn, resolve, ...args) => {
  9579. activeCount++;
  9580. const result = pTry(fn, ...args);
  9581. resolve(result);
  9582. result.then(next, next);
  9583. };
  9584. const enqueue = (fn, resolve, ...args) => {
  9585. if (activeCount < concurrency) {
  9586. run2(fn, resolve, ...args);
  9587. } else {
  9588. queue.push(run2.bind(null, fn, resolve, ...args));
  9589. }
  9590. };
  9591. const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
  9592. Object.defineProperties(generator, {
  9593. activeCount: {
  9594. get: () => activeCount
  9595. },
  9596. pendingCount: {
  9597. get: () => queue.length
  9598. },
  9599. clearQueue: {
  9600. value: () => {
  9601. queue.length = 0;
  9602. }
  9603. }
  9604. });
  9605. return generator;
  9606. };
  9607. module2.exports = pLimit;
  9608. module2.exports.default = pLimit;
  9609. }
  9610. });
  9611. var require_p_locate = __commonJS2({
  9612. "node_modules/pkg-dir/node_modules/p-locate/index.js"(exports2, module2) {
  9613. "use strict";
  9614. var pLimit = require_p_limit();
  9615. var EndError = class extends Error {
  9616. constructor(value) {
  9617. super();
  9618. this.value = value;
  9619. }
  9620. };
  9621. var testElement = async (element, tester) => tester(await element);
  9622. var finder = async (element) => {
  9623. const values = await Promise.all(element);
  9624. if (values[1] === true) {
  9625. throw new EndError(values[0]);
  9626. }
  9627. return false;
  9628. };
  9629. var pLocate = async (iterable, tester, options) => {
  9630. options = Object.assign({
  9631. concurrency: Infinity,
  9632. preserveOrder: true
  9633. }, options);
  9634. const limit = pLimit(options.concurrency);
  9635. const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
  9636. const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
  9637. try {
  9638. await Promise.all(items.map((element) => checkLimit(finder, element)));
  9639. } catch (error) {
  9640. if (error instanceof EndError) {
  9641. return error.value;
  9642. }
  9643. throw error;
  9644. }
  9645. };
  9646. module2.exports = pLocate;
  9647. module2.exports.default = pLocate;
  9648. }
  9649. });
  9650. var require_locate_path = __commonJS2({
  9651. "node_modules/pkg-dir/node_modules/locate-path/index.js"(exports2, module2) {
  9652. "use strict";
  9653. var path = require("path");
  9654. var fs = require("fs");
  9655. var {
  9656. promisify
  9657. } = require("util");
  9658. var pLocate = require_p_locate();
  9659. var fsStat = promisify(fs.stat);
  9660. var fsLStat = promisify(fs.lstat);
  9661. var typeMappings = {
  9662. directory: "isDirectory",
  9663. file: "isFile"
  9664. };
  9665. function checkType({
  9666. type
  9667. }) {
  9668. if (type in typeMappings) {
  9669. return;
  9670. }
  9671. throw new Error(`Invalid type specified: ${type}`);
  9672. }
  9673. var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
  9674. module2.exports = async (paths, options) => {
  9675. options = Object.assign({
  9676. cwd: process.cwd(),
  9677. type: "file",
  9678. allowSymlinks: true
  9679. }, options);
  9680. checkType(options);
  9681. const statFn = options.allowSymlinks ? fsStat : fsLStat;
  9682. return pLocate(paths, async (path_) => {
  9683. try {
  9684. const stat = await statFn(path.resolve(options.cwd, path_));
  9685. return matchType(options.type, stat);
  9686. } catch (_) {
  9687. return false;
  9688. }
  9689. }, options);
  9690. };
  9691. module2.exports.sync = (paths, options) => {
  9692. options = Object.assign({
  9693. cwd: process.cwd(),
  9694. allowSymlinks: true,
  9695. type: "file"
  9696. }, options);
  9697. checkType(options);
  9698. const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
  9699. for (const path_ of paths) {
  9700. try {
  9701. const stat = statFn(path.resolve(options.cwd, path_));
  9702. if (matchType(options.type, stat)) {
  9703. return path_;
  9704. }
  9705. } catch (_) {
  9706. }
  9707. }
  9708. };
  9709. }
  9710. });
  9711. var require_path_exists = __commonJS2({
  9712. "node_modules/path-exists/index.js"(exports2, module2) {
  9713. "use strict";
  9714. var fs = require("fs");
  9715. var {
  9716. promisify
  9717. } = require("util");
  9718. var pAccess = promisify(fs.access);
  9719. module2.exports = async (path) => {
  9720. try {
  9721. await pAccess(path);
  9722. return true;
  9723. } catch (_) {
  9724. return false;
  9725. }
  9726. };
  9727. module2.exports.sync = (path) => {
  9728. try {
  9729. fs.accessSync(path);
  9730. return true;
  9731. } catch (_) {
  9732. return false;
  9733. }
  9734. };
  9735. }
  9736. });
  9737. var require_find_up = __commonJS2({
  9738. "node_modules/pkg-dir/node_modules/find-up/index.js"(exports2, module2) {
  9739. "use strict";
  9740. var path = require("path");
  9741. var locatePath = require_locate_path();
  9742. var pathExists = require_path_exists();
  9743. var stop = Symbol("findUp.stop");
  9744. module2.exports = async (name, options = {}) => {
  9745. let directory = path.resolve(options.cwd || "");
  9746. const {
  9747. root
  9748. } = path.parse(directory);
  9749. const paths = [].concat(name);
  9750. const runMatcher = async (locateOptions) => {
  9751. if (typeof name !== "function") {
  9752. return locatePath(paths, locateOptions);
  9753. }
  9754. const foundPath = await name(locateOptions.cwd);
  9755. if (typeof foundPath === "string") {
  9756. return locatePath([foundPath], locateOptions);
  9757. }
  9758. return foundPath;
  9759. };
  9760. while (true) {
  9761. const foundPath = await runMatcher(Object.assign(Object.assign({}, options), {}, {
  9762. cwd: directory
  9763. }));
  9764. if (foundPath === stop) {
  9765. return;
  9766. }
  9767. if (foundPath) {
  9768. return path.resolve(directory, foundPath);
  9769. }
  9770. if (directory === root) {
  9771. return;
  9772. }
  9773. directory = path.dirname(directory);
  9774. }
  9775. };
  9776. module2.exports.sync = (name, options = {}) => {
  9777. let directory = path.resolve(options.cwd || "");
  9778. const {
  9779. root
  9780. } = path.parse(directory);
  9781. const paths = [].concat(name);
  9782. const runMatcher = (locateOptions) => {
  9783. if (typeof name !== "function") {
  9784. return locatePath.sync(paths, locateOptions);
  9785. }
  9786. const foundPath = name(locateOptions.cwd);
  9787. if (typeof foundPath === "string") {
  9788. return locatePath.sync([foundPath], locateOptions);
  9789. }
  9790. return foundPath;
  9791. };
  9792. while (true) {
  9793. const foundPath = runMatcher(Object.assign(Object.assign({}, options), {}, {
  9794. cwd: directory
  9795. }));
  9796. if (foundPath === stop) {
  9797. return;
  9798. }
  9799. if (foundPath) {
  9800. return path.resolve(directory, foundPath);
  9801. }
  9802. if (directory === root) {
  9803. return;
  9804. }
  9805. directory = path.dirname(directory);
  9806. }
  9807. };
  9808. module2.exports.exists = pathExists;
  9809. module2.exports.sync.exists = pathExists.sync;
  9810. module2.exports.stop = stop;
  9811. }
  9812. });
  9813. var require_pkg_dir = __commonJS2({
  9814. "node_modules/pkg-dir/index.js"(exports2, module2) {
  9815. "use strict";
  9816. var path = require("path");
  9817. var findUp = require_find_up();
  9818. var pkgDir = async (cwd) => {
  9819. const filePath = await findUp("package.json", {
  9820. cwd
  9821. });
  9822. return filePath && path.dirname(filePath);
  9823. };
  9824. module2.exports = pkgDir;
  9825. module2.exports.default = pkgDir;
  9826. module2.exports.sync = (cwd) => {
  9827. const filePath = findUp.sync("package.json", {
  9828. cwd
  9829. });
  9830. return filePath && path.dirname(filePath);
  9831. };
  9832. }
  9833. });
  9834. var require_semver = __commonJS2({
  9835. "node_modules/make-dir/node_modules/semver/semver.js"(exports2, module2) {
  9836. exports2 = module2.exports = SemVer;
  9837. var debug;
  9838. if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9839. debug = function() {
  9840. var args = Array.prototype.slice.call(arguments, 0);
  9841. args.unshift("SEMVER");
  9842. console.log.apply(console, args);
  9843. };
  9844. } else {
  9845. debug = function() {
  9846. };
  9847. }
  9848. exports2.SEMVER_SPEC_VERSION = "2.0.0";
  9849. var MAX_LENGTH = 256;
  9850. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  9851. var MAX_SAFE_COMPONENT_LENGTH = 16;
  9852. var re = exports2.re = [];
  9853. var src = exports2.src = [];
  9854. var t = exports2.tokens = {};
  9855. var R = 0;
  9856. function tok(n) {
  9857. t[n] = R++;
  9858. }
  9859. tok("NUMERICIDENTIFIER");
  9860. src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
  9861. tok("NUMERICIDENTIFIERLOOSE");
  9862. src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+";
  9863. tok("NONNUMERICIDENTIFIER");
  9864. src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
  9865. tok("MAINVERSION");
  9866. src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
  9867. tok("MAINVERSIONLOOSE");
  9868. src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
  9869. tok("PRERELEASEIDENTIFIER");
  9870. src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9871. tok("PRERELEASEIDENTIFIERLOOSE");
  9872. src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9873. tok("PRERELEASE");
  9874. src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
  9875. tok("PRERELEASELOOSE");
  9876. src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
  9877. tok("BUILDIDENTIFIER");
  9878. src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+";
  9879. tok("BUILD");
  9880. src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
  9881. tok("FULL");
  9882. tok("FULLPLAIN");
  9883. src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
  9884. src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
  9885. tok("LOOSEPLAIN");
  9886. src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
  9887. tok("LOOSE");
  9888. src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
  9889. tok("GTLT");
  9890. src[t.GTLT] = "((?:<|>)?=?)";
  9891. tok("XRANGEIDENTIFIERLOOSE");
  9892. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
  9893. tok("XRANGEIDENTIFIER");
  9894. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
  9895. tok("XRANGEPLAIN");
  9896. src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
  9897. tok("XRANGEPLAINLOOSE");
  9898. src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
  9899. tok("XRANGE");
  9900. src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
  9901. tok("XRANGELOOSE");
  9902. src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
  9903. tok("COERCE");
  9904. src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
  9905. tok("COERCERTL");
  9906. re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
  9907. tok("LONETILDE");
  9908. src[t.LONETILDE] = "(?:~>?)";
  9909. tok("TILDETRIM");
  9910. src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
  9911. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
  9912. var tildeTrimReplace = "$1~";
  9913. tok("TILDE");
  9914. src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
  9915. tok("TILDELOOSE");
  9916. src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
  9917. tok("LONECARET");
  9918. src[t.LONECARET] = "(?:\\^)";
  9919. tok("CARETTRIM");
  9920. src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
  9921. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
  9922. var caretTrimReplace = "$1^";
  9923. tok("CARET");
  9924. src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
  9925. tok("CARETLOOSE");
  9926. src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
  9927. tok("COMPARATORLOOSE");
  9928. src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
  9929. tok("COMPARATOR");
  9930. src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
  9931. tok("COMPARATORTRIM");
  9932. src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
  9933. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
  9934. var comparatorTrimReplace = "$1$2$3";
  9935. tok("HYPHENRANGE");
  9936. src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
  9937. tok("HYPHENRANGELOOSE");
  9938. src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
  9939. tok("STAR");
  9940. src[t.STAR] = "(<|>)?=?\\s*\\*";
  9941. for (i = 0; i < R; i++) {
  9942. debug(i, src[i]);
  9943. if (!re[i]) {
  9944. re[i] = new RegExp(src[i]);
  9945. }
  9946. }
  9947. var i;
  9948. exports2.parse = parse;
  9949. function parse(version, options) {
  9950. if (!options || typeof options !== "object") {
  9951. options = {
  9952. loose: !!options,
  9953. includePrerelease: false
  9954. };
  9955. }
  9956. if (version instanceof SemVer) {
  9957. return version;
  9958. }
  9959. if (typeof version !== "string") {
  9960. return null;
  9961. }
  9962. if (version.length > MAX_LENGTH) {
  9963. return null;
  9964. }
  9965. var r = options.loose ? re[t.LOOSE] : re[t.FULL];
  9966. if (!r.test(version)) {
  9967. return null;
  9968. }
  9969. try {
  9970. return new SemVer(version, options);
  9971. } catch (er) {
  9972. return null;
  9973. }
  9974. }
  9975. exports2.valid = valid;
  9976. function valid(version, options) {
  9977. var v = parse(version, options);
  9978. return v ? v.version : null;
  9979. }
  9980. exports2.clean = clean;
  9981. function clean(version, options) {
  9982. var s = parse(version.trim().replace(/^[=v]+/, ""), options);
  9983. return s ? s.version : null;
  9984. }
  9985. exports2.SemVer = SemVer;
  9986. function SemVer(version, options) {
  9987. if (!options || typeof options !== "object") {
  9988. options = {
  9989. loose: !!options,
  9990. includePrerelease: false
  9991. };
  9992. }
  9993. if (version instanceof SemVer) {
  9994. if (version.loose === options.loose) {
  9995. return version;
  9996. } else {
  9997. version = version.version;
  9998. }
  9999. } else if (typeof version !== "string") {
  10000. throw new TypeError("Invalid Version: " + version);
  10001. }
  10002. if (version.length > MAX_LENGTH) {
  10003. throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
  10004. }
  10005. if (!(this instanceof SemVer)) {
  10006. return new SemVer(version, options);
  10007. }
  10008. debug("SemVer", version, options);
  10009. this.options = options;
  10010. this.loose = !!options.loose;
  10011. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
  10012. if (!m) {
  10013. throw new TypeError("Invalid Version: " + version);
  10014. }
  10015. this.raw = version;
  10016. this.major = +m[1];
  10017. this.minor = +m[2];
  10018. this.patch = +m[3];
  10019. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10020. throw new TypeError("Invalid major version");
  10021. }
  10022. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10023. throw new TypeError("Invalid minor version");
  10024. }
  10025. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10026. throw new TypeError("Invalid patch version");
  10027. }
  10028. if (!m[4]) {
  10029. this.prerelease = [];
  10030. } else {
  10031. this.prerelease = m[4].split(".").map(function(id) {
  10032. if (/^[0-9]+$/.test(id)) {
  10033. var num = +id;
  10034. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10035. return num;
  10036. }
  10037. }
  10038. return id;
  10039. });
  10040. }
  10041. this.build = m[5] ? m[5].split(".") : [];
  10042. this.format();
  10043. }
  10044. SemVer.prototype.format = function() {
  10045. this.version = this.major + "." + this.minor + "." + this.patch;
  10046. if (this.prerelease.length) {
  10047. this.version += "-" + this.prerelease.join(".");
  10048. }
  10049. return this.version;
  10050. };
  10051. SemVer.prototype.toString = function() {
  10052. return this.version;
  10053. };
  10054. SemVer.prototype.compare = function(other) {
  10055. debug("SemVer.compare", this.version, this.options, other);
  10056. if (!(other instanceof SemVer)) {
  10057. other = new SemVer(other, this.options);
  10058. }
  10059. return this.compareMain(other) || this.comparePre(other);
  10060. };
  10061. SemVer.prototype.compareMain = function(other) {
  10062. if (!(other instanceof SemVer)) {
  10063. other = new SemVer(other, this.options);
  10064. }
  10065. return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
  10066. };
  10067. SemVer.prototype.comparePre = function(other) {
  10068. if (!(other instanceof SemVer)) {
  10069. other = new SemVer(other, this.options);
  10070. }
  10071. if (this.prerelease.length && !other.prerelease.length) {
  10072. return -1;
  10073. } else if (!this.prerelease.length && other.prerelease.length) {
  10074. return 1;
  10075. } else if (!this.prerelease.length && !other.prerelease.length) {
  10076. return 0;
  10077. }
  10078. var i2 = 0;
  10079. do {
  10080. var a = this.prerelease[i2];
  10081. var b = other.prerelease[i2];
  10082. debug("prerelease compare", i2, a, b);
  10083. if (a === void 0 && b === void 0) {
  10084. return 0;
  10085. } else if (b === void 0) {
  10086. return 1;
  10087. } else if (a === void 0) {
  10088. return -1;
  10089. } else if (a === b) {
  10090. continue;
  10091. } else {
  10092. return compareIdentifiers(a, b);
  10093. }
  10094. } while (++i2);
  10095. };
  10096. SemVer.prototype.compareBuild = function(other) {
  10097. if (!(other instanceof SemVer)) {
  10098. other = new SemVer(other, this.options);
  10099. }
  10100. var i2 = 0;
  10101. do {
  10102. var a = this.build[i2];
  10103. var b = other.build[i2];
  10104. debug("prerelease compare", i2, a, b);
  10105. if (a === void 0 && b === void 0) {
  10106. return 0;
  10107. } else if (b === void 0) {
  10108. return 1;
  10109. } else if (a === void 0) {
  10110. return -1;
  10111. } else if (a === b) {
  10112. continue;
  10113. } else {
  10114. return compareIdentifiers(a, b);
  10115. }
  10116. } while (++i2);
  10117. };
  10118. SemVer.prototype.inc = function(release, identifier) {
  10119. switch (release) {
  10120. case "premajor":
  10121. this.prerelease.length = 0;
  10122. this.patch = 0;
  10123. this.minor = 0;
  10124. this.major++;
  10125. this.inc("pre", identifier);
  10126. break;
  10127. case "preminor":
  10128. this.prerelease.length = 0;
  10129. this.patch = 0;
  10130. this.minor++;
  10131. this.inc("pre", identifier);
  10132. break;
  10133. case "prepatch":
  10134. this.prerelease.length = 0;
  10135. this.inc("patch", identifier);
  10136. this.inc("pre", identifier);
  10137. break;
  10138. case "prerelease":
  10139. if (this.prerelease.length === 0) {
  10140. this.inc("patch", identifier);
  10141. }
  10142. this.inc("pre", identifier);
  10143. break;
  10144. case "major":
  10145. if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
  10146. this.major++;
  10147. }
  10148. this.minor = 0;
  10149. this.patch = 0;
  10150. this.prerelease = [];
  10151. break;
  10152. case "minor":
  10153. if (this.patch !== 0 || this.prerelease.length === 0) {
  10154. this.minor++;
  10155. }
  10156. this.patch = 0;
  10157. this.prerelease = [];
  10158. break;
  10159. case "patch":
  10160. if (this.prerelease.length === 0) {
  10161. this.patch++;
  10162. }
  10163. this.prerelease = [];
  10164. break;
  10165. case "pre":
  10166. if (this.prerelease.length === 0) {
  10167. this.prerelease = [0];
  10168. } else {
  10169. var i2 = this.prerelease.length;
  10170. while (--i2 >= 0) {
  10171. if (typeof this.prerelease[i2] === "number") {
  10172. this.prerelease[i2]++;
  10173. i2 = -2;
  10174. }
  10175. }
  10176. if (i2 === -1) {
  10177. this.prerelease.push(0);
  10178. }
  10179. }
  10180. if (identifier) {
  10181. if (this.prerelease[0] === identifier) {
  10182. if (isNaN(this.prerelease[1])) {
  10183. this.prerelease = [identifier, 0];
  10184. }
  10185. } else {
  10186. this.prerelease = [identifier, 0];
  10187. }
  10188. }
  10189. break;
  10190. default:
  10191. throw new Error("invalid increment argument: " + release);
  10192. }
  10193. this.format();
  10194. this.raw = this.version;
  10195. return this;
  10196. };
  10197. exports2.inc = inc;
  10198. function inc(version, release, loose, identifier) {
  10199. if (typeof loose === "string") {
  10200. identifier = loose;
  10201. loose = void 0;
  10202. }
  10203. try {
  10204. return new SemVer(version, loose).inc(release, identifier).version;
  10205. } catch (er) {
  10206. return null;
  10207. }
  10208. }
  10209. exports2.diff = diff;
  10210. function diff(version1, version2) {
  10211. if (eq(version1, version2)) {
  10212. return null;
  10213. } else {
  10214. var v1 = parse(version1);
  10215. var v2 = parse(version2);
  10216. var prefix = "";
  10217. if (v1.prerelease.length || v2.prerelease.length) {
  10218. prefix = "pre";
  10219. var defaultResult = "prerelease";
  10220. }
  10221. for (var key in v1) {
  10222. if (key === "major" || key === "minor" || key === "patch") {
  10223. if (v1[key] !== v2[key]) {
  10224. return prefix + key;
  10225. }
  10226. }
  10227. }
  10228. return defaultResult;
  10229. }
  10230. }
  10231. exports2.compareIdentifiers = compareIdentifiers;
  10232. var numeric = /^[0-9]+$/;
  10233. function compareIdentifiers(a, b) {
  10234. var anum = numeric.test(a);
  10235. var bnum = numeric.test(b);
  10236. if (anum && bnum) {
  10237. a = +a;
  10238. b = +b;
  10239. }
  10240. return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
  10241. }
  10242. exports2.rcompareIdentifiers = rcompareIdentifiers;
  10243. function rcompareIdentifiers(a, b) {
  10244. return compareIdentifiers(b, a);
  10245. }
  10246. exports2.major = major;
  10247. function major(a, loose) {
  10248. return new SemVer(a, loose).major;
  10249. }
  10250. exports2.minor = minor;
  10251. function minor(a, loose) {
  10252. return new SemVer(a, loose).minor;
  10253. }
  10254. exports2.patch = patch;
  10255. function patch(a, loose) {
  10256. return new SemVer(a, loose).patch;
  10257. }
  10258. exports2.compare = compare;
  10259. function compare(a, b, loose) {
  10260. return new SemVer(a, loose).compare(new SemVer(b, loose));
  10261. }
  10262. exports2.compareLoose = compareLoose;
  10263. function compareLoose(a, b) {
  10264. return compare(a, b, true);
  10265. }
  10266. exports2.compareBuild = compareBuild;
  10267. function compareBuild(a, b, loose) {
  10268. var versionA = new SemVer(a, loose);
  10269. var versionB = new SemVer(b, loose);
  10270. return versionA.compare(versionB) || versionA.compareBuild(versionB);
  10271. }
  10272. exports2.rcompare = rcompare;
  10273. function rcompare(a, b, loose) {
  10274. return compare(b, a, loose);
  10275. }
  10276. exports2.sort = sort;
  10277. function sort(list, loose) {
  10278. return list.sort(function(a, b) {
  10279. return exports2.compareBuild(a, b, loose);
  10280. });
  10281. }
  10282. exports2.rsort = rsort;
  10283. function rsort(list, loose) {
  10284. return list.sort(function(a, b) {
  10285. return exports2.compareBuild(b, a, loose);
  10286. });
  10287. }
  10288. exports2.gt = gt;
  10289. function gt(a, b, loose) {
  10290. return compare(a, b, loose) > 0;
  10291. }
  10292. exports2.lt = lt;
  10293. function lt(a, b, loose) {
  10294. return compare(a, b, loose) < 0;
  10295. }
  10296. exports2.eq = eq;
  10297. function eq(a, b, loose) {
  10298. return compare(a, b, loose) === 0;
  10299. }
  10300. exports2.neq = neq;
  10301. function neq(a, b, loose) {
  10302. return compare(a, b, loose) !== 0;
  10303. }
  10304. exports2.gte = gte;
  10305. function gte(a, b, loose) {
  10306. return compare(a, b, loose) >= 0;
  10307. }
  10308. exports2.lte = lte;
  10309. function lte(a, b, loose) {
  10310. return compare(a, b, loose) <= 0;
  10311. }
  10312. exports2.cmp = cmp;
  10313. function cmp(a, op, b, loose) {
  10314. switch (op) {
  10315. case "===":
  10316. if (typeof a === "object")
  10317. a = a.version;
  10318. if (typeof b === "object")
  10319. b = b.version;
  10320. return a === b;
  10321. case "!==":
  10322. if (typeof a === "object")
  10323. a = a.version;
  10324. if (typeof b === "object")
  10325. b = b.version;
  10326. return a !== b;
  10327. case "":
  10328. case "=":
  10329. case "==":
  10330. return eq(a, b, loose);
  10331. case "!=":
  10332. return neq(a, b, loose);
  10333. case ">":
  10334. return gt(a, b, loose);
  10335. case ">=":
  10336. return gte(a, b, loose);
  10337. case "<":
  10338. return lt(a, b, loose);
  10339. case "<=":
  10340. return lte(a, b, loose);
  10341. default:
  10342. throw new TypeError("Invalid operator: " + op);
  10343. }
  10344. }
  10345. exports2.Comparator = Comparator;
  10346. function Comparator(comp, options) {
  10347. if (!options || typeof options !== "object") {
  10348. options = {
  10349. loose: !!options,
  10350. includePrerelease: false
  10351. };
  10352. }
  10353. if (comp instanceof Comparator) {
  10354. if (comp.loose === !!options.loose) {
  10355. return comp;
  10356. } else {
  10357. comp = comp.value;
  10358. }
  10359. }
  10360. if (!(this instanceof Comparator)) {
  10361. return new Comparator(comp, options);
  10362. }
  10363. debug("comparator", comp, options);
  10364. this.options = options;
  10365. this.loose = !!options.loose;
  10366. this.parse(comp);
  10367. if (this.semver === ANY) {
  10368. this.value = "";
  10369. } else {
  10370. this.value = this.operator + this.semver.version;
  10371. }
  10372. debug("comp", this);
  10373. }
  10374. var ANY = {};
  10375. Comparator.prototype.parse = function(comp) {
  10376. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10377. var m = comp.match(r);
  10378. if (!m) {
  10379. throw new TypeError("Invalid comparator: " + comp);
  10380. }
  10381. this.operator = m[1] !== void 0 ? m[1] : "";
  10382. if (this.operator === "=") {
  10383. this.operator = "";
  10384. }
  10385. if (!m[2]) {
  10386. this.semver = ANY;
  10387. } else {
  10388. this.semver = new SemVer(m[2], this.options.loose);
  10389. }
  10390. };
  10391. Comparator.prototype.toString = function() {
  10392. return this.value;
  10393. };
  10394. Comparator.prototype.test = function(version) {
  10395. debug("Comparator.test", version, this.options.loose);
  10396. if (this.semver === ANY || version === ANY) {
  10397. return true;
  10398. }
  10399. if (typeof version === "string") {
  10400. try {
  10401. version = new SemVer(version, this.options);
  10402. } catch (er) {
  10403. return false;
  10404. }
  10405. }
  10406. return cmp(version, this.operator, this.semver, this.options);
  10407. };
  10408. Comparator.prototype.intersects = function(comp, options) {
  10409. if (!(comp instanceof Comparator)) {
  10410. throw new TypeError("a Comparator is required");
  10411. }
  10412. if (!options || typeof options !== "object") {
  10413. options = {
  10414. loose: !!options,
  10415. includePrerelease: false
  10416. };
  10417. }
  10418. var rangeTmp;
  10419. if (this.operator === "") {
  10420. if (this.value === "") {
  10421. return true;
  10422. }
  10423. rangeTmp = new Range(comp.value, options);
  10424. return satisfies(this.value, rangeTmp, options);
  10425. } else if (comp.operator === "") {
  10426. if (comp.value === "") {
  10427. return true;
  10428. }
  10429. rangeTmp = new Range(this.value, options);
  10430. return satisfies(comp.semver, rangeTmp, options);
  10431. }
  10432. var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
  10433. var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
  10434. var sameSemVer = this.semver.version === comp.semver.version;
  10435. var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
  10436. var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
  10437. var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
  10438. return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
  10439. };
  10440. exports2.Range = Range;
  10441. function Range(range, options) {
  10442. if (!options || typeof options !== "object") {
  10443. options = {
  10444. loose: !!options,
  10445. includePrerelease: false
  10446. };
  10447. }
  10448. if (range instanceof Range) {
  10449. if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
  10450. return range;
  10451. } else {
  10452. return new Range(range.raw, options);
  10453. }
  10454. }
  10455. if (range instanceof Comparator) {
  10456. return new Range(range.value, options);
  10457. }
  10458. if (!(this instanceof Range)) {
  10459. return new Range(range, options);
  10460. }
  10461. this.options = options;
  10462. this.loose = !!options.loose;
  10463. this.includePrerelease = !!options.includePrerelease;
  10464. this.raw = range;
  10465. this.set = range.split(/\s*\|\|\s*/).map(function(range2) {
  10466. return this.parseRange(range2.trim());
  10467. }, this).filter(function(c) {
  10468. return c.length;
  10469. });
  10470. if (!this.set.length) {
  10471. throw new TypeError("Invalid SemVer Range: " + range);
  10472. }
  10473. this.format();
  10474. }
  10475. Range.prototype.format = function() {
  10476. this.range = this.set.map(function(comps) {
  10477. return comps.join(" ").trim();
  10478. }).join("||").trim();
  10479. return this.range;
  10480. };
  10481. Range.prototype.toString = function() {
  10482. return this.range;
  10483. };
  10484. Range.prototype.parseRange = function(range) {
  10485. var loose = this.options.loose;
  10486. range = range.trim();
  10487. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
  10488. range = range.replace(hr, hyphenReplace);
  10489. debug("hyphen replace", range);
  10490. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
  10491. debug("comparator trim", range, re[t.COMPARATORTRIM]);
  10492. range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
  10493. range = range.replace(re[t.CARETTRIM], caretTrimReplace);
  10494. range = range.split(/\s+/).join(" ");
  10495. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10496. var set = range.split(" ").map(function(comp) {
  10497. return parseComparator(comp, this.options);
  10498. }, this).join(" ").split(/\s+/);
  10499. if (this.options.loose) {
  10500. set = set.filter(function(comp) {
  10501. return !!comp.match(compRe);
  10502. });
  10503. }
  10504. set = set.map(function(comp) {
  10505. return new Comparator(comp, this.options);
  10506. }, this);
  10507. return set;
  10508. };
  10509. Range.prototype.intersects = function(range, options) {
  10510. if (!(range instanceof Range)) {
  10511. throw new TypeError("a Range is required");
  10512. }
  10513. return this.set.some(function(thisComparators) {
  10514. return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
  10515. return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
  10516. return rangeComparators.every(function(rangeComparator) {
  10517. return thisComparator.intersects(rangeComparator, options);
  10518. });
  10519. });
  10520. });
  10521. });
  10522. };
  10523. function isSatisfiable(comparators, options) {
  10524. var result = true;
  10525. var remainingComparators = comparators.slice();
  10526. var testComparator = remainingComparators.pop();
  10527. while (result && remainingComparators.length) {
  10528. result = remainingComparators.every(function(otherComparator) {
  10529. return testComparator.intersects(otherComparator, options);
  10530. });
  10531. testComparator = remainingComparators.pop();
  10532. }
  10533. return result;
  10534. }
  10535. exports2.toComparators = toComparators;
  10536. function toComparators(range, options) {
  10537. return new Range(range, options).set.map(function(comp) {
  10538. return comp.map(function(c) {
  10539. return c.value;
  10540. }).join(" ").trim().split(" ");
  10541. });
  10542. }
  10543. function parseComparator(comp, options) {
  10544. debug("comp", comp, options);
  10545. comp = replaceCarets(comp, options);
  10546. debug("caret", comp);
  10547. comp = replaceTildes(comp, options);
  10548. debug("tildes", comp);
  10549. comp = replaceXRanges(comp, options);
  10550. debug("xrange", comp);
  10551. comp = replaceStars(comp, options);
  10552. debug("stars", comp);
  10553. return comp;
  10554. }
  10555. function isX(id) {
  10556. return !id || id.toLowerCase() === "x" || id === "*";
  10557. }
  10558. function replaceTildes(comp, options) {
  10559. return comp.trim().split(/\s+/).map(function(comp2) {
  10560. return replaceTilde(comp2, options);
  10561. }).join(" ");
  10562. }
  10563. function replaceTilde(comp, options) {
  10564. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
  10565. return comp.replace(r, function(_, M, m, p, pr) {
  10566. debug("tilde", comp, _, M, m, p, pr);
  10567. var ret;
  10568. if (isX(M)) {
  10569. ret = "";
  10570. } else if (isX(m)) {
  10571. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10572. } else if (isX(p)) {
  10573. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10574. } else if (pr) {
  10575. debug("replaceTilde pr", pr);
  10576. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10577. } else {
  10578. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10579. }
  10580. debug("tilde return", ret);
  10581. return ret;
  10582. });
  10583. }
  10584. function replaceCarets(comp, options) {
  10585. return comp.trim().split(/\s+/).map(function(comp2) {
  10586. return replaceCaret(comp2, options);
  10587. }).join(" ");
  10588. }
  10589. function replaceCaret(comp, options) {
  10590. debug("caret", comp, options);
  10591. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
  10592. return comp.replace(r, function(_, M, m, p, pr) {
  10593. debug("caret", comp, _, M, m, p, pr);
  10594. var ret;
  10595. if (isX(M)) {
  10596. ret = "";
  10597. } else if (isX(m)) {
  10598. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10599. } else if (isX(p)) {
  10600. if (M === "0") {
  10601. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10602. } else {
  10603. ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
  10604. }
  10605. } else if (pr) {
  10606. debug("replaceCaret pr", pr);
  10607. if (M === "0") {
  10608. if (m === "0") {
  10609. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
  10610. } else {
  10611. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10612. }
  10613. } else {
  10614. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
  10615. }
  10616. } else {
  10617. debug("no pr");
  10618. if (M === "0") {
  10619. if (m === "0") {
  10620. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
  10621. } else {
  10622. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10623. }
  10624. } else {
  10625. ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
  10626. }
  10627. }
  10628. debug("caret return", ret);
  10629. return ret;
  10630. });
  10631. }
  10632. function replaceXRanges(comp, options) {
  10633. debug("replaceXRanges", comp, options);
  10634. return comp.split(/\s+/).map(function(comp2) {
  10635. return replaceXRange(comp2, options);
  10636. }).join(" ");
  10637. }
  10638. function replaceXRange(comp, options) {
  10639. comp = comp.trim();
  10640. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
  10641. return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
  10642. debug("xRange", comp, ret, gtlt, M, m, p, pr);
  10643. var xM = isX(M);
  10644. var xm = xM || isX(m);
  10645. var xp = xm || isX(p);
  10646. var anyX = xp;
  10647. if (gtlt === "=" && anyX) {
  10648. gtlt = "";
  10649. }
  10650. pr = options.includePrerelease ? "-0" : "";
  10651. if (xM) {
  10652. if (gtlt === ">" || gtlt === "<") {
  10653. ret = "<0.0.0-0";
  10654. } else {
  10655. ret = "*";
  10656. }
  10657. } else if (gtlt && anyX) {
  10658. if (xm) {
  10659. m = 0;
  10660. }
  10661. p = 0;
  10662. if (gtlt === ">") {
  10663. gtlt = ">=";
  10664. if (xm) {
  10665. M = +M + 1;
  10666. m = 0;
  10667. p = 0;
  10668. } else {
  10669. m = +m + 1;
  10670. p = 0;
  10671. }
  10672. } else if (gtlt === "<=") {
  10673. gtlt = "<";
  10674. if (xm) {
  10675. M = +M + 1;
  10676. } else {
  10677. m = +m + 1;
  10678. }
  10679. }
  10680. ret = gtlt + M + "." + m + "." + p + pr;
  10681. } else if (xm) {
  10682. ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
  10683. } else if (xp) {
  10684. ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
  10685. }
  10686. debug("xRange return", ret);
  10687. return ret;
  10688. });
  10689. }
  10690. function replaceStars(comp, options) {
  10691. debug("replaceStars", comp, options);
  10692. return comp.trim().replace(re[t.STAR], "");
  10693. }
  10694. function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
  10695. if (isX(fM)) {
  10696. from = "";
  10697. } else if (isX(fm)) {
  10698. from = ">=" + fM + ".0.0";
  10699. } else if (isX(fp)) {
  10700. from = ">=" + fM + "." + fm + ".0";
  10701. } else {
  10702. from = ">=" + from;
  10703. }
  10704. if (isX(tM)) {
  10705. to = "";
  10706. } else if (isX(tm)) {
  10707. to = "<" + (+tM + 1) + ".0.0";
  10708. } else if (isX(tp)) {
  10709. to = "<" + tM + "." + (+tm + 1) + ".0";
  10710. } else if (tpr) {
  10711. to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
  10712. } else {
  10713. to = "<=" + to;
  10714. }
  10715. return (from + " " + to).trim();
  10716. }
  10717. Range.prototype.test = function(version) {
  10718. if (!version) {
  10719. return false;
  10720. }
  10721. if (typeof version === "string") {
  10722. try {
  10723. version = new SemVer(version, this.options);
  10724. } catch (er) {
  10725. return false;
  10726. }
  10727. }
  10728. for (var i2 = 0; i2 < this.set.length; i2++) {
  10729. if (testSet(this.set[i2], version, this.options)) {
  10730. return true;
  10731. }
  10732. }
  10733. return false;
  10734. };
  10735. function testSet(set, version, options) {
  10736. for (var i2 = 0; i2 < set.length; i2++) {
  10737. if (!set[i2].test(version)) {
  10738. return false;
  10739. }
  10740. }
  10741. if (version.prerelease.length && !options.includePrerelease) {
  10742. for (i2 = 0; i2 < set.length; i2++) {
  10743. debug(set[i2].semver);
  10744. if (set[i2].semver === ANY) {
  10745. continue;
  10746. }
  10747. if (set[i2].semver.prerelease.length > 0) {
  10748. var allowed = set[i2].semver;
  10749. if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
  10750. return true;
  10751. }
  10752. }
  10753. }
  10754. return false;
  10755. }
  10756. return true;
  10757. }
  10758. exports2.satisfies = satisfies;
  10759. function satisfies(version, range, options) {
  10760. try {
  10761. range = new Range(range, options);
  10762. } catch (er) {
  10763. return false;
  10764. }
  10765. return range.test(version);
  10766. }
  10767. exports2.maxSatisfying = maxSatisfying;
  10768. function maxSatisfying(versions, range, options) {
  10769. var max = null;
  10770. var maxSV = null;
  10771. try {
  10772. var rangeObj = new Range(range, options);
  10773. } catch (er) {
  10774. return null;
  10775. }
  10776. versions.forEach(function(v) {
  10777. if (rangeObj.test(v)) {
  10778. if (!max || maxSV.compare(v) === -1) {
  10779. max = v;
  10780. maxSV = new SemVer(max, options);
  10781. }
  10782. }
  10783. });
  10784. return max;
  10785. }
  10786. exports2.minSatisfying = minSatisfying;
  10787. function minSatisfying(versions, range, options) {
  10788. var min = null;
  10789. var minSV = null;
  10790. try {
  10791. var rangeObj = new Range(range, options);
  10792. } catch (er) {
  10793. return null;
  10794. }
  10795. versions.forEach(function(v) {
  10796. if (rangeObj.test(v)) {
  10797. if (!min || minSV.compare(v) === 1) {
  10798. min = v;
  10799. minSV = new SemVer(min, options);
  10800. }
  10801. }
  10802. });
  10803. return min;
  10804. }
  10805. exports2.minVersion = minVersion;
  10806. function minVersion(range, loose) {
  10807. range = new Range(range, loose);
  10808. var minver = new SemVer("0.0.0");
  10809. if (range.test(minver)) {
  10810. return minver;
  10811. }
  10812. minver = new SemVer("0.0.0-0");
  10813. if (range.test(minver)) {
  10814. return minver;
  10815. }
  10816. minver = null;
  10817. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10818. var comparators = range.set[i2];
  10819. comparators.forEach(function(comparator) {
  10820. var compver = new SemVer(comparator.semver.version);
  10821. switch (comparator.operator) {
  10822. case ">":
  10823. if (compver.prerelease.length === 0) {
  10824. compver.patch++;
  10825. } else {
  10826. compver.prerelease.push(0);
  10827. }
  10828. compver.raw = compver.format();
  10829. case "":
  10830. case ">=":
  10831. if (!minver || gt(minver, compver)) {
  10832. minver = compver;
  10833. }
  10834. break;
  10835. case "<":
  10836. case "<=":
  10837. break;
  10838. default:
  10839. throw new Error("Unexpected operation: " + comparator.operator);
  10840. }
  10841. });
  10842. }
  10843. if (minver && range.test(minver)) {
  10844. return minver;
  10845. }
  10846. return null;
  10847. }
  10848. exports2.validRange = validRange;
  10849. function validRange(range, options) {
  10850. try {
  10851. return new Range(range, options).range || "*";
  10852. } catch (er) {
  10853. return null;
  10854. }
  10855. }
  10856. exports2.ltr = ltr;
  10857. function ltr(version, range, options) {
  10858. return outside(version, range, "<", options);
  10859. }
  10860. exports2.gtr = gtr;
  10861. function gtr(version, range, options) {
  10862. return outside(version, range, ">", options);
  10863. }
  10864. exports2.outside = outside;
  10865. function outside(version, range, hilo, options) {
  10866. version = new SemVer(version, options);
  10867. range = new Range(range, options);
  10868. var gtfn, ltefn, ltfn, comp, ecomp;
  10869. switch (hilo) {
  10870. case ">":
  10871. gtfn = gt;
  10872. ltefn = lte;
  10873. ltfn = lt;
  10874. comp = ">";
  10875. ecomp = ">=";
  10876. break;
  10877. case "<":
  10878. gtfn = lt;
  10879. ltefn = gte;
  10880. ltfn = gt;
  10881. comp = "<";
  10882. ecomp = "<=";
  10883. break;
  10884. default:
  10885. throw new TypeError('Must provide a hilo val of "<" or ">"');
  10886. }
  10887. if (satisfies(version, range, options)) {
  10888. return false;
  10889. }
  10890. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10891. var comparators = range.set[i2];
  10892. var high = null;
  10893. var low = null;
  10894. comparators.forEach(function(comparator) {
  10895. if (comparator.semver === ANY) {
  10896. comparator = new Comparator(">=0.0.0");
  10897. }
  10898. high = high || comparator;
  10899. low = low || comparator;
  10900. if (gtfn(comparator.semver, high.semver, options)) {
  10901. high = comparator;
  10902. } else if (ltfn(comparator.semver, low.semver, options)) {
  10903. low = comparator;
  10904. }
  10905. });
  10906. if (high.operator === comp || high.operator === ecomp) {
  10907. return false;
  10908. }
  10909. if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
  10910. return false;
  10911. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10912. return false;
  10913. }
  10914. }
  10915. return true;
  10916. }
  10917. exports2.prerelease = prerelease;
  10918. function prerelease(version, options) {
  10919. var parsed = parse(version, options);
  10920. return parsed && parsed.prerelease.length ? parsed.prerelease : null;
  10921. }
  10922. exports2.intersects = intersects;
  10923. function intersects(r1, r2, options) {
  10924. r1 = new Range(r1, options);
  10925. r2 = new Range(r2, options);
  10926. return r1.intersects(r2);
  10927. }
  10928. exports2.coerce = coerce;
  10929. function coerce(version, options) {
  10930. if (version instanceof SemVer) {
  10931. return version;
  10932. }
  10933. if (typeof version === "number") {
  10934. version = String(version);
  10935. }
  10936. if (typeof version !== "string") {
  10937. return null;
  10938. }
  10939. options = options || {};
  10940. var match = null;
  10941. if (!options.rtl) {
  10942. match = version.match(re[t.COERCE]);
  10943. } else {
  10944. var next;
  10945. while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
  10946. if (!match || next.index + next[0].length !== match.index + match[0].length) {
  10947. match = next;
  10948. }
  10949. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
  10950. }
  10951. re[t.COERCERTL].lastIndex = -1;
  10952. }
  10953. if (match === null) {
  10954. return null;
  10955. }
  10956. return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
  10957. }
  10958. }
  10959. });
  10960. var require_make_dir = __commonJS2({
  10961. "node_modules/make-dir/index.js"(exports2, module2) {
  10962. "use strict";
  10963. var fs = require("fs");
  10964. var path = require("path");
  10965. var {
  10966. promisify
  10967. } = require("util");
  10968. var semver = require_semver();
  10969. var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
  10970. var checkPath = (pth) => {
  10971. if (process.platform === "win32") {
  10972. const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
  10973. if (pathHasInvalidWinCharacters) {
  10974. const error = new Error(`Path contains invalid characters: ${pth}`);
  10975. error.code = "EINVAL";
  10976. throw error;
  10977. }
  10978. }
  10979. };
  10980. var processOptions = (options) => {
  10981. const defaults = {
  10982. mode: 511,
  10983. fs
  10984. };
  10985. return Object.assign(Object.assign({}, defaults), options);
  10986. };
  10987. var permissionError = (pth) => {
  10988. const error = new Error(`operation not permitted, mkdir '${pth}'`);
  10989. error.code = "EPERM";
  10990. error.errno = -4048;
  10991. error.path = pth;
  10992. error.syscall = "mkdir";
  10993. return error;
  10994. };
  10995. var makeDir = async (input, options) => {
  10996. checkPath(input);
  10997. options = processOptions(options);
  10998. const mkdir = promisify(options.fs.mkdir);
  10999. const stat = promisify(options.fs.stat);
  11000. if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
  11001. const pth = path.resolve(input);
  11002. await mkdir(pth, {
  11003. mode: options.mode,
  11004. recursive: true
  11005. });
  11006. return pth;
  11007. }
  11008. const make = async (pth) => {
  11009. try {
  11010. await mkdir(pth, options.mode);
  11011. return pth;
  11012. } catch (error) {
  11013. if (error.code === "EPERM") {
  11014. throw error;
  11015. }
  11016. if (error.code === "ENOENT") {
  11017. if (path.dirname(pth) === pth) {
  11018. throw permissionError(pth);
  11019. }
  11020. if (error.message.includes("null bytes")) {
  11021. throw error;
  11022. }
  11023. await make(path.dirname(pth));
  11024. return make(pth);
  11025. }
  11026. try {
  11027. const stats = await stat(pth);
  11028. if (!stats.isDirectory()) {
  11029. throw new Error("The path is not a directory");
  11030. }
  11031. } catch (_) {
  11032. throw error;
  11033. }
  11034. return pth;
  11035. }
  11036. };
  11037. return make(path.resolve(input));
  11038. };
  11039. module2.exports = makeDir;
  11040. module2.exports.sync = (input, options) => {
  11041. checkPath(input);
  11042. options = processOptions(options);
  11043. if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
  11044. const pth = path.resolve(input);
  11045. fs.mkdirSync(pth, {
  11046. mode: options.mode,
  11047. recursive: true
  11048. });
  11049. return pth;
  11050. }
  11051. const make = (pth) => {
  11052. try {
  11053. options.fs.mkdirSync(pth, options.mode);
  11054. } catch (error) {
  11055. if (error.code === "EPERM") {
  11056. throw error;
  11057. }
  11058. if (error.code === "ENOENT") {
  11059. if (path.dirname(pth) === pth) {
  11060. throw permissionError(pth);
  11061. }
  11062. if (error.message.includes("null bytes")) {
  11063. throw error;
  11064. }
  11065. make(path.dirname(pth));
  11066. return make(pth);
  11067. }
  11068. try {
  11069. if (!options.fs.statSync(pth).isDirectory()) {
  11070. throw new Error("The path is not a directory");
  11071. }
  11072. } catch (_) {
  11073. throw error;
  11074. }
  11075. }
  11076. return pth;
  11077. };
  11078. return make(path.resolve(input));
  11079. };
  11080. }
  11081. });
  11082. var require_find_cache_dir = __commonJS2({
  11083. "node_modules/find-cache-dir/index.js"(exports2, module2) {
  11084. "use strict";
  11085. var path = require("path");
  11086. var fs = require("fs");
  11087. var commonDir = require_commondir();
  11088. var pkgDir = require_pkg_dir();
  11089. var makeDir = require_make_dir();
  11090. var {
  11091. env: env2,
  11092. cwd
  11093. } = process;
  11094. var isWritable = (path2) => {
  11095. try {
  11096. fs.accessSync(path2, fs.constants.W_OK);
  11097. return true;
  11098. } catch (_) {
  11099. return false;
  11100. }
  11101. };
  11102. function useDirectory(directory, options) {
  11103. if (options.create) {
  11104. makeDir.sync(directory);
  11105. }
  11106. if (options.thunk) {
  11107. return (...arguments_) => path.join(directory, ...arguments_);
  11108. }
  11109. return directory;
  11110. }
  11111. function getNodeModuleDirectory(directory) {
  11112. const nodeModules = path.join(directory, "node_modules");
  11113. if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path.join(directory)))) {
  11114. return;
  11115. }
  11116. return nodeModules;
  11117. }
  11118. module2.exports = (options = {}) => {
  11119. if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) {
  11120. return useDirectory(path.join(env2.CACHE_DIR, options.name), options);
  11121. }
  11122. let {
  11123. cwd: directory = cwd()
  11124. } = options;
  11125. if (options.files) {
  11126. directory = commonDir(directory, options.files);
  11127. }
  11128. directory = pkgDir.sync(directory);
  11129. if (!directory) {
  11130. return;
  11131. }
  11132. const nodeModules = getNodeModuleDirectory(directory);
  11133. if (!nodeModules) {
  11134. return void 0;
  11135. }
  11136. return useDirectory(path.join(directory, "node_modules", ".cache", options.name), options);
  11137. };
  11138. }
  11139. });
  11140. var require_find_cache_file = __commonJS2({
  11141. "src/cli/find-cache-file.js"(exports2, module2) {
  11142. "use strict";
  11143. var fs = require("fs").promises;
  11144. var os2 = require("os");
  11145. var path = require("path");
  11146. var findCacheDir = require_find_cache_dir();
  11147. var {
  11148. statSafe,
  11149. isJson
  11150. } = require_utils();
  11151. function findDefaultCacheFile() {
  11152. const cacheDir = findCacheDir({
  11153. name: "prettier",
  11154. create: true
  11155. }) || os2.tmpdir();
  11156. const cacheFilePath = path.join(cacheDir, ".prettier-cache");
  11157. return cacheFilePath;
  11158. }
  11159. async function findCacheFileFromOption(cacheLocation) {
  11160. const cacheFile = path.resolve(cacheLocation);
  11161. const stat = await statSafe(cacheFile);
  11162. if (stat) {
  11163. if (stat.isDirectory()) {
  11164. throw new Error(`Resolved --cache-location '${cacheFile}' is a directory`);
  11165. }
  11166. const data = await fs.readFile(cacheFile, "utf8");
  11167. if (!isJson(data)) {
  11168. throw new Error(`'${cacheFile}' isn't a valid JSON file`);
  11169. }
  11170. }
  11171. return cacheFile;
  11172. }
  11173. async function findCacheFile(cacheLocation) {
  11174. if (!cacheLocation) {
  11175. return findDefaultCacheFile();
  11176. }
  11177. const cacheFile = await findCacheFileFromOption(cacheLocation);
  11178. return cacheFile;
  11179. }
  11180. module2.exports = findCacheFile;
  11181. }
  11182. });
  11183. var require_cjs = __commonJS2({
  11184. "node_modules/flatted/cjs/index.js"(exports2) {
  11185. "use strict";
  11186. var {
  11187. parse: $parse,
  11188. stringify: $stringify
  11189. } = JSON;
  11190. var {
  11191. keys
  11192. } = Object;
  11193. var Primitive = String;
  11194. var primitive = "string";
  11195. var ignore = {};
  11196. var object = "object";
  11197. var noop = (_, value) => value;
  11198. var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
  11199. var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
  11200. var revive = (input, parsed, output, $) => {
  11201. const lazy = [];
  11202. for (let ke = keys(output), {
  11203. length
  11204. } = ke, y = 0; y < length; y++) {
  11205. const k = ke[y];
  11206. const value = output[k];
  11207. if (value instanceof Primitive) {
  11208. const tmp = input[value];
  11209. if (typeof tmp === object && !parsed.has(tmp)) {
  11210. parsed.add(tmp);
  11211. output[k] = ignore;
  11212. lazy.push({
  11213. k,
  11214. a: [input, parsed, tmp, $]
  11215. });
  11216. } else
  11217. output[k] = $.call(output, k, tmp);
  11218. } else if (output[k] !== ignore)
  11219. output[k] = $.call(output, k, value);
  11220. }
  11221. for (let {
  11222. length
  11223. } = lazy, i = 0; i < length; i++) {
  11224. const {
  11225. k,
  11226. a
  11227. } = lazy[i];
  11228. output[k] = $.call(output, k, revive.apply(null, a));
  11229. }
  11230. return output;
  11231. };
  11232. var set = (known, input, value) => {
  11233. const index = Primitive(input.push(value) - 1);
  11234. known.set(value, index);
  11235. return index;
  11236. };
  11237. var parse = (text, reviver) => {
  11238. const input = $parse(text, Primitives).map(primitives);
  11239. const value = input[0];
  11240. const $ = reviver || noop;
  11241. const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
  11242. return $.call({
  11243. "": tmp
  11244. }, "", tmp);
  11245. };
  11246. exports2.parse = parse;
  11247. var stringify2 = (value, replacer, space) => {
  11248. const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
  11249. const known = /* @__PURE__ */ new Map();
  11250. const input = [];
  11251. const output = [];
  11252. let i = +set(known, input, $.call({
  11253. "": value
  11254. }, "", value));
  11255. let firstRun = !i;
  11256. while (i < input.length) {
  11257. firstRun = true;
  11258. output[i] = $stringify(input[i++], replace, space);
  11259. }
  11260. return "[" + output.join(",") + "]";
  11261. function replace(key, value2) {
  11262. if (firstRun) {
  11263. firstRun = !firstRun;
  11264. return value2;
  11265. }
  11266. const after = $.call(this, key, value2);
  11267. switch (typeof after) {
  11268. case object:
  11269. if (after === null)
  11270. return after;
  11271. case primitive:
  11272. return known.get(after) || set(known, input, after);
  11273. }
  11274. return after;
  11275. }
  11276. };
  11277. exports2.stringify = stringify2;
  11278. var toJSON = (any) => $parse(stringify2(any));
  11279. exports2.toJSON = toJSON;
  11280. var fromJSON = (any) => parse($stringify(any));
  11281. exports2.fromJSON = fromJSON;
  11282. }
  11283. });
  11284. var require_utils6 = __commonJS2({
  11285. "node_modules/flat-cache/src/utils.js"(exports2, module2) {
  11286. var fs = require("fs");
  11287. var path = require("path");
  11288. var flatted = require_cjs();
  11289. module2.exports = {
  11290. tryParse: function(filePath, defaultValue) {
  11291. var result;
  11292. try {
  11293. result = this.readJSON(filePath);
  11294. } catch (ex) {
  11295. result = defaultValue;
  11296. }
  11297. return result;
  11298. },
  11299. readJSON: function(filePath) {
  11300. return flatted.parse(fs.readFileSync(filePath, {
  11301. encoding: "utf8"
  11302. }));
  11303. },
  11304. writeJSON: function(filePath, data) {
  11305. fs.mkdirSync(path.dirname(filePath), {
  11306. recursive: true
  11307. });
  11308. fs.writeFileSync(filePath, flatted.stringify(data));
  11309. }
  11310. };
  11311. }
  11312. });
  11313. var require_old = __commonJS2({
  11314. "node_modules/fs.realpath/old.js"(exports2) {
  11315. var pathModule = require("path");
  11316. var isWindows = process.platform === "win32";
  11317. var fs = require("fs");
  11318. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  11319. function rethrow() {
  11320. var callback;
  11321. if (DEBUG) {
  11322. var backtrace = new Error();
  11323. callback = debugCallback;
  11324. } else
  11325. callback = missingCallback;
  11326. return callback;
  11327. function debugCallback(err) {
  11328. if (err) {
  11329. backtrace.message = err.message;
  11330. err = backtrace;
  11331. missingCallback(err);
  11332. }
  11333. }
  11334. function missingCallback(err) {
  11335. if (err) {
  11336. if (process.throwDeprecation)
  11337. throw err;
  11338. else if (!process.noDeprecation) {
  11339. var msg = "fs: missing callback " + (err.stack || err.message);
  11340. if (process.traceDeprecation)
  11341. console.trace(msg);
  11342. else
  11343. console.error(msg);
  11344. }
  11345. }
  11346. }
  11347. }
  11348. function maybeCallback(cb) {
  11349. return typeof cb === "function" ? cb : rethrow();
  11350. }
  11351. var normalize = pathModule.normalize;
  11352. if (isWindows) {
  11353. nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  11354. } else {
  11355. nextPartRe = /(.*?)(?:[\/]+|$)/g;
  11356. }
  11357. var nextPartRe;
  11358. if (isWindows) {
  11359. splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  11360. } else {
  11361. splitRootRe = /^[\/]*/;
  11362. }
  11363. var splitRootRe;
  11364. exports2.realpathSync = function realpathSync(p, cache) {
  11365. p = pathModule.resolve(p);
  11366. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11367. return cache[p];
  11368. }
  11369. var original = p, seenLinks = {}, knownHard = {};
  11370. var pos;
  11371. var current;
  11372. var base;
  11373. var previous;
  11374. start();
  11375. function start() {
  11376. var m = splitRootRe.exec(p);
  11377. pos = m[0].length;
  11378. current = m[0];
  11379. base = m[0];
  11380. previous = "";
  11381. if (isWindows && !knownHard[base]) {
  11382. fs.lstatSync(base);
  11383. knownHard[base] = true;
  11384. }
  11385. }
  11386. while (pos < p.length) {
  11387. nextPartRe.lastIndex = pos;
  11388. var result = nextPartRe.exec(p);
  11389. previous = current;
  11390. current += result[0];
  11391. base = previous + result[1];
  11392. pos = nextPartRe.lastIndex;
  11393. if (knownHard[base] || cache && cache[base] === base) {
  11394. continue;
  11395. }
  11396. var resolvedLink;
  11397. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11398. resolvedLink = cache[base];
  11399. } else {
  11400. var stat = fs.lstatSync(base);
  11401. if (!stat.isSymbolicLink()) {
  11402. knownHard[base] = true;
  11403. if (cache)
  11404. cache[base] = base;
  11405. continue;
  11406. }
  11407. var linkTarget = null;
  11408. if (!isWindows) {
  11409. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11410. if (seenLinks.hasOwnProperty(id)) {
  11411. linkTarget = seenLinks[id];
  11412. }
  11413. }
  11414. if (linkTarget === null) {
  11415. fs.statSync(base);
  11416. linkTarget = fs.readlinkSync(base);
  11417. }
  11418. resolvedLink = pathModule.resolve(previous, linkTarget);
  11419. if (cache)
  11420. cache[base] = resolvedLink;
  11421. if (!isWindows)
  11422. seenLinks[id] = linkTarget;
  11423. }
  11424. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11425. start();
  11426. }
  11427. if (cache)
  11428. cache[original] = p;
  11429. return p;
  11430. };
  11431. exports2.realpath = function realpath(p, cache, cb) {
  11432. if (typeof cb !== "function") {
  11433. cb = maybeCallback(cache);
  11434. cache = null;
  11435. }
  11436. p = pathModule.resolve(p);
  11437. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11438. return process.nextTick(cb.bind(null, null, cache[p]));
  11439. }
  11440. var original = p, seenLinks = {}, knownHard = {};
  11441. var pos;
  11442. var current;
  11443. var base;
  11444. var previous;
  11445. start();
  11446. function start() {
  11447. var m = splitRootRe.exec(p);
  11448. pos = m[0].length;
  11449. current = m[0];
  11450. base = m[0];
  11451. previous = "";
  11452. if (isWindows && !knownHard[base]) {
  11453. fs.lstat(base, function(err) {
  11454. if (err)
  11455. return cb(err);
  11456. knownHard[base] = true;
  11457. LOOP();
  11458. });
  11459. } else {
  11460. process.nextTick(LOOP);
  11461. }
  11462. }
  11463. function LOOP() {
  11464. if (pos >= p.length) {
  11465. if (cache)
  11466. cache[original] = p;
  11467. return cb(null, p);
  11468. }
  11469. nextPartRe.lastIndex = pos;
  11470. var result = nextPartRe.exec(p);
  11471. previous = current;
  11472. current += result[0];
  11473. base = previous + result[1];
  11474. pos = nextPartRe.lastIndex;
  11475. if (knownHard[base] || cache && cache[base] === base) {
  11476. return process.nextTick(LOOP);
  11477. }
  11478. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11479. return gotResolvedLink(cache[base]);
  11480. }
  11481. return fs.lstat(base, gotStat);
  11482. }
  11483. function gotStat(err, stat) {
  11484. if (err)
  11485. return cb(err);
  11486. if (!stat.isSymbolicLink()) {
  11487. knownHard[base] = true;
  11488. if (cache)
  11489. cache[base] = base;
  11490. return process.nextTick(LOOP);
  11491. }
  11492. if (!isWindows) {
  11493. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11494. if (seenLinks.hasOwnProperty(id)) {
  11495. return gotTarget(null, seenLinks[id], base);
  11496. }
  11497. }
  11498. fs.stat(base, function(err2) {
  11499. if (err2)
  11500. return cb(err2);
  11501. fs.readlink(base, function(err3, target) {
  11502. if (!isWindows)
  11503. seenLinks[id] = target;
  11504. gotTarget(err3, target);
  11505. });
  11506. });
  11507. }
  11508. function gotTarget(err, target, base2) {
  11509. if (err)
  11510. return cb(err);
  11511. var resolvedLink = pathModule.resolve(previous, target);
  11512. if (cache)
  11513. cache[base2] = resolvedLink;
  11514. gotResolvedLink(resolvedLink);
  11515. }
  11516. function gotResolvedLink(resolvedLink) {
  11517. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11518. start();
  11519. }
  11520. };
  11521. }
  11522. });
  11523. var require_fs5 = __commonJS2({
  11524. "node_modules/fs.realpath/index.js"(exports2, module2) {
  11525. module2.exports = realpath;
  11526. realpath.realpath = realpath;
  11527. realpath.sync = realpathSync;
  11528. realpath.realpathSync = realpathSync;
  11529. realpath.monkeypatch = monkeypatch;
  11530. realpath.unmonkeypatch = unmonkeypatch;
  11531. var fs = require("fs");
  11532. var origRealpath = fs.realpath;
  11533. var origRealpathSync = fs.realpathSync;
  11534. var version = process.version;
  11535. var ok = /^v[0-5]\./.test(version);
  11536. var old = require_old();
  11537. function newError(er) {
  11538. return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
  11539. }
  11540. function realpath(p, cache, cb) {
  11541. if (ok) {
  11542. return origRealpath(p, cache, cb);
  11543. }
  11544. if (typeof cache === "function") {
  11545. cb = cache;
  11546. cache = null;
  11547. }
  11548. origRealpath(p, cache, function(er, result) {
  11549. if (newError(er)) {
  11550. old.realpath(p, cache, cb);
  11551. } else {
  11552. cb(er, result);
  11553. }
  11554. });
  11555. }
  11556. function realpathSync(p, cache) {
  11557. if (ok) {
  11558. return origRealpathSync(p, cache);
  11559. }
  11560. try {
  11561. return origRealpathSync(p, cache);
  11562. } catch (er) {
  11563. if (newError(er)) {
  11564. return old.realpathSync(p, cache);
  11565. } else {
  11566. throw er;
  11567. }
  11568. }
  11569. }
  11570. function monkeypatch() {
  11571. fs.realpath = realpath;
  11572. fs.realpathSync = realpathSync;
  11573. }
  11574. function unmonkeypatch() {
  11575. fs.realpath = origRealpath;
  11576. fs.realpathSync = origRealpathSync;
  11577. }
  11578. }
  11579. });
  11580. var require_concat_map = __commonJS2({
  11581. "node_modules/concat-map/index.js"(exports2, module2) {
  11582. module2.exports = function(xs, fn) {
  11583. var res = [];
  11584. for (var i = 0; i < xs.length; i++) {
  11585. var x = fn(xs[i], i);
  11586. if (isArray(x))
  11587. res.push.apply(res, x);
  11588. else
  11589. res.push(x);
  11590. }
  11591. return res;
  11592. };
  11593. var isArray = Array.isArray || function(xs) {
  11594. return Object.prototype.toString.call(xs) === "[object Array]";
  11595. };
  11596. }
  11597. });
  11598. var require_balanced_match = __commonJS2({
  11599. "node_modules/balanced-match/index.js"(exports2, module2) {
  11600. "use strict";
  11601. module2.exports = balanced;
  11602. function balanced(a, b, str) {
  11603. if (a instanceof RegExp)
  11604. a = maybeMatch(a, str);
  11605. if (b instanceof RegExp)
  11606. b = maybeMatch(b, str);
  11607. var r = range(a, b, str);
  11608. return r && {
  11609. start: r[0],
  11610. end: r[1],
  11611. pre: str.slice(0, r[0]),
  11612. body: str.slice(r[0] + a.length, r[1]),
  11613. post: str.slice(r[1] + b.length)
  11614. };
  11615. }
  11616. function maybeMatch(reg, str) {
  11617. var m = str.match(reg);
  11618. return m ? m[0] : null;
  11619. }
  11620. balanced.range = range;
  11621. function range(a, b, str) {
  11622. var begs, beg, left, right, result;
  11623. var ai = str.indexOf(a);
  11624. var bi = str.indexOf(b, ai + 1);
  11625. var i = ai;
  11626. if (ai >= 0 && bi > 0) {
  11627. if (a === b) {
  11628. return [ai, bi];
  11629. }
  11630. begs = [];
  11631. left = str.length;
  11632. while (i >= 0 && !result) {
  11633. if (i == ai) {
  11634. begs.push(i);
  11635. ai = str.indexOf(a, i + 1);
  11636. } else if (begs.length == 1) {
  11637. result = [begs.pop(), bi];
  11638. } else {
  11639. beg = begs.pop();
  11640. if (beg < left) {
  11641. left = beg;
  11642. right = bi;
  11643. }
  11644. bi = str.indexOf(b, i + 1);
  11645. }
  11646. i = ai < bi && ai >= 0 ? ai : bi;
  11647. }
  11648. if (begs.length) {
  11649. result = [left, right];
  11650. }
  11651. }
  11652. return result;
  11653. }
  11654. }
  11655. });
  11656. var require_brace_expansion = __commonJS2({
  11657. "node_modules/brace-expansion/index.js"(exports2, module2) {
  11658. var concatMap = require_concat_map();
  11659. var balanced = require_balanced_match();
  11660. module2.exports = expandTop;
  11661. var escSlash = "\0SLASH" + Math.random() + "\0";
  11662. var escOpen = "\0OPEN" + Math.random() + "\0";
  11663. var escClose = "\0CLOSE" + Math.random() + "\0";
  11664. var escComma = "\0COMMA" + Math.random() + "\0";
  11665. var escPeriod = "\0PERIOD" + Math.random() + "\0";
  11666. function numeric(str) {
  11667. return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
  11668. }
  11669. function escapeBraces(str) {
  11670. return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
  11671. }
  11672. function unescapeBraces(str) {
  11673. return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
  11674. }
  11675. function parseCommaParts(str) {
  11676. if (!str)
  11677. return [""];
  11678. var parts = [];
  11679. var m = balanced("{", "}", str);
  11680. if (!m)
  11681. return str.split(",");
  11682. var pre = m.pre;
  11683. var body = m.body;
  11684. var post = m.post;
  11685. var p = pre.split(",");
  11686. p[p.length - 1] += "{" + body + "}";
  11687. var postParts = parseCommaParts(post);
  11688. if (post.length) {
  11689. p[p.length - 1] += postParts.shift();
  11690. p.push.apply(p, postParts);
  11691. }
  11692. parts.push.apply(parts, p);
  11693. return parts;
  11694. }
  11695. function expandTop(str) {
  11696. if (!str)
  11697. return [];
  11698. if (str.substr(0, 2) === "{}") {
  11699. str = "\\{\\}" + str.substr(2);
  11700. }
  11701. return expand(escapeBraces(str), true).map(unescapeBraces);
  11702. }
  11703. function embrace(str) {
  11704. return "{" + str + "}";
  11705. }
  11706. function isPadded(el) {
  11707. return /^-?0\d/.test(el);
  11708. }
  11709. function lte(i, y) {
  11710. return i <= y;
  11711. }
  11712. function gte(i, y) {
  11713. return i >= y;
  11714. }
  11715. function expand(str, isTop) {
  11716. var expansions = [];
  11717. var m = balanced("{", "}", str);
  11718. if (!m || /\$$/.test(m.pre))
  11719. return [str];
  11720. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  11721. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  11722. var isSequence = isNumericSequence || isAlphaSequence;
  11723. var isOptions = m.body.indexOf(",") >= 0;
  11724. if (!isSequence && !isOptions) {
  11725. if (m.post.match(/,.*\}/)) {
  11726. str = m.pre + "{" + m.body + escClose + m.post;
  11727. return expand(str);
  11728. }
  11729. return [str];
  11730. }
  11731. var n;
  11732. if (isSequence) {
  11733. n = m.body.split(/\.\./);
  11734. } else {
  11735. n = parseCommaParts(m.body);
  11736. if (n.length === 1) {
  11737. n = expand(n[0], false).map(embrace);
  11738. if (n.length === 1) {
  11739. var post = m.post.length ? expand(m.post, false) : [""];
  11740. return post.map(function(p) {
  11741. return m.pre + n[0] + p;
  11742. });
  11743. }
  11744. }
  11745. }
  11746. var pre = m.pre;
  11747. var post = m.post.length ? expand(m.post, false) : [""];
  11748. var N;
  11749. if (isSequence) {
  11750. var x = numeric(n[0]);
  11751. var y = numeric(n[1]);
  11752. var width = Math.max(n[0].length, n[1].length);
  11753. var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
  11754. var test = lte;
  11755. var reverse = y < x;
  11756. if (reverse) {
  11757. incr *= -1;
  11758. test = gte;
  11759. }
  11760. var pad = n.some(isPadded);
  11761. N = [];
  11762. for (var i = x; test(i, y); i += incr) {
  11763. var c;
  11764. if (isAlphaSequence) {
  11765. c = String.fromCharCode(i);
  11766. if (c === "\\")
  11767. c = "";
  11768. } else {
  11769. c = String(i);
  11770. if (pad) {
  11771. var need = width - c.length;
  11772. if (need > 0) {
  11773. var z = new Array(need + 1).join("0");
  11774. if (i < 0)
  11775. c = "-" + z + c.slice(1);
  11776. else
  11777. c = z + c;
  11778. }
  11779. }
  11780. }
  11781. N.push(c);
  11782. }
  11783. } else {
  11784. N = concatMap(n, function(el) {
  11785. return expand(el, false);
  11786. });
  11787. }
  11788. for (var j = 0; j < N.length; j++) {
  11789. for (var k = 0; k < post.length; k++) {
  11790. var expansion = pre + N[j] + post[k];
  11791. if (!isTop || isSequence || expansion)
  11792. expansions.push(expansion);
  11793. }
  11794. }
  11795. return expansions;
  11796. }
  11797. }
  11798. });
  11799. var require_minimatch = __commonJS2({
  11800. "node_modules/minimatch/minimatch.js"(exports2, module2) {
  11801. module2.exports = minimatch;
  11802. minimatch.Minimatch = Minimatch;
  11803. var path = function() {
  11804. try {
  11805. return require("path");
  11806. } catch (e) {
  11807. }
  11808. }() || {
  11809. sep: "/"
  11810. };
  11811. minimatch.sep = path.sep;
  11812. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
  11813. var expand = require_brace_expansion();
  11814. var plTypes = {
  11815. "!": {
  11816. open: "(?:(?!(?:",
  11817. close: "))[^/]*?)"
  11818. },
  11819. "?": {
  11820. open: "(?:",
  11821. close: ")?"
  11822. },
  11823. "+": {
  11824. open: "(?:",
  11825. close: ")+"
  11826. },
  11827. "*": {
  11828. open: "(?:",
  11829. close: ")*"
  11830. },
  11831. "@": {
  11832. open: "(?:",
  11833. close: ")"
  11834. }
  11835. };
  11836. var qmark = "[^/]";
  11837. var star = qmark + "*?";
  11838. var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
  11839. var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
  11840. var reSpecials = charSet("().*{}+?[]^$\\!");
  11841. function charSet(s) {
  11842. return s.split("").reduce(function(set, c) {
  11843. set[c] = true;
  11844. return set;
  11845. }, {});
  11846. }
  11847. var slashSplit = /\/+/;
  11848. minimatch.filter = filter;
  11849. function filter(pattern, options) {
  11850. options = options || {};
  11851. return function(p, i, list) {
  11852. return minimatch(p, pattern, options);
  11853. };
  11854. }
  11855. function ext(a, b) {
  11856. b = b || {};
  11857. var t = {};
  11858. Object.keys(a).forEach(function(k) {
  11859. t[k] = a[k];
  11860. });
  11861. Object.keys(b).forEach(function(k) {
  11862. t[k] = b[k];
  11863. });
  11864. return t;
  11865. }
  11866. minimatch.defaults = function(def) {
  11867. if (!def || typeof def !== "object" || !Object.keys(def).length) {
  11868. return minimatch;
  11869. }
  11870. var orig = minimatch;
  11871. var m = function minimatch2(p, pattern, options) {
  11872. return orig(p, pattern, ext(def, options));
  11873. };
  11874. m.Minimatch = function Minimatch2(pattern, options) {
  11875. return new orig.Minimatch(pattern, ext(def, options));
  11876. };
  11877. m.Minimatch.defaults = function defaults(options) {
  11878. return orig.defaults(ext(def, options)).Minimatch;
  11879. };
  11880. m.filter = function filter2(pattern, options) {
  11881. return orig.filter(pattern, ext(def, options));
  11882. };
  11883. m.defaults = function defaults(options) {
  11884. return orig.defaults(ext(def, options));
  11885. };
  11886. m.makeRe = function makeRe2(pattern, options) {
  11887. return orig.makeRe(pattern, ext(def, options));
  11888. };
  11889. m.braceExpand = function braceExpand2(pattern, options) {
  11890. return orig.braceExpand(pattern, ext(def, options));
  11891. };
  11892. m.match = function(list, pattern, options) {
  11893. return orig.match(list, pattern, ext(def, options));
  11894. };
  11895. return m;
  11896. };
  11897. Minimatch.defaults = function(def) {
  11898. return minimatch.defaults(def).Minimatch;
  11899. };
  11900. function minimatch(p, pattern, options) {
  11901. assertValidPattern(pattern);
  11902. if (!options)
  11903. options = {};
  11904. if (!options.nocomment && pattern.charAt(0) === "#") {
  11905. return false;
  11906. }
  11907. return new Minimatch(pattern, options).match(p);
  11908. }
  11909. function Minimatch(pattern, options) {
  11910. if (!(this instanceof Minimatch)) {
  11911. return new Minimatch(pattern, options);
  11912. }
  11913. assertValidPattern(pattern);
  11914. if (!options)
  11915. options = {};
  11916. pattern = pattern.trim();
  11917. if (!options.allowWindowsEscape && path.sep !== "/") {
  11918. pattern = pattern.split(path.sep).join("/");
  11919. }
  11920. this.options = options;
  11921. this.set = [];
  11922. this.pattern = pattern;
  11923. this.regexp = null;
  11924. this.negate = false;
  11925. this.comment = false;
  11926. this.empty = false;
  11927. this.partial = !!options.partial;
  11928. this.make();
  11929. }
  11930. Minimatch.prototype.debug = function() {
  11931. };
  11932. Minimatch.prototype.make = make;
  11933. function make() {
  11934. var pattern = this.pattern;
  11935. var options = this.options;
  11936. if (!options.nocomment && pattern.charAt(0) === "#") {
  11937. this.comment = true;
  11938. return;
  11939. }
  11940. if (!pattern) {
  11941. this.empty = true;
  11942. return;
  11943. }
  11944. this.parseNegate();
  11945. var set = this.globSet = this.braceExpand();
  11946. if (options.debug)
  11947. this.debug = function debug() {
  11948. console.error.apply(console, arguments);
  11949. };
  11950. this.debug(this.pattern, set);
  11951. set = this.globParts = set.map(function(s) {
  11952. return s.split(slashSplit);
  11953. });
  11954. this.debug(this.pattern, set);
  11955. set = set.map(function(s, si, set2) {
  11956. return s.map(this.parse, this);
  11957. }, this);
  11958. this.debug(this.pattern, set);
  11959. set = set.filter(function(s) {
  11960. return s.indexOf(false) === -1;
  11961. });
  11962. this.debug(this.pattern, set);
  11963. this.set = set;
  11964. }
  11965. Minimatch.prototype.parseNegate = parseNegate;
  11966. function parseNegate() {
  11967. var pattern = this.pattern;
  11968. var negate = false;
  11969. var options = this.options;
  11970. var negateOffset = 0;
  11971. if (options.nonegate)
  11972. return;
  11973. for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
  11974. negate = !negate;
  11975. negateOffset++;
  11976. }
  11977. if (negateOffset)
  11978. this.pattern = pattern.substr(negateOffset);
  11979. this.negate = negate;
  11980. }
  11981. minimatch.braceExpand = function(pattern, options) {
  11982. return braceExpand(pattern, options);
  11983. };
  11984. Minimatch.prototype.braceExpand = braceExpand;
  11985. function braceExpand(pattern, options) {
  11986. if (!options) {
  11987. if (this instanceof Minimatch) {
  11988. options = this.options;
  11989. } else {
  11990. options = {};
  11991. }
  11992. }
  11993. pattern = typeof pattern === "undefined" ? this.pattern : pattern;
  11994. assertValidPattern(pattern);
  11995. if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
  11996. return [pattern];
  11997. }
  11998. return expand(pattern);
  11999. }
  12000. var MAX_PATTERN_LENGTH = 1024 * 64;
  12001. var assertValidPattern = function(pattern) {
  12002. if (typeof pattern !== "string") {
  12003. throw new TypeError("invalid pattern");
  12004. }
  12005. if (pattern.length > MAX_PATTERN_LENGTH) {
  12006. throw new TypeError("pattern is too long");
  12007. }
  12008. };
  12009. Minimatch.prototype.parse = parse;
  12010. var SUBPARSE = {};
  12011. function parse(pattern, isSub) {
  12012. assertValidPattern(pattern);
  12013. var options = this.options;
  12014. if (pattern === "**") {
  12015. if (!options.noglobstar)
  12016. return GLOBSTAR;
  12017. else
  12018. pattern = "*";
  12019. }
  12020. if (pattern === "")
  12021. return "";
  12022. var re = "";
  12023. var hasMagic = !!options.nocase;
  12024. var escaping = false;
  12025. var patternListStack = [];
  12026. var negativeLists = [];
  12027. var stateChar;
  12028. var inClass = false;
  12029. var reClassStart = -1;
  12030. var classStart = -1;
  12031. var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
  12032. var self2 = this;
  12033. function clearStateChar() {
  12034. if (stateChar) {
  12035. switch (stateChar) {
  12036. case "*":
  12037. re += star;
  12038. hasMagic = true;
  12039. break;
  12040. case "?":
  12041. re += qmark;
  12042. hasMagic = true;
  12043. break;
  12044. default:
  12045. re += "\\" + stateChar;
  12046. break;
  12047. }
  12048. self2.debug("clearStateChar %j %j", stateChar, re);
  12049. stateChar = false;
  12050. }
  12051. }
  12052. for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
  12053. this.debug("%s %s %s %j", pattern, i, re, c);
  12054. if (escaping && reSpecials[c]) {
  12055. re += "\\" + c;
  12056. escaping = false;
  12057. continue;
  12058. }
  12059. switch (c) {
  12060. case "/": {
  12061. return false;
  12062. }
  12063. case "\\":
  12064. clearStateChar();
  12065. escaping = true;
  12066. continue;
  12067. case "?":
  12068. case "*":
  12069. case "+":
  12070. case "@":
  12071. case "!":
  12072. this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
  12073. if (inClass) {
  12074. this.debug(" in class");
  12075. if (c === "!" && i === classStart + 1)
  12076. c = "^";
  12077. re += c;
  12078. continue;
  12079. }
  12080. self2.debug("call clearStateChar %j", stateChar);
  12081. clearStateChar();
  12082. stateChar = c;
  12083. if (options.noext)
  12084. clearStateChar();
  12085. continue;
  12086. case "(":
  12087. if (inClass) {
  12088. re += "(";
  12089. continue;
  12090. }
  12091. if (!stateChar) {
  12092. re += "\\(";
  12093. continue;
  12094. }
  12095. patternListStack.push({
  12096. type: stateChar,
  12097. start: i - 1,
  12098. reStart: re.length,
  12099. open: plTypes[stateChar].open,
  12100. close: plTypes[stateChar].close
  12101. });
  12102. re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
  12103. this.debug("plType %j %j", stateChar, re);
  12104. stateChar = false;
  12105. continue;
  12106. case ")":
  12107. if (inClass || !patternListStack.length) {
  12108. re += "\\)";
  12109. continue;
  12110. }
  12111. clearStateChar();
  12112. hasMagic = true;
  12113. var pl = patternListStack.pop();
  12114. re += pl.close;
  12115. if (pl.type === "!") {
  12116. negativeLists.push(pl);
  12117. }
  12118. pl.reEnd = re.length;
  12119. continue;
  12120. case "|":
  12121. if (inClass || !patternListStack.length || escaping) {
  12122. re += "\\|";
  12123. escaping = false;
  12124. continue;
  12125. }
  12126. clearStateChar();
  12127. re += "|";
  12128. continue;
  12129. case "[":
  12130. clearStateChar();
  12131. if (inClass) {
  12132. re += "\\" + c;
  12133. continue;
  12134. }
  12135. inClass = true;
  12136. classStart = i;
  12137. reClassStart = re.length;
  12138. re += c;
  12139. continue;
  12140. case "]":
  12141. if (i === classStart + 1 || !inClass) {
  12142. re += "\\" + c;
  12143. escaping = false;
  12144. continue;
  12145. }
  12146. var cs = pattern.substring(classStart + 1, i);
  12147. try {
  12148. RegExp("[" + cs + "]");
  12149. } catch (er) {
  12150. var sp = this.parse(cs, SUBPARSE);
  12151. re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
  12152. hasMagic = hasMagic || sp[1];
  12153. inClass = false;
  12154. continue;
  12155. }
  12156. hasMagic = true;
  12157. inClass = false;
  12158. re += c;
  12159. continue;
  12160. default:
  12161. clearStateChar();
  12162. if (escaping) {
  12163. escaping = false;
  12164. } else if (reSpecials[c] && !(c === "^" && inClass)) {
  12165. re += "\\";
  12166. }
  12167. re += c;
  12168. }
  12169. }
  12170. if (inClass) {
  12171. cs = pattern.substr(classStart + 1);
  12172. sp = this.parse(cs, SUBPARSE);
  12173. re = re.substr(0, reClassStart) + "\\[" + sp[0];
  12174. hasMagic = hasMagic || sp[1];
  12175. }
  12176. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  12177. var tail = re.slice(pl.reStart + pl.open.length);
  12178. this.debug("setting tail", re, pl);
  12179. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
  12180. if (!$2) {
  12181. $2 = "\\";
  12182. }
  12183. return $1 + $1 + $2 + "|";
  12184. });
  12185. this.debug("tail=%j\n %s", tail, tail, pl, re);
  12186. var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
  12187. hasMagic = true;
  12188. re = re.slice(0, pl.reStart) + t + "\\(" + tail;
  12189. }
  12190. clearStateChar();
  12191. if (escaping) {
  12192. re += "\\\\";
  12193. }
  12194. var addPatternStart = false;
  12195. switch (re.charAt(0)) {
  12196. case "[":
  12197. case ".":
  12198. case "(":
  12199. addPatternStart = true;
  12200. }
  12201. for (var n = negativeLists.length - 1; n > -1; n--) {
  12202. var nl = negativeLists[n];
  12203. var nlBefore = re.slice(0, nl.reStart);
  12204. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  12205. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  12206. var nlAfter = re.slice(nl.reEnd);
  12207. nlLast += nlAfter;
  12208. var openParensBefore = nlBefore.split("(").length - 1;
  12209. var cleanAfter = nlAfter;
  12210. for (i = 0; i < openParensBefore; i++) {
  12211. cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
  12212. }
  12213. nlAfter = cleanAfter;
  12214. var dollar = "";
  12215. if (nlAfter === "" && isSub !== SUBPARSE) {
  12216. dollar = "$";
  12217. }
  12218. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  12219. re = newRe;
  12220. }
  12221. if (re !== "" && hasMagic) {
  12222. re = "(?=.)" + re;
  12223. }
  12224. if (addPatternStart) {
  12225. re = patternStart + re;
  12226. }
  12227. if (isSub === SUBPARSE) {
  12228. return [re, hasMagic];
  12229. }
  12230. if (!hasMagic) {
  12231. return globUnescape(pattern);
  12232. }
  12233. var flags = options.nocase ? "i" : "";
  12234. try {
  12235. var regExp = new RegExp("^" + re + "$", flags);
  12236. } catch (er) {
  12237. return new RegExp("$.");
  12238. }
  12239. regExp._glob = pattern;
  12240. regExp._src = re;
  12241. return regExp;
  12242. }
  12243. minimatch.makeRe = function(pattern, options) {
  12244. return new Minimatch(pattern, options || {}).makeRe();
  12245. };
  12246. Minimatch.prototype.makeRe = makeRe;
  12247. function makeRe() {
  12248. if (this.regexp || this.regexp === false)
  12249. return this.regexp;
  12250. var set = this.set;
  12251. if (!set.length) {
  12252. this.regexp = false;
  12253. return this.regexp;
  12254. }
  12255. var options = this.options;
  12256. var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
  12257. var flags = options.nocase ? "i" : "";
  12258. var re = set.map(function(pattern) {
  12259. return pattern.map(function(p) {
  12260. return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
  12261. }).join("\\/");
  12262. }).join("|");
  12263. re = "^(?:" + re + ")$";
  12264. if (this.negate)
  12265. re = "^(?!" + re + ").*$";
  12266. try {
  12267. this.regexp = new RegExp(re, flags);
  12268. } catch (ex) {
  12269. this.regexp = false;
  12270. }
  12271. return this.regexp;
  12272. }
  12273. minimatch.match = function(list, pattern, options) {
  12274. options = options || {};
  12275. var mm = new Minimatch(pattern, options);
  12276. list = list.filter(function(f) {
  12277. return mm.match(f);
  12278. });
  12279. if (mm.options.nonull && !list.length) {
  12280. list.push(pattern);
  12281. }
  12282. return list;
  12283. };
  12284. Minimatch.prototype.match = function match(f, partial) {
  12285. if (typeof partial === "undefined")
  12286. partial = this.partial;
  12287. this.debug("match", f, this.pattern);
  12288. if (this.comment)
  12289. return false;
  12290. if (this.empty)
  12291. return f === "";
  12292. if (f === "/" && partial)
  12293. return true;
  12294. var options = this.options;
  12295. if (path.sep !== "/") {
  12296. f = f.split(path.sep).join("/");
  12297. }
  12298. f = f.split(slashSplit);
  12299. this.debug(this.pattern, "split", f);
  12300. var set = this.set;
  12301. this.debug(this.pattern, "set", set);
  12302. var filename;
  12303. var i;
  12304. for (i = f.length - 1; i >= 0; i--) {
  12305. filename = f[i];
  12306. if (filename)
  12307. break;
  12308. }
  12309. for (i = 0; i < set.length; i++) {
  12310. var pattern = set[i];
  12311. var file = f;
  12312. if (options.matchBase && pattern.length === 1) {
  12313. file = [filename];
  12314. }
  12315. var hit = this.matchOne(file, pattern, partial);
  12316. if (hit) {
  12317. if (options.flipNegate)
  12318. return true;
  12319. return !this.negate;
  12320. }
  12321. }
  12322. if (options.flipNegate)
  12323. return false;
  12324. return this.negate;
  12325. };
  12326. Minimatch.prototype.matchOne = function(file, pattern, partial) {
  12327. var options = this.options;
  12328. this.debug("matchOne", {
  12329. "this": this,
  12330. file,
  12331. pattern
  12332. });
  12333. this.debug("matchOne", file.length, pattern.length);
  12334. for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
  12335. this.debug("matchOne loop");
  12336. var p = pattern[pi];
  12337. var f = file[fi];
  12338. this.debug(pattern, p, f);
  12339. if (p === false)
  12340. return false;
  12341. if (p === GLOBSTAR) {
  12342. this.debug("GLOBSTAR", [pattern, p, f]);
  12343. var fr = fi;
  12344. var pr = pi + 1;
  12345. if (pr === pl) {
  12346. this.debug("** at the end");
  12347. for (; fi < fl; fi++) {
  12348. if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
  12349. return false;
  12350. }
  12351. return true;
  12352. }
  12353. while (fr < fl) {
  12354. var swallowee = file[fr];
  12355. this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
  12356. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  12357. this.debug("globstar found match!", fr, fl, swallowee);
  12358. return true;
  12359. } else {
  12360. if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
  12361. this.debug("dot detected!", file, fr, pattern, pr);
  12362. break;
  12363. }
  12364. this.debug("globstar swallow a segment, and continue");
  12365. fr++;
  12366. }
  12367. }
  12368. if (partial) {
  12369. this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
  12370. if (fr === fl)
  12371. return true;
  12372. }
  12373. return false;
  12374. }
  12375. var hit;
  12376. if (typeof p === "string") {
  12377. hit = f === p;
  12378. this.debug("string match", p, f, hit);
  12379. } else {
  12380. hit = f.match(p);
  12381. this.debug("pattern match", p, f, hit);
  12382. }
  12383. if (!hit)
  12384. return false;
  12385. }
  12386. if (fi === fl && pi === pl) {
  12387. return true;
  12388. } else if (fi === fl) {
  12389. return partial;
  12390. } else if (pi === pl) {
  12391. return fi === fl - 1 && file[fi] === "";
  12392. }
  12393. throw new Error("wtf?");
  12394. };
  12395. function globUnescape(s) {
  12396. return s.replace(/\\(.)/g, "$1");
  12397. }
  12398. function regExpEscape(s) {
  12399. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  12400. }
  12401. }
  12402. });
  12403. var require_inherits_browser = __commonJS2({
  12404. "node_modules/inherits/inherits_browser.js"(exports2, module2) {
  12405. if (typeof Object.create === "function") {
  12406. module2.exports = function inherits(ctor, superCtor) {
  12407. if (superCtor) {
  12408. ctor.super_ = superCtor;
  12409. ctor.prototype = Object.create(superCtor.prototype, {
  12410. constructor: {
  12411. value: ctor,
  12412. enumerable: false,
  12413. writable: true,
  12414. configurable: true
  12415. }
  12416. });
  12417. }
  12418. };
  12419. } else {
  12420. module2.exports = function inherits(ctor, superCtor) {
  12421. if (superCtor) {
  12422. ctor.super_ = superCtor;
  12423. var TempCtor = function() {
  12424. };
  12425. TempCtor.prototype = superCtor.prototype;
  12426. ctor.prototype = new TempCtor();
  12427. ctor.prototype.constructor = ctor;
  12428. }
  12429. };
  12430. }
  12431. }
  12432. });
  12433. var require_inherits = __commonJS2({
  12434. "node_modules/inherits/inherits.js"(exports2, module2) {
  12435. try {
  12436. util = require("util");
  12437. if (typeof util.inherits !== "function")
  12438. throw "";
  12439. module2.exports = util.inherits;
  12440. } catch (e) {
  12441. module2.exports = require_inherits_browser();
  12442. }
  12443. var util;
  12444. }
  12445. });
  12446. var require_path_is_absolute = __commonJS2({
  12447. "node_modules/path-is-absolute/index.js"(exports2, module2) {
  12448. "use strict";
  12449. function posix(path) {
  12450. return path.charAt(0) === "/";
  12451. }
  12452. function win32(path) {
  12453. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  12454. var result = splitDeviceRe.exec(path);
  12455. var device = result[1] || "";
  12456. var isUnc = Boolean(device && device.charAt(1) !== ":");
  12457. return Boolean(result[2] || isUnc);
  12458. }
  12459. module2.exports = process.platform === "win32" ? win32 : posix;
  12460. module2.exports.posix = posix;
  12461. module2.exports.win32 = win32;
  12462. }
  12463. });
  12464. var require_common3 = __commonJS2({
  12465. "node_modules/glob/common.js"(exports2) {
  12466. exports2.setopts = setopts;
  12467. exports2.ownProp = ownProp;
  12468. exports2.makeAbs = makeAbs;
  12469. exports2.finish = finish;
  12470. exports2.mark = mark;
  12471. exports2.isIgnored = isIgnored;
  12472. exports2.childrenIgnored = childrenIgnored;
  12473. function ownProp(obj, field) {
  12474. return Object.prototype.hasOwnProperty.call(obj, field);
  12475. }
  12476. var fs = require("fs");
  12477. var path = require("path");
  12478. var minimatch = require_minimatch();
  12479. var isAbsolute = require_path_is_absolute();
  12480. var Minimatch = minimatch.Minimatch;
  12481. function alphasort(a, b) {
  12482. return a.localeCompare(b, "en");
  12483. }
  12484. function setupIgnores(self2, options) {
  12485. self2.ignore = options.ignore || [];
  12486. if (!Array.isArray(self2.ignore))
  12487. self2.ignore = [self2.ignore];
  12488. if (self2.ignore.length) {
  12489. self2.ignore = self2.ignore.map(ignoreMap);
  12490. }
  12491. }
  12492. function ignoreMap(pattern) {
  12493. var gmatcher = null;
  12494. if (pattern.slice(-3) === "/**") {
  12495. var gpattern = pattern.replace(/(\/\*\*)+$/, "");
  12496. gmatcher = new Minimatch(gpattern, {
  12497. dot: true
  12498. });
  12499. }
  12500. return {
  12501. matcher: new Minimatch(pattern, {
  12502. dot: true
  12503. }),
  12504. gmatcher
  12505. };
  12506. }
  12507. function setopts(self2, pattern, options) {
  12508. if (!options)
  12509. options = {};
  12510. if (options.matchBase && -1 === pattern.indexOf("/")) {
  12511. if (options.noglobstar) {
  12512. throw new Error("base matching requires globstar");
  12513. }
  12514. pattern = "**/" + pattern;
  12515. }
  12516. self2.silent = !!options.silent;
  12517. self2.pattern = pattern;
  12518. self2.strict = options.strict !== false;
  12519. self2.realpath = !!options.realpath;
  12520. self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
  12521. self2.follow = !!options.follow;
  12522. self2.dot = !!options.dot;
  12523. self2.mark = !!options.mark;
  12524. self2.nodir = !!options.nodir;
  12525. if (self2.nodir)
  12526. self2.mark = true;
  12527. self2.sync = !!options.sync;
  12528. self2.nounique = !!options.nounique;
  12529. self2.nonull = !!options.nonull;
  12530. self2.nosort = !!options.nosort;
  12531. self2.nocase = !!options.nocase;
  12532. self2.stat = !!options.stat;
  12533. self2.noprocess = !!options.noprocess;
  12534. self2.absolute = !!options.absolute;
  12535. self2.fs = options.fs || fs;
  12536. self2.maxLength = options.maxLength || Infinity;
  12537. self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
  12538. self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
  12539. self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
  12540. setupIgnores(self2, options);
  12541. self2.changedCwd = false;
  12542. var cwd = process.cwd();
  12543. if (!ownProp(options, "cwd"))
  12544. self2.cwd = cwd;
  12545. else {
  12546. self2.cwd = path.resolve(options.cwd);
  12547. self2.changedCwd = self2.cwd !== cwd;
  12548. }
  12549. self2.root = options.root || path.resolve(self2.cwd, "/");
  12550. self2.root = path.resolve(self2.root);
  12551. if (process.platform === "win32")
  12552. self2.root = self2.root.replace(/\\/g, "/");
  12553. self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
  12554. if (process.platform === "win32")
  12555. self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
  12556. self2.nomount = !!options.nomount;
  12557. options.nonegate = true;
  12558. options.nocomment = true;
  12559. options.allowWindowsEscape = false;
  12560. self2.minimatch = new Minimatch(pattern, options);
  12561. self2.options = self2.minimatch.options;
  12562. }
  12563. function finish(self2) {
  12564. var nou = self2.nounique;
  12565. var all = nou ? [] : /* @__PURE__ */ Object.create(null);
  12566. for (var i = 0, l = self2.matches.length; i < l; i++) {
  12567. var matches = self2.matches[i];
  12568. if (!matches || Object.keys(matches).length === 0) {
  12569. if (self2.nonull) {
  12570. var literal = self2.minimatch.globSet[i];
  12571. if (nou)
  12572. all.push(literal);
  12573. else
  12574. all[literal] = true;
  12575. }
  12576. } else {
  12577. var m = Object.keys(matches);
  12578. if (nou)
  12579. all.push.apply(all, m);
  12580. else
  12581. m.forEach(function(m2) {
  12582. all[m2] = true;
  12583. });
  12584. }
  12585. }
  12586. if (!nou)
  12587. all = Object.keys(all);
  12588. if (!self2.nosort)
  12589. all = all.sort(alphasort);
  12590. if (self2.mark) {
  12591. for (var i = 0; i < all.length; i++) {
  12592. all[i] = self2._mark(all[i]);
  12593. }
  12594. if (self2.nodir) {
  12595. all = all.filter(function(e) {
  12596. var notDir = !/\/$/.test(e);
  12597. var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
  12598. if (notDir && c)
  12599. notDir = c !== "DIR" && !Array.isArray(c);
  12600. return notDir;
  12601. });
  12602. }
  12603. }
  12604. if (self2.ignore.length)
  12605. all = all.filter(function(m2) {
  12606. return !isIgnored(self2, m2);
  12607. });
  12608. self2.found = all;
  12609. }
  12610. function mark(self2, p) {
  12611. var abs = makeAbs(self2, p);
  12612. var c = self2.cache[abs];
  12613. var m = p;
  12614. if (c) {
  12615. var isDir = c === "DIR" || Array.isArray(c);
  12616. var slash = p.slice(-1) === "/";
  12617. if (isDir && !slash)
  12618. m += "/";
  12619. else if (!isDir && slash)
  12620. m = m.slice(0, -1);
  12621. if (m !== p) {
  12622. var mabs = makeAbs(self2, m);
  12623. self2.statCache[mabs] = self2.statCache[abs];
  12624. self2.cache[mabs] = self2.cache[abs];
  12625. }
  12626. }
  12627. return m;
  12628. }
  12629. function makeAbs(self2, f) {
  12630. var abs = f;
  12631. if (f.charAt(0) === "/") {
  12632. abs = path.join(self2.root, f);
  12633. } else if (isAbsolute(f) || f === "") {
  12634. abs = f;
  12635. } else if (self2.changedCwd) {
  12636. abs = path.resolve(self2.cwd, f);
  12637. } else {
  12638. abs = path.resolve(f);
  12639. }
  12640. if (process.platform === "win32")
  12641. abs = abs.replace(/\\/g, "/");
  12642. return abs;
  12643. }
  12644. function isIgnored(self2, path2) {
  12645. if (!self2.ignore.length)
  12646. return false;
  12647. return self2.ignore.some(function(item) {
  12648. return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
  12649. });
  12650. }
  12651. function childrenIgnored(self2, path2) {
  12652. if (!self2.ignore.length)
  12653. return false;
  12654. return self2.ignore.some(function(item) {
  12655. return !!(item.gmatcher && item.gmatcher.match(path2));
  12656. });
  12657. }
  12658. }
  12659. });
  12660. var require_sync7 = __commonJS2({
  12661. "node_modules/glob/sync.js"(exports2, module2) {
  12662. module2.exports = globSync;
  12663. globSync.GlobSync = GlobSync;
  12664. var rp = require_fs5();
  12665. var minimatch = require_minimatch();
  12666. var Minimatch = minimatch.Minimatch;
  12667. var Glob = require_glob().Glob;
  12668. var util = require("util");
  12669. var path = require("path");
  12670. var assert = require("assert");
  12671. var isAbsolute = require_path_is_absolute();
  12672. var common = require_common3();
  12673. var setopts = common.setopts;
  12674. var ownProp = common.ownProp;
  12675. var childrenIgnored = common.childrenIgnored;
  12676. var isIgnored = common.isIgnored;
  12677. function globSync(pattern, options) {
  12678. if (typeof options === "function" || arguments.length === 3)
  12679. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12680. return new GlobSync(pattern, options).found;
  12681. }
  12682. function GlobSync(pattern, options) {
  12683. if (!pattern)
  12684. throw new Error("must provide pattern");
  12685. if (typeof options === "function" || arguments.length === 3)
  12686. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12687. if (!(this instanceof GlobSync))
  12688. return new GlobSync(pattern, options);
  12689. setopts(this, pattern, options);
  12690. if (this.noprocess)
  12691. return this;
  12692. var n = this.minimatch.set.length;
  12693. this.matches = new Array(n);
  12694. for (var i = 0; i < n; i++) {
  12695. this._process(this.minimatch.set[i], i, false);
  12696. }
  12697. this._finish();
  12698. }
  12699. GlobSync.prototype._finish = function() {
  12700. assert.ok(this instanceof GlobSync);
  12701. if (this.realpath) {
  12702. var self2 = this;
  12703. this.matches.forEach(function(matchset, index) {
  12704. var set = self2.matches[index] = /* @__PURE__ */ Object.create(null);
  12705. for (var p in matchset) {
  12706. try {
  12707. p = self2._makeAbs(p);
  12708. var real = rp.realpathSync(p, self2.realpathCache);
  12709. set[real] = true;
  12710. } catch (er) {
  12711. if (er.syscall === "stat")
  12712. set[self2._makeAbs(p)] = true;
  12713. else
  12714. throw er;
  12715. }
  12716. }
  12717. });
  12718. }
  12719. common.finish(this);
  12720. };
  12721. GlobSync.prototype._process = function(pattern, index, inGlobStar) {
  12722. assert.ok(this instanceof GlobSync);
  12723. var n = 0;
  12724. while (typeof pattern[n] === "string") {
  12725. n++;
  12726. }
  12727. var prefix;
  12728. switch (n) {
  12729. case pattern.length:
  12730. this._processSimple(pattern.join("/"), index);
  12731. return;
  12732. case 0:
  12733. prefix = null;
  12734. break;
  12735. default:
  12736. prefix = pattern.slice(0, n).join("/");
  12737. break;
  12738. }
  12739. var remain = pattern.slice(n);
  12740. var read;
  12741. if (prefix === null)
  12742. read = ".";
  12743. else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
  12744. return typeof p === "string" ? p : "[*]";
  12745. }).join("/"))) {
  12746. if (!prefix || !isAbsolute(prefix))
  12747. prefix = "/" + prefix;
  12748. read = prefix;
  12749. } else
  12750. read = prefix;
  12751. var abs = this._makeAbs(read);
  12752. if (childrenIgnored(this, read))
  12753. return;
  12754. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  12755. if (isGlobStar)
  12756. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
  12757. else
  12758. this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
  12759. };
  12760. GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
  12761. var entries = this._readdir(abs, inGlobStar);
  12762. if (!entries)
  12763. return;
  12764. var pn = remain[0];
  12765. var negate = !!this.minimatch.negate;
  12766. var rawGlob = pn._glob;
  12767. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  12768. var matchedEntries = [];
  12769. for (var i = 0; i < entries.length; i++) {
  12770. var e = entries[i];
  12771. if (e.charAt(0) !== "." || dotOk) {
  12772. var m;
  12773. if (negate && !prefix) {
  12774. m = !e.match(pn);
  12775. } else {
  12776. m = e.match(pn);
  12777. }
  12778. if (m)
  12779. matchedEntries.push(e);
  12780. }
  12781. }
  12782. var len = matchedEntries.length;
  12783. if (len === 0)
  12784. return;
  12785. if (remain.length === 1 && !this.mark && !this.stat) {
  12786. if (!this.matches[index])
  12787. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12788. for (var i = 0; i < len; i++) {
  12789. var e = matchedEntries[i];
  12790. if (prefix) {
  12791. if (prefix.slice(-1) !== "/")
  12792. e = prefix + "/" + e;
  12793. else
  12794. e = prefix + e;
  12795. }
  12796. if (e.charAt(0) === "/" && !this.nomount) {
  12797. e = path.join(this.root, e);
  12798. }
  12799. this._emitMatch(index, e);
  12800. }
  12801. return;
  12802. }
  12803. remain.shift();
  12804. for (var i = 0; i < len; i++) {
  12805. var e = matchedEntries[i];
  12806. var newPattern;
  12807. if (prefix)
  12808. newPattern = [prefix, e];
  12809. else
  12810. newPattern = [e];
  12811. this._process(newPattern.concat(remain), index, inGlobStar);
  12812. }
  12813. };
  12814. GlobSync.prototype._emitMatch = function(index, e) {
  12815. if (isIgnored(this, e))
  12816. return;
  12817. var abs = this._makeAbs(e);
  12818. if (this.mark)
  12819. e = this._mark(e);
  12820. if (this.absolute) {
  12821. e = abs;
  12822. }
  12823. if (this.matches[index][e])
  12824. return;
  12825. if (this.nodir) {
  12826. var c = this.cache[abs];
  12827. if (c === "DIR" || Array.isArray(c))
  12828. return;
  12829. }
  12830. this.matches[index][e] = true;
  12831. if (this.stat)
  12832. this._stat(e);
  12833. };
  12834. GlobSync.prototype._readdirInGlobStar = function(abs) {
  12835. if (this.follow)
  12836. return this._readdir(abs, false);
  12837. var entries;
  12838. var lstat;
  12839. var stat;
  12840. try {
  12841. lstat = this.fs.lstatSync(abs);
  12842. } catch (er) {
  12843. if (er.code === "ENOENT") {
  12844. return null;
  12845. }
  12846. }
  12847. var isSym = lstat && lstat.isSymbolicLink();
  12848. this.symlinks[abs] = isSym;
  12849. if (!isSym && lstat && !lstat.isDirectory())
  12850. this.cache[abs] = "FILE";
  12851. else
  12852. entries = this._readdir(abs, false);
  12853. return entries;
  12854. };
  12855. GlobSync.prototype._readdir = function(abs, inGlobStar) {
  12856. var entries;
  12857. if (inGlobStar && !ownProp(this.symlinks, abs))
  12858. return this._readdirInGlobStar(abs);
  12859. if (ownProp(this.cache, abs)) {
  12860. var c = this.cache[abs];
  12861. if (!c || c === "FILE")
  12862. return null;
  12863. if (Array.isArray(c))
  12864. return c;
  12865. }
  12866. try {
  12867. return this._readdirEntries(abs, this.fs.readdirSync(abs));
  12868. } catch (er) {
  12869. this._readdirError(abs, er);
  12870. return null;
  12871. }
  12872. };
  12873. GlobSync.prototype._readdirEntries = function(abs, entries) {
  12874. if (!this.mark && !this.stat) {
  12875. for (var i = 0; i < entries.length; i++) {
  12876. var e = entries[i];
  12877. if (abs === "/")
  12878. e = abs + e;
  12879. else
  12880. e = abs + "/" + e;
  12881. this.cache[e] = true;
  12882. }
  12883. }
  12884. this.cache[abs] = entries;
  12885. return entries;
  12886. };
  12887. GlobSync.prototype._readdirError = function(f, er) {
  12888. switch (er.code) {
  12889. case "ENOTSUP":
  12890. case "ENOTDIR":
  12891. var abs = this._makeAbs(f);
  12892. this.cache[abs] = "FILE";
  12893. if (abs === this.cwdAbs) {
  12894. var error = new Error(er.code + " invalid cwd " + this.cwd);
  12895. error.path = this.cwd;
  12896. error.code = er.code;
  12897. throw error;
  12898. }
  12899. break;
  12900. case "ENOENT":
  12901. case "ELOOP":
  12902. case "ENAMETOOLONG":
  12903. case "UNKNOWN":
  12904. this.cache[this._makeAbs(f)] = false;
  12905. break;
  12906. default:
  12907. this.cache[this._makeAbs(f)] = false;
  12908. if (this.strict)
  12909. throw er;
  12910. if (!this.silent)
  12911. console.error("glob error", er);
  12912. break;
  12913. }
  12914. };
  12915. GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
  12916. var entries = this._readdir(abs, inGlobStar);
  12917. if (!entries)
  12918. return;
  12919. var remainWithoutGlobStar = remain.slice(1);
  12920. var gspref = prefix ? [prefix] : [];
  12921. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  12922. this._process(noGlobStar, index, false);
  12923. var len = entries.length;
  12924. var isSym = this.symlinks[abs];
  12925. if (isSym && inGlobStar)
  12926. return;
  12927. for (var i = 0; i < len; i++) {
  12928. var e = entries[i];
  12929. if (e.charAt(0) === "." && !this.dot)
  12930. continue;
  12931. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  12932. this._process(instead, index, true);
  12933. var below = gspref.concat(entries[i], remain);
  12934. this._process(below, index, true);
  12935. }
  12936. };
  12937. GlobSync.prototype._processSimple = function(prefix, index) {
  12938. var exists = this._stat(prefix);
  12939. if (!this.matches[index])
  12940. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12941. if (!exists)
  12942. return;
  12943. if (prefix && isAbsolute(prefix) && !this.nomount) {
  12944. var trail = /[\/\\]$/.test(prefix);
  12945. if (prefix.charAt(0) === "/") {
  12946. prefix = path.join(this.root, prefix);
  12947. } else {
  12948. prefix = path.resolve(this.root, prefix);
  12949. if (trail)
  12950. prefix += "/";
  12951. }
  12952. }
  12953. if (process.platform === "win32")
  12954. prefix = prefix.replace(/\\/g, "/");
  12955. this._emitMatch(index, prefix);
  12956. };
  12957. GlobSync.prototype._stat = function(f) {
  12958. var abs = this._makeAbs(f);
  12959. var needDir = f.slice(-1) === "/";
  12960. if (f.length > this.maxLength)
  12961. return false;
  12962. if (!this.stat && ownProp(this.cache, abs)) {
  12963. var c = this.cache[abs];
  12964. if (Array.isArray(c))
  12965. c = "DIR";
  12966. if (!needDir || c === "DIR")
  12967. return c;
  12968. if (needDir && c === "FILE")
  12969. return false;
  12970. }
  12971. var exists;
  12972. var stat = this.statCache[abs];
  12973. if (!stat) {
  12974. var lstat;
  12975. try {
  12976. lstat = this.fs.lstatSync(abs);
  12977. } catch (er) {
  12978. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  12979. this.statCache[abs] = false;
  12980. return false;
  12981. }
  12982. }
  12983. if (lstat && lstat.isSymbolicLink()) {
  12984. try {
  12985. stat = this.fs.statSync(abs);
  12986. } catch (er) {
  12987. stat = lstat;
  12988. }
  12989. } else {
  12990. stat = lstat;
  12991. }
  12992. }
  12993. this.statCache[abs] = stat;
  12994. var c = true;
  12995. if (stat)
  12996. c = stat.isDirectory() ? "DIR" : "FILE";
  12997. this.cache[abs] = this.cache[abs] || c;
  12998. if (needDir && c === "FILE")
  12999. return false;
  13000. return c;
  13001. };
  13002. GlobSync.prototype._mark = function(p) {
  13003. return common.mark(this, p);
  13004. };
  13005. GlobSync.prototype._makeAbs = function(f) {
  13006. return common.makeAbs(this, f);
  13007. };
  13008. }
  13009. });
  13010. var require_wrappy = __commonJS2({
  13011. "node_modules/wrappy/wrappy.js"(exports2, module2) {
  13012. module2.exports = wrappy;
  13013. function wrappy(fn, cb) {
  13014. if (fn && cb)
  13015. return wrappy(fn)(cb);
  13016. if (typeof fn !== "function")
  13017. throw new TypeError("need wrapper function");
  13018. Object.keys(fn).forEach(function(k) {
  13019. wrapper[k] = fn[k];
  13020. });
  13021. return wrapper;
  13022. function wrapper() {
  13023. var args = new Array(arguments.length);
  13024. for (var i = 0; i < args.length; i++) {
  13025. args[i] = arguments[i];
  13026. }
  13027. var ret = fn.apply(this, args);
  13028. var cb2 = args[args.length - 1];
  13029. if (typeof ret === "function" && ret !== cb2) {
  13030. Object.keys(cb2).forEach(function(k) {
  13031. ret[k] = cb2[k];
  13032. });
  13033. }
  13034. return ret;
  13035. }
  13036. }
  13037. }
  13038. });
  13039. var require_once = __commonJS2({
  13040. "node_modules/once/once.js"(exports2, module2) {
  13041. var wrappy = require_wrappy();
  13042. module2.exports = wrappy(once);
  13043. module2.exports.strict = wrappy(onceStrict);
  13044. once.proto = once(function() {
  13045. Object.defineProperty(Function.prototype, "once", {
  13046. value: function() {
  13047. return once(this);
  13048. },
  13049. configurable: true
  13050. });
  13051. Object.defineProperty(Function.prototype, "onceStrict", {
  13052. value: function() {
  13053. return onceStrict(this);
  13054. },
  13055. configurable: true
  13056. });
  13057. });
  13058. function once(fn) {
  13059. var f = function() {
  13060. if (f.called)
  13061. return f.value;
  13062. f.called = true;
  13063. return f.value = fn.apply(this, arguments);
  13064. };
  13065. f.called = false;
  13066. return f;
  13067. }
  13068. function onceStrict(fn) {
  13069. var f = function() {
  13070. if (f.called)
  13071. throw new Error(f.onceError);
  13072. f.called = true;
  13073. return f.value = fn.apply(this, arguments);
  13074. };
  13075. var name = fn.name || "Function wrapped with `once`";
  13076. f.onceError = name + " shouldn't be called more than once";
  13077. f.called = false;
  13078. return f;
  13079. }
  13080. }
  13081. });
  13082. var require_inflight = __commonJS2({
  13083. "node_modules/inflight/inflight.js"(exports2, module2) {
  13084. var wrappy = require_wrappy();
  13085. var reqs = /* @__PURE__ */ Object.create(null);
  13086. var once = require_once();
  13087. module2.exports = wrappy(inflight);
  13088. function inflight(key, cb) {
  13089. if (reqs[key]) {
  13090. reqs[key].push(cb);
  13091. return null;
  13092. } else {
  13093. reqs[key] = [cb];
  13094. return makeres(key);
  13095. }
  13096. }
  13097. function makeres(key) {
  13098. return once(function RES() {
  13099. var cbs = reqs[key];
  13100. var len = cbs.length;
  13101. var args = slice(arguments);
  13102. try {
  13103. for (var i = 0; i < len; i++) {
  13104. cbs[i].apply(null, args);
  13105. }
  13106. } finally {
  13107. if (cbs.length > len) {
  13108. cbs.splice(0, len);
  13109. process.nextTick(function() {
  13110. RES.apply(null, args);
  13111. });
  13112. } else {
  13113. delete reqs[key];
  13114. }
  13115. }
  13116. });
  13117. }
  13118. function slice(args) {
  13119. var length = args.length;
  13120. var array2 = [];
  13121. for (var i = 0; i < length; i++)
  13122. array2[i] = args[i];
  13123. return array2;
  13124. }
  13125. }
  13126. });
  13127. var require_glob = __commonJS2({
  13128. "node_modules/glob/glob.js"(exports2, module2) {
  13129. module2.exports = glob;
  13130. var rp = require_fs5();
  13131. var minimatch = require_minimatch();
  13132. var Minimatch = minimatch.Minimatch;
  13133. var inherits = require_inherits();
  13134. var EE = require("events").EventEmitter;
  13135. var path = require("path");
  13136. var assert = require("assert");
  13137. var isAbsolute = require_path_is_absolute();
  13138. var globSync = require_sync7();
  13139. var common = require_common3();
  13140. var setopts = common.setopts;
  13141. var ownProp = common.ownProp;
  13142. var inflight = require_inflight();
  13143. var util = require("util");
  13144. var childrenIgnored = common.childrenIgnored;
  13145. var isIgnored = common.isIgnored;
  13146. var once = require_once();
  13147. function glob(pattern, options, cb) {
  13148. if (typeof options === "function")
  13149. cb = options, options = {};
  13150. if (!options)
  13151. options = {};
  13152. if (options.sync) {
  13153. if (cb)
  13154. throw new TypeError("callback provided to sync glob");
  13155. return globSync(pattern, options);
  13156. }
  13157. return new Glob(pattern, options, cb);
  13158. }
  13159. glob.sync = globSync;
  13160. var GlobSync = glob.GlobSync = globSync.GlobSync;
  13161. glob.glob = glob;
  13162. function extend(origin, add) {
  13163. if (add === null || typeof add !== "object") {
  13164. return origin;
  13165. }
  13166. var keys = Object.keys(add);
  13167. var i = keys.length;
  13168. while (i--) {
  13169. origin[keys[i]] = add[keys[i]];
  13170. }
  13171. return origin;
  13172. }
  13173. glob.hasMagic = function(pattern, options_) {
  13174. var options = extend({}, options_);
  13175. options.noprocess = true;
  13176. var g = new Glob(pattern, options);
  13177. var set = g.minimatch.set;
  13178. if (!pattern)
  13179. return false;
  13180. if (set.length > 1)
  13181. return true;
  13182. for (var j = 0; j < set[0].length; j++) {
  13183. if (typeof set[0][j] !== "string")
  13184. return true;
  13185. }
  13186. return false;
  13187. };
  13188. glob.Glob = Glob;
  13189. inherits(Glob, EE);
  13190. function Glob(pattern, options, cb) {
  13191. if (typeof options === "function") {
  13192. cb = options;
  13193. options = null;
  13194. }
  13195. if (options && options.sync) {
  13196. if (cb)
  13197. throw new TypeError("callback provided to sync glob");
  13198. return new GlobSync(pattern, options);
  13199. }
  13200. if (!(this instanceof Glob))
  13201. return new Glob(pattern, options, cb);
  13202. setopts(this, pattern, options);
  13203. this._didRealPath = false;
  13204. var n = this.minimatch.set.length;
  13205. this.matches = new Array(n);
  13206. if (typeof cb === "function") {
  13207. cb = once(cb);
  13208. this.on("error", cb);
  13209. this.on("end", function(matches) {
  13210. cb(null, matches);
  13211. });
  13212. }
  13213. var self2 = this;
  13214. this._processing = 0;
  13215. this._emitQueue = [];
  13216. this._processQueue = [];
  13217. this.paused = false;
  13218. if (this.noprocess)
  13219. return this;
  13220. if (n === 0)
  13221. return done();
  13222. var sync = true;
  13223. for (var i = 0; i < n; i++) {
  13224. this._process(this.minimatch.set[i], i, false, done);
  13225. }
  13226. sync = false;
  13227. function done() {
  13228. --self2._processing;
  13229. if (self2._processing <= 0) {
  13230. if (sync) {
  13231. process.nextTick(function() {
  13232. self2._finish();
  13233. });
  13234. } else {
  13235. self2._finish();
  13236. }
  13237. }
  13238. }
  13239. }
  13240. Glob.prototype._finish = function() {
  13241. assert(this instanceof Glob);
  13242. if (this.aborted)
  13243. return;
  13244. if (this.realpath && !this._didRealpath)
  13245. return this._realpath();
  13246. common.finish(this);
  13247. this.emit("end", this.found);
  13248. };
  13249. Glob.prototype._realpath = function() {
  13250. if (this._didRealpath)
  13251. return;
  13252. this._didRealpath = true;
  13253. var n = this.matches.length;
  13254. if (n === 0)
  13255. return this._finish();
  13256. var self2 = this;
  13257. for (var i = 0; i < this.matches.length; i++)
  13258. this._realpathSet(i, next);
  13259. function next() {
  13260. if (--n === 0)
  13261. self2._finish();
  13262. }
  13263. };
  13264. Glob.prototype._realpathSet = function(index, cb) {
  13265. var matchset = this.matches[index];
  13266. if (!matchset)
  13267. return cb();
  13268. var found = Object.keys(matchset);
  13269. var self2 = this;
  13270. var n = found.length;
  13271. if (n === 0)
  13272. return cb();
  13273. var set = this.matches[index] = /* @__PURE__ */ Object.create(null);
  13274. found.forEach(function(p, i) {
  13275. p = self2._makeAbs(p);
  13276. rp.realpath(p, self2.realpathCache, function(er, real) {
  13277. if (!er)
  13278. set[real] = true;
  13279. else if (er.syscall === "stat")
  13280. set[p] = true;
  13281. else
  13282. self2.emit("error", er);
  13283. if (--n === 0) {
  13284. self2.matches[index] = set;
  13285. cb();
  13286. }
  13287. });
  13288. });
  13289. };
  13290. Glob.prototype._mark = function(p) {
  13291. return common.mark(this, p);
  13292. };
  13293. Glob.prototype._makeAbs = function(f) {
  13294. return common.makeAbs(this, f);
  13295. };
  13296. Glob.prototype.abort = function() {
  13297. this.aborted = true;
  13298. this.emit("abort");
  13299. };
  13300. Glob.prototype.pause = function() {
  13301. if (!this.paused) {
  13302. this.paused = true;
  13303. this.emit("pause");
  13304. }
  13305. };
  13306. Glob.prototype.resume = function() {
  13307. if (this.paused) {
  13308. this.emit("resume");
  13309. this.paused = false;
  13310. if (this._emitQueue.length) {
  13311. var eq = this._emitQueue.slice(0);
  13312. this._emitQueue.length = 0;
  13313. for (var i = 0; i < eq.length; i++) {
  13314. var e = eq[i];
  13315. this._emitMatch(e[0], e[1]);
  13316. }
  13317. }
  13318. if (this._processQueue.length) {
  13319. var pq = this._processQueue.slice(0);
  13320. this._processQueue.length = 0;
  13321. for (var i = 0; i < pq.length; i++) {
  13322. var p = pq[i];
  13323. this._processing--;
  13324. this._process(p[0], p[1], p[2], p[3]);
  13325. }
  13326. }
  13327. }
  13328. };
  13329. Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
  13330. assert(this instanceof Glob);
  13331. assert(typeof cb === "function");
  13332. if (this.aborted)
  13333. return;
  13334. this._processing++;
  13335. if (this.paused) {
  13336. this._processQueue.push([pattern, index, inGlobStar, cb]);
  13337. return;
  13338. }
  13339. var n = 0;
  13340. while (typeof pattern[n] === "string") {
  13341. n++;
  13342. }
  13343. var prefix;
  13344. switch (n) {
  13345. case pattern.length:
  13346. this._processSimple(pattern.join("/"), index, cb);
  13347. return;
  13348. case 0:
  13349. prefix = null;
  13350. break;
  13351. default:
  13352. prefix = pattern.slice(0, n).join("/");
  13353. break;
  13354. }
  13355. var remain = pattern.slice(n);
  13356. var read;
  13357. if (prefix === null)
  13358. read = ".";
  13359. else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
  13360. return typeof p === "string" ? p : "[*]";
  13361. }).join("/"))) {
  13362. if (!prefix || !isAbsolute(prefix))
  13363. prefix = "/" + prefix;
  13364. read = prefix;
  13365. } else
  13366. read = prefix;
  13367. var abs = this._makeAbs(read);
  13368. if (childrenIgnored(this, read))
  13369. return cb();
  13370. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  13371. if (isGlobStar)
  13372. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
  13373. else
  13374. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
  13375. };
  13376. Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13377. var self2 = this;
  13378. this._readdir(abs, inGlobStar, function(er, entries) {
  13379. return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13380. });
  13381. };
  13382. Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13383. if (!entries)
  13384. return cb();
  13385. var pn = remain[0];
  13386. var negate = !!this.minimatch.negate;
  13387. var rawGlob = pn._glob;
  13388. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  13389. var matchedEntries = [];
  13390. for (var i = 0; i < entries.length; i++) {
  13391. var e = entries[i];
  13392. if (e.charAt(0) !== "." || dotOk) {
  13393. var m;
  13394. if (negate && !prefix) {
  13395. m = !e.match(pn);
  13396. } else {
  13397. m = e.match(pn);
  13398. }
  13399. if (m)
  13400. matchedEntries.push(e);
  13401. }
  13402. }
  13403. var len = matchedEntries.length;
  13404. if (len === 0)
  13405. return cb();
  13406. if (remain.length === 1 && !this.mark && !this.stat) {
  13407. if (!this.matches[index])
  13408. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13409. for (var i = 0; i < len; i++) {
  13410. var e = matchedEntries[i];
  13411. if (prefix) {
  13412. if (prefix !== "/")
  13413. e = prefix + "/" + e;
  13414. else
  13415. e = prefix + e;
  13416. }
  13417. if (e.charAt(0) === "/" && !this.nomount) {
  13418. e = path.join(this.root, e);
  13419. }
  13420. this._emitMatch(index, e);
  13421. }
  13422. return cb();
  13423. }
  13424. remain.shift();
  13425. for (var i = 0; i < len; i++) {
  13426. var e = matchedEntries[i];
  13427. var newPattern;
  13428. if (prefix) {
  13429. if (prefix !== "/")
  13430. e = prefix + "/" + e;
  13431. else
  13432. e = prefix + e;
  13433. }
  13434. this._process([e].concat(remain), index, inGlobStar, cb);
  13435. }
  13436. cb();
  13437. };
  13438. Glob.prototype._emitMatch = function(index, e) {
  13439. if (this.aborted)
  13440. return;
  13441. if (isIgnored(this, e))
  13442. return;
  13443. if (this.paused) {
  13444. this._emitQueue.push([index, e]);
  13445. return;
  13446. }
  13447. var abs = isAbsolute(e) ? e : this._makeAbs(e);
  13448. if (this.mark)
  13449. e = this._mark(e);
  13450. if (this.absolute)
  13451. e = abs;
  13452. if (this.matches[index][e])
  13453. return;
  13454. if (this.nodir) {
  13455. var c = this.cache[abs];
  13456. if (c === "DIR" || Array.isArray(c))
  13457. return;
  13458. }
  13459. this.matches[index][e] = true;
  13460. var st = this.statCache[abs];
  13461. if (st)
  13462. this.emit("stat", e, st);
  13463. this.emit("match", e);
  13464. };
  13465. Glob.prototype._readdirInGlobStar = function(abs, cb) {
  13466. if (this.aborted)
  13467. return;
  13468. if (this.follow)
  13469. return this._readdir(abs, false, cb);
  13470. var lstatkey = "lstat\0" + abs;
  13471. var self2 = this;
  13472. var lstatcb = inflight(lstatkey, lstatcb_);
  13473. if (lstatcb)
  13474. self2.fs.lstat(abs, lstatcb);
  13475. function lstatcb_(er, lstat) {
  13476. if (er && er.code === "ENOENT")
  13477. return cb();
  13478. var isSym = lstat && lstat.isSymbolicLink();
  13479. self2.symlinks[abs] = isSym;
  13480. if (!isSym && lstat && !lstat.isDirectory()) {
  13481. self2.cache[abs] = "FILE";
  13482. cb();
  13483. } else
  13484. self2._readdir(abs, false, cb);
  13485. }
  13486. };
  13487. Glob.prototype._readdir = function(abs, inGlobStar, cb) {
  13488. if (this.aborted)
  13489. return;
  13490. cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
  13491. if (!cb)
  13492. return;
  13493. if (inGlobStar && !ownProp(this.symlinks, abs))
  13494. return this._readdirInGlobStar(abs, cb);
  13495. if (ownProp(this.cache, abs)) {
  13496. var c = this.cache[abs];
  13497. if (!c || c === "FILE")
  13498. return cb();
  13499. if (Array.isArray(c))
  13500. return cb(null, c);
  13501. }
  13502. var self2 = this;
  13503. self2.fs.readdir(abs, readdirCb(this, abs, cb));
  13504. };
  13505. function readdirCb(self2, abs, cb) {
  13506. return function(er, entries) {
  13507. if (er)
  13508. self2._readdirError(abs, er, cb);
  13509. else
  13510. self2._readdirEntries(abs, entries, cb);
  13511. };
  13512. }
  13513. Glob.prototype._readdirEntries = function(abs, entries, cb) {
  13514. if (this.aborted)
  13515. return;
  13516. if (!this.mark && !this.stat) {
  13517. for (var i = 0; i < entries.length; i++) {
  13518. var e = entries[i];
  13519. if (abs === "/")
  13520. e = abs + e;
  13521. else
  13522. e = abs + "/" + e;
  13523. this.cache[e] = true;
  13524. }
  13525. }
  13526. this.cache[abs] = entries;
  13527. return cb(null, entries);
  13528. };
  13529. Glob.prototype._readdirError = function(f, er, cb) {
  13530. if (this.aborted)
  13531. return;
  13532. switch (er.code) {
  13533. case "ENOTSUP":
  13534. case "ENOTDIR":
  13535. var abs = this._makeAbs(f);
  13536. this.cache[abs] = "FILE";
  13537. if (abs === this.cwdAbs) {
  13538. var error = new Error(er.code + " invalid cwd " + this.cwd);
  13539. error.path = this.cwd;
  13540. error.code = er.code;
  13541. this.emit("error", error);
  13542. this.abort();
  13543. }
  13544. break;
  13545. case "ENOENT":
  13546. case "ELOOP":
  13547. case "ENAMETOOLONG":
  13548. case "UNKNOWN":
  13549. this.cache[this._makeAbs(f)] = false;
  13550. break;
  13551. default:
  13552. this.cache[this._makeAbs(f)] = false;
  13553. if (this.strict) {
  13554. this.emit("error", er);
  13555. this.abort();
  13556. }
  13557. if (!this.silent)
  13558. console.error("glob error", er);
  13559. break;
  13560. }
  13561. return cb();
  13562. };
  13563. Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13564. var self2 = this;
  13565. this._readdir(abs, inGlobStar, function(er, entries) {
  13566. self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13567. });
  13568. };
  13569. Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13570. if (!entries)
  13571. return cb();
  13572. var remainWithoutGlobStar = remain.slice(1);
  13573. var gspref = prefix ? [prefix] : [];
  13574. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  13575. this._process(noGlobStar, index, false, cb);
  13576. var isSym = this.symlinks[abs];
  13577. var len = entries.length;
  13578. if (isSym && inGlobStar)
  13579. return cb();
  13580. for (var i = 0; i < len; i++) {
  13581. var e = entries[i];
  13582. if (e.charAt(0) === "." && !this.dot)
  13583. continue;
  13584. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  13585. this._process(instead, index, true, cb);
  13586. var below = gspref.concat(entries[i], remain);
  13587. this._process(below, index, true, cb);
  13588. }
  13589. cb();
  13590. };
  13591. Glob.prototype._processSimple = function(prefix, index, cb) {
  13592. var self2 = this;
  13593. this._stat(prefix, function(er, exists) {
  13594. self2._processSimple2(prefix, index, er, exists, cb);
  13595. });
  13596. };
  13597. Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
  13598. if (!this.matches[index])
  13599. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13600. if (!exists)
  13601. return cb();
  13602. if (prefix && isAbsolute(prefix) && !this.nomount) {
  13603. var trail = /[\/\\]$/.test(prefix);
  13604. if (prefix.charAt(0) === "/") {
  13605. prefix = path.join(this.root, prefix);
  13606. } else {
  13607. prefix = path.resolve(this.root, prefix);
  13608. if (trail)
  13609. prefix += "/";
  13610. }
  13611. }
  13612. if (process.platform === "win32")
  13613. prefix = prefix.replace(/\\/g, "/");
  13614. this._emitMatch(index, prefix);
  13615. cb();
  13616. };
  13617. Glob.prototype._stat = function(f, cb) {
  13618. var abs = this._makeAbs(f);
  13619. var needDir = f.slice(-1) === "/";
  13620. if (f.length > this.maxLength)
  13621. return cb();
  13622. if (!this.stat && ownProp(this.cache, abs)) {
  13623. var c = this.cache[abs];
  13624. if (Array.isArray(c))
  13625. c = "DIR";
  13626. if (!needDir || c === "DIR")
  13627. return cb(null, c);
  13628. if (needDir && c === "FILE")
  13629. return cb();
  13630. }
  13631. var exists;
  13632. var stat = this.statCache[abs];
  13633. if (stat !== void 0) {
  13634. if (stat === false)
  13635. return cb(null, stat);
  13636. else {
  13637. var type = stat.isDirectory() ? "DIR" : "FILE";
  13638. if (needDir && type === "FILE")
  13639. return cb();
  13640. else
  13641. return cb(null, type, stat);
  13642. }
  13643. }
  13644. var self2 = this;
  13645. var statcb = inflight("stat\0" + abs, lstatcb_);
  13646. if (statcb)
  13647. self2.fs.lstat(abs, statcb);
  13648. function lstatcb_(er, lstat) {
  13649. if (lstat && lstat.isSymbolicLink()) {
  13650. return self2.fs.stat(abs, function(er2, stat2) {
  13651. if (er2)
  13652. self2._stat2(f, abs, null, lstat, cb);
  13653. else
  13654. self2._stat2(f, abs, er2, stat2, cb);
  13655. });
  13656. } else {
  13657. self2._stat2(f, abs, er, lstat, cb);
  13658. }
  13659. }
  13660. };
  13661. Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
  13662. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  13663. this.statCache[abs] = false;
  13664. return cb();
  13665. }
  13666. var needDir = f.slice(-1) === "/";
  13667. this.statCache[abs] = stat;
  13668. if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
  13669. return cb(null, false, stat);
  13670. var c = true;
  13671. if (stat)
  13672. c = stat.isDirectory() ? "DIR" : "FILE";
  13673. this.cache[abs] = this.cache[abs] || c;
  13674. if (needDir && c === "FILE")
  13675. return cb();
  13676. return cb(null, c, stat);
  13677. };
  13678. }
  13679. });
  13680. var require_rimraf = __commonJS2({
  13681. "node_modules/rimraf/rimraf.js"(exports2, module2) {
  13682. var assert = require("assert");
  13683. var path = require("path");
  13684. var fs = require("fs");
  13685. var glob = void 0;
  13686. try {
  13687. glob = require_glob();
  13688. } catch (_err) {
  13689. }
  13690. var defaultGlobOpts = {
  13691. nosort: true,
  13692. silent: true
  13693. };
  13694. var timeout = 0;
  13695. var isWindows = process.platform === "win32";
  13696. var defaults = (options) => {
  13697. const methods = ["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"];
  13698. methods.forEach((m) => {
  13699. options[m] = options[m] || fs[m];
  13700. m = m + "Sync";
  13701. options[m] = options[m] || fs[m];
  13702. });
  13703. options.maxBusyTries = options.maxBusyTries || 3;
  13704. options.emfileWait = options.emfileWait || 1e3;
  13705. if (options.glob === false) {
  13706. options.disableGlob = true;
  13707. }
  13708. if (options.disableGlob !== true && glob === void 0) {
  13709. throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
  13710. }
  13711. options.disableGlob = options.disableGlob || false;
  13712. options.glob = options.glob || defaultGlobOpts;
  13713. };
  13714. var rimraf = (p, options, cb) => {
  13715. if (typeof options === "function") {
  13716. cb = options;
  13717. options = {};
  13718. }
  13719. assert(p, "rimraf: missing path");
  13720. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13721. assert.equal(typeof cb, "function", "rimraf: callback function required");
  13722. assert(options, "rimraf: invalid options argument provided");
  13723. assert.equal(typeof options, "object", "rimraf: options should be object");
  13724. defaults(options);
  13725. let busyTries = 0;
  13726. let errState = null;
  13727. let n = 0;
  13728. const next = (er) => {
  13729. errState = errState || er;
  13730. if (--n === 0)
  13731. cb(errState);
  13732. };
  13733. const afterGlob = (er, results) => {
  13734. if (er)
  13735. return cb(er);
  13736. n = results.length;
  13737. if (n === 0)
  13738. return cb();
  13739. results.forEach((p2) => {
  13740. const CB = (er2) => {
  13741. if (er2) {
  13742. if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
  13743. busyTries++;
  13744. return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
  13745. }
  13746. if (er2.code === "EMFILE" && timeout < options.emfileWait) {
  13747. return setTimeout(() => rimraf_(p2, options, CB), timeout++);
  13748. }
  13749. if (er2.code === "ENOENT")
  13750. er2 = null;
  13751. }
  13752. timeout = 0;
  13753. next(er2);
  13754. };
  13755. rimraf_(p2, options, CB);
  13756. });
  13757. };
  13758. if (options.disableGlob || !glob.hasMagic(p))
  13759. return afterGlob(null, [p]);
  13760. options.lstat(p, (er, stat) => {
  13761. if (!er)
  13762. return afterGlob(null, [p]);
  13763. glob(p, options.glob, afterGlob);
  13764. });
  13765. };
  13766. var rimraf_ = (p, options, cb) => {
  13767. assert(p);
  13768. assert(options);
  13769. assert(typeof cb === "function");
  13770. options.lstat(p, (er, st) => {
  13771. if (er && er.code === "ENOENT")
  13772. return cb(null);
  13773. if (er && er.code === "EPERM" && isWindows)
  13774. fixWinEPERM(p, options, er, cb);
  13775. if (st && st.isDirectory())
  13776. return rmdir(p, options, er, cb);
  13777. options.unlink(p, (er2) => {
  13778. if (er2) {
  13779. if (er2.code === "ENOENT")
  13780. return cb(null);
  13781. if (er2.code === "EPERM")
  13782. return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
  13783. if (er2.code === "EISDIR")
  13784. return rmdir(p, options, er2, cb);
  13785. }
  13786. return cb(er2);
  13787. });
  13788. });
  13789. };
  13790. var fixWinEPERM = (p, options, er, cb) => {
  13791. assert(p);
  13792. assert(options);
  13793. assert(typeof cb === "function");
  13794. options.chmod(p, 438, (er2) => {
  13795. if (er2)
  13796. cb(er2.code === "ENOENT" ? null : er);
  13797. else
  13798. options.stat(p, (er3, stats) => {
  13799. if (er3)
  13800. cb(er3.code === "ENOENT" ? null : er);
  13801. else if (stats.isDirectory())
  13802. rmdir(p, options, er, cb);
  13803. else
  13804. options.unlink(p, cb);
  13805. });
  13806. });
  13807. };
  13808. var fixWinEPERMSync = (p, options, er) => {
  13809. assert(p);
  13810. assert(options);
  13811. try {
  13812. options.chmodSync(p, 438);
  13813. } catch (er2) {
  13814. if (er2.code === "ENOENT")
  13815. return;
  13816. else
  13817. throw er;
  13818. }
  13819. let stats;
  13820. try {
  13821. stats = options.statSync(p);
  13822. } catch (er3) {
  13823. if (er3.code === "ENOENT")
  13824. return;
  13825. else
  13826. throw er;
  13827. }
  13828. if (stats.isDirectory())
  13829. rmdirSync(p, options, er);
  13830. else
  13831. options.unlinkSync(p);
  13832. };
  13833. var rmdir = (p, options, originalEr, cb) => {
  13834. assert(p);
  13835. assert(options);
  13836. assert(typeof cb === "function");
  13837. options.rmdir(p, (er) => {
  13838. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  13839. rmkids(p, options, cb);
  13840. else if (er && er.code === "ENOTDIR")
  13841. cb(originalEr);
  13842. else
  13843. cb(er);
  13844. });
  13845. };
  13846. var rmkids = (p, options, cb) => {
  13847. assert(p);
  13848. assert(options);
  13849. assert(typeof cb === "function");
  13850. options.readdir(p, (er, files) => {
  13851. if (er)
  13852. return cb(er);
  13853. let n = files.length;
  13854. if (n === 0)
  13855. return options.rmdir(p, cb);
  13856. let errState;
  13857. files.forEach((f) => {
  13858. rimraf(path.join(p, f), options, (er2) => {
  13859. if (errState)
  13860. return;
  13861. if (er2)
  13862. return cb(errState = er2);
  13863. if (--n === 0)
  13864. options.rmdir(p, cb);
  13865. });
  13866. });
  13867. });
  13868. };
  13869. var rimrafSync = (p, options) => {
  13870. options = options || {};
  13871. defaults(options);
  13872. assert(p, "rimraf: missing path");
  13873. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13874. assert(options, "rimraf: missing options");
  13875. assert.equal(typeof options, "object", "rimraf: options should be object");
  13876. let results;
  13877. if (options.disableGlob || !glob.hasMagic(p)) {
  13878. results = [p];
  13879. } else {
  13880. try {
  13881. options.lstatSync(p);
  13882. results = [p];
  13883. } catch (er) {
  13884. results = glob.sync(p, options.glob);
  13885. }
  13886. }
  13887. if (!results.length)
  13888. return;
  13889. for (let i = 0; i < results.length; i++) {
  13890. const p2 = results[i];
  13891. let st;
  13892. try {
  13893. st = options.lstatSync(p2);
  13894. } catch (er) {
  13895. if (er.code === "ENOENT")
  13896. return;
  13897. if (er.code === "EPERM" && isWindows)
  13898. fixWinEPERMSync(p2, options, er);
  13899. }
  13900. try {
  13901. if (st && st.isDirectory())
  13902. rmdirSync(p2, options, null);
  13903. else
  13904. options.unlinkSync(p2);
  13905. } catch (er) {
  13906. if (er.code === "ENOENT")
  13907. return;
  13908. if (er.code === "EPERM")
  13909. return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
  13910. if (er.code !== "EISDIR")
  13911. throw er;
  13912. rmdirSync(p2, options, er);
  13913. }
  13914. }
  13915. };
  13916. var rmdirSync = (p, options, originalEr) => {
  13917. assert(p);
  13918. assert(options);
  13919. try {
  13920. options.rmdirSync(p);
  13921. } catch (er) {
  13922. if (er.code === "ENOENT")
  13923. return;
  13924. if (er.code === "ENOTDIR")
  13925. throw originalEr;
  13926. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  13927. rmkidsSync(p, options);
  13928. }
  13929. };
  13930. var rmkidsSync = (p, options) => {
  13931. assert(p);
  13932. assert(options);
  13933. options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
  13934. const retries = isWindows ? 100 : 1;
  13935. let i = 0;
  13936. do {
  13937. let threw = true;
  13938. try {
  13939. const ret = options.rmdirSync(p, options);
  13940. threw = false;
  13941. return ret;
  13942. } finally {
  13943. if (++i < retries && threw)
  13944. continue;
  13945. }
  13946. } while (true);
  13947. };
  13948. module2.exports = rimraf;
  13949. rimraf.sync = rimrafSync;
  13950. }
  13951. });
  13952. var require_del = __commonJS2({
  13953. "node_modules/flat-cache/src/del.js"(exports2, module2) {
  13954. var rimraf = require_rimraf().sync;
  13955. var fs = require("fs");
  13956. module2.exports = function del(file) {
  13957. if (fs.existsSync(file)) {
  13958. rimraf(file, {
  13959. glob: false
  13960. });
  13961. return true;
  13962. }
  13963. return false;
  13964. };
  13965. }
  13966. });
  13967. var require_cache = __commonJS2({
  13968. "node_modules/flat-cache/src/cache.js"(exports2, module2) {
  13969. var path = require("path");
  13970. var fs = require("fs");
  13971. var utils = require_utils6();
  13972. var del = require_del();
  13973. var writeJSON = utils.writeJSON;
  13974. var cache = {
  13975. load: function(docId, cacheDir) {
  13976. var me = this;
  13977. me._visited = {};
  13978. me._persisted = {};
  13979. me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  13980. if (fs.existsSync(me._pathToFile)) {
  13981. me._persisted = utils.tryParse(me._pathToFile, {});
  13982. }
  13983. },
  13984. loadFile: function(pathToFile) {
  13985. var me = this;
  13986. var dir = path.dirname(pathToFile);
  13987. var fName = path.basename(pathToFile);
  13988. me.load(fName, dir);
  13989. },
  13990. all: function() {
  13991. return this._persisted;
  13992. },
  13993. keys: function() {
  13994. return Object.keys(this._persisted);
  13995. },
  13996. setKey: function(key, value) {
  13997. this._visited[key] = true;
  13998. this._persisted[key] = value;
  13999. },
  14000. removeKey: function(key) {
  14001. delete this._visited[key];
  14002. delete this._persisted[key];
  14003. },
  14004. getKey: function(key) {
  14005. this._visited[key] = true;
  14006. return this._persisted[key];
  14007. },
  14008. _prune: function() {
  14009. var me = this;
  14010. var obj = {};
  14011. var keys = Object.keys(me._visited);
  14012. if (keys.length === 0) {
  14013. return;
  14014. }
  14015. keys.forEach(function(key) {
  14016. obj[key] = me._persisted[key];
  14017. });
  14018. me._visited = {};
  14019. me._persisted = obj;
  14020. },
  14021. save: function(noPrune) {
  14022. var me = this;
  14023. !noPrune && me._prune();
  14024. writeJSON(me._pathToFile, me._persisted);
  14025. },
  14026. removeCacheFile: function() {
  14027. return del(this._pathToFile);
  14028. },
  14029. destroy: function() {
  14030. var me = this;
  14031. me._visited = {};
  14032. me._persisted = {};
  14033. me.removeCacheFile();
  14034. }
  14035. };
  14036. module2.exports = {
  14037. load: function(docId, cacheDir) {
  14038. return this.create(docId, cacheDir);
  14039. },
  14040. create: function(docId, cacheDir) {
  14041. var obj = Object.create(cache);
  14042. obj.load(docId, cacheDir);
  14043. return obj;
  14044. },
  14045. createFromFile: function(filePath) {
  14046. var obj = Object.create(cache);
  14047. obj.loadFile(filePath);
  14048. return obj;
  14049. },
  14050. clearCacheById: function(docId, cacheDir) {
  14051. var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  14052. return del(filePath);
  14053. },
  14054. clearAll: function(cacheDir) {
  14055. var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, "../.cache/");
  14056. return del(filePath);
  14057. }
  14058. };
  14059. }
  14060. });
  14061. var require_cache2 = __commonJS2({
  14062. "node_modules/file-entry-cache/cache.js"(exports2, module2) {
  14063. var path = require("path");
  14064. var crypto = require("crypto");
  14065. module2.exports = {
  14066. createFromFile: function(filePath, useChecksum) {
  14067. var fname = path.basename(filePath);
  14068. var dir = path.dirname(filePath);
  14069. return this.create(fname, dir, useChecksum);
  14070. },
  14071. create: function(cacheId, _path, useChecksum) {
  14072. var fs = require("fs");
  14073. var flatCache = require_cache();
  14074. var cache = flatCache.load(cacheId, _path);
  14075. var normalizedEntries = {};
  14076. var removeNotFoundFiles = function removeNotFoundFiles2() {
  14077. const cachedEntries = cache.keys();
  14078. cachedEntries.forEach(function remover(fPath) {
  14079. try {
  14080. fs.statSync(fPath);
  14081. } catch (err) {
  14082. if (err.code === "ENOENT") {
  14083. cache.removeKey(fPath);
  14084. }
  14085. }
  14086. });
  14087. };
  14088. removeNotFoundFiles();
  14089. return {
  14090. cache,
  14091. getHash: function(buffer) {
  14092. return crypto.createHash("md5").update(buffer).digest("hex");
  14093. },
  14094. hasFileChanged: function(file) {
  14095. return this.getFileDescriptor(file).changed;
  14096. },
  14097. analyzeFiles: function(files) {
  14098. var me = this;
  14099. files = files || [];
  14100. var res = {
  14101. changedFiles: [],
  14102. notFoundFiles: [],
  14103. notChangedFiles: []
  14104. };
  14105. me.normalizeEntries(files).forEach(function(entry) {
  14106. if (entry.changed) {
  14107. res.changedFiles.push(entry.key);
  14108. return;
  14109. }
  14110. if (entry.notFound) {
  14111. res.notFoundFiles.push(entry.key);
  14112. return;
  14113. }
  14114. res.notChangedFiles.push(entry.key);
  14115. });
  14116. return res;
  14117. },
  14118. getFileDescriptor: function(file) {
  14119. var fstat;
  14120. try {
  14121. fstat = fs.statSync(file);
  14122. } catch (ex) {
  14123. this.removeEntry(file);
  14124. return {
  14125. key: file,
  14126. notFound: true,
  14127. err: ex
  14128. };
  14129. }
  14130. if (useChecksum) {
  14131. return this._getFileDescriptorUsingChecksum(file);
  14132. }
  14133. return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
  14134. },
  14135. _getFileDescriptorUsingMtimeAndSize: function(file, fstat) {
  14136. var meta = cache.getKey(file);
  14137. var cacheExists = !!meta;
  14138. var cSize = fstat.size;
  14139. var cTime = fstat.mtime.getTime();
  14140. var isDifferentDate;
  14141. var isDifferentSize;
  14142. if (!meta) {
  14143. meta = {
  14144. size: cSize,
  14145. mtime: cTime
  14146. };
  14147. } else {
  14148. isDifferentDate = cTime !== meta.mtime;
  14149. isDifferentSize = cSize !== meta.size;
  14150. }
  14151. var nEntry = normalizedEntries[file] = {
  14152. key: file,
  14153. changed: !cacheExists || isDifferentDate || isDifferentSize,
  14154. meta
  14155. };
  14156. return nEntry;
  14157. },
  14158. _getFileDescriptorUsingChecksum: function(file) {
  14159. var meta = cache.getKey(file);
  14160. var cacheExists = !!meta;
  14161. var contentBuffer;
  14162. try {
  14163. contentBuffer = fs.readFileSync(file);
  14164. } catch (ex) {
  14165. contentBuffer = "";
  14166. }
  14167. var isDifferent = true;
  14168. var hash = this.getHash(contentBuffer);
  14169. if (!meta) {
  14170. meta = {
  14171. hash
  14172. };
  14173. } else {
  14174. isDifferent = hash !== meta.hash;
  14175. }
  14176. var nEntry = normalizedEntries[file] = {
  14177. key: file,
  14178. changed: !cacheExists || isDifferent,
  14179. meta
  14180. };
  14181. return nEntry;
  14182. },
  14183. getUpdatedFiles: function(files) {
  14184. var me = this;
  14185. files = files || [];
  14186. return me.normalizeEntries(files).filter(function(entry) {
  14187. return entry.changed;
  14188. }).map(function(entry) {
  14189. return entry.key;
  14190. });
  14191. },
  14192. normalizeEntries: function(files) {
  14193. files = files || [];
  14194. var me = this;
  14195. var nEntries = files.map(function(file) {
  14196. return me.getFileDescriptor(file);
  14197. });
  14198. return nEntries;
  14199. },
  14200. removeEntry: function(entryName) {
  14201. delete normalizedEntries[entryName];
  14202. cache.removeKey(entryName);
  14203. },
  14204. deleteCacheFile: function() {
  14205. cache.removeCacheFile();
  14206. },
  14207. destroy: function() {
  14208. normalizedEntries = {};
  14209. cache.destroy();
  14210. },
  14211. _getMetaForFileUsingCheckSum: function(cacheEntry) {
  14212. var contentBuffer = fs.readFileSync(cacheEntry.key);
  14213. var hash = this.getHash(contentBuffer);
  14214. var meta = Object.assign(cacheEntry.meta, {
  14215. hash
  14216. });
  14217. delete meta.size;
  14218. delete meta.mtime;
  14219. return meta;
  14220. },
  14221. _getMetaForFileUsingMtimeAndSize: function(cacheEntry) {
  14222. var stat = fs.statSync(cacheEntry.key);
  14223. var meta = Object.assign(cacheEntry.meta, {
  14224. size: stat.size,
  14225. mtime: stat.mtime.getTime()
  14226. });
  14227. delete meta.hash;
  14228. return meta;
  14229. },
  14230. reconcile: function(noPrune) {
  14231. removeNotFoundFiles();
  14232. noPrune = typeof noPrune === "undefined" ? true : noPrune;
  14233. var entries = normalizedEntries;
  14234. var keys = Object.keys(entries);
  14235. if (keys.length === 0) {
  14236. return;
  14237. }
  14238. var me = this;
  14239. keys.forEach(function(entryName) {
  14240. var cacheEntry = entries[entryName];
  14241. try {
  14242. var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
  14243. cache.setKey(entryName, meta);
  14244. } catch (err) {
  14245. if (err.code !== "ENOENT") {
  14246. throw err;
  14247. }
  14248. }
  14249. });
  14250. cache.save(noPrune);
  14251. }
  14252. };
  14253. }
  14254. };
  14255. }
  14256. });
  14257. var require_format_results_cache = __commonJS2({
  14258. "src/cli/format-results-cache.js"(exports2, module2) {
  14259. "use strict";
  14260. var fileEntryCache = require_cache2();
  14261. var stringify2 = require_fast_json_stable_stringify();
  14262. var {
  14263. version: prettierVersion
  14264. } = require("./index.js");
  14265. var {
  14266. createHash
  14267. } = require_utils();
  14268. var optionsHashCache = /* @__PURE__ */ new WeakMap();
  14269. var nodeVersion = process && process.version;
  14270. function getHashOfOptions(options) {
  14271. if (optionsHashCache.has(options)) {
  14272. return optionsHashCache.get(options);
  14273. }
  14274. const hash = createHash(`${prettierVersion}_${nodeVersion}_${stringify2(options)}`);
  14275. optionsHashCache.set(options, hash);
  14276. return hash;
  14277. }
  14278. function getMetadataFromFileDescriptor(fileDescriptor) {
  14279. return fileDescriptor.meta;
  14280. }
  14281. var FormatResultsCache = class {
  14282. constructor(cacheFileLocation, cacheStrategy) {
  14283. const useChecksum = cacheStrategy === "content";
  14284. this.cacheFileLocation = cacheFileLocation;
  14285. this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum);
  14286. }
  14287. existsAvailableFormatResultsCache(filePath, options) {
  14288. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14289. if (fileDescriptor.notFound) {
  14290. return false;
  14291. }
  14292. const hashOfOptions = getHashOfOptions(options);
  14293. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14294. const changed = fileDescriptor.changed || meta.hashOfOptions !== hashOfOptions;
  14295. return !changed;
  14296. }
  14297. setFormatResultsCache(filePath, options) {
  14298. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14299. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14300. if (fileDescriptor && !fileDescriptor.notFound) {
  14301. meta.hashOfOptions = getHashOfOptions(options);
  14302. }
  14303. }
  14304. removeFormatResultsCache(filePath) {
  14305. this.fileEntryCache.removeEntry(filePath);
  14306. }
  14307. reconcile() {
  14308. this.fileEntryCache.reconcile();
  14309. }
  14310. };
  14311. module2.exports = FormatResultsCache;
  14312. }
  14313. });
  14314. var require_base = __commonJS2({
  14315. "node_modules/diff/lib/diff/base.js"(exports2) {
  14316. "use strict";
  14317. Object.defineProperty(exports2, "__esModule", {
  14318. value: true
  14319. });
  14320. exports2["default"] = Diff;
  14321. function Diff() {
  14322. }
  14323. Diff.prototype = {
  14324. diff: function diff(oldString, newString) {
  14325. var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  14326. var callback = options.callback;
  14327. if (typeof options === "function") {
  14328. callback = options;
  14329. options = {};
  14330. }
  14331. this.options = options;
  14332. var self2 = this;
  14333. function done(value) {
  14334. if (callback) {
  14335. setTimeout(function() {
  14336. callback(void 0, value);
  14337. }, 0);
  14338. return true;
  14339. } else {
  14340. return value;
  14341. }
  14342. }
  14343. oldString = this.castInput(oldString);
  14344. newString = this.castInput(newString);
  14345. oldString = this.removeEmpty(this.tokenize(oldString));
  14346. newString = this.removeEmpty(this.tokenize(newString));
  14347. var newLen = newString.length, oldLen = oldString.length;
  14348. var editLength = 1;
  14349. var maxEditLength = newLen + oldLen;
  14350. var bestPath = [{
  14351. newPos: -1,
  14352. components: []
  14353. }];
  14354. var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
  14355. if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
  14356. return done([{
  14357. value: this.join(newString),
  14358. count: newString.length
  14359. }]);
  14360. }
  14361. function execEditLength() {
  14362. for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
  14363. var basePath = void 0;
  14364. var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
  14365. if (addPath) {
  14366. bestPath[diagonalPath - 1] = void 0;
  14367. }
  14368. var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
  14369. if (!canAdd && !canRemove) {
  14370. bestPath[diagonalPath] = void 0;
  14371. continue;
  14372. }
  14373. if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
  14374. basePath = clonePath(removePath);
  14375. self2.pushComponent(basePath.components, void 0, true);
  14376. } else {
  14377. basePath = addPath;
  14378. basePath.newPos++;
  14379. self2.pushComponent(basePath.components, true, void 0);
  14380. }
  14381. _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
  14382. if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
  14383. return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
  14384. } else {
  14385. bestPath[diagonalPath] = basePath;
  14386. }
  14387. }
  14388. editLength++;
  14389. }
  14390. if (callback) {
  14391. (function exec() {
  14392. setTimeout(function() {
  14393. if (editLength > maxEditLength) {
  14394. return callback();
  14395. }
  14396. if (!execEditLength()) {
  14397. exec();
  14398. }
  14399. }, 0);
  14400. })();
  14401. } else {
  14402. while (editLength <= maxEditLength) {
  14403. var ret = execEditLength();
  14404. if (ret) {
  14405. return ret;
  14406. }
  14407. }
  14408. }
  14409. },
  14410. pushComponent: function pushComponent(components, added, removed) {
  14411. var last = components[components.length - 1];
  14412. if (last && last.added === added && last.removed === removed) {
  14413. components[components.length - 1] = {
  14414. count: last.count + 1,
  14415. added,
  14416. removed
  14417. };
  14418. } else {
  14419. components.push({
  14420. count: 1,
  14421. added,
  14422. removed
  14423. });
  14424. }
  14425. },
  14426. extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
  14427. var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
  14428. while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
  14429. newPos++;
  14430. oldPos++;
  14431. commonCount++;
  14432. }
  14433. if (commonCount) {
  14434. basePath.components.push({
  14435. count: commonCount
  14436. });
  14437. }
  14438. basePath.newPos = newPos;
  14439. return oldPos;
  14440. },
  14441. equals: function equals(left, right) {
  14442. if (this.options.comparator) {
  14443. return this.options.comparator(left, right);
  14444. } else {
  14445. return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
  14446. }
  14447. },
  14448. removeEmpty: function removeEmpty(array2) {
  14449. var ret = [];
  14450. for (var i = 0; i < array2.length; i++) {
  14451. if (array2[i]) {
  14452. ret.push(array2[i]);
  14453. }
  14454. }
  14455. return ret;
  14456. },
  14457. castInput: function castInput(value) {
  14458. return value;
  14459. },
  14460. tokenize: function tokenize(value) {
  14461. return value.split("");
  14462. },
  14463. join: function join(chars) {
  14464. return chars.join("");
  14465. }
  14466. };
  14467. function buildValues(diff, components, newString, oldString, useLongestToken) {
  14468. var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
  14469. for (; componentPos < componentLen; componentPos++) {
  14470. var component = components[componentPos];
  14471. if (!component.removed) {
  14472. if (!component.added && useLongestToken) {
  14473. var value = newString.slice(newPos, newPos + component.count);
  14474. value = value.map(function(value2, i) {
  14475. var oldValue = oldString[oldPos + i];
  14476. return oldValue.length > value2.length ? oldValue : value2;
  14477. });
  14478. component.value = diff.join(value);
  14479. } else {
  14480. component.value = diff.join(newString.slice(newPos, newPos + component.count));
  14481. }
  14482. newPos += component.count;
  14483. if (!component.added) {
  14484. oldPos += component.count;
  14485. }
  14486. } else {
  14487. component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
  14488. oldPos += component.count;
  14489. if (componentPos && components[componentPos - 1].added) {
  14490. var tmp = components[componentPos - 1];
  14491. components[componentPos - 1] = components[componentPos];
  14492. components[componentPos] = tmp;
  14493. }
  14494. }
  14495. }
  14496. var lastComponent = components[componentLen - 1];
  14497. if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
  14498. components[componentLen - 2].value += lastComponent.value;
  14499. components.pop();
  14500. }
  14501. return components;
  14502. }
  14503. function clonePath(path) {
  14504. return {
  14505. newPos: path.newPos,
  14506. components: path.components.slice(0)
  14507. };
  14508. }
  14509. }
  14510. });
  14511. var require_params = __commonJS2({
  14512. "node_modules/diff/lib/util/params.js"(exports2) {
  14513. "use strict";
  14514. Object.defineProperty(exports2, "__esModule", {
  14515. value: true
  14516. });
  14517. exports2.generateOptions = generateOptions;
  14518. function generateOptions(options, defaults) {
  14519. if (typeof options === "function") {
  14520. defaults.callback = options;
  14521. } else if (options) {
  14522. for (var name in options) {
  14523. if (options.hasOwnProperty(name)) {
  14524. defaults[name] = options[name];
  14525. }
  14526. }
  14527. }
  14528. return defaults;
  14529. }
  14530. }
  14531. });
  14532. var require_line = __commonJS2({
  14533. "node_modules/diff/lib/diff/line.js"(exports2) {
  14534. "use strict";
  14535. Object.defineProperty(exports2, "__esModule", {
  14536. value: true
  14537. });
  14538. exports2.diffLines = diffLines;
  14539. exports2.diffTrimmedLines = diffTrimmedLines;
  14540. exports2.lineDiff = void 0;
  14541. var _base = _interopRequireDefault(require_base());
  14542. var _params = require_params();
  14543. function _interopRequireDefault(obj) {
  14544. return obj && obj.__esModule ? obj : {
  14545. "default": obj
  14546. };
  14547. }
  14548. var lineDiff = new _base["default"]();
  14549. exports2.lineDiff = lineDiff;
  14550. lineDiff.tokenize = function(value) {
  14551. var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
  14552. if (!linesAndNewlines[linesAndNewlines.length - 1]) {
  14553. linesAndNewlines.pop();
  14554. }
  14555. for (var i = 0; i < linesAndNewlines.length; i++) {
  14556. var line = linesAndNewlines[i];
  14557. if (i % 2 && !this.options.newlineIsToken) {
  14558. retLines[retLines.length - 1] += line;
  14559. } else {
  14560. if (this.options.ignoreWhitespace) {
  14561. line = line.trim();
  14562. }
  14563. retLines.push(line);
  14564. }
  14565. }
  14566. return retLines;
  14567. };
  14568. function diffLines(oldStr, newStr, callback) {
  14569. return lineDiff.diff(oldStr, newStr, callback);
  14570. }
  14571. function diffTrimmedLines(oldStr, newStr, callback) {
  14572. var options = (0, _params.generateOptions)(callback, {
  14573. ignoreWhitespace: true
  14574. });
  14575. return lineDiff.diff(oldStr, newStr, options);
  14576. }
  14577. }
  14578. });
  14579. var require_create = __commonJS2({
  14580. "node_modules/diff/lib/patch/create.js"(exports2) {
  14581. "use strict";
  14582. Object.defineProperty(exports2, "__esModule", {
  14583. value: true
  14584. });
  14585. exports2.structuredPatch = structuredPatch;
  14586. exports2.formatPatch = formatPatch;
  14587. exports2.createTwoFilesPatch = createTwoFilesPatch;
  14588. exports2.createPatch = createPatch;
  14589. var _line = require_line();
  14590. function _toConsumableArray(arr) {
  14591. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  14592. }
  14593. function _nonIterableSpread() {
  14594. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  14595. }
  14596. function _unsupportedIterableToArray(o, minLen) {
  14597. if (!o)
  14598. return;
  14599. if (typeof o === "string")
  14600. return _arrayLikeToArray(o, minLen);
  14601. var n = Object.prototype.toString.call(o).slice(8, -1);
  14602. if (n === "Object" && o.constructor)
  14603. n = o.constructor.name;
  14604. if (n === "Map" || n === "Set")
  14605. return Array.from(o);
  14606. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  14607. return _arrayLikeToArray(o, minLen);
  14608. }
  14609. function _iterableToArray(iter) {
  14610. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
  14611. return Array.from(iter);
  14612. }
  14613. function _arrayWithoutHoles(arr) {
  14614. if (Array.isArray(arr))
  14615. return _arrayLikeToArray(arr);
  14616. }
  14617. function _arrayLikeToArray(arr, len) {
  14618. if (len == null || len > arr.length)
  14619. len = arr.length;
  14620. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  14621. arr2[i] = arr[i];
  14622. }
  14623. return arr2;
  14624. }
  14625. function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14626. if (!options) {
  14627. options = {};
  14628. }
  14629. if (typeof options.context === "undefined") {
  14630. options.context = 4;
  14631. }
  14632. var diff = (0, _line.diffLines)(oldStr, newStr, options);
  14633. diff.push({
  14634. value: "",
  14635. lines: []
  14636. });
  14637. function contextLines(lines) {
  14638. return lines.map(function(entry) {
  14639. return " " + entry;
  14640. });
  14641. }
  14642. var hunks = [];
  14643. var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
  14644. var _loop = function _loop2(i2) {
  14645. var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
  14646. current.lines = lines;
  14647. if (current.added || current.removed) {
  14648. var _curRange;
  14649. if (!oldRangeStart) {
  14650. var prev = diff[i2 - 1];
  14651. oldRangeStart = oldLine;
  14652. newRangeStart = newLine;
  14653. if (prev) {
  14654. curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
  14655. oldRangeStart -= curRange.length;
  14656. newRangeStart -= curRange.length;
  14657. }
  14658. }
  14659. (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
  14660. return (current.added ? "+" : "-") + entry;
  14661. })));
  14662. if (current.added) {
  14663. newLine += lines.length;
  14664. } else {
  14665. oldLine += lines.length;
  14666. }
  14667. } else {
  14668. if (oldRangeStart) {
  14669. if (lines.length <= options.context * 2 && i2 < diff.length - 2) {
  14670. var _curRange2;
  14671. (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
  14672. } else {
  14673. var _curRange3;
  14674. var contextSize = Math.min(lines.length, options.context);
  14675. (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
  14676. var hunk = {
  14677. oldStart: oldRangeStart,
  14678. oldLines: oldLine - oldRangeStart + contextSize,
  14679. newStart: newRangeStart,
  14680. newLines: newLine - newRangeStart + contextSize,
  14681. lines: curRange
  14682. };
  14683. if (i2 >= diff.length - 2 && lines.length <= options.context) {
  14684. var oldEOFNewline = /\n$/.test(oldStr);
  14685. var newEOFNewline = /\n$/.test(newStr);
  14686. var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
  14687. if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
  14688. curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
  14689. }
  14690. if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
  14691. curRange.push("\\ No newline at end of file");
  14692. }
  14693. }
  14694. hunks.push(hunk);
  14695. oldRangeStart = 0;
  14696. newRangeStart = 0;
  14697. curRange = [];
  14698. }
  14699. }
  14700. oldLine += lines.length;
  14701. newLine += lines.length;
  14702. }
  14703. };
  14704. for (var i = 0; i < diff.length; i++) {
  14705. _loop(i);
  14706. }
  14707. return {
  14708. oldFileName,
  14709. newFileName,
  14710. oldHeader,
  14711. newHeader,
  14712. hunks
  14713. };
  14714. }
  14715. function formatPatch(diff) {
  14716. var ret = [];
  14717. if (diff.oldFileName == diff.newFileName) {
  14718. ret.push("Index: " + diff.oldFileName);
  14719. }
  14720. ret.push("===================================================================");
  14721. ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
  14722. ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
  14723. for (var i = 0; i < diff.hunks.length; i++) {
  14724. var hunk = diff.hunks[i];
  14725. if (hunk.oldLines === 0) {
  14726. hunk.oldStart -= 1;
  14727. }
  14728. if (hunk.newLines === 0) {
  14729. hunk.newStart -= 1;
  14730. }
  14731. ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
  14732. ret.push.apply(ret, hunk.lines);
  14733. }
  14734. return ret.join("\n") + "\n";
  14735. }
  14736. function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14737. return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
  14738. }
  14739. function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
  14740. return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
  14741. }
  14742. }
  14743. });
  14744. var require_format = __commonJS2({
  14745. "src/cli/format.js"(exports2, module2) {
  14746. "use strict";
  14747. var {
  14748. promises: fs
  14749. } = require("fs");
  14750. var path = require("path");
  14751. var {
  14752. default: chalk2
  14753. } = (init_source(), __toCommonJS(source_exports));
  14754. var prettier2 = require("./index.js");
  14755. var {
  14756. getStdin
  14757. } = require("./third-party.js");
  14758. var {
  14759. createIgnorer,
  14760. errors
  14761. } = require_prettier_internal();
  14762. var {
  14763. expandPatterns,
  14764. fixWindowsSlashes
  14765. } = require_expand_patterns();
  14766. var getOptionsForFile = require_get_options_for_file();
  14767. var isTTY = require_is_tty();
  14768. var findCacheFile = require_find_cache_file();
  14769. var FormatResultsCache = require_format_results_cache();
  14770. var {
  14771. statSafe
  14772. } = require_utils();
  14773. function diff(a, b) {
  14774. return require_create().createTwoFilesPatch("", "", a, b, "", "", {
  14775. context: 2
  14776. });
  14777. }
  14778. function handleError(context, filename, error, printedFilename) {
  14779. if (error instanceof errors.UndefinedParserError) {
  14780. if ((context.argv.write || context.argv.ignoreUnknown) && printedFilename) {
  14781. printedFilename.clear();
  14782. }
  14783. if (context.argv.ignoreUnknown) {
  14784. return;
  14785. }
  14786. if (!context.argv.check && !context.argv.listDifferent) {
  14787. process.exitCode = 2;
  14788. }
  14789. context.logger.error(error.message);
  14790. return;
  14791. }
  14792. if (context.argv.write) {
  14793. process.stdout.write("\n");
  14794. }
  14795. const isParseError = Boolean(error && error.loc);
  14796. const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
  14797. if (isParseError) {
  14798. context.logger.error(`${filename}: ${String(error)}`);
  14799. } else if (isValidationError || error instanceof errors.ConfigError) {
  14800. context.logger.error(error.message);
  14801. process.exit(1);
  14802. } else if (error instanceof errors.DebugError) {
  14803. context.logger.error(`${filename}: ${error.message}`);
  14804. } else {
  14805. context.logger.error(filename + ": " + (error.stack || error));
  14806. }
  14807. process.exitCode = 2;
  14808. }
  14809. function writeOutput(context, result, options) {
  14810. process.stdout.write(context.argv.debugCheck ? result.filepath : result.formatted);
  14811. if (options && options.cursorOffset >= 0) {
  14812. process.stderr.write(result.cursorOffset + "\n");
  14813. }
  14814. }
  14815. function listDifferent(context, input, options, filename) {
  14816. if (!context.argv.check && !context.argv.listDifferent) {
  14817. return;
  14818. }
  14819. try {
  14820. if (!options.filepath && !options.parser) {
  14821. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14822. }
  14823. if (!prettier2.check(input, options)) {
  14824. if (!context.argv.write) {
  14825. context.logger.log(filename);
  14826. process.exitCode = 1;
  14827. }
  14828. }
  14829. } catch (error) {
  14830. context.logger.error(error.message);
  14831. }
  14832. return true;
  14833. }
  14834. function format(context, input, opt) {
  14835. if (!opt.parser && !opt.filepath) {
  14836. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14837. }
  14838. if (context.argv.debugPrintDoc) {
  14839. const doc = prettier2.__debug.printToDoc(input, opt);
  14840. return {
  14841. formatted: prettier2.__debug.formatDoc(doc) + "\n"
  14842. };
  14843. }
  14844. if (context.argv.debugPrintComments) {
  14845. return {
  14846. formatted: prettier2.format(JSON.stringify(prettier2.formatWithCursor(input, opt).comments || []), {
  14847. parser: "json"
  14848. })
  14849. };
  14850. }
  14851. if (context.argv.debugPrintAst) {
  14852. const {
  14853. ast
  14854. } = prettier2.__debug.parse(input, opt);
  14855. return {
  14856. formatted: JSON.stringify(ast)
  14857. };
  14858. }
  14859. if (context.argv.debugCheck) {
  14860. const pp = prettier2.format(input, opt);
  14861. const pppp = prettier2.format(pp, opt);
  14862. if (pp !== pppp) {
  14863. throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
  14864. } else {
  14865. const stringify2 = (obj) => JSON.stringify(obj, null, 2);
  14866. const ast = stringify2(prettier2.__debug.parse(input, opt, true).ast);
  14867. const past = stringify2(prettier2.__debug.parse(pp, opt, true).ast);
  14868. if (ast !== past) {
  14869. const MAX_AST_SIZE = 2097152;
  14870. const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
  14871. throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
  14872. }
  14873. }
  14874. return {
  14875. formatted: pp,
  14876. filepath: opt.filepath || "(stdin)\n"
  14877. };
  14878. }
  14879. const {
  14880. performanceTestFlag
  14881. } = context;
  14882. if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugBenchmark) {
  14883. let benchmark;
  14884. try {
  14885. benchmark = require("benchmark");
  14886. } catch {
  14887. context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
  14888. process.exit(2);
  14889. }
  14890. context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
  14891. const suite = new benchmark.Suite();
  14892. suite.add("format", () => {
  14893. prettier2.formatWithCursor(input, opt);
  14894. }).on("cycle", (event) => {
  14895. const results = {
  14896. benchmark: String(event.target),
  14897. hz: event.target.hz,
  14898. ms: event.target.times.cycle * 1e3
  14899. };
  14900. context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14901. }).run({
  14902. async: false
  14903. });
  14904. } else if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugRepeat) {
  14905. const repeat = context.argv.debugRepeat;
  14906. context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
  14907. let totalMs = 0;
  14908. for (let i = 0; i < repeat; ++i) {
  14909. const startMs = Date.now();
  14910. prettier2.formatWithCursor(input, opt);
  14911. totalMs += Date.now() - startMs;
  14912. }
  14913. const averageMs = totalMs / repeat;
  14914. const results = {
  14915. repeat,
  14916. hz: 1e3 / averageMs,
  14917. ms: averageMs
  14918. };
  14919. context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14920. }
  14921. return prettier2.formatWithCursor(input, opt);
  14922. }
  14923. async function createIgnorerFromContextOrDie(context) {
  14924. try {
  14925. return await createIgnorer(context.argv.ignorePath, context.argv.withNodeModules);
  14926. } catch (e) {
  14927. context.logger.error(e.message);
  14928. process.exit(2);
  14929. }
  14930. }
  14931. async function formatStdin2(context) {
  14932. const filepath = context.argv.filepath ? path.resolve(process.cwd(), context.argv.filepath) : process.cwd();
  14933. const ignorer = await createIgnorerFromContextOrDie(context);
  14934. const relativeFilepath = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filepath) : path.relative(process.cwd(), filepath);
  14935. try {
  14936. const input = await getStdin();
  14937. if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
  14938. writeOutput(context, {
  14939. formatted: input
  14940. });
  14941. return;
  14942. }
  14943. const options = await getOptionsForFile(context, filepath);
  14944. if (listDifferent(context, input, options, "(stdin)")) {
  14945. return;
  14946. }
  14947. const formatted = format(context, input, options);
  14948. const {
  14949. performanceTestFlag
  14950. } = context;
  14951. if (performanceTestFlag) {
  14952. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code to screen.`);
  14953. return;
  14954. }
  14955. writeOutput(context, formatted, options);
  14956. } catch (error) {
  14957. handleError(context, relativeFilepath || "stdin", error);
  14958. }
  14959. }
  14960. async function formatFiles2(context) {
  14961. var _formatResultsCache4;
  14962. const ignorer = await createIgnorerFromContextOrDie(context);
  14963. let numberOfUnformattedFilesFound = 0;
  14964. const {
  14965. performanceTestFlag
  14966. } = context;
  14967. if (context.argv.check && !performanceTestFlag) {
  14968. context.logger.log("Checking formatting...");
  14969. }
  14970. let formatResultsCache;
  14971. const cacheFilePath = await findCacheFile(context.argv.cacheLocation);
  14972. if (context.argv.cache) {
  14973. formatResultsCache = new FormatResultsCache(cacheFilePath, context.argv.cacheStrategy || "content");
  14974. } else {
  14975. if (context.argv.cacheStrategy) {
  14976. context.logger.error("`--cache-strategy` cannot be used without `--cache`.");
  14977. process.exit(2);
  14978. }
  14979. if (!context.argv.cacheLocation) {
  14980. const stat = await statSafe(cacheFilePath);
  14981. if (stat) {
  14982. await fs.unlink(cacheFilePath);
  14983. }
  14984. }
  14985. }
  14986. for await (const pathOrError of expandPatterns(context)) {
  14987. var _formatResultsCache;
  14988. if (typeof pathOrError === "object") {
  14989. context.logger.error(pathOrError.error);
  14990. process.exitCode = 2;
  14991. continue;
  14992. }
  14993. const filename = pathOrError;
  14994. const ignoreFilename = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filename) : filename;
  14995. const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
  14996. if (fileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) {
  14997. continue;
  14998. }
  14999. const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
  15000. filepath: filename
  15001. });
  15002. let printedFilename;
  15003. if (isTTY()) {
  15004. printedFilename = context.logger.log(filename, {
  15005. newline: false,
  15006. clearable: true
  15007. });
  15008. }
  15009. let input;
  15010. try {
  15011. input = await fs.readFile(filename, "utf8");
  15012. } catch (error) {
  15013. context.logger.log("");
  15014. context.logger.error(`Unable to read file: ${filename}
  15015. ${error.message}`);
  15016. process.exitCode = 2;
  15017. continue;
  15018. }
  15019. if (fileIgnored) {
  15020. writeOutput(context, {
  15021. formatted: input
  15022. }, options);
  15023. continue;
  15024. }
  15025. const start = Date.now();
  15026. const isCacheExists = (_formatResultsCache = formatResultsCache) === null || _formatResultsCache === void 0 ? void 0 : _formatResultsCache.existsAvailableFormatResultsCache(filename, options);
  15027. let result;
  15028. let output;
  15029. try {
  15030. if (isCacheExists) {
  15031. result = {
  15032. formatted: input
  15033. };
  15034. } else {
  15035. result = format(context, input, options);
  15036. }
  15037. output = result.formatted;
  15038. } catch (error) {
  15039. handleError(context, filename, error, printedFilename);
  15040. continue;
  15041. }
  15042. const isDifferent = output !== input;
  15043. let shouldSetCache = !isDifferent;
  15044. if (printedFilename) {
  15045. printedFilename.clear();
  15046. }
  15047. if (performanceTestFlag) {
  15048. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code or write files.`);
  15049. return;
  15050. }
  15051. if (context.argv.write) {
  15052. if (isDifferent) {
  15053. if (!context.argv.check && !context.argv.listDifferent) {
  15054. context.logger.log(`${filename} ${Date.now() - start}ms`);
  15055. }
  15056. try {
  15057. await fs.writeFile(filename, output, "utf8");
  15058. shouldSetCache = true;
  15059. } catch (error) {
  15060. context.logger.error(`Unable to write file: ${filename}
  15061. ${error.message}`);
  15062. process.exitCode = 2;
  15063. }
  15064. } else if (!context.argv.check && !context.argv.listDifferent) {
  15065. const message = `${chalk2.grey(filename)} ${Date.now() - start}ms`;
  15066. if (isCacheExists) {
  15067. context.logger.log(`${message} (cached)`);
  15068. } else {
  15069. context.logger.log(message);
  15070. }
  15071. }
  15072. } else if (context.argv.debugCheck) {
  15073. if (result.filepath) {
  15074. context.logger.log(result.filepath);
  15075. } else {
  15076. process.exitCode = 2;
  15077. }
  15078. } else if (!context.argv.check && !context.argv.listDifferent) {
  15079. writeOutput(context, result, options);
  15080. }
  15081. if (shouldSetCache) {
  15082. var _formatResultsCache2;
  15083. (_formatResultsCache2 = formatResultsCache) === null || _formatResultsCache2 === void 0 ? void 0 : _formatResultsCache2.setFormatResultsCache(filename, options);
  15084. } else {
  15085. var _formatResultsCache3;
  15086. (_formatResultsCache3 = formatResultsCache) === null || _formatResultsCache3 === void 0 ? void 0 : _formatResultsCache3.removeFormatResultsCache(filename);
  15087. }
  15088. if (isDifferent) {
  15089. if (context.argv.check) {
  15090. context.logger.warn(filename);
  15091. } else if (context.argv.listDifferent) {
  15092. context.logger.log(filename);
  15093. }
  15094. numberOfUnformattedFilesFound += 1;
  15095. }
  15096. }
  15097. (_formatResultsCache4 = formatResultsCache) === null || _formatResultsCache4 === void 0 ? void 0 : _formatResultsCache4.reconcile();
  15098. if (context.argv.check) {
  15099. if (numberOfUnformattedFilesFound === 0) {
  15100. context.logger.log("All matched files use Prettier code style!");
  15101. } else if (numberOfUnformattedFilesFound === 1) {
  15102. context.logger.warn(context.argv.write ? "Code style issues fixed in the above file." : "Code style issues found in the above file. Forgot to run Prettier?");
  15103. } else {
  15104. context.logger.warn(context.argv.write ? "Code style issues found in " + numberOfUnformattedFilesFound + " files." : "Code style issues found in " + numberOfUnformattedFilesFound + " files. Forgot to run Prettier?");
  15105. }
  15106. }
  15107. if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
  15108. process.exitCode = 1;
  15109. }
  15110. }
  15111. module2.exports = {
  15112. formatStdin: formatStdin2,
  15113. formatFiles: formatFiles2
  15114. };
  15115. }
  15116. });
  15117. var require_file_info = __commonJS2({
  15118. "src/cli/file-info.js"(exports2, module2) {
  15119. "use strict";
  15120. var stringify2 = require_fast_json_stable_stringify();
  15121. var prettier2 = require("./index.js");
  15122. var {
  15123. printToScreen: printToScreen2
  15124. } = require_utils();
  15125. async function logFileInfoOrDie2(context) {
  15126. const {
  15127. fileInfo: file,
  15128. ignorePath,
  15129. withNodeModules,
  15130. plugins,
  15131. pluginSearchDirs,
  15132. config
  15133. } = context.argv;
  15134. const fileInfo = await prettier2.getFileInfo(file, {
  15135. ignorePath,
  15136. withNodeModules,
  15137. plugins,
  15138. pluginSearchDirs,
  15139. resolveConfig: config !== false
  15140. });
  15141. printToScreen2(prettier2.format(stringify2(fileInfo), {
  15142. parser: "json"
  15143. }));
  15144. }
  15145. module2.exports = logFileInfoOrDie2;
  15146. }
  15147. });
  15148. var require_find_config_path = __commonJS2({
  15149. "src/cli/find-config-path.js"(exports2, module2) {
  15150. "use strict";
  15151. var path = require("path");
  15152. var prettier2 = require("./index.js");
  15153. var {
  15154. printToScreen: printToScreen2
  15155. } = require_utils();
  15156. async function logResolvedConfigPathOrDie2(context) {
  15157. const file = context.argv.findConfigPath;
  15158. const configFile = await prettier2.resolveConfigFile(file);
  15159. if (configFile) {
  15160. printToScreen2(path.relative(process.cwd(), configFile));
  15161. } else {
  15162. throw new Error(`Can not find configure file for "${file}"`);
  15163. }
  15164. }
  15165. module2.exports = logResolvedConfigPathOrDie2;
  15166. }
  15167. });
  15168. var stringify = require_fast_json_stable_stringify();
  15169. var prettier = require("./index.js");
  15170. var createLogger = require_logger();
  15171. var Context = require_context();
  15172. var {
  15173. parseArgvWithoutPlugins
  15174. } = require_parse_cli_arguments();
  15175. var {
  15176. createDetailedUsage,
  15177. createUsage
  15178. } = require_usage();
  15179. var {
  15180. formatStdin,
  15181. formatFiles
  15182. } = require_format();
  15183. var logFileInfoOrDie = require_file_info();
  15184. var logResolvedConfigPathOrDie = require_find_config_path();
  15185. var {
  15186. utils: {
  15187. isNonEmptyArray
  15188. }
  15189. } = require_prettier_internal();
  15190. var {
  15191. printToScreen
  15192. } = require_utils();
  15193. async function run(rawArguments) {
  15194. let logger = createLogger();
  15195. try {
  15196. const logLevel = parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
  15197. if (logLevel !== logger.logLevel) {
  15198. logger = createLogger(logLevel);
  15199. }
  15200. const context = new Context({
  15201. rawArguments,
  15202. logger
  15203. });
  15204. if (logger.logLevel !== "debug" && context.performanceTestFlag) {
  15205. context.logger = createLogger("debug");
  15206. }
  15207. await main(context);
  15208. } catch (error) {
  15209. logger.error(error.message);
  15210. process.exitCode = 1;
  15211. }
  15212. }
  15213. async function main(context) {
  15214. context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
  15215. if (context.argv.pluginSearch === false) {
  15216. const rawPluginSearchDirs = context.argv.__raw["plugin-search-dir"];
  15217. if (typeof rawPluginSearchDirs === "string" || isNonEmptyArray(rawPluginSearchDirs)) {
  15218. throw new Error("Cannot use --no-plugin-search and --plugin-search-dir together.");
  15219. }
  15220. }
  15221. if (context.argv.check && context.argv.listDifferent) {
  15222. throw new Error("Cannot use --check and --list-different together.");
  15223. }
  15224. if (context.argv.write && context.argv.debugCheck) {
  15225. throw new Error("Cannot use --write and --debug-check together.");
  15226. }
  15227. if (context.argv.findConfigPath && context.filePatterns.length > 0) {
  15228. throw new Error("Cannot use --find-config-path with multiple files");
  15229. }
  15230. if (context.argv.fileInfo && context.filePatterns.length > 0) {
  15231. throw new Error("Cannot use --file-info with multiple files");
  15232. }
  15233. if (context.argv.version) {
  15234. printToScreen(prettier.version);
  15235. return;
  15236. }
  15237. if (context.argv.help !== void 0) {
  15238. printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
  15239. return;
  15240. }
  15241. if (context.argv.supportInfo) {
  15242. printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
  15243. parser: "json"
  15244. }));
  15245. return;
  15246. }
  15247. const hasFilePatterns = context.filePatterns.length > 0;
  15248. const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filePath);
  15249. if (context.argv.findConfigPath) {
  15250. await logResolvedConfigPathOrDie(context);
  15251. } else if (context.argv.fileInfo) {
  15252. await logFileInfoOrDie(context);
  15253. } else if (useStdin) {
  15254. if (context.argv.cache) {
  15255. context.logger.error("`--cache` cannot be used with stdin.");
  15256. process.exit(2);
  15257. }
  15258. await formatStdin(context);
  15259. } else if (hasFilePatterns) {
  15260. await formatFiles(context);
  15261. } else {
  15262. process.exitCode = 1;
  15263. printToScreen(createUsage(context));
  15264. }
  15265. }
  15266. module.exports = {
  15267. run
  15268. };