cli.js 488 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085
  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 bind = FunctionPrototype.bind;
  93. var call = FunctionPrototype.call;
  94. var uncurryThis = NATIVE_BIND && bind.bind(call, call);
  95. module2.exports = NATIVE_BIND ? function(fn) {
  96. return fn && uncurryThis(fn);
  97. } : function(fn) {
  98. return fn && function() {
  99. return call.apply(fn, arguments);
  100. };
  101. };
  102. }
  103. });
  104. // node_modules/core-js/internals/classof-raw.js
  105. var require_classof_raw = __commonJS({
  106. "node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
  107. var uncurryThis = require_function_uncurry_this();
  108. var toString = uncurryThis({}.toString);
  109. var stringSlice = uncurryThis("".slice);
  110. module2.exports = function(it) {
  111. return stringSlice(toString(it), 8, -1);
  112. };
  113. }
  114. });
  115. // node_modules/core-js/internals/indexed-object.js
  116. var require_indexed_object = __commonJS({
  117. "node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
  118. var global2 = require_global();
  119. var uncurryThis = require_function_uncurry_this();
  120. var fails = require_fails();
  121. var classof = require_classof_raw();
  122. var Object2 = global2.Object;
  123. var split = uncurryThis("".split);
  124. module2.exports = fails(function() {
  125. return !Object2("z").propertyIsEnumerable(0);
  126. }) ? function(it) {
  127. return classof(it) == "String" ? split(it, "") : Object2(it);
  128. } : Object2;
  129. }
  130. });
  131. // node_modules/core-js/internals/require-object-coercible.js
  132. var require_require_object_coercible = __commonJS({
  133. "node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
  134. var global2 = require_global();
  135. var TypeError2 = global2.TypeError;
  136. module2.exports = function(it) {
  137. if (it == void 0)
  138. throw TypeError2("Can't call method on " + it);
  139. return it;
  140. };
  141. }
  142. });
  143. // node_modules/core-js/internals/to-indexed-object.js
  144. var require_to_indexed_object = __commonJS({
  145. "node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
  146. var IndexedObject = require_indexed_object();
  147. var requireObjectCoercible = require_require_object_coercible();
  148. module2.exports = function(it) {
  149. return IndexedObject(requireObjectCoercible(it));
  150. };
  151. }
  152. });
  153. // node_modules/core-js/internals/is-callable.js
  154. var require_is_callable = __commonJS({
  155. "node_modules/core-js/internals/is-callable.js"(exports2, module2) {
  156. module2.exports = function(argument) {
  157. return typeof argument == "function";
  158. };
  159. }
  160. });
  161. // node_modules/core-js/internals/is-object.js
  162. var require_is_object = __commonJS({
  163. "node_modules/core-js/internals/is-object.js"(exports2, module2) {
  164. var isCallable = require_is_callable();
  165. module2.exports = function(it) {
  166. return typeof it == "object" ? it !== null : isCallable(it);
  167. };
  168. }
  169. });
  170. // node_modules/core-js/internals/get-built-in.js
  171. var require_get_built_in = __commonJS({
  172. "node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
  173. var global2 = require_global();
  174. var isCallable = require_is_callable();
  175. var aFunction = function(argument) {
  176. return isCallable(argument) ? argument : void 0;
  177. };
  178. module2.exports = function(namespace, method) {
  179. return arguments.length < 2 ? aFunction(global2[namespace]) : global2[namespace] && global2[namespace][method];
  180. };
  181. }
  182. });
  183. // node_modules/core-js/internals/object-is-prototype-of.js
  184. var require_object_is_prototype_of = __commonJS({
  185. "node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
  186. var uncurryThis = require_function_uncurry_this();
  187. module2.exports = uncurryThis({}.isPrototypeOf);
  188. }
  189. });
  190. // node_modules/core-js/internals/engine-user-agent.js
  191. var require_engine_user_agent = __commonJS({
  192. "node_modules/core-js/internals/engine-user-agent.js"(exports2, module2) {
  193. var getBuiltIn = require_get_built_in();
  194. module2.exports = getBuiltIn("navigator", "userAgent") || "";
  195. }
  196. });
  197. // node_modules/core-js/internals/engine-v8-version.js
  198. var require_engine_v8_version = __commonJS({
  199. "node_modules/core-js/internals/engine-v8-version.js"(exports2, module2) {
  200. var global2 = require_global();
  201. var userAgent = require_engine_user_agent();
  202. var process2 = global2.process;
  203. var Deno = global2.Deno;
  204. var versions = process2 && process2.versions || Deno && Deno.version;
  205. var v8 = versions && versions.v8;
  206. var match;
  207. var version;
  208. if (v8) {
  209. match = v8.split(".");
  210. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  211. }
  212. if (!version && userAgent) {
  213. match = userAgent.match(/Edge\/(\d+)/);
  214. if (!match || match[1] >= 74) {
  215. match = userAgent.match(/Chrome\/(\d+)/);
  216. if (match)
  217. version = +match[1];
  218. }
  219. }
  220. module2.exports = version;
  221. }
  222. });
  223. // node_modules/core-js/internals/native-symbol.js
  224. var require_native_symbol = __commonJS({
  225. "node_modules/core-js/internals/native-symbol.js"(exports2, module2) {
  226. var V8_VERSION = require_engine_v8_version();
  227. var fails = require_fails();
  228. module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
  229. var symbol = Symbol();
  230. return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  231. });
  232. }
  233. });
  234. // node_modules/core-js/internals/use-symbol-as-uid.js
  235. var require_use_symbol_as_uid = __commonJS({
  236. "node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
  237. var NATIVE_SYMBOL = require_native_symbol();
  238. module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
  239. }
  240. });
  241. // node_modules/core-js/internals/is-symbol.js
  242. var require_is_symbol = __commonJS({
  243. "node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
  244. var global2 = require_global();
  245. var getBuiltIn = require_get_built_in();
  246. var isCallable = require_is_callable();
  247. var isPrototypeOf = require_object_is_prototype_of();
  248. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  249. var Object2 = global2.Object;
  250. module2.exports = USE_SYMBOL_AS_UID ? function(it) {
  251. return typeof it == "symbol";
  252. } : function(it) {
  253. var $Symbol = getBuiltIn("Symbol");
  254. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object2(it));
  255. };
  256. }
  257. });
  258. // node_modules/core-js/internals/try-to-string.js
  259. var require_try_to_string = __commonJS({
  260. "node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
  261. var global2 = require_global();
  262. var String2 = global2.String;
  263. module2.exports = function(argument) {
  264. try {
  265. return String2(argument);
  266. } catch (error) {
  267. return "Object";
  268. }
  269. };
  270. }
  271. });
  272. // node_modules/core-js/internals/a-callable.js
  273. var require_a_callable = __commonJS({
  274. "node_modules/core-js/internals/a-callable.js"(exports2, module2) {
  275. var global2 = require_global();
  276. var isCallable = require_is_callable();
  277. var tryToString = require_try_to_string();
  278. var TypeError2 = global2.TypeError;
  279. module2.exports = function(argument) {
  280. if (isCallable(argument))
  281. return argument;
  282. throw TypeError2(tryToString(argument) + " is not a function");
  283. };
  284. }
  285. });
  286. // node_modules/core-js/internals/get-method.js
  287. var require_get_method = __commonJS({
  288. "node_modules/core-js/internals/get-method.js"(exports2, module2) {
  289. var aCallable = require_a_callable();
  290. module2.exports = function(V, P) {
  291. var func = V[P];
  292. return func == null ? void 0 : aCallable(func);
  293. };
  294. }
  295. });
  296. // node_modules/core-js/internals/ordinary-to-primitive.js
  297. var require_ordinary_to_primitive = __commonJS({
  298. "node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
  299. var global2 = require_global();
  300. var call = require_function_call();
  301. var isCallable = require_is_callable();
  302. var isObject = require_is_object();
  303. var TypeError2 = global2.TypeError;
  304. module2.exports = function(input, pref) {
  305. var fn, val;
  306. if (pref === "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  307. return val;
  308. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input)))
  309. return val;
  310. if (pref !== "string" && isCallable(fn = input.toString) && !isObject(val = call(fn, input)))
  311. return val;
  312. throw TypeError2("Can't convert object to primitive value");
  313. };
  314. }
  315. });
  316. // node_modules/core-js/internals/is-pure.js
  317. var require_is_pure = __commonJS({
  318. "node_modules/core-js/internals/is-pure.js"(exports2, module2) {
  319. module2.exports = false;
  320. }
  321. });
  322. // node_modules/core-js/internals/set-global.js
  323. var require_set_global = __commonJS({
  324. "node_modules/core-js/internals/set-global.js"(exports2, module2) {
  325. var global2 = require_global();
  326. var defineProperty = Object.defineProperty;
  327. module2.exports = function(key, value) {
  328. try {
  329. defineProperty(global2, key, { value, configurable: true, writable: true });
  330. } catch (error) {
  331. global2[key] = value;
  332. }
  333. return value;
  334. };
  335. }
  336. });
  337. // node_modules/core-js/internals/shared-store.js
  338. var require_shared_store = __commonJS({
  339. "node_modules/core-js/internals/shared-store.js"(exports2, module2) {
  340. var global2 = require_global();
  341. var setGlobal = require_set_global();
  342. var SHARED = "__core-js_shared__";
  343. var store = global2[SHARED] || setGlobal(SHARED, {});
  344. module2.exports = store;
  345. }
  346. });
  347. // node_modules/core-js/internals/shared.js
  348. var require_shared = __commonJS({
  349. "node_modules/core-js/internals/shared.js"(exports2, module2) {
  350. var IS_PURE = require_is_pure();
  351. var store = require_shared_store();
  352. (module2.exports = function(key, value) {
  353. return store[key] || (store[key] = value !== void 0 ? value : {});
  354. })("versions", []).push({
  355. version: "3.22.2",
  356. mode: IS_PURE ? "pure" : "global",
  357. copyright: "\xA9 2014-2022 Denis Pushkarev (zloirock.ru)",
  358. license: "https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE",
  359. source: "https://github.com/zloirock/core-js"
  360. });
  361. }
  362. });
  363. // node_modules/core-js/internals/to-object.js
  364. var require_to_object = __commonJS({
  365. "node_modules/core-js/internals/to-object.js"(exports2, module2) {
  366. var global2 = require_global();
  367. var requireObjectCoercible = require_require_object_coercible();
  368. var Object2 = global2.Object;
  369. module2.exports = function(argument) {
  370. return Object2(requireObjectCoercible(argument));
  371. };
  372. }
  373. });
  374. // node_modules/core-js/internals/has-own-property.js
  375. var require_has_own_property = __commonJS({
  376. "node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
  377. var uncurryThis = require_function_uncurry_this();
  378. var toObject = require_to_object();
  379. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  380. module2.exports = Object.hasOwn || function hasOwn(it, key) {
  381. return hasOwnProperty(toObject(it), key);
  382. };
  383. }
  384. });
  385. // node_modules/core-js/internals/uid.js
  386. var require_uid = __commonJS({
  387. "node_modules/core-js/internals/uid.js"(exports2, module2) {
  388. var uncurryThis = require_function_uncurry_this();
  389. var id = 0;
  390. var postfix = Math.random();
  391. var toString = uncurryThis(1 .toString);
  392. module2.exports = function(key) {
  393. return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
  394. };
  395. }
  396. });
  397. // node_modules/core-js/internals/well-known-symbol.js
  398. var require_well_known_symbol = __commonJS({
  399. "node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
  400. var global2 = require_global();
  401. var shared = require_shared();
  402. var hasOwn = require_has_own_property();
  403. var uid = require_uid();
  404. var NATIVE_SYMBOL = require_native_symbol();
  405. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  406. var WellKnownSymbolsStore = shared("wks");
  407. var Symbol2 = global2.Symbol;
  408. var symbolFor = Symbol2 && Symbol2["for"];
  409. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
  410. module2.exports = function(name) {
  411. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == "string")) {
  412. var description = "Symbol." + name;
  413. if (NATIVE_SYMBOL && hasOwn(Symbol2, name)) {
  414. WellKnownSymbolsStore[name] = Symbol2[name];
  415. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  416. WellKnownSymbolsStore[name] = symbolFor(description);
  417. } else {
  418. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  419. }
  420. }
  421. return WellKnownSymbolsStore[name];
  422. };
  423. }
  424. });
  425. // node_modules/core-js/internals/to-primitive.js
  426. var require_to_primitive = __commonJS({
  427. "node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
  428. var global2 = require_global();
  429. var call = require_function_call();
  430. var isObject = require_is_object();
  431. var isSymbol = require_is_symbol();
  432. var getMethod = require_get_method();
  433. var ordinaryToPrimitive = require_ordinary_to_primitive();
  434. var wellKnownSymbol = require_well_known_symbol();
  435. var TypeError2 = global2.TypeError;
  436. var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
  437. module2.exports = function(input, pref) {
  438. if (!isObject(input) || isSymbol(input))
  439. return input;
  440. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  441. var result;
  442. if (exoticToPrim) {
  443. if (pref === void 0)
  444. pref = "default";
  445. result = call(exoticToPrim, input, pref);
  446. if (!isObject(result) || isSymbol(result))
  447. return result;
  448. throw TypeError2("Can't convert object to primitive value");
  449. }
  450. if (pref === void 0)
  451. pref = "number";
  452. return ordinaryToPrimitive(input, pref);
  453. };
  454. }
  455. });
  456. // node_modules/core-js/internals/to-property-key.js
  457. var require_to_property_key = __commonJS({
  458. "node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
  459. var toPrimitive = require_to_primitive();
  460. var isSymbol = require_is_symbol();
  461. module2.exports = function(argument) {
  462. var key = toPrimitive(argument, "string");
  463. return isSymbol(key) ? key : key + "";
  464. };
  465. }
  466. });
  467. // node_modules/core-js/internals/document-create-element.js
  468. var require_document_create_element = __commonJS({
  469. "node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
  470. var global2 = require_global();
  471. var isObject = require_is_object();
  472. var document = global2.document;
  473. var EXISTS = isObject(document) && isObject(document.createElement);
  474. module2.exports = function(it) {
  475. return EXISTS ? document.createElement(it) : {};
  476. };
  477. }
  478. });
  479. // node_modules/core-js/internals/ie8-dom-define.js
  480. var require_ie8_dom_define = __commonJS({
  481. "node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
  482. var DESCRIPTORS = require_descriptors();
  483. var fails = require_fails();
  484. var createElement = require_document_create_element();
  485. module2.exports = !DESCRIPTORS && !fails(function() {
  486. return Object.defineProperty(createElement("div"), "a", {
  487. get: function() {
  488. return 7;
  489. }
  490. }).a != 7;
  491. });
  492. }
  493. });
  494. // node_modules/core-js/internals/object-get-own-property-descriptor.js
  495. var require_object_get_own_property_descriptor = __commonJS({
  496. "node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
  497. var DESCRIPTORS = require_descriptors();
  498. var call = require_function_call();
  499. var propertyIsEnumerableModule = require_object_property_is_enumerable();
  500. var createPropertyDescriptor = require_create_property_descriptor();
  501. var toIndexedObject = require_to_indexed_object();
  502. var toPropertyKey = require_to_property_key();
  503. var hasOwn = require_has_own_property();
  504. var IE8_DOM_DEFINE = require_ie8_dom_define();
  505. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  506. exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  507. O = toIndexedObject(O);
  508. P = toPropertyKey(P);
  509. if (IE8_DOM_DEFINE)
  510. try {
  511. return $getOwnPropertyDescriptor(O, P);
  512. } catch (error) {
  513. }
  514. if (hasOwn(O, P))
  515. return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  516. };
  517. }
  518. });
  519. // node_modules/core-js/internals/v8-prototype-define-bug.js
  520. var require_v8_prototype_define_bug = __commonJS({
  521. "node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
  522. var DESCRIPTORS = require_descriptors();
  523. var fails = require_fails();
  524. module2.exports = DESCRIPTORS && fails(function() {
  525. return Object.defineProperty(function() {
  526. }, "prototype", {
  527. value: 42,
  528. writable: false
  529. }).prototype != 42;
  530. });
  531. }
  532. });
  533. // node_modules/core-js/internals/an-object.js
  534. var require_an_object = __commonJS({
  535. "node_modules/core-js/internals/an-object.js"(exports2, module2) {
  536. var global2 = require_global();
  537. var isObject = require_is_object();
  538. var String2 = global2.String;
  539. var TypeError2 = global2.TypeError;
  540. module2.exports = function(argument) {
  541. if (isObject(argument))
  542. return argument;
  543. throw TypeError2(String2(argument) + " is not an object");
  544. };
  545. }
  546. });
  547. // node_modules/core-js/internals/object-define-property.js
  548. var require_object_define_property = __commonJS({
  549. "node_modules/core-js/internals/object-define-property.js"(exports2) {
  550. var global2 = require_global();
  551. var DESCRIPTORS = require_descriptors();
  552. var IE8_DOM_DEFINE = require_ie8_dom_define();
  553. var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
  554. var anObject = require_an_object();
  555. var toPropertyKey = require_to_property_key();
  556. var TypeError2 = global2.TypeError;
  557. var $defineProperty = Object.defineProperty;
  558. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  559. var ENUMERABLE = "enumerable";
  560. var CONFIGURABLE = "configurable";
  561. var WRITABLE = "writable";
  562. exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  563. anObject(O);
  564. P = toPropertyKey(P);
  565. anObject(Attributes);
  566. if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  567. var current = $getOwnPropertyDescriptor(O, P);
  568. if (current && current[WRITABLE]) {
  569. O[P] = Attributes.value;
  570. Attributes = {
  571. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  572. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  573. writable: false
  574. };
  575. }
  576. }
  577. return $defineProperty(O, P, Attributes);
  578. } : $defineProperty : function defineProperty(O, P, Attributes) {
  579. anObject(O);
  580. P = toPropertyKey(P);
  581. anObject(Attributes);
  582. if (IE8_DOM_DEFINE)
  583. try {
  584. return $defineProperty(O, P, Attributes);
  585. } catch (error) {
  586. }
  587. if ("get" in Attributes || "set" in Attributes)
  588. throw TypeError2("Accessors not supported");
  589. if ("value" in Attributes)
  590. O[P] = Attributes.value;
  591. return O;
  592. };
  593. }
  594. });
  595. // node_modules/core-js/internals/create-non-enumerable-property.js
  596. var require_create_non_enumerable_property = __commonJS({
  597. "node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
  598. var DESCRIPTORS = require_descriptors();
  599. var definePropertyModule = require_object_define_property();
  600. var createPropertyDescriptor = require_create_property_descriptor();
  601. module2.exports = DESCRIPTORS ? function(object, key, value) {
  602. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  603. } : function(object, key, value) {
  604. object[key] = value;
  605. return object;
  606. };
  607. }
  608. });
  609. // node_modules/core-js/internals/inspect-source.js
  610. var require_inspect_source = __commonJS({
  611. "node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
  612. var uncurryThis = require_function_uncurry_this();
  613. var isCallable = require_is_callable();
  614. var store = require_shared_store();
  615. var functionToString = uncurryThis(Function.toString);
  616. if (!isCallable(store.inspectSource)) {
  617. store.inspectSource = function(it) {
  618. return functionToString(it);
  619. };
  620. }
  621. module2.exports = store.inspectSource;
  622. }
  623. });
  624. // node_modules/core-js/internals/native-weak-map.js
  625. var require_native_weak_map = __commonJS({
  626. "node_modules/core-js/internals/native-weak-map.js"(exports2, module2) {
  627. var global2 = require_global();
  628. var isCallable = require_is_callable();
  629. var inspectSource = require_inspect_source();
  630. var WeakMap2 = global2.WeakMap;
  631. module2.exports = isCallable(WeakMap2) && /native code/.test(inspectSource(WeakMap2));
  632. }
  633. });
  634. // node_modules/core-js/internals/shared-key.js
  635. var require_shared_key = __commonJS({
  636. "node_modules/core-js/internals/shared-key.js"(exports2, module2) {
  637. var shared = require_shared();
  638. var uid = require_uid();
  639. var keys = shared("keys");
  640. module2.exports = function(key) {
  641. return keys[key] || (keys[key] = uid(key));
  642. };
  643. }
  644. });
  645. // node_modules/core-js/internals/hidden-keys.js
  646. var require_hidden_keys = __commonJS({
  647. "node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
  648. module2.exports = {};
  649. }
  650. });
  651. // node_modules/core-js/internals/internal-state.js
  652. var require_internal_state = __commonJS({
  653. "node_modules/core-js/internals/internal-state.js"(exports2, module2) {
  654. var NATIVE_WEAK_MAP = require_native_weak_map();
  655. var global2 = require_global();
  656. var uncurryThis = require_function_uncurry_this();
  657. var isObject = require_is_object();
  658. var createNonEnumerableProperty = require_create_non_enumerable_property();
  659. var hasOwn = require_has_own_property();
  660. var shared = require_shared_store();
  661. var sharedKey = require_shared_key();
  662. var hiddenKeys = require_hidden_keys();
  663. var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
  664. var TypeError2 = global2.TypeError;
  665. var WeakMap2 = global2.WeakMap;
  666. var set;
  667. var get;
  668. var has;
  669. var enforce = function(it) {
  670. return has(it) ? get(it) : set(it, {});
  671. };
  672. var getterFor = function(TYPE) {
  673. return function(it) {
  674. var state;
  675. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  676. throw TypeError2("Incompatible receiver, " + TYPE + " required");
  677. }
  678. return state;
  679. };
  680. };
  681. if (NATIVE_WEAK_MAP || shared.state) {
  682. store = shared.state || (shared.state = new WeakMap2());
  683. wmget = uncurryThis(store.get);
  684. wmhas = uncurryThis(store.has);
  685. wmset = uncurryThis(store.set);
  686. set = function(it, metadata) {
  687. if (wmhas(store, it))
  688. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  689. metadata.facade = it;
  690. wmset(store, it, metadata);
  691. return metadata;
  692. };
  693. get = function(it) {
  694. return wmget(store, it) || {};
  695. };
  696. has = function(it) {
  697. return wmhas(store, it);
  698. };
  699. } else {
  700. STATE = sharedKey("state");
  701. hiddenKeys[STATE] = true;
  702. set = function(it, metadata) {
  703. if (hasOwn(it, STATE))
  704. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  705. metadata.facade = it;
  706. createNonEnumerableProperty(it, STATE, metadata);
  707. return metadata;
  708. };
  709. get = function(it) {
  710. return hasOwn(it, STATE) ? it[STATE] : {};
  711. };
  712. has = function(it) {
  713. return hasOwn(it, STATE);
  714. };
  715. }
  716. var store;
  717. var wmget;
  718. var wmhas;
  719. var wmset;
  720. var STATE;
  721. module2.exports = {
  722. set,
  723. get,
  724. has,
  725. enforce,
  726. getterFor
  727. };
  728. }
  729. });
  730. // node_modules/core-js/internals/function-name.js
  731. var require_function_name = __commonJS({
  732. "node_modules/core-js/internals/function-name.js"(exports2, module2) {
  733. var DESCRIPTORS = require_descriptors();
  734. var hasOwn = require_has_own_property();
  735. var FunctionPrototype = Function.prototype;
  736. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  737. var EXISTS = hasOwn(FunctionPrototype, "name");
  738. var PROPER = EXISTS && function something() {
  739. }.name === "something";
  740. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
  741. module2.exports = {
  742. EXISTS,
  743. PROPER,
  744. CONFIGURABLE
  745. };
  746. }
  747. });
  748. // node_modules/core-js/internals/redefine.js
  749. var require_redefine = __commonJS({
  750. "node_modules/core-js/internals/redefine.js"(exports2, module2) {
  751. var global2 = require_global();
  752. var isCallable = require_is_callable();
  753. var hasOwn = require_has_own_property();
  754. var createNonEnumerableProperty = require_create_non_enumerable_property();
  755. var setGlobal = require_set_global();
  756. var inspectSource = require_inspect_source();
  757. var InternalStateModule = require_internal_state();
  758. var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
  759. var getInternalState = InternalStateModule.get;
  760. var enforceInternalState = InternalStateModule.enforce;
  761. var TEMPLATE = String(String).split("String");
  762. (module2.exports = function(O, key, value, options) {
  763. var unsafe = options ? !!options.unsafe : false;
  764. var simple = options ? !!options.enumerable : false;
  765. var noTargetGet = options ? !!options.noTargetGet : false;
  766. var name = options && options.name !== void 0 ? options.name : key;
  767. var state;
  768. if (isCallable(value)) {
  769. if (String(name).slice(0, 7) === "Symbol(") {
  770. name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
  771. }
  772. if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
  773. createNonEnumerableProperty(value, "name", name);
  774. }
  775. state = enforceInternalState(value);
  776. if (!state.source) {
  777. state.source = TEMPLATE.join(typeof name == "string" ? name : "");
  778. }
  779. }
  780. if (O === global2) {
  781. if (simple)
  782. O[key] = value;
  783. else
  784. setGlobal(key, value);
  785. return;
  786. } else if (!unsafe) {
  787. delete O[key];
  788. } else if (!noTargetGet && O[key]) {
  789. simple = true;
  790. }
  791. if (simple)
  792. O[key] = value;
  793. else
  794. createNonEnumerableProperty(O, key, value);
  795. })(Function.prototype, "toString", function toString() {
  796. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  797. });
  798. }
  799. });
  800. // node_modules/core-js/internals/to-integer-or-infinity.js
  801. var require_to_integer_or_infinity = __commonJS({
  802. "node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
  803. var ceil = Math.ceil;
  804. var floor = Math.floor;
  805. module2.exports = function(argument) {
  806. var number = +argument;
  807. return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
  808. };
  809. }
  810. });
  811. // node_modules/core-js/internals/to-absolute-index.js
  812. var require_to_absolute_index = __commonJS({
  813. "node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
  814. var toIntegerOrInfinity = require_to_integer_or_infinity();
  815. var max = Math.max;
  816. var min = Math.min;
  817. module2.exports = function(index, length) {
  818. var integer = toIntegerOrInfinity(index);
  819. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  820. };
  821. }
  822. });
  823. // node_modules/core-js/internals/to-length.js
  824. var require_to_length = __commonJS({
  825. "node_modules/core-js/internals/to-length.js"(exports2, module2) {
  826. var toIntegerOrInfinity = require_to_integer_or_infinity();
  827. var min = Math.min;
  828. module2.exports = function(argument) {
  829. return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
  830. };
  831. }
  832. });
  833. // node_modules/core-js/internals/length-of-array-like.js
  834. var require_length_of_array_like = __commonJS({
  835. "node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
  836. var toLength = require_to_length();
  837. module2.exports = function(obj) {
  838. return toLength(obj.length);
  839. };
  840. }
  841. });
  842. // node_modules/core-js/internals/array-includes.js
  843. var require_array_includes = __commonJS({
  844. "node_modules/core-js/internals/array-includes.js"(exports2, module2) {
  845. var toIndexedObject = require_to_indexed_object();
  846. var toAbsoluteIndex = require_to_absolute_index();
  847. var lengthOfArrayLike = require_length_of_array_like();
  848. var createMethod = function(IS_INCLUDES) {
  849. return function($this, el, fromIndex) {
  850. var O = toIndexedObject($this);
  851. var length = lengthOfArrayLike(O);
  852. var index = toAbsoluteIndex(fromIndex, length);
  853. var value;
  854. if (IS_INCLUDES && el != el)
  855. while (length > index) {
  856. value = O[index++];
  857. if (value != value)
  858. return true;
  859. }
  860. else
  861. for (; length > index; index++) {
  862. if ((IS_INCLUDES || index in O) && O[index] === el)
  863. return IS_INCLUDES || index || 0;
  864. }
  865. return !IS_INCLUDES && -1;
  866. };
  867. };
  868. module2.exports = {
  869. includes: createMethod(true),
  870. indexOf: createMethod(false)
  871. };
  872. }
  873. });
  874. // node_modules/core-js/internals/object-keys-internal.js
  875. var require_object_keys_internal = __commonJS({
  876. "node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
  877. var uncurryThis = require_function_uncurry_this();
  878. var hasOwn = require_has_own_property();
  879. var toIndexedObject = require_to_indexed_object();
  880. var indexOf = require_array_includes().indexOf;
  881. var hiddenKeys = require_hidden_keys();
  882. var push = uncurryThis([].push);
  883. module2.exports = function(object, names) {
  884. var O = toIndexedObject(object);
  885. var i = 0;
  886. var result = [];
  887. var key;
  888. for (key in O)
  889. !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  890. while (names.length > i)
  891. if (hasOwn(O, key = names[i++])) {
  892. ~indexOf(result, key) || push(result, key);
  893. }
  894. return result;
  895. };
  896. }
  897. });
  898. // node_modules/core-js/internals/enum-bug-keys.js
  899. var require_enum_bug_keys = __commonJS({
  900. "node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
  901. module2.exports = [
  902. "constructor",
  903. "hasOwnProperty",
  904. "isPrototypeOf",
  905. "propertyIsEnumerable",
  906. "toLocaleString",
  907. "toString",
  908. "valueOf"
  909. ];
  910. }
  911. });
  912. // node_modules/core-js/internals/object-get-own-property-names.js
  913. var require_object_get_own_property_names = __commonJS({
  914. "node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
  915. var internalObjectKeys = require_object_keys_internal();
  916. var enumBugKeys = require_enum_bug_keys();
  917. var hiddenKeys = enumBugKeys.concat("length", "prototype");
  918. exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  919. return internalObjectKeys(O, hiddenKeys);
  920. };
  921. }
  922. });
  923. // node_modules/core-js/internals/object-get-own-property-symbols.js
  924. var require_object_get_own_property_symbols = __commonJS({
  925. "node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
  926. exports2.f = Object.getOwnPropertySymbols;
  927. }
  928. });
  929. // node_modules/core-js/internals/own-keys.js
  930. var require_own_keys = __commonJS({
  931. "node_modules/core-js/internals/own-keys.js"(exports2, module2) {
  932. var getBuiltIn = require_get_built_in();
  933. var uncurryThis = require_function_uncurry_this();
  934. var getOwnPropertyNamesModule = require_object_get_own_property_names();
  935. var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
  936. var anObject = require_an_object();
  937. var concat = uncurryThis([].concat);
  938. module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys(it) {
  939. var keys = getOwnPropertyNamesModule.f(anObject(it));
  940. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  941. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  942. };
  943. }
  944. });
  945. // node_modules/core-js/internals/copy-constructor-properties.js
  946. var require_copy_constructor_properties = __commonJS({
  947. "node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
  948. var hasOwn = require_has_own_property();
  949. var ownKeys = require_own_keys();
  950. var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
  951. var definePropertyModule = require_object_define_property();
  952. module2.exports = function(target, source, exceptions) {
  953. var keys = ownKeys(source);
  954. var defineProperty = definePropertyModule.f;
  955. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  956. for (var i = 0; i < keys.length; i++) {
  957. var key = keys[i];
  958. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  959. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  960. }
  961. }
  962. };
  963. }
  964. });
  965. // node_modules/core-js/internals/is-forced.js
  966. var require_is_forced = __commonJS({
  967. "node_modules/core-js/internals/is-forced.js"(exports2, module2) {
  968. var fails = require_fails();
  969. var isCallable = require_is_callable();
  970. var replacement = /#|\.prototype\./;
  971. var isForced = function(feature, detection) {
  972. var value = data[normalize(feature)];
  973. return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  974. };
  975. var normalize = isForced.normalize = function(string) {
  976. return String(string).replace(replacement, ".").toLowerCase();
  977. };
  978. var data = isForced.data = {};
  979. var NATIVE = isForced.NATIVE = "N";
  980. var POLYFILL = isForced.POLYFILL = "P";
  981. module2.exports = isForced;
  982. }
  983. });
  984. // node_modules/core-js/internals/export.js
  985. var require_export = __commonJS({
  986. "node_modules/core-js/internals/export.js"(exports2, module2) {
  987. var global2 = require_global();
  988. var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  989. var createNonEnumerableProperty = require_create_non_enumerable_property();
  990. var redefine = require_redefine();
  991. var setGlobal = require_set_global();
  992. var copyConstructorProperties = require_copy_constructor_properties();
  993. var isForced = require_is_forced();
  994. module2.exports = function(options, source) {
  995. var TARGET = options.target;
  996. var GLOBAL = options.global;
  997. var STATIC = options.stat;
  998. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  999. if (GLOBAL) {
  1000. target = global2;
  1001. } else if (STATIC) {
  1002. target = global2[TARGET] || setGlobal(TARGET, {});
  1003. } else {
  1004. target = (global2[TARGET] || {}).prototype;
  1005. }
  1006. if (target)
  1007. for (key in source) {
  1008. sourceProperty = source[key];
  1009. if (options.noTargetGet) {
  1010. descriptor = getOwnPropertyDescriptor(target, key);
  1011. targetProperty = descriptor && descriptor.value;
  1012. } else
  1013. targetProperty = target[key];
  1014. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
  1015. if (!FORCED && targetProperty !== void 0) {
  1016. if (typeof sourceProperty == typeof targetProperty)
  1017. continue;
  1018. copyConstructorProperties(sourceProperty, targetProperty);
  1019. }
  1020. if (options.sham || targetProperty && targetProperty.sham) {
  1021. createNonEnumerableProperty(sourceProperty, "sham", true);
  1022. }
  1023. redefine(target, key, sourceProperty, options);
  1024. }
  1025. };
  1026. }
  1027. });
  1028. // node_modules/core-js/internals/function-bind-context.js
  1029. var require_function_bind_context = __commonJS({
  1030. "node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
  1031. var uncurryThis = require_function_uncurry_this();
  1032. var aCallable = require_a_callable();
  1033. var NATIVE_BIND = require_function_bind_native();
  1034. var bind = uncurryThis(uncurryThis.bind);
  1035. module2.exports = function(fn, that) {
  1036. aCallable(fn);
  1037. return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
  1038. return fn.apply(that, arguments);
  1039. };
  1040. };
  1041. }
  1042. });
  1043. // node_modules/core-js/internals/iterators.js
  1044. var require_iterators = __commonJS({
  1045. "node_modules/core-js/internals/iterators.js"(exports2, module2) {
  1046. module2.exports = {};
  1047. }
  1048. });
  1049. // node_modules/core-js/internals/is-array-iterator-method.js
  1050. var require_is_array_iterator_method = __commonJS({
  1051. "node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
  1052. var wellKnownSymbol = require_well_known_symbol();
  1053. var Iterators = require_iterators();
  1054. var ITERATOR = wellKnownSymbol("iterator");
  1055. var ArrayPrototype = Array.prototype;
  1056. module2.exports = function(it) {
  1057. return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  1058. };
  1059. }
  1060. });
  1061. // node_modules/core-js/internals/to-string-tag-support.js
  1062. var require_to_string_tag_support = __commonJS({
  1063. "node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
  1064. var wellKnownSymbol = require_well_known_symbol();
  1065. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1066. var test = {};
  1067. test[TO_STRING_TAG] = "z";
  1068. module2.exports = String(test) === "[object z]";
  1069. }
  1070. });
  1071. // node_modules/core-js/internals/classof.js
  1072. var require_classof = __commonJS({
  1073. "node_modules/core-js/internals/classof.js"(exports2, module2) {
  1074. var global2 = require_global();
  1075. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  1076. var isCallable = require_is_callable();
  1077. var classofRaw = require_classof_raw();
  1078. var wellKnownSymbol = require_well_known_symbol();
  1079. var TO_STRING_TAG = wellKnownSymbol("toStringTag");
  1080. var Object2 = global2.Object;
  1081. var CORRECT_ARGUMENTS = classofRaw(function() {
  1082. return arguments;
  1083. }()) == "Arguments";
  1084. var tryGet = function(it, key) {
  1085. try {
  1086. return it[key];
  1087. } catch (error) {
  1088. }
  1089. };
  1090. module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
  1091. var O, tag, result;
  1092. return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object2(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable(O.callee) ? "Arguments" : result;
  1093. };
  1094. }
  1095. });
  1096. // node_modules/core-js/internals/get-iterator-method.js
  1097. var require_get_iterator_method = __commonJS({
  1098. "node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
  1099. var classof = require_classof();
  1100. var getMethod = require_get_method();
  1101. var Iterators = require_iterators();
  1102. var wellKnownSymbol = require_well_known_symbol();
  1103. var ITERATOR = wellKnownSymbol("iterator");
  1104. module2.exports = function(it) {
  1105. if (it != void 0)
  1106. return getMethod(it, ITERATOR) || getMethod(it, "@@iterator") || Iterators[classof(it)];
  1107. };
  1108. }
  1109. });
  1110. // node_modules/core-js/internals/get-iterator.js
  1111. var require_get_iterator = __commonJS({
  1112. "node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
  1113. var global2 = require_global();
  1114. var call = require_function_call();
  1115. var aCallable = require_a_callable();
  1116. var anObject = require_an_object();
  1117. var tryToString = require_try_to_string();
  1118. var getIteratorMethod = require_get_iterator_method();
  1119. var TypeError2 = global2.TypeError;
  1120. module2.exports = function(argument, usingIterator) {
  1121. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  1122. if (aCallable(iteratorMethod))
  1123. return anObject(call(iteratorMethod, argument));
  1124. throw TypeError2(tryToString(argument) + " is not iterable");
  1125. };
  1126. }
  1127. });
  1128. // node_modules/core-js/internals/iterator-close.js
  1129. var require_iterator_close = __commonJS({
  1130. "node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
  1131. var call = require_function_call();
  1132. var anObject = require_an_object();
  1133. var getMethod = require_get_method();
  1134. module2.exports = function(iterator, kind, value) {
  1135. var innerResult, innerError;
  1136. anObject(iterator);
  1137. try {
  1138. innerResult = getMethod(iterator, "return");
  1139. if (!innerResult) {
  1140. if (kind === "throw")
  1141. throw value;
  1142. return value;
  1143. }
  1144. innerResult = call(innerResult, iterator);
  1145. } catch (error) {
  1146. innerError = true;
  1147. innerResult = error;
  1148. }
  1149. if (kind === "throw")
  1150. throw value;
  1151. if (innerError)
  1152. throw innerResult;
  1153. anObject(innerResult);
  1154. return value;
  1155. };
  1156. }
  1157. });
  1158. // node_modules/core-js/internals/iterate.js
  1159. var require_iterate = __commonJS({
  1160. "node_modules/core-js/internals/iterate.js"(exports2, module2) {
  1161. var global2 = require_global();
  1162. var bind = require_function_bind_context();
  1163. var call = require_function_call();
  1164. var anObject = require_an_object();
  1165. var tryToString = require_try_to_string();
  1166. var isArrayIteratorMethod = require_is_array_iterator_method();
  1167. var lengthOfArrayLike = require_length_of_array_like();
  1168. var isPrototypeOf = require_object_is_prototype_of();
  1169. var getIterator = require_get_iterator();
  1170. var getIteratorMethod = require_get_iterator_method();
  1171. var iteratorClose = require_iterator_close();
  1172. var TypeError2 = global2.TypeError;
  1173. var Result = function(stopped, result) {
  1174. this.stopped = stopped;
  1175. this.result = result;
  1176. };
  1177. var ResultPrototype = Result.prototype;
  1178. module2.exports = function(iterable, unboundFunction, options) {
  1179. var that = options && options.that;
  1180. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  1181. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  1182. var INTERRUPTED = !!(options && options.INTERRUPTED);
  1183. var fn = bind(unboundFunction, that);
  1184. var iterator, iterFn, index, length, result, next, step;
  1185. var stop = function(condition) {
  1186. if (iterator)
  1187. iteratorClose(iterator, "normal", condition);
  1188. return new Result(true, condition);
  1189. };
  1190. var callFn = function(value) {
  1191. if (AS_ENTRIES) {
  1192. anObject(value);
  1193. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  1194. }
  1195. return INTERRUPTED ? fn(value, stop) : fn(value);
  1196. };
  1197. if (IS_ITERATOR) {
  1198. iterator = iterable;
  1199. } else {
  1200. iterFn = getIteratorMethod(iterable);
  1201. if (!iterFn)
  1202. throw TypeError2(tryToString(iterable) + " is not iterable");
  1203. if (isArrayIteratorMethod(iterFn)) {
  1204. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  1205. result = callFn(iterable[index]);
  1206. if (result && isPrototypeOf(ResultPrototype, result))
  1207. return result;
  1208. }
  1209. return new Result(false);
  1210. }
  1211. iterator = getIterator(iterable, iterFn);
  1212. }
  1213. next = iterator.next;
  1214. while (!(step = call(next, iterator)).done) {
  1215. try {
  1216. result = callFn(step.value);
  1217. } catch (error) {
  1218. iteratorClose(iterator, "throw", error);
  1219. }
  1220. if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
  1221. return result;
  1222. }
  1223. return new Result(false);
  1224. };
  1225. }
  1226. });
  1227. // node_modules/core-js/internals/create-property.js
  1228. var require_create_property = __commonJS({
  1229. "node_modules/core-js/internals/create-property.js"(exports2, module2) {
  1230. "use strict";
  1231. var toPropertyKey = require_to_property_key();
  1232. var definePropertyModule = require_object_define_property();
  1233. var createPropertyDescriptor = require_create_property_descriptor();
  1234. module2.exports = function(object, key, value) {
  1235. var propertyKey = toPropertyKey(key);
  1236. if (propertyKey in object)
  1237. definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  1238. else
  1239. object[propertyKey] = value;
  1240. };
  1241. }
  1242. });
  1243. // node_modules/core-js/modules/es.object.from-entries.js
  1244. var require_es_object_from_entries = __commonJS({
  1245. "node_modules/core-js/modules/es.object.from-entries.js"() {
  1246. var $ = require_export();
  1247. var iterate = require_iterate();
  1248. var createProperty = require_create_property();
  1249. $({ target: "Object", stat: true }, {
  1250. fromEntries: function fromEntries(iterable) {
  1251. var obj = {};
  1252. iterate(iterable, function(k, v) {
  1253. createProperty(obj, k, v);
  1254. }, { AS_ENTRIES: true });
  1255. return obj;
  1256. }
  1257. });
  1258. }
  1259. });
  1260. // node_modules/core-js/internals/is-array.js
  1261. var require_is_array = __commonJS({
  1262. "node_modules/core-js/internals/is-array.js"(exports2, module2) {
  1263. var classof = require_classof_raw();
  1264. module2.exports = Array.isArray || function isArray(argument) {
  1265. return classof(argument) == "Array";
  1266. };
  1267. }
  1268. });
  1269. // node_modules/core-js/internals/flatten-into-array.js
  1270. var require_flatten_into_array = __commonJS({
  1271. "node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
  1272. "use strict";
  1273. var global2 = require_global();
  1274. var isArray = require_is_array();
  1275. var lengthOfArrayLike = require_length_of_array_like();
  1276. var bind = require_function_bind_context();
  1277. var TypeError2 = global2.TypeError;
  1278. var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  1279. var targetIndex = start;
  1280. var sourceIndex = 0;
  1281. var mapFn = mapper ? bind(mapper, thisArg) : false;
  1282. var element, elementLen;
  1283. while (sourceIndex < sourceLen) {
  1284. if (sourceIndex in source) {
  1285. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  1286. if (depth > 0 && isArray(element)) {
  1287. elementLen = lengthOfArrayLike(element);
  1288. targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
  1289. } else {
  1290. if (targetIndex >= 9007199254740991)
  1291. throw TypeError2("Exceed the acceptable array length");
  1292. target[targetIndex] = element;
  1293. }
  1294. targetIndex++;
  1295. }
  1296. sourceIndex++;
  1297. }
  1298. return targetIndex;
  1299. };
  1300. module2.exports = flattenIntoArray;
  1301. }
  1302. });
  1303. // node_modules/core-js/internals/is-constructor.js
  1304. var require_is_constructor = __commonJS({
  1305. "node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
  1306. var uncurryThis = require_function_uncurry_this();
  1307. var fails = require_fails();
  1308. var isCallable = require_is_callable();
  1309. var classof = require_classof();
  1310. var getBuiltIn = require_get_built_in();
  1311. var inspectSource = require_inspect_source();
  1312. var noop = function() {
  1313. };
  1314. var empty = [];
  1315. var construct = getBuiltIn("Reflect", "construct");
  1316. var constructorRegExp = /^\s*(?:class|function)\b/;
  1317. var exec = uncurryThis(constructorRegExp.exec);
  1318. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  1319. var isConstructorModern = function isConstructor(argument) {
  1320. if (!isCallable(argument))
  1321. return false;
  1322. try {
  1323. construct(noop, empty, argument);
  1324. return true;
  1325. } catch (error) {
  1326. return false;
  1327. }
  1328. };
  1329. var isConstructorLegacy = function isConstructor(argument) {
  1330. if (!isCallable(argument))
  1331. return false;
  1332. switch (classof(argument)) {
  1333. case "AsyncFunction":
  1334. case "GeneratorFunction":
  1335. case "AsyncGeneratorFunction":
  1336. return false;
  1337. }
  1338. try {
  1339. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  1340. } catch (error) {
  1341. return true;
  1342. }
  1343. };
  1344. isConstructorLegacy.sham = true;
  1345. module2.exports = !construct || fails(function() {
  1346. var called;
  1347. return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
  1348. called = true;
  1349. }) || called;
  1350. }) ? isConstructorLegacy : isConstructorModern;
  1351. }
  1352. });
  1353. // node_modules/core-js/internals/array-species-constructor.js
  1354. var require_array_species_constructor = __commonJS({
  1355. "node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
  1356. var global2 = require_global();
  1357. var isArray = require_is_array();
  1358. var isConstructor = require_is_constructor();
  1359. var isObject = require_is_object();
  1360. var wellKnownSymbol = require_well_known_symbol();
  1361. var SPECIES = wellKnownSymbol("species");
  1362. var Array2 = global2.Array;
  1363. module2.exports = function(originalArray) {
  1364. var C;
  1365. if (isArray(originalArray)) {
  1366. C = originalArray.constructor;
  1367. if (isConstructor(C) && (C === Array2 || isArray(C.prototype)))
  1368. C = void 0;
  1369. else if (isObject(C)) {
  1370. C = C[SPECIES];
  1371. if (C === null)
  1372. C = void 0;
  1373. }
  1374. }
  1375. return C === void 0 ? Array2 : C;
  1376. };
  1377. }
  1378. });
  1379. // node_modules/core-js/internals/array-species-create.js
  1380. var require_array_species_create = __commonJS({
  1381. "node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
  1382. var arraySpeciesConstructor = require_array_species_constructor();
  1383. module2.exports = function(originalArray, length) {
  1384. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1385. };
  1386. }
  1387. });
  1388. // node_modules/core-js/modules/es.array.flat-map.js
  1389. var require_es_array_flat_map = __commonJS({
  1390. "node_modules/core-js/modules/es.array.flat-map.js"() {
  1391. "use strict";
  1392. var $ = require_export();
  1393. var flattenIntoArray = require_flatten_into_array();
  1394. var aCallable = require_a_callable();
  1395. var toObject = require_to_object();
  1396. var lengthOfArrayLike = require_length_of_array_like();
  1397. var arraySpeciesCreate = require_array_species_create();
  1398. $({ target: "Array", proto: true }, {
  1399. flatMap: function flatMap(callbackfn) {
  1400. var O = toObject(this);
  1401. var sourceLen = lengthOfArrayLike(O);
  1402. var A;
  1403. aCallable(callbackfn);
  1404. A = arraySpeciesCreate(O, 0);
  1405. A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
  1406. return A;
  1407. }
  1408. });
  1409. }
  1410. });
  1411. // node_modules/core-js/modules/es.array.flat.js
  1412. var require_es_array_flat = __commonJS({
  1413. "node_modules/core-js/modules/es.array.flat.js"() {
  1414. "use strict";
  1415. var $ = require_export();
  1416. var flattenIntoArray = require_flatten_into_array();
  1417. var toObject = require_to_object();
  1418. var lengthOfArrayLike = require_length_of_array_like();
  1419. var toIntegerOrInfinity = require_to_integer_or_infinity();
  1420. var arraySpeciesCreate = require_array_species_create();
  1421. $({ target: "Array", proto: true }, {
  1422. flat: function flat() {
  1423. var depthArg = arguments.length ? arguments[0] : void 0;
  1424. var O = toObject(this);
  1425. var sourceLen = lengthOfArrayLike(O);
  1426. var A = arraySpeciesCreate(O, 0);
  1427. A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
  1428. return A;
  1429. }
  1430. });
  1431. }
  1432. });
  1433. // dist/_cli.js.cjs.js
  1434. require_es_object_from_entries();
  1435. require_es_array_flat_map();
  1436. require_es_array_flat();
  1437. var __create = Object.create;
  1438. var __defProp = Object.defineProperty;
  1439. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  1440. var __getOwnPropNames2 = Object.getOwnPropertyNames;
  1441. var __getProtoOf = Object.getPrototypeOf;
  1442. var __hasOwnProp = Object.prototype.hasOwnProperty;
  1443. var __esm = (fn, res) => function __init() {
  1444. return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
  1445. };
  1446. var __commonJS2 = (cb, mod) => function __require() {
  1447. return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = {
  1448. exports: {}
  1449. }).exports, mod), mod.exports;
  1450. };
  1451. var __export = (target, all) => {
  1452. for (var name in all)
  1453. __defProp(target, name, {
  1454. get: all[name],
  1455. enumerable: true
  1456. });
  1457. };
  1458. var __copyProps = (to, from, except, desc) => {
  1459. if (from && typeof from === "object" || typeof from === "function") {
  1460. for (let key of __getOwnPropNames2(from))
  1461. if (!__hasOwnProp.call(to, key) && key !== except)
  1462. __defProp(to, key, {
  1463. get: () => from[key],
  1464. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  1465. });
  1466. }
  1467. return to;
  1468. };
  1469. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  1470. value: mod,
  1471. enumerable: true
  1472. }) : target, mod));
  1473. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
  1474. value: true
  1475. }), mod);
  1476. var require_fast_json_stable_stringify = __commonJS2({
  1477. "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
  1478. "use strict";
  1479. module2.exports = function(data, opts) {
  1480. if (!opts)
  1481. opts = {};
  1482. if (typeof opts === "function")
  1483. opts = {
  1484. cmp: opts
  1485. };
  1486. var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
  1487. var cmp = opts.cmp && function(f) {
  1488. return function(node) {
  1489. return function(a, b) {
  1490. var aobj = {
  1491. key: a,
  1492. value: node[a]
  1493. };
  1494. var bobj = {
  1495. key: b,
  1496. value: node[b]
  1497. };
  1498. return f(aobj, bobj);
  1499. };
  1500. };
  1501. }(opts.cmp);
  1502. var seen = [];
  1503. return function stringify2(node) {
  1504. if (node && node.toJSON && typeof node.toJSON === "function") {
  1505. node = node.toJSON();
  1506. }
  1507. if (node === void 0)
  1508. return;
  1509. if (typeof node == "number")
  1510. return isFinite(node) ? "" + node : "null";
  1511. if (typeof node !== "object")
  1512. return JSON.stringify(node);
  1513. var i, out;
  1514. if (Array.isArray(node)) {
  1515. out = "[";
  1516. for (i = 0; i < node.length; i++) {
  1517. if (i)
  1518. out += ",";
  1519. out += stringify2(node[i]) || "null";
  1520. }
  1521. return out + "]";
  1522. }
  1523. if (node === null)
  1524. return "null";
  1525. if (seen.indexOf(node) !== -1) {
  1526. if (cycles)
  1527. return JSON.stringify("__cycle__");
  1528. throw new TypeError("Converting circular structure to JSON");
  1529. }
  1530. var seenIndex = seen.push(node) - 1;
  1531. var keys = Object.keys(node).sort(cmp && cmp(node));
  1532. out = "";
  1533. for (i = 0; i < keys.length; i++) {
  1534. var key = keys[i];
  1535. var value = stringify2(node[key]);
  1536. if (!value)
  1537. continue;
  1538. if (out)
  1539. out += ",";
  1540. out += JSON.stringify(key) + ":" + value;
  1541. }
  1542. seen.splice(seenIndex, 1);
  1543. return "{" + out + "}";
  1544. }(data);
  1545. };
  1546. }
  1547. });
  1548. var require_clone = __commonJS2({
  1549. "node_modules/clone/clone.js"(exports2, module2) {
  1550. var clone = function() {
  1551. "use strict";
  1552. function clone2(parent, circular, depth, prototype) {
  1553. var filter;
  1554. if (typeof circular === "object") {
  1555. depth = circular.depth;
  1556. prototype = circular.prototype;
  1557. filter = circular.filter;
  1558. circular = circular.circular;
  1559. }
  1560. var allParents = [];
  1561. var allChildren = [];
  1562. var useBuffer = typeof Buffer != "undefined";
  1563. if (typeof circular == "undefined")
  1564. circular = true;
  1565. if (typeof depth == "undefined")
  1566. depth = Infinity;
  1567. function _clone(parent2, depth2) {
  1568. if (parent2 === null)
  1569. return null;
  1570. if (depth2 == 0)
  1571. return parent2;
  1572. var child;
  1573. var proto2;
  1574. if (typeof parent2 != "object") {
  1575. return parent2;
  1576. }
  1577. if (clone2.__isArray(parent2)) {
  1578. child = [];
  1579. } else if (clone2.__isRegExp(parent2)) {
  1580. child = new RegExp(parent2.source, __getRegExpFlags(parent2));
  1581. if (parent2.lastIndex)
  1582. child.lastIndex = parent2.lastIndex;
  1583. } else if (clone2.__isDate(parent2)) {
  1584. child = new Date(parent2.getTime());
  1585. } else if (useBuffer && Buffer.isBuffer(parent2)) {
  1586. if (Buffer.allocUnsafe) {
  1587. child = Buffer.allocUnsafe(parent2.length);
  1588. } else {
  1589. child = new Buffer(parent2.length);
  1590. }
  1591. parent2.copy(child);
  1592. return child;
  1593. } else {
  1594. if (typeof prototype == "undefined") {
  1595. proto2 = Object.getPrototypeOf(parent2);
  1596. child = Object.create(proto2);
  1597. } else {
  1598. child = Object.create(prototype);
  1599. proto2 = prototype;
  1600. }
  1601. }
  1602. if (circular) {
  1603. var index = allParents.indexOf(parent2);
  1604. if (index != -1) {
  1605. return allChildren[index];
  1606. }
  1607. allParents.push(parent2);
  1608. allChildren.push(child);
  1609. }
  1610. for (var i in parent2) {
  1611. var attrs;
  1612. if (proto2) {
  1613. attrs = Object.getOwnPropertyDescriptor(proto2, i);
  1614. }
  1615. if (attrs && attrs.set == null) {
  1616. continue;
  1617. }
  1618. child[i] = _clone(parent2[i], depth2 - 1);
  1619. }
  1620. return child;
  1621. }
  1622. return _clone(parent, depth);
  1623. }
  1624. clone2.clonePrototype = function clonePrototype(parent) {
  1625. if (parent === null)
  1626. return null;
  1627. var c = function() {
  1628. };
  1629. c.prototype = parent;
  1630. return new c();
  1631. };
  1632. function __objToStr(o) {
  1633. return Object.prototype.toString.call(o);
  1634. }
  1635. ;
  1636. clone2.__objToStr = __objToStr;
  1637. function __isDate(o) {
  1638. return typeof o === "object" && __objToStr(o) === "[object Date]";
  1639. }
  1640. ;
  1641. clone2.__isDate = __isDate;
  1642. function __isArray(o) {
  1643. return typeof o === "object" && __objToStr(o) === "[object Array]";
  1644. }
  1645. ;
  1646. clone2.__isArray = __isArray;
  1647. function __isRegExp(o) {
  1648. return typeof o === "object" && __objToStr(o) === "[object RegExp]";
  1649. }
  1650. ;
  1651. clone2.__isRegExp = __isRegExp;
  1652. function __getRegExpFlags(re) {
  1653. var flags = "";
  1654. if (re.global)
  1655. flags += "g";
  1656. if (re.ignoreCase)
  1657. flags += "i";
  1658. if (re.multiline)
  1659. flags += "m";
  1660. return flags;
  1661. }
  1662. ;
  1663. clone2.__getRegExpFlags = __getRegExpFlags;
  1664. return clone2;
  1665. }();
  1666. if (typeof module2 === "object" && module2.exports) {
  1667. module2.exports = clone;
  1668. }
  1669. }
  1670. });
  1671. var require_defaults = __commonJS2({
  1672. "node_modules/defaults/index.js"(exports2, module2) {
  1673. var clone = require_clone();
  1674. module2.exports = function(options, defaults) {
  1675. options = options || {};
  1676. Object.keys(defaults).forEach(function(key) {
  1677. if (typeof options[key] === "undefined") {
  1678. options[key] = clone(defaults[key]);
  1679. }
  1680. });
  1681. return options;
  1682. };
  1683. }
  1684. });
  1685. var require_combining = __commonJS2({
  1686. "node_modules/wcwidth/combining.js"(exports2, module2) {
  1687. 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]];
  1688. }
  1689. });
  1690. var require_wcwidth = __commonJS2({
  1691. "node_modules/wcwidth/index.js"(exports2, module2) {
  1692. "use strict";
  1693. var defaults = require_defaults();
  1694. var combining = require_combining();
  1695. var DEFAULTS = {
  1696. nul: 0,
  1697. control: 0
  1698. };
  1699. module2.exports = function wcwidth2(str) {
  1700. return wcswidth(str, DEFAULTS);
  1701. };
  1702. module2.exports.config = function(opts) {
  1703. opts = defaults(opts || {}, DEFAULTS);
  1704. return function wcwidth2(str) {
  1705. return wcswidth(str, opts);
  1706. };
  1707. };
  1708. function wcswidth(str, opts) {
  1709. if (typeof str !== "string")
  1710. return wcwidth(str, opts);
  1711. var s = 0;
  1712. for (var i = 0; i < str.length; i++) {
  1713. var n = wcwidth(str.charCodeAt(i), opts);
  1714. if (n < 0)
  1715. return -1;
  1716. s += n;
  1717. }
  1718. return s;
  1719. }
  1720. function wcwidth(ucs, opts) {
  1721. if (ucs === 0)
  1722. return opts.nul;
  1723. if (ucs < 32 || ucs >= 127 && ucs < 160)
  1724. return opts.control;
  1725. if (bisearch(ucs))
  1726. return 0;
  1727. 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));
  1728. }
  1729. function bisearch(ucs) {
  1730. var min = 0;
  1731. var max = combining.length - 1;
  1732. var mid;
  1733. if (ucs < combining[0][0] || ucs > combining[max][1])
  1734. return false;
  1735. while (max >= min) {
  1736. mid = Math.floor((min + max) / 2);
  1737. if (ucs > combining[mid][1])
  1738. min = mid + 1;
  1739. else if (ucs < combining[mid][0])
  1740. max = mid - 1;
  1741. else
  1742. return true;
  1743. }
  1744. return false;
  1745. }
  1746. }
  1747. });
  1748. function ansiRegex({
  1749. onlyFirst = false
  1750. } = {}) {
  1751. 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("|");
  1752. return new RegExp(pattern, onlyFirst ? void 0 : "g");
  1753. }
  1754. var init_ansi_regex = __esm({
  1755. "node_modules/strip-ansi/node_modules/ansi-regex/index.js"() {
  1756. }
  1757. });
  1758. var strip_ansi_exports = {};
  1759. __export(strip_ansi_exports, {
  1760. default: () => stripAnsi
  1761. });
  1762. function stripAnsi(string) {
  1763. if (typeof string !== "string") {
  1764. throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
  1765. }
  1766. return string.replace(ansiRegex(), "");
  1767. }
  1768. var init_strip_ansi = __esm({
  1769. "node_modules/strip-ansi/index.js"() {
  1770. init_ansi_regex();
  1771. }
  1772. });
  1773. function assembleStyles() {
  1774. const codes = /* @__PURE__ */ new Map();
  1775. const styles2 = {
  1776. modifier: {
  1777. reset: [0, 0],
  1778. bold: [1, 22],
  1779. dim: [2, 22],
  1780. italic: [3, 23],
  1781. underline: [4, 24],
  1782. overline: [53, 55],
  1783. inverse: [7, 27],
  1784. hidden: [8, 28],
  1785. strikethrough: [9, 29]
  1786. },
  1787. color: {
  1788. black: [30, 39],
  1789. red: [31, 39],
  1790. green: [32, 39],
  1791. yellow: [33, 39],
  1792. blue: [34, 39],
  1793. magenta: [35, 39],
  1794. cyan: [36, 39],
  1795. white: [37, 39],
  1796. blackBright: [90, 39],
  1797. redBright: [91, 39],
  1798. greenBright: [92, 39],
  1799. yellowBright: [93, 39],
  1800. blueBright: [94, 39],
  1801. magentaBright: [95, 39],
  1802. cyanBright: [96, 39],
  1803. whiteBright: [97, 39]
  1804. },
  1805. bgColor: {
  1806. bgBlack: [40, 49],
  1807. bgRed: [41, 49],
  1808. bgGreen: [42, 49],
  1809. bgYellow: [43, 49],
  1810. bgBlue: [44, 49],
  1811. bgMagenta: [45, 49],
  1812. bgCyan: [46, 49],
  1813. bgWhite: [47, 49],
  1814. bgBlackBright: [100, 49],
  1815. bgRedBright: [101, 49],
  1816. bgGreenBright: [102, 49],
  1817. bgYellowBright: [103, 49],
  1818. bgBlueBright: [104, 49],
  1819. bgMagentaBright: [105, 49],
  1820. bgCyanBright: [106, 49],
  1821. bgWhiteBright: [107, 49]
  1822. }
  1823. };
  1824. styles2.color.gray = styles2.color.blackBright;
  1825. styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
  1826. styles2.color.grey = styles2.color.blackBright;
  1827. styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
  1828. for (const [groupName, group] of Object.entries(styles2)) {
  1829. for (const [styleName, style] of Object.entries(group)) {
  1830. styles2[styleName] = {
  1831. open: `\x1B[${style[0]}m`,
  1832. close: `\x1B[${style[1]}m`
  1833. };
  1834. group[styleName] = styles2[styleName];
  1835. codes.set(style[0], style[1]);
  1836. }
  1837. Object.defineProperty(styles2, groupName, {
  1838. value: group,
  1839. enumerable: false
  1840. });
  1841. }
  1842. Object.defineProperty(styles2, "codes", {
  1843. value: codes,
  1844. enumerable: false
  1845. });
  1846. styles2.color.close = "\x1B[39m";
  1847. styles2.bgColor.close = "\x1B[49m";
  1848. styles2.color.ansi = wrapAnsi16();
  1849. styles2.color.ansi256 = wrapAnsi256();
  1850. styles2.color.ansi16m = wrapAnsi16m();
  1851. styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
  1852. styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
  1853. styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
  1854. Object.defineProperties(styles2, {
  1855. rgbToAnsi256: {
  1856. value: (red, green, blue) => {
  1857. if (red === green && green === blue) {
  1858. if (red < 8) {
  1859. return 16;
  1860. }
  1861. if (red > 248) {
  1862. return 231;
  1863. }
  1864. return Math.round((red - 8) / 247 * 24) + 232;
  1865. }
  1866. return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
  1867. },
  1868. enumerable: false
  1869. },
  1870. hexToRgb: {
  1871. value: (hex) => {
  1872. const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
  1873. if (!matches) {
  1874. return [0, 0, 0];
  1875. }
  1876. let {
  1877. colorString
  1878. } = matches.groups;
  1879. if (colorString.length === 3) {
  1880. colorString = [...colorString].map((character) => character + character).join("");
  1881. }
  1882. const integer = Number.parseInt(colorString, 16);
  1883. return [integer >> 16 & 255, integer >> 8 & 255, integer & 255];
  1884. },
  1885. enumerable: false
  1886. },
  1887. hexToAnsi256: {
  1888. value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
  1889. enumerable: false
  1890. },
  1891. ansi256ToAnsi: {
  1892. value: (code) => {
  1893. if (code < 8) {
  1894. return 30 + code;
  1895. }
  1896. if (code < 16) {
  1897. return 90 + (code - 8);
  1898. }
  1899. let red;
  1900. let green;
  1901. let blue;
  1902. if (code >= 232) {
  1903. red = ((code - 232) * 10 + 8) / 255;
  1904. green = red;
  1905. blue = red;
  1906. } else {
  1907. code -= 16;
  1908. const remainder = code % 36;
  1909. red = Math.floor(code / 36) / 5;
  1910. green = Math.floor(remainder / 6) / 5;
  1911. blue = remainder % 6 / 5;
  1912. }
  1913. const value = Math.max(red, green, blue) * 2;
  1914. if (value === 0) {
  1915. return 30;
  1916. }
  1917. let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
  1918. if (value === 2) {
  1919. result += 60;
  1920. }
  1921. return result;
  1922. },
  1923. enumerable: false
  1924. },
  1925. rgbToAnsi: {
  1926. value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
  1927. enumerable: false
  1928. },
  1929. hexToAnsi: {
  1930. value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
  1931. enumerable: false
  1932. }
  1933. });
  1934. return styles2;
  1935. }
  1936. var ANSI_BACKGROUND_OFFSET;
  1937. var wrapAnsi16;
  1938. var wrapAnsi256;
  1939. var wrapAnsi16m;
  1940. var ansiStyles;
  1941. var ansi_styles_default;
  1942. var init_ansi_styles = __esm({
  1943. "node_modules/chalk/source/vendor/ansi-styles/index.js"() {
  1944. ANSI_BACKGROUND_OFFSET = 10;
  1945. wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
  1946. wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
  1947. wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
  1948. ansiStyles = assembleStyles();
  1949. ansi_styles_default = ansiStyles;
  1950. }
  1951. });
  1952. function hasFlag(flag, argv = import_node_process.default.argv) {
  1953. const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
  1954. const position = argv.indexOf(prefix + flag);
  1955. const terminatorPosition = argv.indexOf("--");
  1956. return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
  1957. }
  1958. function envForceColor() {
  1959. if ("FORCE_COLOR" in env) {
  1960. if (env.FORCE_COLOR === "true") {
  1961. return 1;
  1962. }
  1963. if (env.FORCE_COLOR === "false") {
  1964. return 0;
  1965. }
  1966. return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
  1967. }
  1968. }
  1969. function translateLevel(level) {
  1970. if (level === 0) {
  1971. return false;
  1972. }
  1973. return {
  1974. level,
  1975. hasBasic: true,
  1976. has256: level >= 2,
  1977. has16m: level >= 3
  1978. };
  1979. }
  1980. function _supportsColor(haveStream, {
  1981. streamIsTTY,
  1982. sniffFlags = true
  1983. } = {}) {
  1984. const noFlagForceColor = envForceColor();
  1985. if (noFlagForceColor !== void 0) {
  1986. flagForceColor = noFlagForceColor;
  1987. }
  1988. const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
  1989. if (forceColor === 0) {
  1990. return 0;
  1991. }
  1992. if (sniffFlags) {
  1993. if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
  1994. return 3;
  1995. }
  1996. if (hasFlag("color=256")) {
  1997. return 2;
  1998. }
  1999. }
  2000. if (haveStream && !streamIsTTY && forceColor === void 0) {
  2001. return 0;
  2002. }
  2003. const min = forceColor || 0;
  2004. if (env.TERM === "dumb") {
  2005. return min;
  2006. }
  2007. if (import_node_process.default.platform === "win32") {
  2008. const osRelease = import_node_os.default.release().split(".");
  2009. if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
  2010. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  2011. }
  2012. return 1;
  2013. }
  2014. if ("CI" in env) {
  2015. if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
  2016. return 1;
  2017. }
  2018. return min;
  2019. }
  2020. if ("TEAMCITY_VERSION" in env) {
  2021. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  2022. }
  2023. if ("TF_BUILD" in env && "AGENT_NAME" in env) {
  2024. return 1;
  2025. }
  2026. if (env.COLORTERM === "truecolor") {
  2027. return 3;
  2028. }
  2029. if ("TERM_PROGRAM" in env) {
  2030. const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
  2031. switch (env.TERM_PROGRAM) {
  2032. case "iTerm.app":
  2033. return version >= 3 ? 3 : 2;
  2034. case "Apple_Terminal":
  2035. return 2;
  2036. }
  2037. }
  2038. if (/-256(color)?$/i.test(env.TERM)) {
  2039. return 2;
  2040. }
  2041. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  2042. return 1;
  2043. }
  2044. if ("COLORTERM" in env) {
  2045. return 1;
  2046. }
  2047. return min;
  2048. }
  2049. function createSupportsColor(stream, options = {}) {
  2050. const level = _supportsColor(stream, Object.assign({
  2051. streamIsTTY: stream && stream.isTTY
  2052. }, options));
  2053. return translateLevel(level);
  2054. }
  2055. var import_node_process;
  2056. var import_node_os;
  2057. var import_node_tty;
  2058. var env;
  2059. var flagForceColor;
  2060. var supportsColor;
  2061. var supports_color_default;
  2062. var init_supports_color = __esm({
  2063. "node_modules/chalk/source/vendor/supports-color/index.js"() {
  2064. import_node_process = __toESM(require("process"), 1);
  2065. import_node_os = __toESM(require("os"), 1);
  2066. import_node_tty = __toESM(require("tty"), 1);
  2067. ({
  2068. env
  2069. } = import_node_process.default);
  2070. if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
  2071. flagForceColor = 0;
  2072. } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
  2073. flagForceColor = 1;
  2074. }
  2075. supportsColor = {
  2076. stdout: createSupportsColor({
  2077. isTTY: import_node_tty.default.isatty(1)
  2078. }),
  2079. stderr: createSupportsColor({
  2080. isTTY: import_node_tty.default.isatty(2)
  2081. })
  2082. };
  2083. supports_color_default = supportsColor;
  2084. }
  2085. });
  2086. function stringReplaceAll(string, substring, replacer) {
  2087. let index = string.indexOf(substring);
  2088. if (index === -1) {
  2089. return string;
  2090. }
  2091. const substringLength = substring.length;
  2092. let endIndex = 0;
  2093. let returnValue = "";
  2094. do {
  2095. returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
  2096. endIndex = index + substringLength;
  2097. index = string.indexOf(substring, endIndex);
  2098. } while (index !== -1);
  2099. returnValue += string.slice(endIndex);
  2100. return returnValue;
  2101. }
  2102. function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
  2103. let endIndex = 0;
  2104. let returnValue = "";
  2105. do {
  2106. const gotCR = string[index - 1] === "\r";
  2107. returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
  2108. endIndex = index + 1;
  2109. index = string.indexOf("\n", endIndex);
  2110. } while (index !== -1);
  2111. returnValue += string.slice(endIndex);
  2112. return returnValue;
  2113. }
  2114. var init_utilities = __esm({
  2115. "node_modules/chalk/source/utilities.js"() {
  2116. }
  2117. });
  2118. var source_exports = {};
  2119. __export(source_exports, {
  2120. Chalk: () => Chalk,
  2121. chalkStderr: () => chalkStderr,
  2122. default: () => source_default,
  2123. supportsColor: () => stdoutColor,
  2124. supportsColorStderr: () => stderrColor
  2125. });
  2126. function createChalk(options) {
  2127. return chalkFactory(options);
  2128. }
  2129. var stdoutColor;
  2130. var stderrColor;
  2131. var GENERATOR;
  2132. var STYLER;
  2133. var IS_EMPTY;
  2134. var levelMapping;
  2135. var styles;
  2136. var applyOptions;
  2137. var Chalk;
  2138. var chalkFactory;
  2139. var getModelAnsi;
  2140. var usedModels;
  2141. var proto;
  2142. var createStyler;
  2143. var createBuilder;
  2144. var applyStyle;
  2145. var chalk;
  2146. var chalkStderr;
  2147. var source_default;
  2148. var init_source = __esm({
  2149. "node_modules/chalk/source/index.js"() {
  2150. init_ansi_styles();
  2151. init_supports_color();
  2152. init_utilities();
  2153. ({
  2154. stdout: stdoutColor,
  2155. stderr: stderrColor
  2156. } = supports_color_default);
  2157. GENERATOR = Symbol("GENERATOR");
  2158. STYLER = Symbol("STYLER");
  2159. IS_EMPTY = Symbol("IS_EMPTY");
  2160. levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
  2161. styles = /* @__PURE__ */ Object.create(null);
  2162. applyOptions = (object, options = {}) => {
  2163. if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
  2164. throw new Error("The `level` option should be an integer from 0 to 3");
  2165. }
  2166. const colorLevel = stdoutColor ? stdoutColor.level : 0;
  2167. object.level = options.level === void 0 ? colorLevel : options.level;
  2168. };
  2169. Chalk = class {
  2170. constructor(options) {
  2171. return chalkFactory(options);
  2172. }
  2173. };
  2174. chalkFactory = (options) => {
  2175. const chalk2 = (...strings) => strings.join(" ");
  2176. applyOptions(chalk2, options);
  2177. Object.setPrototypeOf(chalk2, createChalk.prototype);
  2178. return chalk2;
  2179. };
  2180. Object.setPrototypeOf(createChalk.prototype, Function.prototype);
  2181. for (const [styleName, style] of Object.entries(ansi_styles_default)) {
  2182. styles[styleName] = {
  2183. get() {
  2184. const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
  2185. Object.defineProperty(this, styleName, {
  2186. value: builder
  2187. });
  2188. return builder;
  2189. }
  2190. };
  2191. }
  2192. styles.visible = {
  2193. get() {
  2194. const builder = createBuilder(this, this[STYLER], true);
  2195. Object.defineProperty(this, "visible", {
  2196. value: builder
  2197. });
  2198. return builder;
  2199. }
  2200. };
  2201. getModelAnsi = (model, level, type, ...arguments_) => {
  2202. if (model === "rgb") {
  2203. if (level === "ansi16m") {
  2204. return ansi_styles_default[type].ansi16m(...arguments_);
  2205. }
  2206. if (level === "ansi256") {
  2207. return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
  2208. }
  2209. return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
  2210. }
  2211. if (model === "hex") {
  2212. return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
  2213. }
  2214. return ansi_styles_default[type][model](...arguments_);
  2215. };
  2216. usedModels = ["rgb", "hex", "ansi256"];
  2217. for (const model of usedModels) {
  2218. styles[model] = {
  2219. get() {
  2220. const {
  2221. level
  2222. } = this;
  2223. return function(...arguments_) {
  2224. const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
  2225. return createBuilder(this, styler, this[IS_EMPTY]);
  2226. };
  2227. }
  2228. };
  2229. const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
  2230. styles[bgModel] = {
  2231. get() {
  2232. const {
  2233. level
  2234. } = this;
  2235. return function(...arguments_) {
  2236. const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
  2237. return createBuilder(this, styler, this[IS_EMPTY]);
  2238. };
  2239. }
  2240. };
  2241. }
  2242. proto = Object.defineProperties(() => {
  2243. }, Object.assign(Object.assign({}, styles), {}, {
  2244. level: {
  2245. enumerable: true,
  2246. get() {
  2247. return this[GENERATOR].level;
  2248. },
  2249. set(level) {
  2250. this[GENERATOR].level = level;
  2251. }
  2252. }
  2253. }));
  2254. createStyler = (open, close, parent) => {
  2255. let openAll;
  2256. let closeAll;
  2257. if (parent === void 0) {
  2258. openAll = open;
  2259. closeAll = close;
  2260. } else {
  2261. openAll = parent.openAll + open;
  2262. closeAll = close + parent.closeAll;
  2263. }
  2264. return {
  2265. open,
  2266. close,
  2267. openAll,
  2268. closeAll,
  2269. parent
  2270. };
  2271. };
  2272. createBuilder = (self2, _styler, _isEmpty) => {
  2273. const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
  2274. Object.setPrototypeOf(builder, proto);
  2275. builder[GENERATOR] = self2;
  2276. builder[STYLER] = _styler;
  2277. builder[IS_EMPTY] = _isEmpty;
  2278. return builder;
  2279. };
  2280. applyStyle = (self2, string) => {
  2281. if (self2.level <= 0 || !string) {
  2282. return self2[IS_EMPTY] ? "" : string;
  2283. }
  2284. let styler = self2[STYLER];
  2285. if (styler === void 0) {
  2286. return string;
  2287. }
  2288. const {
  2289. openAll,
  2290. closeAll
  2291. } = styler;
  2292. if (string.includes("\x1B")) {
  2293. while (styler !== void 0) {
  2294. string = stringReplaceAll(string, styler.close, styler.open);
  2295. styler = styler.parent;
  2296. }
  2297. }
  2298. const lfIndex = string.indexOf("\n");
  2299. if (lfIndex !== -1) {
  2300. string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
  2301. }
  2302. return openAll + string + closeAll;
  2303. };
  2304. Object.defineProperties(createChalk.prototype, styles);
  2305. chalk = createChalk();
  2306. chalkStderr = createChalk({
  2307. level: stderrColor ? stderrColor.level : 0
  2308. });
  2309. source_default = chalk;
  2310. }
  2311. });
  2312. var require_logger = __commonJS2({
  2313. "src/cli/logger.js"(exports2, module2) {
  2314. "use strict";
  2315. var readline = require("readline");
  2316. var wcwidth = require_wcwidth();
  2317. var {
  2318. default: stripAnsi2
  2319. } = (init_strip_ansi(), __toCommonJS(strip_ansi_exports));
  2320. var {
  2321. default: chalk2
  2322. } = (init_source(), __toCommonJS(source_exports));
  2323. var countLines = (stream, text) => {
  2324. const columns = stream.columns || 80;
  2325. let lineCount = 0;
  2326. for (const line of stripAnsi2(text).split("\n")) {
  2327. lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
  2328. }
  2329. return lineCount;
  2330. };
  2331. var clear = (stream, text) => () => {
  2332. const lineCount = countLines(stream, text);
  2333. for (let line = 0; line < lineCount; line++) {
  2334. if (line > 0) {
  2335. readline.moveCursor(stream, 0, -1);
  2336. }
  2337. readline.clearLine(stream, 0);
  2338. readline.cursorTo(stream, 0);
  2339. }
  2340. };
  2341. var emptyLogResult = {
  2342. clear() {
  2343. }
  2344. };
  2345. function createLogger2(logLevel = "log") {
  2346. return {
  2347. logLevel,
  2348. warn: createLogFunc("warn", "yellow"),
  2349. error: createLogFunc("error", "red"),
  2350. debug: createLogFunc("debug", "blue"),
  2351. log: createLogFunc("log")
  2352. };
  2353. function createLogFunc(loggerName, color) {
  2354. if (!shouldLog(loggerName)) {
  2355. return () => emptyLogResult;
  2356. }
  2357. const prefix = color ? `[${chalk2[color](loggerName)}] ` : "";
  2358. const stream = process[loggerName === "log" ? "stdout" : "stderr"];
  2359. return (message, options) => {
  2360. options = Object.assign({
  2361. newline: true,
  2362. clearable: false
  2363. }, options);
  2364. message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
  2365. stream.write(message);
  2366. if (options.clearable) {
  2367. return {
  2368. clear: clear(stream, message)
  2369. };
  2370. }
  2371. };
  2372. }
  2373. function shouldLog(loggerName) {
  2374. switch (logLevel) {
  2375. case "silent":
  2376. return false;
  2377. case "debug":
  2378. if (loggerName === "debug") {
  2379. return true;
  2380. }
  2381. case "log":
  2382. if (loggerName === "log") {
  2383. return true;
  2384. }
  2385. case "warn":
  2386. if (loggerName === "warn") {
  2387. return true;
  2388. }
  2389. case "error":
  2390. return loggerName === "error";
  2391. }
  2392. }
  2393. }
  2394. module2.exports = createLogger2;
  2395. }
  2396. });
  2397. var require_prettier_internal = __commonJS2({
  2398. "src/cli/prettier-internal.js"(exports2, module2) {
  2399. "use strict";
  2400. module2.exports = require("./index.js").__internal;
  2401. }
  2402. });
  2403. var require_lib = __commonJS2({
  2404. "node_modules/outdent/lib/index.js"(exports2, module2) {
  2405. "use strict";
  2406. Object.defineProperty(exports2, "__esModule", {
  2407. value: true
  2408. });
  2409. exports2.outdent = void 0;
  2410. function noop() {
  2411. var args = [];
  2412. for (var _i = 0; _i < arguments.length; _i++) {
  2413. args[_i] = arguments[_i];
  2414. }
  2415. }
  2416. function createWeakMap() {
  2417. if (typeof WeakMap !== "undefined") {
  2418. return /* @__PURE__ */ new WeakMap();
  2419. } else {
  2420. return fakeSetOrMap();
  2421. }
  2422. }
  2423. function fakeSetOrMap() {
  2424. return {
  2425. add: noop,
  2426. delete: noop,
  2427. get: noop,
  2428. set: noop,
  2429. has: function(k) {
  2430. return false;
  2431. }
  2432. };
  2433. }
  2434. var hop = Object.prototype.hasOwnProperty;
  2435. var has = function(obj, prop) {
  2436. return hop.call(obj, prop);
  2437. };
  2438. function extend(target, source) {
  2439. for (var prop in source) {
  2440. if (has(source, prop)) {
  2441. target[prop] = source[prop];
  2442. }
  2443. }
  2444. return target;
  2445. }
  2446. var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
  2447. var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
  2448. var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
  2449. var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
  2450. var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
  2451. function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
  2452. var indentationLevel = 0;
  2453. var match = strings[0].match(reDetectIndentation);
  2454. if (match) {
  2455. indentationLevel = match[1].length;
  2456. }
  2457. var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
  2458. var reMatchIndent = new RegExp(reSource, "g");
  2459. if (firstInterpolatedValueSetsIndentationLevel) {
  2460. strings = strings.slice(1);
  2461. }
  2462. var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
  2463. var normalizeNewlines = typeof newline === "string";
  2464. var l = strings.length;
  2465. var outdentedStrings = strings.map(function(v, i) {
  2466. v = v.replace(reMatchIndent, "$1");
  2467. if (i === 0 && trimLeadingNewline) {
  2468. v = v.replace(reLeadingNewline, "");
  2469. }
  2470. if (i === l - 1 && trimTrailingNewline) {
  2471. v = v.replace(reTrailingNewline, "");
  2472. }
  2473. if (normalizeNewlines) {
  2474. v = v.replace(/\r\n|\n|\r/g, function(_) {
  2475. return newline;
  2476. });
  2477. }
  2478. return v;
  2479. });
  2480. return outdentedStrings;
  2481. }
  2482. function concatStringsAndValues(strings, values) {
  2483. var ret = "";
  2484. for (var i = 0, l = strings.length; i < l; i++) {
  2485. ret += strings[i];
  2486. if (i < l - 1) {
  2487. ret += values[i];
  2488. }
  2489. }
  2490. return ret;
  2491. }
  2492. function isTemplateStringsArray(v) {
  2493. return has(v, "raw") && has(v, "length");
  2494. }
  2495. function createInstance(options) {
  2496. var arrayAutoIndentCache = createWeakMap();
  2497. var arrayFirstInterpSetsIndentCache = createWeakMap();
  2498. function outdent(stringsOrOptions) {
  2499. var values = [];
  2500. for (var _i = 1; _i < arguments.length; _i++) {
  2501. values[_i - 1] = arguments[_i];
  2502. }
  2503. if (isTemplateStringsArray(stringsOrOptions)) {
  2504. var strings = stringsOrOptions;
  2505. var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
  2506. var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
  2507. var renderedArray = cache.get(strings);
  2508. if (!renderedArray) {
  2509. renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
  2510. cache.set(strings, renderedArray);
  2511. }
  2512. if (values.length === 0) {
  2513. return renderedArray[0];
  2514. }
  2515. var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
  2516. return rendered;
  2517. } else {
  2518. return createInstance(extend(extend({}, options), stringsOrOptions || {}));
  2519. }
  2520. }
  2521. var fullOutdent = extend(outdent, {
  2522. string: function(str) {
  2523. return _outdentArray([str], false, options)[0];
  2524. }
  2525. });
  2526. return fullOutdent;
  2527. }
  2528. var defaultOutdent = createInstance({
  2529. trimLeadingNewline: true,
  2530. trimTrailingNewline: true
  2531. });
  2532. exports2.outdent = defaultOutdent;
  2533. exports2.default = defaultOutdent;
  2534. if (typeof module2 !== "undefined") {
  2535. try {
  2536. module2.exports = defaultOutdent;
  2537. Object.defineProperty(defaultOutdent, "__esModule", {
  2538. value: true
  2539. });
  2540. defaultOutdent.default = defaultOutdent;
  2541. defaultOutdent.outdent = defaultOutdent;
  2542. } catch (e) {
  2543. }
  2544. }
  2545. }
  2546. });
  2547. var require_constant = __commonJS2({
  2548. "src/cli/constant.js"(exports2, module2) {
  2549. "use strict";
  2550. var {
  2551. outdent
  2552. } = require_lib();
  2553. var {
  2554. coreOptions
  2555. } = require_prettier_internal();
  2556. var categoryOrder = [coreOptions.CATEGORY_OUTPUT, coreOptions.CATEGORY_FORMAT, coreOptions.CATEGORY_CONFIG, coreOptions.CATEGORY_EDITOR, coreOptions.CATEGORY_OTHER];
  2557. var options = {
  2558. cache: {
  2559. default: false,
  2560. description: "Only format changed files. Cannot use with --stdin-filepath.",
  2561. type: "boolean"
  2562. },
  2563. "cache-strategy": {
  2564. choices: [{
  2565. description: "Use the file metadata such as timestamps as cache keys",
  2566. value: "metadata"
  2567. }, {
  2568. description: "Use the file content as cache keys",
  2569. value: "content"
  2570. }],
  2571. description: "Strategy for the cache to use for detecting changed files.",
  2572. type: "choice"
  2573. },
  2574. check: {
  2575. alias: "c",
  2576. category: coreOptions.CATEGORY_OUTPUT,
  2577. description: outdent`
  2578. Check if the given files are formatted, print a human-friendly summary
  2579. message and paths to unformatted files (see also --list-different).
  2580. `,
  2581. type: "boolean"
  2582. },
  2583. color: {
  2584. default: true,
  2585. description: "Colorize error messages.",
  2586. oppositeDescription: "Do not colorize error messages.",
  2587. type: "boolean"
  2588. },
  2589. config: {
  2590. category: coreOptions.CATEGORY_CONFIG,
  2591. description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
  2592. exception: (value) => value === false,
  2593. oppositeDescription: "Do not look for a configuration file.",
  2594. type: "path"
  2595. },
  2596. "config-precedence": {
  2597. category: coreOptions.CATEGORY_CONFIG,
  2598. choices: [{
  2599. description: "CLI options take precedence over config file",
  2600. value: "cli-override"
  2601. }, {
  2602. description: "Config file take precedence over CLI options",
  2603. value: "file-override"
  2604. }, {
  2605. description: outdent`
  2606. If a config file is found will evaluate it and ignore other CLI options.
  2607. If no config file is found CLI options will evaluate as normal.
  2608. `,
  2609. value: "prefer-file"
  2610. }],
  2611. default: "cli-override",
  2612. description: "Define in which order config files and CLI options should be evaluated.",
  2613. type: "choice"
  2614. },
  2615. "debug-benchmark": {
  2616. type: "boolean"
  2617. },
  2618. "debug-check": {
  2619. type: "boolean"
  2620. },
  2621. "debug-print-ast": {
  2622. type: "boolean"
  2623. },
  2624. "debug-print-comments": {
  2625. type: "boolean"
  2626. },
  2627. "debug-print-doc": {
  2628. type: "boolean"
  2629. },
  2630. "debug-repeat": {
  2631. default: 0,
  2632. type: "int"
  2633. },
  2634. editorconfig: {
  2635. category: coreOptions.CATEGORY_CONFIG,
  2636. default: true,
  2637. description: "Take .editorconfig into account when parsing configuration.",
  2638. oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
  2639. type: "boolean"
  2640. },
  2641. "error-on-unmatched-pattern": {
  2642. oppositeDescription: "Prevent errors when pattern is unmatched.",
  2643. type: "boolean"
  2644. },
  2645. "file-info": {
  2646. description: outdent`
  2647. Extract the following info (as JSON) for a given file path. Reported fields:
  2648. * ignored (boolean) - true if file path is filtered by --ignore-path
  2649. * inferredParser (string | null) - name of parser inferred from file path
  2650. `,
  2651. type: "path"
  2652. },
  2653. "find-config-path": {
  2654. category: coreOptions.CATEGORY_CONFIG,
  2655. description: "Find and print the path to a configuration file for the given input file.",
  2656. type: "path"
  2657. },
  2658. help: {
  2659. alias: "h",
  2660. description: outdent`
  2661. Show CLI usage, or details about the given flag.
  2662. Example: --help write
  2663. `,
  2664. exception: (value) => value === "",
  2665. type: "flag"
  2666. },
  2667. "ignore-path": {
  2668. category: coreOptions.CATEGORY_CONFIG,
  2669. default: ".prettierignore",
  2670. description: "Path to a file with patterns describing files to ignore.",
  2671. type: "path"
  2672. },
  2673. "ignore-unknown": {
  2674. alias: "u",
  2675. description: "Ignore unknown files.",
  2676. type: "boolean"
  2677. },
  2678. "list-different": {
  2679. alias: "l",
  2680. category: coreOptions.CATEGORY_OUTPUT,
  2681. description: "Print the names of files that are different from Prettier's formatting (see also --check).",
  2682. type: "boolean"
  2683. },
  2684. loglevel: {
  2685. choices: ["silent", "error", "warn", "log", "debug"],
  2686. default: "log",
  2687. description: "What level of logs to report.",
  2688. type: "choice"
  2689. },
  2690. "plugin-search": {
  2691. oppositeDescription: "Disable plugin autoloading.",
  2692. type: "boolean"
  2693. },
  2694. "support-info": {
  2695. description: "Print support information as JSON.",
  2696. type: "boolean"
  2697. },
  2698. version: {
  2699. alias: "v",
  2700. description: "Print Prettier version.",
  2701. type: "boolean"
  2702. },
  2703. "with-node-modules": {
  2704. category: coreOptions.CATEGORY_CONFIG,
  2705. description: "Process files inside 'node_modules' directory.",
  2706. type: "boolean"
  2707. },
  2708. write: {
  2709. alias: "w",
  2710. category: coreOptions.CATEGORY_OUTPUT,
  2711. description: "Edit files in-place. (Beware!)",
  2712. type: "boolean"
  2713. }
  2714. };
  2715. var usageSummary = outdent`
  2716. Usage: prettier [options] [file/dir/glob ...]
  2717. By default, output is written to stdout.
  2718. Stdin is read if it is piped to Prettier and no files are given.
  2719. `;
  2720. module2.exports = {
  2721. categoryOrder,
  2722. options,
  2723. usageSummary
  2724. };
  2725. }
  2726. });
  2727. var require_dashify = __commonJS2({
  2728. "node_modules/dashify/index.js"(exports2, module2) {
  2729. "use strict";
  2730. module2.exports = (str, options) => {
  2731. if (typeof str !== "string")
  2732. throw new TypeError("expected a string");
  2733. 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();
  2734. };
  2735. }
  2736. });
  2737. var require_option_map = __commonJS2({
  2738. "src/cli/options/option-map.js"(exports2, module2) {
  2739. "use strict";
  2740. var dashify = require_dashify();
  2741. var {
  2742. coreOptions
  2743. } = require_prettier_internal();
  2744. function normalizeDetailedOption(name, option) {
  2745. return Object.assign(Object.assign({
  2746. category: coreOptions.CATEGORY_OTHER
  2747. }, option), {}, {
  2748. choices: option.choices && option.choices.map((choice) => {
  2749. const newChoice = Object.assign({
  2750. description: "",
  2751. deprecated: false
  2752. }, typeof choice === "object" ? choice : {
  2753. value: choice
  2754. });
  2755. if (newChoice.value === true) {
  2756. newChoice.value = "";
  2757. }
  2758. return newChoice;
  2759. })
  2760. });
  2761. }
  2762. function normalizeDetailedOptionMap(detailedOptionMap) {
  2763. return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
  2764. }
  2765. function createDetailedOptionMap(supportOptions) {
  2766. return Object.fromEntries(supportOptions.map((option) => {
  2767. const newOption = Object.assign(Object.assign({}, option), {}, {
  2768. name: option.cliName || dashify(option.name),
  2769. description: option.cliDescription || option.description,
  2770. category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
  2771. forwardToApi: option.name
  2772. });
  2773. if (option.deprecated) {
  2774. delete newOption.forwardToApi;
  2775. delete newOption.description;
  2776. delete newOption.oppositeDescription;
  2777. newOption.deprecated = true;
  2778. }
  2779. return [newOption.name, newOption];
  2780. }));
  2781. }
  2782. module2.exports = {
  2783. normalizeDetailedOptionMap,
  2784. createDetailedOptionMap
  2785. };
  2786. }
  2787. });
  2788. var require_get_context_options = __commonJS2({
  2789. "src/cli/options/get-context-options.js"(exports2, module2) {
  2790. "use strict";
  2791. var prettier2 = require("./index.js");
  2792. var {
  2793. optionsModule,
  2794. utils: {
  2795. arrayify
  2796. }
  2797. } = require_prettier_internal();
  2798. var constant = require_constant();
  2799. var {
  2800. normalizeDetailedOptionMap,
  2801. createDetailedOptionMap
  2802. } = require_option_map();
  2803. function getContextOptions(plugins, pluginSearchDirs) {
  2804. const {
  2805. options: supportOptions,
  2806. languages
  2807. } = prettier2.getSupportInfo({
  2808. showDeprecated: true,
  2809. showUnreleased: true,
  2810. showInternal: true,
  2811. plugins,
  2812. pluginSearchDirs
  2813. });
  2814. const detailedOptionMap = normalizeDetailedOptionMap(Object.assign(Object.assign({}, createDetailedOptionMap(supportOptions)), constant.options));
  2815. const detailedOptions = arrayify(detailedOptionMap, "name");
  2816. const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
  2817. deprecated
  2818. }) => !deprecated).map((option) => [option.name, option.default])));
  2819. return {
  2820. supportOptions,
  2821. detailedOptions,
  2822. detailedOptionMap,
  2823. apiDefaultOptions,
  2824. languages
  2825. };
  2826. }
  2827. module2.exports = getContextOptions;
  2828. }
  2829. });
  2830. var require_camelcase = __commonJS2({
  2831. "node_modules/camelcase/index.js"(exports2, module2) {
  2832. "use strict";
  2833. var UPPERCASE = /[\p{Lu}]/u;
  2834. var LOWERCASE = /[\p{Ll}]/u;
  2835. var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
  2836. var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
  2837. var SEPARATORS = /[_.\- ]+/;
  2838. var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
  2839. var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
  2840. var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
  2841. var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
  2842. let isLastCharLower = false;
  2843. let isLastCharUpper = false;
  2844. let isLastLastCharUpper = false;
  2845. for (let i = 0; i < string.length; i++) {
  2846. const character = string[i];
  2847. if (isLastCharLower && UPPERCASE.test(character)) {
  2848. string = string.slice(0, i) + "-" + string.slice(i);
  2849. isLastCharLower = false;
  2850. isLastLastCharUpper = isLastCharUpper;
  2851. isLastCharUpper = true;
  2852. i++;
  2853. } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
  2854. string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
  2855. isLastLastCharUpper = isLastCharUpper;
  2856. isLastCharUpper = false;
  2857. isLastCharLower = true;
  2858. } else {
  2859. isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
  2860. isLastLastCharUpper = isLastCharUpper;
  2861. isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
  2862. }
  2863. }
  2864. return string;
  2865. };
  2866. var preserveConsecutiveUppercase = (input, toLowerCase) => {
  2867. LEADING_CAPITAL.lastIndex = 0;
  2868. return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
  2869. };
  2870. var postProcess = (input, toUpperCase) => {
  2871. SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
  2872. NUMBERS_AND_IDENTIFIER.lastIndex = 0;
  2873. return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
  2874. };
  2875. var camelCase = (input, options) => {
  2876. if (!(typeof input === "string" || Array.isArray(input))) {
  2877. throw new TypeError("Expected the input to be `string | string[]`");
  2878. }
  2879. options = Object.assign({
  2880. pascalCase: false,
  2881. preserveConsecutiveUppercase: false
  2882. }, options);
  2883. if (Array.isArray(input)) {
  2884. input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
  2885. } else {
  2886. input = input.trim();
  2887. }
  2888. if (input.length === 0) {
  2889. return "";
  2890. }
  2891. const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
  2892. const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
  2893. if (input.length === 1) {
  2894. return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
  2895. }
  2896. const hasUpperCase = input !== toLowerCase(input);
  2897. if (hasUpperCase) {
  2898. input = preserveCamelCase(input, toLowerCase, toUpperCase);
  2899. }
  2900. input = input.replace(LEADING_SEPARATORS, "");
  2901. if (options.preserveConsecutiveUppercase) {
  2902. input = preserveConsecutiveUppercase(input, toLowerCase);
  2903. } else {
  2904. input = toLowerCase(input);
  2905. }
  2906. if (options.pascalCase) {
  2907. input = toUpperCase(input.charAt(0)) + input.slice(1);
  2908. }
  2909. return postProcess(input, toUpperCase);
  2910. };
  2911. module2.exports = camelCase;
  2912. module2.exports.default = camelCase;
  2913. }
  2914. });
  2915. var sdbm_exports = {};
  2916. __export(sdbm_exports, {
  2917. default: () => sdbm
  2918. });
  2919. function sdbm(string) {
  2920. let hash = 0;
  2921. for (let i = 0; i < string.length; i++) {
  2922. hash = string.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
  2923. }
  2924. return hash >>> 0;
  2925. }
  2926. var init_sdbm = __esm({
  2927. "node_modules/sdbm/index.js"() {
  2928. }
  2929. });
  2930. var require_utils = __commonJS2({
  2931. "src/cli/utils.js"(exports2, module2) {
  2932. "use strict";
  2933. var {
  2934. promises: fs
  2935. } = require("fs");
  2936. var {
  2937. default: sdbm2
  2938. } = (init_sdbm(), __toCommonJS(sdbm_exports));
  2939. var printToScreen2 = console.log.bind(console);
  2940. function groupBy(array2, iteratee) {
  2941. const result = /* @__PURE__ */ Object.create(null);
  2942. for (const value of array2) {
  2943. const key = iteratee(value);
  2944. if (Array.isArray(result[key])) {
  2945. result[key].push(value);
  2946. } else {
  2947. result[key] = [value];
  2948. }
  2949. }
  2950. return result;
  2951. }
  2952. function pick(object, keys) {
  2953. const entries = keys.map((key) => [key, object[key]]);
  2954. return Object.fromEntries(entries);
  2955. }
  2956. function createHash(source) {
  2957. return String(sdbm2(source));
  2958. }
  2959. async function statSafe(filePath) {
  2960. try {
  2961. return await fs.stat(filePath);
  2962. } catch (error) {
  2963. if (error.code !== "ENOENT") {
  2964. throw error;
  2965. }
  2966. }
  2967. }
  2968. module2.exports = {
  2969. printToScreen: printToScreen2,
  2970. groupBy,
  2971. pick,
  2972. createHash,
  2973. statSafe
  2974. };
  2975. }
  2976. });
  2977. var require_minimist = __commonJS2({
  2978. "node_modules/minimist/index.js"(exports2, module2) {
  2979. module2.exports = function(args, opts) {
  2980. if (!opts)
  2981. opts = {};
  2982. var flags = {
  2983. bools: {},
  2984. strings: {},
  2985. unknownFn: null
  2986. };
  2987. if (typeof opts["unknown"] === "function") {
  2988. flags.unknownFn = opts["unknown"];
  2989. }
  2990. if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
  2991. flags.allBools = true;
  2992. } else {
  2993. [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
  2994. flags.bools[key2] = true;
  2995. });
  2996. }
  2997. var aliases = {};
  2998. Object.keys(opts.alias || {}).forEach(function(key2) {
  2999. aliases[key2] = [].concat(opts.alias[key2]);
  3000. aliases[key2].forEach(function(x) {
  3001. aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
  3002. return x !== y;
  3003. }));
  3004. });
  3005. });
  3006. [].concat(opts.string).filter(Boolean).forEach(function(key2) {
  3007. flags.strings[key2] = true;
  3008. if (aliases[key2]) {
  3009. flags.strings[aliases[key2]] = true;
  3010. }
  3011. });
  3012. var defaults = opts["default"] || {};
  3013. var argv = {
  3014. _: []
  3015. };
  3016. Object.keys(flags.bools).forEach(function(key2) {
  3017. setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
  3018. });
  3019. var notFlags = [];
  3020. if (args.indexOf("--") !== -1) {
  3021. notFlags = args.slice(args.indexOf("--") + 1);
  3022. args = args.slice(0, args.indexOf("--"));
  3023. }
  3024. function argDefined(key2, arg2) {
  3025. return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
  3026. }
  3027. function setArg(key2, val, arg2) {
  3028. if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
  3029. if (flags.unknownFn(arg2) === false)
  3030. return;
  3031. }
  3032. var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
  3033. setKey(argv, key2.split("."), value2);
  3034. (aliases[key2] || []).forEach(function(x) {
  3035. setKey(argv, x.split("."), value2);
  3036. });
  3037. }
  3038. function setKey(obj, keys, value2) {
  3039. var o = obj;
  3040. for (var i2 = 0; i2 < keys.length - 1; i2++) {
  3041. var key2 = keys[i2];
  3042. if (isConstructorOrProto(o, key2))
  3043. return;
  3044. if (o[key2] === void 0)
  3045. o[key2] = {};
  3046. if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
  3047. o[key2] = {};
  3048. if (o[key2] === Array.prototype)
  3049. o[key2] = [];
  3050. o = o[key2];
  3051. }
  3052. var key2 = keys[keys.length - 1];
  3053. if (isConstructorOrProto(o, key2))
  3054. return;
  3055. if (o === Object.prototype || o === Number.prototype || o === String.prototype)
  3056. o = {};
  3057. if (o === Array.prototype)
  3058. o = [];
  3059. if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
  3060. o[key2] = value2;
  3061. } else if (Array.isArray(o[key2])) {
  3062. o[key2].push(value2);
  3063. } else {
  3064. o[key2] = [o[key2], value2];
  3065. }
  3066. }
  3067. function aliasIsBoolean(key2) {
  3068. return aliases[key2].some(function(x) {
  3069. return flags.bools[x];
  3070. });
  3071. }
  3072. for (var i = 0; i < args.length; i++) {
  3073. var arg = args[i];
  3074. if (/^--.+=/.test(arg)) {
  3075. var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
  3076. var key = m[1];
  3077. var value = m[2];
  3078. if (flags.bools[key]) {
  3079. value = value !== "false";
  3080. }
  3081. setArg(key, value, arg);
  3082. } else if (/^--no-.+/.test(arg)) {
  3083. var key = arg.match(/^--no-(.+)/)[1];
  3084. setArg(key, false, arg);
  3085. } else if (/^--.+/.test(arg)) {
  3086. var key = arg.match(/^--(.+)/)[1];
  3087. var next = args[i + 1];
  3088. if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3089. setArg(key, next, arg);
  3090. i++;
  3091. } else if (/^(true|false)$/.test(next)) {
  3092. setArg(key, next === "true", arg);
  3093. i++;
  3094. } else {
  3095. setArg(key, flags.strings[key] ? "" : true, arg);
  3096. }
  3097. } else if (/^-[^-]+/.test(arg)) {
  3098. var letters = arg.slice(1, -1).split("");
  3099. var broken = false;
  3100. for (var j = 0; j < letters.length; j++) {
  3101. var next = arg.slice(j + 2);
  3102. if (next === "-") {
  3103. setArg(letters[j], next, arg);
  3104. continue;
  3105. }
  3106. if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
  3107. setArg(letters[j], next.split("=")[1], arg);
  3108. broken = true;
  3109. break;
  3110. }
  3111. if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
  3112. setArg(letters[j], next, arg);
  3113. broken = true;
  3114. break;
  3115. }
  3116. if (letters[j + 1] && letters[j + 1].match(/\W/)) {
  3117. setArg(letters[j], arg.slice(j + 2), arg);
  3118. broken = true;
  3119. break;
  3120. } else {
  3121. setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
  3122. }
  3123. }
  3124. var key = arg.slice(-1)[0];
  3125. if (!broken && key !== "-") {
  3126. if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3127. setArg(key, args[i + 1], arg);
  3128. i++;
  3129. } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
  3130. setArg(key, args[i + 1] === "true", arg);
  3131. i++;
  3132. } else {
  3133. setArg(key, flags.strings[key] ? "" : true, arg);
  3134. }
  3135. }
  3136. } else {
  3137. if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
  3138. argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
  3139. }
  3140. if (opts.stopEarly) {
  3141. argv._.push.apply(argv._, args.slice(i + 1));
  3142. break;
  3143. }
  3144. }
  3145. }
  3146. Object.keys(defaults).forEach(function(key2) {
  3147. if (!hasKey(argv, key2.split("."))) {
  3148. setKey(argv, key2.split("."), defaults[key2]);
  3149. (aliases[key2] || []).forEach(function(x) {
  3150. setKey(argv, x.split("."), defaults[key2]);
  3151. });
  3152. }
  3153. });
  3154. if (opts["--"]) {
  3155. argv["--"] = new Array();
  3156. notFlags.forEach(function(key2) {
  3157. argv["--"].push(key2);
  3158. });
  3159. } else {
  3160. notFlags.forEach(function(key2) {
  3161. argv._.push(key2);
  3162. });
  3163. }
  3164. return argv;
  3165. };
  3166. function hasKey(obj, keys) {
  3167. var o = obj;
  3168. keys.slice(0, -1).forEach(function(key2) {
  3169. o = o[key2] || {};
  3170. });
  3171. var key = keys[keys.length - 1];
  3172. return key in o;
  3173. }
  3174. function isNumber(x) {
  3175. if (typeof x === "number")
  3176. return true;
  3177. if (/^0x[0-9a-f]+$/i.test(x))
  3178. return true;
  3179. return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
  3180. }
  3181. function isConstructorOrProto(obj, key) {
  3182. return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
  3183. }
  3184. }
  3185. });
  3186. var require_minimist2 = __commonJS2({
  3187. "src/cli/options/minimist.js"(exports2, module2) {
  3188. "use strict";
  3189. var minimist = require_minimist();
  3190. var PLACEHOLDER = null;
  3191. module2.exports = function(args, options) {
  3192. const boolean = options.boolean || [];
  3193. const defaults = options.default || {};
  3194. const booleanWithoutDefault = boolean.filter((key) => !(key in defaults));
  3195. const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map((key) => [key, PLACEHOLDER])));
  3196. const parsed = minimist(args, Object.assign(Object.assign({}, options), {}, {
  3197. default: newDefaults
  3198. }));
  3199. return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
  3200. };
  3201. }
  3202. });
  3203. var require_create_minimist_options = __commonJS2({
  3204. "src/cli/options/create-minimist-options.js"(exports2, module2) {
  3205. "use strict";
  3206. var {
  3207. utils: {
  3208. partition
  3209. }
  3210. } = require_prettier_internal();
  3211. module2.exports = function createMinimistOptions(detailedOptions) {
  3212. const [boolean, string] = partition(detailedOptions, ({
  3213. type
  3214. }) => type === "boolean").map((detailedOptions2) => detailedOptions2.flatMap(({
  3215. name,
  3216. alias
  3217. }) => alias ? [name, alias] : [name]));
  3218. 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]));
  3219. return {
  3220. alias: {},
  3221. boolean,
  3222. string,
  3223. default: defaults
  3224. };
  3225. };
  3226. }
  3227. });
  3228. var leven_exports = {};
  3229. __export(leven_exports, {
  3230. default: () => leven
  3231. });
  3232. function leven(first, second) {
  3233. if (first === second) {
  3234. return 0;
  3235. }
  3236. const swap = first;
  3237. if (first.length > second.length) {
  3238. first = second;
  3239. second = swap;
  3240. }
  3241. let firstLength = first.length;
  3242. let secondLength = second.length;
  3243. while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
  3244. firstLength--;
  3245. secondLength--;
  3246. }
  3247. let start = 0;
  3248. while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
  3249. start++;
  3250. }
  3251. firstLength -= start;
  3252. secondLength -= start;
  3253. if (firstLength === 0) {
  3254. return secondLength;
  3255. }
  3256. let bCharacterCode;
  3257. let result;
  3258. let temporary;
  3259. let temporary2;
  3260. let index = 0;
  3261. let index2 = 0;
  3262. while (index < firstLength) {
  3263. characterCodeCache[index] = first.charCodeAt(start + index);
  3264. array[index] = ++index;
  3265. }
  3266. while (index2 < secondLength) {
  3267. bCharacterCode = second.charCodeAt(start + index2);
  3268. temporary = index2++;
  3269. result = index2;
  3270. for (index = 0; index < firstLength; index++) {
  3271. temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
  3272. temporary = array[index];
  3273. result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
  3274. }
  3275. }
  3276. return result;
  3277. }
  3278. var array;
  3279. var characterCodeCache;
  3280. var init_leven = __esm({
  3281. "node_modules/leven/index.js"() {
  3282. array = [];
  3283. characterCodeCache = [];
  3284. }
  3285. });
  3286. var require_normalize_cli_options = __commonJS2({
  3287. "src/cli/options/normalize-cli-options.js"(exports2, module2) {
  3288. "use strict";
  3289. var {
  3290. default: chalk2
  3291. } = (init_source(), __toCommonJS(source_exports));
  3292. var {
  3293. default: leven2
  3294. } = (init_leven(), __toCommonJS(leven_exports));
  3295. var {
  3296. optionsNormalizer
  3297. } = require_prettier_internal();
  3298. function normalizeCliOptions(options, optionInfos, opts) {
  3299. return optionsNormalizer.normalizeCliOptions(options, optionInfos, Object.assign({
  3300. colorsModule: chalk2,
  3301. levenshteinDistance: leven2
  3302. }, opts));
  3303. }
  3304. module2.exports = normalizeCliOptions;
  3305. }
  3306. });
  3307. var require_parse_cli_arguments = __commonJS2({
  3308. "src/cli/options/parse-cli-arguments.js"(exports2, module2) {
  3309. "use strict";
  3310. var camelCase = require_camelcase();
  3311. var {
  3312. pick
  3313. } = require_utils();
  3314. var getContextOptions = require_get_context_options();
  3315. var minimist = require_minimist2();
  3316. var createMinimistOptions = require_create_minimist_options();
  3317. var normalizeCliOptions = require_normalize_cli_options();
  3318. function parseArgv(rawArguments, detailedOptions, logger, keys) {
  3319. const minimistOptions = createMinimistOptions(detailedOptions);
  3320. let argv = minimist(rawArguments, minimistOptions);
  3321. if (keys) {
  3322. if (keys.includes("plugin-search-dir") && !keys.includes("plugin-search")) {
  3323. keys.push("plugin-search");
  3324. }
  3325. detailedOptions = detailedOptions.filter((option) => keys.includes(option.name));
  3326. argv = pick(argv, keys);
  3327. }
  3328. const normalized = normalizeCliOptions(argv, detailedOptions, {
  3329. logger
  3330. });
  3331. return Object.assign(Object.assign({}, Object.fromEntries(Object.entries(normalized).map(([key, value]) => {
  3332. const option = detailedOptions.find(({
  3333. name
  3334. }) => name === key) || {};
  3335. return [option.forwardToApi || camelCase(key), value];
  3336. }))), {}, {
  3337. get __raw() {
  3338. return argv;
  3339. }
  3340. });
  3341. }
  3342. var detailedOptionsWithoutPlugins = getContextOptions([], false).detailedOptions;
  3343. function parseArgvWithoutPlugins2(rawArguments, logger, keys) {
  3344. return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
  3345. }
  3346. module2.exports = {
  3347. parseArgv,
  3348. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3349. };
  3350. }
  3351. });
  3352. var require_context = __commonJS2({
  3353. "src/cli/context.js"(exports2, module2) {
  3354. "use strict";
  3355. var {
  3356. utils: {
  3357. getLast
  3358. }
  3359. } = require_prettier_internal();
  3360. var getContextOptions = require_get_context_options();
  3361. var {
  3362. parseArgv,
  3363. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3364. } = require_parse_cli_arguments();
  3365. var Context2 = class {
  3366. constructor({
  3367. rawArguments,
  3368. logger
  3369. }) {
  3370. this.rawArguments = rawArguments;
  3371. this.logger = logger;
  3372. this.stack = [];
  3373. const {
  3374. plugins,
  3375. pluginSearchDirs
  3376. } = parseArgvWithoutPlugins2(rawArguments, logger, ["plugin", "plugin-search-dir"]);
  3377. this.pushContextPlugins(plugins, pluginSearchDirs);
  3378. const argv = parseArgv(rawArguments, this.detailedOptions, logger);
  3379. this.argv = argv;
  3380. this.filePatterns = argv._.map(String);
  3381. }
  3382. pushContextPlugins(plugins, pluginSearchDirs) {
  3383. const options = getContextOptions(plugins, pluginSearchDirs);
  3384. this.stack.push(options);
  3385. Object.assign(this, options);
  3386. }
  3387. popContextPlugins() {
  3388. this.stack.pop();
  3389. Object.assign(this, getLast(this.stack));
  3390. }
  3391. get performanceTestFlag() {
  3392. const {
  3393. debugBenchmark,
  3394. debugRepeat
  3395. } = this.argv;
  3396. if (debugBenchmark) {
  3397. return {
  3398. name: "--debug-benchmark",
  3399. debugBenchmark: true
  3400. };
  3401. }
  3402. if (debugRepeat > 0) {
  3403. return {
  3404. name: "--debug-repeat",
  3405. debugRepeat
  3406. };
  3407. }
  3408. const {
  3409. PRETTIER_PERF_REPEAT
  3410. } = process.env;
  3411. if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
  3412. return {
  3413. name: "PRETTIER_PERF_REPEAT (environment variable)",
  3414. debugRepeat: Number(PRETTIER_PERF_REPEAT)
  3415. };
  3416. }
  3417. }
  3418. };
  3419. module2.exports = Context2;
  3420. }
  3421. });
  3422. var require_usage = __commonJS2({
  3423. "src/cli/usage.js"(exports2, module2) {
  3424. "use strict";
  3425. var camelCase = require_camelcase();
  3426. var constant = require_constant();
  3427. var {
  3428. groupBy
  3429. } = require_utils();
  3430. var OPTION_USAGE_THRESHOLD = 25;
  3431. var CHOICE_USAGE_MARGIN = 3;
  3432. var CHOICE_USAGE_INDENTATION = 2;
  3433. function indent(str, spaces) {
  3434. return str.replace(/^/gm, " ".repeat(spaces));
  3435. }
  3436. function createDefaultValueDisplay(value) {
  3437. return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
  3438. }
  3439. function getOptionDefaultValue(context, optionName) {
  3440. if (!(optionName in context.detailedOptionMap)) {
  3441. return;
  3442. }
  3443. const option = context.detailedOptionMap[optionName];
  3444. if (option.default !== void 0) {
  3445. return option.default;
  3446. }
  3447. const optionCamelName = camelCase(optionName);
  3448. if (optionCamelName in context.apiDefaultOptions) {
  3449. return context.apiDefaultOptions[optionCamelName];
  3450. }
  3451. }
  3452. function createOptionUsageHeader(option) {
  3453. const name = `--${option.name}`;
  3454. const alias = option.alias ? `-${option.alias},` : null;
  3455. const type = createOptionUsageType(option);
  3456. return [alias, name, type].filter(Boolean).join(" ");
  3457. }
  3458. function createOptionUsageRow(header, content, threshold) {
  3459. const separator = header.length >= threshold ? `
  3460. ${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
  3461. const description = content.replace(/\n/g, `
  3462. ${" ".repeat(threshold)}`);
  3463. return `${header}${separator}${description}`;
  3464. }
  3465. function createOptionUsageType(option) {
  3466. switch (option.type) {
  3467. case "boolean":
  3468. return null;
  3469. case "choice":
  3470. return `<${option.choices.filter((choice) => !choice.deprecated && choice.since !== null).map((choice) => choice.value).join("|")}>`;
  3471. default:
  3472. return `<${option.type}>`;
  3473. }
  3474. }
  3475. function createChoiceUsages(choices, margin, indentation) {
  3476. const activeChoices = choices.filter((choice) => !choice.deprecated && choice.since !== null);
  3477. const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
  3478. return activeChoices.map((choice) => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
  3479. }
  3480. function createOptionUsage(context, option, threshold) {
  3481. const header = createOptionUsageHeader(option);
  3482. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3483. return createOptionUsageRow(header, `${option.description}${optionDefaultValue === void 0 ? "" : `
  3484. Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
  3485. }
  3486. function getOptionsWithOpposites(options) {
  3487. const optionsWithOpposites = options.map((option) => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
  3488. name: `no-${option.name}`,
  3489. type: "boolean",
  3490. description: option.oppositeDescription
  3491. }) : null]);
  3492. return optionsWithOpposites.flat().filter(Boolean);
  3493. }
  3494. function createUsage2(context) {
  3495. const options = getOptionsWithOpposites(context.detailedOptions).filter((option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
  3496. const groupedOptions = groupBy(options, (option) => option.category);
  3497. const firstCategories = constant.categoryOrder.slice(0, -1);
  3498. const lastCategories = constant.categoryOrder.slice(-1);
  3499. const restCategories = Object.keys(groupedOptions).filter((category) => !constant.categoryOrder.includes(category));
  3500. const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
  3501. const optionsUsage = allCategories.map((category) => {
  3502. const categoryOptions = groupedOptions[category].map((option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
  3503. return `${category} options:
  3504. ${indent(categoryOptions, 2)}`;
  3505. });
  3506. return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
  3507. }
  3508. function createDetailedUsage2(context, flag) {
  3509. const option = getOptionsWithOpposites(context.detailedOptions).find((option2) => option2.name === flag || option2.alias === flag);
  3510. const header = createOptionUsageHeader(option);
  3511. const description = `
  3512. ${indent(option.description, 2)}`;
  3513. const choices = option.type !== "choice" ? "" : `
  3514. Valid options:
  3515. ${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
  3516. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3517. const defaults = optionDefaultValue !== void 0 ? `
  3518. Default: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
  3519. const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `
  3520. Plugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `
  3521. * ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
  3522. return `${header}${description}${choices}${defaults}${pluginDefaults}`;
  3523. }
  3524. module2.exports = {
  3525. createUsage: createUsage2,
  3526. createDetailedUsage: createDetailedUsage2
  3527. };
  3528. }
  3529. });
  3530. var require_array = __commonJS2({
  3531. "node_modules/fast-glob/out/utils/array.js"(exports2) {
  3532. "use strict";
  3533. Object.defineProperty(exports2, "__esModule", {
  3534. value: true
  3535. });
  3536. exports2.splitWhen = exports2.flatten = void 0;
  3537. function flatten(items) {
  3538. return items.reduce((collection, item) => [].concat(collection, item), []);
  3539. }
  3540. exports2.flatten = flatten;
  3541. function splitWhen(items, predicate) {
  3542. const result = [[]];
  3543. let groupIndex = 0;
  3544. for (const item of items) {
  3545. if (predicate(item)) {
  3546. groupIndex++;
  3547. result[groupIndex] = [];
  3548. } else {
  3549. result[groupIndex].push(item);
  3550. }
  3551. }
  3552. return result;
  3553. }
  3554. exports2.splitWhen = splitWhen;
  3555. }
  3556. });
  3557. var require_errno = __commonJS2({
  3558. "node_modules/fast-glob/out/utils/errno.js"(exports2) {
  3559. "use strict";
  3560. Object.defineProperty(exports2, "__esModule", {
  3561. value: true
  3562. });
  3563. exports2.isEnoentCodeError = void 0;
  3564. function isEnoentCodeError(error) {
  3565. return error.code === "ENOENT";
  3566. }
  3567. exports2.isEnoentCodeError = isEnoentCodeError;
  3568. }
  3569. });
  3570. var require_fs = __commonJS2({
  3571. "node_modules/fast-glob/out/utils/fs.js"(exports2) {
  3572. "use strict";
  3573. Object.defineProperty(exports2, "__esModule", {
  3574. value: true
  3575. });
  3576. exports2.createDirentFromStats = void 0;
  3577. var DirentFromStats = class {
  3578. constructor(name, stats) {
  3579. this.name = name;
  3580. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  3581. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  3582. this.isDirectory = stats.isDirectory.bind(stats);
  3583. this.isFIFO = stats.isFIFO.bind(stats);
  3584. this.isFile = stats.isFile.bind(stats);
  3585. this.isSocket = stats.isSocket.bind(stats);
  3586. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  3587. }
  3588. };
  3589. function createDirentFromStats(name, stats) {
  3590. return new DirentFromStats(name, stats);
  3591. }
  3592. exports2.createDirentFromStats = createDirentFromStats;
  3593. }
  3594. });
  3595. var require_path = __commonJS2({
  3596. "node_modules/fast-glob/out/utils/path.js"(exports2) {
  3597. "use strict";
  3598. Object.defineProperty(exports2, "__esModule", {
  3599. value: true
  3600. });
  3601. exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
  3602. var path = require("path");
  3603. var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  3604. var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
  3605. function unixify(filepath) {
  3606. return filepath.replace(/\\/g, "/");
  3607. }
  3608. exports2.unixify = unixify;
  3609. function makeAbsolute(cwd, filepath) {
  3610. return path.resolve(cwd, filepath);
  3611. }
  3612. exports2.makeAbsolute = makeAbsolute;
  3613. function escape(pattern) {
  3614. return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  3615. }
  3616. exports2.escape = escape;
  3617. function removeLeadingDotSegment(entry) {
  3618. if (entry.charAt(0) === ".") {
  3619. const secondCharactery = entry.charAt(1);
  3620. if (secondCharactery === "/" || secondCharactery === "\\") {
  3621. return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  3622. }
  3623. }
  3624. return entry;
  3625. }
  3626. exports2.removeLeadingDotSegment = removeLeadingDotSegment;
  3627. }
  3628. });
  3629. var require_is_extglob = __commonJS2({
  3630. "node_modules/is-extglob/index.js"(exports2, module2) {
  3631. module2.exports = function isExtglob(str) {
  3632. if (typeof str !== "string" || str === "") {
  3633. return false;
  3634. }
  3635. var match;
  3636. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  3637. if (match[2])
  3638. return true;
  3639. str = str.slice(match.index + match[0].length);
  3640. }
  3641. return false;
  3642. };
  3643. }
  3644. });
  3645. var require_is_glob = __commonJS2({
  3646. "node_modules/is-glob/index.js"(exports2, module2) {
  3647. var isExtglob = require_is_extglob();
  3648. var chars = {
  3649. "{": "}",
  3650. "(": ")",
  3651. "[": "]"
  3652. };
  3653. var strictCheck = function(str) {
  3654. if (str[0] === "!") {
  3655. return true;
  3656. }
  3657. var index = 0;
  3658. var pipeIndex = -2;
  3659. var closeSquareIndex = -2;
  3660. var closeCurlyIndex = -2;
  3661. var closeParenIndex = -2;
  3662. var backSlashIndex = -2;
  3663. while (index < str.length) {
  3664. if (str[index] === "*") {
  3665. return true;
  3666. }
  3667. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
  3668. return true;
  3669. }
  3670. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  3671. if (closeSquareIndex < index) {
  3672. closeSquareIndex = str.indexOf("]", index);
  3673. }
  3674. if (closeSquareIndex > index) {
  3675. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3676. return true;
  3677. }
  3678. backSlashIndex = str.indexOf("\\", index);
  3679. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3680. return true;
  3681. }
  3682. }
  3683. }
  3684. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  3685. closeCurlyIndex = str.indexOf("}", index);
  3686. if (closeCurlyIndex > index) {
  3687. backSlashIndex = str.indexOf("\\", index);
  3688. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
  3689. return true;
  3690. }
  3691. }
  3692. }
  3693. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  3694. closeParenIndex = str.indexOf(")", index);
  3695. if (closeParenIndex > index) {
  3696. backSlashIndex = str.indexOf("\\", index);
  3697. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3698. return true;
  3699. }
  3700. }
  3701. }
  3702. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  3703. if (pipeIndex < index) {
  3704. pipeIndex = str.indexOf("|", index);
  3705. }
  3706. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  3707. closeParenIndex = str.indexOf(")", pipeIndex);
  3708. if (closeParenIndex > pipeIndex) {
  3709. backSlashIndex = str.indexOf("\\", pipeIndex);
  3710. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3711. return true;
  3712. }
  3713. }
  3714. }
  3715. }
  3716. if (str[index] === "\\") {
  3717. var open = str[index + 1];
  3718. index += 2;
  3719. var close = chars[open];
  3720. if (close) {
  3721. var n = str.indexOf(close, index);
  3722. if (n !== -1) {
  3723. index = n + 1;
  3724. }
  3725. }
  3726. if (str[index] === "!") {
  3727. return true;
  3728. }
  3729. } else {
  3730. index++;
  3731. }
  3732. }
  3733. return false;
  3734. };
  3735. var relaxedCheck = function(str) {
  3736. if (str[0] === "!") {
  3737. return true;
  3738. }
  3739. var index = 0;
  3740. while (index < str.length) {
  3741. if (/[*?{}()[\]]/.test(str[index])) {
  3742. return true;
  3743. }
  3744. if (str[index] === "\\") {
  3745. var open = str[index + 1];
  3746. index += 2;
  3747. var close = chars[open];
  3748. if (close) {
  3749. var n = str.indexOf(close, index);
  3750. if (n !== -1) {
  3751. index = n + 1;
  3752. }
  3753. }
  3754. if (str[index] === "!") {
  3755. return true;
  3756. }
  3757. } else {
  3758. index++;
  3759. }
  3760. }
  3761. return false;
  3762. };
  3763. module2.exports = function isGlob(str, options) {
  3764. if (typeof str !== "string" || str === "") {
  3765. return false;
  3766. }
  3767. if (isExtglob(str)) {
  3768. return true;
  3769. }
  3770. var check = strictCheck;
  3771. if (options && options.strict === false) {
  3772. check = relaxedCheck;
  3773. }
  3774. return check(str);
  3775. };
  3776. }
  3777. });
  3778. var require_glob_parent = __commonJS2({
  3779. "node_modules/glob-parent/index.js"(exports2, module2) {
  3780. "use strict";
  3781. var isGlob = require_is_glob();
  3782. var pathPosixDirname = require("path").posix.dirname;
  3783. var isWin32 = require("os").platform() === "win32";
  3784. var slash = "/";
  3785. var backslash = /\\/g;
  3786. var enclosure = /[\{\[].*[\}\]]$/;
  3787. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  3788. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  3789. module2.exports = function globParent(str, opts) {
  3790. var options = Object.assign({
  3791. flipBackslashes: true
  3792. }, opts);
  3793. if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
  3794. str = str.replace(backslash, slash);
  3795. }
  3796. if (enclosure.test(str)) {
  3797. str += slash;
  3798. }
  3799. str += "a";
  3800. do {
  3801. str = pathPosixDirname(str);
  3802. } while (isGlob(str) || globby.test(str));
  3803. return str.replace(escaped, "$1");
  3804. };
  3805. }
  3806. });
  3807. var require_utils2 = __commonJS2({
  3808. "node_modules/braces/lib/utils.js"(exports2) {
  3809. "use strict";
  3810. exports2.isInteger = (num) => {
  3811. if (typeof num === "number") {
  3812. return Number.isInteger(num);
  3813. }
  3814. if (typeof num === "string" && num.trim() !== "") {
  3815. return Number.isInteger(Number(num));
  3816. }
  3817. return false;
  3818. };
  3819. exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
  3820. exports2.exceedsLimit = (min, max, step = 1, limit) => {
  3821. if (limit === false)
  3822. return false;
  3823. if (!exports2.isInteger(min) || !exports2.isInteger(max))
  3824. return false;
  3825. return (Number(max) - Number(min)) / Number(step) >= limit;
  3826. };
  3827. exports2.escapeNode = (block, n = 0, type) => {
  3828. let node = block.nodes[n];
  3829. if (!node)
  3830. return;
  3831. if (type && node.type === type || node.type === "open" || node.type === "close") {
  3832. if (node.escaped !== true) {
  3833. node.value = "\\" + node.value;
  3834. node.escaped = true;
  3835. }
  3836. }
  3837. };
  3838. exports2.encloseBrace = (node) => {
  3839. if (node.type !== "brace")
  3840. return false;
  3841. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  3842. node.invalid = true;
  3843. return true;
  3844. }
  3845. return false;
  3846. };
  3847. exports2.isInvalidBrace = (block) => {
  3848. if (block.type !== "brace")
  3849. return false;
  3850. if (block.invalid === true || block.dollar)
  3851. return true;
  3852. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  3853. block.invalid = true;
  3854. return true;
  3855. }
  3856. if (block.open !== true || block.close !== true) {
  3857. block.invalid = true;
  3858. return true;
  3859. }
  3860. return false;
  3861. };
  3862. exports2.isOpenOrClose = (node) => {
  3863. if (node.type === "open" || node.type === "close") {
  3864. return true;
  3865. }
  3866. return node.open === true || node.close === true;
  3867. };
  3868. exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
  3869. if (node.type === "text")
  3870. acc.push(node.value);
  3871. if (node.type === "range")
  3872. node.type = "text";
  3873. return acc;
  3874. }, []);
  3875. exports2.flatten = (...args) => {
  3876. const result = [];
  3877. const flat = (arr) => {
  3878. for (let i = 0; i < arr.length; i++) {
  3879. let ele = arr[i];
  3880. Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
  3881. }
  3882. return result;
  3883. };
  3884. flat(args);
  3885. return result;
  3886. };
  3887. }
  3888. });
  3889. var require_stringify = __commonJS2({
  3890. "node_modules/braces/lib/stringify.js"(exports2, module2) {
  3891. "use strict";
  3892. var utils = require_utils2();
  3893. module2.exports = (ast, options = {}) => {
  3894. let stringify2 = (node, parent = {}) => {
  3895. let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
  3896. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  3897. let output = "";
  3898. if (node.value) {
  3899. if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
  3900. return "\\" + node.value;
  3901. }
  3902. return node.value;
  3903. }
  3904. if (node.value) {
  3905. return node.value;
  3906. }
  3907. if (node.nodes) {
  3908. for (let child of node.nodes) {
  3909. output += stringify2(child);
  3910. }
  3911. }
  3912. return output;
  3913. };
  3914. return stringify2(ast);
  3915. };
  3916. }
  3917. });
  3918. var require_is_number = __commonJS2({
  3919. "node_modules/is-number/index.js"(exports2, module2) {
  3920. "use strict";
  3921. module2.exports = function(num) {
  3922. if (typeof num === "number") {
  3923. return num - num === 0;
  3924. }
  3925. if (typeof num === "string" && num.trim() !== "") {
  3926. return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  3927. }
  3928. return false;
  3929. };
  3930. }
  3931. });
  3932. var require_to_regex_range = __commonJS2({
  3933. "node_modules/to-regex-range/index.js"(exports2, module2) {
  3934. "use strict";
  3935. var isNumber = require_is_number();
  3936. var toRegexRange = (min, max, options) => {
  3937. if (isNumber(min) === false) {
  3938. throw new TypeError("toRegexRange: expected the first argument to be a number");
  3939. }
  3940. if (max === void 0 || min === max) {
  3941. return String(min);
  3942. }
  3943. if (isNumber(max) === false) {
  3944. throw new TypeError("toRegexRange: expected the second argument to be a number.");
  3945. }
  3946. let opts = Object.assign({
  3947. relaxZeros: true
  3948. }, options);
  3949. if (typeof opts.strictZeros === "boolean") {
  3950. opts.relaxZeros = opts.strictZeros === false;
  3951. }
  3952. let relax = String(opts.relaxZeros);
  3953. let shorthand = String(opts.shorthand);
  3954. let capture = String(opts.capture);
  3955. let wrap = String(opts.wrap);
  3956. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  3957. if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
  3958. return toRegexRange.cache[cacheKey].result;
  3959. }
  3960. let a = Math.min(min, max);
  3961. let b = Math.max(min, max);
  3962. if (Math.abs(a - b) === 1) {
  3963. let result = min + "|" + max;
  3964. if (opts.capture) {
  3965. return `(${result})`;
  3966. }
  3967. if (opts.wrap === false) {
  3968. return result;
  3969. }
  3970. return `(?:${result})`;
  3971. }
  3972. let isPadded = hasPadding(min) || hasPadding(max);
  3973. let state = {
  3974. min,
  3975. max,
  3976. a,
  3977. b
  3978. };
  3979. let positives = [];
  3980. let negatives = [];
  3981. if (isPadded) {
  3982. state.isPadded = isPadded;
  3983. state.maxLen = String(state.max).length;
  3984. }
  3985. if (a < 0) {
  3986. let newMin = b < 0 ? Math.abs(b) : 1;
  3987. negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
  3988. a = state.a = 0;
  3989. }
  3990. if (b >= 0) {
  3991. positives = splitToPatterns(a, b, state, opts);
  3992. }
  3993. state.negatives = negatives;
  3994. state.positives = positives;
  3995. state.result = collatePatterns(negatives, positives, opts);
  3996. if (opts.capture === true) {
  3997. state.result = `(${state.result})`;
  3998. } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
  3999. state.result = `(?:${state.result})`;
  4000. }
  4001. toRegexRange.cache[cacheKey] = state;
  4002. return state.result;
  4003. };
  4004. function collatePatterns(neg, pos, options) {
  4005. let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
  4006. let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
  4007. let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
  4008. let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
  4009. return subpatterns.join("|");
  4010. }
  4011. function splitToRanges(min, max) {
  4012. let nines = 1;
  4013. let zeros = 1;
  4014. let stop = countNines(min, nines);
  4015. let stops = /* @__PURE__ */ new Set([max]);
  4016. while (min <= stop && stop <= max) {
  4017. stops.add(stop);
  4018. nines += 1;
  4019. stop = countNines(min, nines);
  4020. }
  4021. stop = countZeros(max + 1, zeros) - 1;
  4022. while (min < stop && stop <= max) {
  4023. stops.add(stop);
  4024. zeros += 1;
  4025. stop = countZeros(max + 1, zeros) - 1;
  4026. }
  4027. stops = [...stops];
  4028. stops.sort(compare);
  4029. return stops;
  4030. }
  4031. function rangeToPattern(start, stop, options) {
  4032. if (start === stop) {
  4033. return {
  4034. pattern: start,
  4035. count: [],
  4036. digits: 0
  4037. };
  4038. }
  4039. let zipped = zip(start, stop);
  4040. let digits = zipped.length;
  4041. let pattern = "";
  4042. let count = 0;
  4043. for (let i = 0; i < digits; i++) {
  4044. let [startDigit, stopDigit] = zipped[i];
  4045. if (startDigit === stopDigit) {
  4046. pattern += startDigit;
  4047. } else if (startDigit !== "0" || stopDigit !== "9") {
  4048. pattern += toCharacterClass(startDigit, stopDigit, options);
  4049. } else {
  4050. count++;
  4051. }
  4052. }
  4053. if (count) {
  4054. pattern += options.shorthand === true ? "\\d" : "[0-9]";
  4055. }
  4056. return {
  4057. pattern,
  4058. count: [count],
  4059. digits
  4060. };
  4061. }
  4062. function splitToPatterns(min, max, tok, options) {
  4063. let ranges = splitToRanges(min, max);
  4064. let tokens = [];
  4065. let start = min;
  4066. let prev;
  4067. for (let i = 0; i < ranges.length; i++) {
  4068. let max2 = ranges[i];
  4069. let obj = rangeToPattern(String(start), String(max2), options);
  4070. let zeros = "";
  4071. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  4072. if (prev.count.length > 1) {
  4073. prev.count.pop();
  4074. }
  4075. prev.count.push(obj.count[0]);
  4076. prev.string = prev.pattern + toQuantifier(prev.count);
  4077. start = max2 + 1;
  4078. continue;
  4079. }
  4080. if (tok.isPadded) {
  4081. zeros = padZeros(max2, tok, options);
  4082. }
  4083. obj.string = zeros + obj.pattern + toQuantifier(obj.count);
  4084. tokens.push(obj);
  4085. start = max2 + 1;
  4086. prev = obj;
  4087. }
  4088. return tokens;
  4089. }
  4090. function filterPatterns(arr, comparison, prefix, intersection, options) {
  4091. let result = [];
  4092. for (let ele of arr) {
  4093. let {
  4094. string
  4095. } = ele;
  4096. if (!intersection && !contains(comparison, "string", string)) {
  4097. result.push(prefix + string);
  4098. }
  4099. if (intersection && contains(comparison, "string", string)) {
  4100. result.push(prefix + string);
  4101. }
  4102. }
  4103. return result;
  4104. }
  4105. function zip(a, b) {
  4106. let arr = [];
  4107. for (let i = 0; i < a.length; i++)
  4108. arr.push([a[i], b[i]]);
  4109. return arr;
  4110. }
  4111. function compare(a, b) {
  4112. return a > b ? 1 : b > a ? -1 : 0;
  4113. }
  4114. function contains(arr, key, val) {
  4115. return arr.some((ele) => ele[key] === val);
  4116. }
  4117. function countNines(min, len) {
  4118. return Number(String(min).slice(0, -len) + "9".repeat(len));
  4119. }
  4120. function countZeros(integer, zeros) {
  4121. return integer - integer % Math.pow(10, zeros);
  4122. }
  4123. function toQuantifier(digits) {
  4124. let [start = 0, stop = ""] = digits;
  4125. if (stop || start > 1) {
  4126. return `{${start + (stop ? "," + stop : "")}}`;
  4127. }
  4128. return "";
  4129. }
  4130. function toCharacterClass(a, b, options) {
  4131. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  4132. }
  4133. function hasPadding(str) {
  4134. return /^-?(0+)\d/.test(str);
  4135. }
  4136. function padZeros(value, tok, options) {
  4137. if (!tok.isPadded) {
  4138. return value;
  4139. }
  4140. let diff = Math.abs(tok.maxLen - String(value).length);
  4141. let relax = options.relaxZeros !== false;
  4142. switch (diff) {
  4143. case 0:
  4144. return "";
  4145. case 1:
  4146. return relax ? "0?" : "0";
  4147. case 2:
  4148. return relax ? "0{0,2}" : "00";
  4149. default: {
  4150. return relax ? `0{0,${diff}}` : `0{${diff}}`;
  4151. }
  4152. }
  4153. }
  4154. toRegexRange.cache = {};
  4155. toRegexRange.clearCache = () => toRegexRange.cache = {};
  4156. module2.exports = toRegexRange;
  4157. }
  4158. });
  4159. var require_fill_range = __commonJS2({
  4160. "node_modules/fill-range/index.js"(exports2, module2) {
  4161. "use strict";
  4162. var util = require("util");
  4163. var toRegexRange = require_to_regex_range();
  4164. var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  4165. var transform = (toNumber) => {
  4166. return (value) => toNumber === true ? Number(value) : String(value);
  4167. };
  4168. var isValidValue = (value) => {
  4169. return typeof value === "number" || typeof value === "string" && value !== "";
  4170. };
  4171. var isNumber = (num) => Number.isInteger(+num);
  4172. var zeros = (input) => {
  4173. let value = `${input}`;
  4174. let index = -1;
  4175. if (value[0] === "-")
  4176. value = value.slice(1);
  4177. if (value === "0")
  4178. return false;
  4179. while (value[++index] === "0")
  4180. ;
  4181. return index > 0;
  4182. };
  4183. var stringify2 = (start, end, options) => {
  4184. if (typeof start === "string" || typeof end === "string") {
  4185. return true;
  4186. }
  4187. return options.stringify === true;
  4188. };
  4189. var pad = (input, maxLength, toNumber) => {
  4190. if (maxLength > 0) {
  4191. let dash = input[0] === "-" ? "-" : "";
  4192. if (dash)
  4193. input = input.slice(1);
  4194. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  4195. }
  4196. if (toNumber === false) {
  4197. return String(input);
  4198. }
  4199. return input;
  4200. };
  4201. var toMaxLen = (input, maxLength) => {
  4202. let negative = input[0] === "-" ? "-" : "";
  4203. if (negative) {
  4204. input = input.slice(1);
  4205. maxLength--;
  4206. }
  4207. while (input.length < maxLength)
  4208. input = "0" + input;
  4209. return negative ? "-" + input : input;
  4210. };
  4211. var toSequence = (parts, options) => {
  4212. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4213. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4214. let prefix = options.capture ? "" : "?:";
  4215. let positives = "";
  4216. let negatives = "";
  4217. let result;
  4218. if (parts.positives.length) {
  4219. positives = parts.positives.join("|");
  4220. }
  4221. if (parts.negatives.length) {
  4222. negatives = `-(${prefix}${parts.negatives.join("|")})`;
  4223. }
  4224. if (positives && negatives) {
  4225. result = `${positives}|${negatives}`;
  4226. } else {
  4227. result = positives || negatives;
  4228. }
  4229. if (options.wrap) {
  4230. return `(${prefix}${result})`;
  4231. }
  4232. return result;
  4233. };
  4234. var toRange = (a, b, isNumbers, options) => {
  4235. if (isNumbers) {
  4236. return toRegexRange(a, b, Object.assign({
  4237. wrap: false
  4238. }, options));
  4239. }
  4240. let start = String.fromCharCode(a);
  4241. if (a === b)
  4242. return start;
  4243. let stop = String.fromCharCode(b);
  4244. return `[${start}-${stop}]`;
  4245. };
  4246. var toRegex = (start, end, options) => {
  4247. if (Array.isArray(start)) {
  4248. let wrap = options.wrap === true;
  4249. let prefix = options.capture ? "" : "?:";
  4250. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  4251. }
  4252. return toRegexRange(start, end, options);
  4253. };
  4254. var rangeError = (...args) => {
  4255. return new RangeError("Invalid range arguments: " + util.inspect(...args));
  4256. };
  4257. var invalidRange = (start, end, options) => {
  4258. if (options.strictRanges === true)
  4259. throw rangeError([start, end]);
  4260. return [];
  4261. };
  4262. var invalidStep = (step, options) => {
  4263. if (options.strictRanges === true) {
  4264. throw new TypeError(`Expected step "${step}" to be a number`);
  4265. }
  4266. return [];
  4267. };
  4268. var fillNumbers = (start, end, step = 1, options = {}) => {
  4269. let a = Number(start);
  4270. let b = Number(end);
  4271. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  4272. if (options.strictRanges === true)
  4273. throw rangeError([start, end]);
  4274. return [];
  4275. }
  4276. if (a === 0)
  4277. a = 0;
  4278. if (b === 0)
  4279. b = 0;
  4280. let descending = a > b;
  4281. let startString = String(start);
  4282. let endString = String(end);
  4283. let stepString = String(step);
  4284. step = Math.max(Math.abs(step), 1);
  4285. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  4286. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  4287. let toNumber = padded === false && stringify2(start, end, options) === false;
  4288. let format = options.transform || transform(toNumber);
  4289. if (options.toRegex && step === 1) {
  4290. return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
  4291. }
  4292. let parts = {
  4293. negatives: [],
  4294. positives: []
  4295. };
  4296. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  4297. let range = [];
  4298. let index = 0;
  4299. while (descending ? a >= b : a <= b) {
  4300. if (options.toRegex === true && step > 1) {
  4301. push(a);
  4302. } else {
  4303. range.push(pad(format(a, index), maxLen, toNumber));
  4304. }
  4305. a = descending ? a - step : a + step;
  4306. index++;
  4307. }
  4308. if (options.toRegex === true) {
  4309. return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
  4310. wrap: false
  4311. }, options));
  4312. }
  4313. return range;
  4314. };
  4315. var fillLetters = (start, end, step = 1, options = {}) => {
  4316. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
  4317. return invalidRange(start, end, options);
  4318. }
  4319. let format = options.transform || ((val) => String.fromCharCode(val));
  4320. let a = `${start}`.charCodeAt(0);
  4321. let b = `${end}`.charCodeAt(0);
  4322. let descending = a > b;
  4323. let min = Math.min(a, b);
  4324. let max = Math.max(a, b);
  4325. if (options.toRegex && step === 1) {
  4326. return toRange(min, max, false, options);
  4327. }
  4328. let range = [];
  4329. let index = 0;
  4330. while (descending ? a >= b : a <= b) {
  4331. range.push(format(a, index));
  4332. a = descending ? a - step : a + step;
  4333. index++;
  4334. }
  4335. if (options.toRegex === true) {
  4336. return toRegex(range, null, {
  4337. wrap: false,
  4338. options
  4339. });
  4340. }
  4341. return range;
  4342. };
  4343. var fill = (start, end, step, options = {}) => {
  4344. if (end == null && isValidValue(start)) {
  4345. return [start];
  4346. }
  4347. if (!isValidValue(start) || !isValidValue(end)) {
  4348. return invalidRange(start, end, options);
  4349. }
  4350. if (typeof step === "function") {
  4351. return fill(start, end, 1, {
  4352. transform: step
  4353. });
  4354. }
  4355. if (isObject(step)) {
  4356. return fill(start, end, 0, step);
  4357. }
  4358. let opts = Object.assign({}, options);
  4359. if (opts.capture === true)
  4360. opts.wrap = true;
  4361. step = step || opts.step || 1;
  4362. if (!isNumber(step)) {
  4363. if (step != null && !isObject(step))
  4364. return invalidStep(step, opts);
  4365. return fill(start, end, 1, step);
  4366. }
  4367. if (isNumber(start) && isNumber(end)) {
  4368. return fillNumbers(start, end, step, opts);
  4369. }
  4370. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  4371. };
  4372. module2.exports = fill;
  4373. }
  4374. });
  4375. var require_compile = __commonJS2({
  4376. "node_modules/braces/lib/compile.js"(exports2, module2) {
  4377. "use strict";
  4378. var fill = require_fill_range();
  4379. var utils = require_utils2();
  4380. var compile = (ast, options = {}) => {
  4381. let walk = (node, parent = {}) => {
  4382. let invalidBlock = utils.isInvalidBrace(parent);
  4383. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  4384. let invalid = invalidBlock === true || invalidNode === true;
  4385. let prefix = options.escapeInvalid === true ? "\\" : "";
  4386. let output = "";
  4387. if (node.isOpen === true) {
  4388. return prefix + node.value;
  4389. }
  4390. if (node.isClose === true) {
  4391. return prefix + node.value;
  4392. }
  4393. if (node.type === "open") {
  4394. return invalid ? prefix + node.value : "(";
  4395. }
  4396. if (node.type === "close") {
  4397. return invalid ? prefix + node.value : ")";
  4398. }
  4399. if (node.type === "comma") {
  4400. return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  4401. }
  4402. if (node.value) {
  4403. return node.value;
  4404. }
  4405. if (node.nodes && node.ranges > 0) {
  4406. let args = utils.reduce(node.nodes);
  4407. let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
  4408. wrap: false,
  4409. toRegex: true
  4410. }));
  4411. if (range.length !== 0) {
  4412. return args.length > 1 && range.length > 1 ? `(${range})` : range;
  4413. }
  4414. }
  4415. if (node.nodes) {
  4416. for (let child of node.nodes) {
  4417. output += walk(child, node);
  4418. }
  4419. }
  4420. return output;
  4421. };
  4422. return walk(ast);
  4423. };
  4424. module2.exports = compile;
  4425. }
  4426. });
  4427. var require_expand = __commonJS2({
  4428. "node_modules/braces/lib/expand.js"(exports2, module2) {
  4429. "use strict";
  4430. var fill = require_fill_range();
  4431. var stringify2 = require_stringify();
  4432. var utils = require_utils2();
  4433. var append = (queue = "", stash = "", enclose = false) => {
  4434. let result = [];
  4435. queue = [].concat(queue);
  4436. stash = [].concat(stash);
  4437. if (!stash.length)
  4438. return queue;
  4439. if (!queue.length) {
  4440. return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
  4441. }
  4442. for (let item of queue) {
  4443. if (Array.isArray(item)) {
  4444. for (let value of item) {
  4445. result.push(append(value, stash, enclose));
  4446. }
  4447. } else {
  4448. for (let ele of stash) {
  4449. if (enclose === true && typeof ele === "string")
  4450. ele = `{${ele}}`;
  4451. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  4452. }
  4453. }
  4454. }
  4455. return utils.flatten(result);
  4456. };
  4457. var expand = (ast, options = {}) => {
  4458. let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
  4459. let walk = (node, parent = {}) => {
  4460. node.queue = [];
  4461. let p = parent;
  4462. let q = parent.queue;
  4463. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  4464. p = p.parent;
  4465. q = p.queue;
  4466. }
  4467. if (node.invalid || node.dollar) {
  4468. q.push(append(q.pop(), stringify2(node, options)));
  4469. return;
  4470. }
  4471. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  4472. q.push(append(q.pop(), ["{}"]));
  4473. return;
  4474. }
  4475. if (node.nodes && node.ranges > 0) {
  4476. let args = utils.reduce(node.nodes);
  4477. if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
  4478. throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
  4479. }
  4480. let range = fill(...args, options);
  4481. if (range.length === 0) {
  4482. range = stringify2(node, options);
  4483. }
  4484. q.push(append(q.pop(), range));
  4485. node.nodes = [];
  4486. return;
  4487. }
  4488. let enclose = utils.encloseBrace(node);
  4489. let queue = node.queue;
  4490. let block = node;
  4491. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  4492. block = block.parent;
  4493. queue = block.queue;
  4494. }
  4495. for (let i = 0; i < node.nodes.length; i++) {
  4496. let child = node.nodes[i];
  4497. if (child.type === "comma" && node.type === "brace") {
  4498. if (i === 1)
  4499. queue.push("");
  4500. queue.push("");
  4501. continue;
  4502. }
  4503. if (child.type === "close") {
  4504. q.push(append(q.pop(), queue, enclose));
  4505. continue;
  4506. }
  4507. if (child.value && child.type !== "open") {
  4508. queue.push(append(queue.pop(), child.value));
  4509. continue;
  4510. }
  4511. if (child.nodes) {
  4512. walk(child, node);
  4513. }
  4514. }
  4515. return queue;
  4516. };
  4517. return utils.flatten(walk(ast));
  4518. };
  4519. module2.exports = expand;
  4520. }
  4521. });
  4522. var require_constants = __commonJS2({
  4523. "node_modules/braces/lib/constants.js"(exports2, module2) {
  4524. "use strict";
  4525. module2.exports = {
  4526. MAX_LENGTH: 1024 * 64,
  4527. CHAR_0: "0",
  4528. CHAR_9: "9",
  4529. CHAR_UPPERCASE_A: "A",
  4530. CHAR_LOWERCASE_A: "a",
  4531. CHAR_UPPERCASE_Z: "Z",
  4532. CHAR_LOWERCASE_Z: "z",
  4533. CHAR_LEFT_PARENTHESES: "(",
  4534. CHAR_RIGHT_PARENTHESES: ")",
  4535. CHAR_ASTERISK: "*",
  4536. CHAR_AMPERSAND: "&",
  4537. CHAR_AT: "@",
  4538. CHAR_BACKSLASH: "\\",
  4539. CHAR_BACKTICK: "`",
  4540. CHAR_CARRIAGE_RETURN: "\r",
  4541. CHAR_CIRCUMFLEX_ACCENT: "^",
  4542. CHAR_COLON: ":",
  4543. CHAR_COMMA: ",",
  4544. CHAR_DOLLAR: "$",
  4545. CHAR_DOT: ".",
  4546. CHAR_DOUBLE_QUOTE: '"',
  4547. CHAR_EQUAL: "=",
  4548. CHAR_EXCLAMATION_MARK: "!",
  4549. CHAR_FORM_FEED: "\f",
  4550. CHAR_FORWARD_SLASH: "/",
  4551. CHAR_HASH: "#",
  4552. CHAR_HYPHEN_MINUS: "-",
  4553. CHAR_LEFT_ANGLE_BRACKET: "<",
  4554. CHAR_LEFT_CURLY_BRACE: "{",
  4555. CHAR_LEFT_SQUARE_BRACKET: "[",
  4556. CHAR_LINE_FEED: "\n",
  4557. CHAR_NO_BREAK_SPACE: "\xA0",
  4558. CHAR_PERCENT: "%",
  4559. CHAR_PLUS: "+",
  4560. CHAR_QUESTION_MARK: "?",
  4561. CHAR_RIGHT_ANGLE_BRACKET: ">",
  4562. CHAR_RIGHT_CURLY_BRACE: "}",
  4563. CHAR_RIGHT_SQUARE_BRACKET: "]",
  4564. CHAR_SEMICOLON: ";",
  4565. CHAR_SINGLE_QUOTE: "'",
  4566. CHAR_SPACE: " ",
  4567. CHAR_TAB: " ",
  4568. CHAR_UNDERSCORE: "_",
  4569. CHAR_VERTICAL_LINE: "|",
  4570. CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
  4571. };
  4572. }
  4573. });
  4574. var require_parse = __commonJS2({
  4575. "node_modules/braces/lib/parse.js"(exports2, module2) {
  4576. "use strict";
  4577. var stringify2 = require_stringify();
  4578. var {
  4579. MAX_LENGTH,
  4580. CHAR_BACKSLASH,
  4581. CHAR_BACKTICK,
  4582. CHAR_COMMA,
  4583. CHAR_DOT,
  4584. CHAR_LEFT_PARENTHESES,
  4585. CHAR_RIGHT_PARENTHESES,
  4586. CHAR_LEFT_CURLY_BRACE,
  4587. CHAR_RIGHT_CURLY_BRACE,
  4588. CHAR_LEFT_SQUARE_BRACKET,
  4589. CHAR_RIGHT_SQUARE_BRACKET,
  4590. CHAR_DOUBLE_QUOTE,
  4591. CHAR_SINGLE_QUOTE,
  4592. CHAR_NO_BREAK_SPACE,
  4593. CHAR_ZERO_WIDTH_NOBREAK_SPACE
  4594. } = require_constants();
  4595. var parse = (input, options = {}) => {
  4596. if (typeof input !== "string") {
  4597. throw new TypeError("Expected a string");
  4598. }
  4599. let opts = options || {};
  4600. let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  4601. if (input.length > max) {
  4602. throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  4603. }
  4604. let ast = {
  4605. type: "root",
  4606. input,
  4607. nodes: []
  4608. };
  4609. let stack = [ast];
  4610. let block = ast;
  4611. let prev = ast;
  4612. let brackets = 0;
  4613. let length = input.length;
  4614. let index = 0;
  4615. let depth = 0;
  4616. let value;
  4617. let memo = {};
  4618. const advance = () => input[index++];
  4619. const push = (node) => {
  4620. if (node.type === "text" && prev.type === "dot") {
  4621. prev.type = "text";
  4622. }
  4623. if (prev && prev.type === "text" && node.type === "text") {
  4624. prev.value += node.value;
  4625. return;
  4626. }
  4627. block.nodes.push(node);
  4628. node.parent = block;
  4629. node.prev = prev;
  4630. prev = node;
  4631. return node;
  4632. };
  4633. push({
  4634. type: "bos"
  4635. });
  4636. while (index < length) {
  4637. block = stack[stack.length - 1];
  4638. value = advance();
  4639. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
  4640. continue;
  4641. }
  4642. if (value === CHAR_BACKSLASH) {
  4643. push({
  4644. type: "text",
  4645. value: (options.keepEscaping ? value : "") + advance()
  4646. });
  4647. continue;
  4648. }
  4649. if (value === CHAR_RIGHT_SQUARE_BRACKET) {
  4650. push({
  4651. type: "text",
  4652. value: "\\" + value
  4653. });
  4654. continue;
  4655. }
  4656. if (value === CHAR_LEFT_SQUARE_BRACKET) {
  4657. brackets++;
  4658. let closed = true;
  4659. let next;
  4660. while (index < length && (next = advance())) {
  4661. value += next;
  4662. if (next === CHAR_LEFT_SQUARE_BRACKET) {
  4663. brackets++;
  4664. continue;
  4665. }
  4666. if (next === CHAR_BACKSLASH) {
  4667. value += advance();
  4668. continue;
  4669. }
  4670. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  4671. brackets--;
  4672. if (brackets === 0) {
  4673. break;
  4674. }
  4675. }
  4676. }
  4677. push({
  4678. type: "text",
  4679. value
  4680. });
  4681. continue;
  4682. }
  4683. if (value === CHAR_LEFT_PARENTHESES) {
  4684. block = push({
  4685. type: "paren",
  4686. nodes: []
  4687. });
  4688. stack.push(block);
  4689. push({
  4690. type: "text",
  4691. value
  4692. });
  4693. continue;
  4694. }
  4695. if (value === CHAR_RIGHT_PARENTHESES) {
  4696. if (block.type !== "paren") {
  4697. push({
  4698. type: "text",
  4699. value
  4700. });
  4701. continue;
  4702. }
  4703. block = stack.pop();
  4704. push({
  4705. type: "text",
  4706. value
  4707. });
  4708. block = stack[stack.length - 1];
  4709. continue;
  4710. }
  4711. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  4712. let open = value;
  4713. let next;
  4714. if (options.keepQuotes !== true) {
  4715. value = "";
  4716. }
  4717. while (index < length && (next = advance())) {
  4718. if (next === CHAR_BACKSLASH) {
  4719. value += next + advance();
  4720. continue;
  4721. }
  4722. if (next === open) {
  4723. if (options.keepQuotes === true)
  4724. value += next;
  4725. break;
  4726. }
  4727. value += next;
  4728. }
  4729. push({
  4730. type: "text",
  4731. value
  4732. });
  4733. continue;
  4734. }
  4735. if (value === CHAR_LEFT_CURLY_BRACE) {
  4736. depth++;
  4737. let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
  4738. let brace = {
  4739. type: "brace",
  4740. open: true,
  4741. close: false,
  4742. dollar,
  4743. depth,
  4744. commas: 0,
  4745. ranges: 0,
  4746. nodes: []
  4747. };
  4748. block = push(brace);
  4749. stack.push(block);
  4750. push({
  4751. type: "open",
  4752. value
  4753. });
  4754. continue;
  4755. }
  4756. if (value === CHAR_RIGHT_CURLY_BRACE) {
  4757. if (block.type !== "brace") {
  4758. push({
  4759. type: "text",
  4760. value
  4761. });
  4762. continue;
  4763. }
  4764. let type = "close";
  4765. block = stack.pop();
  4766. block.close = true;
  4767. push({
  4768. type,
  4769. value
  4770. });
  4771. depth--;
  4772. block = stack[stack.length - 1];
  4773. continue;
  4774. }
  4775. if (value === CHAR_COMMA && depth > 0) {
  4776. if (block.ranges > 0) {
  4777. block.ranges = 0;
  4778. let open = block.nodes.shift();
  4779. block.nodes = [open, {
  4780. type: "text",
  4781. value: stringify2(block)
  4782. }];
  4783. }
  4784. push({
  4785. type: "comma",
  4786. value
  4787. });
  4788. block.commas++;
  4789. continue;
  4790. }
  4791. if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
  4792. let siblings = block.nodes;
  4793. if (depth === 0 || siblings.length === 0) {
  4794. push({
  4795. type: "text",
  4796. value
  4797. });
  4798. continue;
  4799. }
  4800. if (prev.type === "dot") {
  4801. block.range = [];
  4802. prev.value += value;
  4803. prev.type = "range";
  4804. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  4805. block.invalid = true;
  4806. block.ranges = 0;
  4807. prev.type = "text";
  4808. continue;
  4809. }
  4810. block.ranges++;
  4811. block.args = [];
  4812. continue;
  4813. }
  4814. if (prev.type === "range") {
  4815. siblings.pop();
  4816. let before = siblings[siblings.length - 1];
  4817. before.value += prev.value + value;
  4818. prev = before;
  4819. block.ranges--;
  4820. continue;
  4821. }
  4822. push({
  4823. type: "dot",
  4824. value
  4825. });
  4826. continue;
  4827. }
  4828. push({
  4829. type: "text",
  4830. value
  4831. });
  4832. }
  4833. do {
  4834. block = stack.pop();
  4835. if (block.type !== "root") {
  4836. block.nodes.forEach((node) => {
  4837. if (!node.nodes) {
  4838. if (node.type === "open")
  4839. node.isOpen = true;
  4840. if (node.type === "close")
  4841. node.isClose = true;
  4842. if (!node.nodes)
  4843. node.type = "text";
  4844. node.invalid = true;
  4845. }
  4846. });
  4847. let parent = stack[stack.length - 1];
  4848. let index2 = parent.nodes.indexOf(block);
  4849. parent.nodes.splice(index2, 1, ...block.nodes);
  4850. }
  4851. } while (stack.length > 0);
  4852. push({
  4853. type: "eos"
  4854. });
  4855. return ast;
  4856. };
  4857. module2.exports = parse;
  4858. }
  4859. });
  4860. var require_braces = __commonJS2({
  4861. "node_modules/braces/index.js"(exports2, module2) {
  4862. "use strict";
  4863. var stringify2 = require_stringify();
  4864. var compile = require_compile();
  4865. var expand = require_expand();
  4866. var parse = require_parse();
  4867. var braces = (input, options = {}) => {
  4868. let output = [];
  4869. if (Array.isArray(input)) {
  4870. for (let pattern of input) {
  4871. let result = braces.create(pattern, options);
  4872. if (Array.isArray(result)) {
  4873. output.push(...result);
  4874. } else {
  4875. output.push(result);
  4876. }
  4877. }
  4878. } else {
  4879. output = [].concat(braces.create(input, options));
  4880. }
  4881. if (options && options.expand === true && options.nodupes === true) {
  4882. output = [...new Set(output)];
  4883. }
  4884. return output;
  4885. };
  4886. braces.parse = (input, options = {}) => parse(input, options);
  4887. braces.stringify = (input, options = {}) => {
  4888. if (typeof input === "string") {
  4889. return stringify2(braces.parse(input, options), options);
  4890. }
  4891. return stringify2(input, options);
  4892. };
  4893. braces.compile = (input, options = {}) => {
  4894. if (typeof input === "string") {
  4895. input = braces.parse(input, options);
  4896. }
  4897. return compile(input, options);
  4898. };
  4899. braces.expand = (input, options = {}) => {
  4900. if (typeof input === "string") {
  4901. input = braces.parse(input, options);
  4902. }
  4903. let result = expand(input, options);
  4904. if (options.noempty === true) {
  4905. result = result.filter(Boolean);
  4906. }
  4907. if (options.nodupes === true) {
  4908. result = [...new Set(result)];
  4909. }
  4910. return result;
  4911. };
  4912. braces.create = (input, options = {}) => {
  4913. if (input === "" || input.length < 3) {
  4914. return [input];
  4915. }
  4916. return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
  4917. };
  4918. module2.exports = braces;
  4919. }
  4920. });
  4921. var require_constants2 = __commonJS2({
  4922. "node_modules/picomatch/lib/constants.js"(exports2, module2) {
  4923. "use strict";
  4924. var path = require("path");
  4925. var WIN_SLASH = "\\\\/";
  4926. var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  4927. var DOT_LITERAL = "\\.";
  4928. var PLUS_LITERAL = "\\+";
  4929. var QMARK_LITERAL = "\\?";
  4930. var SLASH_LITERAL = "\\/";
  4931. var ONE_CHAR = "(?=.)";
  4932. var QMARK = "[^/]";
  4933. var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  4934. var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  4935. var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  4936. var NO_DOT = `(?!${DOT_LITERAL})`;
  4937. var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  4938. var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  4939. var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  4940. var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  4941. var STAR = `${QMARK}*?`;
  4942. var POSIX_CHARS = {
  4943. DOT_LITERAL,
  4944. PLUS_LITERAL,
  4945. QMARK_LITERAL,
  4946. SLASH_LITERAL,
  4947. ONE_CHAR,
  4948. QMARK,
  4949. END_ANCHOR,
  4950. DOTS_SLASH,
  4951. NO_DOT,
  4952. NO_DOTS,
  4953. NO_DOT_SLASH,
  4954. NO_DOTS_SLASH,
  4955. QMARK_NO_DOT,
  4956. STAR,
  4957. START_ANCHOR
  4958. };
  4959. var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
  4960. SLASH_LITERAL: `[${WIN_SLASH}]`,
  4961. QMARK: WIN_NO_SLASH,
  4962. STAR: `${WIN_NO_SLASH}*?`,
  4963. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  4964. NO_DOT: `(?!${DOT_LITERAL})`,
  4965. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  4966. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  4967. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  4968. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  4969. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  4970. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  4971. });
  4972. var POSIX_REGEX_SOURCE = {
  4973. alnum: "a-zA-Z0-9",
  4974. alpha: "a-zA-Z",
  4975. ascii: "\\x00-\\x7F",
  4976. blank: " \\t",
  4977. cntrl: "\\x00-\\x1F\\x7F",
  4978. digit: "0-9",
  4979. graph: "\\x21-\\x7E",
  4980. lower: "a-z",
  4981. print: "\\x20-\\x7E ",
  4982. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  4983. space: " \\t\\r\\n\\v\\f",
  4984. upper: "A-Z",
  4985. word: "A-Za-z0-9_",
  4986. xdigit: "A-Fa-f0-9"
  4987. };
  4988. module2.exports = {
  4989. MAX_LENGTH: 1024 * 64,
  4990. POSIX_REGEX_SOURCE,
  4991. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  4992. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  4993. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  4994. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  4995. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  4996. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  4997. REPLACEMENTS: {
  4998. "***": "*",
  4999. "**/**": "**",
  5000. "**/**/**": "**"
  5001. },
  5002. CHAR_0: 48,
  5003. CHAR_9: 57,
  5004. CHAR_UPPERCASE_A: 65,
  5005. CHAR_LOWERCASE_A: 97,
  5006. CHAR_UPPERCASE_Z: 90,
  5007. CHAR_LOWERCASE_Z: 122,
  5008. CHAR_LEFT_PARENTHESES: 40,
  5009. CHAR_RIGHT_PARENTHESES: 41,
  5010. CHAR_ASTERISK: 42,
  5011. CHAR_AMPERSAND: 38,
  5012. CHAR_AT: 64,
  5013. CHAR_BACKWARD_SLASH: 92,
  5014. CHAR_CARRIAGE_RETURN: 13,
  5015. CHAR_CIRCUMFLEX_ACCENT: 94,
  5016. CHAR_COLON: 58,
  5017. CHAR_COMMA: 44,
  5018. CHAR_DOT: 46,
  5019. CHAR_DOUBLE_QUOTE: 34,
  5020. CHAR_EQUAL: 61,
  5021. CHAR_EXCLAMATION_MARK: 33,
  5022. CHAR_FORM_FEED: 12,
  5023. CHAR_FORWARD_SLASH: 47,
  5024. CHAR_GRAVE_ACCENT: 96,
  5025. CHAR_HASH: 35,
  5026. CHAR_HYPHEN_MINUS: 45,
  5027. CHAR_LEFT_ANGLE_BRACKET: 60,
  5028. CHAR_LEFT_CURLY_BRACE: 123,
  5029. CHAR_LEFT_SQUARE_BRACKET: 91,
  5030. CHAR_LINE_FEED: 10,
  5031. CHAR_NO_BREAK_SPACE: 160,
  5032. CHAR_PERCENT: 37,
  5033. CHAR_PLUS: 43,
  5034. CHAR_QUESTION_MARK: 63,
  5035. CHAR_RIGHT_ANGLE_BRACKET: 62,
  5036. CHAR_RIGHT_CURLY_BRACE: 125,
  5037. CHAR_RIGHT_SQUARE_BRACKET: 93,
  5038. CHAR_SEMICOLON: 59,
  5039. CHAR_SINGLE_QUOTE: 39,
  5040. CHAR_SPACE: 32,
  5041. CHAR_TAB: 9,
  5042. CHAR_UNDERSCORE: 95,
  5043. CHAR_VERTICAL_LINE: 124,
  5044. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  5045. SEP: path.sep,
  5046. extglobChars(chars) {
  5047. return {
  5048. "!": {
  5049. type: "negate",
  5050. open: "(?:(?!(?:",
  5051. close: `))${chars.STAR})`
  5052. },
  5053. "?": {
  5054. type: "qmark",
  5055. open: "(?:",
  5056. close: ")?"
  5057. },
  5058. "+": {
  5059. type: "plus",
  5060. open: "(?:",
  5061. close: ")+"
  5062. },
  5063. "*": {
  5064. type: "star",
  5065. open: "(?:",
  5066. close: ")*"
  5067. },
  5068. "@": {
  5069. type: "at",
  5070. open: "(?:",
  5071. close: ")"
  5072. }
  5073. };
  5074. },
  5075. globChars(win32) {
  5076. return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  5077. }
  5078. };
  5079. }
  5080. });
  5081. var require_utils3 = __commonJS2({
  5082. "node_modules/picomatch/lib/utils.js"(exports2) {
  5083. "use strict";
  5084. var path = require("path");
  5085. var win32 = process.platform === "win32";
  5086. var {
  5087. REGEX_BACKSLASH,
  5088. REGEX_REMOVE_BACKSLASH,
  5089. REGEX_SPECIAL_CHARS,
  5090. REGEX_SPECIAL_CHARS_GLOBAL
  5091. } = require_constants2();
  5092. exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  5093. exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  5094. exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
  5095. exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  5096. exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  5097. exports2.removeBackslashes = (str) => {
  5098. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  5099. return match === "\\" ? "" : match;
  5100. });
  5101. };
  5102. exports2.supportsLookbehinds = () => {
  5103. const segs = process.version.slice(1).split(".").map(Number);
  5104. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
  5105. return true;
  5106. }
  5107. return false;
  5108. };
  5109. exports2.isWindows = (options) => {
  5110. if (options && typeof options.windows === "boolean") {
  5111. return options.windows;
  5112. }
  5113. return win32 === true || path.sep === "\\";
  5114. };
  5115. exports2.escapeLast = (input, char, lastIdx) => {
  5116. const idx = input.lastIndexOf(char, lastIdx);
  5117. if (idx === -1)
  5118. return input;
  5119. if (input[idx - 1] === "\\")
  5120. return exports2.escapeLast(input, char, idx - 1);
  5121. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  5122. };
  5123. exports2.removePrefix = (input, state = {}) => {
  5124. let output = input;
  5125. if (output.startsWith("./")) {
  5126. output = output.slice(2);
  5127. state.prefix = "./";
  5128. }
  5129. return output;
  5130. };
  5131. exports2.wrapOutput = (input, state = {}, options = {}) => {
  5132. const prepend = options.contains ? "" : "^";
  5133. const append = options.contains ? "" : "$";
  5134. let output = `${prepend}(?:${input})${append}`;
  5135. if (state.negated === true) {
  5136. output = `(?:^(?!${output}).*$)`;
  5137. }
  5138. return output;
  5139. };
  5140. }
  5141. });
  5142. var require_scan = __commonJS2({
  5143. "node_modules/picomatch/lib/scan.js"(exports2, module2) {
  5144. "use strict";
  5145. var utils = require_utils3();
  5146. var {
  5147. CHAR_ASTERISK,
  5148. CHAR_AT,
  5149. CHAR_BACKWARD_SLASH,
  5150. CHAR_COMMA,
  5151. CHAR_DOT,
  5152. CHAR_EXCLAMATION_MARK,
  5153. CHAR_FORWARD_SLASH,
  5154. CHAR_LEFT_CURLY_BRACE,
  5155. CHAR_LEFT_PARENTHESES,
  5156. CHAR_LEFT_SQUARE_BRACKET,
  5157. CHAR_PLUS,
  5158. CHAR_QUESTION_MARK,
  5159. CHAR_RIGHT_CURLY_BRACE,
  5160. CHAR_RIGHT_PARENTHESES,
  5161. CHAR_RIGHT_SQUARE_BRACKET
  5162. } = require_constants2();
  5163. var isPathSeparator = (code) => {
  5164. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  5165. };
  5166. var depth = (token) => {
  5167. if (token.isPrefix !== true) {
  5168. token.depth = token.isGlobstar ? Infinity : 1;
  5169. }
  5170. };
  5171. var scan = (input, options) => {
  5172. const opts = options || {};
  5173. const length = input.length - 1;
  5174. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  5175. const slashes = [];
  5176. const tokens = [];
  5177. const parts = [];
  5178. let str = input;
  5179. let index = -1;
  5180. let start = 0;
  5181. let lastIndex = 0;
  5182. let isBrace = false;
  5183. let isBracket = false;
  5184. let isGlob = false;
  5185. let isExtglob = false;
  5186. let isGlobstar = false;
  5187. let braceEscaped = false;
  5188. let backslashes = false;
  5189. let negated = false;
  5190. let negatedExtglob = false;
  5191. let finished = false;
  5192. let braces = 0;
  5193. let prev;
  5194. let code;
  5195. let token = {
  5196. value: "",
  5197. depth: 0,
  5198. isGlob: false
  5199. };
  5200. const eos = () => index >= length;
  5201. const peek = () => str.charCodeAt(index + 1);
  5202. const advance = () => {
  5203. prev = code;
  5204. return str.charCodeAt(++index);
  5205. };
  5206. while (index < length) {
  5207. code = advance();
  5208. let next;
  5209. if (code === CHAR_BACKWARD_SLASH) {
  5210. backslashes = token.backslashes = true;
  5211. code = advance();
  5212. if (code === CHAR_LEFT_CURLY_BRACE) {
  5213. braceEscaped = true;
  5214. }
  5215. continue;
  5216. }
  5217. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  5218. braces++;
  5219. while (eos() !== true && (code = advance())) {
  5220. if (code === CHAR_BACKWARD_SLASH) {
  5221. backslashes = token.backslashes = true;
  5222. advance();
  5223. continue;
  5224. }
  5225. if (code === CHAR_LEFT_CURLY_BRACE) {
  5226. braces++;
  5227. continue;
  5228. }
  5229. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  5230. isBrace = token.isBrace = true;
  5231. isGlob = token.isGlob = true;
  5232. finished = true;
  5233. if (scanToEnd === true) {
  5234. continue;
  5235. }
  5236. break;
  5237. }
  5238. if (braceEscaped !== true && code === CHAR_COMMA) {
  5239. isBrace = token.isBrace = true;
  5240. isGlob = token.isGlob = true;
  5241. finished = true;
  5242. if (scanToEnd === true) {
  5243. continue;
  5244. }
  5245. break;
  5246. }
  5247. if (code === CHAR_RIGHT_CURLY_BRACE) {
  5248. braces--;
  5249. if (braces === 0) {
  5250. braceEscaped = false;
  5251. isBrace = token.isBrace = true;
  5252. finished = true;
  5253. break;
  5254. }
  5255. }
  5256. }
  5257. if (scanToEnd === true) {
  5258. continue;
  5259. }
  5260. break;
  5261. }
  5262. if (code === CHAR_FORWARD_SLASH) {
  5263. slashes.push(index);
  5264. tokens.push(token);
  5265. token = {
  5266. value: "",
  5267. depth: 0,
  5268. isGlob: false
  5269. };
  5270. if (finished === true)
  5271. continue;
  5272. if (prev === CHAR_DOT && index === start + 1) {
  5273. start += 2;
  5274. continue;
  5275. }
  5276. lastIndex = index + 1;
  5277. continue;
  5278. }
  5279. if (opts.noext !== true) {
  5280. const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
  5281. if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
  5282. isGlob = token.isGlob = true;
  5283. isExtglob = token.isExtglob = true;
  5284. finished = true;
  5285. if (code === CHAR_EXCLAMATION_MARK && index === start) {
  5286. negatedExtglob = true;
  5287. }
  5288. if (scanToEnd === true) {
  5289. while (eos() !== true && (code = advance())) {
  5290. if (code === CHAR_BACKWARD_SLASH) {
  5291. backslashes = token.backslashes = true;
  5292. code = advance();
  5293. continue;
  5294. }
  5295. if (code === CHAR_RIGHT_PARENTHESES) {
  5296. isGlob = token.isGlob = true;
  5297. finished = true;
  5298. break;
  5299. }
  5300. }
  5301. continue;
  5302. }
  5303. break;
  5304. }
  5305. }
  5306. if (code === CHAR_ASTERISK) {
  5307. if (prev === CHAR_ASTERISK)
  5308. isGlobstar = token.isGlobstar = true;
  5309. isGlob = token.isGlob = true;
  5310. finished = true;
  5311. if (scanToEnd === true) {
  5312. continue;
  5313. }
  5314. break;
  5315. }
  5316. if (code === CHAR_QUESTION_MARK) {
  5317. isGlob = token.isGlob = true;
  5318. finished = true;
  5319. if (scanToEnd === true) {
  5320. continue;
  5321. }
  5322. break;
  5323. }
  5324. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  5325. while (eos() !== true && (next = advance())) {
  5326. if (next === CHAR_BACKWARD_SLASH) {
  5327. backslashes = token.backslashes = true;
  5328. advance();
  5329. continue;
  5330. }
  5331. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  5332. isBracket = token.isBracket = true;
  5333. isGlob = token.isGlob = true;
  5334. finished = true;
  5335. break;
  5336. }
  5337. }
  5338. if (scanToEnd === true) {
  5339. continue;
  5340. }
  5341. break;
  5342. }
  5343. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  5344. negated = token.negated = true;
  5345. start++;
  5346. continue;
  5347. }
  5348. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  5349. isGlob = token.isGlob = true;
  5350. if (scanToEnd === true) {
  5351. while (eos() !== true && (code = advance())) {
  5352. if (code === CHAR_LEFT_PARENTHESES) {
  5353. backslashes = token.backslashes = true;
  5354. code = advance();
  5355. continue;
  5356. }
  5357. if (code === CHAR_RIGHT_PARENTHESES) {
  5358. finished = true;
  5359. break;
  5360. }
  5361. }
  5362. continue;
  5363. }
  5364. break;
  5365. }
  5366. if (isGlob === true) {
  5367. finished = true;
  5368. if (scanToEnd === true) {
  5369. continue;
  5370. }
  5371. break;
  5372. }
  5373. }
  5374. if (opts.noext === true) {
  5375. isExtglob = false;
  5376. isGlob = false;
  5377. }
  5378. let base = str;
  5379. let prefix = "";
  5380. let glob = "";
  5381. if (start > 0) {
  5382. prefix = str.slice(0, start);
  5383. str = str.slice(start);
  5384. lastIndex -= start;
  5385. }
  5386. if (base && isGlob === true && lastIndex > 0) {
  5387. base = str.slice(0, lastIndex);
  5388. glob = str.slice(lastIndex);
  5389. } else if (isGlob === true) {
  5390. base = "";
  5391. glob = str;
  5392. } else {
  5393. base = str;
  5394. }
  5395. if (base && base !== "" && base !== "/" && base !== str) {
  5396. if (isPathSeparator(base.charCodeAt(base.length - 1))) {
  5397. base = base.slice(0, -1);
  5398. }
  5399. }
  5400. if (opts.unescape === true) {
  5401. if (glob)
  5402. glob = utils.removeBackslashes(glob);
  5403. if (base && backslashes === true) {
  5404. base = utils.removeBackslashes(base);
  5405. }
  5406. }
  5407. const state = {
  5408. prefix,
  5409. input,
  5410. start,
  5411. base,
  5412. glob,
  5413. isBrace,
  5414. isBracket,
  5415. isGlob,
  5416. isExtglob,
  5417. isGlobstar,
  5418. negated,
  5419. negatedExtglob
  5420. };
  5421. if (opts.tokens === true) {
  5422. state.maxDepth = 0;
  5423. if (!isPathSeparator(code)) {
  5424. tokens.push(token);
  5425. }
  5426. state.tokens = tokens;
  5427. }
  5428. if (opts.parts === true || opts.tokens === true) {
  5429. let prevIndex;
  5430. for (let idx = 0; idx < slashes.length; idx++) {
  5431. const n = prevIndex ? prevIndex + 1 : start;
  5432. const i = slashes[idx];
  5433. const value = input.slice(n, i);
  5434. if (opts.tokens) {
  5435. if (idx === 0 && start !== 0) {
  5436. tokens[idx].isPrefix = true;
  5437. tokens[idx].value = prefix;
  5438. } else {
  5439. tokens[idx].value = value;
  5440. }
  5441. depth(tokens[idx]);
  5442. state.maxDepth += tokens[idx].depth;
  5443. }
  5444. if (idx !== 0 || value !== "") {
  5445. parts.push(value);
  5446. }
  5447. prevIndex = i;
  5448. }
  5449. if (prevIndex && prevIndex + 1 < input.length) {
  5450. const value = input.slice(prevIndex + 1);
  5451. parts.push(value);
  5452. if (opts.tokens) {
  5453. tokens[tokens.length - 1].value = value;
  5454. depth(tokens[tokens.length - 1]);
  5455. state.maxDepth += tokens[tokens.length - 1].depth;
  5456. }
  5457. }
  5458. state.slashes = slashes;
  5459. state.parts = parts;
  5460. }
  5461. return state;
  5462. };
  5463. module2.exports = scan;
  5464. }
  5465. });
  5466. var require_parse2 = __commonJS2({
  5467. "node_modules/picomatch/lib/parse.js"(exports2, module2) {
  5468. "use strict";
  5469. var constants = require_constants2();
  5470. var utils = require_utils3();
  5471. var {
  5472. MAX_LENGTH,
  5473. POSIX_REGEX_SOURCE,
  5474. REGEX_NON_SPECIAL_CHARS,
  5475. REGEX_SPECIAL_CHARS_BACKREF,
  5476. REPLACEMENTS
  5477. } = constants;
  5478. var expandRange = (args, options) => {
  5479. if (typeof options.expandRange === "function") {
  5480. return options.expandRange(...args, options);
  5481. }
  5482. args.sort();
  5483. const value = `[${args.join("-")}]`;
  5484. try {
  5485. new RegExp(value);
  5486. } catch (ex) {
  5487. return args.map((v) => utils.escapeRegex(v)).join("..");
  5488. }
  5489. return value;
  5490. };
  5491. var syntaxError = (type, char) => {
  5492. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  5493. };
  5494. var parse = (input, options) => {
  5495. if (typeof input !== "string") {
  5496. throw new TypeError("Expected a string");
  5497. }
  5498. input = REPLACEMENTS[input] || input;
  5499. const opts = Object.assign({}, options);
  5500. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  5501. let len = input.length;
  5502. if (len > max) {
  5503. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  5504. }
  5505. const bos = {
  5506. type: "bos",
  5507. value: "",
  5508. output: opts.prepend || ""
  5509. };
  5510. const tokens = [bos];
  5511. const capture = opts.capture ? "" : "?:";
  5512. const win32 = utils.isWindows(options);
  5513. const PLATFORM_CHARS = constants.globChars(win32);
  5514. const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
  5515. const {
  5516. DOT_LITERAL,
  5517. PLUS_LITERAL,
  5518. SLASH_LITERAL,
  5519. ONE_CHAR,
  5520. DOTS_SLASH,
  5521. NO_DOT,
  5522. NO_DOT_SLASH,
  5523. NO_DOTS_SLASH,
  5524. QMARK,
  5525. QMARK_NO_DOT,
  5526. STAR,
  5527. START_ANCHOR
  5528. } = PLATFORM_CHARS;
  5529. const globstar = (opts2) => {
  5530. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  5531. };
  5532. const nodot = opts.dot ? "" : NO_DOT;
  5533. const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  5534. let star = opts.bash === true ? globstar(opts) : STAR;
  5535. if (opts.capture) {
  5536. star = `(${star})`;
  5537. }
  5538. if (typeof opts.noext === "boolean") {
  5539. opts.noextglob = opts.noext;
  5540. }
  5541. const state = {
  5542. input,
  5543. index: -1,
  5544. start: 0,
  5545. dot: opts.dot === true,
  5546. consumed: "",
  5547. output: "",
  5548. prefix: "",
  5549. backtrack: false,
  5550. negated: false,
  5551. brackets: 0,
  5552. braces: 0,
  5553. parens: 0,
  5554. quotes: 0,
  5555. globstar: false,
  5556. tokens
  5557. };
  5558. input = utils.removePrefix(input, state);
  5559. len = input.length;
  5560. const extglobs = [];
  5561. const braces = [];
  5562. const stack = [];
  5563. let prev = bos;
  5564. let value;
  5565. const eos = () => state.index === len - 1;
  5566. const peek = state.peek = (n = 1) => input[state.index + n];
  5567. const advance = state.advance = () => input[++state.index] || "";
  5568. const remaining = () => input.slice(state.index + 1);
  5569. const consume = (value2 = "", num = 0) => {
  5570. state.consumed += value2;
  5571. state.index += num;
  5572. };
  5573. const append = (token) => {
  5574. state.output += token.output != null ? token.output : token.value;
  5575. consume(token.value);
  5576. };
  5577. const negate = () => {
  5578. let count = 1;
  5579. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  5580. advance();
  5581. state.start++;
  5582. count++;
  5583. }
  5584. if (count % 2 === 0) {
  5585. return false;
  5586. }
  5587. state.negated = true;
  5588. state.start++;
  5589. return true;
  5590. };
  5591. const increment = (type) => {
  5592. state[type]++;
  5593. stack.push(type);
  5594. };
  5595. const decrement = (type) => {
  5596. state[type]--;
  5597. stack.pop();
  5598. };
  5599. const push = (tok) => {
  5600. if (prev.type === "globstar") {
  5601. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  5602. const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  5603. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
  5604. state.output = state.output.slice(0, -prev.output.length);
  5605. prev.type = "star";
  5606. prev.value = "*";
  5607. prev.output = star;
  5608. state.output += prev.output;
  5609. }
  5610. }
  5611. if (extglobs.length && tok.type !== "paren") {
  5612. extglobs[extglobs.length - 1].inner += tok.value;
  5613. }
  5614. if (tok.value || tok.output)
  5615. append(tok);
  5616. if (prev && prev.type === "text" && tok.type === "text") {
  5617. prev.value += tok.value;
  5618. prev.output = (prev.output || "") + tok.value;
  5619. return;
  5620. }
  5621. tok.prev = prev;
  5622. tokens.push(tok);
  5623. prev = tok;
  5624. };
  5625. const extglobOpen = (type, value2) => {
  5626. const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
  5627. conditions: 1,
  5628. inner: ""
  5629. });
  5630. token.prev = prev;
  5631. token.parens = state.parens;
  5632. token.output = state.output;
  5633. const output = (opts.capture ? "(" : "") + token.open;
  5634. increment("parens");
  5635. push({
  5636. type,
  5637. value: value2,
  5638. output: state.output ? "" : ONE_CHAR
  5639. });
  5640. push({
  5641. type: "paren",
  5642. extglob: true,
  5643. value: advance(),
  5644. output
  5645. });
  5646. extglobs.push(token);
  5647. };
  5648. const extglobClose = (token) => {
  5649. let output = token.close + (opts.capture ? ")" : "");
  5650. let rest;
  5651. if (token.type === "negate") {
  5652. let extglobStar = star;
  5653. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
  5654. extglobStar = globstar(opts);
  5655. }
  5656. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
  5657. output = token.close = `)$))${extglobStar}`;
  5658. }
  5659. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
  5660. const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
  5661. fastpaths: false
  5662. })).output;
  5663. output = token.close = `)${expression})${extglobStar})`;
  5664. }
  5665. if (token.prev.type === "bos") {
  5666. state.negatedExtglob = true;
  5667. }
  5668. }
  5669. push({
  5670. type: "paren",
  5671. extglob: true,
  5672. value,
  5673. output
  5674. });
  5675. decrement("parens");
  5676. };
  5677. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  5678. let backslashes = false;
  5679. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
  5680. if (first === "\\") {
  5681. backslashes = true;
  5682. return m;
  5683. }
  5684. if (first === "?") {
  5685. if (esc) {
  5686. return esc + first + (rest ? QMARK.repeat(rest.length) : "");
  5687. }
  5688. if (index === 0) {
  5689. return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
  5690. }
  5691. return QMARK.repeat(chars.length);
  5692. }
  5693. if (first === ".") {
  5694. return DOT_LITERAL.repeat(chars.length);
  5695. }
  5696. if (first === "*") {
  5697. if (esc) {
  5698. return esc + first + (rest ? star : "");
  5699. }
  5700. return star;
  5701. }
  5702. return esc ? m : `\\${m}`;
  5703. });
  5704. if (backslashes === true) {
  5705. if (opts.unescape === true) {
  5706. output = output.replace(/\\/g, "");
  5707. } else {
  5708. output = output.replace(/\\+/g, (m) => {
  5709. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  5710. });
  5711. }
  5712. }
  5713. if (output === input && opts.contains === true) {
  5714. state.output = input;
  5715. return state;
  5716. }
  5717. state.output = utils.wrapOutput(output, state, options);
  5718. return state;
  5719. }
  5720. while (!eos()) {
  5721. value = advance();
  5722. if (value === "\0") {
  5723. continue;
  5724. }
  5725. if (value === "\\") {
  5726. const next = peek();
  5727. if (next === "/" && opts.bash !== true) {
  5728. continue;
  5729. }
  5730. if (next === "." || next === ";") {
  5731. continue;
  5732. }
  5733. if (!next) {
  5734. value += "\\";
  5735. push({
  5736. type: "text",
  5737. value
  5738. });
  5739. continue;
  5740. }
  5741. const match = /^\\+/.exec(remaining());
  5742. let slashes = 0;
  5743. if (match && match[0].length > 2) {
  5744. slashes = match[0].length;
  5745. state.index += slashes;
  5746. if (slashes % 2 !== 0) {
  5747. value += "\\";
  5748. }
  5749. }
  5750. if (opts.unescape === true) {
  5751. value = advance();
  5752. } else {
  5753. value += advance();
  5754. }
  5755. if (state.brackets === 0) {
  5756. push({
  5757. type: "text",
  5758. value
  5759. });
  5760. continue;
  5761. }
  5762. }
  5763. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  5764. if (opts.posix !== false && value === ":") {
  5765. const inner = prev.value.slice(1);
  5766. if (inner.includes("[")) {
  5767. prev.posix = true;
  5768. if (inner.includes(":")) {
  5769. const idx = prev.value.lastIndexOf("[");
  5770. const pre = prev.value.slice(0, idx);
  5771. const rest2 = prev.value.slice(idx + 2);
  5772. const posix = POSIX_REGEX_SOURCE[rest2];
  5773. if (posix) {
  5774. prev.value = pre + posix;
  5775. state.backtrack = true;
  5776. advance();
  5777. if (!bos.output && tokens.indexOf(prev) === 1) {
  5778. bos.output = ONE_CHAR;
  5779. }
  5780. continue;
  5781. }
  5782. }
  5783. }
  5784. }
  5785. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
  5786. value = `\\${value}`;
  5787. }
  5788. if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
  5789. value = `\\${value}`;
  5790. }
  5791. if (opts.posix === true && value === "!" && prev.value === "[") {
  5792. value = "^";
  5793. }
  5794. prev.value += value;
  5795. append({
  5796. value
  5797. });
  5798. continue;
  5799. }
  5800. if (state.quotes === 1 && value !== '"') {
  5801. value = utils.escapeRegex(value);
  5802. prev.value += value;
  5803. append({
  5804. value
  5805. });
  5806. continue;
  5807. }
  5808. if (value === '"') {
  5809. state.quotes = state.quotes === 1 ? 0 : 1;
  5810. if (opts.keepQuotes === true) {
  5811. push({
  5812. type: "text",
  5813. value
  5814. });
  5815. }
  5816. continue;
  5817. }
  5818. if (value === "(") {
  5819. increment("parens");
  5820. push({
  5821. type: "paren",
  5822. value
  5823. });
  5824. continue;
  5825. }
  5826. if (value === ")") {
  5827. if (state.parens === 0 && opts.strictBrackets === true) {
  5828. throw new SyntaxError(syntaxError("opening", "("));
  5829. }
  5830. const extglob = extglobs[extglobs.length - 1];
  5831. if (extglob && state.parens === extglob.parens + 1) {
  5832. extglobClose(extglobs.pop());
  5833. continue;
  5834. }
  5835. push({
  5836. type: "paren",
  5837. value,
  5838. output: state.parens ? ")" : "\\)"
  5839. });
  5840. decrement("parens");
  5841. continue;
  5842. }
  5843. if (value === "[") {
  5844. if (opts.nobracket === true || !remaining().includes("]")) {
  5845. if (opts.nobracket !== true && opts.strictBrackets === true) {
  5846. throw new SyntaxError(syntaxError("closing", "]"));
  5847. }
  5848. value = `\\${value}`;
  5849. } else {
  5850. increment("brackets");
  5851. }
  5852. push({
  5853. type: "bracket",
  5854. value
  5855. });
  5856. continue;
  5857. }
  5858. if (value === "]") {
  5859. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  5860. push({
  5861. type: "text",
  5862. value,
  5863. output: `\\${value}`
  5864. });
  5865. continue;
  5866. }
  5867. if (state.brackets === 0) {
  5868. if (opts.strictBrackets === true) {
  5869. throw new SyntaxError(syntaxError("opening", "["));
  5870. }
  5871. push({
  5872. type: "text",
  5873. value,
  5874. output: `\\${value}`
  5875. });
  5876. continue;
  5877. }
  5878. decrement("brackets");
  5879. const prevValue = prev.value.slice(1);
  5880. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
  5881. value = `/${value}`;
  5882. }
  5883. prev.value += value;
  5884. append({
  5885. value
  5886. });
  5887. if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
  5888. continue;
  5889. }
  5890. const escaped = utils.escapeRegex(prev.value);
  5891. state.output = state.output.slice(0, -prev.value.length);
  5892. if (opts.literalBrackets === true) {
  5893. state.output += escaped;
  5894. prev.value = escaped;
  5895. continue;
  5896. }
  5897. prev.value = `(${capture}${escaped}|${prev.value})`;
  5898. state.output += prev.value;
  5899. continue;
  5900. }
  5901. if (value === "{" && opts.nobrace !== true) {
  5902. increment("braces");
  5903. const open = {
  5904. type: "brace",
  5905. value,
  5906. output: "(",
  5907. outputIndex: state.output.length,
  5908. tokensIndex: state.tokens.length
  5909. };
  5910. braces.push(open);
  5911. push(open);
  5912. continue;
  5913. }
  5914. if (value === "}") {
  5915. const brace = braces[braces.length - 1];
  5916. if (opts.nobrace === true || !brace) {
  5917. push({
  5918. type: "text",
  5919. value,
  5920. output: value
  5921. });
  5922. continue;
  5923. }
  5924. let output = ")";
  5925. if (brace.dots === true) {
  5926. const arr = tokens.slice();
  5927. const range = [];
  5928. for (let i = arr.length - 1; i >= 0; i--) {
  5929. tokens.pop();
  5930. if (arr[i].type === "brace") {
  5931. break;
  5932. }
  5933. if (arr[i].type !== "dots") {
  5934. range.unshift(arr[i].value);
  5935. }
  5936. }
  5937. output = expandRange(range, opts);
  5938. state.backtrack = true;
  5939. }
  5940. if (brace.comma !== true && brace.dots !== true) {
  5941. const out = state.output.slice(0, brace.outputIndex);
  5942. const toks = state.tokens.slice(brace.tokensIndex);
  5943. brace.value = brace.output = "\\{";
  5944. value = output = "\\}";
  5945. state.output = out;
  5946. for (const t of toks) {
  5947. state.output += t.output || t.value;
  5948. }
  5949. }
  5950. push({
  5951. type: "brace",
  5952. value,
  5953. output
  5954. });
  5955. decrement("braces");
  5956. braces.pop();
  5957. continue;
  5958. }
  5959. if (value === "|") {
  5960. if (extglobs.length > 0) {
  5961. extglobs[extglobs.length - 1].conditions++;
  5962. }
  5963. push({
  5964. type: "text",
  5965. value
  5966. });
  5967. continue;
  5968. }
  5969. if (value === ",") {
  5970. let output = value;
  5971. const brace = braces[braces.length - 1];
  5972. if (brace && stack[stack.length - 1] === "braces") {
  5973. brace.comma = true;
  5974. output = "|";
  5975. }
  5976. push({
  5977. type: "comma",
  5978. value,
  5979. output
  5980. });
  5981. continue;
  5982. }
  5983. if (value === "/") {
  5984. if (prev.type === "dot" && state.index === state.start + 1) {
  5985. state.start = state.index + 1;
  5986. state.consumed = "";
  5987. state.output = "";
  5988. tokens.pop();
  5989. prev = bos;
  5990. continue;
  5991. }
  5992. push({
  5993. type: "slash",
  5994. value,
  5995. output: SLASH_LITERAL
  5996. });
  5997. continue;
  5998. }
  5999. if (value === ".") {
  6000. if (state.braces > 0 && prev.type === "dot") {
  6001. if (prev.value === ".")
  6002. prev.output = DOT_LITERAL;
  6003. const brace = braces[braces.length - 1];
  6004. prev.type = "dots";
  6005. prev.output += value;
  6006. prev.value += value;
  6007. brace.dots = true;
  6008. continue;
  6009. }
  6010. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  6011. push({
  6012. type: "text",
  6013. value,
  6014. output: DOT_LITERAL
  6015. });
  6016. continue;
  6017. }
  6018. push({
  6019. type: "dot",
  6020. value,
  6021. output: DOT_LITERAL
  6022. });
  6023. continue;
  6024. }
  6025. if (value === "?") {
  6026. const isGroup = prev && prev.value === "(";
  6027. if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6028. extglobOpen("qmark", value);
  6029. continue;
  6030. }
  6031. if (prev && prev.type === "paren") {
  6032. const next = peek();
  6033. let output = value;
  6034. if (next === "<" && !utils.supportsLookbehinds()) {
  6035. throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  6036. }
  6037. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
  6038. output = `\\${value}`;
  6039. }
  6040. push({
  6041. type: "text",
  6042. value,
  6043. output
  6044. });
  6045. continue;
  6046. }
  6047. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  6048. push({
  6049. type: "qmark",
  6050. value,
  6051. output: QMARK_NO_DOT
  6052. });
  6053. continue;
  6054. }
  6055. push({
  6056. type: "qmark",
  6057. value,
  6058. output: QMARK
  6059. });
  6060. continue;
  6061. }
  6062. if (value === "!") {
  6063. if (opts.noextglob !== true && peek() === "(") {
  6064. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  6065. extglobOpen("negate", value);
  6066. continue;
  6067. }
  6068. }
  6069. if (opts.nonegate !== true && state.index === 0) {
  6070. negate();
  6071. continue;
  6072. }
  6073. }
  6074. if (value === "+") {
  6075. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6076. extglobOpen("plus", value);
  6077. continue;
  6078. }
  6079. if (prev && prev.value === "(" || opts.regex === false) {
  6080. push({
  6081. type: "plus",
  6082. value,
  6083. output: PLUS_LITERAL
  6084. });
  6085. continue;
  6086. }
  6087. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  6088. push({
  6089. type: "plus",
  6090. value
  6091. });
  6092. continue;
  6093. }
  6094. push({
  6095. type: "plus",
  6096. value: PLUS_LITERAL
  6097. });
  6098. continue;
  6099. }
  6100. if (value === "@") {
  6101. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6102. push({
  6103. type: "at",
  6104. extglob: true,
  6105. value,
  6106. output: ""
  6107. });
  6108. continue;
  6109. }
  6110. push({
  6111. type: "text",
  6112. value
  6113. });
  6114. continue;
  6115. }
  6116. if (value !== "*") {
  6117. if (value === "$" || value === "^") {
  6118. value = `\\${value}`;
  6119. }
  6120. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  6121. if (match) {
  6122. value += match[0];
  6123. state.index += match[0].length;
  6124. }
  6125. push({
  6126. type: "text",
  6127. value
  6128. });
  6129. continue;
  6130. }
  6131. if (prev && (prev.type === "globstar" || prev.star === true)) {
  6132. prev.type = "star";
  6133. prev.star = true;
  6134. prev.value += value;
  6135. prev.output = star;
  6136. state.backtrack = true;
  6137. state.globstar = true;
  6138. consume(value);
  6139. continue;
  6140. }
  6141. let rest = remaining();
  6142. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  6143. extglobOpen("star", value);
  6144. continue;
  6145. }
  6146. if (prev.type === "star") {
  6147. if (opts.noglobstar === true) {
  6148. consume(value);
  6149. continue;
  6150. }
  6151. const prior = prev.prev;
  6152. const before = prior.prev;
  6153. const isStart = prior.type === "slash" || prior.type === "bos";
  6154. const afterStar = before && (before.type === "star" || before.type === "globstar");
  6155. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  6156. push({
  6157. type: "star",
  6158. value,
  6159. output: ""
  6160. });
  6161. continue;
  6162. }
  6163. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  6164. const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  6165. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
  6166. push({
  6167. type: "star",
  6168. value,
  6169. output: ""
  6170. });
  6171. continue;
  6172. }
  6173. while (rest.slice(0, 3) === "/**") {
  6174. const after = input[state.index + 4];
  6175. if (after && after !== "/") {
  6176. break;
  6177. }
  6178. rest = rest.slice(3);
  6179. consume("/**", 3);
  6180. }
  6181. if (prior.type === "bos" && eos()) {
  6182. prev.type = "globstar";
  6183. prev.value += value;
  6184. prev.output = globstar(opts);
  6185. state.output = prev.output;
  6186. state.globstar = true;
  6187. consume(value);
  6188. continue;
  6189. }
  6190. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  6191. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6192. prior.output = `(?:${prior.output}`;
  6193. prev.type = "globstar";
  6194. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  6195. prev.value += value;
  6196. state.globstar = true;
  6197. state.output += prior.output + prev.output;
  6198. consume(value);
  6199. continue;
  6200. }
  6201. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  6202. const end = rest[1] !== void 0 ? "|$" : "";
  6203. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6204. prior.output = `(?:${prior.output}`;
  6205. prev.type = "globstar";
  6206. prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
  6207. prev.value += value;
  6208. state.output += prior.output + prev.output;
  6209. state.globstar = true;
  6210. consume(value + advance());
  6211. push({
  6212. type: "slash",
  6213. value: "/",
  6214. output: ""
  6215. });
  6216. continue;
  6217. }
  6218. if (prior.type === "bos" && rest[0] === "/") {
  6219. prev.type = "globstar";
  6220. prev.value += value;
  6221. prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
  6222. state.output = prev.output;
  6223. state.globstar = true;
  6224. consume(value + advance());
  6225. push({
  6226. type: "slash",
  6227. value: "/",
  6228. output: ""
  6229. });
  6230. continue;
  6231. }
  6232. state.output = state.output.slice(0, -prev.output.length);
  6233. prev.type = "globstar";
  6234. prev.output = globstar(opts);
  6235. prev.value += value;
  6236. state.output += prev.output;
  6237. state.globstar = true;
  6238. consume(value);
  6239. continue;
  6240. }
  6241. const token = {
  6242. type: "star",
  6243. value,
  6244. output: star
  6245. };
  6246. if (opts.bash === true) {
  6247. token.output = ".*?";
  6248. if (prev.type === "bos" || prev.type === "slash") {
  6249. token.output = nodot + token.output;
  6250. }
  6251. push(token);
  6252. continue;
  6253. }
  6254. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  6255. token.output = value;
  6256. push(token);
  6257. continue;
  6258. }
  6259. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  6260. if (prev.type === "dot") {
  6261. state.output += NO_DOT_SLASH;
  6262. prev.output += NO_DOT_SLASH;
  6263. } else if (opts.dot === true) {
  6264. state.output += NO_DOTS_SLASH;
  6265. prev.output += NO_DOTS_SLASH;
  6266. } else {
  6267. state.output += nodot;
  6268. prev.output += nodot;
  6269. }
  6270. if (peek() !== "*") {
  6271. state.output += ONE_CHAR;
  6272. prev.output += ONE_CHAR;
  6273. }
  6274. }
  6275. push(token);
  6276. }
  6277. while (state.brackets > 0) {
  6278. if (opts.strictBrackets === true)
  6279. throw new SyntaxError(syntaxError("closing", "]"));
  6280. state.output = utils.escapeLast(state.output, "[");
  6281. decrement("brackets");
  6282. }
  6283. while (state.parens > 0) {
  6284. if (opts.strictBrackets === true)
  6285. throw new SyntaxError(syntaxError("closing", ")"));
  6286. state.output = utils.escapeLast(state.output, "(");
  6287. decrement("parens");
  6288. }
  6289. while (state.braces > 0) {
  6290. if (opts.strictBrackets === true)
  6291. throw new SyntaxError(syntaxError("closing", "}"));
  6292. state.output = utils.escapeLast(state.output, "{");
  6293. decrement("braces");
  6294. }
  6295. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
  6296. push({
  6297. type: "maybe_slash",
  6298. value: "",
  6299. output: `${SLASH_LITERAL}?`
  6300. });
  6301. }
  6302. if (state.backtrack === true) {
  6303. state.output = "";
  6304. for (const token of state.tokens) {
  6305. state.output += token.output != null ? token.output : token.value;
  6306. if (token.suffix) {
  6307. state.output += token.suffix;
  6308. }
  6309. }
  6310. }
  6311. return state;
  6312. };
  6313. parse.fastpaths = (input, options) => {
  6314. const opts = Object.assign({}, options);
  6315. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  6316. const len = input.length;
  6317. if (len > max) {
  6318. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  6319. }
  6320. input = REPLACEMENTS[input] || input;
  6321. const win32 = utils.isWindows(options);
  6322. const {
  6323. DOT_LITERAL,
  6324. SLASH_LITERAL,
  6325. ONE_CHAR,
  6326. DOTS_SLASH,
  6327. NO_DOT,
  6328. NO_DOTS,
  6329. NO_DOTS_SLASH,
  6330. STAR,
  6331. START_ANCHOR
  6332. } = constants.globChars(win32);
  6333. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  6334. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  6335. const capture = opts.capture ? "" : "?:";
  6336. const state = {
  6337. negated: false,
  6338. prefix: ""
  6339. };
  6340. let star = opts.bash === true ? ".*?" : STAR;
  6341. if (opts.capture) {
  6342. star = `(${star})`;
  6343. }
  6344. const globstar = (opts2) => {
  6345. if (opts2.noglobstar === true)
  6346. return star;
  6347. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  6348. };
  6349. const create = (str) => {
  6350. switch (str) {
  6351. case "*":
  6352. return `${nodot}${ONE_CHAR}${star}`;
  6353. case ".*":
  6354. return `${DOT_LITERAL}${ONE_CHAR}${star}`;
  6355. case "*.*":
  6356. return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6357. case "*/*":
  6358. return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
  6359. case "**":
  6360. return nodot + globstar(opts);
  6361. case "**/*":
  6362. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
  6363. case "**/*.*":
  6364. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6365. case "**/.*":
  6366. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
  6367. default: {
  6368. const match = /^(.*?)\.(\w+)$/.exec(str);
  6369. if (!match)
  6370. return;
  6371. const source2 = create(match[1]);
  6372. if (!source2)
  6373. return;
  6374. return source2 + DOT_LITERAL + match[2];
  6375. }
  6376. }
  6377. };
  6378. const output = utils.removePrefix(input, state);
  6379. let source = create(output);
  6380. if (source && opts.strictSlashes !== true) {
  6381. source += `${SLASH_LITERAL}?`;
  6382. }
  6383. return source;
  6384. };
  6385. module2.exports = parse;
  6386. }
  6387. });
  6388. var require_picomatch = __commonJS2({
  6389. "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
  6390. "use strict";
  6391. var path = require("path");
  6392. var scan = require_scan();
  6393. var parse = require_parse2();
  6394. var utils = require_utils3();
  6395. var constants = require_constants2();
  6396. var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  6397. var picomatch = (glob, options, returnState = false) => {
  6398. if (Array.isArray(glob)) {
  6399. const fns = glob.map((input) => picomatch(input, options, returnState));
  6400. const arrayMatcher = (str) => {
  6401. for (const isMatch of fns) {
  6402. const state2 = isMatch(str);
  6403. if (state2)
  6404. return state2;
  6405. }
  6406. return false;
  6407. };
  6408. return arrayMatcher;
  6409. }
  6410. const isState = isObject(glob) && glob.tokens && glob.input;
  6411. if (glob === "" || typeof glob !== "string" && !isState) {
  6412. throw new TypeError("Expected pattern to be a non-empty string");
  6413. }
  6414. const opts = options || {};
  6415. const posix = utils.isWindows(options);
  6416. const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
  6417. const state = regex.state;
  6418. delete regex.state;
  6419. let isIgnored = () => false;
  6420. if (opts.ignore) {
  6421. const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
  6422. ignore: null,
  6423. onMatch: null,
  6424. onResult: null
  6425. });
  6426. isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
  6427. }
  6428. const matcher = (input, returnObject = false) => {
  6429. const {
  6430. isMatch,
  6431. match,
  6432. output
  6433. } = picomatch.test(input, regex, options, {
  6434. glob,
  6435. posix
  6436. });
  6437. const result = {
  6438. glob,
  6439. state,
  6440. regex,
  6441. posix,
  6442. input,
  6443. output,
  6444. match,
  6445. isMatch
  6446. };
  6447. if (typeof opts.onResult === "function") {
  6448. opts.onResult(result);
  6449. }
  6450. if (isMatch === false) {
  6451. result.isMatch = false;
  6452. return returnObject ? result : false;
  6453. }
  6454. if (isIgnored(input)) {
  6455. if (typeof opts.onIgnore === "function") {
  6456. opts.onIgnore(result);
  6457. }
  6458. result.isMatch = false;
  6459. return returnObject ? result : false;
  6460. }
  6461. if (typeof opts.onMatch === "function") {
  6462. opts.onMatch(result);
  6463. }
  6464. return returnObject ? result : true;
  6465. };
  6466. if (returnState) {
  6467. matcher.state = state;
  6468. }
  6469. return matcher;
  6470. };
  6471. picomatch.test = (input, regex, options, {
  6472. glob,
  6473. posix
  6474. } = {}) => {
  6475. if (typeof input !== "string") {
  6476. throw new TypeError("Expected input to be a string");
  6477. }
  6478. if (input === "") {
  6479. return {
  6480. isMatch: false,
  6481. output: ""
  6482. };
  6483. }
  6484. const opts = options || {};
  6485. const format = opts.format || (posix ? utils.toPosixSlashes : null);
  6486. let match = input === glob;
  6487. let output = match && format ? format(input) : input;
  6488. if (match === false) {
  6489. output = format ? format(input) : input;
  6490. match = output === glob;
  6491. }
  6492. if (match === false || opts.capture === true) {
  6493. if (opts.matchBase === true || opts.basename === true) {
  6494. match = picomatch.matchBase(input, regex, options, posix);
  6495. } else {
  6496. match = regex.exec(output);
  6497. }
  6498. }
  6499. return {
  6500. isMatch: Boolean(match),
  6501. match,
  6502. output
  6503. };
  6504. };
  6505. picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
  6506. const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
  6507. return regex.test(path.basename(input));
  6508. };
  6509. picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6510. picomatch.parse = (pattern, options) => {
  6511. if (Array.isArray(pattern))
  6512. return pattern.map((p) => picomatch.parse(p, options));
  6513. return parse(pattern, Object.assign(Object.assign({}, options), {}, {
  6514. fastpaths: false
  6515. }));
  6516. };
  6517. picomatch.scan = (input, options) => scan(input, options);
  6518. picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
  6519. if (returnOutput === true) {
  6520. return state.output;
  6521. }
  6522. const opts = options || {};
  6523. const prepend = opts.contains ? "" : "^";
  6524. const append = opts.contains ? "" : "$";
  6525. let source = `${prepend}(?:${state.output})${append}`;
  6526. if (state && state.negated === true) {
  6527. source = `^(?!${source}).*$`;
  6528. }
  6529. const regex = picomatch.toRegex(source, options);
  6530. if (returnState === true) {
  6531. regex.state = state;
  6532. }
  6533. return regex;
  6534. };
  6535. picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  6536. if (!input || typeof input !== "string") {
  6537. throw new TypeError("Expected a non-empty string");
  6538. }
  6539. let parsed = {
  6540. negated: false,
  6541. fastpaths: true
  6542. };
  6543. if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
  6544. parsed.output = parse.fastpaths(input, options);
  6545. }
  6546. if (!parsed.output) {
  6547. parsed = parse(input, options);
  6548. }
  6549. return picomatch.compileRe(parsed, options, returnOutput, returnState);
  6550. };
  6551. picomatch.toRegex = (source, options) => {
  6552. try {
  6553. const opts = options || {};
  6554. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  6555. } catch (err) {
  6556. if (options && options.debug === true)
  6557. throw err;
  6558. return /$^/;
  6559. }
  6560. };
  6561. picomatch.constants = constants;
  6562. module2.exports = picomatch;
  6563. }
  6564. });
  6565. var require_picomatch2 = __commonJS2({
  6566. "node_modules/picomatch/index.js"(exports2, module2) {
  6567. "use strict";
  6568. module2.exports = require_picomatch();
  6569. }
  6570. });
  6571. var require_micromatch = __commonJS2({
  6572. "node_modules/micromatch/index.js"(exports2, module2) {
  6573. "use strict";
  6574. var util = require("util");
  6575. var braces = require_braces();
  6576. var picomatch = require_picomatch2();
  6577. var utils = require_utils3();
  6578. var isEmptyString = (val) => val === "" || val === "./";
  6579. var micromatch = (list, patterns, options) => {
  6580. patterns = [].concat(patterns);
  6581. list = [].concat(list);
  6582. let omit = /* @__PURE__ */ new Set();
  6583. let keep = /* @__PURE__ */ new Set();
  6584. let items = /* @__PURE__ */ new Set();
  6585. let negatives = 0;
  6586. let onResult = (state) => {
  6587. items.add(state.output);
  6588. if (options && options.onResult) {
  6589. options.onResult(state);
  6590. }
  6591. };
  6592. for (let i = 0; i < patterns.length; i++) {
  6593. let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
  6594. onResult
  6595. }), true);
  6596. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  6597. if (negated)
  6598. negatives++;
  6599. for (let item of list) {
  6600. let matched = isMatch(item, true);
  6601. let match = negated ? !matched.isMatch : matched.isMatch;
  6602. if (!match)
  6603. continue;
  6604. if (negated) {
  6605. omit.add(matched.output);
  6606. } else {
  6607. omit.delete(matched.output);
  6608. keep.add(matched.output);
  6609. }
  6610. }
  6611. }
  6612. let result = negatives === patterns.length ? [...items] : [...keep];
  6613. let matches = result.filter((item) => !omit.has(item));
  6614. if (options && matches.length === 0) {
  6615. if (options.failglob === true) {
  6616. throw new Error(`No matches found for "${patterns.join(", ")}"`);
  6617. }
  6618. if (options.nonull === true || options.nullglob === true) {
  6619. return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  6620. }
  6621. }
  6622. return matches;
  6623. };
  6624. micromatch.match = micromatch;
  6625. micromatch.matcher = (pattern, options) => picomatch(pattern, options);
  6626. micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6627. micromatch.any = micromatch.isMatch;
  6628. micromatch.not = (list, patterns, options = {}) => {
  6629. patterns = [].concat(patterns).map(String);
  6630. let result = /* @__PURE__ */ new Set();
  6631. let items = [];
  6632. let onResult = (state) => {
  6633. if (options.onResult)
  6634. options.onResult(state);
  6635. items.push(state.output);
  6636. };
  6637. let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
  6638. onResult
  6639. })));
  6640. for (let item of items) {
  6641. if (!matches.has(item)) {
  6642. result.add(item);
  6643. }
  6644. }
  6645. return [...result];
  6646. };
  6647. micromatch.contains = (str, pattern, options) => {
  6648. if (typeof str !== "string") {
  6649. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6650. }
  6651. if (Array.isArray(pattern)) {
  6652. return pattern.some((p) => micromatch.contains(str, p, options));
  6653. }
  6654. if (typeof pattern === "string") {
  6655. if (isEmptyString(str) || isEmptyString(pattern)) {
  6656. return false;
  6657. }
  6658. if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
  6659. return true;
  6660. }
  6661. }
  6662. return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
  6663. contains: true
  6664. }));
  6665. };
  6666. micromatch.matchKeys = (obj, patterns, options) => {
  6667. if (!utils.isObject(obj)) {
  6668. throw new TypeError("Expected the first argument to be an object");
  6669. }
  6670. let keys = micromatch(Object.keys(obj), patterns, options);
  6671. let res = {};
  6672. for (let key of keys)
  6673. res[key] = obj[key];
  6674. return res;
  6675. };
  6676. micromatch.some = (list, patterns, options) => {
  6677. let items = [].concat(list);
  6678. for (let pattern of [].concat(patterns)) {
  6679. let isMatch = picomatch(String(pattern), options);
  6680. if (items.some((item) => isMatch(item))) {
  6681. return true;
  6682. }
  6683. }
  6684. return false;
  6685. };
  6686. micromatch.every = (list, patterns, options) => {
  6687. let items = [].concat(list);
  6688. for (let pattern of [].concat(patterns)) {
  6689. let isMatch = picomatch(String(pattern), options);
  6690. if (!items.every((item) => isMatch(item))) {
  6691. return false;
  6692. }
  6693. }
  6694. return true;
  6695. };
  6696. micromatch.all = (str, patterns, options) => {
  6697. if (typeof str !== "string") {
  6698. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6699. }
  6700. return [].concat(patterns).every((p) => picomatch(p, options)(str));
  6701. };
  6702. micromatch.capture = (glob, input, options) => {
  6703. let posix = utils.isWindows(options);
  6704. let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
  6705. capture: true
  6706. }));
  6707. let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
  6708. if (match) {
  6709. return match.slice(1).map((v) => v === void 0 ? "" : v);
  6710. }
  6711. };
  6712. micromatch.makeRe = (...args) => picomatch.makeRe(...args);
  6713. micromatch.scan = (...args) => picomatch.scan(...args);
  6714. micromatch.parse = (patterns, options) => {
  6715. let res = [];
  6716. for (let pattern of [].concat(patterns || [])) {
  6717. for (let str of braces(String(pattern), options)) {
  6718. res.push(picomatch.parse(str, options));
  6719. }
  6720. }
  6721. return res;
  6722. };
  6723. micromatch.braces = (pattern, options) => {
  6724. if (typeof pattern !== "string")
  6725. throw new TypeError("Expected a string");
  6726. if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
  6727. return [pattern];
  6728. }
  6729. return braces(pattern, options);
  6730. };
  6731. micromatch.braceExpand = (pattern, options) => {
  6732. if (typeof pattern !== "string")
  6733. throw new TypeError("Expected a string");
  6734. return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
  6735. expand: true
  6736. }));
  6737. };
  6738. module2.exports = micromatch;
  6739. }
  6740. });
  6741. var require_pattern = __commonJS2({
  6742. "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
  6743. "use strict";
  6744. Object.defineProperty(exports2, "__esModule", {
  6745. value: true
  6746. });
  6747. 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;
  6748. var path = require("path");
  6749. var globParent = require_glob_parent();
  6750. var micromatch = require_micromatch();
  6751. var GLOBSTAR = "**";
  6752. var ESCAPE_SYMBOL = "\\";
  6753. var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  6754. var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  6755. var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  6756. var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  6757. var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  6758. function isStaticPattern(pattern, options = {}) {
  6759. return !isDynamicPattern(pattern, options);
  6760. }
  6761. exports2.isStaticPattern = isStaticPattern;
  6762. function isDynamicPattern(pattern, options = {}) {
  6763. if (pattern === "") {
  6764. return false;
  6765. }
  6766. if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
  6767. return true;
  6768. }
  6769. if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
  6770. return true;
  6771. }
  6772. if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
  6773. return true;
  6774. }
  6775. if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
  6776. return true;
  6777. }
  6778. return false;
  6779. }
  6780. exports2.isDynamicPattern = isDynamicPattern;
  6781. function hasBraceExpansion(pattern) {
  6782. const openingBraceIndex = pattern.indexOf("{");
  6783. if (openingBraceIndex === -1) {
  6784. return false;
  6785. }
  6786. const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
  6787. if (closingBraceIndex === -1) {
  6788. return false;
  6789. }
  6790. const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
  6791. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  6792. }
  6793. function convertToPositivePattern(pattern) {
  6794. return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
  6795. }
  6796. exports2.convertToPositivePattern = convertToPositivePattern;
  6797. function convertToNegativePattern(pattern) {
  6798. return "!" + pattern;
  6799. }
  6800. exports2.convertToNegativePattern = convertToNegativePattern;
  6801. function isNegativePattern(pattern) {
  6802. return pattern.startsWith("!") && pattern[1] !== "(";
  6803. }
  6804. exports2.isNegativePattern = isNegativePattern;
  6805. function isPositivePattern(pattern) {
  6806. return !isNegativePattern(pattern);
  6807. }
  6808. exports2.isPositivePattern = isPositivePattern;
  6809. function getNegativePatterns(patterns) {
  6810. return patterns.filter(isNegativePattern);
  6811. }
  6812. exports2.getNegativePatterns = getNegativePatterns;
  6813. function getPositivePatterns(patterns) {
  6814. return patterns.filter(isPositivePattern);
  6815. }
  6816. exports2.getPositivePatterns = getPositivePatterns;
  6817. function getPatternsInsideCurrentDirectory(patterns) {
  6818. return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
  6819. }
  6820. exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  6821. function getPatternsOutsideCurrentDirectory(patterns) {
  6822. return patterns.filter(isPatternRelatedToParentDirectory);
  6823. }
  6824. exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  6825. function isPatternRelatedToParentDirectory(pattern) {
  6826. return pattern.startsWith("..") || pattern.startsWith("./..");
  6827. }
  6828. exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  6829. function getBaseDirectory(pattern) {
  6830. return globParent(pattern, {
  6831. flipBackslashes: false
  6832. });
  6833. }
  6834. exports2.getBaseDirectory = getBaseDirectory;
  6835. function hasGlobStar(pattern) {
  6836. return pattern.includes(GLOBSTAR);
  6837. }
  6838. exports2.hasGlobStar = hasGlobStar;
  6839. function endsWithSlashGlobStar(pattern) {
  6840. return pattern.endsWith("/" + GLOBSTAR);
  6841. }
  6842. exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
  6843. function isAffectDepthOfReadingPattern(pattern) {
  6844. const basename = path.basename(pattern);
  6845. return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
  6846. }
  6847. exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  6848. function expandPatternsWithBraceExpansion(patterns) {
  6849. return patterns.reduce((collection, pattern) => {
  6850. return collection.concat(expandBraceExpansion(pattern));
  6851. }, []);
  6852. }
  6853. exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  6854. function expandBraceExpansion(pattern) {
  6855. return micromatch.braces(pattern, {
  6856. expand: true,
  6857. nodupes: true
  6858. });
  6859. }
  6860. exports2.expandBraceExpansion = expandBraceExpansion;
  6861. function getPatternParts(pattern, options) {
  6862. let {
  6863. parts
  6864. } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
  6865. parts: true
  6866. }));
  6867. if (parts.length === 0) {
  6868. parts = [pattern];
  6869. }
  6870. if (parts[0].startsWith("/")) {
  6871. parts[0] = parts[0].slice(1);
  6872. parts.unshift("");
  6873. }
  6874. return parts;
  6875. }
  6876. exports2.getPatternParts = getPatternParts;
  6877. function makeRe(pattern, options) {
  6878. return micromatch.makeRe(pattern, options);
  6879. }
  6880. exports2.makeRe = makeRe;
  6881. function convertPatternsToRe(patterns, options) {
  6882. return patterns.map((pattern) => makeRe(pattern, options));
  6883. }
  6884. exports2.convertPatternsToRe = convertPatternsToRe;
  6885. function matchAny(entry, patternsRe) {
  6886. return patternsRe.some((patternRe) => patternRe.test(entry));
  6887. }
  6888. exports2.matchAny = matchAny;
  6889. }
  6890. });
  6891. var require_merge2 = __commonJS2({
  6892. "node_modules/merge2/index.js"(exports2, module2) {
  6893. "use strict";
  6894. var Stream = require("stream");
  6895. var PassThrough = Stream.PassThrough;
  6896. var slice = Array.prototype.slice;
  6897. module2.exports = merge2;
  6898. function merge2() {
  6899. const streamsQueue = [];
  6900. const args = slice.call(arguments);
  6901. let merging = false;
  6902. let options = args[args.length - 1];
  6903. if (options && !Array.isArray(options) && options.pipe == null) {
  6904. args.pop();
  6905. } else {
  6906. options = {};
  6907. }
  6908. const doEnd = options.end !== false;
  6909. const doPipeError = options.pipeError === true;
  6910. if (options.objectMode == null) {
  6911. options.objectMode = true;
  6912. }
  6913. if (options.highWaterMark == null) {
  6914. options.highWaterMark = 64 * 1024;
  6915. }
  6916. const mergedStream = PassThrough(options);
  6917. function addStream() {
  6918. for (let i = 0, len = arguments.length; i < len; i++) {
  6919. streamsQueue.push(pauseStreams(arguments[i], options));
  6920. }
  6921. mergeStream();
  6922. return this;
  6923. }
  6924. function mergeStream() {
  6925. if (merging) {
  6926. return;
  6927. }
  6928. merging = true;
  6929. let streams = streamsQueue.shift();
  6930. if (!streams) {
  6931. process.nextTick(endStream);
  6932. return;
  6933. }
  6934. if (!Array.isArray(streams)) {
  6935. streams = [streams];
  6936. }
  6937. let pipesCount = streams.length + 1;
  6938. function next() {
  6939. if (--pipesCount > 0) {
  6940. return;
  6941. }
  6942. merging = false;
  6943. mergeStream();
  6944. }
  6945. function pipe(stream) {
  6946. function onend() {
  6947. stream.removeListener("merge2UnpipeEnd", onend);
  6948. stream.removeListener("end", onend);
  6949. if (doPipeError) {
  6950. stream.removeListener("error", onerror);
  6951. }
  6952. next();
  6953. }
  6954. function onerror(err) {
  6955. mergedStream.emit("error", err);
  6956. }
  6957. if (stream._readableState.endEmitted) {
  6958. return next();
  6959. }
  6960. stream.on("merge2UnpipeEnd", onend);
  6961. stream.on("end", onend);
  6962. if (doPipeError) {
  6963. stream.on("error", onerror);
  6964. }
  6965. stream.pipe(mergedStream, {
  6966. end: false
  6967. });
  6968. stream.resume();
  6969. }
  6970. for (let i = 0; i < streams.length; i++) {
  6971. pipe(streams[i]);
  6972. }
  6973. next();
  6974. }
  6975. function endStream() {
  6976. merging = false;
  6977. mergedStream.emit("queueDrain");
  6978. if (doEnd) {
  6979. mergedStream.end();
  6980. }
  6981. }
  6982. mergedStream.setMaxListeners(0);
  6983. mergedStream.add = addStream;
  6984. mergedStream.on("unpipe", function(stream) {
  6985. stream.emit("merge2UnpipeEnd");
  6986. });
  6987. if (args.length) {
  6988. addStream.apply(null, args);
  6989. }
  6990. return mergedStream;
  6991. }
  6992. function pauseStreams(streams, options) {
  6993. if (!Array.isArray(streams)) {
  6994. if (!streams._readableState && streams.pipe) {
  6995. streams = streams.pipe(PassThrough(options));
  6996. }
  6997. if (!streams._readableState || !streams.pause || !streams.pipe) {
  6998. throw new Error("Only readable stream can be merged.");
  6999. }
  7000. streams.pause();
  7001. } else {
  7002. for (let i = 0, len = streams.length; i < len; i++) {
  7003. streams[i] = pauseStreams(streams[i], options);
  7004. }
  7005. }
  7006. return streams;
  7007. }
  7008. }
  7009. });
  7010. var require_stream = __commonJS2({
  7011. "node_modules/fast-glob/out/utils/stream.js"(exports2) {
  7012. "use strict";
  7013. Object.defineProperty(exports2, "__esModule", {
  7014. value: true
  7015. });
  7016. exports2.merge = void 0;
  7017. var merge2 = require_merge2();
  7018. function merge(streams) {
  7019. const mergedStream = merge2(streams);
  7020. streams.forEach((stream) => {
  7021. stream.once("error", (error) => mergedStream.emit("error", error));
  7022. });
  7023. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  7024. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  7025. return mergedStream;
  7026. }
  7027. exports2.merge = merge;
  7028. function propagateCloseEventToSources(streams) {
  7029. streams.forEach((stream) => stream.emit("close"));
  7030. }
  7031. }
  7032. });
  7033. var require_string = __commonJS2({
  7034. "node_modules/fast-glob/out/utils/string.js"(exports2) {
  7035. "use strict";
  7036. Object.defineProperty(exports2, "__esModule", {
  7037. value: true
  7038. });
  7039. exports2.isEmpty = exports2.isString = void 0;
  7040. function isString(input) {
  7041. return typeof input === "string";
  7042. }
  7043. exports2.isString = isString;
  7044. function isEmpty(input) {
  7045. return input === "";
  7046. }
  7047. exports2.isEmpty = isEmpty;
  7048. }
  7049. });
  7050. var require_utils4 = __commonJS2({
  7051. "node_modules/fast-glob/out/utils/index.js"(exports2) {
  7052. "use strict";
  7053. Object.defineProperty(exports2, "__esModule", {
  7054. value: true
  7055. });
  7056. exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
  7057. var array2 = require_array();
  7058. exports2.array = array2;
  7059. var errno = require_errno();
  7060. exports2.errno = errno;
  7061. var fs = require_fs();
  7062. exports2.fs = fs;
  7063. var path = require_path();
  7064. exports2.path = path;
  7065. var pattern = require_pattern();
  7066. exports2.pattern = pattern;
  7067. var stream = require_stream();
  7068. exports2.stream = stream;
  7069. var string = require_string();
  7070. exports2.string = string;
  7071. }
  7072. });
  7073. var require_tasks = __commonJS2({
  7074. "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
  7075. "use strict";
  7076. Object.defineProperty(exports2, "__esModule", {
  7077. value: true
  7078. });
  7079. exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
  7080. var utils = require_utils4();
  7081. function generate(patterns, settings) {
  7082. const positivePatterns = getPositivePatterns(patterns);
  7083. const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
  7084. const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
  7085. const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
  7086. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  7087. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  7088. return staticTasks.concat(dynamicTasks);
  7089. }
  7090. exports2.generate = generate;
  7091. function convertPatternsToTasks(positive, negative, dynamic) {
  7092. const tasks = [];
  7093. const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
  7094. const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
  7095. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  7096. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  7097. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  7098. if ("." in insideCurrentDirectoryGroup) {
  7099. tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  7100. } else {
  7101. tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  7102. }
  7103. return tasks;
  7104. }
  7105. exports2.convertPatternsToTasks = convertPatternsToTasks;
  7106. function getPositivePatterns(patterns) {
  7107. return utils.pattern.getPositivePatterns(patterns);
  7108. }
  7109. exports2.getPositivePatterns = getPositivePatterns;
  7110. function getNegativePatternsAsPositive(patterns, ignore) {
  7111. const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
  7112. const positive = negative.map(utils.pattern.convertToPositivePattern);
  7113. return positive;
  7114. }
  7115. exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  7116. function groupPatternsByBaseDirectory(patterns) {
  7117. const group = {};
  7118. return patterns.reduce((collection, pattern) => {
  7119. const base = utils.pattern.getBaseDirectory(pattern);
  7120. if (base in collection) {
  7121. collection[base].push(pattern);
  7122. } else {
  7123. collection[base] = [pattern];
  7124. }
  7125. return collection;
  7126. }, group);
  7127. }
  7128. exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  7129. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  7130. return Object.keys(positive).map((base) => {
  7131. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  7132. });
  7133. }
  7134. exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  7135. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  7136. return {
  7137. dynamic,
  7138. positive,
  7139. negative,
  7140. base,
  7141. patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
  7142. };
  7143. }
  7144. exports2.convertPatternGroupToTask = convertPatternGroupToTask;
  7145. }
  7146. });
  7147. var require_patterns = __commonJS2({
  7148. "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
  7149. "use strict";
  7150. Object.defineProperty(exports2, "__esModule", {
  7151. value: true
  7152. });
  7153. exports2.removeDuplicateSlashes = exports2.transform = void 0;
  7154. var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  7155. function transform(patterns) {
  7156. return patterns.map((pattern) => removeDuplicateSlashes(pattern));
  7157. }
  7158. exports2.transform = transform;
  7159. function removeDuplicateSlashes(pattern) {
  7160. return pattern.replace(DOUBLE_SLASH_RE, "/");
  7161. }
  7162. exports2.removeDuplicateSlashes = removeDuplicateSlashes;
  7163. }
  7164. });
  7165. var require_async = __commonJS2({
  7166. "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
  7167. "use strict";
  7168. Object.defineProperty(exports2, "__esModule", {
  7169. value: true
  7170. });
  7171. exports2.read = void 0;
  7172. function read(path, settings, callback) {
  7173. settings.fs.lstat(path, (lstatError, lstat) => {
  7174. if (lstatError !== null) {
  7175. callFailureCallback(callback, lstatError);
  7176. return;
  7177. }
  7178. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7179. callSuccessCallback(callback, lstat);
  7180. return;
  7181. }
  7182. settings.fs.stat(path, (statError, stat) => {
  7183. if (statError !== null) {
  7184. if (settings.throwErrorOnBrokenSymbolicLink) {
  7185. callFailureCallback(callback, statError);
  7186. return;
  7187. }
  7188. callSuccessCallback(callback, lstat);
  7189. return;
  7190. }
  7191. if (settings.markSymbolicLink) {
  7192. stat.isSymbolicLink = () => true;
  7193. }
  7194. callSuccessCallback(callback, stat);
  7195. });
  7196. });
  7197. }
  7198. exports2.read = read;
  7199. function callFailureCallback(callback, error) {
  7200. callback(error);
  7201. }
  7202. function callSuccessCallback(callback, result) {
  7203. callback(null, result);
  7204. }
  7205. }
  7206. });
  7207. var require_sync = __commonJS2({
  7208. "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
  7209. "use strict";
  7210. Object.defineProperty(exports2, "__esModule", {
  7211. value: true
  7212. });
  7213. exports2.read = void 0;
  7214. function read(path, settings) {
  7215. const lstat = settings.fs.lstatSync(path);
  7216. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7217. return lstat;
  7218. }
  7219. try {
  7220. const stat = settings.fs.statSync(path);
  7221. if (settings.markSymbolicLink) {
  7222. stat.isSymbolicLink = () => true;
  7223. }
  7224. return stat;
  7225. } catch (error) {
  7226. if (!settings.throwErrorOnBrokenSymbolicLink) {
  7227. return lstat;
  7228. }
  7229. throw error;
  7230. }
  7231. }
  7232. exports2.read = read;
  7233. }
  7234. });
  7235. var require_fs2 = __commonJS2({
  7236. "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
  7237. "use strict";
  7238. Object.defineProperty(exports2, "__esModule", {
  7239. value: true
  7240. });
  7241. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7242. var fs = require("fs");
  7243. exports2.FILE_SYSTEM_ADAPTER = {
  7244. lstat: fs.lstat,
  7245. stat: fs.stat,
  7246. lstatSync: fs.lstatSync,
  7247. statSync: fs.statSync
  7248. };
  7249. function createFileSystemAdapter(fsMethods) {
  7250. if (fsMethods === void 0) {
  7251. return exports2.FILE_SYSTEM_ADAPTER;
  7252. }
  7253. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7254. }
  7255. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7256. }
  7257. });
  7258. var require_settings = __commonJS2({
  7259. "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
  7260. "use strict";
  7261. Object.defineProperty(exports2, "__esModule", {
  7262. value: true
  7263. });
  7264. var fs = require_fs2();
  7265. var Settings = class {
  7266. constructor(_options = {}) {
  7267. this._options = _options;
  7268. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  7269. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7270. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  7271. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7272. }
  7273. _getValue(option, value) {
  7274. return option !== null && option !== void 0 ? option : value;
  7275. }
  7276. };
  7277. exports2.default = Settings;
  7278. }
  7279. });
  7280. var require_out = __commonJS2({
  7281. "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
  7282. "use strict";
  7283. Object.defineProperty(exports2, "__esModule", {
  7284. value: true
  7285. });
  7286. exports2.statSync = exports2.stat = exports2.Settings = void 0;
  7287. var async = require_async();
  7288. var sync = require_sync();
  7289. var settings_1 = require_settings();
  7290. exports2.Settings = settings_1.default;
  7291. function stat(path, optionsOrSettingsOrCallback, callback) {
  7292. if (typeof optionsOrSettingsOrCallback === "function") {
  7293. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7294. return;
  7295. }
  7296. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7297. }
  7298. exports2.stat = stat;
  7299. function statSync(path, optionsOrSettings) {
  7300. const settings = getSettings(optionsOrSettings);
  7301. return sync.read(path, settings);
  7302. }
  7303. exports2.statSync = statSync;
  7304. function getSettings(settingsOrOptions = {}) {
  7305. if (settingsOrOptions instanceof settings_1.default) {
  7306. return settingsOrOptions;
  7307. }
  7308. return new settings_1.default(settingsOrOptions);
  7309. }
  7310. }
  7311. });
  7312. var require_queue_microtask = __commonJS2({
  7313. "node_modules/queue-microtask/index.js"(exports2, module2) {
  7314. var promise;
  7315. module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  7316. throw err;
  7317. }, 0));
  7318. }
  7319. });
  7320. var require_run_parallel = __commonJS2({
  7321. "node_modules/run-parallel/index.js"(exports2, module2) {
  7322. module2.exports = runParallel;
  7323. var queueMicrotask2 = require_queue_microtask();
  7324. function runParallel(tasks, cb) {
  7325. let results, pending, keys;
  7326. let isSync = true;
  7327. if (Array.isArray(tasks)) {
  7328. results = [];
  7329. pending = tasks.length;
  7330. } else {
  7331. keys = Object.keys(tasks);
  7332. results = {};
  7333. pending = keys.length;
  7334. }
  7335. function done(err) {
  7336. function end() {
  7337. if (cb)
  7338. cb(err, results);
  7339. cb = null;
  7340. }
  7341. if (isSync)
  7342. queueMicrotask2(end);
  7343. else
  7344. end();
  7345. }
  7346. function each(i, err, result) {
  7347. results[i] = result;
  7348. if (--pending === 0 || err) {
  7349. done(err);
  7350. }
  7351. }
  7352. if (!pending) {
  7353. done(null);
  7354. } else if (keys) {
  7355. keys.forEach(function(key) {
  7356. tasks[key](function(err, result) {
  7357. each(key, err, result);
  7358. });
  7359. });
  7360. } else {
  7361. tasks.forEach(function(task, i) {
  7362. task(function(err, result) {
  7363. each(i, err, result);
  7364. });
  7365. });
  7366. }
  7367. isSync = false;
  7368. }
  7369. }
  7370. });
  7371. var require_constants3 = __commonJS2({
  7372. "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
  7373. "use strict";
  7374. Object.defineProperty(exports2, "__esModule", {
  7375. value: true
  7376. });
  7377. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
  7378. var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  7379. if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
  7380. throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
  7381. }
  7382. var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  7383. var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  7384. var SUPPORTED_MAJOR_VERSION = 10;
  7385. var SUPPORTED_MINOR_VERSION = 10;
  7386. var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  7387. var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  7388. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  7389. }
  7390. });
  7391. var require_fs3 = __commonJS2({
  7392. "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
  7393. "use strict";
  7394. Object.defineProperty(exports2, "__esModule", {
  7395. value: true
  7396. });
  7397. exports2.createDirentFromStats = void 0;
  7398. var DirentFromStats = class {
  7399. constructor(name, stats) {
  7400. this.name = name;
  7401. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  7402. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  7403. this.isDirectory = stats.isDirectory.bind(stats);
  7404. this.isFIFO = stats.isFIFO.bind(stats);
  7405. this.isFile = stats.isFile.bind(stats);
  7406. this.isSocket = stats.isSocket.bind(stats);
  7407. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  7408. }
  7409. };
  7410. function createDirentFromStats(name, stats) {
  7411. return new DirentFromStats(name, stats);
  7412. }
  7413. exports2.createDirentFromStats = createDirentFromStats;
  7414. }
  7415. });
  7416. var require_utils5 = __commonJS2({
  7417. "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
  7418. "use strict";
  7419. Object.defineProperty(exports2, "__esModule", {
  7420. value: true
  7421. });
  7422. exports2.fs = void 0;
  7423. var fs = require_fs3();
  7424. exports2.fs = fs;
  7425. }
  7426. });
  7427. var require_common = __commonJS2({
  7428. "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
  7429. "use strict";
  7430. Object.defineProperty(exports2, "__esModule", {
  7431. value: true
  7432. });
  7433. exports2.joinPathSegments = void 0;
  7434. function joinPathSegments(a, b, separator) {
  7435. if (a.endsWith(separator)) {
  7436. return a + b;
  7437. }
  7438. return a + separator + b;
  7439. }
  7440. exports2.joinPathSegments = joinPathSegments;
  7441. }
  7442. });
  7443. var require_async2 = __commonJS2({
  7444. "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
  7445. "use strict";
  7446. Object.defineProperty(exports2, "__esModule", {
  7447. value: true
  7448. });
  7449. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7450. var fsStat = require_out();
  7451. var rpl = require_run_parallel();
  7452. var constants_1 = require_constants3();
  7453. var utils = require_utils5();
  7454. var common = require_common();
  7455. function read(directory, settings, callback) {
  7456. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7457. readdirWithFileTypes(directory, settings, callback);
  7458. return;
  7459. }
  7460. readdir(directory, settings, callback);
  7461. }
  7462. exports2.read = read;
  7463. function readdirWithFileTypes(directory, settings, callback) {
  7464. settings.fs.readdir(directory, {
  7465. withFileTypes: true
  7466. }, (readdirError, dirents) => {
  7467. if (readdirError !== null) {
  7468. callFailureCallback(callback, readdirError);
  7469. return;
  7470. }
  7471. const entries = dirents.map((dirent) => ({
  7472. dirent,
  7473. name: dirent.name,
  7474. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7475. }));
  7476. if (!settings.followSymbolicLinks) {
  7477. callSuccessCallback(callback, entries);
  7478. return;
  7479. }
  7480. const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
  7481. rpl(tasks, (rplError, rplEntries) => {
  7482. if (rplError !== null) {
  7483. callFailureCallback(callback, rplError);
  7484. return;
  7485. }
  7486. callSuccessCallback(callback, rplEntries);
  7487. });
  7488. });
  7489. }
  7490. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7491. function makeRplTaskEntry(entry, settings) {
  7492. return (done) => {
  7493. if (!entry.dirent.isSymbolicLink()) {
  7494. done(null, entry);
  7495. return;
  7496. }
  7497. settings.fs.stat(entry.path, (statError, stats) => {
  7498. if (statError !== null) {
  7499. if (settings.throwErrorOnBrokenSymbolicLink) {
  7500. done(statError);
  7501. return;
  7502. }
  7503. done(null, entry);
  7504. return;
  7505. }
  7506. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7507. done(null, entry);
  7508. });
  7509. };
  7510. }
  7511. function readdir(directory, settings, callback) {
  7512. settings.fs.readdir(directory, (readdirError, names) => {
  7513. if (readdirError !== null) {
  7514. callFailureCallback(callback, readdirError);
  7515. return;
  7516. }
  7517. const tasks = names.map((name) => {
  7518. const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7519. return (done) => {
  7520. fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
  7521. if (error !== null) {
  7522. done(error);
  7523. return;
  7524. }
  7525. const entry = {
  7526. name,
  7527. path,
  7528. dirent: utils.fs.createDirentFromStats(name, stats)
  7529. };
  7530. if (settings.stats) {
  7531. entry.stats = stats;
  7532. }
  7533. done(null, entry);
  7534. });
  7535. };
  7536. });
  7537. rpl(tasks, (rplError, entries) => {
  7538. if (rplError !== null) {
  7539. callFailureCallback(callback, rplError);
  7540. return;
  7541. }
  7542. callSuccessCallback(callback, entries);
  7543. });
  7544. });
  7545. }
  7546. exports2.readdir = readdir;
  7547. function callFailureCallback(callback, error) {
  7548. callback(error);
  7549. }
  7550. function callSuccessCallback(callback, result) {
  7551. callback(null, result);
  7552. }
  7553. }
  7554. });
  7555. var require_sync2 = __commonJS2({
  7556. "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
  7557. "use strict";
  7558. Object.defineProperty(exports2, "__esModule", {
  7559. value: true
  7560. });
  7561. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7562. var fsStat = require_out();
  7563. var constants_1 = require_constants3();
  7564. var utils = require_utils5();
  7565. var common = require_common();
  7566. function read(directory, settings) {
  7567. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7568. return readdirWithFileTypes(directory, settings);
  7569. }
  7570. return readdir(directory, settings);
  7571. }
  7572. exports2.read = read;
  7573. function readdirWithFileTypes(directory, settings) {
  7574. const dirents = settings.fs.readdirSync(directory, {
  7575. withFileTypes: true
  7576. });
  7577. return dirents.map((dirent) => {
  7578. const entry = {
  7579. dirent,
  7580. name: dirent.name,
  7581. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7582. };
  7583. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
  7584. try {
  7585. const stats = settings.fs.statSync(entry.path);
  7586. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7587. } catch (error) {
  7588. if (settings.throwErrorOnBrokenSymbolicLink) {
  7589. throw error;
  7590. }
  7591. }
  7592. }
  7593. return entry;
  7594. });
  7595. }
  7596. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7597. function readdir(directory, settings) {
  7598. const names = settings.fs.readdirSync(directory);
  7599. return names.map((name) => {
  7600. const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7601. const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
  7602. const entry = {
  7603. name,
  7604. path: entryPath,
  7605. dirent: utils.fs.createDirentFromStats(name, stats)
  7606. };
  7607. if (settings.stats) {
  7608. entry.stats = stats;
  7609. }
  7610. return entry;
  7611. });
  7612. }
  7613. exports2.readdir = readdir;
  7614. }
  7615. });
  7616. var require_fs4 = __commonJS2({
  7617. "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
  7618. "use strict";
  7619. Object.defineProperty(exports2, "__esModule", {
  7620. value: true
  7621. });
  7622. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7623. var fs = require("fs");
  7624. exports2.FILE_SYSTEM_ADAPTER = {
  7625. lstat: fs.lstat,
  7626. stat: fs.stat,
  7627. lstatSync: fs.lstatSync,
  7628. statSync: fs.statSync,
  7629. readdir: fs.readdir,
  7630. readdirSync: fs.readdirSync
  7631. };
  7632. function createFileSystemAdapter(fsMethods) {
  7633. if (fsMethods === void 0) {
  7634. return exports2.FILE_SYSTEM_ADAPTER;
  7635. }
  7636. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7637. }
  7638. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7639. }
  7640. });
  7641. var require_settings2 = __commonJS2({
  7642. "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
  7643. "use strict";
  7644. Object.defineProperty(exports2, "__esModule", {
  7645. value: true
  7646. });
  7647. var path = require("path");
  7648. var fsStat = require_out();
  7649. var fs = require_fs4();
  7650. var Settings = class {
  7651. constructor(_options = {}) {
  7652. this._options = _options;
  7653. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  7654. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7655. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  7656. this.stats = this._getValue(this._options.stats, false);
  7657. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7658. this.fsStatSettings = new fsStat.Settings({
  7659. followSymbolicLink: this.followSymbolicLinks,
  7660. fs: this.fs,
  7661. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  7662. });
  7663. }
  7664. _getValue(option, value) {
  7665. return option !== null && option !== void 0 ? option : value;
  7666. }
  7667. };
  7668. exports2.default = Settings;
  7669. }
  7670. });
  7671. var require_out2 = __commonJS2({
  7672. "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
  7673. "use strict";
  7674. Object.defineProperty(exports2, "__esModule", {
  7675. value: true
  7676. });
  7677. exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
  7678. var async = require_async2();
  7679. var sync = require_sync2();
  7680. var settings_1 = require_settings2();
  7681. exports2.Settings = settings_1.default;
  7682. function scandir(path, optionsOrSettingsOrCallback, callback) {
  7683. if (typeof optionsOrSettingsOrCallback === "function") {
  7684. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7685. return;
  7686. }
  7687. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7688. }
  7689. exports2.scandir = scandir;
  7690. function scandirSync(path, optionsOrSettings) {
  7691. const settings = getSettings(optionsOrSettings);
  7692. return sync.read(path, settings);
  7693. }
  7694. exports2.scandirSync = scandirSync;
  7695. function getSettings(settingsOrOptions = {}) {
  7696. if (settingsOrOptions instanceof settings_1.default) {
  7697. return settingsOrOptions;
  7698. }
  7699. return new settings_1.default(settingsOrOptions);
  7700. }
  7701. }
  7702. });
  7703. var require_reusify = __commonJS2({
  7704. "node_modules/reusify/reusify.js"(exports2, module2) {
  7705. "use strict";
  7706. function reusify(Constructor) {
  7707. var head = new Constructor();
  7708. var tail = head;
  7709. function get() {
  7710. var current = head;
  7711. if (current.next) {
  7712. head = current.next;
  7713. } else {
  7714. head = new Constructor();
  7715. tail = head;
  7716. }
  7717. current.next = null;
  7718. return current;
  7719. }
  7720. function release(obj) {
  7721. tail.next = obj;
  7722. tail = obj;
  7723. }
  7724. return {
  7725. get,
  7726. release
  7727. };
  7728. }
  7729. module2.exports = reusify;
  7730. }
  7731. });
  7732. var require_queue = __commonJS2({
  7733. "node_modules/fastq/queue.js"(exports2, module2) {
  7734. "use strict";
  7735. var reusify = require_reusify();
  7736. function fastqueue(context, worker, concurrency) {
  7737. if (typeof context === "function") {
  7738. concurrency = worker;
  7739. worker = context;
  7740. context = null;
  7741. }
  7742. if (concurrency < 1) {
  7743. throw new Error("fastqueue concurrency must be greater than 1");
  7744. }
  7745. var cache = reusify(Task);
  7746. var queueHead = null;
  7747. var queueTail = null;
  7748. var _running = 0;
  7749. var errorHandler = null;
  7750. var self2 = {
  7751. push,
  7752. drain: noop,
  7753. saturated: noop,
  7754. pause,
  7755. paused: false,
  7756. concurrency,
  7757. running,
  7758. resume,
  7759. idle,
  7760. length,
  7761. getQueue,
  7762. unshift,
  7763. empty: noop,
  7764. kill,
  7765. killAndDrain,
  7766. error
  7767. };
  7768. return self2;
  7769. function running() {
  7770. return _running;
  7771. }
  7772. function pause() {
  7773. self2.paused = true;
  7774. }
  7775. function length() {
  7776. var current = queueHead;
  7777. var counter = 0;
  7778. while (current) {
  7779. current = current.next;
  7780. counter++;
  7781. }
  7782. return counter;
  7783. }
  7784. function getQueue() {
  7785. var current = queueHead;
  7786. var tasks = [];
  7787. while (current) {
  7788. tasks.push(current.value);
  7789. current = current.next;
  7790. }
  7791. return tasks;
  7792. }
  7793. function resume() {
  7794. if (!self2.paused)
  7795. return;
  7796. self2.paused = false;
  7797. for (var i = 0; i < self2.concurrency; i++) {
  7798. _running++;
  7799. release();
  7800. }
  7801. }
  7802. function idle() {
  7803. return _running === 0 && self2.length() === 0;
  7804. }
  7805. function push(value, done) {
  7806. var current = cache.get();
  7807. current.context = context;
  7808. current.release = release;
  7809. current.value = value;
  7810. current.callback = done || noop;
  7811. current.errorHandler = errorHandler;
  7812. if (_running === self2.concurrency || self2.paused) {
  7813. if (queueTail) {
  7814. queueTail.next = current;
  7815. queueTail = current;
  7816. } else {
  7817. queueHead = current;
  7818. queueTail = current;
  7819. self2.saturated();
  7820. }
  7821. } else {
  7822. _running++;
  7823. worker.call(context, current.value, current.worked);
  7824. }
  7825. }
  7826. function unshift(value, done) {
  7827. var current = cache.get();
  7828. current.context = context;
  7829. current.release = release;
  7830. current.value = value;
  7831. current.callback = done || noop;
  7832. if (_running === self2.concurrency || self2.paused) {
  7833. if (queueHead) {
  7834. current.next = queueHead;
  7835. queueHead = current;
  7836. } else {
  7837. queueHead = current;
  7838. queueTail = current;
  7839. self2.saturated();
  7840. }
  7841. } else {
  7842. _running++;
  7843. worker.call(context, current.value, current.worked);
  7844. }
  7845. }
  7846. function release(holder) {
  7847. if (holder) {
  7848. cache.release(holder);
  7849. }
  7850. var next = queueHead;
  7851. if (next) {
  7852. if (!self2.paused) {
  7853. if (queueTail === queueHead) {
  7854. queueTail = null;
  7855. }
  7856. queueHead = next.next;
  7857. next.next = null;
  7858. worker.call(context, next.value, next.worked);
  7859. if (queueTail === null) {
  7860. self2.empty();
  7861. }
  7862. } else {
  7863. _running--;
  7864. }
  7865. } else if (--_running === 0) {
  7866. self2.drain();
  7867. }
  7868. }
  7869. function kill() {
  7870. queueHead = null;
  7871. queueTail = null;
  7872. self2.drain = noop;
  7873. }
  7874. function killAndDrain() {
  7875. queueHead = null;
  7876. queueTail = null;
  7877. self2.drain();
  7878. self2.drain = noop;
  7879. }
  7880. function error(handler) {
  7881. errorHandler = handler;
  7882. }
  7883. }
  7884. function noop() {
  7885. }
  7886. function Task() {
  7887. this.value = null;
  7888. this.callback = noop;
  7889. this.next = null;
  7890. this.release = noop;
  7891. this.context = null;
  7892. this.errorHandler = null;
  7893. var self2 = this;
  7894. this.worked = function worked(err, result) {
  7895. var callback = self2.callback;
  7896. var errorHandler = self2.errorHandler;
  7897. var val = self2.value;
  7898. self2.value = null;
  7899. self2.callback = noop;
  7900. if (self2.errorHandler) {
  7901. errorHandler(err, val);
  7902. }
  7903. callback.call(self2.context, err, result);
  7904. self2.release(self2);
  7905. };
  7906. }
  7907. function queueAsPromised(context, worker, concurrency) {
  7908. if (typeof context === "function") {
  7909. concurrency = worker;
  7910. worker = context;
  7911. context = null;
  7912. }
  7913. function asyncWrapper(arg, cb) {
  7914. worker.call(this, arg).then(function(res) {
  7915. cb(null, res);
  7916. }, cb);
  7917. }
  7918. var queue = fastqueue(context, asyncWrapper, concurrency);
  7919. var pushCb = queue.push;
  7920. var unshiftCb = queue.unshift;
  7921. queue.push = push;
  7922. queue.unshift = unshift;
  7923. queue.drained = drained;
  7924. return queue;
  7925. function push(value) {
  7926. var p = new Promise(function(resolve, reject) {
  7927. pushCb(value, function(err, result) {
  7928. if (err) {
  7929. reject(err);
  7930. return;
  7931. }
  7932. resolve(result);
  7933. });
  7934. });
  7935. p.catch(noop);
  7936. return p;
  7937. }
  7938. function unshift(value) {
  7939. var p = new Promise(function(resolve, reject) {
  7940. unshiftCb(value, function(err, result) {
  7941. if (err) {
  7942. reject(err);
  7943. return;
  7944. }
  7945. resolve(result);
  7946. });
  7947. });
  7948. p.catch(noop);
  7949. return p;
  7950. }
  7951. function drained() {
  7952. var previousDrain = queue.drain;
  7953. var p = new Promise(function(resolve) {
  7954. queue.drain = function() {
  7955. previousDrain();
  7956. resolve();
  7957. };
  7958. });
  7959. return p;
  7960. }
  7961. }
  7962. module2.exports = fastqueue;
  7963. module2.exports.promise = queueAsPromised;
  7964. }
  7965. });
  7966. var require_common2 = __commonJS2({
  7967. "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
  7968. "use strict";
  7969. Object.defineProperty(exports2, "__esModule", {
  7970. value: true
  7971. });
  7972. exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
  7973. function isFatalError(settings, error) {
  7974. if (settings.errorFilter === null) {
  7975. return true;
  7976. }
  7977. return !settings.errorFilter(error);
  7978. }
  7979. exports2.isFatalError = isFatalError;
  7980. function isAppliedFilter(filter, value) {
  7981. return filter === null || filter(value);
  7982. }
  7983. exports2.isAppliedFilter = isAppliedFilter;
  7984. function replacePathSegmentSeparator(filepath, separator) {
  7985. return filepath.split(/[/\\]/).join(separator);
  7986. }
  7987. exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
  7988. function joinPathSegments(a, b, separator) {
  7989. if (a === "") {
  7990. return b;
  7991. }
  7992. if (a.endsWith(separator)) {
  7993. return a + b;
  7994. }
  7995. return a + separator + b;
  7996. }
  7997. exports2.joinPathSegments = joinPathSegments;
  7998. }
  7999. });
  8000. var require_reader = __commonJS2({
  8001. "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
  8002. "use strict";
  8003. Object.defineProperty(exports2, "__esModule", {
  8004. value: true
  8005. });
  8006. var common = require_common2();
  8007. var Reader = class {
  8008. constructor(_root, _settings) {
  8009. this._root = _root;
  8010. this._settings = _settings;
  8011. this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  8012. }
  8013. };
  8014. exports2.default = Reader;
  8015. }
  8016. });
  8017. var require_async3 = __commonJS2({
  8018. "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
  8019. "use strict";
  8020. Object.defineProperty(exports2, "__esModule", {
  8021. value: true
  8022. });
  8023. var events_1 = require("events");
  8024. var fsScandir = require_out2();
  8025. var fastq = require_queue();
  8026. var common = require_common2();
  8027. var reader_1 = require_reader();
  8028. var AsyncReader = class extends reader_1.default {
  8029. constructor(_root, _settings) {
  8030. super(_root, _settings);
  8031. this._settings = _settings;
  8032. this._scandir = fsScandir.scandir;
  8033. this._emitter = new events_1.EventEmitter();
  8034. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  8035. this._isFatalError = false;
  8036. this._isDestroyed = false;
  8037. this._queue.drain = () => {
  8038. if (!this._isFatalError) {
  8039. this._emitter.emit("end");
  8040. }
  8041. };
  8042. }
  8043. read() {
  8044. this._isFatalError = false;
  8045. this._isDestroyed = false;
  8046. setImmediate(() => {
  8047. this._pushToQueue(this._root, this._settings.basePath);
  8048. });
  8049. return this._emitter;
  8050. }
  8051. get isDestroyed() {
  8052. return this._isDestroyed;
  8053. }
  8054. destroy() {
  8055. if (this._isDestroyed) {
  8056. throw new Error("The reader is already destroyed");
  8057. }
  8058. this._isDestroyed = true;
  8059. this._queue.killAndDrain();
  8060. }
  8061. onEntry(callback) {
  8062. this._emitter.on("entry", callback);
  8063. }
  8064. onError(callback) {
  8065. this._emitter.once("error", callback);
  8066. }
  8067. onEnd(callback) {
  8068. this._emitter.once("end", callback);
  8069. }
  8070. _pushToQueue(directory, base) {
  8071. const queueItem = {
  8072. directory,
  8073. base
  8074. };
  8075. this._queue.push(queueItem, (error) => {
  8076. if (error !== null) {
  8077. this._handleError(error);
  8078. }
  8079. });
  8080. }
  8081. _worker(item, done) {
  8082. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  8083. if (error !== null) {
  8084. done(error, void 0);
  8085. return;
  8086. }
  8087. for (const entry of entries) {
  8088. this._handleEntry(entry, item.base);
  8089. }
  8090. done(null, void 0);
  8091. });
  8092. }
  8093. _handleError(error) {
  8094. if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
  8095. return;
  8096. }
  8097. this._isFatalError = true;
  8098. this._isDestroyed = true;
  8099. this._emitter.emit("error", error);
  8100. }
  8101. _handleEntry(entry, base) {
  8102. if (this._isDestroyed || this._isFatalError) {
  8103. return;
  8104. }
  8105. const fullpath = entry.path;
  8106. if (base !== void 0) {
  8107. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8108. }
  8109. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8110. this._emitEntry(entry);
  8111. }
  8112. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8113. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8114. }
  8115. }
  8116. _emitEntry(entry) {
  8117. this._emitter.emit("entry", entry);
  8118. }
  8119. };
  8120. exports2.default = AsyncReader;
  8121. }
  8122. });
  8123. var require_async4 = __commonJS2({
  8124. "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
  8125. "use strict";
  8126. Object.defineProperty(exports2, "__esModule", {
  8127. value: true
  8128. });
  8129. var async_1 = require_async3();
  8130. var AsyncProvider = class {
  8131. constructor(_root, _settings) {
  8132. this._root = _root;
  8133. this._settings = _settings;
  8134. this._reader = new async_1.default(this._root, this._settings);
  8135. this._storage = [];
  8136. }
  8137. read(callback) {
  8138. this._reader.onError((error) => {
  8139. callFailureCallback(callback, error);
  8140. });
  8141. this._reader.onEntry((entry) => {
  8142. this._storage.push(entry);
  8143. });
  8144. this._reader.onEnd(() => {
  8145. callSuccessCallback(callback, this._storage);
  8146. });
  8147. this._reader.read();
  8148. }
  8149. };
  8150. exports2.default = AsyncProvider;
  8151. function callFailureCallback(callback, error) {
  8152. callback(error);
  8153. }
  8154. function callSuccessCallback(callback, entries) {
  8155. callback(null, entries);
  8156. }
  8157. }
  8158. });
  8159. var require_stream2 = __commonJS2({
  8160. "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
  8161. "use strict";
  8162. Object.defineProperty(exports2, "__esModule", {
  8163. value: true
  8164. });
  8165. var stream_1 = require("stream");
  8166. var async_1 = require_async3();
  8167. var StreamProvider = class {
  8168. constructor(_root, _settings) {
  8169. this._root = _root;
  8170. this._settings = _settings;
  8171. this._reader = new async_1.default(this._root, this._settings);
  8172. this._stream = new stream_1.Readable({
  8173. objectMode: true,
  8174. read: () => {
  8175. },
  8176. destroy: () => {
  8177. if (!this._reader.isDestroyed) {
  8178. this._reader.destroy();
  8179. }
  8180. }
  8181. });
  8182. }
  8183. read() {
  8184. this._reader.onError((error) => {
  8185. this._stream.emit("error", error);
  8186. });
  8187. this._reader.onEntry((entry) => {
  8188. this._stream.push(entry);
  8189. });
  8190. this._reader.onEnd(() => {
  8191. this._stream.push(null);
  8192. });
  8193. this._reader.read();
  8194. return this._stream;
  8195. }
  8196. };
  8197. exports2.default = StreamProvider;
  8198. }
  8199. });
  8200. var require_sync3 = __commonJS2({
  8201. "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
  8202. "use strict";
  8203. Object.defineProperty(exports2, "__esModule", {
  8204. value: true
  8205. });
  8206. var fsScandir = require_out2();
  8207. var common = require_common2();
  8208. var reader_1 = require_reader();
  8209. var SyncReader = class extends reader_1.default {
  8210. constructor() {
  8211. super(...arguments);
  8212. this._scandir = fsScandir.scandirSync;
  8213. this._storage = [];
  8214. this._queue = /* @__PURE__ */ new Set();
  8215. }
  8216. read() {
  8217. this._pushToQueue(this._root, this._settings.basePath);
  8218. this._handleQueue();
  8219. return this._storage;
  8220. }
  8221. _pushToQueue(directory, base) {
  8222. this._queue.add({
  8223. directory,
  8224. base
  8225. });
  8226. }
  8227. _handleQueue() {
  8228. for (const item of this._queue.values()) {
  8229. this._handleDirectory(item.directory, item.base);
  8230. }
  8231. }
  8232. _handleDirectory(directory, base) {
  8233. try {
  8234. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  8235. for (const entry of entries) {
  8236. this._handleEntry(entry, base);
  8237. }
  8238. } catch (error) {
  8239. this._handleError(error);
  8240. }
  8241. }
  8242. _handleError(error) {
  8243. if (!common.isFatalError(this._settings, error)) {
  8244. return;
  8245. }
  8246. throw error;
  8247. }
  8248. _handleEntry(entry, base) {
  8249. const fullpath = entry.path;
  8250. if (base !== void 0) {
  8251. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8252. }
  8253. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8254. this._pushToStorage(entry);
  8255. }
  8256. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8257. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8258. }
  8259. }
  8260. _pushToStorage(entry) {
  8261. this._storage.push(entry);
  8262. }
  8263. };
  8264. exports2.default = SyncReader;
  8265. }
  8266. });
  8267. var require_sync4 = __commonJS2({
  8268. "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
  8269. "use strict";
  8270. Object.defineProperty(exports2, "__esModule", {
  8271. value: true
  8272. });
  8273. var sync_1 = require_sync3();
  8274. var SyncProvider = class {
  8275. constructor(_root, _settings) {
  8276. this._root = _root;
  8277. this._settings = _settings;
  8278. this._reader = new sync_1.default(this._root, this._settings);
  8279. }
  8280. read() {
  8281. return this._reader.read();
  8282. }
  8283. };
  8284. exports2.default = SyncProvider;
  8285. }
  8286. });
  8287. var require_settings3 = __commonJS2({
  8288. "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
  8289. "use strict";
  8290. Object.defineProperty(exports2, "__esModule", {
  8291. value: true
  8292. });
  8293. var path = require("path");
  8294. var fsScandir = require_out2();
  8295. var Settings = class {
  8296. constructor(_options = {}) {
  8297. this._options = _options;
  8298. this.basePath = this._getValue(this._options.basePath, void 0);
  8299. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  8300. this.deepFilter = this._getValue(this._options.deepFilter, null);
  8301. this.entryFilter = this._getValue(this._options.entryFilter, null);
  8302. this.errorFilter = this._getValue(this._options.errorFilter, null);
  8303. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  8304. this.fsScandirSettings = new fsScandir.Settings({
  8305. followSymbolicLinks: this._options.followSymbolicLinks,
  8306. fs: this._options.fs,
  8307. pathSegmentSeparator: this._options.pathSegmentSeparator,
  8308. stats: this._options.stats,
  8309. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  8310. });
  8311. }
  8312. _getValue(option, value) {
  8313. return option !== null && option !== void 0 ? option : value;
  8314. }
  8315. };
  8316. exports2.default = Settings;
  8317. }
  8318. });
  8319. var require_out3 = __commonJS2({
  8320. "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
  8321. "use strict";
  8322. Object.defineProperty(exports2, "__esModule", {
  8323. value: true
  8324. });
  8325. exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
  8326. var async_1 = require_async4();
  8327. var stream_1 = require_stream2();
  8328. var sync_1 = require_sync4();
  8329. var settings_1 = require_settings3();
  8330. exports2.Settings = settings_1.default;
  8331. function walk(directory, optionsOrSettingsOrCallback, callback) {
  8332. if (typeof optionsOrSettingsOrCallback === "function") {
  8333. new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  8334. return;
  8335. }
  8336. new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  8337. }
  8338. exports2.walk = walk;
  8339. function walkSync(directory, optionsOrSettings) {
  8340. const settings = getSettings(optionsOrSettings);
  8341. const provider = new sync_1.default(directory, settings);
  8342. return provider.read();
  8343. }
  8344. exports2.walkSync = walkSync;
  8345. function walkStream(directory, optionsOrSettings) {
  8346. const settings = getSettings(optionsOrSettings);
  8347. const provider = new stream_1.default(directory, settings);
  8348. return provider.read();
  8349. }
  8350. exports2.walkStream = walkStream;
  8351. function getSettings(settingsOrOptions = {}) {
  8352. if (settingsOrOptions instanceof settings_1.default) {
  8353. return settingsOrOptions;
  8354. }
  8355. return new settings_1.default(settingsOrOptions);
  8356. }
  8357. }
  8358. });
  8359. var require_reader2 = __commonJS2({
  8360. "node_modules/fast-glob/out/readers/reader.js"(exports2) {
  8361. "use strict";
  8362. Object.defineProperty(exports2, "__esModule", {
  8363. value: true
  8364. });
  8365. var path = require("path");
  8366. var fsStat = require_out();
  8367. var utils = require_utils4();
  8368. var Reader = class {
  8369. constructor(_settings) {
  8370. this._settings = _settings;
  8371. this._fsStatSettings = new fsStat.Settings({
  8372. followSymbolicLink: this._settings.followSymbolicLinks,
  8373. fs: this._settings.fs,
  8374. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  8375. });
  8376. }
  8377. _getFullEntryPath(filepath) {
  8378. return path.resolve(this._settings.cwd, filepath);
  8379. }
  8380. _makeEntry(stats, pattern) {
  8381. const entry = {
  8382. name: pattern,
  8383. path: pattern,
  8384. dirent: utils.fs.createDirentFromStats(pattern, stats)
  8385. };
  8386. if (this._settings.stats) {
  8387. entry.stats = stats;
  8388. }
  8389. return entry;
  8390. }
  8391. _isFatalError(error) {
  8392. return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  8393. }
  8394. };
  8395. exports2.default = Reader;
  8396. }
  8397. });
  8398. var require_stream3 = __commonJS2({
  8399. "node_modules/fast-glob/out/readers/stream.js"(exports2) {
  8400. "use strict";
  8401. Object.defineProperty(exports2, "__esModule", {
  8402. value: true
  8403. });
  8404. var stream_1 = require("stream");
  8405. var fsStat = require_out();
  8406. var fsWalk = require_out3();
  8407. var reader_1 = require_reader2();
  8408. var ReaderStream = class extends reader_1.default {
  8409. constructor() {
  8410. super(...arguments);
  8411. this._walkStream = fsWalk.walkStream;
  8412. this._stat = fsStat.stat;
  8413. }
  8414. dynamic(root, options) {
  8415. return this._walkStream(root, options);
  8416. }
  8417. static(patterns, options) {
  8418. const filepaths = patterns.map(this._getFullEntryPath, this);
  8419. const stream = new stream_1.PassThrough({
  8420. objectMode: true
  8421. });
  8422. stream._write = (index, _enc, done) => {
  8423. return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
  8424. if (entry !== null && options.entryFilter(entry)) {
  8425. stream.push(entry);
  8426. }
  8427. if (index === filepaths.length - 1) {
  8428. stream.end();
  8429. }
  8430. done();
  8431. }).catch(done);
  8432. };
  8433. for (let i = 0; i < filepaths.length; i++) {
  8434. stream.write(i);
  8435. }
  8436. return stream;
  8437. }
  8438. _getEntry(filepath, pattern, options) {
  8439. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
  8440. if (options.errorFilter(error)) {
  8441. return null;
  8442. }
  8443. throw error;
  8444. });
  8445. }
  8446. _getStat(filepath) {
  8447. return new Promise((resolve, reject) => {
  8448. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  8449. return error === null ? resolve(stats) : reject(error);
  8450. });
  8451. });
  8452. }
  8453. };
  8454. exports2.default = ReaderStream;
  8455. }
  8456. });
  8457. var require_matcher = __commonJS2({
  8458. "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
  8459. "use strict";
  8460. Object.defineProperty(exports2, "__esModule", {
  8461. value: true
  8462. });
  8463. var utils = require_utils4();
  8464. var Matcher = class {
  8465. constructor(_patterns, _settings, _micromatchOptions) {
  8466. this._patterns = _patterns;
  8467. this._settings = _settings;
  8468. this._micromatchOptions = _micromatchOptions;
  8469. this._storage = [];
  8470. this._fillStorage();
  8471. }
  8472. _fillStorage() {
  8473. const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
  8474. for (const pattern of patterns) {
  8475. const segments = this._getPatternSegments(pattern);
  8476. const sections = this._splitSegmentsIntoSections(segments);
  8477. this._storage.push({
  8478. complete: sections.length <= 1,
  8479. pattern,
  8480. segments,
  8481. sections
  8482. });
  8483. }
  8484. }
  8485. _getPatternSegments(pattern) {
  8486. const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
  8487. return parts.map((part) => {
  8488. const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
  8489. if (!dynamic) {
  8490. return {
  8491. dynamic: false,
  8492. pattern: part
  8493. };
  8494. }
  8495. return {
  8496. dynamic: true,
  8497. pattern: part,
  8498. patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
  8499. };
  8500. });
  8501. }
  8502. _splitSegmentsIntoSections(segments) {
  8503. return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
  8504. }
  8505. };
  8506. exports2.default = Matcher;
  8507. }
  8508. });
  8509. var require_partial = __commonJS2({
  8510. "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
  8511. "use strict";
  8512. Object.defineProperty(exports2, "__esModule", {
  8513. value: true
  8514. });
  8515. var matcher_1 = require_matcher();
  8516. var PartialMatcher = class extends matcher_1.default {
  8517. match(filepath) {
  8518. const parts = filepath.split("/");
  8519. const levels = parts.length;
  8520. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  8521. for (const pattern of patterns) {
  8522. const section = pattern.sections[0];
  8523. if (!pattern.complete && levels > section.length) {
  8524. return true;
  8525. }
  8526. const match = parts.every((part, index) => {
  8527. const segment = pattern.segments[index];
  8528. if (segment.dynamic && segment.patternRe.test(part)) {
  8529. return true;
  8530. }
  8531. if (!segment.dynamic && segment.pattern === part) {
  8532. return true;
  8533. }
  8534. return false;
  8535. });
  8536. if (match) {
  8537. return true;
  8538. }
  8539. }
  8540. return false;
  8541. }
  8542. };
  8543. exports2.default = PartialMatcher;
  8544. }
  8545. });
  8546. var require_deep = __commonJS2({
  8547. "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
  8548. "use strict";
  8549. Object.defineProperty(exports2, "__esModule", {
  8550. value: true
  8551. });
  8552. var utils = require_utils4();
  8553. var partial_1 = require_partial();
  8554. var DeepFilter = class {
  8555. constructor(_settings, _micromatchOptions) {
  8556. this._settings = _settings;
  8557. this._micromatchOptions = _micromatchOptions;
  8558. }
  8559. getFilter(basePath, positive, negative) {
  8560. const matcher = this._getMatcher(positive);
  8561. const negativeRe = this._getNegativePatternsRe(negative);
  8562. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  8563. }
  8564. _getMatcher(patterns) {
  8565. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  8566. }
  8567. _getNegativePatternsRe(patterns) {
  8568. const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
  8569. return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  8570. }
  8571. _filter(basePath, entry, matcher, negativeRe) {
  8572. if (this._isSkippedByDeep(basePath, entry.path)) {
  8573. return false;
  8574. }
  8575. if (this._isSkippedSymbolicLink(entry)) {
  8576. return false;
  8577. }
  8578. const filepath = utils.path.removeLeadingDotSegment(entry.path);
  8579. if (this._isSkippedByPositivePatterns(filepath, matcher)) {
  8580. return false;
  8581. }
  8582. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  8583. }
  8584. _isSkippedByDeep(basePath, entryPath) {
  8585. if (this._settings.deep === Infinity) {
  8586. return false;
  8587. }
  8588. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  8589. }
  8590. _getEntryLevel(basePath, entryPath) {
  8591. const entryPathDepth = entryPath.split("/").length;
  8592. if (basePath === "") {
  8593. return entryPathDepth;
  8594. }
  8595. const basePathDepth = basePath.split("/").length;
  8596. return entryPathDepth - basePathDepth;
  8597. }
  8598. _isSkippedSymbolicLink(entry) {
  8599. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  8600. }
  8601. _isSkippedByPositivePatterns(entryPath, matcher) {
  8602. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  8603. }
  8604. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  8605. return !utils.pattern.matchAny(entryPath, patternsRe);
  8606. }
  8607. };
  8608. exports2.default = DeepFilter;
  8609. }
  8610. });
  8611. var require_entry = __commonJS2({
  8612. "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
  8613. "use strict";
  8614. Object.defineProperty(exports2, "__esModule", {
  8615. value: true
  8616. });
  8617. var utils = require_utils4();
  8618. var EntryFilter = class {
  8619. constructor(_settings, _micromatchOptions) {
  8620. this._settings = _settings;
  8621. this._micromatchOptions = _micromatchOptions;
  8622. this.index = /* @__PURE__ */ new Map();
  8623. }
  8624. getFilter(positive, negative) {
  8625. const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
  8626. const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
  8627. return (entry) => this._filter(entry, positiveRe, negativeRe);
  8628. }
  8629. _filter(entry, positiveRe, negativeRe) {
  8630. if (this._settings.unique && this._isDuplicateEntry(entry)) {
  8631. return false;
  8632. }
  8633. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
  8634. return false;
  8635. }
  8636. if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
  8637. return false;
  8638. }
  8639. const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
  8640. const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
  8641. if (this._settings.unique && isMatched) {
  8642. this._createIndexRecord(entry);
  8643. }
  8644. return isMatched;
  8645. }
  8646. _isDuplicateEntry(entry) {
  8647. return this.index.has(entry.path);
  8648. }
  8649. _createIndexRecord(entry) {
  8650. this.index.set(entry.path, void 0);
  8651. }
  8652. _onlyFileFilter(entry) {
  8653. return this._settings.onlyFiles && !entry.dirent.isFile();
  8654. }
  8655. _onlyDirectoryFilter(entry) {
  8656. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  8657. }
  8658. _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
  8659. if (!this._settings.absolute) {
  8660. return false;
  8661. }
  8662. const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
  8663. return utils.pattern.matchAny(fullpath, patternsRe);
  8664. }
  8665. _isMatchToPatterns(entryPath, patternsRe) {
  8666. const filepath = utils.path.removeLeadingDotSegment(entryPath);
  8667. return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + "/", patternsRe);
  8668. }
  8669. };
  8670. exports2.default = EntryFilter;
  8671. }
  8672. });
  8673. var require_error = __commonJS2({
  8674. "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
  8675. "use strict";
  8676. Object.defineProperty(exports2, "__esModule", {
  8677. value: true
  8678. });
  8679. var utils = require_utils4();
  8680. var ErrorFilter = class {
  8681. constructor(_settings) {
  8682. this._settings = _settings;
  8683. }
  8684. getFilter() {
  8685. return (error) => this._isNonFatalError(error);
  8686. }
  8687. _isNonFatalError(error) {
  8688. return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  8689. }
  8690. };
  8691. exports2.default = ErrorFilter;
  8692. }
  8693. });
  8694. var require_entry2 = __commonJS2({
  8695. "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
  8696. "use strict";
  8697. Object.defineProperty(exports2, "__esModule", {
  8698. value: true
  8699. });
  8700. var utils = require_utils4();
  8701. var EntryTransformer = class {
  8702. constructor(_settings) {
  8703. this._settings = _settings;
  8704. }
  8705. getTransformer() {
  8706. return (entry) => this._transform(entry);
  8707. }
  8708. _transform(entry) {
  8709. let filepath = entry.path;
  8710. if (this._settings.absolute) {
  8711. filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
  8712. filepath = utils.path.unixify(filepath);
  8713. }
  8714. if (this._settings.markDirectories && entry.dirent.isDirectory()) {
  8715. filepath += "/";
  8716. }
  8717. if (!this._settings.objectMode) {
  8718. return filepath;
  8719. }
  8720. return Object.assign(Object.assign({}, entry), {
  8721. path: filepath
  8722. });
  8723. }
  8724. };
  8725. exports2.default = EntryTransformer;
  8726. }
  8727. });
  8728. var require_provider = __commonJS2({
  8729. "node_modules/fast-glob/out/providers/provider.js"(exports2) {
  8730. "use strict";
  8731. Object.defineProperty(exports2, "__esModule", {
  8732. value: true
  8733. });
  8734. var path = require("path");
  8735. var deep_1 = require_deep();
  8736. var entry_1 = require_entry();
  8737. var error_1 = require_error();
  8738. var entry_2 = require_entry2();
  8739. var Provider = class {
  8740. constructor(_settings) {
  8741. this._settings = _settings;
  8742. this.errorFilter = new error_1.default(this._settings);
  8743. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  8744. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  8745. this.entryTransformer = new entry_2.default(this._settings);
  8746. }
  8747. _getRootDirectory(task) {
  8748. return path.resolve(this._settings.cwd, task.base);
  8749. }
  8750. _getReaderOptions(task) {
  8751. const basePath = task.base === "." ? "" : task.base;
  8752. return {
  8753. basePath,
  8754. pathSegmentSeparator: "/",
  8755. concurrency: this._settings.concurrency,
  8756. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  8757. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  8758. errorFilter: this.errorFilter.getFilter(),
  8759. followSymbolicLinks: this._settings.followSymbolicLinks,
  8760. fs: this._settings.fs,
  8761. stats: this._settings.stats,
  8762. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  8763. transform: this.entryTransformer.getTransformer()
  8764. };
  8765. }
  8766. _getMicromatchOptions() {
  8767. return {
  8768. dot: this._settings.dot,
  8769. matchBase: this._settings.baseNameMatch,
  8770. nobrace: !this._settings.braceExpansion,
  8771. nocase: !this._settings.caseSensitiveMatch,
  8772. noext: !this._settings.extglob,
  8773. noglobstar: !this._settings.globstar,
  8774. posix: true,
  8775. strictSlashes: false
  8776. };
  8777. }
  8778. };
  8779. exports2.default = Provider;
  8780. }
  8781. });
  8782. var require_async5 = __commonJS2({
  8783. "node_modules/fast-glob/out/providers/async.js"(exports2) {
  8784. "use strict";
  8785. Object.defineProperty(exports2, "__esModule", {
  8786. value: true
  8787. });
  8788. var stream_1 = require_stream3();
  8789. var provider_1 = require_provider();
  8790. var ProviderAsync = class extends provider_1.default {
  8791. constructor() {
  8792. super(...arguments);
  8793. this._reader = new stream_1.default(this._settings);
  8794. }
  8795. read(task) {
  8796. const root = this._getRootDirectory(task);
  8797. const options = this._getReaderOptions(task);
  8798. const entries = [];
  8799. return new Promise((resolve, reject) => {
  8800. const stream = this.api(root, task, options);
  8801. stream.once("error", reject);
  8802. stream.on("data", (entry) => entries.push(options.transform(entry)));
  8803. stream.once("end", () => resolve(entries));
  8804. });
  8805. }
  8806. api(root, task, options) {
  8807. if (task.dynamic) {
  8808. return this._reader.dynamic(root, options);
  8809. }
  8810. return this._reader.static(task.patterns, options);
  8811. }
  8812. };
  8813. exports2.default = ProviderAsync;
  8814. }
  8815. });
  8816. var require_stream4 = __commonJS2({
  8817. "node_modules/fast-glob/out/providers/stream.js"(exports2) {
  8818. "use strict";
  8819. Object.defineProperty(exports2, "__esModule", {
  8820. value: true
  8821. });
  8822. var stream_1 = require("stream");
  8823. var stream_2 = require_stream3();
  8824. var provider_1 = require_provider();
  8825. var ProviderStream = class extends provider_1.default {
  8826. constructor() {
  8827. super(...arguments);
  8828. this._reader = new stream_2.default(this._settings);
  8829. }
  8830. read(task) {
  8831. const root = this._getRootDirectory(task);
  8832. const options = this._getReaderOptions(task);
  8833. const source = this.api(root, task, options);
  8834. const destination = new stream_1.Readable({
  8835. objectMode: true,
  8836. read: () => {
  8837. }
  8838. });
  8839. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
  8840. destination.once("close", () => source.destroy());
  8841. return destination;
  8842. }
  8843. api(root, task, options) {
  8844. if (task.dynamic) {
  8845. return this._reader.dynamic(root, options);
  8846. }
  8847. return this._reader.static(task.patterns, options);
  8848. }
  8849. };
  8850. exports2.default = ProviderStream;
  8851. }
  8852. });
  8853. var require_sync5 = __commonJS2({
  8854. "node_modules/fast-glob/out/readers/sync.js"(exports2) {
  8855. "use strict";
  8856. Object.defineProperty(exports2, "__esModule", {
  8857. value: true
  8858. });
  8859. var fsStat = require_out();
  8860. var fsWalk = require_out3();
  8861. var reader_1 = require_reader2();
  8862. var ReaderSync = class extends reader_1.default {
  8863. constructor() {
  8864. super(...arguments);
  8865. this._walkSync = fsWalk.walkSync;
  8866. this._statSync = fsStat.statSync;
  8867. }
  8868. dynamic(root, options) {
  8869. return this._walkSync(root, options);
  8870. }
  8871. static(patterns, options) {
  8872. const entries = [];
  8873. for (const pattern of patterns) {
  8874. const filepath = this._getFullEntryPath(pattern);
  8875. const entry = this._getEntry(filepath, pattern, options);
  8876. if (entry === null || !options.entryFilter(entry)) {
  8877. continue;
  8878. }
  8879. entries.push(entry);
  8880. }
  8881. return entries;
  8882. }
  8883. _getEntry(filepath, pattern, options) {
  8884. try {
  8885. const stats = this._getStat(filepath);
  8886. return this._makeEntry(stats, pattern);
  8887. } catch (error) {
  8888. if (options.errorFilter(error)) {
  8889. return null;
  8890. }
  8891. throw error;
  8892. }
  8893. }
  8894. _getStat(filepath) {
  8895. return this._statSync(filepath, this._fsStatSettings);
  8896. }
  8897. };
  8898. exports2.default = ReaderSync;
  8899. }
  8900. });
  8901. var require_sync6 = __commonJS2({
  8902. "node_modules/fast-glob/out/providers/sync.js"(exports2) {
  8903. "use strict";
  8904. Object.defineProperty(exports2, "__esModule", {
  8905. value: true
  8906. });
  8907. var sync_1 = require_sync5();
  8908. var provider_1 = require_provider();
  8909. var ProviderSync = class extends provider_1.default {
  8910. constructor() {
  8911. super(...arguments);
  8912. this._reader = new sync_1.default(this._settings);
  8913. }
  8914. read(task) {
  8915. const root = this._getRootDirectory(task);
  8916. const options = this._getReaderOptions(task);
  8917. const entries = this.api(root, task, options);
  8918. return entries.map(options.transform);
  8919. }
  8920. api(root, task, options) {
  8921. if (task.dynamic) {
  8922. return this._reader.dynamic(root, options);
  8923. }
  8924. return this._reader.static(task.patterns, options);
  8925. }
  8926. };
  8927. exports2.default = ProviderSync;
  8928. }
  8929. });
  8930. var require_settings4 = __commonJS2({
  8931. "node_modules/fast-glob/out/settings.js"(exports2) {
  8932. "use strict";
  8933. Object.defineProperty(exports2, "__esModule", {
  8934. value: true
  8935. });
  8936. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
  8937. var fs = require("fs");
  8938. var os2 = require("os");
  8939. var CPU_COUNT = Math.max(os2.cpus().length, 1);
  8940. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
  8941. lstat: fs.lstat,
  8942. lstatSync: fs.lstatSync,
  8943. stat: fs.stat,
  8944. statSync: fs.statSync,
  8945. readdir: fs.readdir,
  8946. readdirSync: fs.readdirSync
  8947. };
  8948. var Settings = class {
  8949. constructor(_options = {}) {
  8950. this._options = _options;
  8951. this.absolute = this._getValue(this._options.absolute, false);
  8952. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  8953. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  8954. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  8955. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  8956. this.cwd = this._getValue(this._options.cwd, process.cwd());
  8957. this.deep = this._getValue(this._options.deep, Infinity);
  8958. this.dot = this._getValue(this._options.dot, false);
  8959. this.extglob = this._getValue(this._options.extglob, true);
  8960. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  8961. this.fs = this._getFileSystemMethods(this._options.fs);
  8962. this.globstar = this._getValue(this._options.globstar, true);
  8963. this.ignore = this._getValue(this._options.ignore, []);
  8964. this.markDirectories = this._getValue(this._options.markDirectories, false);
  8965. this.objectMode = this._getValue(this._options.objectMode, false);
  8966. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  8967. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  8968. this.stats = this._getValue(this._options.stats, false);
  8969. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  8970. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  8971. this.unique = this._getValue(this._options.unique, true);
  8972. if (this.onlyDirectories) {
  8973. this.onlyFiles = false;
  8974. }
  8975. if (this.stats) {
  8976. this.objectMode = true;
  8977. }
  8978. }
  8979. _getValue(option, value) {
  8980. return option === void 0 ? value : option;
  8981. }
  8982. _getFileSystemMethods(methods = {}) {
  8983. return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
  8984. }
  8985. };
  8986. exports2.default = Settings;
  8987. }
  8988. });
  8989. var require_out4 = __commonJS2({
  8990. "node_modules/fast-glob/out/index.js"(exports2, module2) {
  8991. "use strict";
  8992. var taskManager = require_tasks();
  8993. var patternManager = require_patterns();
  8994. var async_1 = require_async5();
  8995. var stream_1 = require_stream4();
  8996. var sync_1 = require_sync6();
  8997. var settings_1 = require_settings4();
  8998. var utils = require_utils4();
  8999. async function FastGlob(source, options) {
  9000. assertPatternsInput(source);
  9001. const works = getWorks(source, async_1.default, options);
  9002. const result = await Promise.all(works);
  9003. return utils.array.flatten(result);
  9004. }
  9005. (function(FastGlob2) {
  9006. function sync(source, options) {
  9007. assertPatternsInput(source);
  9008. const works = getWorks(source, sync_1.default, options);
  9009. return utils.array.flatten(works);
  9010. }
  9011. FastGlob2.sync = sync;
  9012. function stream(source, options) {
  9013. assertPatternsInput(source);
  9014. const works = getWorks(source, stream_1.default, options);
  9015. return utils.stream.merge(works);
  9016. }
  9017. FastGlob2.stream = stream;
  9018. function generateTasks(source, options) {
  9019. assertPatternsInput(source);
  9020. const patterns = patternManager.transform([].concat(source));
  9021. const settings = new settings_1.default(options);
  9022. return taskManager.generate(patterns, settings);
  9023. }
  9024. FastGlob2.generateTasks = generateTasks;
  9025. function isDynamicPattern(source, options) {
  9026. assertPatternsInput(source);
  9027. const settings = new settings_1.default(options);
  9028. return utils.pattern.isDynamicPattern(source, settings);
  9029. }
  9030. FastGlob2.isDynamicPattern = isDynamicPattern;
  9031. function escapePath(source) {
  9032. assertPatternsInput(source);
  9033. return utils.path.escape(source);
  9034. }
  9035. FastGlob2.escapePath = escapePath;
  9036. })(FastGlob || (FastGlob = {}));
  9037. function getWorks(source, _Provider, options) {
  9038. const patterns = patternManager.transform([].concat(source));
  9039. const settings = new settings_1.default(options);
  9040. const tasks = taskManager.generate(patterns, settings);
  9041. const provider = new _Provider(settings);
  9042. return tasks.map(provider.read, provider);
  9043. }
  9044. function assertPatternsInput(input) {
  9045. const source = [].concat(input);
  9046. const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
  9047. if (!isValidSource) {
  9048. throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  9049. }
  9050. }
  9051. module2.exports = FastGlob;
  9052. }
  9053. });
  9054. var require_expand_patterns = __commonJS2({
  9055. "src/cli/expand-patterns.js"(exports2, module2) {
  9056. "use strict";
  9057. var path = require("path");
  9058. var fastGlob = require_out4();
  9059. var {
  9060. statSafe
  9061. } = require_utils();
  9062. async function* expandPatterns(context) {
  9063. const cwd = process.cwd();
  9064. const seen = /* @__PURE__ */ new Set();
  9065. let noResults = true;
  9066. for await (const pathOrError of expandPatternsInternal(context)) {
  9067. noResults = false;
  9068. if (typeof pathOrError !== "string") {
  9069. yield pathOrError;
  9070. continue;
  9071. }
  9072. const relativePath = path.relative(cwd, pathOrError);
  9073. if (seen.has(relativePath)) {
  9074. continue;
  9075. }
  9076. seen.add(relativePath);
  9077. yield relativePath;
  9078. }
  9079. if (noResults && context.argv.errorOnUnmatchedPattern !== false) {
  9080. yield {
  9081. error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
  9082. };
  9083. }
  9084. }
  9085. async function* expandPatternsInternal(context) {
  9086. const silentlyIgnoredDirs = [".git", ".svn", ".hg"];
  9087. if (context.argv.withNodeModules !== true) {
  9088. silentlyIgnoredDirs.push("node_modules");
  9089. }
  9090. const globOptions = {
  9091. dot: true,
  9092. ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir)
  9093. };
  9094. let supportedFilesGlob;
  9095. const cwd = process.cwd();
  9096. const entries = [];
  9097. for (const pattern of context.filePatterns) {
  9098. const absolutePath = path.resolve(cwd, pattern);
  9099. if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
  9100. continue;
  9101. }
  9102. const stat = await statSafe(absolutePath);
  9103. if (stat) {
  9104. if (stat.isFile()) {
  9105. entries.push({
  9106. type: "file",
  9107. glob: escapePathForGlob(fixWindowsSlashes(pattern)),
  9108. input: pattern
  9109. });
  9110. } else if (stat.isDirectory()) {
  9111. const relativePath = path.relative(cwd, absolutePath) || ".";
  9112. entries.push({
  9113. type: "dir",
  9114. glob: escapePathForGlob(fixWindowsSlashes(relativePath)) + "/" + getSupportedFilesGlob(),
  9115. input: pattern
  9116. });
  9117. }
  9118. } else if (pattern[0] === "!") {
  9119. globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1)));
  9120. } else {
  9121. entries.push({
  9122. type: "glob",
  9123. glob: fixWindowsSlashes(pattern),
  9124. input: pattern
  9125. });
  9126. }
  9127. }
  9128. for (const {
  9129. type,
  9130. glob,
  9131. input
  9132. } of entries) {
  9133. let result;
  9134. try {
  9135. result = await fastGlob(glob, globOptions);
  9136. } catch ({
  9137. message
  9138. }) {
  9139. yield {
  9140. error: `${errorMessages.globError[type]}: ${input}
  9141. ${message}`
  9142. };
  9143. continue;
  9144. }
  9145. if (result.length === 0) {
  9146. if (context.argv.errorOnUnmatchedPattern !== false) {
  9147. yield {
  9148. error: `${errorMessages.emptyResults[type]}: "${input}".`
  9149. };
  9150. }
  9151. } else {
  9152. yield* sortPaths(result);
  9153. }
  9154. }
  9155. function getSupportedFilesGlob() {
  9156. if (!supportedFilesGlob) {
  9157. const extensions = context.languages.flatMap((lang) => lang.extensions || []);
  9158. const filenames = context.languages.flatMap((lang) => lang.filenames || []);
  9159. supportedFilesGlob = `**/{${[...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
  9160. }
  9161. return supportedFilesGlob;
  9162. }
  9163. }
  9164. var errorMessages = {
  9165. globError: {
  9166. file: "Unable to resolve file",
  9167. dir: "Unable to expand directory",
  9168. glob: "Unable to expand glob pattern"
  9169. },
  9170. emptyResults: {
  9171. file: "Explicitly specified file was ignored due to negative glob patterns",
  9172. dir: "No supported files were found in the directory",
  9173. glob: "No files matching the pattern were found"
  9174. }
  9175. };
  9176. function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
  9177. return path.relative(cwd, absolutePath).split(path.sep).some((dir) => ignoredDirectories.includes(dir));
  9178. }
  9179. function sortPaths(paths) {
  9180. return paths.sort((a, b) => a.localeCompare(b));
  9181. }
  9182. function escapePathForGlob(path2) {
  9183. return fastGlob.escapePath(path2.replace(/\\/g, "\0")).replace(/\\!/g, "@(!)").replace(/\0/g, "@(\\\\)");
  9184. }
  9185. var isWindows = path.sep === "\\";
  9186. function fixWindowsSlashes(pattern) {
  9187. return isWindows ? pattern.replace(/\\/g, "/") : pattern;
  9188. }
  9189. module2.exports = {
  9190. expandPatterns,
  9191. fixWindowsSlashes
  9192. };
  9193. }
  9194. });
  9195. var require_get_options_for_file = __commonJS2({
  9196. "src/cli/options/get-options-for-file.js"(exports2, module2) {
  9197. "use strict";
  9198. var dashify = require_dashify();
  9199. var prettier2 = require("./index.js");
  9200. var {
  9201. optionsNormalizer
  9202. } = require_prettier_internal();
  9203. var minimist = require_minimist2();
  9204. var createMinimistOptions = require_create_minimist_options();
  9205. var normalizeCliOptions = require_normalize_cli_options();
  9206. function getOptions(argv, detailedOptions) {
  9207. return Object.fromEntries(detailedOptions.filter(({
  9208. forwardToApi
  9209. }) => forwardToApi).map(({
  9210. forwardToApi,
  9211. name
  9212. }) => [forwardToApi, argv[name]]));
  9213. }
  9214. function cliifyOptions(object, apiDetailedOptionMap) {
  9215. return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
  9216. const apiOption = apiDetailedOptionMap[key];
  9217. const cliKey = apiOption ? apiOption.name : key;
  9218. return [dashify(cliKey), value];
  9219. }));
  9220. }
  9221. function createApiDetailedOptionMap(detailedOptions) {
  9222. return Object.fromEntries(detailedOptions.filter((option) => option.forwardToApi && option.forwardToApi !== option.name).map((option) => [option.forwardToApi, option]));
  9223. }
  9224. function parseArgsToOptions(context, overrideDefaults) {
  9225. const minimistOptions = createMinimistOptions(context.detailedOptions);
  9226. const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
  9227. return getOptions(normalizeCliOptions(minimist(context.rawArguments, {
  9228. string: minimistOptions.string,
  9229. boolean: minimistOptions.boolean,
  9230. default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
  9231. }), context.detailedOptions, {
  9232. logger: false
  9233. }), context.detailedOptions);
  9234. }
  9235. async function getOptionsOrDie(context, filePath) {
  9236. try {
  9237. if (context.argv.config === false) {
  9238. context.logger.debug("'--no-config' option found, skip loading config file.");
  9239. return null;
  9240. }
  9241. context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
  9242. const options = await prettier2.resolveConfig(filePath, {
  9243. editorconfig: context.argv.editorconfig,
  9244. config: context.argv.config
  9245. });
  9246. context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
  9247. return options;
  9248. } catch (error) {
  9249. context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
  9250. process.exit(2);
  9251. }
  9252. }
  9253. function applyConfigPrecedence(context, options) {
  9254. try {
  9255. switch (context.argv.configPrecedence) {
  9256. case "cli-override":
  9257. return parseArgsToOptions(context, options);
  9258. case "file-override":
  9259. return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
  9260. case "prefer-file":
  9261. return options || parseArgsToOptions(context);
  9262. }
  9263. } catch (error) {
  9264. context.logger.error(error.toString());
  9265. process.exit(2);
  9266. }
  9267. }
  9268. async function getOptionsForFile(context, filepath) {
  9269. const options = await getOptionsOrDie(context, filepath);
  9270. const hasPlugins = options && options.plugins;
  9271. if (hasPlugins) {
  9272. context.pushContextPlugins(options.plugins);
  9273. }
  9274. const appliedOptions = Object.assign({
  9275. filepath
  9276. }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
  9277. logger: context.logger
  9278. })));
  9279. context.logger.debug(`applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}`);
  9280. if (hasPlugins) {
  9281. context.popContextPlugins();
  9282. }
  9283. return appliedOptions;
  9284. }
  9285. module2.exports = getOptionsForFile;
  9286. }
  9287. });
  9288. var require_is_tty = __commonJS2({
  9289. "src/cli/is-tty.js"(exports2, module2) {
  9290. "use strict";
  9291. var {
  9292. isCI
  9293. } = require("./third-party.js");
  9294. module2.exports = function isTTY() {
  9295. return process.stdout.isTTY && !isCI();
  9296. };
  9297. }
  9298. });
  9299. var require_commondir = __commonJS2({
  9300. "node_modules/commondir/index.js"(exports2, module2) {
  9301. var path = require("path");
  9302. module2.exports = function(basedir, relfiles) {
  9303. if (relfiles) {
  9304. var files = relfiles.map(function(r) {
  9305. return path.resolve(basedir, r);
  9306. });
  9307. } else {
  9308. var files = basedir;
  9309. }
  9310. var res = files.slice(1).reduce(function(ps, file) {
  9311. if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
  9312. throw new Error("relative path without a basedir");
  9313. }
  9314. var xs = file.split(/\/+|\\+/);
  9315. for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
  9316. ;
  9317. return ps.slice(0, i);
  9318. }, files[0].split(/\/+|\\+/));
  9319. return res.length > 1 ? res.join("/") : "/";
  9320. };
  9321. }
  9322. });
  9323. var require_p_try = __commonJS2({
  9324. "node_modules/p-try/index.js"(exports2, module2) {
  9325. "use strict";
  9326. var pTry = (fn, ...arguments_) => new Promise((resolve) => {
  9327. resolve(fn(...arguments_));
  9328. });
  9329. module2.exports = pTry;
  9330. module2.exports.default = pTry;
  9331. }
  9332. });
  9333. var require_p_limit = __commonJS2({
  9334. "node_modules/p-limit/index.js"(exports2, module2) {
  9335. "use strict";
  9336. var pTry = require_p_try();
  9337. var pLimit = (concurrency) => {
  9338. if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
  9339. return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
  9340. }
  9341. const queue = [];
  9342. let activeCount = 0;
  9343. const next = () => {
  9344. activeCount--;
  9345. if (queue.length > 0) {
  9346. queue.shift()();
  9347. }
  9348. };
  9349. const run2 = (fn, resolve, ...args) => {
  9350. activeCount++;
  9351. const result = pTry(fn, ...args);
  9352. resolve(result);
  9353. result.then(next, next);
  9354. };
  9355. const enqueue = (fn, resolve, ...args) => {
  9356. if (activeCount < concurrency) {
  9357. run2(fn, resolve, ...args);
  9358. } else {
  9359. queue.push(run2.bind(null, fn, resolve, ...args));
  9360. }
  9361. };
  9362. const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
  9363. Object.defineProperties(generator, {
  9364. activeCount: {
  9365. get: () => activeCount
  9366. },
  9367. pendingCount: {
  9368. get: () => queue.length
  9369. },
  9370. clearQueue: {
  9371. value: () => {
  9372. queue.length = 0;
  9373. }
  9374. }
  9375. });
  9376. return generator;
  9377. };
  9378. module2.exports = pLimit;
  9379. module2.exports.default = pLimit;
  9380. }
  9381. });
  9382. var require_p_locate = __commonJS2({
  9383. "node_modules/p-locate/index.js"(exports2, module2) {
  9384. "use strict";
  9385. var pLimit = require_p_limit();
  9386. var EndError = class extends Error {
  9387. constructor(value) {
  9388. super();
  9389. this.value = value;
  9390. }
  9391. };
  9392. var testElement = async (element, tester) => tester(await element);
  9393. var finder = async (element) => {
  9394. const values = await Promise.all(element);
  9395. if (values[1] === true) {
  9396. throw new EndError(values[0]);
  9397. }
  9398. return false;
  9399. };
  9400. var pLocate = async (iterable, tester, options) => {
  9401. options = Object.assign({
  9402. concurrency: Infinity,
  9403. preserveOrder: true
  9404. }, options);
  9405. const limit = pLimit(options.concurrency);
  9406. const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
  9407. const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
  9408. try {
  9409. await Promise.all(items.map((element) => checkLimit(finder, element)));
  9410. } catch (error) {
  9411. if (error instanceof EndError) {
  9412. return error.value;
  9413. }
  9414. throw error;
  9415. }
  9416. };
  9417. module2.exports = pLocate;
  9418. module2.exports.default = pLocate;
  9419. }
  9420. });
  9421. var require_locate_path = __commonJS2({
  9422. "node_modules/locate-path/index.js"(exports2, module2) {
  9423. "use strict";
  9424. var path = require("path");
  9425. var fs = require("fs");
  9426. var {
  9427. promisify
  9428. } = require("util");
  9429. var pLocate = require_p_locate();
  9430. var fsStat = promisify(fs.stat);
  9431. var fsLStat = promisify(fs.lstat);
  9432. var typeMappings = {
  9433. directory: "isDirectory",
  9434. file: "isFile"
  9435. };
  9436. function checkType({
  9437. type
  9438. }) {
  9439. if (type in typeMappings) {
  9440. return;
  9441. }
  9442. throw new Error(`Invalid type specified: ${type}`);
  9443. }
  9444. var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
  9445. module2.exports = async (paths, options) => {
  9446. options = Object.assign({
  9447. cwd: process.cwd(),
  9448. type: "file",
  9449. allowSymlinks: true
  9450. }, options);
  9451. checkType(options);
  9452. const statFn = options.allowSymlinks ? fsStat : fsLStat;
  9453. return pLocate(paths, async (path_) => {
  9454. try {
  9455. const stat = await statFn(path.resolve(options.cwd, path_));
  9456. return matchType(options.type, stat);
  9457. } catch (_) {
  9458. return false;
  9459. }
  9460. }, options);
  9461. };
  9462. module2.exports.sync = (paths, options) => {
  9463. options = Object.assign({
  9464. cwd: process.cwd(),
  9465. allowSymlinks: true,
  9466. type: "file"
  9467. }, options);
  9468. checkType(options);
  9469. const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
  9470. for (const path_ of paths) {
  9471. try {
  9472. const stat = statFn(path.resolve(options.cwd, path_));
  9473. if (matchType(options.type, stat)) {
  9474. return path_;
  9475. }
  9476. } catch (_) {
  9477. }
  9478. }
  9479. };
  9480. }
  9481. });
  9482. var require_path_exists = __commonJS2({
  9483. "node_modules/path-exists/index.js"(exports2, module2) {
  9484. "use strict";
  9485. var fs = require("fs");
  9486. var {
  9487. promisify
  9488. } = require("util");
  9489. var pAccess = promisify(fs.access);
  9490. module2.exports = async (path) => {
  9491. try {
  9492. await pAccess(path);
  9493. return true;
  9494. } catch (_) {
  9495. return false;
  9496. }
  9497. };
  9498. module2.exports.sync = (path) => {
  9499. try {
  9500. fs.accessSync(path);
  9501. return true;
  9502. } catch (_) {
  9503. return false;
  9504. }
  9505. };
  9506. }
  9507. });
  9508. var require_find_up = __commonJS2({
  9509. "node_modules/find-up/index.js"(exports2, module2) {
  9510. "use strict";
  9511. var path = require("path");
  9512. var locatePath = require_locate_path();
  9513. var pathExists = require_path_exists();
  9514. var stop = Symbol("findUp.stop");
  9515. module2.exports = async (name, options = {}) => {
  9516. let directory = path.resolve(options.cwd || "");
  9517. const {
  9518. root
  9519. } = path.parse(directory);
  9520. const paths = [].concat(name);
  9521. const runMatcher = async (locateOptions) => {
  9522. if (typeof name !== "function") {
  9523. return locatePath(paths, locateOptions);
  9524. }
  9525. const foundPath = await name(locateOptions.cwd);
  9526. if (typeof foundPath === "string") {
  9527. return locatePath([foundPath], locateOptions);
  9528. }
  9529. return foundPath;
  9530. };
  9531. while (true) {
  9532. const foundPath = await runMatcher(Object.assign(Object.assign({}, options), {}, {
  9533. cwd: directory
  9534. }));
  9535. if (foundPath === stop) {
  9536. return;
  9537. }
  9538. if (foundPath) {
  9539. return path.resolve(directory, foundPath);
  9540. }
  9541. if (directory === root) {
  9542. return;
  9543. }
  9544. directory = path.dirname(directory);
  9545. }
  9546. };
  9547. module2.exports.sync = (name, options = {}) => {
  9548. let directory = path.resolve(options.cwd || "");
  9549. const {
  9550. root
  9551. } = path.parse(directory);
  9552. const paths = [].concat(name);
  9553. const runMatcher = (locateOptions) => {
  9554. if (typeof name !== "function") {
  9555. return locatePath.sync(paths, locateOptions);
  9556. }
  9557. const foundPath = name(locateOptions.cwd);
  9558. if (typeof foundPath === "string") {
  9559. return locatePath.sync([foundPath], locateOptions);
  9560. }
  9561. return foundPath;
  9562. };
  9563. while (true) {
  9564. const foundPath = runMatcher(Object.assign(Object.assign({}, options), {}, {
  9565. cwd: directory
  9566. }));
  9567. if (foundPath === stop) {
  9568. return;
  9569. }
  9570. if (foundPath) {
  9571. return path.resolve(directory, foundPath);
  9572. }
  9573. if (directory === root) {
  9574. return;
  9575. }
  9576. directory = path.dirname(directory);
  9577. }
  9578. };
  9579. module2.exports.exists = pathExists;
  9580. module2.exports.sync.exists = pathExists.sync;
  9581. module2.exports.stop = stop;
  9582. }
  9583. });
  9584. var require_pkg_dir = __commonJS2({
  9585. "node_modules/pkg-dir/index.js"(exports2, module2) {
  9586. "use strict";
  9587. var path = require("path");
  9588. var findUp = require_find_up();
  9589. var pkgDir = async (cwd) => {
  9590. const filePath = await findUp("package.json", {
  9591. cwd
  9592. });
  9593. return filePath && path.dirname(filePath);
  9594. };
  9595. module2.exports = pkgDir;
  9596. module2.exports.default = pkgDir;
  9597. module2.exports.sync = (cwd) => {
  9598. const filePath = findUp.sync("package.json", {
  9599. cwd
  9600. });
  9601. return filePath && path.dirname(filePath);
  9602. };
  9603. }
  9604. });
  9605. var require_semver = __commonJS2({
  9606. "node_modules/make-dir/node_modules/semver/semver.js"(exports2, module2) {
  9607. exports2 = module2.exports = SemVer;
  9608. var debug;
  9609. if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9610. debug = function() {
  9611. var args = Array.prototype.slice.call(arguments, 0);
  9612. args.unshift("SEMVER");
  9613. console.log.apply(console, args);
  9614. };
  9615. } else {
  9616. debug = function() {
  9617. };
  9618. }
  9619. exports2.SEMVER_SPEC_VERSION = "2.0.0";
  9620. var MAX_LENGTH = 256;
  9621. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  9622. var MAX_SAFE_COMPONENT_LENGTH = 16;
  9623. var re = exports2.re = [];
  9624. var src = exports2.src = [];
  9625. var t = exports2.tokens = {};
  9626. var R = 0;
  9627. function tok(n) {
  9628. t[n] = R++;
  9629. }
  9630. tok("NUMERICIDENTIFIER");
  9631. src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
  9632. tok("NUMERICIDENTIFIERLOOSE");
  9633. src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+";
  9634. tok("NONNUMERICIDENTIFIER");
  9635. src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
  9636. tok("MAINVERSION");
  9637. src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
  9638. tok("MAINVERSIONLOOSE");
  9639. src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
  9640. tok("PRERELEASEIDENTIFIER");
  9641. src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9642. tok("PRERELEASEIDENTIFIERLOOSE");
  9643. src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9644. tok("PRERELEASE");
  9645. src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
  9646. tok("PRERELEASELOOSE");
  9647. src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
  9648. tok("BUILDIDENTIFIER");
  9649. src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+";
  9650. tok("BUILD");
  9651. src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
  9652. tok("FULL");
  9653. tok("FULLPLAIN");
  9654. src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
  9655. src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
  9656. tok("LOOSEPLAIN");
  9657. src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
  9658. tok("LOOSE");
  9659. src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
  9660. tok("GTLT");
  9661. src[t.GTLT] = "((?:<|>)?=?)";
  9662. tok("XRANGEIDENTIFIERLOOSE");
  9663. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
  9664. tok("XRANGEIDENTIFIER");
  9665. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
  9666. tok("XRANGEPLAIN");
  9667. src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
  9668. tok("XRANGEPLAINLOOSE");
  9669. src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
  9670. tok("XRANGE");
  9671. src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
  9672. tok("XRANGELOOSE");
  9673. src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
  9674. tok("COERCE");
  9675. src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
  9676. tok("COERCERTL");
  9677. re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
  9678. tok("LONETILDE");
  9679. src[t.LONETILDE] = "(?:~>?)";
  9680. tok("TILDETRIM");
  9681. src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
  9682. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
  9683. var tildeTrimReplace = "$1~";
  9684. tok("TILDE");
  9685. src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
  9686. tok("TILDELOOSE");
  9687. src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
  9688. tok("LONECARET");
  9689. src[t.LONECARET] = "(?:\\^)";
  9690. tok("CARETTRIM");
  9691. src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
  9692. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
  9693. var caretTrimReplace = "$1^";
  9694. tok("CARET");
  9695. src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
  9696. tok("CARETLOOSE");
  9697. src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
  9698. tok("COMPARATORLOOSE");
  9699. src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
  9700. tok("COMPARATOR");
  9701. src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
  9702. tok("COMPARATORTRIM");
  9703. src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
  9704. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
  9705. var comparatorTrimReplace = "$1$2$3";
  9706. tok("HYPHENRANGE");
  9707. src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
  9708. tok("HYPHENRANGELOOSE");
  9709. src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
  9710. tok("STAR");
  9711. src[t.STAR] = "(<|>)?=?\\s*\\*";
  9712. for (i = 0; i < R; i++) {
  9713. debug(i, src[i]);
  9714. if (!re[i]) {
  9715. re[i] = new RegExp(src[i]);
  9716. }
  9717. }
  9718. var i;
  9719. exports2.parse = parse;
  9720. function parse(version, options) {
  9721. if (!options || typeof options !== "object") {
  9722. options = {
  9723. loose: !!options,
  9724. includePrerelease: false
  9725. };
  9726. }
  9727. if (version instanceof SemVer) {
  9728. return version;
  9729. }
  9730. if (typeof version !== "string") {
  9731. return null;
  9732. }
  9733. if (version.length > MAX_LENGTH) {
  9734. return null;
  9735. }
  9736. var r = options.loose ? re[t.LOOSE] : re[t.FULL];
  9737. if (!r.test(version)) {
  9738. return null;
  9739. }
  9740. try {
  9741. return new SemVer(version, options);
  9742. } catch (er) {
  9743. return null;
  9744. }
  9745. }
  9746. exports2.valid = valid;
  9747. function valid(version, options) {
  9748. var v = parse(version, options);
  9749. return v ? v.version : null;
  9750. }
  9751. exports2.clean = clean;
  9752. function clean(version, options) {
  9753. var s = parse(version.trim().replace(/^[=v]+/, ""), options);
  9754. return s ? s.version : null;
  9755. }
  9756. exports2.SemVer = SemVer;
  9757. function SemVer(version, options) {
  9758. if (!options || typeof options !== "object") {
  9759. options = {
  9760. loose: !!options,
  9761. includePrerelease: false
  9762. };
  9763. }
  9764. if (version instanceof SemVer) {
  9765. if (version.loose === options.loose) {
  9766. return version;
  9767. } else {
  9768. version = version.version;
  9769. }
  9770. } else if (typeof version !== "string") {
  9771. throw new TypeError("Invalid Version: " + version);
  9772. }
  9773. if (version.length > MAX_LENGTH) {
  9774. throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
  9775. }
  9776. if (!(this instanceof SemVer)) {
  9777. return new SemVer(version, options);
  9778. }
  9779. debug("SemVer", version, options);
  9780. this.options = options;
  9781. this.loose = !!options.loose;
  9782. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
  9783. if (!m) {
  9784. throw new TypeError("Invalid Version: " + version);
  9785. }
  9786. this.raw = version;
  9787. this.major = +m[1];
  9788. this.minor = +m[2];
  9789. this.patch = +m[3];
  9790. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9791. throw new TypeError("Invalid major version");
  9792. }
  9793. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9794. throw new TypeError("Invalid minor version");
  9795. }
  9796. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9797. throw new TypeError("Invalid patch version");
  9798. }
  9799. if (!m[4]) {
  9800. this.prerelease = [];
  9801. } else {
  9802. this.prerelease = m[4].split(".").map(function(id) {
  9803. if (/^[0-9]+$/.test(id)) {
  9804. var num = +id;
  9805. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9806. return num;
  9807. }
  9808. }
  9809. return id;
  9810. });
  9811. }
  9812. this.build = m[5] ? m[5].split(".") : [];
  9813. this.format();
  9814. }
  9815. SemVer.prototype.format = function() {
  9816. this.version = this.major + "." + this.minor + "." + this.patch;
  9817. if (this.prerelease.length) {
  9818. this.version += "-" + this.prerelease.join(".");
  9819. }
  9820. return this.version;
  9821. };
  9822. SemVer.prototype.toString = function() {
  9823. return this.version;
  9824. };
  9825. SemVer.prototype.compare = function(other) {
  9826. debug("SemVer.compare", this.version, this.options, other);
  9827. if (!(other instanceof SemVer)) {
  9828. other = new SemVer(other, this.options);
  9829. }
  9830. return this.compareMain(other) || this.comparePre(other);
  9831. };
  9832. SemVer.prototype.compareMain = function(other) {
  9833. if (!(other instanceof SemVer)) {
  9834. other = new SemVer(other, this.options);
  9835. }
  9836. return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
  9837. };
  9838. SemVer.prototype.comparePre = function(other) {
  9839. if (!(other instanceof SemVer)) {
  9840. other = new SemVer(other, this.options);
  9841. }
  9842. if (this.prerelease.length && !other.prerelease.length) {
  9843. return -1;
  9844. } else if (!this.prerelease.length && other.prerelease.length) {
  9845. return 1;
  9846. } else if (!this.prerelease.length && !other.prerelease.length) {
  9847. return 0;
  9848. }
  9849. var i2 = 0;
  9850. do {
  9851. var a = this.prerelease[i2];
  9852. var b = other.prerelease[i2];
  9853. debug("prerelease compare", i2, a, b);
  9854. if (a === void 0 && b === void 0) {
  9855. return 0;
  9856. } else if (b === void 0) {
  9857. return 1;
  9858. } else if (a === void 0) {
  9859. return -1;
  9860. } else if (a === b) {
  9861. continue;
  9862. } else {
  9863. return compareIdentifiers(a, b);
  9864. }
  9865. } while (++i2);
  9866. };
  9867. SemVer.prototype.compareBuild = function(other) {
  9868. if (!(other instanceof SemVer)) {
  9869. other = new SemVer(other, this.options);
  9870. }
  9871. var i2 = 0;
  9872. do {
  9873. var a = this.build[i2];
  9874. var b = other.build[i2];
  9875. debug("prerelease compare", i2, a, b);
  9876. if (a === void 0 && b === void 0) {
  9877. return 0;
  9878. } else if (b === void 0) {
  9879. return 1;
  9880. } else if (a === void 0) {
  9881. return -1;
  9882. } else if (a === b) {
  9883. continue;
  9884. } else {
  9885. return compareIdentifiers(a, b);
  9886. }
  9887. } while (++i2);
  9888. };
  9889. SemVer.prototype.inc = function(release, identifier) {
  9890. switch (release) {
  9891. case "premajor":
  9892. this.prerelease.length = 0;
  9893. this.patch = 0;
  9894. this.minor = 0;
  9895. this.major++;
  9896. this.inc("pre", identifier);
  9897. break;
  9898. case "preminor":
  9899. this.prerelease.length = 0;
  9900. this.patch = 0;
  9901. this.minor++;
  9902. this.inc("pre", identifier);
  9903. break;
  9904. case "prepatch":
  9905. this.prerelease.length = 0;
  9906. this.inc("patch", identifier);
  9907. this.inc("pre", identifier);
  9908. break;
  9909. case "prerelease":
  9910. if (this.prerelease.length === 0) {
  9911. this.inc("patch", identifier);
  9912. }
  9913. this.inc("pre", identifier);
  9914. break;
  9915. case "major":
  9916. if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
  9917. this.major++;
  9918. }
  9919. this.minor = 0;
  9920. this.patch = 0;
  9921. this.prerelease = [];
  9922. break;
  9923. case "minor":
  9924. if (this.patch !== 0 || this.prerelease.length === 0) {
  9925. this.minor++;
  9926. }
  9927. this.patch = 0;
  9928. this.prerelease = [];
  9929. break;
  9930. case "patch":
  9931. if (this.prerelease.length === 0) {
  9932. this.patch++;
  9933. }
  9934. this.prerelease = [];
  9935. break;
  9936. case "pre":
  9937. if (this.prerelease.length === 0) {
  9938. this.prerelease = [0];
  9939. } else {
  9940. var i2 = this.prerelease.length;
  9941. while (--i2 >= 0) {
  9942. if (typeof this.prerelease[i2] === "number") {
  9943. this.prerelease[i2]++;
  9944. i2 = -2;
  9945. }
  9946. }
  9947. if (i2 === -1) {
  9948. this.prerelease.push(0);
  9949. }
  9950. }
  9951. if (identifier) {
  9952. if (this.prerelease[0] === identifier) {
  9953. if (isNaN(this.prerelease[1])) {
  9954. this.prerelease = [identifier, 0];
  9955. }
  9956. } else {
  9957. this.prerelease = [identifier, 0];
  9958. }
  9959. }
  9960. break;
  9961. default:
  9962. throw new Error("invalid increment argument: " + release);
  9963. }
  9964. this.format();
  9965. this.raw = this.version;
  9966. return this;
  9967. };
  9968. exports2.inc = inc;
  9969. function inc(version, release, loose, identifier) {
  9970. if (typeof loose === "string") {
  9971. identifier = loose;
  9972. loose = void 0;
  9973. }
  9974. try {
  9975. return new SemVer(version, loose).inc(release, identifier).version;
  9976. } catch (er) {
  9977. return null;
  9978. }
  9979. }
  9980. exports2.diff = diff;
  9981. function diff(version1, version2) {
  9982. if (eq(version1, version2)) {
  9983. return null;
  9984. } else {
  9985. var v1 = parse(version1);
  9986. var v2 = parse(version2);
  9987. var prefix = "";
  9988. if (v1.prerelease.length || v2.prerelease.length) {
  9989. prefix = "pre";
  9990. var defaultResult = "prerelease";
  9991. }
  9992. for (var key in v1) {
  9993. if (key === "major" || key === "minor" || key === "patch") {
  9994. if (v1[key] !== v2[key]) {
  9995. return prefix + key;
  9996. }
  9997. }
  9998. }
  9999. return defaultResult;
  10000. }
  10001. }
  10002. exports2.compareIdentifiers = compareIdentifiers;
  10003. var numeric = /^[0-9]+$/;
  10004. function compareIdentifiers(a, b) {
  10005. var anum = numeric.test(a);
  10006. var bnum = numeric.test(b);
  10007. if (anum && bnum) {
  10008. a = +a;
  10009. b = +b;
  10010. }
  10011. return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
  10012. }
  10013. exports2.rcompareIdentifiers = rcompareIdentifiers;
  10014. function rcompareIdentifiers(a, b) {
  10015. return compareIdentifiers(b, a);
  10016. }
  10017. exports2.major = major;
  10018. function major(a, loose) {
  10019. return new SemVer(a, loose).major;
  10020. }
  10021. exports2.minor = minor;
  10022. function minor(a, loose) {
  10023. return new SemVer(a, loose).minor;
  10024. }
  10025. exports2.patch = patch;
  10026. function patch(a, loose) {
  10027. return new SemVer(a, loose).patch;
  10028. }
  10029. exports2.compare = compare;
  10030. function compare(a, b, loose) {
  10031. return new SemVer(a, loose).compare(new SemVer(b, loose));
  10032. }
  10033. exports2.compareLoose = compareLoose;
  10034. function compareLoose(a, b) {
  10035. return compare(a, b, true);
  10036. }
  10037. exports2.compareBuild = compareBuild;
  10038. function compareBuild(a, b, loose) {
  10039. var versionA = new SemVer(a, loose);
  10040. var versionB = new SemVer(b, loose);
  10041. return versionA.compare(versionB) || versionA.compareBuild(versionB);
  10042. }
  10043. exports2.rcompare = rcompare;
  10044. function rcompare(a, b, loose) {
  10045. return compare(b, a, loose);
  10046. }
  10047. exports2.sort = sort;
  10048. function sort(list, loose) {
  10049. return list.sort(function(a, b) {
  10050. return exports2.compareBuild(a, b, loose);
  10051. });
  10052. }
  10053. exports2.rsort = rsort;
  10054. function rsort(list, loose) {
  10055. return list.sort(function(a, b) {
  10056. return exports2.compareBuild(b, a, loose);
  10057. });
  10058. }
  10059. exports2.gt = gt;
  10060. function gt(a, b, loose) {
  10061. return compare(a, b, loose) > 0;
  10062. }
  10063. exports2.lt = lt;
  10064. function lt(a, b, loose) {
  10065. return compare(a, b, loose) < 0;
  10066. }
  10067. exports2.eq = eq;
  10068. function eq(a, b, loose) {
  10069. return compare(a, b, loose) === 0;
  10070. }
  10071. exports2.neq = neq;
  10072. function neq(a, b, loose) {
  10073. return compare(a, b, loose) !== 0;
  10074. }
  10075. exports2.gte = gte;
  10076. function gte(a, b, loose) {
  10077. return compare(a, b, loose) >= 0;
  10078. }
  10079. exports2.lte = lte;
  10080. function lte(a, b, loose) {
  10081. return compare(a, b, loose) <= 0;
  10082. }
  10083. exports2.cmp = cmp;
  10084. function cmp(a, op, b, loose) {
  10085. switch (op) {
  10086. case "===":
  10087. if (typeof a === "object")
  10088. a = a.version;
  10089. if (typeof b === "object")
  10090. b = b.version;
  10091. return a === b;
  10092. case "!==":
  10093. if (typeof a === "object")
  10094. a = a.version;
  10095. if (typeof b === "object")
  10096. b = b.version;
  10097. return a !== b;
  10098. case "":
  10099. case "=":
  10100. case "==":
  10101. return eq(a, b, loose);
  10102. case "!=":
  10103. return neq(a, b, loose);
  10104. case ">":
  10105. return gt(a, b, loose);
  10106. case ">=":
  10107. return gte(a, b, loose);
  10108. case "<":
  10109. return lt(a, b, loose);
  10110. case "<=":
  10111. return lte(a, b, loose);
  10112. default:
  10113. throw new TypeError("Invalid operator: " + op);
  10114. }
  10115. }
  10116. exports2.Comparator = Comparator;
  10117. function Comparator(comp, options) {
  10118. if (!options || typeof options !== "object") {
  10119. options = {
  10120. loose: !!options,
  10121. includePrerelease: false
  10122. };
  10123. }
  10124. if (comp instanceof Comparator) {
  10125. if (comp.loose === !!options.loose) {
  10126. return comp;
  10127. } else {
  10128. comp = comp.value;
  10129. }
  10130. }
  10131. if (!(this instanceof Comparator)) {
  10132. return new Comparator(comp, options);
  10133. }
  10134. debug("comparator", comp, options);
  10135. this.options = options;
  10136. this.loose = !!options.loose;
  10137. this.parse(comp);
  10138. if (this.semver === ANY) {
  10139. this.value = "";
  10140. } else {
  10141. this.value = this.operator + this.semver.version;
  10142. }
  10143. debug("comp", this);
  10144. }
  10145. var ANY = {};
  10146. Comparator.prototype.parse = function(comp) {
  10147. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10148. var m = comp.match(r);
  10149. if (!m) {
  10150. throw new TypeError("Invalid comparator: " + comp);
  10151. }
  10152. this.operator = m[1] !== void 0 ? m[1] : "";
  10153. if (this.operator === "=") {
  10154. this.operator = "";
  10155. }
  10156. if (!m[2]) {
  10157. this.semver = ANY;
  10158. } else {
  10159. this.semver = new SemVer(m[2], this.options.loose);
  10160. }
  10161. };
  10162. Comparator.prototype.toString = function() {
  10163. return this.value;
  10164. };
  10165. Comparator.prototype.test = function(version) {
  10166. debug("Comparator.test", version, this.options.loose);
  10167. if (this.semver === ANY || version === ANY) {
  10168. return true;
  10169. }
  10170. if (typeof version === "string") {
  10171. try {
  10172. version = new SemVer(version, this.options);
  10173. } catch (er) {
  10174. return false;
  10175. }
  10176. }
  10177. return cmp(version, this.operator, this.semver, this.options);
  10178. };
  10179. Comparator.prototype.intersects = function(comp, options) {
  10180. if (!(comp instanceof Comparator)) {
  10181. throw new TypeError("a Comparator is required");
  10182. }
  10183. if (!options || typeof options !== "object") {
  10184. options = {
  10185. loose: !!options,
  10186. includePrerelease: false
  10187. };
  10188. }
  10189. var rangeTmp;
  10190. if (this.operator === "") {
  10191. if (this.value === "") {
  10192. return true;
  10193. }
  10194. rangeTmp = new Range(comp.value, options);
  10195. return satisfies(this.value, rangeTmp, options);
  10196. } else if (comp.operator === "") {
  10197. if (comp.value === "") {
  10198. return true;
  10199. }
  10200. rangeTmp = new Range(this.value, options);
  10201. return satisfies(comp.semver, rangeTmp, options);
  10202. }
  10203. var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
  10204. var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
  10205. var sameSemVer = this.semver.version === comp.semver.version;
  10206. var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
  10207. var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
  10208. var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
  10209. return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
  10210. };
  10211. exports2.Range = Range;
  10212. function Range(range, options) {
  10213. if (!options || typeof options !== "object") {
  10214. options = {
  10215. loose: !!options,
  10216. includePrerelease: false
  10217. };
  10218. }
  10219. if (range instanceof Range) {
  10220. if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
  10221. return range;
  10222. } else {
  10223. return new Range(range.raw, options);
  10224. }
  10225. }
  10226. if (range instanceof Comparator) {
  10227. return new Range(range.value, options);
  10228. }
  10229. if (!(this instanceof Range)) {
  10230. return new Range(range, options);
  10231. }
  10232. this.options = options;
  10233. this.loose = !!options.loose;
  10234. this.includePrerelease = !!options.includePrerelease;
  10235. this.raw = range;
  10236. this.set = range.split(/\s*\|\|\s*/).map(function(range2) {
  10237. return this.parseRange(range2.trim());
  10238. }, this).filter(function(c) {
  10239. return c.length;
  10240. });
  10241. if (!this.set.length) {
  10242. throw new TypeError("Invalid SemVer Range: " + range);
  10243. }
  10244. this.format();
  10245. }
  10246. Range.prototype.format = function() {
  10247. this.range = this.set.map(function(comps) {
  10248. return comps.join(" ").trim();
  10249. }).join("||").trim();
  10250. return this.range;
  10251. };
  10252. Range.prototype.toString = function() {
  10253. return this.range;
  10254. };
  10255. Range.prototype.parseRange = function(range) {
  10256. var loose = this.options.loose;
  10257. range = range.trim();
  10258. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
  10259. range = range.replace(hr, hyphenReplace);
  10260. debug("hyphen replace", range);
  10261. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
  10262. debug("comparator trim", range, re[t.COMPARATORTRIM]);
  10263. range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
  10264. range = range.replace(re[t.CARETTRIM], caretTrimReplace);
  10265. range = range.split(/\s+/).join(" ");
  10266. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10267. var set = range.split(" ").map(function(comp) {
  10268. return parseComparator(comp, this.options);
  10269. }, this).join(" ").split(/\s+/);
  10270. if (this.options.loose) {
  10271. set = set.filter(function(comp) {
  10272. return !!comp.match(compRe);
  10273. });
  10274. }
  10275. set = set.map(function(comp) {
  10276. return new Comparator(comp, this.options);
  10277. }, this);
  10278. return set;
  10279. };
  10280. Range.prototype.intersects = function(range, options) {
  10281. if (!(range instanceof Range)) {
  10282. throw new TypeError("a Range is required");
  10283. }
  10284. return this.set.some(function(thisComparators) {
  10285. return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
  10286. return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
  10287. return rangeComparators.every(function(rangeComparator) {
  10288. return thisComparator.intersects(rangeComparator, options);
  10289. });
  10290. });
  10291. });
  10292. });
  10293. };
  10294. function isSatisfiable(comparators, options) {
  10295. var result = true;
  10296. var remainingComparators = comparators.slice();
  10297. var testComparator = remainingComparators.pop();
  10298. while (result && remainingComparators.length) {
  10299. result = remainingComparators.every(function(otherComparator) {
  10300. return testComparator.intersects(otherComparator, options);
  10301. });
  10302. testComparator = remainingComparators.pop();
  10303. }
  10304. return result;
  10305. }
  10306. exports2.toComparators = toComparators;
  10307. function toComparators(range, options) {
  10308. return new Range(range, options).set.map(function(comp) {
  10309. return comp.map(function(c) {
  10310. return c.value;
  10311. }).join(" ").trim().split(" ");
  10312. });
  10313. }
  10314. function parseComparator(comp, options) {
  10315. debug("comp", comp, options);
  10316. comp = replaceCarets(comp, options);
  10317. debug("caret", comp);
  10318. comp = replaceTildes(comp, options);
  10319. debug("tildes", comp);
  10320. comp = replaceXRanges(comp, options);
  10321. debug("xrange", comp);
  10322. comp = replaceStars(comp, options);
  10323. debug("stars", comp);
  10324. return comp;
  10325. }
  10326. function isX(id) {
  10327. return !id || id.toLowerCase() === "x" || id === "*";
  10328. }
  10329. function replaceTildes(comp, options) {
  10330. return comp.trim().split(/\s+/).map(function(comp2) {
  10331. return replaceTilde(comp2, options);
  10332. }).join(" ");
  10333. }
  10334. function replaceTilde(comp, options) {
  10335. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
  10336. return comp.replace(r, function(_, M, m, p, pr) {
  10337. debug("tilde", comp, _, M, m, p, pr);
  10338. var ret;
  10339. if (isX(M)) {
  10340. ret = "";
  10341. } else if (isX(m)) {
  10342. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10343. } else if (isX(p)) {
  10344. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10345. } else if (pr) {
  10346. debug("replaceTilde pr", pr);
  10347. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10348. } else {
  10349. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10350. }
  10351. debug("tilde return", ret);
  10352. return ret;
  10353. });
  10354. }
  10355. function replaceCarets(comp, options) {
  10356. return comp.trim().split(/\s+/).map(function(comp2) {
  10357. return replaceCaret(comp2, options);
  10358. }).join(" ");
  10359. }
  10360. function replaceCaret(comp, options) {
  10361. debug("caret", comp, options);
  10362. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
  10363. return comp.replace(r, function(_, M, m, p, pr) {
  10364. debug("caret", comp, _, M, m, p, pr);
  10365. var ret;
  10366. if (isX(M)) {
  10367. ret = "";
  10368. } else if (isX(m)) {
  10369. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10370. } else if (isX(p)) {
  10371. if (M === "0") {
  10372. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10373. } else {
  10374. ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
  10375. }
  10376. } else if (pr) {
  10377. debug("replaceCaret pr", pr);
  10378. if (M === "0") {
  10379. if (m === "0") {
  10380. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
  10381. } else {
  10382. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10383. }
  10384. } else {
  10385. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
  10386. }
  10387. } else {
  10388. debug("no pr");
  10389. if (M === "0") {
  10390. if (m === "0") {
  10391. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
  10392. } else {
  10393. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10394. }
  10395. } else {
  10396. ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
  10397. }
  10398. }
  10399. debug("caret return", ret);
  10400. return ret;
  10401. });
  10402. }
  10403. function replaceXRanges(comp, options) {
  10404. debug("replaceXRanges", comp, options);
  10405. return comp.split(/\s+/).map(function(comp2) {
  10406. return replaceXRange(comp2, options);
  10407. }).join(" ");
  10408. }
  10409. function replaceXRange(comp, options) {
  10410. comp = comp.trim();
  10411. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
  10412. return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
  10413. debug("xRange", comp, ret, gtlt, M, m, p, pr);
  10414. var xM = isX(M);
  10415. var xm = xM || isX(m);
  10416. var xp = xm || isX(p);
  10417. var anyX = xp;
  10418. if (gtlt === "=" && anyX) {
  10419. gtlt = "";
  10420. }
  10421. pr = options.includePrerelease ? "-0" : "";
  10422. if (xM) {
  10423. if (gtlt === ">" || gtlt === "<") {
  10424. ret = "<0.0.0-0";
  10425. } else {
  10426. ret = "*";
  10427. }
  10428. } else if (gtlt && anyX) {
  10429. if (xm) {
  10430. m = 0;
  10431. }
  10432. p = 0;
  10433. if (gtlt === ">") {
  10434. gtlt = ">=";
  10435. if (xm) {
  10436. M = +M + 1;
  10437. m = 0;
  10438. p = 0;
  10439. } else {
  10440. m = +m + 1;
  10441. p = 0;
  10442. }
  10443. } else if (gtlt === "<=") {
  10444. gtlt = "<";
  10445. if (xm) {
  10446. M = +M + 1;
  10447. } else {
  10448. m = +m + 1;
  10449. }
  10450. }
  10451. ret = gtlt + M + "." + m + "." + p + pr;
  10452. } else if (xm) {
  10453. ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
  10454. } else if (xp) {
  10455. ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
  10456. }
  10457. debug("xRange return", ret);
  10458. return ret;
  10459. });
  10460. }
  10461. function replaceStars(comp, options) {
  10462. debug("replaceStars", comp, options);
  10463. return comp.trim().replace(re[t.STAR], "");
  10464. }
  10465. function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
  10466. if (isX(fM)) {
  10467. from = "";
  10468. } else if (isX(fm)) {
  10469. from = ">=" + fM + ".0.0";
  10470. } else if (isX(fp)) {
  10471. from = ">=" + fM + "." + fm + ".0";
  10472. } else {
  10473. from = ">=" + from;
  10474. }
  10475. if (isX(tM)) {
  10476. to = "";
  10477. } else if (isX(tm)) {
  10478. to = "<" + (+tM + 1) + ".0.0";
  10479. } else if (isX(tp)) {
  10480. to = "<" + tM + "." + (+tm + 1) + ".0";
  10481. } else if (tpr) {
  10482. to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
  10483. } else {
  10484. to = "<=" + to;
  10485. }
  10486. return (from + " " + to).trim();
  10487. }
  10488. Range.prototype.test = function(version) {
  10489. if (!version) {
  10490. return false;
  10491. }
  10492. if (typeof version === "string") {
  10493. try {
  10494. version = new SemVer(version, this.options);
  10495. } catch (er) {
  10496. return false;
  10497. }
  10498. }
  10499. for (var i2 = 0; i2 < this.set.length; i2++) {
  10500. if (testSet(this.set[i2], version, this.options)) {
  10501. return true;
  10502. }
  10503. }
  10504. return false;
  10505. };
  10506. function testSet(set, version, options) {
  10507. for (var i2 = 0; i2 < set.length; i2++) {
  10508. if (!set[i2].test(version)) {
  10509. return false;
  10510. }
  10511. }
  10512. if (version.prerelease.length && !options.includePrerelease) {
  10513. for (i2 = 0; i2 < set.length; i2++) {
  10514. debug(set[i2].semver);
  10515. if (set[i2].semver === ANY) {
  10516. continue;
  10517. }
  10518. if (set[i2].semver.prerelease.length > 0) {
  10519. var allowed = set[i2].semver;
  10520. if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
  10521. return true;
  10522. }
  10523. }
  10524. }
  10525. return false;
  10526. }
  10527. return true;
  10528. }
  10529. exports2.satisfies = satisfies;
  10530. function satisfies(version, range, options) {
  10531. try {
  10532. range = new Range(range, options);
  10533. } catch (er) {
  10534. return false;
  10535. }
  10536. return range.test(version);
  10537. }
  10538. exports2.maxSatisfying = maxSatisfying;
  10539. function maxSatisfying(versions, range, options) {
  10540. var max = null;
  10541. var maxSV = null;
  10542. try {
  10543. var rangeObj = new Range(range, options);
  10544. } catch (er) {
  10545. return null;
  10546. }
  10547. versions.forEach(function(v) {
  10548. if (rangeObj.test(v)) {
  10549. if (!max || maxSV.compare(v) === -1) {
  10550. max = v;
  10551. maxSV = new SemVer(max, options);
  10552. }
  10553. }
  10554. });
  10555. return max;
  10556. }
  10557. exports2.minSatisfying = minSatisfying;
  10558. function minSatisfying(versions, range, options) {
  10559. var min = null;
  10560. var minSV = null;
  10561. try {
  10562. var rangeObj = new Range(range, options);
  10563. } catch (er) {
  10564. return null;
  10565. }
  10566. versions.forEach(function(v) {
  10567. if (rangeObj.test(v)) {
  10568. if (!min || minSV.compare(v) === 1) {
  10569. min = v;
  10570. minSV = new SemVer(min, options);
  10571. }
  10572. }
  10573. });
  10574. return min;
  10575. }
  10576. exports2.minVersion = minVersion;
  10577. function minVersion(range, loose) {
  10578. range = new Range(range, loose);
  10579. var minver = new SemVer("0.0.0");
  10580. if (range.test(minver)) {
  10581. return minver;
  10582. }
  10583. minver = new SemVer("0.0.0-0");
  10584. if (range.test(minver)) {
  10585. return minver;
  10586. }
  10587. minver = null;
  10588. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10589. var comparators = range.set[i2];
  10590. comparators.forEach(function(comparator) {
  10591. var compver = new SemVer(comparator.semver.version);
  10592. switch (comparator.operator) {
  10593. case ">":
  10594. if (compver.prerelease.length === 0) {
  10595. compver.patch++;
  10596. } else {
  10597. compver.prerelease.push(0);
  10598. }
  10599. compver.raw = compver.format();
  10600. case "":
  10601. case ">=":
  10602. if (!minver || gt(minver, compver)) {
  10603. minver = compver;
  10604. }
  10605. break;
  10606. case "<":
  10607. case "<=":
  10608. break;
  10609. default:
  10610. throw new Error("Unexpected operation: " + comparator.operator);
  10611. }
  10612. });
  10613. }
  10614. if (minver && range.test(minver)) {
  10615. return minver;
  10616. }
  10617. return null;
  10618. }
  10619. exports2.validRange = validRange;
  10620. function validRange(range, options) {
  10621. try {
  10622. return new Range(range, options).range || "*";
  10623. } catch (er) {
  10624. return null;
  10625. }
  10626. }
  10627. exports2.ltr = ltr;
  10628. function ltr(version, range, options) {
  10629. return outside(version, range, "<", options);
  10630. }
  10631. exports2.gtr = gtr;
  10632. function gtr(version, range, options) {
  10633. return outside(version, range, ">", options);
  10634. }
  10635. exports2.outside = outside;
  10636. function outside(version, range, hilo, options) {
  10637. version = new SemVer(version, options);
  10638. range = new Range(range, options);
  10639. var gtfn, ltefn, ltfn, comp, ecomp;
  10640. switch (hilo) {
  10641. case ">":
  10642. gtfn = gt;
  10643. ltefn = lte;
  10644. ltfn = lt;
  10645. comp = ">";
  10646. ecomp = ">=";
  10647. break;
  10648. case "<":
  10649. gtfn = lt;
  10650. ltefn = gte;
  10651. ltfn = gt;
  10652. comp = "<";
  10653. ecomp = "<=";
  10654. break;
  10655. default:
  10656. throw new TypeError('Must provide a hilo val of "<" or ">"');
  10657. }
  10658. if (satisfies(version, range, options)) {
  10659. return false;
  10660. }
  10661. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10662. var comparators = range.set[i2];
  10663. var high = null;
  10664. var low = null;
  10665. comparators.forEach(function(comparator) {
  10666. if (comparator.semver === ANY) {
  10667. comparator = new Comparator(">=0.0.0");
  10668. }
  10669. high = high || comparator;
  10670. low = low || comparator;
  10671. if (gtfn(comparator.semver, high.semver, options)) {
  10672. high = comparator;
  10673. } else if (ltfn(comparator.semver, low.semver, options)) {
  10674. low = comparator;
  10675. }
  10676. });
  10677. if (high.operator === comp || high.operator === ecomp) {
  10678. return false;
  10679. }
  10680. if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
  10681. return false;
  10682. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10683. return false;
  10684. }
  10685. }
  10686. return true;
  10687. }
  10688. exports2.prerelease = prerelease;
  10689. function prerelease(version, options) {
  10690. var parsed = parse(version, options);
  10691. return parsed && parsed.prerelease.length ? parsed.prerelease : null;
  10692. }
  10693. exports2.intersects = intersects;
  10694. function intersects(r1, r2, options) {
  10695. r1 = new Range(r1, options);
  10696. r2 = new Range(r2, options);
  10697. return r1.intersects(r2);
  10698. }
  10699. exports2.coerce = coerce;
  10700. function coerce(version, options) {
  10701. if (version instanceof SemVer) {
  10702. return version;
  10703. }
  10704. if (typeof version === "number") {
  10705. version = String(version);
  10706. }
  10707. if (typeof version !== "string") {
  10708. return null;
  10709. }
  10710. options = options || {};
  10711. var match = null;
  10712. if (!options.rtl) {
  10713. match = version.match(re[t.COERCE]);
  10714. } else {
  10715. var next;
  10716. while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
  10717. if (!match || next.index + next[0].length !== match.index + match[0].length) {
  10718. match = next;
  10719. }
  10720. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
  10721. }
  10722. re[t.COERCERTL].lastIndex = -1;
  10723. }
  10724. if (match === null) {
  10725. return null;
  10726. }
  10727. return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
  10728. }
  10729. }
  10730. });
  10731. var require_make_dir = __commonJS2({
  10732. "node_modules/make-dir/index.js"(exports2, module2) {
  10733. "use strict";
  10734. var fs = require("fs");
  10735. var path = require("path");
  10736. var {
  10737. promisify
  10738. } = require("util");
  10739. var semver = require_semver();
  10740. var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
  10741. var checkPath = (pth) => {
  10742. if (process.platform === "win32") {
  10743. const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
  10744. if (pathHasInvalidWinCharacters) {
  10745. const error = new Error(`Path contains invalid characters: ${pth}`);
  10746. error.code = "EINVAL";
  10747. throw error;
  10748. }
  10749. }
  10750. };
  10751. var processOptions = (options) => {
  10752. const defaults = {
  10753. mode: 511,
  10754. fs
  10755. };
  10756. return Object.assign(Object.assign({}, defaults), options);
  10757. };
  10758. var permissionError = (pth) => {
  10759. const error = new Error(`operation not permitted, mkdir '${pth}'`);
  10760. error.code = "EPERM";
  10761. error.errno = -4048;
  10762. error.path = pth;
  10763. error.syscall = "mkdir";
  10764. return error;
  10765. };
  10766. var makeDir = async (input, options) => {
  10767. checkPath(input);
  10768. options = processOptions(options);
  10769. const mkdir = promisify(options.fs.mkdir);
  10770. const stat = promisify(options.fs.stat);
  10771. if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
  10772. const pth = path.resolve(input);
  10773. await mkdir(pth, {
  10774. mode: options.mode,
  10775. recursive: true
  10776. });
  10777. return pth;
  10778. }
  10779. const make = async (pth) => {
  10780. try {
  10781. await mkdir(pth, options.mode);
  10782. return pth;
  10783. } catch (error) {
  10784. if (error.code === "EPERM") {
  10785. throw error;
  10786. }
  10787. if (error.code === "ENOENT") {
  10788. if (path.dirname(pth) === pth) {
  10789. throw permissionError(pth);
  10790. }
  10791. if (error.message.includes("null bytes")) {
  10792. throw error;
  10793. }
  10794. await make(path.dirname(pth));
  10795. return make(pth);
  10796. }
  10797. try {
  10798. const stats = await stat(pth);
  10799. if (!stats.isDirectory()) {
  10800. throw new Error("The path is not a directory");
  10801. }
  10802. } catch (_) {
  10803. throw error;
  10804. }
  10805. return pth;
  10806. }
  10807. };
  10808. return make(path.resolve(input));
  10809. };
  10810. module2.exports = makeDir;
  10811. module2.exports.sync = (input, options) => {
  10812. checkPath(input);
  10813. options = processOptions(options);
  10814. if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
  10815. const pth = path.resolve(input);
  10816. fs.mkdirSync(pth, {
  10817. mode: options.mode,
  10818. recursive: true
  10819. });
  10820. return pth;
  10821. }
  10822. const make = (pth) => {
  10823. try {
  10824. options.fs.mkdirSync(pth, options.mode);
  10825. } catch (error) {
  10826. if (error.code === "EPERM") {
  10827. throw error;
  10828. }
  10829. if (error.code === "ENOENT") {
  10830. if (path.dirname(pth) === pth) {
  10831. throw permissionError(pth);
  10832. }
  10833. if (error.message.includes("null bytes")) {
  10834. throw error;
  10835. }
  10836. make(path.dirname(pth));
  10837. return make(pth);
  10838. }
  10839. try {
  10840. if (!options.fs.statSync(pth).isDirectory()) {
  10841. throw new Error("The path is not a directory");
  10842. }
  10843. } catch (_) {
  10844. throw error;
  10845. }
  10846. }
  10847. return pth;
  10848. };
  10849. return make(path.resolve(input));
  10850. };
  10851. }
  10852. });
  10853. var require_find_cache_dir = __commonJS2({
  10854. "node_modules/find-cache-dir/index.js"(exports2, module2) {
  10855. "use strict";
  10856. var path = require("path");
  10857. var fs = require("fs");
  10858. var commonDir = require_commondir();
  10859. var pkgDir = require_pkg_dir();
  10860. var makeDir = require_make_dir();
  10861. var {
  10862. env: env2,
  10863. cwd
  10864. } = process;
  10865. var isWritable = (path2) => {
  10866. try {
  10867. fs.accessSync(path2, fs.constants.W_OK);
  10868. return true;
  10869. } catch (_) {
  10870. return false;
  10871. }
  10872. };
  10873. function useDirectory(directory, options) {
  10874. if (options.create) {
  10875. makeDir.sync(directory);
  10876. }
  10877. if (options.thunk) {
  10878. return (...arguments_) => path.join(directory, ...arguments_);
  10879. }
  10880. return directory;
  10881. }
  10882. function getNodeModuleDirectory(directory) {
  10883. const nodeModules = path.join(directory, "node_modules");
  10884. if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path.join(directory)))) {
  10885. return;
  10886. }
  10887. return nodeModules;
  10888. }
  10889. module2.exports = (options = {}) => {
  10890. if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) {
  10891. return useDirectory(path.join(env2.CACHE_DIR, options.name), options);
  10892. }
  10893. let {
  10894. cwd: directory = cwd()
  10895. } = options;
  10896. if (options.files) {
  10897. directory = commonDir(directory, options.files);
  10898. }
  10899. directory = pkgDir.sync(directory);
  10900. if (!directory) {
  10901. return;
  10902. }
  10903. const nodeModules = getNodeModuleDirectory(directory);
  10904. if (!nodeModules) {
  10905. return void 0;
  10906. }
  10907. return useDirectory(path.join(directory, "node_modules", ".cache", options.name), options);
  10908. };
  10909. }
  10910. });
  10911. var require_find_cache_file = __commonJS2({
  10912. "src/cli/find-cache-file.js"(exports2, module2) {
  10913. "use strict";
  10914. var os2 = require("os");
  10915. var path = require("path");
  10916. var findCacheDir = require_find_cache_dir();
  10917. function findCacheFile() {
  10918. const cacheDir = findCacheDir({
  10919. name: "prettier",
  10920. create: true
  10921. }) || os2.tmpdir();
  10922. const cacheFilePath = path.join(cacheDir, ".prettier-cache");
  10923. return cacheFilePath;
  10924. }
  10925. module2.exports = findCacheFile;
  10926. }
  10927. });
  10928. var require_cjs = __commonJS2({
  10929. "node_modules/flatted/cjs/index.js"(exports2) {
  10930. "use strict";
  10931. var {
  10932. parse: $parse,
  10933. stringify: $stringify
  10934. } = JSON;
  10935. var {
  10936. keys
  10937. } = Object;
  10938. var Primitive = String;
  10939. var primitive = "string";
  10940. var ignore = {};
  10941. var object = "object";
  10942. var noop = (_, value) => value;
  10943. var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
  10944. var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
  10945. var revive = (input, parsed, output, $) => {
  10946. const lazy = [];
  10947. for (let ke = keys(output), {
  10948. length
  10949. } = ke, y = 0; y < length; y++) {
  10950. const k = ke[y];
  10951. const value = output[k];
  10952. if (value instanceof Primitive) {
  10953. const tmp = input[value];
  10954. if (typeof tmp === object && !parsed.has(tmp)) {
  10955. parsed.add(tmp);
  10956. output[k] = ignore;
  10957. lazy.push({
  10958. k,
  10959. a: [input, parsed, tmp, $]
  10960. });
  10961. } else
  10962. output[k] = $.call(output, k, tmp);
  10963. } else if (output[k] !== ignore)
  10964. output[k] = $.call(output, k, value);
  10965. }
  10966. for (let {
  10967. length
  10968. } = lazy, i = 0; i < length; i++) {
  10969. const {
  10970. k,
  10971. a
  10972. } = lazy[i];
  10973. output[k] = $.call(output, k, revive.apply(null, a));
  10974. }
  10975. return output;
  10976. };
  10977. var set = (known, input, value) => {
  10978. const index = Primitive(input.push(value) - 1);
  10979. known.set(value, index);
  10980. return index;
  10981. };
  10982. var parse = (text, reviver) => {
  10983. const input = $parse(text, Primitives).map(primitives);
  10984. const value = input[0];
  10985. const $ = reviver || noop;
  10986. const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
  10987. return $.call({
  10988. "": tmp
  10989. }, "", tmp);
  10990. };
  10991. exports2.parse = parse;
  10992. var stringify2 = (value, replacer, space) => {
  10993. const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
  10994. const known = /* @__PURE__ */ new Map();
  10995. const input = [];
  10996. const output = [];
  10997. let i = +set(known, input, $.call({
  10998. "": value
  10999. }, "", value));
  11000. let firstRun = !i;
  11001. while (i < input.length) {
  11002. firstRun = true;
  11003. output[i] = $stringify(input[i++], replace, space);
  11004. }
  11005. return "[" + output.join(",") + "]";
  11006. function replace(key, value2) {
  11007. if (firstRun) {
  11008. firstRun = !firstRun;
  11009. return value2;
  11010. }
  11011. const after = $.call(this, key, value2);
  11012. switch (typeof after) {
  11013. case object:
  11014. if (after === null)
  11015. return after;
  11016. case primitive:
  11017. return known.get(after) || set(known, input, after);
  11018. }
  11019. return after;
  11020. }
  11021. };
  11022. exports2.stringify = stringify2;
  11023. var toJSON = (any) => $parse(stringify2(any));
  11024. exports2.toJSON = toJSON;
  11025. var fromJSON = (any) => parse($stringify(any));
  11026. exports2.fromJSON = fromJSON;
  11027. }
  11028. });
  11029. var require_utils6 = __commonJS2({
  11030. "node_modules/flat-cache/src/utils.js"(exports2, module2) {
  11031. var fs = require("fs");
  11032. var path = require("path");
  11033. var flatted = require_cjs();
  11034. module2.exports = {
  11035. tryParse: function(filePath, defaultValue) {
  11036. var result;
  11037. try {
  11038. result = this.readJSON(filePath);
  11039. } catch (ex) {
  11040. result = defaultValue;
  11041. }
  11042. return result;
  11043. },
  11044. readJSON: function(filePath) {
  11045. return flatted.parse(fs.readFileSync(filePath, {
  11046. encoding: "utf8"
  11047. }));
  11048. },
  11049. writeJSON: function(filePath, data) {
  11050. fs.mkdirSync(path.dirname(filePath), {
  11051. recursive: true
  11052. });
  11053. fs.writeFileSync(filePath, flatted.stringify(data));
  11054. }
  11055. };
  11056. }
  11057. });
  11058. var require_old = __commonJS2({
  11059. "node_modules/fs.realpath/old.js"(exports2) {
  11060. var pathModule = require("path");
  11061. var isWindows = process.platform === "win32";
  11062. var fs = require("fs");
  11063. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  11064. function rethrow() {
  11065. var callback;
  11066. if (DEBUG) {
  11067. var backtrace = new Error();
  11068. callback = debugCallback;
  11069. } else
  11070. callback = missingCallback;
  11071. return callback;
  11072. function debugCallback(err) {
  11073. if (err) {
  11074. backtrace.message = err.message;
  11075. err = backtrace;
  11076. missingCallback(err);
  11077. }
  11078. }
  11079. function missingCallback(err) {
  11080. if (err) {
  11081. if (process.throwDeprecation)
  11082. throw err;
  11083. else if (!process.noDeprecation) {
  11084. var msg = "fs: missing callback " + (err.stack || err.message);
  11085. if (process.traceDeprecation)
  11086. console.trace(msg);
  11087. else
  11088. console.error(msg);
  11089. }
  11090. }
  11091. }
  11092. }
  11093. function maybeCallback(cb) {
  11094. return typeof cb === "function" ? cb : rethrow();
  11095. }
  11096. var normalize = pathModule.normalize;
  11097. if (isWindows) {
  11098. nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  11099. } else {
  11100. nextPartRe = /(.*?)(?:[\/]+|$)/g;
  11101. }
  11102. var nextPartRe;
  11103. if (isWindows) {
  11104. splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  11105. } else {
  11106. splitRootRe = /^[\/]*/;
  11107. }
  11108. var splitRootRe;
  11109. exports2.realpathSync = function realpathSync(p, cache) {
  11110. p = pathModule.resolve(p);
  11111. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11112. return cache[p];
  11113. }
  11114. var original = p, seenLinks = {}, knownHard = {};
  11115. var pos;
  11116. var current;
  11117. var base;
  11118. var previous;
  11119. start();
  11120. function start() {
  11121. var m = splitRootRe.exec(p);
  11122. pos = m[0].length;
  11123. current = m[0];
  11124. base = m[0];
  11125. previous = "";
  11126. if (isWindows && !knownHard[base]) {
  11127. fs.lstatSync(base);
  11128. knownHard[base] = true;
  11129. }
  11130. }
  11131. while (pos < p.length) {
  11132. nextPartRe.lastIndex = pos;
  11133. var result = nextPartRe.exec(p);
  11134. previous = current;
  11135. current += result[0];
  11136. base = previous + result[1];
  11137. pos = nextPartRe.lastIndex;
  11138. if (knownHard[base] || cache && cache[base] === base) {
  11139. continue;
  11140. }
  11141. var resolvedLink;
  11142. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11143. resolvedLink = cache[base];
  11144. } else {
  11145. var stat = fs.lstatSync(base);
  11146. if (!stat.isSymbolicLink()) {
  11147. knownHard[base] = true;
  11148. if (cache)
  11149. cache[base] = base;
  11150. continue;
  11151. }
  11152. var linkTarget = null;
  11153. if (!isWindows) {
  11154. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11155. if (seenLinks.hasOwnProperty(id)) {
  11156. linkTarget = seenLinks[id];
  11157. }
  11158. }
  11159. if (linkTarget === null) {
  11160. fs.statSync(base);
  11161. linkTarget = fs.readlinkSync(base);
  11162. }
  11163. resolvedLink = pathModule.resolve(previous, linkTarget);
  11164. if (cache)
  11165. cache[base] = resolvedLink;
  11166. if (!isWindows)
  11167. seenLinks[id] = linkTarget;
  11168. }
  11169. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11170. start();
  11171. }
  11172. if (cache)
  11173. cache[original] = p;
  11174. return p;
  11175. };
  11176. exports2.realpath = function realpath(p, cache, cb) {
  11177. if (typeof cb !== "function") {
  11178. cb = maybeCallback(cache);
  11179. cache = null;
  11180. }
  11181. p = pathModule.resolve(p);
  11182. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11183. return process.nextTick(cb.bind(null, null, cache[p]));
  11184. }
  11185. var original = p, seenLinks = {}, knownHard = {};
  11186. var pos;
  11187. var current;
  11188. var base;
  11189. var previous;
  11190. start();
  11191. function start() {
  11192. var m = splitRootRe.exec(p);
  11193. pos = m[0].length;
  11194. current = m[0];
  11195. base = m[0];
  11196. previous = "";
  11197. if (isWindows && !knownHard[base]) {
  11198. fs.lstat(base, function(err) {
  11199. if (err)
  11200. return cb(err);
  11201. knownHard[base] = true;
  11202. LOOP();
  11203. });
  11204. } else {
  11205. process.nextTick(LOOP);
  11206. }
  11207. }
  11208. function LOOP() {
  11209. if (pos >= p.length) {
  11210. if (cache)
  11211. cache[original] = p;
  11212. return cb(null, p);
  11213. }
  11214. nextPartRe.lastIndex = pos;
  11215. var result = nextPartRe.exec(p);
  11216. previous = current;
  11217. current += result[0];
  11218. base = previous + result[1];
  11219. pos = nextPartRe.lastIndex;
  11220. if (knownHard[base] || cache && cache[base] === base) {
  11221. return process.nextTick(LOOP);
  11222. }
  11223. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11224. return gotResolvedLink(cache[base]);
  11225. }
  11226. return fs.lstat(base, gotStat);
  11227. }
  11228. function gotStat(err, stat) {
  11229. if (err)
  11230. return cb(err);
  11231. if (!stat.isSymbolicLink()) {
  11232. knownHard[base] = true;
  11233. if (cache)
  11234. cache[base] = base;
  11235. return process.nextTick(LOOP);
  11236. }
  11237. if (!isWindows) {
  11238. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11239. if (seenLinks.hasOwnProperty(id)) {
  11240. return gotTarget(null, seenLinks[id], base);
  11241. }
  11242. }
  11243. fs.stat(base, function(err2) {
  11244. if (err2)
  11245. return cb(err2);
  11246. fs.readlink(base, function(err3, target) {
  11247. if (!isWindows)
  11248. seenLinks[id] = target;
  11249. gotTarget(err3, target);
  11250. });
  11251. });
  11252. }
  11253. function gotTarget(err, target, base2) {
  11254. if (err)
  11255. return cb(err);
  11256. var resolvedLink = pathModule.resolve(previous, target);
  11257. if (cache)
  11258. cache[base2] = resolvedLink;
  11259. gotResolvedLink(resolvedLink);
  11260. }
  11261. function gotResolvedLink(resolvedLink) {
  11262. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11263. start();
  11264. }
  11265. };
  11266. }
  11267. });
  11268. var require_fs5 = __commonJS2({
  11269. "node_modules/fs.realpath/index.js"(exports2, module2) {
  11270. module2.exports = realpath;
  11271. realpath.realpath = realpath;
  11272. realpath.sync = realpathSync;
  11273. realpath.realpathSync = realpathSync;
  11274. realpath.monkeypatch = monkeypatch;
  11275. realpath.unmonkeypatch = unmonkeypatch;
  11276. var fs = require("fs");
  11277. var origRealpath = fs.realpath;
  11278. var origRealpathSync = fs.realpathSync;
  11279. var version = process.version;
  11280. var ok = /^v[0-5]\./.test(version);
  11281. var old = require_old();
  11282. function newError(er) {
  11283. return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
  11284. }
  11285. function realpath(p, cache, cb) {
  11286. if (ok) {
  11287. return origRealpath(p, cache, cb);
  11288. }
  11289. if (typeof cache === "function") {
  11290. cb = cache;
  11291. cache = null;
  11292. }
  11293. origRealpath(p, cache, function(er, result) {
  11294. if (newError(er)) {
  11295. old.realpath(p, cache, cb);
  11296. } else {
  11297. cb(er, result);
  11298. }
  11299. });
  11300. }
  11301. function realpathSync(p, cache) {
  11302. if (ok) {
  11303. return origRealpathSync(p, cache);
  11304. }
  11305. try {
  11306. return origRealpathSync(p, cache);
  11307. } catch (er) {
  11308. if (newError(er)) {
  11309. return old.realpathSync(p, cache);
  11310. } else {
  11311. throw er;
  11312. }
  11313. }
  11314. }
  11315. function monkeypatch() {
  11316. fs.realpath = realpath;
  11317. fs.realpathSync = realpathSync;
  11318. }
  11319. function unmonkeypatch() {
  11320. fs.realpath = origRealpath;
  11321. fs.realpathSync = origRealpathSync;
  11322. }
  11323. }
  11324. });
  11325. var require_concat_map = __commonJS2({
  11326. "node_modules/concat-map/index.js"(exports2, module2) {
  11327. module2.exports = function(xs, fn) {
  11328. var res = [];
  11329. for (var i = 0; i < xs.length; i++) {
  11330. var x = fn(xs[i], i);
  11331. if (isArray(x))
  11332. res.push.apply(res, x);
  11333. else
  11334. res.push(x);
  11335. }
  11336. return res;
  11337. };
  11338. var isArray = Array.isArray || function(xs) {
  11339. return Object.prototype.toString.call(xs) === "[object Array]";
  11340. };
  11341. }
  11342. });
  11343. var require_balanced_match = __commonJS2({
  11344. "node_modules/balanced-match/index.js"(exports2, module2) {
  11345. "use strict";
  11346. module2.exports = balanced;
  11347. function balanced(a, b, str) {
  11348. if (a instanceof RegExp)
  11349. a = maybeMatch(a, str);
  11350. if (b instanceof RegExp)
  11351. b = maybeMatch(b, str);
  11352. var r = range(a, b, str);
  11353. return r && {
  11354. start: r[0],
  11355. end: r[1],
  11356. pre: str.slice(0, r[0]),
  11357. body: str.slice(r[0] + a.length, r[1]),
  11358. post: str.slice(r[1] + b.length)
  11359. };
  11360. }
  11361. function maybeMatch(reg, str) {
  11362. var m = str.match(reg);
  11363. return m ? m[0] : null;
  11364. }
  11365. balanced.range = range;
  11366. function range(a, b, str) {
  11367. var begs, beg, left, right, result;
  11368. var ai = str.indexOf(a);
  11369. var bi = str.indexOf(b, ai + 1);
  11370. var i = ai;
  11371. if (ai >= 0 && bi > 0) {
  11372. if (a === b) {
  11373. return [ai, bi];
  11374. }
  11375. begs = [];
  11376. left = str.length;
  11377. while (i >= 0 && !result) {
  11378. if (i == ai) {
  11379. begs.push(i);
  11380. ai = str.indexOf(a, i + 1);
  11381. } else if (begs.length == 1) {
  11382. result = [begs.pop(), bi];
  11383. } else {
  11384. beg = begs.pop();
  11385. if (beg < left) {
  11386. left = beg;
  11387. right = bi;
  11388. }
  11389. bi = str.indexOf(b, i + 1);
  11390. }
  11391. i = ai < bi && ai >= 0 ? ai : bi;
  11392. }
  11393. if (begs.length) {
  11394. result = [left, right];
  11395. }
  11396. }
  11397. return result;
  11398. }
  11399. }
  11400. });
  11401. var require_brace_expansion = __commonJS2({
  11402. "node_modules/brace-expansion/index.js"(exports2, module2) {
  11403. var concatMap = require_concat_map();
  11404. var balanced = require_balanced_match();
  11405. module2.exports = expandTop;
  11406. var escSlash = "\0SLASH" + Math.random() + "\0";
  11407. var escOpen = "\0OPEN" + Math.random() + "\0";
  11408. var escClose = "\0CLOSE" + Math.random() + "\0";
  11409. var escComma = "\0COMMA" + Math.random() + "\0";
  11410. var escPeriod = "\0PERIOD" + Math.random() + "\0";
  11411. function numeric(str) {
  11412. return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
  11413. }
  11414. function escapeBraces(str) {
  11415. return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
  11416. }
  11417. function unescapeBraces(str) {
  11418. return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
  11419. }
  11420. function parseCommaParts(str) {
  11421. if (!str)
  11422. return [""];
  11423. var parts = [];
  11424. var m = balanced("{", "}", str);
  11425. if (!m)
  11426. return str.split(",");
  11427. var pre = m.pre;
  11428. var body = m.body;
  11429. var post = m.post;
  11430. var p = pre.split(",");
  11431. p[p.length - 1] += "{" + body + "}";
  11432. var postParts = parseCommaParts(post);
  11433. if (post.length) {
  11434. p[p.length - 1] += postParts.shift();
  11435. p.push.apply(p, postParts);
  11436. }
  11437. parts.push.apply(parts, p);
  11438. return parts;
  11439. }
  11440. function expandTop(str) {
  11441. if (!str)
  11442. return [];
  11443. if (str.substr(0, 2) === "{}") {
  11444. str = "\\{\\}" + str.substr(2);
  11445. }
  11446. return expand(escapeBraces(str), true).map(unescapeBraces);
  11447. }
  11448. function embrace(str) {
  11449. return "{" + str + "}";
  11450. }
  11451. function isPadded(el) {
  11452. return /^-?0\d/.test(el);
  11453. }
  11454. function lte(i, y) {
  11455. return i <= y;
  11456. }
  11457. function gte(i, y) {
  11458. return i >= y;
  11459. }
  11460. function expand(str, isTop) {
  11461. var expansions = [];
  11462. var m = balanced("{", "}", str);
  11463. if (!m || /\$$/.test(m.pre))
  11464. return [str];
  11465. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  11466. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  11467. var isSequence = isNumericSequence || isAlphaSequence;
  11468. var isOptions = m.body.indexOf(",") >= 0;
  11469. if (!isSequence && !isOptions) {
  11470. if (m.post.match(/,.*\}/)) {
  11471. str = m.pre + "{" + m.body + escClose + m.post;
  11472. return expand(str);
  11473. }
  11474. return [str];
  11475. }
  11476. var n;
  11477. if (isSequence) {
  11478. n = m.body.split(/\.\./);
  11479. } else {
  11480. n = parseCommaParts(m.body);
  11481. if (n.length === 1) {
  11482. n = expand(n[0], false).map(embrace);
  11483. if (n.length === 1) {
  11484. var post = m.post.length ? expand(m.post, false) : [""];
  11485. return post.map(function(p) {
  11486. return m.pre + n[0] + p;
  11487. });
  11488. }
  11489. }
  11490. }
  11491. var pre = m.pre;
  11492. var post = m.post.length ? expand(m.post, false) : [""];
  11493. var N;
  11494. if (isSequence) {
  11495. var x = numeric(n[0]);
  11496. var y = numeric(n[1]);
  11497. var width = Math.max(n[0].length, n[1].length);
  11498. var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
  11499. var test = lte;
  11500. var reverse = y < x;
  11501. if (reverse) {
  11502. incr *= -1;
  11503. test = gte;
  11504. }
  11505. var pad = n.some(isPadded);
  11506. N = [];
  11507. for (var i = x; test(i, y); i += incr) {
  11508. var c;
  11509. if (isAlphaSequence) {
  11510. c = String.fromCharCode(i);
  11511. if (c === "\\")
  11512. c = "";
  11513. } else {
  11514. c = String(i);
  11515. if (pad) {
  11516. var need = width - c.length;
  11517. if (need > 0) {
  11518. var z = new Array(need + 1).join("0");
  11519. if (i < 0)
  11520. c = "-" + z + c.slice(1);
  11521. else
  11522. c = z + c;
  11523. }
  11524. }
  11525. }
  11526. N.push(c);
  11527. }
  11528. } else {
  11529. N = concatMap(n, function(el) {
  11530. return expand(el, false);
  11531. });
  11532. }
  11533. for (var j = 0; j < N.length; j++) {
  11534. for (var k = 0; k < post.length; k++) {
  11535. var expansion = pre + N[j] + post[k];
  11536. if (!isTop || isSequence || expansion)
  11537. expansions.push(expansion);
  11538. }
  11539. }
  11540. return expansions;
  11541. }
  11542. }
  11543. });
  11544. var require_minimatch = __commonJS2({
  11545. "node_modules/minimatch/minimatch.js"(exports2, module2) {
  11546. module2.exports = minimatch;
  11547. minimatch.Minimatch = Minimatch;
  11548. var path = function() {
  11549. try {
  11550. return require("path");
  11551. } catch (e) {
  11552. }
  11553. }() || {
  11554. sep: "/"
  11555. };
  11556. minimatch.sep = path.sep;
  11557. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
  11558. var expand = require_brace_expansion();
  11559. var plTypes = {
  11560. "!": {
  11561. open: "(?:(?!(?:",
  11562. close: "))[^/]*?)"
  11563. },
  11564. "?": {
  11565. open: "(?:",
  11566. close: ")?"
  11567. },
  11568. "+": {
  11569. open: "(?:",
  11570. close: ")+"
  11571. },
  11572. "*": {
  11573. open: "(?:",
  11574. close: ")*"
  11575. },
  11576. "@": {
  11577. open: "(?:",
  11578. close: ")"
  11579. }
  11580. };
  11581. var qmark = "[^/]";
  11582. var star = qmark + "*?";
  11583. var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
  11584. var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
  11585. var reSpecials = charSet("().*{}+?[]^$\\!");
  11586. function charSet(s) {
  11587. return s.split("").reduce(function(set, c) {
  11588. set[c] = true;
  11589. return set;
  11590. }, {});
  11591. }
  11592. var slashSplit = /\/+/;
  11593. minimatch.filter = filter;
  11594. function filter(pattern, options) {
  11595. options = options || {};
  11596. return function(p, i, list) {
  11597. return minimatch(p, pattern, options);
  11598. };
  11599. }
  11600. function ext(a, b) {
  11601. b = b || {};
  11602. var t = {};
  11603. Object.keys(a).forEach(function(k) {
  11604. t[k] = a[k];
  11605. });
  11606. Object.keys(b).forEach(function(k) {
  11607. t[k] = b[k];
  11608. });
  11609. return t;
  11610. }
  11611. minimatch.defaults = function(def) {
  11612. if (!def || typeof def !== "object" || !Object.keys(def).length) {
  11613. return minimatch;
  11614. }
  11615. var orig = minimatch;
  11616. var m = function minimatch2(p, pattern, options) {
  11617. return orig(p, pattern, ext(def, options));
  11618. };
  11619. m.Minimatch = function Minimatch2(pattern, options) {
  11620. return new orig.Minimatch(pattern, ext(def, options));
  11621. };
  11622. m.Minimatch.defaults = function defaults(options) {
  11623. return orig.defaults(ext(def, options)).Minimatch;
  11624. };
  11625. m.filter = function filter2(pattern, options) {
  11626. return orig.filter(pattern, ext(def, options));
  11627. };
  11628. m.defaults = function defaults(options) {
  11629. return orig.defaults(ext(def, options));
  11630. };
  11631. m.makeRe = function makeRe2(pattern, options) {
  11632. return orig.makeRe(pattern, ext(def, options));
  11633. };
  11634. m.braceExpand = function braceExpand2(pattern, options) {
  11635. return orig.braceExpand(pattern, ext(def, options));
  11636. };
  11637. m.match = function(list, pattern, options) {
  11638. return orig.match(list, pattern, ext(def, options));
  11639. };
  11640. return m;
  11641. };
  11642. Minimatch.defaults = function(def) {
  11643. return minimatch.defaults(def).Minimatch;
  11644. };
  11645. function minimatch(p, pattern, options) {
  11646. assertValidPattern(pattern);
  11647. if (!options)
  11648. options = {};
  11649. if (!options.nocomment && pattern.charAt(0) === "#") {
  11650. return false;
  11651. }
  11652. return new Minimatch(pattern, options).match(p);
  11653. }
  11654. function Minimatch(pattern, options) {
  11655. if (!(this instanceof Minimatch)) {
  11656. return new Minimatch(pattern, options);
  11657. }
  11658. assertValidPattern(pattern);
  11659. if (!options)
  11660. options = {};
  11661. pattern = pattern.trim();
  11662. if (!options.allowWindowsEscape && path.sep !== "/") {
  11663. pattern = pattern.split(path.sep).join("/");
  11664. }
  11665. this.options = options;
  11666. this.set = [];
  11667. this.pattern = pattern;
  11668. this.regexp = null;
  11669. this.negate = false;
  11670. this.comment = false;
  11671. this.empty = false;
  11672. this.partial = !!options.partial;
  11673. this.make();
  11674. }
  11675. Minimatch.prototype.debug = function() {
  11676. };
  11677. Minimatch.prototype.make = make;
  11678. function make() {
  11679. var pattern = this.pattern;
  11680. var options = this.options;
  11681. if (!options.nocomment && pattern.charAt(0) === "#") {
  11682. this.comment = true;
  11683. return;
  11684. }
  11685. if (!pattern) {
  11686. this.empty = true;
  11687. return;
  11688. }
  11689. this.parseNegate();
  11690. var set = this.globSet = this.braceExpand();
  11691. if (options.debug)
  11692. this.debug = function debug() {
  11693. console.error.apply(console, arguments);
  11694. };
  11695. this.debug(this.pattern, set);
  11696. set = this.globParts = set.map(function(s) {
  11697. return s.split(slashSplit);
  11698. });
  11699. this.debug(this.pattern, set);
  11700. set = set.map(function(s, si, set2) {
  11701. return s.map(this.parse, this);
  11702. }, this);
  11703. this.debug(this.pattern, set);
  11704. set = set.filter(function(s) {
  11705. return s.indexOf(false) === -1;
  11706. });
  11707. this.debug(this.pattern, set);
  11708. this.set = set;
  11709. }
  11710. Minimatch.prototype.parseNegate = parseNegate;
  11711. function parseNegate() {
  11712. var pattern = this.pattern;
  11713. var negate = false;
  11714. var options = this.options;
  11715. var negateOffset = 0;
  11716. if (options.nonegate)
  11717. return;
  11718. for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
  11719. negate = !negate;
  11720. negateOffset++;
  11721. }
  11722. if (negateOffset)
  11723. this.pattern = pattern.substr(negateOffset);
  11724. this.negate = negate;
  11725. }
  11726. minimatch.braceExpand = function(pattern, options) {
  11727. return braceExpand(pattern, options);
  11728. };
  11729. Minimatch.prototype.braceExpand = braceExpand;
  11730. function braceExpand(pattern, options) {
  11731. if (!options) {
  11732. if (this instanceof Minimatch) {
  11733. options = this.options;
  11734. } else {
  11735. options = {};
  11736. }
  11737. }
  11738. pattern = typeof pattern === "undefined" ? this.pattern : pattern;
  11739. assertValidPattern(pattern);
  11740. if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
  11741. return [pattern];
  11742. }
  11743. return expand(pattern);
  11744. }
  11745. var MAX_PATTERN_LENGTH = 1024 * 64;
  11746. var assertValidPattern = function(pattern) {
  11747. if (typeof pattern !== "string") {
  11748. throw new TypeError("invalid pattern");
  11749. }
  11750. if (pattern.length > MAX_PATTERN_LENGTH) {
  11751. throw new TypeError("pattern is too long");
  11752. }
  11753. };
  11754. Minimatch.prototype.parse = parse;
  11755. var SUBPARSE = {};
  11756. function parse(pattern, isSub) {
  11757. assertValidPattern(pattern);
  11758. var options = this.options;
  11759. if (pattern === "**") {
  11760. if (!options.noglobstar)
  11761. return GLOBSTAR;
  11762. else
  11763. pattern = "*";
  11764. }
  11765. if (pattern === "")
  11766. return "";
  11767. var re = "";
  11768. var hasMagic = !!options.nocase;
  11769. var escaping = false;
  11770. var patternListStack = [];
  11771. var negativeLists = [];
  11772. var stateChar;
  11773. var inClass = false;
  11774. var reClassStart = -1;
  11775. var classStart = -1;
  11776. var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
  11777. var self2 = this;
  11778. function clearStateChar() {
  11779. if (stateChar) {
  11780. switch (stateChar) {
  11781. case "*":
  11782. re += star;
  11783. hasMagic = true;
  11784. break;
  11785. case "?":
  11786. re += qmark;
  11787. hasMagic = true;
  11788. break;
  11789. default:
  11790. re += "\\" + stateChar;
  11791. break;
  11792. }
  11793. self2.debug("clearStateChar %j %j", stateChar, re);
  11794. stateChar = false;
  11795. }
  11796. }
  11797. for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
  11798. this.debug("%s %s %s %j", pattern, i, re, c);
  11799. if (escaping && reSpecials[c]) {
  11800. re += "\\" + c;
  11801. escaping = false;
  11802. continue;
  11803. }
  11804. switch (c) {
  11805. case "/": {
  11806. return false;
  11807. }
  11808. case "\\":
  11809. clearStateChar();
  11810. escaping = true;
  11811. continue;
  11812. case "?":
  11813. case "*":
  11814. case "+":
  11815. case "@":
  11816. case "!":
  11817. this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
  11818. if (inClass) {
  11819. this.debug(" in class");
  11820. if (c === "!" && i === classStart + 1)
  11821. c = "^";
  11822. re += c;
  11823. continue;
  11824. }
  11825. self2.debug("call clearStateChar %j", stateChar);
  11826. clearStateChar();
  11827. stateChar = c;
  11828. if (options.noext)
  11829. clearStateChar();
  11830. continue;
  11831. case "(":
  11832. if (inClass) {
  11833. re += "(";
  11834. continue;
  11835. }
  11836. if (!stateChar) {
  11837. re += "\\(";
  11838. continue;
  11839. }
  11840. patternListStack.push({
  11841. type: stateChar,
  11842. start: i - 1,
  11843. reStart: re.length,
  11844. open: plTypes[stateChar].open,
  11845. close: plTypes[stateChar].close
  11846. });
  11847. re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
  11848. this.debug("plType %j %j", stateChar, re);
  11849. stateChar = false;
  11850. continue;
  11851. case ")":
  11852. if (inClass || !patternListStack.length) {
  11853. re += "\\)";
  11854. continue;
  11855. }
  11856. clearStateChar();
  11857. hasMagic = true;
  11858. var pl = patternListStack.pop();
  11859. re += pl.close;
  11860. if (pl.type === "!") {
  11861. negativeLists.push(pl);
  11862. }
  11863. pl.reEnd = re.length;
  11864. continue;
  11865. case "|":
  11866. if (inClass || !patternListStack.length || escaping) {
  11867. re += "\\|";
  11868. escaping = false;
  11869. continue;
  11870. }
  11871. clearStateChar();
  11872. re += "|";
  11873. continue;
  11874. case "[":
  11875. clearStateChar();
  11876. if (inClass) {
  11877. re += "\\" + c;
  11878. continue;
  11879. }
  11880. inClass = true;
  11881. classStart = i;
  11882. reClassStart = re.length;
  11883. re += c;
  11884. continue;
  11885. case "]":
  11886. if (i === classStart + 1 || !inClass) {
  11887. re += "\\" + c;
  11888. escaping = false;
  11889. continue;
  11890. }
  11891. var cs = pattern.substring(classStart + 1, i);
  11892. try {
  11893. RegExp("[" + cs + "]");
  11894. } catch (er) {
  11895. var sp = this.parse(cs, SUBPARSE);
  11896. re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
  11897. hasMagic = hasMagic || sp[1];
  11898. inClass = false;
  11899. continue;
  11900. }
  11901. hasMagic = true;
  11902. inClass = false;
  11903. re += c;
  11904. continue;
  11905. default:
  11906. clearStateChar();
  11907. if (escaping) {
  11908. escaping = false;
  11909. } else if (reSpecials[c] && !(c === "^" && inClass)) {
  11910. re += "\\";
  11911. }
  11912. re += c;
  11913. }
  11914. }
  11915. if (inClass) {
  11916. cs = pattern.substr(classStart + 1);
  11917. sp = this.parse(cs, SUBPARSE);
  11918. re = re.substr(0, reClassStart) + "\\[" + sp[0];
  11919. hasMagic = hasMagic || sp[1];
  11920. }
  11921. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  11922. var tail = re.slice(pl.reStart + pl.open.length);
  11923. this.debug("setting tail", re, pl);
  11924. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
  11925. if (!$2) {
  11926. $2 = "\\";
  11927. }
  11928. return $1 + $1 + $2 + "|";
  11929. });
  11930. this.debug("tail=%j\n %s", tail, tail, pl, re);
  11931. var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
  11932. hasMagic = true;
  11933. re = re.slice(0, pl.reStart) + t + "\\(" + tail;
  11934. }
  11935. clearStateChar();
  11936. if (escaping) {
  11937. re += "\\\\";
  11938. }
  11939. var addPatternStart = false;
  11940. switch (re.charAt(0)) {
  11941. case "[":
  11942. case ".":
  11943. case "(":
  11944. addPatternStart = true;
  11945. }
  11946. for (var n = negativeLists.length - 1; n > -1; n--) {
  11947. var nl = negativeLists[n];
  11948. var nlBefore = re.slice(0, nl.reStart);
  11949. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  11950. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  11951. var nlAfter = re.slice(nl.reEnd);
  11952. nlLast += nlAfter;
  11953. var openParensBefore = nlBefore.split("(").length - 1;
  11954. var cleanAfter = nlAfter;
  11955. for (i = 0; i < openParensBefore; i++) {
  11956. cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
  11957. }
  11958. nlAfter = cleanAfter;
  11959. var dollar = "";
  11960. if (nlAfter === "" && isSub !== SUBPARSE) {
  11961. dollar = "$";
  11962. }
  11963. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  11964. re = newRe;
  11965. }
  11966. if (re !== "" && hasMagic) {
  11967. re = "(?=.)" + re;
  11968. }
  11969. if (addPatternStart) {
  11970. re = patternStart + re;
  11971. }
  11972. if (isSub === SUBPARSE) {
  11973. return [re, hasMagic];
  11974. }
  11975. if (!hasMagic) {
  11976. return globUnescape(pattern);
  11977. }
  11978. var flags = options.nocase ? "i" : "";
  11979. try {
  11980. var regExp = new RegExp("^" + re + "$", flags);
  11981. } catch (er) {
  11982. return new RegExp("$.");
  11983. }
  11984. regExp._glob = pattern;
  11985. regExp._src = re;
  11986. return regExp;
  11987. }
  11988. minimatch.makeRe = function(pattern, options) {
  11989. return new Minimatch(pattern, options || {}).makeRe();
  11990. };
  11991. Minimatch.prototype.makeRe = makeRe;
  11992. function makeRe() {
  11993. if (this.regexp || this.regexp === false)
  11994. return this.regexp;
  11995. var set = this.set;
  11996. if (!set.length) {
  11997. this.regexp = false;
  11998. return this.regexp;
  11999. }
  12000. var options = this.options;
  12001. var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
  12002. var flags = options.nocase ? "i" : "";
  12003. var re = set.map(function(pattern) {
  12004. return pattern.map(function(p) {
  12005. return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
  12006. }).join("\\/");
  12007. }).join("|");
  12008. re = "^(?:" + re + ")$";
  12009. if (this.negate)
  12010. re = "^(?!" + re + ").*$";
  12011. try {
  12012. this.regexp = new RegExp(re, flags);
  12013. } catch (ex) {
  12014. this.regexp = false;
  12015. }
  12016. return this.regexp;
  12017. }
  12018. minimatch.match = function(list, pattern, options) {
  12019. options = options || {};
  12020. var mm = new Minimatch(pattern, options);
  12021. list = list.filter(function(f) {
  12022. return mm.match(f);
  12023. });
  12024. if (mm.options.nonull && !list.length) {
  12025. list.push(pattern);
  12026. }
  12027. return list;
  12028. };
  12029. Minimatch.prototype.match = function match(f, partial) {
  12030. if (typeof partial === "undefined")
  12031. partial = this.partial;
  12032. this.debug("match", f, this.pattern);
  12033. if (this.comment)
  12034. return false;
  12035. if (this.empty)
  12036. return f === "";
  12037. if (f === "/" && partial)
  12038. return true;
  12039. var options = this.options;
  12040. if (path.sep !== "/") {
  12041. f = f.split(path.sep).join("/");
  12042. }
  12043. f = f.split(slashSplit);
  12044. this.debug(this.pattern, "split", f);
  12045. var set = this.set;
  12046. this.debug(this.pattern, "set", set);
  12047. var filename;
  12048. var i;
  12049. for (i = f.length - 1; i >= 0; i--) {
  12050. filename = f[i];
  12051. if (filename)
  12052. break;
  12053. }
  12054. for (i = 0; i < set.length; i++) {
  12055. var pattern = set[i];
  12056. var file = f;
  12057. if (options.matchBase && pattern.length === 1) {
  12058. file = [filename];
  12059. }
  12060. var hit = this.matchOne(file, pattern, partial);
  12061. if (hit) {
  12062. if (options.flipNegate)
  12063. return true;
  12064. return !this.negate;
  12065. }
  12066. }
  12067. if (options.flipNegate)
  12068. return false;
  12069. return this.negate;
  12070. };
  12071. Minimatch.prototype.matchOne = function(file, pattern, partial) {
  12072. var options = this.options;
  12073. this.debug("matchOne", {
  12074. "this": this,
  12075. file,
  12076. pattern
  12077. });
  12078. this.debug("matchOne", file.length, pattern.length);
  12079. for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
  12080. this.debug("matchOne loop");
  12081. var p = pattern[pi];
  12082. var f = file[fi];
  12083. this.debug(pattern, p, f);
  12084. if (p === false)
  12085. return false;
  12086. if (p === GLOBSTAR) {
  12087. this.debug("GLOBSTAR", [pattern, p, f]);
  12088. var fr = fi;
  12089. var pr = pi + 1;
  12090. if (pr === pl) {
  12091. this.debug("** at the end");
  12092. for (; fi < fl; fi++) {
  12093. if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
  12094. return false;
  12095. }
  12096. return true;
  12097. }
  12098. while (fr < fl) {
  12099. var swallowee = file[fr];
  12100. this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
  12101. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  12102. this.debug("globstar found match!", fr, fl, swallowee);
  12103. return true;
  12104. } else {
  12105. if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
  12106. this.debug("dot detected!", file, fr, pattern, pr);
  12107. break;
  12108. }
  12109. this.debug("globstar swallow a segment, and continue");
  12110. fr++;
  12111. }
  12112. }
  12113. if (partial) {
  12114. this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
  12115. if (fr === fl)
  12116. return true;
  12117. }
  12118. return false;
  12119. }
  12120. var hit;
  12121. if (typeof p === "string") {
  12122. hit = f === p;
  12123. this.debug("string match", p, f, hit);
  12124. } else {
  12125. hit = f.match(p);
  12126. this.debug("pattern match", p, f, hit);
  12127. }
  12128. if (!hit)
  12129. return false;
  12130. }
  12131. if (fi === fl && pi === pl) {
  12132. return true;
  12133. } else if (fi === fl) {
  12134. return partial;
  12135. } else if (pi === pl) {
  12136. return fi === fl - 1 && file[fi] === "";
  12137. }
  12138. throw new Error("wtf?");
  12139. };
  12140. function globUnescape(s) {
  12141. return s.replace(/\\(.)/g, "$1");
  12142. }
  12143. function regExpEscape(s) {
  12144. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  12145. }
  12146. }
  12147. });
  12148. var require_inherits_browser = __commonJS2({
  12149. "node_modules/inherits/inherits_browser.js"(exports2, module2) {
  12150. if (typeof Object.create === "function") {
  12151. module2.exports = function inherits(ctor, superCtor) {
  12152. if (superCtor) {
  12153. ctor.super_ = superCtor;
  12154. ctor.prototype = Object.create(superCtor.prototype, {
  12155. constructor: {
  12156. value: ctor,
  12157. enumerable: false,
  12158. writable: true,
  12159. configurable: true
  12160. }
  12161. });
  12162. }
  12163. };
  12164. } else {
  12165. module2.exports = function inherits(ctor, superCtor) {
  12166. if (superCtor) {
  12167. ctor.super_ = superCtor;
  12168. var TempCtor = function() {
  12169. };
  12170. TempCtor.prototype = superCtor.prototype;
  12171. ctor.prototype = new TempCtor();
  12172. ctor.prototype.constructor = ctor;
  12173. }
  12174. };
  12175. }
  12176. }
  12177. });
  12178. var require_inherits = __commonJS2({
  12179. "node_modules/inherits/inherits.js"(exports2, module2) {
  12180. try {
  12181. util = require("util");
  12182. if (typeof util.inherits !== "function")
  12183. throw "";
  12184. module2.exports = util.inherits;
  12185. } catch (e) {
  12186. module2.exports = require_inherits_browser();
  12187. }
  12188. var util;
  12189. }
  12190. });
  12191. var require_path_is_absolute = __commonJS2({
  12192. "node_modules/path-is-absolute/index.js"(exports2, module2) {
  12193. "use strict";
  12194. function posix(path) {
  12195. return path.charAt(0) === "/";
  12196. }
  12197. function win32(path) {
  12198. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  12199. var result = splitDeviceRe.exec(path);
  12200. var device = result[1] || "";
  12201. var isUnc = Boolean(device && device.charAt(1) !== ":");
  12202. return Boolean(result[2] || isUnc);
  12203. }
  12204. module2.exports = process.platform === "win32" ? win32 : posix;
  12205. module2.exports.posix = posix;
  12206. module2.exports.win32 = win32;
  12207. }
  12208. });
  12209. var require_common3 = __commonJS2({
  12210. "node_modules/glob/common.js"(exports2) {
  12211. exports2.setopts = setopts;
  12212. exports2.ownProp = ownProp;
  12213. exports2.makeAbs = makeAbs;
  12214. exports2.finish = finish;
  12215. exports2.mark = mark;
  12216. exports2.isIgnored = isIgnored;
  12217. exports2.childrenIgnored = childrenIgnored;
  12218. function ownProp(obj, field) {
  12219. return Object.prototype.hasOwnProperty.call(obj, field);
  12220. }
  12221. var fs = require("fs");
  12222. var path = require("path");
  12223. var minimatch = require_minimatch();
  12224. var isAbsolute = require_path_is_absolute();
  12225. var Minimatch = minimatch.Minimatch;
  12226. function alphasort(a, b) {
  12227. return a.localeCompare(b, "en");
  12228. }
  12229. function setupIgnores(self2, options) {
  12230. self2.ignore = options.ignore || [];
  12231. if (!Array.isArray(self2.ignore))
  12232. self2.ignore = [self2.ignore];
  12233. if (self2.ignore.length) {
  12234. self2.ignore = self2.ignore.map(ignoreMap);
  12235. }
  12236. }
  12237. function ignoreMap(pattern) {
  12238. var gmatcher = null;
  12239. if (pattern.slice(-3) === "/**") {
  12240. var gpattern = pattern.replace(/(\/\*\*)+$/, "");
  12241. gmatcher = new Minimatch(gpattern, {
  12242. dot: true
  12243. });
  12244. }
  12245. return {
  12246. matcher: new Minimatch(pattern, {
  12247. dot: true
  12248. }),
  12249. gmatcher
  12250. };
  12251. }
  12252. function setopts(self2, pattern, options) {
  12253. if (!options)
  12254. options = {};
  12255. if (options.matchBase && pattern.indexOf("/") === -1) {
  12256. if (options.noglobstar) {
  12257. throw new Error("base matching requires globstar");
  12258. }
  12259. pattern = "**/" + pattern;
  12260. }
  12261. self2.silent = !!options.silent;
  12262. self2.pattern = pattern;
  12263. self2.strict = options.strict !== false;
  12264. self2.realpath = !!options.realpath;
  12265. self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
  12266. self2.follow = !!options.follow;
  12267. self2.dot = !!options.dot;
  12268. self2.mark = !!options.mark;
  12269. self2.nodir = !!options.nodir;
  12270. if (self2.nodir)
  12271. self2.mark = true;
  12272. self2.sync = !!options.sync;
  12273. self2.nounique = !!options.nounique;
  12274. self2.nonull = !!options.nonull;
  12275. self2.nosort = !!options.nosort;
  12276. self2.nocase = !!options.nocase;
  12277. self2.stat = !!options.stat;
  12278. self2.noprocess = !!options.noprocess;
  12279. self2.absolute = !!options.absolute;
  12280. self2.fs = options.fs || fs;
  12281. self2.maxLength = options.maxLength || Infinity;
  12282. self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
  12283. self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
  12284. self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
  12285. setupIgnores(self2, options);
  12286. self2.changedCwd = false;
  12287. var cwd = process.cwd();
  12288. if (!ownProp(options, "cwd"))
  12289. self2.cwd = cwd;
  12290. else {
  12291. self2.cwd = path.resolve(options.cwd);
  12292. self2.changedCwd = self2.cwd !== cwd;
  12293. }
  12294. self2.root = options.root || path.resolve(self2.cwd, "/");
  12295. self2.root = path.resolve(self2.root);
  12296. if (process.platform === "win32")
  12297. self2.root = self2.root.replace(/\\/g, "/");
  12298. self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
  12299. if (process.platform === "win32")
  12300. self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
  12301. self2.nomount = !!options.nomount;
  12302. options.nonegate = true;
  12303. options.nocomment = true;
  12304. self2.minimatch = new Minimatch(pattern, options);
  12305. self2.options = self2.minimatch.options;
  12306. }
  12307. function finish(self2) {
  12308. var nou = self2.nounique;
  12309. var all = nou ? [] : /* @__PURE__ */ Object.create(null);
  12310. for (var i = 0, l = self2.matches.length; i < l; i++) {
  12311. var matches = self2.matches[i];
  12312. if (!matches || Object.keys(matches).length === 0) {
  12313. if (self2.nonull) {
  12314. var literal = self2.minimatch.globSet[i];
  12315. if (nou)
  12316. all.push(literal);
  12317. else
  12318. all[literal] = true;
  12319. }
  12320. } else {
  12321. var m = Object.keys(matches);
  12322. if (nou)
  12323. all.push.apply(all, m);
  12324. else
  12325. m.forEach(function(m2) {
  12326. all[m2] = true;
  12327. });
  12328. }
  12329. }
  12330. if (!nou)
  12331. all = Object.keys(all);
  12332. if (!self2.nosort)
  12333. all = all.sort(alphasort);
  12334. if (self2.mark) {
  12335. for (var i = 0; i < all.length; i++) {
  12336. all[i] = self2._mark(all[i]);
  12337. }
  12338. if (self2.nodir) {
  12339. all = all.filter(function(e) {
  12340. var notDir = !/\/$/.test(e);
  12341. var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
  12342. if (notDir && c)
  12343. notDir = c !== "DIR" && !Array.isArray(c);
  12344. return notDir;
  12345. });
  12346. }
  12347. }
  12348. if (self2.ignore.length)
  12349. all = all.filter(function(m2) {
  12350. return !isIgnored(self2, m2);
  12351. });
  12352. self2.found = all;
  12353. }
  12354. function mark(self2, p) {
  12355. var abs = makeAbs(self2, p);
  12356. var c = self2.cache[abs];
  12357. var m = p;
  12358. if (c) {
  12359. var isDir = c === "DIR" || Array.isArray(c);
  12360. var slash = p.slice(-1) === "/";
  12361. if (isDir && !slash)
  12362. m += "/";
  12363. else if (!isDir && slash)
  12364. m = m.slice(0, -1);
  12365. if (m !== p) {
  12366. var mabs = makeAbs(self2, m);
  12367. self2.statCache[mabs] = self2.statCache[abs];
  12368. self2.cache[mabs] = self2.cache[abs];
  12369. }
  12370. }
  12371. return m;
  12372. }
  12373. function makeAbs(self2, f) {
  12374. var abs = f;
  12375. if (f.charAt(0) === "/") {
  12376. abs = path.join(self2.root, f);
  12377. } else if (isAbsolute(f) || f === "") {
  12378. abs = f;
  12379. } else if (self2.changedCwd) {
  12380. abs = path.resolve(self2.cwd, f);
  12381. } else {
  12382. abs = path.resolve(f);
  12383. }
  12384. if (process.platform === "win32")
  12385. abs = abs.replace(/\\/g, "/");
  12386. return abs;
  12387. }
  12388. function isIgnored(self2, path2) {
  12389. if (!self2.ignore.length)
  12390. return false;
  12391. return self2.ignore.some(function(item) {
  12392. return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
  12393. });
  12394. }
  12395. function childrenIgnored(self2, path2) {
  12396. if (!self2.ignore.length)
  12397. return false;
  12398. return self2.ignore.some(function(item) {
  12399. return !!(item.gmatcher && item.gmatcher.match(path2));
  12400. });
  12401. }
  12402. }
  12403. });
  12404. var require_sync7 = __commonJS2({
  12405. "node_modules/glob/sync.js"(exports2, module2) {
  12406. module2.exports = globSync;
  12407. globSync.GlobSync = GlobSync;
  12408. var rp = require_fs5();
  12409. var minimatch = require_minimatch();
  12410. var Minimatch = minimatch.Minimatch;
  12411. var Glob = require_glob().Glob;
  12412. var util = require("util");
  12413. var path = require("path");
  12414. var assert = require("assert");
  12415. var isAbsolute = require_path_is_absolute();
  12416. var common = require_common3();
  12417. var setopts = common.setopts;
  12418. var ownProp = common.ownProp;
  12419. var childrenIgnored = common.childrenIgnored;
  12420. var isIgnored = common.isIgnored;
  12421. function globSync(pattern, options) {
  12422. if (typeof options === "function" || arguments.length === 3)
  12423. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12424. return new GlobSync(pattern, options).found;
  12425. }
  12426. function GlobSync(pattern, options) {
  12427. if (!pattern)
  12428. throw new Error("must provide pattern");
  12429. if (typeof options === "function" || arguments.length === 3)
  12430. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12431. if (!(this instanceof GlobSync))
  12432. return new GlobSync(pattern, options);
  12433. setopts(this, pattern, options);
  12434. if (this.noprocess)
  12435. return this;
  12436. var n = this.minimatch.set.length;
  12437. this.matches = new Array(n);
  12438. for (var i = 0; i < n; i++) {
  12439. this._process(this.minimatch.set[i], i, false);
  12440. }
  12441. this._finish();
  12442. }
  12443. GlobSync.prototype._finish = function() {
  12444. assert(this instanceof GlobSync);
  12445. if (this.realpath) {
  12446. var self2 = this;
  12447. this.matches.forEach(function(matchset, index) {
  12448. var set = self2.matches[index] = /* @__PURE__ */ Object.create(null);
  12449. for (var p in matchset) {
  12450. try {
  12451. p = self2._makeAbs(p);
  12452. var real = rp.realpathSync(p, self2.realpathCache);
  12453. set[real] = true;
  12454. } catch (er) {
  12455. if (er.syscall === "stat")
  12456. set[self2._makeAbs(p)] = true;
  12457. else
  12458. throw er;
  12459. }
  12460. }
  12461. });
  12462. }
  12463. common.finish(this);
  12464. };
  12465. GlobSync.prototype._process = function(pattern, index, inGlobStar) {
  12466. assert(this instanceof GlobSync);
  12467. var n = 0;
  12468. while (typeof pattern[n] === "string") {
  12469. n++;
  12470. }
  12471. var prefix;
  12472. switch (n) {
  12473. case pattern.length:
  12474. this._processSimple(pattern.join("/"), index);
  12475. return;
  12476. case 0:
  12477. prefix = null;
  12478. break;
  12479. default:
  12480. prefix = pattern.slice(0, n).join("/");
  12481. break;
  12482. }
  12483. var remain = pattern.slice(n);
  12484. var read;
  12485. if (prefix === null)
  12486. read = ".";
  12487. else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
  12488. if (!prefix || !isAbsolute(prefix))
  12489. prefix = "/" + prefix;
  12490. read = prefix;
  12491. } else
  12492. read = prefix;
  12493. var abs = this._makeAbs(read);
  12494. if (childrenIgnored(this, read))
  12495. return;
  12496. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  12497. if (isGlobStar)
  12498. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
  12499. else
  12500. this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
  12501. };
  12502. GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
  12503. var entries = this._readdir(abs, inGlobStar);
  12504. if (!entries)
  12505. return;
  12506. var pn = remain[0];
  12507. var negate = !!this.minimatch.negate;
  12508. var rawGlob = pn._glob;
  12509. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  12510. var matchedEntries = [];
  12511. for (var i = 0; i < entries.length; i++) {
  12512. var e = entries[i];
  12513. if (e.charAt(0) !== "." || dotOk) {
  12514. var m;
  12515. if (negate && !prefix) {
  12516. m = !e.match(pn);
  12517. } else {
  12518. m = e.match(pn);
  12519. }
  12520. if (m)
  12521. matchedEntries.push(e);
  12522. }
  12523. }
  12524. var len = matchedEntries.length;
  12525. if (len === 0)
  12526. return;
  12527. if (remain.length === 1 && !this.mark && !this.stat) {
  12528. if (!this.matches[index])
  12529. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12530. for (var i = 0; i < len; i++) {
  12531. var e = matchedEntries[i];
  12532. if (prefix) {
  12533. if (prefix.slice(-1) !== "/")
  12534. e = prefix + "/" + e;
  12535. else
  12536. e = prefix + e;
  12537. }
  12538. if (e.charAt(0) === "/" && !this.nomount) {
  12539. e = path.join(this.root, e);
  12540. }
  12541. this._emitMatch(index, e);
  12542. }
  12543. return;
  12544. }
  12545. remain.shift();
  12546. for (var i = 0; i < len; i++) {
  12547. var e = matchedEntries[i];
  12548. var newPattern;
  12549. if (prefix)
  12550. newPattern = [prefix, e];
  12551. else
  12552. newPattern = [e];
  12553. this._process(newPattern.concat(remain), index, inGlobStar);
  12554. }
  12555. };
  12556. GlobSync.prototype._emitMatch = function(index, e) {
  12557. if (isIgnored(this, e))
  12558. return;
  12559. var abs = this._makeAbs(e);
  12560. if (this.mark)
  12561. e = this._mark(e);
  12562. if (this.absolute) {
  12563. e = abs;
  12564. }
  12565. if (this.matches[index][e])
  12566. return;
  12567. if (this.nodir) {
  12568. var c = this.cache[abs];
  12569. if (c === "DIR" || Array.isArray(c))
  12570. return;
  12571. }
  12572. this.matches[index][e] = true;
  12573. if (this.stat)
  12574. this._stat(e);
  12575. };
  12576. GlobSync.prototype._readdirInGlobStar = function(abs) {
  12577. if (this.follow)
  12578. return this._readdir(abs, false);
  12579. var entries;
  12580. var lstat;
  12581. var stat;
  12582. try {
  12583. lstat = this.fs.lstatSync(abs);
  12584. } catch (er) {
  12585. if (er.code === "ENOENT") {
  12586. return null;
  12587. }
  12588. }
  12589. var isSym = lstat && lstat.isSymbolicLink();
  12590. this.symlinks[abs] = isSym;
  12591. if (!isSym && lstat && !lstat.isDirectory())
  12592. this.cache[abs] = "FILE";
  12593. else
  12594. entries = this._readdir(abs, false);
  12595. return entries;
  12596. };
  12597. GlobSync.prototype._readdir = function(abs, inGlobStar) {
  12598. var entries;
  12599. if (inGlobStar && !ownProp(this.symlinks, abs))
  12600. return this._readdirInGlobStar(abs);
  12601. if (ownProp(this.cache, abs)) {
  12602. var c = this.cache[abs];
  12603. if (!c || c === "FILE")
  12604. return null;
  12605. if (Array.isArray(c))
  12606. return c;
  12607. }
  12608. try {
  12609. return this._readdirEntries(abs, this.fs.readdirSync(abs));
  12610. } catch (er) {
  12611. this._readdirError(abs, er);
  12612. return null;
  12613. }
  12614. };
  12615. GlobSync.prototype._readdirEntries = function(abs, entries) {
  12616. if (!this.mark && !this.stat) {
  12617. for (var i = 0; i < entries.length; i++) {
  12618. var e = entries[i];
  12619. if (abs === "/")
  12620. e = abs + e;
  12621. else
  12622. e = abs + "/" + e;
  12623. this.cache[e] = true;
  12624. }
  12625. }
  12626. this.cache[abs] = entries;
  12627. return entries;
  12628. };
  12629. GlobSync.prototype._readdirError = function(f, er) {
  12630. switch (er.code) {
  12631. case "ENOTSUP":
  12632. case "ENOTDIR":
  12633. var abs = this._makeAbs(f);
  12634. this.cache[abs] = "FILE";
  12635. if (abs === this.cwdAbs) {
  12636. var error = new Error(er.code + " invalid cwd " + this.cwd);
  12637. error.path = this.cwd;
  12638. error.code = er.code;
  12639. throw error;
  12640. }
  12641. break;
  12642. case "ENOENT":
  12643. case "ELOOP":
  12644. case "ENAMETOOLONG":
  12645. case "UNKNOWN":
  12646. this.cache[this._makeAbs(f)] = false;
  12647. break;
  12648. default:
  12649. this.cache[this._makeAbs(f)] = false;
  12650. if (this.strict)
  12651. throw er;
  12652. if (!this.silent)
  12653. console.error("glob error", er);
  12654. break;
  12655. }
  12656. };
  12657. GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
  12658. var entries = this._readdir(abs, inGlobStar);
  12659. if (!entries)
  12660. return;
  12661. var remainWithoutGlobStar = remain.slice(1);
  12662. var gspref = prefix ? [prefix] : [];
  12663. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  12664. this._process(noGlobStar, index, false);
  12665. var len = entries.length;
  12666. var isSym = this.symlinks[abs];
  12667. if (isSym && inGlobStar)
  12668. return;
  12669. for (var i = 0; i < len; i++) {
  12670. var e = entries[i];
  12671. if (e.charAt(0) === "." && !this.dot)
  12672. continue;
  12673. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  12674. this._process(instead, index, true);
  12675. var below = gspref.concat(entries[i], remain);
  12676. this._process(below, index, true);
  12677. }
  12678. };
  12679. GlobSync.prototype._processSimple = function(prefix, index) {
  12680. var exists = this._stat(prefix);
  12681. if (!this.matches[index])
  12682. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12683. if (!exists)
  12684. return;
  12685. if (prefix && isAbsolute(prefix) && !this.nomount) {
  12686. var trail = /[\/\\]$/.test(prefix);
  12687. if (prefix.charAt(0) === "/") {
  12688. prefix = path.join(this.root, prefix);
  12689. } else {
  12690. prefix = path.resolve(this.root, prefix);
  12691. if (trail)
  12692. prefix += "/";
  12693. }
  12694. }
  12695. if (process.platform === "win32")
  12696. prefix = prefix.replace(/\\/g, "/");
  12697. this._emitMatch(index, prefix);
  12698. };
  12699. GlobSync.prototype._stat = function(f) {
  12700. var abs = this._makeAbs(f);
  12701. var needDir = f.slice(-1) === "/";
  12702. if (f.length > this.maxLength)
  12703. return false;
  12704. if (!this.stat && ownProp(this.cache, abs)) {
  12705. var c = this.cache[abs];
  12706. if (Array.isArray(c))
  12707. c = "DIR";
  12708. if (!needDir || c === "DIR")
  12709. return c;
  12710. if (needDir && c === "FILE")
  12711. return false;
  12712. }
  12713. var exists;
  12714. var stat = this.statCache[abs];
  12715. if (!stat) {
  12716. var lstat;
  12717. try {
  12718. lstat = this.fs.lstatSync(abs);
  12719. } catch (er) {
  12720. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  12721. this.statCache[abs] = false;
  12722. return false;
  12723. }
  12724. }
  12725. if (lstat && lstat.isSymbolicLink()) {
  12726. try {
  12727. stat = this.fs.statSync(abs);
  12728. } catch (er) {
  12729. stat = lstat;
  12730. }
  12731. } else {
  12732. stat = lstat;
  12733. }
  12734. }
  12735. this.statCache[abs] = stat;
  12736. var c = true;
  12737. if (stat)
  12738. c = stat.isDirectory() ? "DIR" : "FILE";
  12739. this.cache[abs] = this.cache[abs] || c;
  12740. if (needDir && c === "FILE")
  12741. return false;
  12742. return c;
  12743. };
  12744. GlobSync.prototype._mark = function(p) {
  12745. return common.mark(this, p);
  12746. };
  12747. GlobSync.prototype._makeAbs = function(f) {
  12748. return common.makeAbs(this, f);
  12749. };
  12750. }
  12751. });
  12752. var require_wrappy = __commonJS2({
  12753. "node_modules/wrappy/wrappy.js"(exports2, module2) {
  12754. module2.exports = wrappy;
  12755. function wrappy(fn, cb) {
  12756. if (fn && cb)
  12757. return wrappy(fn)(cb);
  12758. if (typeof fn !== "function")
  12759. throw new TypeError("need wrapper function");
  12760. Object.keys(fn).forEach(function(k) {
  12761. wrapper[k] = fn[k];
  12762. });
  12763. return wrapper;
  12764. function wrapper() {
  12765. var args = new Array(arguments.length);
  12766. for (var i = 0; i < args.length; i++) {
  12767. args[i] = arguments[i];
  12768. }
  12769. var ret = fn.apply(this, args);
  12770. var cb2 = args[args.length - 1];
  12771. if (typeof ret === "function" && ret !== cb2) {
  12772. Object.keys(cb2).forEach(function(k) {
  12773. ret[k] = cb2[k];
  12774. });
  12775. }
  12776. return ret;
  12777. }
  12778. }
  12779. }
  12780. });
  12781. var require_once = __commonJS2({
  12782. "node_modules/once/once.js"(exports2, module2) {
  12783. var wrappy = require_wrappy();
  12784. module2.exports = wrappy(once);
  12785. module2.exports.strict = wrappy(onceStrict);
  12786. once.proto = once(function() {
  12787. Object.defineProperty(Function.prototype, "once", {
  12788. value: function() {
  12789. return once(this);
  12790. },
  12791. configurable: true
  12792. });
  12793. Object.defineProperty(Function.prototype, "onceStrict", {
  12794. value: function() {
  12795. return onceStrict(this);
  12796. },
  12797. configurable: true
  12798. });
  12799. });
  12800. function once(fn) {
  12801. var f = function() {
  12802. if (f.called)
  12803. return f.value;
  12804. f.called = true;
  12805. return f.value = fn.apply(this, arguments);
  12806. };
  12807. f.called = false;
  12808. return f;
  12809. }
  12810. function onceStrict(fn) {
  12811. var f = function() {
  12812. if (f.called)
  12813. throw new Error(f.onceError);
  12814. f.called = true;
  12815. return f.value = fn.apply(this, arguments);
  12816. };
  12817. var name = fn.name || "Function wrapped with `once`";
  12818. f.onceError = name + " shouldn't be called more than once";
  12819. f.called = false;
  12820. return f;
  12821. }
  12822. }
  12823. });
  12824. var require_inflight = __commonJS2({
  12825. "node_modules/inflight/inflight.js"(exports2, module2) {
  12826. var wrappy = require_wrappy();
  12827. var reqs = /* @__PURE__ */ Object.create(null);
  12828. var once = require_once();
  12829. module2.exports = wrappy(inflight);
  12830. function inflight(key, cb) {
  12831. if (reqs[key]) {
  12832. reqs[key].push(cb);
  12833. return null;
  12834. } else {
  12835. reqs[key] = [cb];
  12836. return makeres(key);
  12837. }
  12838. }
  12839. function makeres(key) {
  12840. return once(function RES() {
  12841. var cbs = reqs[key];
  12842. var len = cbs.length;
  12843. var args = slice(arguments);
  12844. try {
  12845. for (var i = 0; i < len; i++) {
  12846. cbs[i].apply(null, args);
  12847. }
  12848. } finally {
  12849. if (cbs.length > len) {
  12850. cbs.splice(0, len);
  12851. process.nextTick(function() {
  12852. RES.apply(null, args);
  12853. });
  12854. } else {
  12855. delete reqs[key];
  12856. }
  12857. }
  12858. });
  12859. }
  12860. function slice(args) {
  12861. var length = args.length;
  12862. var array2 = [];
  12863. for (var i = 0; i < length; i++)
  12864. array2[i] = args[i];
  12865. return array2;
  12866. }
  12867. }
  12868. });
  12869. var require_glob = __commonJS2({
  12870. "node_modules/glob/glob.js"(exports2, module2) {
  12871. module2.exports = glob;
  12872. var rp = require_fs5();
  12873. var minimatch = require_minimatch();
  12874. var Minimatch = minimatch.Minimatch;
  12875. var inherits = require_inherits();
  12876. var EE = require("events").EventEmitter;
  12877. var path = require("path");
  12878. var assert = require("assert");
  12879. var isAbsolute = require_path_is_absolute();
  12880. var globSync = require_sync7();
  12881. var common = require_common3();
  12882. var setopts = common.setopts;
  12883. var ownProp = common.ownProp;
  12884. var inflight = require_inflight();
  12885. var util = require("util");
  12886. var childrenIgnored = common.childrenIgnored;
  12887. var isIgnored = common.isIgnored;
  12888. var once = require_once();
  12889. function glob(pattern, options, cb) {
  12890. if (typeof options === "function")
  12891. cb = options, options = {};
  12892. if (!options)
  12893. options = {};
  12894. if (options.sync) {
  12895. if (cb)
  12896. throw new TypeError("callback provided to sync glob");
  12897. return globSync(pattern, options);
  12898. }
  12899. return new Glob(pattern, options, cb);
  12900. }
  12901. glob.sync = globSync;
  12902. var GlobSync = glob.GlobSync = globSync.GlobSync;
  12903. glob.glob = glob;
  12904. function extend(origin, add) {
  12905. if (add === null || typeof add !== "object") {
  12906. return origin;
  12907. }
  12908. var keys = Object.keys(add);
  12909. var i = keys.length;
  12910. while (i--) {
  12911. origin[keys[i]] = add[keys[i]];
  12912. }
  12913. return origin;
  12914. }
  12915. glob.hasMagic = function(pattern, options_) {
  12916. var options = extend({}, options_);
  12917. options.noprocess = true;
  12918. var g = new Glob(pattern, options);
  12919. var set = g.minimatch.set;
  12920. if (!pattern)
  12921. return false;
  12922. if (set.length > 1)
  12923. return true;
  12924. for (var j = 0; j < set[0].length; j++) {
  12925. if (typeof set[0][j] !== "string")
  12926. return true;
  12927. }
  12928. return false;
  12929. };
  12930. glob.Glob = Glob;
  12931. inherits(Glob, EE);
  12932. function Glob(pattern, options, cb) {
  12933. if (typeof options === "function") {
  12934. cb = options;
  12935. options = null;
  12936. }
  12937. if (options && options.sync) {
  12938. if (cb)
  12939. throw new TypeError("callback provided to sync glob");
  12940. return new GlobSync(pattern, options);
  12941. }
  12942. if (!(this instanceof Glob))
  12943. return new Glob(pattern, options, cb);
  12944. setopts(this, pattern, options);
  12945. this._didRealPath = false;
  12946. var n = this.minimatch.set.length;
  12947. this.matches = new Array(n);
  12948. if (typeof cb === "function") {
  12949. cb = once(cb);
  12950. this.on("error", cb);
  12951. this.on("end", function(matches) {
  12952. cb(null, matches);
  12953. });
  12954. }
  12955. var self2 = this;
  12956. this._processing = 0;
  12957. this._emitQueue = [];
  12958. this._processQueue = [];
  12959. this.paused = false;
  12960. if (this.noprocess)
  12961. return this;
  12962. if (n === 0)
  12963. return done();
  12964. var sync = true;
  12965. for (var i = 0; i < n; i++) {
  12966. this._process(this.minimatch.set[i], i, false, done);
  12967. }
  12968. sync = false;
  12969. function done() {
  12970. --self2._processing;
  12971. if (self2._processing <= 0) {
  12972. if (sync) {
  12973. process.nextTick(function() {
  12974. self2._finish();
  12975. });
  12976. } else {
  12977. self2._finish();
  12978. }
  12979. }
  12980. }
  12981. }
  12982. Glob.prototype._finish = function() {
  12983. assert(this instanceof Glob);
  12984. if (this.aborted)
  12985. return;
  12986. if (this.realpath && !this._didRealpath)
  12987. return this._realpath();
  12988. common.finish(this);
  12989. this.emit("end", this.found);
  12990. };
  12991. Glob.prototype._realpath = function() {
  12992. if (this._didRealpath)
  12993. return;
  12994. this._didRealpath = true;
  12995. var n = this.matches.length;
  12996. if (n === 0)
  12997. return this._finish();
  12998. var self2 = this;
  12999. for (var i = 0; i < this.matches.length; i++)
  13000. this._realpathSet(i, next);
  13001. function next() {
  13002. if (--n === 0)
  13003. self2._finish();
  13004. }
  13005. };
  13006. Glob.prototype._realpathSet = function(index, cb) {
  13007. var matchset = this.matches[index];
  13008. if (!matchset)
  13009. return cb();
  13010. var found = Object.keys(matchset);
  13011. var self2 = this;
  13012. var n = found.length;
  13013. if (n === 0)
  13014. return cb();
  13015. var set = this.matches[index] = /* @__PURE__ */ Object.create(null);
  13016. found.forEach(function(p, i) {
  13017. p = self2._makeAbs(p);
  13018. rp.realpath(p, self2.realpathCache, function(er, real) {
  13019. if (!er)
  13020. set[real] = true;
  13021. else if (er.syscall === "stat")
  13022. set[p] = true;
  13023. else
  13024. self2.emit("error", er);
  13025. if (--n === 0) {
  13026. self2.matches[index] = set;
  13027. cb();
  13028. }
  13029. });
  13030. });
  13031. };
  13032. Glob.prototype._mark = function(p) {
  13033. return common.mark(this, p);
  13034. };
  13035. Glob.prototype._makeAbs = function(f) {
  13036. return common.makeAbs(this, f);
  13037. };
  13038. Glob.prototype.abort = function() {
  13039. this.aborted = true;
  13040. this.emit("abort");
  13041. };
  13042. Glob.prototype.pause = function() {
  13043. if (!this.paused) {
  13044. this.paused = true;
  13045. this.emit("pause");
  13046. }
  13047. };
  13048. Glob.prototype.resume = function() {
  13049. if (this.paused) {
  13050. this.emit("resume");
  13051. this.paused = false;
  13052. if (this._emitQueue.length) {
  13053. var eq = this._emitQueue.slice(0);
  13054. this._emitQueue.length = 0;
  13055. for (var i = 0; i < eq.length; i++) {
  13056. var e = eq[i];
  13057. this._emitMatch(e[0], e[1]);
  13058. }
  13059. }
  13060. if (this._processQueue.length) {
  13061. var pq = this._processQueue.slice(0);
  13062. this._processQueue.length = 0;
  13063. for (var i = 0; i < pq.length; i++) {
  13064. var p = pq[i];
  13065. this._processing--;
  13066. this._process(p[0], p[1], p[2], p[3]);
  13067. }
  13068. }
  13069. }
  13070. };
  13071. Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
  13072. assert(this instanceof Glob);
  13073. assert(typeof cb === "function");
  13074. if (this.aborted)
  13075. return;
  13076. this._processing++;
  13077. if (this.paused) {
  13078. this._processQueue.push([pattern, index, inGlobStar, cb]);
  13079. return;
  13080. }
  13081. var n = 0;
  13082. while (typeof pattern[n] === "string") {
  13083. n++;
  13084. }
  13085. var prefix;
  13086. switch (n) {
  13087. case pattern.length:
  13088. this._processSimple(pattern.join("/"), index, cb);
  13089. return;
  13090. case 0:
  13091. prefix = null;
  13092. break;
  13093. default:
  13094. prefix = pattern.slice(0, n).join("/");
  13095. break;
  13096. }
  13097. var remain = pattern.slice(n);
  13098. var read;
  13099. if (prefix === null)
  13100. read = ".";
  13101. else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
  13102. if (!prefix || !isAbsolute(prefix))
  13103. prefix = "/" + prefix;
  13104. read = prefix;
  13105. } else
  13106. read = prefix;
  13107. var abs = this._makeAbs(read);
  13108. if (childrenIgnored(this, read))
  13109. return cb();
  13110. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  13111. if (isGlobStar)
  13112. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
  13113. else
  13114. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
  13115. };
  13116. Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13117. var self2 = this;
  13118. this._readdir(abs, inGlobStar, function(er, entries) {
  13119. return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13120. });
  13121. };
  13122. Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13123. if (!entries)
  13124. return cb();
  13125. var pn = remain[0];
  13126. var negate = !!this.minimatch.negate;
  13127. var rawGlob = pn._glob;
  13128. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  13129. var matchedEntries = [];
  13130. for (var i = 0; i < entries.length; i++) {
  13131. var e = entries[i];
  13132. if (e.charAt(0) !== "." || dotOk) {
  13133. var m;
  13134. if (negate && !prefix) {
  13135. m = !e.match(pn);
  13136. } else {
  13137. m = e.match(pn);
  13138. }
  13139. if (m)
  13140. matchedEntries.push(e);
  13141. }
  13142. }
  13143. var len = matchedEntries.length;
  13144. if (len === 0)
  13145. return cb();
  13146. if (remain.length === 1 && !this.mark && !this.stat) {
  13147. if (!this.matches[index])
  13148. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13149. for (var i = 0; i < len; i++) {
  13150. var e = matchedEntries[i];
  13151. if (prefix) {
  13152. if (prefix !== "/")
  13153. e = prefix + "/" + e;
  13154. else
  13155. e = prefix + e;
  13156. }
  13157. if (e.charAt(0) === "/" && !this.nomount) {
  13158. e = path.join(this.root, e);
  13159. }
  13160. this._emitMatch(index, e);
  13161. }
  13162. return cb();
  13163. }
  13164. remain.shift();
  13165. for (var i = 0; i < len; i++) {
  13166. var e = matchedEntries[i];
  13167. var newPattern;
  13168. if (prefix) {
  13169. if (prefix !== "/")
  13170. e = prefix + "/" + e;
  13171. else
  13172. e = prefix + e;
  13173. }
  13174. this._process([e].concat(remain), index, inGlobStar, cb);
  13175. }
  13176. cb();
  13177. };
  13178. Glob.prototype._emitMatch = function(index, e) {
  13179. if (this.aborted)
  13180. return;
  13181. if (isIgnored(this, e))
  13182. return;
  13183. if (this.paused) {
  13184. this._emitQueue.push([index, e]);
  13185. return;
  13186. }
  13187. var abs = isAbsolute(e) ? e : this._makeAbs(e);
  13188. if (this.mark)
  13189. e = this._mark(e);
  13190. if (this.absolute)
  13191. e = abs;
  13192. if (this.matches[index][e])
  13193. return;
  13194. if (this.nodir) {
  13195. var c = this.cache[abs];
  13196. if (c === "DIR" || Array.isArray(c))
  13197. return;
  13198. }
  13199. this.matches[index][e] = true;
  13200. var st = this.statCache[abs];
  13201. if (st)
  13202. this.emit("stat", e, st);
  13203. this.emit("match", e);
  13204. };
  13205. Glob.prototype._readdirInGlobStar = function(abs, cb) {
  13206. if (this.aborted)
  13207. return;
  13208. if (this.follow)
  13209. return this._readdir(abs, false, cb);
  13210. var lstatkey = "lstat\0" + abs;
  13211. var self2 = this;
  13212. var lstatcb = inflight(lstatkey, lstatcb_);
  13213. if (lstatcb)
  13214. self2.fs.lstat(abs, lstatcb);
  13215. function lstatcb_(er, lstat) {
  13216. if (er && er.code === "ENOENT")
  13217. return cb();
  13218. var isSym = lstat && lstat.isSymbolicLink();
  13219. self2.symlinks[abs] = isSym;
  13220. if (!isSym && lstat && !lstat.isDirectory()) {
  13221. self2.cache[abs] = "FILE";
  13222. cb();
  13223. } else
  13224. self2._readdir(abs, false, cb);
  13225. }
  13226. };
  13227. Glob.prototype._readdir = function(abs, inGlobStar, cb) {
  13228. if (this.aborted)
  13229. return;
  13230. cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
  13231. if (!cb)
  13232. return;
  13233. if (inGlobStar && !ownProp(this.symlinks, abs))
  13234. return this._readdirInGlobStar(abs, cb);
  13235. if (ownProp(this.cache, abs)) {
  13236. var c = this.cache[abs];
  13237. if (!c || c === "FILE")
  13238. return cb();
  13239. if (Array.isArray(c))
  13240. return cb(null, c);
  13241. }
  13242. var self2 = this;
  13243. self2.fs.readdir(abs, readdirCb(this, abs, cb));
  13244. };
  13245. function readdirCb(self2, abs, cb) {
  13246. return function(er, entries) {
  13247. if (er)
  13248. self2._readdirError(abs, er, cb);
  13249. else
  13250. self2._readdirEntries(abs, entries, cb);
  13251. };
  13252. }
  13253. Glob.prototype._readdirEntries = function(abs, entries, cb) {
  13254. if (this.aborted)
  13255. return;
  13256. if (!this.mark && !this.stat) {
  13257. for (var i = 0; i < entries.length; i++) {
  13258. var e = entries[i];
  13259. if (abs === "/")
  13260. e = abs + e;
  13261. else
  13262. e = abs + "/" + e;
  13263. this.cache[e] = true;
  13264. }
  13265. }
  13266. this.cache[abs] = entries;
  13267. return cb(null, entries);
  13268. };
  13269. Glob.prototype._readdirError = function(f, er, cb) {
  13270. if (this.aborted)
  13271. return;
  13272. switch (er.code) {
  13273. case "ENOTSUP":
  13274. case "ENOTDIR":
  13275. var abs = this._makeAbs(f);
  13276. this.cache[abs] = "FILE";
  13277. if (abs === this.cwdAbs) {
  13278. var error = new Error(er.code + " invalid cwd " + this.cwd);
  13279. error.path = this.cwd;
  13280. error.code = er.code;
  13281. this.emit("error", error);
  13282. this.abort();
  13283. }
  13284. break;
  13285. case "ENOENT":
  13286. case "ELOOP":
  13287. case "ENAMETOOLONG":
  13288. case "UNKNOWN":
  13289. this.cache[this._makeAbs(f)] = false;
  13290. break;
  13291. default:
  13292. this.cache[this._makeAbs(f)] = false;
  13293. if (this.strict) {
  13294. this.emit("error", er);
  13295. this.abort();
  13296. }
  13297. if (!this.silent)
  13298. console.error("glob error", er);
  13299. break;
  13300. }
  13301. return cb();
  13302. };
  13303. Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13304. var self2 = this;
  13305. this._readdir(abs, inGlobStar, function(er, entries) {
  13306. self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13307. });
  13308. };
  13309. Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13310. if (!entries)
  13311. return cb();
  13312. var remainWithoutGlobStar = remain.slice(1);
  13313. var gspref = prefix ? [prefix] : [];
  13314. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  13315. this._process(noGlobStar, index, false, cb);
  13316. var isSym = this.symlinks[abs];
  13317. var len = entries.length;
  13318. if (isSym && inGlobStar)
  13319. return cb();
  13320. for (var i = 0; i < len; i++) {
  13321. var e = entries[i];
  13322. if (e.charAt(0) === "." && !this.dot)
  13323. continue;
  13324. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  13325. this._process(instead, index, true, cb);
  13326. var below = gspref.concat(entries[i], remain);
  13327. this._process(below, index, true, cb);
  13328. }
  13329. cb();
  13330. };
  13331. Glob.prototype._processSimple = function(prefix, index, cb) {
  13332. var self2 = this;
  13333. this._stat(prefix, function(er, exists) {
  13334. self2._processSimple2(prefix, index, er, exists, cb);
  13335. });
  13336. };
  13337. Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
  13338. if (!this.matches[index])
  13339. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13340. if (!exists)
  13341. return cb();
  13342. if (prefix && isAbsolute(prefix) && !this.nomount) {
  13343. var trail = /[\/\\]$/.test(prefix);
  13344. if (prefix.charAt(0) === "/") {
  13345. prefix = path.join(this.root, prefix);
  13346. } else {
  13347. prefix = path.resolve(this.root, prefix);
  13348. if (trail)
  13349. prefix += "/";
  13350. }
  13351. }
  13352. if (process.platform === "win32")
  13353. prefix = prefix.replace(/\\/g, "/");
  13354. this._emitMatch(index, prefix);
  13355. cb();
  13356. };
  13357. Glob.prototype._stat = function(f, cb) {
  13358. var abs = this._makeAbs(f);
  13359. var needDir = f.slice(-1) === "/";
  13360. if (f.length > this.maxLength)
  13361. return cb();
  13362. if (!this.stat && ownProp(this.cache, abs)) {
  13363. var c = this.cache[abs];
  13364. if (Array.isArray(c))
  13365. c = "DIR";
  13366. if (!needDir || c === "DIR")
  13367. return cb(null, c);
  13368. if (needDir && c === "FILE")
  13369. return cb();
  13370. }
  13371. var exists;
  13372. var stat = this.statCache[abs];
  13373. if (stat !== void 0) {
  13374. if (stat === false)
  13375. return cb(null, stat);
  13376. else {
  13377. var type = stat.isDirectory() ? "DIR" : "FILE";
  13378. if (needDir && type === "FILE")
  13379. return cb();
  13380. else
  13381. return cb(null, type, stat);
  13382. }
  13383. }
  13384. var self2 = this;
  13385. var statcb = inflight("stat\0" + abs, lstatcb_);
  13386. if (statcb)
  13387. self2.fs.lstat(abs, statcb);
  13388. function lstatcb_(er, lstat) {
  13389. if (lstat && lstat.isSymbolicLink()) {
  13390. return self2.fs.stat(abs, function(er2, stat2) {
  13391. if (er2)
  13392. self2._stat2(f, abs, null, lstat, cb);
  13393. else
  13394. self2._stat2(f, abs, er2, stat2, cb);
  13395. });
  13396. } else {
  13397. self2._stat2(f, abs, er, lstat, cb);
  13398. }
  13399. }
  13400. };
  13401. Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
  13402. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  13403. this.statCache[abs] = false;
  13404. return cb();
  13405. }
  13406. var needDir = f.slice(-1) === "/";
  13407. this.statCache[abs] = stat;
  13408. if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
  13409. return cb(null, false, stat);
  13410. var c = true;
  13411. if (stat)
  13412. c = stat.isDirectory() ? "DIR" : "FILE";
  13413. this.cache[abs] = this.cache[abs] || c;
  13414. if (needDir && c === "FILE")
  13415. return cb();
  13416. return cb(null, c, stat);
  13417. };
  13418. }
  13419. });
  13420. var require_rimraf = __commonJS2({
  13421. "node_modules/rimraf/rimraf.js"(exports2, module2) {
  13422. var assert = require("assert");
  13423. var path = require("path");
  13424. var fs = require("fs");
  13425. var glob = void 0;
  13426. try {
  13427. glob = require_glob();
  13428. } catch (_err) {
  13429. }
  13430. var defaultGlobOpts = {
  13431. nosort: true,
  13432. silent: true
  13433. };
  13434. var timeout = 0;
  13435. var isWindows = process.platform === "win32";
  13436. var defaults = (options) => {
  13437. const methods = ["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"];
  13438. methods.forEach((m) => {
  13439. options[m] = options[m] || fs[m];
  13440. m = m + "Sync";
  13441. options[m] = options[m] || fs[m];
  13442. });
  13443. options.maxBusyTries = options.maxBusyTries || 3;
  13444. options.emfileWait = options.emfileWait || 1e3;
  13445. if (options.glob === false) {
  13446. options.disableGlob = true;
  13447. }
  13448. if (options.disableGlob !== true && glob === void 0) {
  13449. throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
  13450. }
  13451. options.disableGlob = options.disableGlob || false;
  13452. options.glob = options.glob || defaultGlobOpts;
  13453. };
  13454. var rimraf = (p, options, cb) => {
  13455. if (typeof options === "function") {
  13456. cb = options;
  13457. options = {};
  13458. }
  13459. assert(p, "rimraf: missing path");
  13460. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13461. assert.equal(typeof cb, "function", "rimraf: callback function required");
  13462. assert(options, "rimraf: invalid options argument provided");
  13463. assert.equal(typeof options, "object", "rimraf: options should be object");
  13464. defaults(options);
  13465. let busyTries = 0;
  13466. let errState = null;
  13467. let n = 0;
  13468. const next = (er) => {
  13469. errState = errState || er;
  13470. if (--n === 0)
  13471. cb(errState);
  13472. };
  13473. const afterGlob = (er, results) => {
  13474. if (er)
  13475. return cb(er);
  13476. n = results.length;
  13477. if (n === 0)
  13478. return cb();
  13479. results.forEach((p2) => {
  13480. const CB = (er2) => {
  13481. if (er2) {
  13482. if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
  13483. busyTries++;
  13484. return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
  13485. }
  13486. if (er2.code === "EMFILE" && timeout < options.emfileWait) {
  13487. return setTimeout(() => rimraf_(p2, options, CB), timeout++);
  13488. }
  13489. if (er2.code === "ENOENT")
  13490. er2 = null;
  13491. }
  13492. timeout = 0;
  13493. next(er2);
  13494. };
  13495. rimraf_(p2, options, CB);
  13496. });
  13497. };
  13498. if (options.disableGlob || !glob.hasMagic(p))
  13499. return afterGlob(null, [p]);
  13500. options.lstat(p, (er, stat) => {
  13501. if (!er)
  13502. return afterGlob(null, [p]);
  13503. glob(p, options.glob, afterGlob);
  13504. });
  13505. };
  13506. var rimraf_ = (p, options, cb) => {
  13507. assert(p);
  13508. assert(options);
  13509. assert(typeof cb === "function");
  13510. options.lstat(p, (er, st) => {
  13511. if (er && er.code === "ENOENT")
  13512. return cb(null);
  13513. if (er && er.code === "EPERM" && isWindows)
  13514. fixWinEPERM(p, options, er, cb);
  13515. if (st && st.isDirectory())
  13516. return rmdir(p, options, er, cb);
  13517. options.unlink(p, (er2) => {
  13518. if (er2) {
  13519. if (er2.code === "ENOENT")
  13520. return cb(null);
  13521. if (er2.code === "EPERM")
  13522. return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
  13523. if (er2.code === "EISDIR")
  13524. return rmdir(p, options, er2, cb);
  13525. }
  13526. return cb(er2);
  13527. });
  13528. });
  13529. };
  13530. var fixWinEPERM = (p, options, er, cb) => {
  13531. assert(p);
  13532. assert(options);
  13533. assert(typeof cb === "function");
  13534. options.chmod(p, 438, (er2) => {
  13535. if (er2)
  13536. cb(er2.code === "ENOENT" ? null : er);
  13537. else
  13538. options.stat(p, (er3, stats) => {
  13539. if (er3)
  13540. cb(er3.code === "ENOENT" ? null : er);
  13541. else if (stats.isDirectory())
  13542. rmdir(p, options, er, cb);
  13543. else
  13544. options.unlink(p, cb);
  13545. });
  13546. });
  13547. };
  13548. var fixWinEPERMSync = (p, options, er) => {
  13549. assert(p);
  13550. assert(options);
  13551. try {
  13552. options.chmodSync(p, 438);
  13553. } catch (er2) {
  13554. if (er2.code === "ENOENT")
  13555. return;
  13556. else
  13557. throw er;
  13558. }
  13559. let stats;
  13560. try {
  13561. stats = options.statSync(p);
  13562. } catch (er3) {
  13563. if (er3.code === "ENOENT")
  13564. return;
  13565. else
  13566. throw er;
  13567. }
  13568. if (stats.isDirectory())
  13569. rmdirSync(p, options, er);
  13570. else
  13571. options.unlinkSync(p);
  13572. };
  13573. var rmdir = (p, options, originalEr, cb) => {
  13574. assert(p);
  13575. assert(options);
  13576. assert(typeof cb === "function");
  13577. options.rmdir(p, (er) => {
  13578. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  13579. rmkids(p, options, cb);
  13580. else if (er && er.code === "ENOTDIR")
  13581. cb(originalEr);
  13582. else
  13583. cb(er);
  13584. });
  13585. };
  13586. var rmkids = (p, options, cb) => {
  13587. assert(p);
  13588. assert(options);
  13589. assert(typeof cb === "function");
  13590. options.readdir(p, (er, files) => {
  13591. if (er)
  13592. return cb(er);
  13593. let n = files.length;
  13594. if (n === 0)
  13595. return options.rmdir(p, cb);
  13596. let errState;
  13597. files.forEach((f) => {
  13598. rimraf(path.join(p, f), options, (er2) => {
  13599. if (errState)
  13600. return;
  13601. if (er2)
  13602. return cb(errState = er2);
  13603. if (--n === 0)
  13604. options.rmdir(p, cb);
  13605. });
  13606. });
  13607. });
  13608. };
  13609. var rimrafSync = (p, options) => {
  13610. options = options || {};
  13611. defaults(options);
  13612. assert(p, "rimraf: missing path");
  13613. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13614. assert(options, "rimraf: missing options");
  13615. assert.equal(typeof options, "object", "rimraf: options should be object");
  13616. let results;
  13617. if (options.disableGlob || !glob.hasMagic(p)) {
  13618. results = [p];
  13619. } else {
  13620. try {
  13621. options.lstatSync(p);
  13622. results = [p];
  13623. } catch (er) {
  13624. results = glob.sync(p, options.glob);
  13625. }
  13626. }
  13627. if (!results.length)
  13628. return;
  13629. for (let i = 0; i < results.length; i++) {
  13630. const p2 = results[i];
  13631. let st;
  13632. try {
  13633. st = options.lstatSync(p2);
  13634. } catch (er) {
  13635. if (er.code === "ENOENT")
  13636. return;
  13637. if (er.code === "EPERM" && isWindows)
  13638. fixWinEPERMSync(p2, options, er);
  13639. }
  13640. try {
  13641. if (st && st.isDirectory())
  13642. rmdirSync(p2, options, null);
  13643. else
  13644. options.unlinkSync(p2);
  13645. } catch (er) {
  13646. if (er.code === "ENOENT")
  13647. return;
  13648. if (er.code === "EPERM")
  13649. return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
  13650. if (er.code !== "EISDIR")
  13651. throw er;
  13652. rmdirSync(p2, options, er);
  13653. }
  13654. }
  13655. };
  13656. var rmdirSync = (p, options, originalEr) => {
  13657. assert(p);
  13658. assert(options);
  13659. try {
  13660. options.rmdirSync(p);
  13661. } catch (er) {
  13662. if (er.code === "ENOENT")
  13663. return;
  13664. if (er.code === "ENOTDIR")
  13665. throw originalEr;
  13666. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  13667. rmkidsSync(p, options);
  13668. }
  13669. };
  13670. var rmkidsSync = (p, options) => {
  13671. assert(p);
  13672. assert(options);
  13673. options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
  13674. const retries = isWindows ? 100 : 1;
  13675. let i = 0;
  13676. do {
  13677. let threw = true;
  13678. try {
  13679. const ret = options.rmdirSync(p, options);
  13680. threw = false;
  13681. return ret;
  13682. } finally {
  13683. if (++i < retries && threw)
  13684. continue;
  13685. }
  13686. } while (true);
  13687. };
  13688. module2.exports = rimraf;
  13689. rimraf.sync = rimrafSync;
  13690. }
  13691. });
  13692. var require_del = __commonJS2({
  13693. "node_modules/flat-cache/src/del.js"(exports2, module2) {
  13694. var rimraf = require_rimraf().sync;
  13695. var fs = require("fs");
  13696. module2.exports = function del(file) {
  13697. if (fs.existsSync(file)) {
  13698. rimraf(file, {
  13699. glob: false
  13700. });
  13701. return true;
  13702. }
  13703. return false;
  13704. };
  13705. }
  13706. });
  13707. var require_cache = __commonJS2({
  13708. "node_modules/flat-cache/src/cache.js"(exports2, module2) {
  13709. var path = require("path");
  13710. var fs = require("fs");
  13711. var utils = require_utils6();
  13712. var del = require_del();
  13713. var writeJSON = utils.writeJSON;
  13714. var cache = {
  13715. load: function(docId, cacheDir) {
  13716. var me = this;
  13717. me._visited = {};
  13718. me._persisted = {};
  13719. me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  13720. if (fs.existsSync(me._pathToFile)) {
  13721. me._persisted = utils.tryParse(me._pathToFile, {});
  13722. }
  13723. },
  13724. loadFile: function(pathToFile) {
  13725. var me = this;
  13726. var dir = path.dirname(pathToFile);
  13727. var fName = path.basename(pathToFile);
  13728. me.load(fName, dir);
  13729. },
  13730. all: function() {
  13731. return this._persisted;
  13732. },
  13733. keys: function() {
  13734. return Object.keys(this._persisted);
  13735. },
  13736. setKey: function(key, value) {
  13737. this._visited[key] = true;
  13738. this._persisted[key] = value;
  13739. },
  13740. removeKey: function(key) {
  13741. delete this._visited[key];
  13742. delete this._persisted[key];
  13743. },
  13744. getKey: function(key) {
  13745. this._visited[key] = true;
  13746. return this._persisted[key];
  13747. },
  13748. _prune: function() {
  13749. var me = this;
  13750. var obj = {};
  13751. var keys = Object.keys(me._visited);
  13752. if (keys.length === 0) {
  13753. return;
  13754. }
  13755. keys.forEach(function(key) {
  13756. obj[key] = me._persisted[key];
  13757. });
  13758. me._visited = {};
  13759. me._persisted = obj;
  13760. },
  13761. save: function(noPrune) {
  13762. var me = this;
  13763. !noPrune && me._prune();
  13764. writeJSON(me._pathToFile, me._persisted);
  13765. },
  13766. removeCacheFile: function() {
  13767. return del(this._pathToFile);
  13768. },
  13769. destroy: function() {
  13770. var me = this;
  13771. me._visited = {};
  13772. me._persisted = {};
  13773. me.removeCacheFile();
  13774. }
  13775. };
  13776. module2.exports = {
  13777. load: function(docId, cacheDir) {
  13778. return this.create(docId, cacheDir);
  13779. },
  13780. create: function(docId, cacheDir) {
  13781. var obj = Object.create(cache);
  13782. obj.load(docId, cacheDir);
  13783. return obj;
  13784. },
  13785. createFromFile: function(filePath) {
  13786. var obj = Object.create(cache);
  13787. obj.loadFile(filePath);
  13788. return obj;
  13789. },
  13790. clearCacheById: function(docId, cacheDir) {
  13791. var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  13792. return del(filePath);
  13793. },
  13794. clearAll: function(cacheDir) {
  13795. var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, "../.cache/");
  13796. return del(filePath);
  13797. }
  13798. };
  13799. }
  13800. });
  13801. var require_cache2 = __commonJS2({
  13802. "node_modules/file-entry-cache/cache.js"(exports2, module2) {
  13803. var path = require("path");
  13804. var crypto = require("crypto");
  13805. module2.exports = {
  13806. createFromFile: function(filePath, useChecksum) {
  13807. var fname = path.basename(filePath);
  13808. var dir = path.dirname(filePath);
  13809. return this.create(fname, dir, useChecksum);
  13810. },
  13811. create: function(cacheId, _path, useChecksum) {
  13812. var fs = require("fs");
  13813. var flatCache = require_cache();
  13814. var cache = flatCache.load(cacheId, _path);
  13815. var normalizedEntries = {};
  13816. var removeNotFoundFiles = function removeNotFoundFiles2() {
  13817. const cachedEntries = cache.keys();
  13818. cachedEntries.forEach(function remover(fPath) {
  13819. try {
  13820. fs.statSync(fPath);
  13821. } catch (err) {
  13822. if (err.code === "ENOENT") {
  13823. cache.removeKey(fPath);
  13824. }
  13825. }
  13826. });
  13827. };
  13828. removeNotFoundFiles();
  13829. return {
  13830. cache,
  13831. getHash: function(buffer) {
  13832. return crypto.createHash("md5").update(buffer).digest("hex");
  13833. },
  13834. hasFileChanged: function(file) {
  13835. return this.getFileDescriptor(file).changed;
  13836. },
  13837. analyzeFiles: function(files) {
  13838. var me = this;
  13839. files = files || [];
  13840. var res = {
  13841. changedFiles: [],
  13842. notFoundFiles: [],
  13843. notChangedFiles: []
  13844. };
  13845. me.normalizeEntries(files).forEach(function(entry) {
  13846. if (entry.changed) {
  13847. res.changedFiles.push(entry.key);
  13848. return;
  13849. }
  13850. if (entry.notFound) {
  13851. res.notFoundFiles.push(entry.key);
  13852. return;
  13853. }
  13854. res.notChangedFiles.push(entry.key);
  13855. });
  13856. return res;
  13857. },
  13858. getFileDescriptor: function(file) {
  13859. var fstat;
  13860. try {
  13861. fstat = fs.statSync(file);
  13862. } catch (ex) {
  13863. this.removeEntry(file);
  13864. return {
  13865. key: file,
  13866. notFound: true,
  13867. err: ex
  13868. };
  13869. }
  13870. if (useChecksum) {
  13871. return this._getFileDescriptorUsingChecksum(file);
  13872. }
  13873. return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
  13874. },
  13875. _getFileDescriptorUsingMtimeAndSize: function(file, fstat) {
  13876. var meta = cache.getKey(file);
  13877. var cacheExists = !!meta;
  13878. var cSize = fstat.size;
  13879. var cTime = fstat.mtime.getTime();
  13880. var isDifferentDate;
  13881. var isDifferentSize;
  13882. if (!meta) {
  13883. meta = {
  13884. size: cSize,
  13885. mtime: cTime
  13886. };
  13887. } else {
  13888. isDifferentDate = cTime !== meta.mtime;
  13889. isDifferentSize = cSize !== meta.size;
  13890. }
  13891. var nEntry = normalizedEntries[file] = {
  13892. key: file,
  13893. changed: !cacheExists || isDifferentDate || isDifferentSize,
  13894. meta
  13895. };
  13896. return nEntry;
  13897. },
  13898. _getFileDescriptorUsingChecksum: function(file) {
  13899. var meta = cache.getKey(file);
  13900. var cacheExists = !!meta;
  13901. var contentBuffer;
  13902. try {
  13903. contentBuffer = fs.readFileSync(file);
  13904. } catch (ex) {
  13905. contentBuffer = "";
  13906. }
  13907. var isDifferent = true;
  13908. var hash = this.getHash(contentBuffer);
  13909. if (!meta) {
  13910. meta = {
  13911. hash
  13912. };
  13913. } else {
  13914. isDifferent = hash !== meta.hash;
  13915. }
  13916. var nEntry = normalizedEntries[file] = {
  13917. key: file,
  13918. changed: !cacheExists || isDifferent,
  13919. meta
  13920. };
  13921. return nEntry;
  13922. },
  13923. getUpdatedFiles: function(files) {
  13924. var me = this;
  13925. files = files || [];
  13926. return me.normalizeEntries(files).filter(function(entry) {
  13927. return entry.changed;
  13928. }).map(function(entry) {
  13929. return entry.key;
  13930. });
  13931. },
  13932. normalizeEntries: function(files) {
  13933. files = files || [];
  13934. var me = this;
  13935. var nEntries = files.map(function(file) {
  13936. return me.getFileDescriptor(file);
  13937. });
  13938. return nEntries;
  13939. },
  13940. removeEntry: function(entryName) {
  13941. delete normalizedEntries[entryName];
  13942. cache.removeKey(entryName);
  13943. },
  13944. deleteCacheFile: function() {
  13945. cache.removeCacheFile();
  13946. },
  13947. destroy: function() {
  13948. normalizedEntries = {};
  13949. cache.destroy();
  13950. },
  13951. _getMetaForFileUsingCheckSum: function(cacheEntry) {
  13952. var contentBuffer = fs.readFileSync(cacheEntry.key);
  13953. var hash = this.getHash(contentBuffer);
  13954. var meta = Object.assign(cacheEntry.meta, {
  13955. hash
  13956. });
  13957. delete meta.size;
  13958. delete meta.mtime;
  13959. return meta;
  13960. },
  13961. _getMetaForFileUsingMtimeAndSize: function(cacheEntry) {
  13962. var stat = fs.statSync(cacheEntry.key);
  13963. var meta = Object.assign(cacheEntry.meta, {
  13964. size: stat.size,
  13965. mtime: stat.mtime.getTime()
  13966. });
  13967. delete meta.hash;
  13968. return meta;
  13969. },
  13970. reconcile: function(noPrune) {
  13971. removeNotFoundFiles();
  13972. noPrune = typeof noPrune === "undefined" ? true : noPrune;
  13973. var entries = normalizedEntries;
  13974. var keys = Object.keys(entries);
  13975. if (keys.length === 0) {
  13976. return;
  13977. }
  13978. var me = this;
  13979. keys.forEach(function(entryName) {
  13980. var cacheEntry = entries[entryName];
  13981. try {
  13982. var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
  13983. cache.setKey(entryName, meta);
  13984. } catch (err) {
  13985. if (err.code !== "ENOENT") {
  13986. throw err;
  13987. }
  13988. }
  13989. });
  13990. cache.save(noPrune);
  13991. }
  13992. };
  13993. }
  13994. };
  13995. }
  13996. });
  13997. var require_format_results_cache = __commonJS2({
  13998. "src/cli/format-results-cache.js"(exports2, module2) {
  13999. "use strict";
  14000. var fileEntryCache = require_cache2();
  14001. var stringify2 = require_fast_json_stable_stringify();
  14002. var {
  14003. version: prettierVersion
  14004. } = require("./index.js");
  14005. var {
  14006. createHash
  14007. } = require_utils();
  14008. var optionsHashCache = /* @__PURE__ */ new WeakMap();
  14009. var nodeVersion = process && process.version;
  14010. function getHashOfOptions(options) {
  14011. if (optionsHashCache.has(options)) {
  14012. return optionsHashCache.get(options);
  14013. }
  14014. const hash = createHash(`${prettierVersion}_${nodeVersion}_${stringify2(options)}`);
  14015. optionsHashCache.set(options, hash);
  14016. return hash;
  14017. }
  14018. function getMetadataFromFileDescriptor(fileDescriptor) {
  14019. return fileDescriptor.meta;
  14020. }
  14021. var FormatResultsCache = class {
  14022. constructor(cacheFileLocation, cacheStrategy) {
  14023. const useChecksum = cacheStrategy === "content";
  14024. this.cacheFileLocation = cacheFileLocation;
  14025. this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum);
  14026. }
  14027. existsAvailableFormatResultsCache(filePath, options) {
  14028. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14029. const hashOfOptions = getHashOfOptions(options);
  14030. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14031. const changed = fileDescriptor.changed || meta.hashOfOptions !== hashOfOptions;
  14032. if (fileDescriptor.notFound) {
  14033. return false;
  14034. }
  14035. if (changed) {
  14036. return false;
  14037. }
  14038. return true;
  14039. }
  14040. setFormatResultsCache(filePath, options) {
  14041. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14042. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14043. if (fileDescriptor && !fileDescriptor.notFound) {
  14044. meta.hashOfOptions = getHashOfOptions(options);
  14045. }
  14046. }
  14047. reconcile() {
  14048. this.fileEntryCache.reconcile();
  14049. }
  14050. };
  14051. module2.exports = FormatResultsCache;
  14052. }
  14053. });
  14054. var require_base = __commonJS2({
  14055. "node_modules/diff/lib/diff/base.js"(exports2) {
  14056. "use strict";
  14057. Object.defineProperty(exports2, "__esModule", {
  14058. value: true
  14059. });
  14060. exports2["default"] = Diff;
  14061. function Diff() {
  14062. }
  14063. Diff.prototype = {
  14064. diff: function diff(oldString, newString) {
  14065. var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  14066. var callback = options.callback;
  14067. if (typeof options === "function") {
  14068. callback = options;
  14069. options = {};
  14070. }
  14071. this.options = options;
  14072. var self2 = this;
  14073. function done(value) {
  14074. if (callback) {
  14075. setTimeout(function() {
  14076. callback(void 0, value);
  14077. }, 0);
  14078. return true;
  14079. } else {
  14080. return value;
  14081. }
  14082. }
  14083. oldString = this.castInput(oldString);
  14084. newString = this.castInput(newString);
  14085. oldString = this.removeEmpty(this.tokenize(oldString));
  14086. newString = this.removeEmpty(this.tokenize(newString));
  14087. var newLen = newString.length, oldLen = oldString.length;
  14088. var editLength = 1;
  14089. var maxEditLength = newLen + oldLen;
  14090. var bestPath = [{
  14091. newPos: -1,
  14092. components: []
  14093. }];
  14094. var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
  14095. if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
  14096. return done([{
  14097. value: this.join(newString),
  14098. count: newString.length
  14099. }]);
  14100. }
  14101. function execEditLength() {
  14102. for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
  14103. var basePath = void 0;
  14104. var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
  14105. if (addPath) {
  14106. bestPath[diagonalPath - 1] = void 0;
  14107. }
  14108. var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
  14109. if (!canAdd && !canRemove) {
  14110. bestPath[diagonalPath] = void 0;
  14111. continue;
  14112. }
  14113. if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
  14114. basePath = clonePath(removePath);
  14115. self2.pushComponent(basePath.components, void 0, true);
  14116. } else {
  14117. basePath = addPath;
  14118. basePath.newPos++;
  14119. self2.pushComponent(basePath.components, true, void 0);
  14120. }
  14121. _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
  14122. if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
  14123. return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
  14124. } else {
  14125. bestPath[diagonalPath] = basePath;
  14126. }
  14127. }
  14128. editLength++;
  14129. }
  14130. if (callback) {
  14131. (function exec() {
  14132. setTimeout(function() {
  14133. if (editLength > maxEditLength) {
  14134. return callback();
  14135. }
  14136. if (!execEditLength()) {
  14137. exec();
  14138. }
  14139. }, 0);
  14140. })();
  14141. } else {
  14142. while (editLength <= maxEditLength) {
  14143. var ret = execEditLength();
  14144. if (ret) {
  14145. return ret;
  14146. }
  14147. }
  14148. }
  14149. },
  14150. pushComponent: function pushComponent(components, added, removed) {
  14151. var last = components[components.length - 1];
  14152. if (last && last.added === added && last.removed === removed) {
  14153. components[components.length - 1] = {
  14154. count: last.count + 1,
  14155. added,
  14156. removed
  14157. };
  14158. } else {
  14159. components.push({
  14160. count: 1,
  14161. added,
  14162. removed
  14163. });
  14164. }
  14165. },
  14166. extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
  14167. var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
  14168. while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
  14169. newPos++;
  14170. oldPos++;
  14171. commonCount++;
  14172. }
  14173. if (commonCount) {
  14174. basePath.components.push({
  14175. count: commonCount
  14176. });
  14177. }
  14178. basePath.newPos = newPos;
  14179. return oldPos;
  14180. },
  14181. equals: function equals(left, right) {
  14182. if (this.options.comparator) {
  14183. return this.options.comparator(left, right);
  14184. } else {
  14185. return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
  14186. }
  14187. },
  14188. removeEmpty: function removeEmpty(array2) {
  14189. var ret = [];
  14190. for (var i = 0; i < array2.length; i++) {
  14191. if (array2[i]) {
  14192. ret.push(array2[i]);
  14193. }
  14194. }
  14195. return ret;
  14196. },
  14197. castInput: function castInput(value) {
  14198. return value;
  14199. },
  14200. tokenize: function tokenize(value) {
  14201. return value.split("");
  14202. },
  14203. join: function join(chars) {
  14204. return chars.join("");
  14205. }
  14206. };
  14207. function buildValues(diff, components, newString, oldString, useLongestToken) {
  14208. var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
  14209. for (; componentPos < componentLen; componentPos++) {
  14210. var component = components[componentPos];
  14211. if (!component.removed) {
  14212. if (!component.added && useLongestToken) {
  14213. var value = newString.slice(newPos, newPos + component.count);
  14214. value = value.map(function(value2, i) {
  14215. var oldValue = oldString[oldPos + i];
  14216. return oldValue.length > value2.length ? oldValue : value2;
  14217. });
  14218. component.value = diff.join(value);
  14219. } else {
  14220. component.value = diff.join(newString.slice(newPos, newPos + component.count));
  14221. }
  14222. newPos += component.count;
  14223. if (!component.added) {
  14224. oldPos += component.count;
  14225. }
  14226. } else {
  14227. component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
  14228. oldPos += component.count;
  14229. if (componentPos && components[componentPos - 1].added) {
  14230. var tmp = components[componentPos - 1];
  14231. components[componentPos - 1] = components[componentPos];
  14232. components[componentPos] = tmp;
  14233. }
  14234. }
  14235. }
  14236. var lastComponent = components[componentLen - 1];
  14237. if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
  14238. components[componentLen - 2].value += lastComponent.value;
  14239. components.pop();
  14240. }
  14241. return components;
  14242. }
  14243. function clonePath(path) {
  14244. return {
  14245. newPos: path.newPos,
  14246. components: path.components.slice(0)
  14247. };
  14248. }
  14249. }
  14250. });
  14251. var require_params = __commonJS2({
  14252. "node_modules/diff/lib/util/params.js"(exports2) {
  14253. "use strict";
  14254. Object.defineProperty(exports2, "__esModule", {
  14255. value: true
  14256. });
  14257. exports2.generateOptions = generateOptions;
  14258. function generateOptions(options, defaults) {
  14259. if (typeof options === "function") {
  14260. defaults.callback = options;
  14261. } else if (options) {
  14262. for (var name in options) {
  14263. if (options.hasOwnProperty(name)) {
  14264. defaults[name] = options[name];
  14265. }
  14266. }
  14267. }
  14268. return defaults;
  14269. }
  14270. }
  14271. });
  14272. var require_line = __commonJS2({
  14273. "node_modules/diff/lib/diff/line.js"(exports2) {
  14274. "use strict";
  14275. Object.defineProperty(exports2, "__esModule", {
  14276. value: true
  14277. });
  14278. exports2.diffLines = diffLines;
  14279. exports2.diffTrimmedLines = diffTrimmedLines;
  14280. exports2.lineDiff = void 0;
  14281. var _base = _interopRequireDefault(require_base());
  14282. var _params = require_params();
  14283. function _interopRequireDefault(obj) {
  14284. return obj && obj.__esModule ? obj : {
  14285. "default": obj
  14286. };
  14287. }
  14288. var lineDiff = new _base["default"]();
  14289. exports2.lineDiff = lineDiff;
  14290. lineDiff.tokenize = function(value) {
  14291. var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
  14292. if (!linesAndNewlines[linesAndNewlines.length - 1]) {
  14293. linesAndNewlines.pop();
  14294. }
  14295. for (var i = 0; i < linesAndNewlines.length; i++) {
  14296. var line = linesAndNewlines[i];
  14297. if (i % 2 && !this.options.newlineIsToken) {
  14298. retLines[retLines.length - 1] += line;
  14299. } else {
  14300. if (this.options.ignoreWhitespace) {
  14301. line = line.trim();
  14302. }
  14303. retLines.push(line);
  14304. }
  14305. }
  14306. return retLines;
  14307. };
  14308. function diffLines(oldStr, newStr, callback) {
  14309. return lineDiff.diff(oldStr, newStr, callback);
  14310. }
  14311. function diffTrimmedLines(oldStr, newStr, callback) {
  14312. var options = (0, _params.generateOptions)(callback, {
  14313. ignoreWhitespace: true
  14314. });
  14315. return lineDiff.diff(oldStr, newStr, options);
  14316. }
  14317. }
  14318. });
  14319. var require_create = __commonJS2({
  14320. "node_modules/diff/lib/patch/create.js"(exports2) {
  14321. "use strict";
  14322. Object.defineProperty(exports2, "__esModule", {
  14323. value: true
  14324. });
  14325. exports2.structuredPatch = structuredPatch;
  14326. exports2.formatPatch = formatPatch;
  14327. exports2.createTwoFilesPatch = createTwoFilesPatch;
  14328. exports2.createPatch = createPatch;
  14329. var _line = require_line();
  14330. function _toConsumableArray(arr) {
  14331. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  14332. }
  14333. function _nonIterableSpread() {
  14334. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  14335. }
  14336. function _unsupportedIterableToArray(o, minLen) {
  14337. if (!o)
  14338. return;
  14339. if (typeof o === "string")
  14340. return _arrayLikeToArray(o, minLen);
  14341. var n = Object.prototype.toString.call(o).slice(8, -1);
  14342. if (n === "Object" && o.constructor)
  14343. n = o.constructor.name;
  14344. if (n === "Map" || n === "Set")
  14345. return Array.from(o);
  14346. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  14347. return _arrayLikeToArray(o, minLen);
  14348. }
  14349. function _iterableToArray(iter) {
  14350. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
  14351. return Array.from(iter);
  14352. }
  14353. function _arrayWithoutHoles(arr) {
  14354. if (Array.isArray(arr))
  14355. return _arrayLikeToArray(arr);
  14356. }
  14357. function _arrayLikeToArray(arr, len) {
  14358. if (len == null || len > arr.length)
  14359. len = arr.length;
  14360. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  14361. arr2[i] = arr[i];
  14362. }
  14363. return arr2;
  14364. }
  14365. function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14366. if (!options) {
  14367. options = {};
  14368. }
  14369. if (typeof options.context === "undefined") {
  14370. options.context = 4;
  14371. }
  14372. var diff = (0, _line.diffLines)(oldStr, newStr, options);
  14373. diff.push({
  14374. value: "",
  14375. lines: []
  14376. });
  14377. function contextLines(lines) {
  14378. return lines.map(function(entry) {
  14379. return " " + entry;
  14380. });
  14381. }
  14382. var hunks = [];
  14383. var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
  14384. var _loop = function _loop2(i2) {
  14385. var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
  14386. current.lines = lines;
  14387. if (current.added || current.removed) {
  14388. var _curRange;
  14389. if (!oldRangeStart) {
  14390. var prev = diff[i2 - 1];
  14391. oldRangeStart = oldLine;
  14392. newRangeStart = newLine;
  14393. if (prev) {
  14394. curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
  14395. oldRangeStart -= curRange.length;
  14396. newRangeStart -= curRange.length;
  14397. }
  14398. }
  14399. (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
  14400. return (current.added ? "+" : "-") + entry;
  14401. })));
  14402. if (current.added) {
  14403. newLine += lines.length;
  14404. } else {
  14405. oldLine += lines.length;
  14406. }
  14407. } else {
  14408. if (oldRangeStart) {
  14409. if (lines.length <= options.context * 2 && i2 < diff.length - 2) {
  14410. var _curRange2;
  14411. (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
  14412. } else {
  14413. var _curRange3;
  14414. var contextSize = Math.min(lines.length, options.context);
  14415. (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
  14416. var hunk = {
  14417. oldStart: oldRangeStart,
  14418. oldLines: oldLine - oldRangeStart + contextSize,
  14419. newStart: newRangeStart,
  14420. newLines: newLine - newRangeStart + contextSize,
  14421. lines: curRange
  14422. };
  14423. if (i2 >= diff.length - 2 && lines.length <= options.context) {
  14424. var oldEOFNewline = /\n$/.test(oldStr);
  14425. var newEOFNewline = /\n$/.test(newStr);
  14426. var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
  14427. if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
  14428. curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
  14429. }
  14430. if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
  14431. curRange.push("\\ No newline at end of file");
  14432. }
  14433. }
  14434. hunks.push(hunk);
  14435. oldRangeStart = 0;
  14436. newRangeStart = 0;
  14437. curRange = [];
  14438. }
  14439. }
  14440. oldLine += lines.length;
  14441. newLine += lines.length;
  14442. }
  14443. };
  14444. for (var i = 0; i < diff.length; i++) {
  14445. _loop(i);
  14446. }
  14447. return {
  14448. oldFileName,
  14449. newFileName,
  14450. oldHeader,
  14451. newHeader,
  14452. hunks
  14453. };
  14454. }
  14455. function formatPatch(diff) {
  14456. var ret = [];
  14457. if (diff.oldFileName == diff.newFileName) {
  14458. ret.push("Index: " + diff.oldFileName);
  14459. }
  14460. ret.push("===================================================================");
  14461. ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
  14462. ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
  14463. for (var i = 0; i < diff.hunks.length; i++) {
  14464. var hunk = diff.hunks[i];
  14465. if (hunk.oldLines === 0) {
  14466. hunk.oldStart -= 1;
  14467. }
  14468. if (hunk.newLines === 0) {
  14469. hunk.newStart -= 1;
  14470. }
  14471. ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
  14472. ret.push.apply(ret, hunk.lines);
  14473. }
  14474. return ret.join("\n") + "\n";
  14475. }
  14476. function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14477. return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
  14478. }
  14479. function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
  14480. return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
  14481. }
  14482. }
  14483. });
  14484. var require_format = __commonJS2({
  14485. "src/cli/format.js"(exports2, module2) {
  14486. "use strict";
  14487. var {
  14488. promises: fs
  14489. } = require("fs");
  14490. var path = require("path");
  14491. var {
  14492. default: chalk2
  14493. } = (init_source(), __toCommonJS(source_exports));
  14494. var prettier2 = require("./index.js");
  14495. var {
  14496. getStdin
  14497. } = require("./third-party.js");
  14498. var {
  14499. createIgnorer,
  14500. errors
  14501. } = require_prettier_internal();
  14502. var {
  14503. expandPatterns,
  14504. fixWindowsSlashes
  14505. } = require_expand_patterns();
  14506. var getOptionsForFile = require_get_options_for_file();
  14507. var isTTY = require_is_tty();
  14508. var findCacheFile = require_find_cache_file();
  14509. var FormatResultsCache = require_format_results_cache();
  14510. var {
  14511. statSafe
  14512. } = require_utils();
  14513. function diff(a, b) {
  14514. return require_create().createTwoFilesPatch("", "", a, b, "", "", {
  14515. context: 2
  14516. });
  14517. }
  14518. function handleError(context, filename, error, printedFilename) {
  14519. if (error instanceof errors.UndefinedParserError) {
  14520. if ((context.argv.write || context.argv.ignoreUnknown) && printedFilename) {
  14521. printedFilename.clear();
  14522. }
  14523. if (context.argv.ignoreUnknown) {
  14524. return;
  14525. }
  14526. if (!context.argv.check && !context.argv.listDifferent) {
  14527. process.exitCode = 2;
  14528. }
  14529. context.logger.error(error.message);
  14530. return;
  14531. }
  14532. if (context.argv.write) {
  14533. process.stdout.write("\n");
  14534. }
  14535. const isParseError = Boolean(error && error.loc);
  14536. const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
  14537. if (isParseError) {
  14538. context.logger.error(`${filename}: ${String(error)}`);
  14539. } else if (isValidationError || error instanceof errors.ConfigError) {
  14540. context.logger.error(error.message);
  14541. process.exit(1);
  14542. } else if (error instanceof errors.DebugError) {
  14543. context.logger.error(`${filename}: ${error.message}`);
  14544. } else {
  14545. context.logger.error(filename + ": " + (error.stack || error));
  14546. }
  14547. process.exitCode = 2;
  14548. }
  14549. function writeOutput(context, result, options) {
  14550. process.stdout.write(context.argv.debugCheck ? result.filepath : result.formatted);
  14551. if (options && options.cursorOffset >= 0) {
  14552. process.stderr.write(result.cursorOffset + "\n");
  14553. }
  14554. }
  14555. function listDifferent(context, input, options, filename) {
  14556. if (!context.argv.check && !context.argv.listDifferent) {
  14557. return;
  14558. }
  14559. try {
  14560. if (!options.filepath && !options.parser) {
  14561. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14562. }
  14563. if (!prettier2.check(input, options)) {
  14564. if (!context.argv.write) {
  14565. context.logger.log(filename);
  14566. process.exitCode = 1;
  14567. }
  14568. }
  14569. } catch (error) {
  14570. context.logger.error(error.message);
  14571. }
  14572. return true;
  14573. }
  14574. function format(context, input, opt) {
  14575. if (!opt.parser && !opt.filepath) {
  14576. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14577. }
  14578. if (context.argv.debugPrintDoc) {
  14579. const doc = prettier2.__debug.printToDoc(input, opt);
  14580. return {
  14581. formatted: prettier2.__debug.formatDoc(doc) + "\n"
  14582. };
  14583. }
  14584. if (context.argv.debugPrintComments) {
  14585. return {
  14586. formatted: prettier2.format(JSON.stringify(prettier2.formatWithCursor(input, opt).comments || []), {
  14587. parser: "json"
  14588. })
  14589. };
  14590. }
  14591. if (context.argv.debugPrintAst) {
  14592. const {
  14593. ast
  14594. } = prettier2.__debug.parse(input, opt);
  14595. return {
  14596. formatted: JSON.stringify(ast)
  14597. };
  14598. }
  14599. if (context.argv.debugCheck) {
  14600. const pp = prettier2.format(input, opt);
  14601. const pppp = prettier2.format(pp, opt);
  14602. if (pp !== pppp) {
  14603. throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
  14604. } else {
  14605. const stringify2 = (obj) => JSON.stringify(obj, null, 2);
  14606. const ast = stringify2(prettier2.__debug.parse(input, opt, true).ast);
  14607. const past = stringify2(prettier2.__debug.parse(pp, opt, true).ast);
  14608. if (ast !== past) {
  14609. const MAX_AST_SIZE = 2097152;
  14610. const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
  14611. throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
  14612. }
  14613. }
  14614. return {
  14615. formatted: pp,
  14616. filepath: opt.filepath || "(stdin)\n"
  14617. };
  14618. }
  14619. const {
  14620. performanceTestFlag
  14621. } = context;
  14622. if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugBenchmark) {
  14623. let benchmark;
  14624. try {
  14625. benchmark = require("benchmark");
  14626. } catch {
  14627. context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
  14628. process.exit(2);
  14629. }
  14630. context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
  14631. const suite = new benchmark.Suite();
  14632. suite.add("format", () => {
  14633. prettier2.formatWithCursor(input, opt);
  14634. }).on("cycle", (event) => {
  14635. const results = {
  14636. benchmark: String(event.target),
  14637. hz: event.target.hz,
  14638. ms: event.target.times.cycle * 1e3
  14639. };
  14640. context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14641. }).run({
  14642. async: false
  14643. });
  14644. } else if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugRepeat) {
  14645. const repeat = context.argv.debugRepeat;
  14646. context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
  14647. let totalMs = 0;
  14648. for (let i = 0; i < repeat; ++i) {
  14649. const startMs = Date.now();
  14650. prettier2.formatWithCursor(input, opt);
  14651. totalMs += Date.now() - startMs;
  14652. }
  14653. const averageMs = totalMs / repeat;
  14654. const results = {
  14655. repeat,
  14656. hz: 1e3 / averageMs,
  14657. ms: averageMs
  14658. };
  14659. context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14660. }
  14661. return prettier2.formatWithCursor(input, opt);
  14662. }
  14663. async function createIgnorerFromContextOrDie(context) {
  14664. try {
  14665. return await createIgnorer(context.argv.ignorePath, context.argv.withNodeModules);
  14666. } catch (e) {
  14667. context.logger.error(e.message);
  14668. process.exit(2);
  14669. }
  14670. }
  14671. async function formatStdin2(context) {
  14672. const filepath = context.argv.filepath ? path.resolve(process.cwd(), context.argv.filepath) : process.cwd();
  14673. const ignorer = await createIgnorerFromContextOrDie(context);
  14674. const relativeFilepath = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filepath) : path.relative(process.cwd(), filepath);
  14675. try {
  14676. const input = await getStdin();
  14677. if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
  14678. writeOutput(context, {
  14679. formatted: input
  14680. });
  14681. return;
  14682. }
  14683. const options = await getOptionsForFile(context, filepath);
  14684. if (listDifferent(context, input, options, "(stdin)")) {
  14685. return;
  14686. }
  14687. const formatted = format(context, input, options);
  14688. const {
  14689. performanceTestFlag
  14690. } = context;
  14691. if (performanceTestFlag) {
  14692. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code to screen.`);
  14693. return;
  14694. }
  14695. writeOutput(context, formatted, options);
  14696. } catch (error) {
  14697. handleError(context, relativeFilepath || "stdin", error);
  14698. }
  14699. }
  14700. async function formatFiles2(context) {
  14701. var _formatResultsCache3;
  14702. const ignorer = await createIgnorerFromContextOrDie(context);
  14703. let numberOfUnformattedFilesFound = 0;
  14704. const {
  14705. performanceTestFlag
  14706. } = context;
  14707. if (context.argv.check && !performanceTestFlag) {
  14708. context.logger.log("Checking formatting...");
  14709. }
  14710. let formatResultsCache;
  14711. const cacheFilePath = findCacheFile();
  14712. if (context.argv.cache) {
  14713. formatResultsCache = new FormatResultsCache(cacheFilePath, context.argv.cacheStrategy || "content");
  14714. } else {
  14715. if (context.argv.cacheStrategy) {
  14716. context.logger.error("`--cache-strategy` cannot be used without `--cache`.");
  14717. process.exit(2);
  14718. }
  14719. const stat = await statSafe(cacheFilePath);
  14720. if (stat) {
  14721. await fs.unlink(cacheFilePath);
  14722. }
  14723. }
  14724. for await (const pathOrError of expandPatterns(context)) {
  14725. var _formatResultsCache, _formatResultsCache2;
  14726. if (typeof pathOrError === "object") {
  14727. context.logger.error(pathOrError.error);
  14728. process.exitCode = 2;
  14729. continue;
  14730. }
  14731. const filename = pathOrError;
  14732. const ignoreFilename = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filename) : filename;
  14733. const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
  14734. if (fileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) {
  14735. continue;
  14736. }
  14737. const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
  14738. filepath: filename
  14739. });
  14740. let printedFilename;
  14741. if (isTTY()) {
  14742. printedFilename = context.logger.log(filename, {
  14743. newline: false,
  14744. clearable: true
  14745. });
  14746. }
  14747. let input;
  14748. try {
  14749. input = await fs.readFile(filename, "utf8");
  14750. } catch (error) {
  14751. context.logger.log("");
  14752. context.logger.error(`Unable to read file: ${filename}
  14753. ${error.message}`);
  14754. process.exitCode = 2;
  14755. continue;
  14756. }
  14757. if (fileIgnored) {
  14758. writeOutput(context, {
  14759. formatted: input
  14760. }, options);
  14761. continue;
  14762. }
  14763. const start = Date.now();
  14764. const isCacheExists = (_formatResultsCache = formatResultsCache) === null || _formatResultsCache === void 0 ? void 0 : _formatResultsCache.existsAvailableFormatResultsCache(filename, options);
  14765. let result;
  14766. let output;
  14767. try {
  14768. if (isCacheExists) {
  14769. result = {
  14770. formatted: input
  14771. };
  14772. } else {
  14773. result = format(context, input, options);
  14774. }
  14775. output = result.formatted;
  14776. } catch (error) {
  14777. handleError(context, filename, error, printedFilename);
  14778. continue;
  14779. }
  14780. (_formatResultsCache2 = formatResultsCache) === null || _formatResultsCache2 === void 0 ? void 0 : _formatResultsCache2.setFormatResultsCache(filename, options);
  14781. const isDifferent = output !== input;
  14782. if (printedFilename) {
  14783. printedFilename.clear();
  14784. }
  14785. if (performanceTestFlag) {
  14786. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code or write files.`);
  14787. return;
  14788. }
  14789. if (context.argv.write) {
  14790. if (isDifferent) {
  14791. if (!context.argv.check && !context.argv.listDifferent) {
  14792. context.logger.log(`${filename} ${Date.now() - start}ms`);
  14793. }
  14794. try {
  14795. await fs.writeFile(filename, output, "utf8");
  14796. } catch (error) {
  14797. context.logger.error(`Unable to write file: ${filename}
  14798. ${error.message}`);
  14799. process.exitCode = 2;
  14800. }
  14801. } else if (!context.argv.check && !context.argv.listDifferent) {
  14802. const message = `${chalk2.grey(filename)} ${Date.now() - start}ms`;
  14803. if (isCacheExists) {
  14804. context.logger.log(`${message} (cached)`);
  14805. } else {
  14806. context.logger.log(message);
  14807. }
  14808. }
  14809. } else if (context.argv.debugCheck) {
  14810. if (result.filepath) {
  14811. context.logger.log(result.filepath);
  14812. } else {
  14813. process.exitCode = 2;
  14814. }
  14815. } else if (!context.argv.check && !context.argv.listDifferent) {
  14816. writeOutput(context, result, options);
  14817. }
  14818. if (isDifferent) {
  14819. if (context.argv.check) {
  14820. context.logger.warn(filename);
  14821. } else if (context.argv.listDifferent) {
  14822. context.logger.log(filename);
  14823. }
  14824. numberOfUnformattedFilesFound += 1;
  14825. }
  14826. }
  14827. (_formatResultsCache3 = formatResultsCache) === null || _formatResultsCache3 === void 0 ? void 0 : _formatResultsCache3.reconcile();
  14828. if (context.argv.check) {
  14829. if (numberOfUnformattedFilesFound === 0) {
  14830. context.logger.log("All matched files use Prettier code style!");
  14831. } else if (numberOfUnformattedFilesFound === 1) {
  14832. 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?");
  14833. } else {
  14834. context.logger.warn(context.argv.write ? "Code style issues found in " + numberOfUnformattedFilesFound + " files." : "Code style issues found in " + numberOfUnformattedFilesFound + " files. Forgot to run Prettier?");
  14835. }
  14836. }
  14837. if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
  14838. process.exitCode = 1;
  14839. }
  14840. }
  14841. module2.exports = {
  14842. formatStdin: formatStdin2,
  14843. formatFiles: formatFiles2
  14844. };
  14845. }
  14846. });
  14847. var require_file_info = __commonJS2({
  14848. "src/cli/file-info.js"(exports2, module2) {
  14849. "use strict";
  14850. var stringify2 = require_fast_json_stable_stringify();
  14851. var prettier2 = require("./index.js");
  14852. var {
  14853. printToScreen: printToScreen2
  14854. } = require_utils();
  14855. async function logFileInfoOrDie2(context) {
  14856. const {
  14857. fileInfo: file,
  14858. ignorePath,
  14859. withNodeModules,
  14860. plugins,
  14861. pluginSearchDirs,
  14862. config
  14863. } = context.argv;
  14864. const fileInfo = await prettier2.getFileInfo(file, {
  14865. ignorePath,
  14866. withNodeModules,
  14867. plugins,
  14868. pluginSearchDirs,
  14869. resolveConfig: config !== false
  14870. });
  14871. printToScreen2(prettier2.format(stringify2(fileInfo), {
  14872. parser: "json"
  14873. }));
  14874. }
  14875. module2.exports = logFileInfoOrDie2;
  14876. }
  14877. });
  14878. var require_find_config_path = __commonJS2({
  14879. "src/cli/find-config-path.js"(exports2, module2) {
  14880. "use strict";
  14881. var path = require("path");
  14882. var prettier2 = require("./index.js");
  14883. var {
  14884. printToScreen: printToScreen2
  14885. } = require_utils();
  14886. async function logResolvedConfigPathOrDie2(context) {
  14887. const file = context.argv.findConfigPath;
  14888. const configFile = await prettier2.resolveConfigFile(file);
  14889. if (configFile) {
  14890. printToScreen2(path.relative(process.cwd(), configFile));
  14891. } else {
  14892. throw new Error(`Can not find configure file for "${file}"`);
  14893. }
  14894. }
  14895. module2.exports = logResolvedConfigPathOrDie2;
  14896. }
  14897. });
  14898. var stringify = require_fast_json_stable_stringify();
  14899. var prettier = require("./index.js");
  14900. var createLogger = require_logger();
  14901. var Context = require_context();
  14902. var {
  14903. parseArgvWithoutPlugins
  14904. } = require_parse_cli_arguments();
  14905. var {
  14906. createDetailedUsage,
  14907. createUsage
  14908. } = require_usage();
  14909. var {
  14910. formatStdin,
  14911. formatFiles
  14912. } = require_format();
  14913. var logFileInfoOrDie = require_file_info();
  14914. var logResolvedConfigPathOrDie = require_find_config_path();
  14915. var {
  14916. utils: {
  14917. isNonEmptyArray
  14918. }
  14919. } = require_prettier_internal();
  14920. var {
  14921. printToScreen
  14922. } = require_utils();
  14923. async function run(rawArguments) {
  14924. let logger = createLogger();
  14925. try {
  14926. const logLevel = parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
  14927. if (logLevel !== logger.logLevel) {
  14928. logger = createLogger(logLevel);
  14929. }
  14930. const context = new Context({
  14931. rawArguments,
  14932. logger
  14933. });
  14934. if (logger.logLevel !== "debug" && context.performanceTestFlag) {
  14935. context.logger = createLogger("debug");
  14936. }
  14937. await main(context);
  14938. } catch (error) {
  14939. logger.error(error.message);
  14940. process.exitCode = 1;
  14941. }
  14942. }
  14943. async function main(context) {
  14944. context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
  14945. if (context.argv.pluginSearch === false) {
  14946. const rawPluginSearchDirs = context.argv.__raw["plugin-search-dir"];
  14947. if (typeof rawPluginSearchDirs === "string" || isNonEmptyArray(rawPluginSearchDirs)) {
  14948. throw new Error("Cannot use --no-plugin-search and --plugin-search-dir together.");
  14949. }
  14950. }
  14951. if (context.argv.check && context.argv.listDifferent) {
  14952. throw new Error("Cannot use --check and --list-different together.");
  14953. }
  14954. if (context.argv.write && context.argv.debugCheck) {
  14955. throw new Error("Cannot use --write and --debug-check together.");
  14956. }
  14957. if (context.argv.findConfigPath && context.filePatterns.length > 0) {
  14958. throw new Error("Cannot use --find-config-path with multiple files");
  14959. }
  14960. if (context.argv.fileInfo && context.filePatterns.length > 0) {
  14961. throw new Error("Cannot use --file-info with multiple files");
  14962. }
  14963. if (context.argv.version) {
  14964. printToScreen(prettier.version);
  14965. return;
  14966. }
  14967. if (context.argv.help !== void 0) {
  14968. printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
  14969. return;
  14970. }
  14971. if (context.argv.supportInfo) {
  14972. printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
  14973. parser: "json"
  14974. }));
  14975. return;
  14976. }
  14977. const hasFilePatterns = context.filePatterns.length > 0;
  14978. const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filePath);
  14979. if (context.argv.findConfigPath) {
  14980. await logResolvedConfigPathOrDie(context);
  14981. } else if (context.argv.fileInfo) {
  14982. await logFileInfoOrDie(context);
  14983. } else if (useStdin) {
  14984. if (context.argv.cache) {
  14985. context.logger.error("`--cache` cannot be used with stdin.");
  14986. process.exit(2);
  14987. }
  14988. await formatStdin(context);
  14989. } else if (hasFilePatterns) {
  14990. await formatFiles(context);
  14991. } else {
  14992. process.exitCode = 1;
  14993. printToScreen(createUsage(context));
  14994. }
  14995. }
  14996. module.exports = {
  14997. run
  14998. };