cli.js 490 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136
  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. chalkStderr: chalkStderr2
  2323. } = (init_source(), __toCommonJS(source_exports));
  2324. var countLines = (stream, text) => {
  2325. const columns = stream.columns || 80;
  2326. let lineCount = 0;
  2327. for (const line of stripAnsi2(text).split("\n")) {
  2328. lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
  2329. }
  2330. return lineCount;
  2331. };
  2332. var clear = (stream, text) => () => {
  2333. const lineCount = countLines(stream, text);
  2334. for (let line = 0; line < lineCount; line++) {
  2335. if (line > 0) {
  2336. readline.moveCursor(stream, 0, -1);
  2337. }
  2338. readline.clearLine(stream, 0);
  2339. readline.cursorTo(stream, 0);
  2340. }
  2341. };
  2342. var emptyLogResult = {
  2343. clear() {
  2344. }
  2345. };
  2346. function createLogger2(logLevel = "log") {
  2347. return {
  2348. logLevel,
  2349. warn: createLogFunc("warn", "yellow"),
  2350. error: createLogFunc("error", "red"),
  2351. debug: createLogFunc("debug", "blue"),
  2352. log: createLogFunc("log")
  2353. };
  2354. function createLogFunc(loggerName, color) {
  2355. if (!shouldLog(loggerName)) {
  2356. return () => emptyLogResult;
  2357. }
  2358. const stream = process[loggerName === "log" ? "stdout" : "stderr"];
  2359. const chalkInstance = loggerName === "log" ? chalk2 : chalkStderr2;
  2360. const prefix = color ? `[${chalkInstance[color](loggerName)}] ` : "";
  2361. return (message, options) => {
  2362. options = Object.assign({
  2363. newline: true,
  2364. clearable: false
  2365. }, options);
  2366. message = message.replace(/^/gm, prefix) + (options.newline ? "\n" : "");
  2367. stream.write(message);
  2368. if (options.clearable) {
  2369. return {
  2370. clear: clear(stream, message)
  2371. };
  2372. }
  2373. };
  2374. }
  2375. function shouldLog(loggerName) {
  2376. switch (logLevel) {
  2377. case "silent":
  2378. return false;
  2379. case "debug":
  2380. if (loggerName === "debug") {
  2381. return true;
  2382. }
  2383. case "log":
  2384. if (loggerName === "log") {
  2385. return true;
  2386. }
  2387. case "warn":
  2388. if (loggerName === "warn") {
  2389. return true;
  2390. }
  2391. case "error":
  2392. return loggerName === "error";
  2393. }
  2394. }
  2395. }
  2396. module2.exports = createLogger2;
  2397. }
  2398. });
  2399. var require_prettier_internal = __commonJS2({
  2400. "src/cli/prettier-internal.js"(exports2, module2) {
  2401. "use strict";
  2402. module2.exports = require("./index.js").__internal;
  2403. }
  2404. });
  2405. var require_lib = __commonJS2({
  2406. "node_modules/outdent/lib/index.js"(exports2, module2) {
  2407. "use strict";
  2408. Object.defineProperty(exports2, "__esModule", {
  2409. value: true
  2410. });
  2411. exports2.outdent = void 0;
  2412. function noop() {
  2413. var args = [];
  2414. for (var _i = 0; _i < arguments.length; _i++) {
  2415. args[_i] = arguments[_i];
  2416. }
  2417. }
  2418. function createWeakMap() {
  2419. if (typeof WeakMap !== "undefined") {
  2420. return /* @__PURE__ */ new WeakMap();
  2421. } else {
  2422. return fakeSetOrMap();
  2423. }
  2424. }
  2425. function fakeSetOrMap() {
  2426. return {
  2427. add: noop,
  2428. delete: noop,
  2429. get: noop,
  2430. set: noop,
  2431. has: function(k) {
  2432. return false;
  2433. }
  2434. };
  2435. }
  2436. var hop = Object.prototype.hasOwnProperty;
  2437. var has = function(obj, prop) {
  2438. return hop.call(obj, prop);
  2439. };
  2440. function extend(target, source) {
  2441. for (var prop in source) {
  2442. if (has(source, prop)) {
  2443. target[prop] = source[prop];
  2444. }
  2445. }
  2446. return target;
  2447. }
  2448. var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
  2449. var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
  2450. var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
  2451. var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
  2452. var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
  2453. function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
  2454. var indentationLevel = 0;
  2455. var match = strings[0].match(reDetectIndentation);
  2456. if (match) {
  2457. indentationLevel = match[1].length;
  2458. }
  2459. var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
  2460. var reMatchIndent = new RegExp(reSource, "g");
  2461. if (firstInterpolatedValueSetsIndentationLevel) {
  2462. strings = strings.slice(1);
  2463. }
  2464. var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
  2465. var normalizeNewlines = typeof newline === "string";
  2466. var l = strings.length;
  2467. var outdentedStrings = strings.map(function(v, i) {
  2468. v = v.replace(reMatchIndent, "$1");
  2469. if (i === 0 && trimLeadingNewline) {
  2470. v = v.replace(reLeadingNewline, "");
  2471. }
  2472. if (i === l - 1 && trimTrailingNewline) {
  2473. v = v.replace(reTrailingNewline, "");
  2474. }
  2475. if (normalizeNewlines) {
  2476. v = v.replace(/\r\n|\n|\r/g, function(_) {
  2477. return newline;
  2478. });
  2479. }
  2480. return v;
  2481. });
  2482. return outdentedStrings;
  2483. }
  2484. function concatStringsAndValues(strings, values) {
  2485. var ret = "";
  2486. for (var i = 0, l = strings.length; i < l; i++) {
  2487. ret += strings[i];
  2488. if (i < l - 1) {
  2489. ret += values[i];
  2490. }
  2491. }
  2492. return ret;
  2493. }
  2494. function isTemplateStringsArray(v) {
  2495. return has(v, "raw") && has(v, "length");
  2496. }
  2497. function createInstance(options) {
  2498. var arrayAutoIndentCache = createWeakMap();
  2499. var arrayFirstInterpSetsIndentCache = createWeakMap();
  2500. function outdent(stringsOrOptions) {
  2501. var values = [];
  2502. for (var _i = 1; _i < arguments.length; _i++) {
  2503. values[_i - 1] = arguments[_i];
  2504. }
  2505. if (isTemplateStringsArray(stringsOrOptions)) {
  2506. var strings = stringsOrOptions;
  2507. var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
  2508. var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
  2509. var renderedArray = cache.get(strings);
  2510. if (!renderedArray) {
  2511. renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
  2512. cache.set(strings, renderedArray);
  2513. }
  2514. if (values.length === 0) {
  2515. return renderedArray[0];
  2516. }
  2517. var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
  2518. return rendered;
  2519. } else {
  2520. return createInstance(extend(extend({}, options), stringsOrOptions || {}));
  2521. }
  2522. }
  2523. var fullOutdent = extend(outdent, {
  2524. string: function(str) {
  2525. return _outdentArray([str], false, options)[0];
  2526. }
  2527. });
  2528. return fullOutdent;
  2529. }
  2530. var defaultOutdent = createInstance({
  2531. trimLeadingNewline: true,
  2532. trimTrailingNewline: true
  2533. });
  2534. exports2.outdent = defaultOutdent;
  2535. exports2.default = defaultOutdent;
  2536. if (typeof module2 !== "undefined") {
  2537. try {
  2538. module2.exports = defaultOutdent;
  2539. Object.defineProperty(defaultOutdent, "__esModule", {
  2540. value: true
  2541. });
  2542. defaultOutdent.default = defaultOutdent;
  2543. defaultOutdent.outdent = defaultOutdent;
  2544. } catch (e) {
  2545. }
  2546. }
  2547. }
  2548. });
  2549. var require_constant = __commonJS2({
  2550. "src/cli/constant.js"(exports2, module2) {
  2551. "use strict";
  2552. var {
  2553. outdent
  2554. } = require_lib();
  2555. var {
  2556. coreOptions
  2557. } = require_prettier_internal();
  2558. var categoryOrder = [coreOptions.CATEGORY_OUTPUT, coreOptions.CATEGORY_FORMAT, coreOptions.CATEGORY_CONFIG, coreOptions.CATEGORY_EDITOR, coreOptions.CATEGORY_OTHER];
  2559. var options = {
  2560. cache: {
  2561. default: false,
  2562. description: "Only format changed files. Cannot use with --stdin-filepath.",
  2563. type: "boolean"
  2564. },
  2565. "cache-location": {
  2566. description: "Path to the cache file.",
  2567. type: "path"
  2568. },
  2569. "cache-strategy": {
  2570. choices: [{
  2571. description: "Use the file metadata such as timestamps as cache keys",
  2572. value: "metadata"
  2573. }, {
  2574. description: "Use the file content as cache keys",
  2575. value: "content"
  2576. }],
  2577. description: "Strategy for the cache to use for detecting changed files.",
  2578. type: "choice"
  2579. },
  2580. check: {
  2581. alias: "c",
  2582. category: coreOptions.CATEGORY_OUTPUT,
  2583. description: outdent`
  2584. Check if the given files are formatted, print a human-friendly summary
  2585. message and paths to unformatted files (see also --list-different).
  2586. `,
  2587. type: "boolean"
  2588. },
  2589. color: {
  2590. default: true,
  2591. description: "Colorize error messages.",
  2592. oppositeDescription: "Do not colorize error messages.",
  2593. type: "boolean"
  2594. },
  2595. config: {
  2596. category: coreOptions.CATEGORY_CONFIG,
  2597. description: "Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).",
  2598. exception: (value) => value === false,
  2599. oppositeDescription: "Do not look for a configuration file.",
  2600. type: "path"
  2601. },
  2602. "config-precedence": {
  2603. category: coreOptions.CATEGORY_CONFIG,
  2604. choices: [{
  2605. description: "CLI options take precedence over config file",
  2606. value: "cli-override"
  2607. }, {
  2608. description: "Config file take precedence over CLI options",
  2609. value: "file-override"
  2610. }, {
  2611. description: outdent`
  2612. If a config file is found will evaluate it and ignore other CLI options.
  2613. If no config file is found CLI options will evaluate as normal.
  2614. `,
  2615. value: "prefer-file"
  2616. }],
  2617. default: "cli-override",
  2618. description: "Define in which order config files and CLI options should be evaluated.",
  2619. type: "choice"
  2620. },
  2621. "debug-benchmark": {
  2622. type: "boolean"
  2623. },
  2624. "debug-check": {
  2625. type: "boolean"
  2626. },
  2627. "debug-print-ast": {
  2628. type: "boolean"
  2629. },
  2630. "debug-print-comments": {
  2631. type: "boolean"
  2632. },
  2633. "debug-print-doc": {
  2634. type: "boolean"
  2635. },
  2636. "debug-repeat": {
  2637. default: 0,
  2638. type: "int"
  2639. },
  2640. editorconfig: {
  2641. category: coreOptions.CATEGORY_CONFIG,
  2642. default: true,
  2643. description: "Take .editorconfig into account when parsing configuration.",
  2644. oppositeDescription: "Don't take .editorconfig into account when parsing configuration.",
  2645. type: "boolean"
  2646. },
  2647. "error-on-unmatched-pattern": {
  2648. oppositeDescription: "Prevent errors when pattern is unmatched.",
  2649. type: "boolean"
  2650. },
  2651. "file-info": {
  2652. description: outdent`
  2653. Extract the following info (as JSON) for a given file path. Reported fields:
  2654. * ignored (boolean) - true if file path is filtered by --ignore-path
  2655. * inferredParser (string | null) - name of parser inferred from file path
  2656. `,
  2657. type: "path"
  2658. },
  2659. "find-config-path": {
  2660. category: coreOptions.CATEGORY_CONFIG,
  2661. description: "Find and print the path to a configuration file for the given input file.",
  2662. type: "path"
  2663. },
  2664. help: {
  2665. alias: "h",
  2666. description: outdent`
  2667. Show CLI usage, or details about the given flag.
  2668. Example: --help write
  2669. `,
  2670. exception: (value) => value === "",
  2671. type: "flag"
  2672. },
  2673. "ignore-path": {
  2674. category: coreOptions.CATEGORY_CONFIG,
  2675. default: ".prettierignore",
  2676. description: "Path to a file with patterns describing files to ignore.",
  2677. type: "path"
  2678. },
  2679. "ignore-unknown": {
  2680. alias: "u",
  2681. description: "Ignore unknown files.",
  2682. type: "boolean"
  2683. },
  2684. "list-different": {
  2685. alias: "l",
  2686. category: coreOptions.CATEGORY_OUTPUT,
  2687. description: "Print the names of files that are different from Prettier's formatting (see also --check).",
  2688. type: "boolean"
  2689. },
  2690. loglevel: {
  2691. choices: ["silent", "error", "warn", "log", "debug"],
  2692. default: "log",
  2693. description: "What level of logs to report.",
  2694. type: "choice"
  2695. },
  2696. "plugin-search": {
  2697. oppositeDescription: "Disable plugin autoloading.",
  2698. type: "boolean"
  2699. },
  2700. "support-info": {
  2701. description: "Print support information as JSON.",
  2702. type: "boolean"
  2703. },
  2704. version: {
  2705. alias: "v",
  2706. description: "Print Prettier version.",
  2707. type: "boolean"
  2708. },
  2709. "with-node-modules": {
  2710. category: coreOptions.CATEGORY_CONFIG,
  2711. description: "Process files inside 'node_modules' directory.",
  2712. type: "boolean"
  2713. },
  2714. write: {
  2715. alias: "w",
  2716. category: coreOptions.CATEGORY_OUTPUT,
  2717. description: "Edit files in-place. (Beware!)",
  2718. type: "boolean"
  2719. }
  2720. };
  2721. var usageSummary = outdent`
  2722. Usage: prettier [options] [file/dir/glob ...]
  2723. By default, output is written to stdout.
  2724. Stdin is read if it is piped to Prettier and no files are given.
  2725. `;
  2726. module2.exports = {
  2727. categoryOrder,
  2728. options,
  2729. usageSummary
  2730. };
  2731. }
  2732. });
  2733. var require_dashify = __commonJS2({
  2734. "node_modules/dashify/index.js"(exports2, module2) {
  2735. "use strict";
  2736. module2.exports = (str, options) => {
  2737. if (typeof str !== "string")
  2738. throw new TypeError("expected a string");
  2739. 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();
  2740. };
  2741. }
  2742. });
  2743. var require_option_map = __commonJS2({
  2744. "src/cli/options/option-map.js"(exports2, module2) {
  2745. "use strict";
  2746. var dashify = require_dashify();
  2747. var {
  2748. coreOptions
  2749. } = require_prettier_internal();
  2750. function normalizeDetailedOption(name, option) {
  2751. return Object.assign(Object.assign({
  2752. category: coreOptions.CATEGORY_OTHER
  2753. }, option), {}, {
  2754. choices: option.choices && option.choices.map((choice) => {
  2755. const newChoice = Object.assign({
  2756. description: "",
  2757. deprecated: false
  2758. }, typeof choice === "object" ? choice : {
  2759. value: choice
  2760. });
  2761. if (newChoice.value === true) {
  2762. newChoice.value = "";
  2763. }
  2764. return newChoice;
  2765. })
  2766. });
  2767. }
  2768. function normalizeDetailedOptionMap(detailedOptionMap) {
  2769. return Object.fromEntries(Object.entries(detailedOptionMap).sort(([leftName], [rightName]) => leftName.localeCompare(rightName)).map(([name, option]) => [name, normalizeDetailedOption(name, option)]));
  2770. }
  2771. function createDetailedOptionMap(supportOptions) {
  2772. return Object.fromEntries(supportOptions.map((option) => {
  2773. const newOption = Object.assign(Object.assign({}, option), {}, {
  2774. name: option.cliName || dashify(option.name),
  2775. description: option.cliDescription || option.description,
  2776. category: option.cliCategory || coreOptions.CATEGORY_FORMAT,
  2777. forwardToApi: option.name
  2778. });
  2779. if (option.deprecated) {
  2780. delete newOption.forwardToApi;
  2781. delete newOption.description;
  2782. delete newOption.oppositeDescription;
  2783. newOption.deprecated = true;
  2784. }
  2785. return [newOption.name, newOption];
  2786. }));
  2787. }
  2788. module2.exports = {
  2789. normalizeDetailedOptionMap,
  2790. createDetailedOptionMap
  2791. };
  2792. }
  2793. });
  2794. var require_get_context_options = __commonJS2({
  2795. "src/cli/options/get-context-options.js"(exports2, module2) {
  2796. "use strict";
  2797. var prettier2 = require("./index.js");
  2798. var {
  2799. optionsModule,
  2800. utils: {
  2801. arrayify
  2802. }
  2803. } = require_prettier_internal();
  2804. var constant = require_constant();
  2805. var {
  2806. normalizeDetailedOptionMap,
  2807. createDetailedOptionMap
  2808. } = require_option_map();
  2809. function getContextOptions(plugins, pluginSearchDirs) {
  2810. const {
  2811. options: supportOptions,
  2812. languages
  2813. } = prettier2.getSupportInfo({
  2814. showDeprecated: true,
  2815. showUnreleased: true,
  2816. showInternal: true,
  2817. plugins,
  2818. pluginSearchDirs
  2819. });
  2820. const detailedOptionMap = normalizeDetailedOptionMap(Object.assign(Object.assign({}, createDetailedOptionMap(supportOptions)), constant.options));
  2821. const detailedOptions = arrayify(detailedOptionMap, "name");
  2822. const apiDefaultOptions = Object.assign(Object.assign({}, optionsModule.hiddenDefaults), Object.fromEntries(supportOptions.filter(({
  2823. deprecated
  2824. }) => !deprecated).map((option) => [option.name, option.default])));
  2825. return {
  2826. supportOptions,
  2827. detailedOptions,
  2828. detailedOptionMap,
  2829. apiDefaultOptions,
  2830. languages
  2831. };
  2832. }
  2833. module2.exports = getContextOptions;
  2834. }
  2835. });
  2836. var require_camelcase = __commonJS2({
  2837. "node_modules/camelcase/index.js"(exports2, module2) {
  2838. "use strict";
  2839. var UPPERCASE = /[\p{Lu}]/u;
  2840. var LOWERCASE = /[\p{Ll}]/u;
  2841. var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
  2842. var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
  2843. var SEPARATORS = /[_.\- ]+/;
  2844. var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
  2845. var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
  2846. var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
  2847. var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
  2848. let isLastCharLower = false;
  2849. let isLastCharUpper = false;
  2850. let isLastLastCharUpper = false;
  2851. for (let i = 0; i < string.length; i++) {
  2852. const character = string[i];
  2853. if (isLastCharLower && UPPERCASE.test(character)) {
  2854. string = string.slice(0, i) + "-" + string.slice(i);
  2855. isLastCharLower = false;
  2856. isLastLastCharUpper = isLastCharUpper;
  2857. isLastCharUpper = true;
  2858. i++;
  2859. } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
  2860. string = string.slice(0, i - 1) + "-" + string.slice(i - 1);
  2861. isLastLastCharUpper = isLastCharUpper;
  2862. isLastCharUpper = false;
  2863. isLastCharLower = true;
  2864. } else {
  2865. isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
  2866. isLastLastCharUpper = isLastCharUpper;
  2867. isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
  2868. }
  2869. }
  2870. return string;
  2871. };
  2872. var preserveConsecutiveUppercase = (input, toLowerCase) => {
  2873. LEADING_CAPITAL.lastIndex = 0;
  2874. return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
  2875. };
  2876. var postProcess = (input, toUpperCase) => {
  2877. SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
  2878. NUMBERS_AND_IDENTIFIER.lastIndex = 0;
  2879. return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
  2880. };
  2881. var camelCase = (input, options) => {
  2882. if (!(typeof input === "string" || Array.isArray(input))) {
  2883. throw new TypeError("Expected the input to be `string | string[]`");
  2884. }
  2885. options = Object.assign({
  2886. pascalCase: false,
  2887. preserveConsecutiveUppercase: false
  2888. }, options);
  2889. if (Array.isArray(input)) {
  2890. input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
  2891. } else {
  2892. input = input.trim();
  2893. }
  2894. if (input.length === 0) {
  2895. return "";
  2896. }
  2897. const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
  2898. const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
  2899. if (input.length === 1) {
  2900. return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
  2901. }
  2902. const hasUpperCase = input !== toLowerCase(input);
  2903. if (hasUpperCase) {
  2904. input = preserveCamelCase(input, toLowerCase, toUpperCase);
  2905. }
  2906. input = input.replace(LEADING_SEPARATORS, "");
  2907. if (options.preserveConsecutiveUppercase) {
  2908. input = preserveConsecutiveUppercase(input, toLowerCase);
  2909. } else {
  2910. input = toLowerCase(input);
  2911. }
  2912. if (options.pascalCase) {
  2913. input = toUpperCase(input.charAt(0)) + input.slice(1);
  2914. }
  2915. return postProcess(input, toUpperCase);
  2916. };
  2917. module2.exports = camelCase;
  2918. module2.exports.default = camelCase;
  2919. }
  2920. });
  2921. var sdbm_exports = {};
  2922. __export(sdbm_exports, {
  2923. default: () => sdbm
  2924. });
  2925. function sdbm(string) {
  2926. let hash = 0;
  2927. for (let i = 0; i < string.length; i++) {
  2928. hash = string.charCodeAt(i) + (hash << 6) + (hash << 16) - hash;
  2929. }
  2930. return hash >>> 0;
  2931. }
  2932. var init_sdbm = __esm({
  2933. "node_modules/sdbm/index.js"() {
  2934. }
  2935. });
  2936. var require_utils = __commonJS2({
  2937. "src/cli/utils.js"(exports2, module2) {
  2938. "use strict";
  2939. var {
  2940. promises: fs
  2941. } = require("fs");
  2942. var {
  2943. default: sdbm2
  2944. } = (init_sdbm(), __toCommonJS(sdbm_exports));
  2945. var printToScreen2 = console.log.bind(console);
  2946. function groupBy(array2, iteratee) {
  2947. const result = /* @__PURE__ */ Object.create(null);
  2948. for (const value of array2) {
  2949. const key = iteratee(value);
  2950. if (Array.isArray(result[key])) {
  2951. result[key].push(value);
  2952. } else {
  2953. result[key] = [value];
  2954. }
  2955. }
  2956. return result;
  2957. }
  2958. function pick(object, keys) {
  2959. const entries = keys.map((key) => [key, object[key]]);
  2960. return Object.fromEntries(entries);
  2961. }
  2962. function createHash(source) {
  2963. return String(sdbm2(source));
  2964. }
  2965. async function statSafe(filePath) {
  2966. try {
  2967. return await fs.stat(filePath);
  2968. } catch (error) {
  2969. if (error.code !== "ENOENT") {
  2970. throw error;
  2971. }
  2972. }
  2973. }
  2974. function isJson(value) {
  2975. try {
  2976. JSON.parse(value);
  2977. return true;
  2978. } catch {
  2979. return false;
  2980. }
  2981. }
  2982. module2.exports = {
  2983. printToScreen: printToScreen2,
  2984. groupBy,
  2985. pick,
  2986. createHash,
  2987. statSafe,
  2988. isJson
  2989. };
  2990. }
  2991. });
  2992. var require_minimist = __commonJS2({
  2993. "node_modules/minimist/index.js"(exports2, module2) {
  2994. module2.exports = function(args, opts) {
  2995. if (!opts)
  2996. opts = {};
  2997. var flags = {
  2998. bools: {},
  2999. strings: {},
  3000. unknownFn: null
  3001. };
  3002. if (typeof opts["unknown"] === "function") {
  3003. flags.unknownFn = opts["unknown"];
  3004. }
  3005. if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
  3006. flags.allBools = true;
  3007. } else {
  3008. [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
  3009. flags.bools[key2] = true;
  3010. });
  3011. }
  3012. var aliases = {};
  3013. Object.keys(opts.alias || {}).forEach(function(key2) {
  3014. aliases[key2] = [].concat(opts.alias[key2]);
  3015. aliases[key2].forEach(function(x) {
  3016. aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
  3017. return x !== y;
  3018. }));
  3019. });
  3020. });
  3021. [].concat(opts.string).filter(Boolean).forEach(function(key2) {
  3022. flags.strings[key2] = true;
  3023. if (aliases[key2]) {
  3024. flags.strings[aliases[key2]] = true;
  3025. }
  3026. });
  3027. var defaults = opts["default"] || {};
  3028. var argv = {
  3029. _: []
  3030. };
  3031. Object.keys(flags.bools).forEach(function(key2) {
  3032. setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
  3033. });
  3034. var notFlags = [];
  3035. if (args.indexOf("--") !== -1) {
  3036. notFlags = args.slice(args.indexOf("--") + 1);
  3037. args = args.slice(0, args.indexOf("--"));
  3038. }
  3039. function argDefined(key2, arg2) {
  3040. return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
  3041. }
  3042. function setArg(key2, val, arg2) {
  3043. if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
  3044. if (flags.unknownFn(arg2) === false)
  3045. return;
  3046. }
  3047. var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
  3048. setKey(argv, key2.split("."), value2);
  3049. (aliases[key2] || []).forEach(function(x) {
  3050. setKey(argv, x.split("."), value2);
  3051. });
  3052. }
  3053. function setKey(obj, keys, value2) {
  3054. var o = obj;
  3055. for (var i2 = 0; i2 < keys.length - 1; i2++) {
  3056. var key2 = keys[i2];
  3057. if (isConstructorOrProto(o, key2))
  3058. return;
  3059. if (o[key2] === void 0)
  3060. o[key2] = {};
  3061. if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
  3062. o[key2] = {};
  3063. if (o[key2] === Array.prototype)
  3064. o[key2] = [];
  3065. o = o[key2];
  3066. }
  3067. var key2 = keys[keys.length - 1];
  3068. if (isConstructorOrProto(o, key2))
  3069. return;
  3070. if (o === Object.prototype || o === Number.prototype || o === String.prototype)
  3071. o = {};
  3072. if (o === Array.prototype)
  3073. o = [];
  3074. if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
  3075. o[key2] = value2;
  3076. } else if (Array.isArray(o[key2])) {
  3077. o[key2].push(value2);
  3078. } else {
  3079. o[key2] = [o[key2], value2];
  3080. }
  3081. }
  3082. function aliasIsBoolean(key2) {
  3083. return aliases[key2].some(function(x) {
  3084. return flags.bools[x];
  3085. });
  3086. }
  3087. for (var i = 0; i < args.length; i++) {
  3088. var arg = args[i];
  3089. if (/^--.+=/.test(arg)) {
  3090. var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
  3091. var key = m[1];
  3092. var value = m[2];
  3093. if (flags.bools[key]) {
  3094. value = value !== "false";
  3095. }
  3096. setArg(key, value, arg);
  3097. } else if (/^--no-.+/.test(arg)) {
  3098. var key = arg.match(/^--no-(.+)/)[1];
  3099. setArg(key, false, arg);
  3100. } else if (/^--.+/.test(arg)) {
  3101. var key = arg.match(/^--(.+)/)[1];
  3102. var next = args[i + 1];
  3103. if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3104. setArg(key, next, arg);
  3105. i++;
  3106. } else if (/^(true|false)$/.test(next)) {
  3107. setArg(key, next === "true", arg);
  3108. i++;
  3109. } else {
  3110. setArg(key, flags.strings[key] ? "" : true, arg);
  3111. }
  3112. } else if (/^-[^-]+/.test(arg)) {
  3113. var letters = arg.slice(1, -1).split("");
  3114. var broken = false;
  3115. for (var j = 0; j < letters.length; j++) {
  3116. var next = arg.slice(j + 2);
  3117. if (next === "-") {
  3118. setArg(letters[j], next, arg);
  3119. continue;
  3120. }
  3121. if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
  3122. setArg(letters[j], next.split("=")[1], arg);
  3123. broken = true;
  3124. break;
  3125. }
  3126. if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
  3127. setArg(letters[j], next, arg);
  3128. broken = true;
  3129. break;
  3130. }
  3131. if (letters[j + 1] && letters[j + 1].match(/\W/)) {
  3132. setArg(letters[j], arg.slice(j + 2), arg);
  3133. broken = true;
  3134. break;
  3135. } else {
  3136. setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
  3137. }
  3138. }
  3139. var key = arg.slice(-1)[0];
  3140. if (!broken && key !== "-") {
  3141. if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
  3142. setArg(key, args[i + 1], arg);
  3143. i++;
  3144. } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
  3145. setArg(key, args[i + 1] === "true", arg);
  3146. i++;
  3147. } else {
  3148. setArg(key, flags.strings[key] ? "" : true, arg);
  3149. }
  3150. }
  3151. } else {
  3152. if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
  3153. argv._.push(flags.strings["_"] || !isNumber(arg) ? arg : Number(arg));
  3154. }
  3155. if (opts.stopEarly) {
  3156. argv._.push.apply(argv._, args.slice(i + 1));
  3157. break;
  3158. }
  3159. }
  3160. }
  3161. Object.keys(defaults).forEach(function(key2) {
  3162. if (!hasKey(argv, key2.split("."))) {
  3163. setKey(argv, key2.split("."), defaults[key2]);
  3164. (aliases[key2] || []).forEach(function(x) {
  3165. setKey(argv, x.split("."), defaults[key2]);
  3166. });
  3167. }
  3168. });
  3169. if (opts["--"]) {
  3170. argv["--"] = new Array();
  3171. notFlags.forEach(function(key2) {
  3172. argv["--"].push(key2);
  3173. });
  3174. } else {
  3175. notFlags.forEach(function(key2) {
  3176. argv._.push(key2);
  3177. });
  3178. }
  3179. return argv;
  3180. };
  3181. function hasKey(obj, keys) {
  3182. var o = obj;
  3183. keys.slice(0, -1).forEach(function(key2) {
  3184. o = o[key2] || {};
  3185. });
  3186. var key = keys[keys.length - 1];
  3187. return key in o;
  3188. }
  3189. function isNumber(x) {
  3190. if (typeof x === "number")
  3191. return true;
  3192. if (/^0x[0-9a-f]+$/i.test(x))
  3193. return true;
  3194. return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
  3195. }
  3196. function isConstructorOrProto(obj, key) {
  3197. return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
  3198. }
  3199. }
  3200. });
  3201. var require_minimist2 = __commonJS2({
  3202. "src/cli/options/minimist.js"(exports2, module2) {
  3203. "use strict";
  3204. var minimist = require_minimist();
  3205. var PLACEHOLDER = null;
  3206. module2.exports = function(args, options) {
  3207. const boolean = options.boolean || [];
  3208. const defaults = options.default || {};
  3209. const booleanWithoutDefault = boolean.filter((key) => !(key in defaults));
  3210. const newDefaults = Object.assign(Object.assign({}, defaults), Object.fromEntries(booleanWithoutDefault.map((key) => [key, PLACEHOLDER])));
  3211. const parsed = minimist(args, Object.assign(Object.assign({}, options), {}, {
  3212. default: newDefaults
  3213. }));
  3214. return Object.fromEntries(Object.entries(parsed).filter(([, value]) => value !== PLACEHOLDER));
  3215. };
  3216. }
  3217. });
  3218. var require_create_minimist_options = __commonJS2({
  3219. "src/cli/options/create-minimist-options.js"(exports2, module2) {
  3220. "use strict";
  3221. var {
  3222. utils: {
  3223. partition
  3224. }
  3225. } = require_prettier_internal();
  3226. module2.exports = function createMinimistOptions(detailedOptions) {
  3227. const [boolean, string] = partition(detailedOptions, ({
  3228. type
  3229. }) => type === "boolean").map((detailedOptions2) => detailedOptions2.flatMap(({
  3230. name,
  3231. alias
  3232. }) => alias ? [name, alias] : [name]));
  3233. 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]));
  3234. return {
  3235. alias: {},
  3236. boolean,
  3237. string,
  3238. default: defaults
  3239. };
  3240. };
  3241. }
  3242. });
  3243. var leven_exports = {};
  3244. __export(leven_exports, {
  3245. default: () => leven
  3246. });
  3247. function leven(first, second) {
  3248. if (first === second) {
  3249. return 0;
  3250. }
  3251. const swap = first;
  3252. if (first.length > second.length) {
  3253. first = second;
  3254. second = swap;
  3255. }
  3256. let firstLength = first.length;
  3257. let secondLength = second.length;
  3258. while (firstLength > 0 && first.charCodeAt(~-firstLength) === second.charCodeAt(~-secondLength)) {
  3259. firstLength--;
  3260. secondLength--;
  3261. }
  3262. let start = 0;
  3263. while (start < firstLength && first.charCodeAt(start) === second.charCodeAt(start)) {
  3264. start++;
  3265. }
  3266. firstLength -= start;
  3267. secondLength -= start;
  3268. if (firstLength === 0) {
  3269. return secondLength;
  3270. }
  3271. let bCharacterCode;
  3272. let result;
  3273. let temporary;
  3274. let temporary2;
  3275. let index = 0;
  3276. let index2 = 0;
  3277. while (index < firstLength) {
  3278. characterCodeCache[index] = first.charCodeAt(start + index);
  3279. array[index] = ++index;
  3280. }
  3281. while (index2 < secondLength) {
  3282. bCharacterCode = second.charCodeAt(start + index2);
  3283. temporary = index2++;
  3284. result = index2;
  3285. for (index = 0; index < firstLength; index++) {
  3286. temporary2 = bCharacterCode === characterCodeCache[index] ? temporary : temporary + 1;
  3287. temporary = array[index];
  3288. result = array[index] = temporary > result ? temporary2 > result ? result + 1 : temporary2 : temporary2 > temporary ? temporary + 1 : temporary2;
  3289. }
  3290. }
  3291. return result;
  3292. }
  3293. var array;
  3294. var characterCodeCache;
  3295. var init_leven = __esm({
  3296. "node_modules/leven/index.js"() {
  3297. array = [];
  3298. characterCodeCache = [];
  3299. }
  3300. });
  3301. var require_normalize_cli_options = __commonJS2({
  3302. "src/cli/options/normalize-cli-options.js"(exports2, module2) {
  3303. "use strict";
  3304. var {
  3305. default: chalk2
  3306. } = (init_source(), __toCommonJS(source_exports));
  3307. var {
  3308. default: leven2
  3309. } = (init_leven(), __toCommonJS(leven_exports));
  3310. var {
  3311. optionsNormalizer
  3312. } = require_prettier_internal();
  3313. function normalizeCliOptions(options, optionInfos, opts) {
  3314. return optionsNormalizer.normalizeCliOptions(options, optionInfos, Object.assign({
  3315. colorsModule: chalk2,
  3316. levenshteinDistance: leven2
  3317. }, opts));
  3318. }
  3319. module2.exports = normalizeCliOptions;
  3320. }
  3321. });
  3322. var require_parse_cli_arguments = __commonJS2({
  3323. "src/cli/options/parse-cli-arguments.js"(exports2, module2) {
  3324. "use strict";
  3325. var camelCase = require_camelcase();
  3326. var {
  3327. pick
  3328. } = require_utils();
  3329. var getContextOptions = require_get_context_options();
  3330. var minimist = require_minimist2();
  3331. var createMinimistOptions = require_create_minimist_options();
  3332. var normalizeCliOptions = require_normalize_cli_options();
  3333. function parseArgv(rawArguments, detailedOptions, logger, keys) {
  3334. const minimistOptions = createMinimistOptions(detailedOptions);
  3335. let argv = minimist(rawArguments, minimistOptions);
  3336. if (keys) {
  3337. if (keys.includes("plugin-search-dir") && !keys.includes("plugin-search")) {
  3338. keys.push("plugin-search");
  3339. }
  3340. detailedOptions = detailedOptions.filter((option) => keys.includes(option.name));
  3341. argv = pick(argv, keys);
  3342. }
  3343. const normalized = normalizeCliOptions(argv, detailedOptions, {
  3344. logger
  3345. });
  3346. return Object.assign(Object.assign({}, Object.fromEntries(Object.entries(normalized).map(([key, value]) => {
  3347. const option = detailedOptions.find(({
  3348. name
  3349. }) => name === key) || {};
  3350. return [option.forwardToApi || camelCase(key), value];
  3351. }))), {}, {
  3352. get __raw() {
  3353. return argv;
  3354. }
  3355. });
  3356. }
  3357. var detailedOptionsWithoutPlugins = getContextOptions([], false).detailedOptions;
  3358. function parseArgvWithoutPlugins2(rawArguments, logger, keys) {
  3359. return parseArgv(rawArguments, detailedOptionsWithoutPlugins, logger, typeof keys === "string" ? [keys] : keys);
  3360. }
  3361. module2.exports = {
  3362. parseArgv,
  3363. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3364. };
  3365. }
  3366. });
  3367. var require_context = __commonJS2({
  3368. "src/cli/context.js"(exports2, module2) {
  3369. "use strict";
  3370. var {
  3371. utils: {
  3372. getLast
  3373. }
  3374. } = require_prettier_internal();
  3375. var getContextOptions = require_get_context_options();
  3376. var {
  3377. parseArgv,
  3378. parseArgvWithoutPlugins: parseArgvWithoutPlugins2
  3379. } = require_parse_cli_arguments();
  3380. var Context2 = class {
  3381. constructor({
  3382. rawArguments,
  3383. logger
  3384. }) {
  3385. this.rawArguments = rawArguments;
  3386. this.logger = logger;
  3387. this.stack = [];
  3388. const {
  3389. plugins,
  3390. pluginSearchDirs
  3391. } = parseArgvWithoutPlugins2(rawArguments, logger, ["plugin", "plugin-search-dir"]);
  3392. this.pushContextPlugins(plugins, pluginSearchDirs);
  3393. const argv = parseArgv(rawArguments, this.detailedOptions, logger);
  3394. this.argv = argv;
  3395. this.filePatterns = argv._.map(String);
  3396. }
  3397. pushContextPlugins(plugins, pluginSearchDirs) {
  3398. const options = getContextOptions(plugins, pluginSearchDirs);
  3399. this.stack.push(options);
  3400. Object.assign(this, options);
  3401. }
  3402. popContextPlugins() {
  3403. this.stack.pop();
  3404. Object.assign(this, getLast(this.stack));
  3405. }
  3406. get performanceTestFlag() {
  3407. const {
  3408. debugBenchmark,
  3409. debugRepeat
  3410. } = this.argv;
  3411. if (debugBenchmark) {
  3412. return {
  3413. name: "--debug-benchmark",
  3414. debugBenchmark: true
  3415. };
  3416. }
  3417. if (debugRepeat > 0) {
  3418. return {
  3419. name: "--debug-repeat",
  3420. debugRepeat
  3421. };
  3422. }
  3423. const {
  3424. PRETTIER_PERF_REPEAT
  3425. } = process.env;
  3426. if (PRETTIER_PERF_REPEAT && /^\d+$/.test(PRETTIER_PERF_REPEAT)) {
  3427. return {
  3428. name: "PRETTIER_PERF_REPEAT (environment variable)",
  3429. debugRepeat: Number(PRETTIER_PERF_REPEAT)
  3430. };
  3431. }
  3432. }
  3433. };
  3434. module2.exports = Context2;
  3435. }
  3436. });
  3437. var require_usage = __commonJS2({
  3438. "src/cli/usage.js"(exports2, module2) {
  3439. "use strict";
  3440. var camelCase = require_camelcase();
  3441. var constant = require_constant();
  3442. var {
  3443. groupBy
  3444. } = require_utils();
  3445. var OPTION_USAGE_THRESHOLD = 25;
  3446. var CHOICE_USAGE_MARGIN = 3;
  3447. var CHOICE_USAGE_INDENTATION = 2;
  3448. function indent(str, spaces) {
  3449. return str.replace(/^/gm, " ".repeat(spaces));
  3450. }
  3451. function createDefaultValueDisplay(value) {
  3452. return Array.isArray(value) ? `[${value.map(createDefaultValueDisplay).join(", ")}]` : value;
  3453. }
  3454. function getOptionDefaultValue(context, optionName) {
  3455. if (!(optionName in context.detailedOptionMap)) {
  3456. return;
  3457. }
  3458. const option = context.detailedOptionMap[optionName];
  3459. if (option.default !== void 0) {
  3460. return option.default;
  3461. }
  3462. const optionCamelName = camelCase(optionName);
  3463. if (optionCamelName in context.apiDefaultOptions) {
  3464. return context.apiDefaultOptions[optionCamelName];
  3465. }
  3466. }
  3467. function createOptionUsageHeader(option) {
  3468. const name = `--${option.name}`;
  3469. const alias = option.alias ? `-${option.alias},` : null;
  3470. const type = createOptionUsageType(option);
  3471. return [alias, name, type].filter(Boolean).join(" ");
  3472. }
  3473. function createOptionUsageRow(header, content, threshold) {
  3474. const separator = header.length >= threshold ? `
  3475. ${" ".repeat(threshold)}` : " ".repeat(threshold - header.length);
  3476. const description = content.replace(/\n/g, `
  3477. ${" ".repeat(threshold)}`);
  3478. return `${header}${separator}${description}`;
  3479. }
  3480. function createOptionUsageType(option) {
  3481. switch (option.type) {
  3482. case "boolean":
  3483. return null;
  3484. case "choice":
  3485. return `<${option.choices.filter((choice) => !choice.deprecated && choice.since !== null).map((choice) => choice.value).join("|")}>`;
  3486. default:
  3487. return `<${option.type}>`;
  3488. }
  3489. }
  3490. function createChoiceUsages(choices, margin, indentation) {
  3491. const activeChoices = choices.filter((choice) => !choice.deprecated && choice.since !== null);
  3492. const threshold = Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
  3493. return activeChoices.map((choice) => indent(createOptionUsageRow(choice.value, choice.description, threshold), indentation));
  3494. }
  3495. function createOptionUsage(context, option, threshold) {
  3496. const header = createOptionUsageHeader(option);
  3497. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3498. return createOptionUsageRow(header, `${option.description}${optionDefaultValue === void 0 ? "" : `
  3499. Defaults to ${createDefaultValueDisplay(optionDefaultValue)}.`}`, threshold);
  3500. }
  3501. function getOptionsWithOpposites(options) {
  3502. const optionsWithOpposites = options.map((option) => [option.description ? option : null, option.oppositeDescription ? Object.assign(Object.assign({}, option), {}, {
  3503. name: `no-${option.name}`,
  3504. type: "boolean",
  3505. description: option.oppositeDescription
  3506. }) : null]);
  3507. return optionsWithOpposites.flat().filter(Boolean);
  3508. }
  3509. function createUsage2(context) {
  3510. const options = getOptionsWithOpposites(context.detailedOptions).filter((option) => !(option.type === "boolean" && option.oppositeDescription && !option.name.startsWith("no-")));
  3511. const groupedOptions = groupBy(options, (option) => option.category);
  3512. const firstCategories = constant.categoryOrder.slice(0, -1);
  3513. const lastCategories = constant.categoryOrder.slice(-1);
  3514. const restCategories = Object.keys(groupedOptions).filter((category) => !constant.categoryOrder.includes(category));
  3515. const allCategories = [...firstCategories, ...restCategories, ...lastCategories];
  3516. const optionsUsage = allCategories.map((category) => {
  3517. const categoryOptions = groupedOptions[category].map((option) => createOptionUsage(context, option, OPTION_USAGE_THRESHOLD)).join("\n");
  3518. return `${category} options:
  3519. ${indent(categoryOptions, 2)}`;
  3520. });
  3521. return [constant.usageSummary, ...optionsUsage, ""].join("\n\n");
  3522. }
  3523. function createDetailedUsage2(context, flag) {
  3524. const option = getOptionsWithOpposites(context.detailedOptions).find((option2) => option2.name === flag || option2.alias === flag);
  3525. const header = createOptionUsageHeader(option);
  3526. const description = `
  3527. ${indent(option.description, 2)}`;
  3528. const choices = option.type !== "choice" ? "" : `
  3529. Valid options:
  3530. ${createChoiceUsages(option.choices, CHOICE_USAGE_MARGIN, CHOICE_USAGE_INDENTATION).join("\n")}`;
  3531. const optionDefaultValue = getOptionDefaultValue(context, option.name);
  3532. const defaults = optionDefaultValue !== void 0 ? `
  3533. Default: ${createDefaultValueDisplay(optionDefaultValue)}` : "";
  3534. const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 ? `
  3535. Plugin defaults:${Object.entries(option.pluginDefaults).map(([key, value]) => `
  3536. * ${key}: ${createDefaultValueDisplay(value)}`)}` : "";
  3537. return `${header}${description}${choices}${defaults}${pluginDefaults}`;
  3538. }
  3539. module2.exports = {
  3540. createUsage: createUsage2,
  3541. createDetailedUsage: createDetailedUsage2
  3542. };
  3543. }
  3544. });
  3545. var require_array = __commonJS2({
  3546. "node_modules/fast-glob/out/utils/array.js"(exports2) {
  3547. "use strict";
  3548. Object.defineProperty(exports2, "__esModule", {
  3549. value: true
  3550. });
  3551. exports2.splitWhen = exports2.flatten = void 0;
  3552. function flatten(items) {
  3553. return items.reduce((collection, item) => [].concat(collection, item), []);
  3554. }
  3555. exports2.flatten = flatten;
  3556. function splitWhen(items, predicate) {
  3557. const result = [[]];
  3558. let groupIndex = 0;
  3559. for (const item of items) {
  3560. if (predicate(item)) {
  3561. groupIndex++;
  3562. result[groupIndex] = [];
  3563. } else {
  3564. result[groupIndex].push(item);
  3565. }
  3566. }
  3567. return result;
  3568. }
  3569. exports2.splitWhen = splitWhen;
  3570. }
  3571. });
  3572. var require_errno = __commonJS2({
  3573. "node_modules/fast-glob/out/utils/errno.js"(exports2) {
  3574. "use strict";
  3575. Object.defineProperty(exports2, "__esModule", {
  3576. value: true
  3577. });
  3578. exports2.isEnoentCodeError = void 0;
  3579. function isEnoentCodeError(error) {
  3580. return error.code === "ENOENT";
  3581. }
  3582. exports2.isEnoentCodeError = isEnoentCodeError;
  3583. }
  3584. });
  3585. var require_fs = __commonJS2({
  3586. "node_modules/fast-glob/out/utils/fs.js"(exports2) {
  3587. "use strict";
  3588. Object.defineProperty(exports2, "__esModule", {
  3589. value: true
  3590. });
  3591. exports2.createDirentFromStats = void 0;
  3592. var DirentFromStats = class {
  3593. constructor(name, stats) {
  3594. this.name = name;
  3595. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  3596. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  3597. this.isDirectory = stats.isDirectory.bind(stats);
  3598. this.isFIFO = stats.isFIFO.bind(stats);
  3599. this.isFile = stats.isFile.bind(stats);
  3600. this.isSocket = stats.isSocket.bind(stats);
  3601. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  3602. }
  3603. };
  3604. function createDirentFromStats(name, stats) {
  3605. return new DirentFromStats(name, stats);
  3606. }
  3607. exports2.createDirentFromStats = createDirentFromStats;
  3608. }
  3609. });
  3610. var require_path = __commonJS2({
  3611. "node_modules/fast-glob/out/utils/path.js"(exports2) {
  3612. "use strict";
  3613. Object.defineProperty(exports2, "__esModule", {
  3614. value: true
  3615. });
  3616. exports2.removeLeadingDotSegment = exports2.escape = exports2.makeAbsolute = exports2.unixify = void 0;
  3617. var path = require("path");
  3618. var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
  3619. var UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
  3620. function unixify(filepath) {
  3621. return filepath.replace(/\\/g, "/");
  3622. }
  3623. exports2.unixify = unixify;
  3624. function makeAbsolute(cwd, filepath) {
  3625. return path.resolve(cwd, filepath);
  3626. }
  3627. exports2.makeAbsolute = makeAbsolute;
  3628. function escape(pattern) {
  3629. return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, "\\$2");
  3630. }
  3631. exports2.escape = escape;
  3632. function removeLeadingDotSegment(entry) {
  3633. if (entry.charAt(0) === ".") {
  3634. const secondCharactery = entry.charAt(1);
  3635. if (secondCharactery === "/" || secondCharactery === "\\") {
  3636. return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
  3637. }
  3638. }
  3639. return entry;
  3640. }
  3641. exports2.removeLeadingDotSegment = removeLeadingDotSegment;
  3642. }
  3643. });
  3644. var require_is_extglob = __commonJS2({
  3645. "node_modules/is-extglob/index.js"(exports2, module2) {
  3646. module2.exports = function isExtglob(str) {
  3647. if (typeof str !== "string" || str === "") {
  3648. return false;
  3649. }
  3650. var match;
  3651. while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
  3652. if (match[2])
  3653. return true;
  3654. str = str.slice(match.index + match[0].length);
  3655. }
  3656. return false;
  3657. };
  3658. }
  3659. });
  3660. var require_is_glob = __commonJS2({
  3661. "node_modules/is-glob/index.js"(exports2, module2) {
  3662. var isExtglob = require_is_extglob();
  3663. var chars = {
  3664. "{": "}",
  3665. "(": ")",
  3666. "[": "]"
  3667. };
  3668. var strictCheck = function(str) {
  3669. if (str[0] === "!") {
  3670. return true;
  3671. }
  3672. var index = 0;
  3673. var pipeIndex = -2;
  3674. var closeSquareIndex = -2;
  3675. var closeCurlyIndex = -2;
  3676. var closeParenIndex = -2;
  3677. var backSlashIndex = -2;
  3678. while (index < str.length) {
  3679. if (str[index] === "*") {
  3680. return true;
  3681. }
  3682. if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
  3683. return true;
  3684. }
  3685. if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
  3686. if (closeSquareIndex < index) {
  3687. closeSquareIndex = str.indexOf("]", index);
  3688. }
  3689. if (closeSquareIndex > index) {
  3690. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3691. return true;
  3692. }
  3693. backSlashIndex = str.indexOf("\\", index);
  3694. if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
  3695. return true;
  3696. }
  3697. }
  3698. }
  3699. if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
  3700. closeCurlyIndex = str.indexOf("}", index);
  3701. if (closeCurlyIndex > index) {
  3702. backSlashIndex = str.indexOf("\\", index);
  3703. if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
  3704. return true;
  3705. }
  3706. }
  3707. }
  3708. if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
  3709. closeParenIndex = str.indexOf(")", index);
  3710. if (closeParenIndex > index) {
  3711. backSlashIndex = str.indexOf("\\", index);
  3712. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3713. return true;
  3714. }
  3715. }
  3716. }
  3717. if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
  3718. if (pipeIndex < index) {
  3719. pipeIndex = str.indexOf("|", index);
  3720. }
  3721. if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
  3722. closeParenIndex = str.indexOf(")", pipeIndex);
  3723. if (closeParenIndex > pipeIndex) {
  3724. backSlashIndex = str.indexOf("\\", pipeIndex);
  3725. if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
  3726. return true;
  3727. }
  3728. }
  3729. }
  3730. }
  3731. if (str[index] === "\\") {
  3732. var open = str[index + 1];
  3733. index += 2;
  3734. var close = chars[open];
  3735. if (close) {
  3736. var n = str.indexOf(close, index);
  3737. if (n !== -1) {
  3738. index = n + 1;
  3739. }
  3740. }
  3741. if (str[index] === "!") {
  3742. return true;
  3743. }
  3744. } else {
  3745. index++;
  3746. }
  3747. }
  3748. return false;
  3749. };
  3750. var relaxedCheck = function(str) {
  3751. if (str[0] === "!") {
  3752. return true;
  3753. }
  3754. var index = 0;
  3755. while (index < str.length) {
  3756. if (/[*?{}()[\]]/.test(str[index])) {
  3757. return true;
  3758. }
  3759. if (str[index] === "\\") {
  3760. var open = str[index + 1];
  3761. index += 2;
  3762. var close = chars[open];
  3763. if (close) {
  3764. var n = str.indexOf(close, index);
  3765. if (n !== -1) {
  3766. index = n + 1;
  3767. }
  3768. }
  3769. if (str[index] === "!") {
  3770. return true;
  3771. }
  3772. } else {
  3773. index++;
  3774. }
  3775. }
  3776. return false;
  3777. };
  3778. module2.exports = function isGlob(str, options) {
  3779. if (typeof str !== "string" || str === "") {
  3780. return false;
  3781. }
  3782. if (isExtglob(str)) {
  3783. return true;
  3784. }
  3785. var check = strictCheck;
  3786. if (options && options.strict === false) {
  3787. check = relaxedCheck;
  3788. }
  3789. return check(str);
  3790. };
  3791. }
  3792. });
  3793. var require_glob_parent = __commonJS2({
  3794. "node_modules/glob-parent/index.js"(exports2, module2) {
  3795. "use strict";
  3796. var isGlob = require_is_glob();
  3797. var pathPosixDirname = require("path").posix.dirname;
  3798. var isWin32 = require("os").platform() === "win32";
  3799. var slash = "/";
  3800. var backslash = /\\/g;
  3801. var enclosure = /[\{\[].*[\}\]]$/;
  3802. var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
  3803. var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
  3804. module2.exports = function globParent(str, opts) {
  3805. var options = Object.assign({
  3806. flipBackslashes: true
  3807. }, opts);
  3808. if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
  3809. str = str.replace(backslash, slash);
  3810. }
  3811. if (enclosure.test(str)) {
  3812. str += slash;
  3813. }
  3814. str += "a";
  3815. do {
  3816. str = pathPosixDirname(str);
  3817. } while (isGlob(str) || globby.test(str));
  3818. return str.replace(escaped, "$1");
  3819. };
  3820. }
  3821. });
  3822. var require_utils2 = __commonJS2({
  3823. "node_modules/braces/lib/utils.js"(exports2) {
  3824. "use strict";
  3825. exports2.isInteger = (num) => {
  3826. if (typeof num === "number") {
  3827. return Number.isInteger(num);
  3828. }
  3829. if (typeof num === "string" && num.trim() !== "") {
  3830. return Number.isInteger(Number(num));
  3831. }
  3832. return false;
  3833. };
  3834. exports2.find = (node, type) => node.nodes.find((node2) => node2.type === type);
  3835. exports2.exceedsLimit = (min, max, step = 1, limit) => {
  3836. if (limit === false)
  3837. return false;
  3838. if (!exports2.isInteger(min) || !exports2.isInteger(max))
  3839. return false;
  3840. return (Number(max) - Number(min)) / Number(step) >= limit;
  3841. };
  3842. exports2.escapeNode = (block, n = 0, type) => {
  3843. let node = block.nodes[n];
  3844. if (!node)
  3845. return;
  3846. if (type && node.type === type || node.type === "open" || node.type === "close") {
  3847. if (node.escaped !== true) {
  3848. node.value = "\\" + node.value;
  3849. node.escaped = true;
  3850. }
  3851. }
  3852. };
  3853. exports2.encloseBrace = (node) => {
  3854. if (node.type !== "brace")
  3855. return false;
  3856. if (node.commas >> 0 + node.ranges >> 0 === 0) {
  3857. node.invalid = true;
  3858. return true;
  3859. }
  3860. return false;
  3861. };
  3862. exports2.isInvalidBrace = (block) => {
  3863. if (block.type !== "brace")
  3864. return false;
  3865. if (block.invalid === true || block.dollar)
  3866. return true;
  3867. if (block.commas >> 0 + block.ranges >> 0 === 0) {
  3868. block.invalid = true;
  3869. return true;
  3870. }
  3871. if (block.open !== true || block.close !== true) {
  3872. block.invalid = true;
  3873. return true;
  3874. }
  3875. return false;
  3876. };
  3877. exports2.isOpenOrClose = (node) => {
  3878. if (node.type === "open" || node.type === "close") {
  3879. return true;
  3880. }
  3881. return node.open === true || node.close === true;
  3882. };
  3883. exports2.reduce = (nodes) => nodes.reduce((acc, node) => {
  3884. if (node.type === "text")
  3885. acc.push(node.value);
  3886. if (node.type === "range")
  3887. node.type = "text";
  3888. return acc;
  3889. }, []);
  3890. exports2.flatten = (...args) => {
  3891. const result = [];
  3892. const flat = (arr) => {
  3893. for (let i = 0; i < arr.length; i++) {
  3894. let ele = arr[i];
  3895. Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
  3896. }
  3897. return result;
  3898. };
  3899. flat(args);
  3900. return result;
  3901. };
  3902. }
  3903. });
  3904. var require_stringify = __commonJS2({
  3905. "node_modules/braces/lib/stringify.js"(exports2, module2) {
  3906. "use strict";
  3907. var utils = require_utils2();
  3908. module2.exports = (ast, options = {}) => {
  3909. let stringify2 = (node, parent = {}) => {
  3910. let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
  3911. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  3912. let output = "";
  3913. if (node.value) {
  3914. if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
  3915. return "\\" + node.value;
  3916. }
  3917. return node.value;
  3918. }
  3919. if (node.value) {
  3920. return node.value;
  3921. }
  3922. if (node.nodes) {
  3923. for (let child of node.nodes) {
  3924. output += stringify2(child);
  3925. }
  3926. }
  3927. return output;
  3928. };
  3929. return stringify2(ast);
  3930. };
  3931. }
  3932. });
  3933. var require_is_number = __commonJS2({
  3934. "node_modules/is-number/index.js"(exports2, module2) {
  3935. "use strict";
  3936. module2.exports = function(num) {
  3937. if (typeof num === "number") {
  3938. return num - num === 0;
  3939. }
  3940. if (typeof num === "string" && num.trim() !== "") {
  3941. return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
  3942. }
  3943. return false;
  3944. };
  3945. }
  3946. });
  3947. var require_to_regex_range = __commonJS2({
  3948. "node_modules/to-regex-range/index.js"(exports2, module2) {
  3949. "use strict";
  3950. var isNumber = require_is_number();
  3951. var toRegexRange = (min, max, options) => {
  3952. if (isNumber(min) === false) {
  3953. throw new TypeError("toRegexRange: expected the first argument to be a number");
  3954. }
  3955. if (max === void 0 || min === max) {
  3956. return String(min);
  3957. }
  3958. if (isNumber(max) === false) {
  3959. throw new TypeError("toRegexRange: expected the second argument to be a number.");
  3960. }
  3961. let opts = Object.assign({
  3962. relaxZeros: true
  3963. }, options);
  3964. if (typeof opts.strictZeros === "boolean") {
  3965. opts.relaxZeros = opts.strictZeros === false;
  3966. }
  3967. let relax = String(opts.relaxZeros);
  3968. let shorthand = String(opts.shorthand);
  3969. let capture = String(opts.capture);
  3970. let wrap = String(opts.wrap);
  3971. let cacheKey = min + ":" + max + "=" + relax + shorthand + capture + wrap;
  3972. if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
  3973. return toRegexRange.cache[cacheKey].result;
  3974. }
  3975. let a = Math.min(min, max);
  3976. let b = Math.max(min, max);
  3977. if (Math.abs(a - b) === 1) {
  3978. let result = min + "|" + max;
  3979. if (opts.capture) {
  3980. return `(${result})`;
  3981. }
  3982. if (opts.wrap === false) {
  3983. return result;
  3984. }
  3985. return `(?:${result})`;
  3986. }
  3987. let isPadded = hasPadding(min) || hasPadding(max);
  3988. let state = {
  3989. min,
  3990. max,
  3991. a,
  3992. b
  3993. };
  3994. let positives = [];
  3995. let negatives = [];
  3996. if (isPadded) {
  3997. state.isPadded = isPadded;
  3998. state.maxLen = String(state.max).length;
  3999. }
  4000. if (a < 0) {
  4001. let newMin = b < 0 ? Math.abs(b) : 1;
  4002. negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
  4003. a = state.a = 0;
  4004. }
  4005. if (b >= 0) {
  4006. positives = splitToPatterns(a, b, state, opts);
  4007. }
  4008. state.negatives = negatives;
  4009. state.positives = positives;
  4010. state.result = collatePatterns(negatives, positives, opts);
  4011. if (opts.capture === true) {
  4012. state.result = `(${state.result})`;
  4013. } else if (opts.wrap !== false && positives.length + negatives.length > 1) {
  4014. state.result = `(?:${state.result})`;
  4015. }
  4016. toRegexRange.cache[cacheKey] = state;
  4017. return state.result;
  4018. };
  4019. function collatePatterns(neg, pos, options) {
  4020. let onlyNegative = filterPatterns(neg, pos, "-", false, options) || [];
  4021. let onlyPositive = filterPatterns(pos, neg, "", false, options) || [];
  4022. let intersected = filterPatterns(neg, pos, "-?", true, options) || [];
  4023. let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
  4024. return subpatterns.join("|");
  4025. }
  4026. function splitToRanges(min, max) {
  4027. let nines = 1;
  4028. let zeros = 1;
  4029. let stop = countNines(min, nines);
  4030. let stops = /* @__PURE__ */ new Set([max]);
  4031. while (min <= stop && stop <= max) {
  4032. stops.add(stop);
  4033. nines += 1;
  4034. stop = countNines(min, nines);
  4035. }
  4036. stop = countZeros(max + 1, zeros) - 1;
  4037. while (min < stop && stop <= max) {
  4038. stops.add(stop);
  4039. zeros += 1;
  4040. stop = countZeros(max + 1, zeros) - 1;
  4041. }
  4042. stops = [...stops];
  4043. stops.sort(compare);
  4044. return stops;
  4045. }
  4046. function rangeToPattern(start, stop, options) {
  4047. if (start === stop) {
  4048. return {
  4049. pattern: start,
  4050. count: [],
  4051. digits: 0
  4052. };
  4053. }
  4054. let zipped = zip(start, stop);
  4055. let digits = zipped.length;
  4056. let pattern = "";
  4057. let count = 0;
  4058. for (let i = 0; i < digits; i++) {
  4059. let [startDigit, stopDigit] = zipped[i];
  4060. if (startDigit === stopDigit) {
  4061. pattern += startDigit;
  4062. } else if (startDigit !== "0" || stopDigit !== "9") {
  4063. pattern += toCharacterClass(startDigit, stopDigit, options);
  4064. } else {
  4065. count++;
  4066. }
  4067. }
  4068. if (count) {
  4069. pattern += options.shorthand === true ? "\\d" : "[0-9]";
  4070. }
  4071. return {
  4072. pattern,
  4073. count: [count],
  4074. digits
  4075. };
  4076. }
  4077. function splitToPatterns(min, max, tok, options) {
  4078. let ranges = splitToRanges(min, max);
  4079. let tokens = [];
  4080. let start = min;
  4081. let prev;
  4082. for (let i = 0; i < ranges.length; i++) {
  4083. let max2 = ranges[i];
  4084. let obj = rangeToPattern(String(start), String(max2), options);
  4085. let zeros = "";
  4086. if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
  4087. if (prev.count.length > 1) {
  4088. prev.count.pop();
  4089. }
  4090. prev.count.push(obj.count[0]);
  4091. prev.string = prev.pattern + toQuantifier(prev.count);
  4092. start = max2 + 1;
  4093. continue;
  4094. }
  4095. if (tok.isPadded) {
  4096. zeros = padZeros(max2, tok, options);
  4097. }
  4098. obj.string = zeros + obj.pattern + toQuantifier(obj.count);
  4099. tokens.push(obj);
  4100. start = max2 + 1;
  4101. prev = obj;
  4102. }
  4103. return tokens;
  4104. }
  4105. function filterPatterns(arr, comparison, prefix, intersection, options) {
  4106. let result = [];
  4107. for (let ele of arr) {
  4108. let {
  4109. string
  4110. } = ele;
  4111. if (!intersection && !contains(comparison, "string", string)) {
  4112. result.push(prefix + string);
  4113. }
  4114. if (intersection && contains(comparison, "string", string)) {
  4115. result.push(prefix + string);
  4116. }
  4117. }
  4118. return result;
  4119. }
  4120. function zip(a, b) {
  4121. let arr = [];
  4122. for (let i = 0; i < a.length; i++)
  4123. arr.push([a[i], b[i]]);
  4124. return arr;
  4125. }
  4126. function compare(a, b) {
  4127. return a > b ? 1 : b > a ? -1 : 0;
  4128. }
  4129. function contains(arr, key, val) {
  4130. return arr.some((ele) => ele[key] === val);
  4131. }
  4132. function countNines(min, len) {
  4133. return Number(String(min).slice(0, -len) + "9".repeat(len));
  4134. }
  4135. function countZeros(integer, zeros) {
  4136. return integer - integer % Math.pow(10, zeros);
  4137. }
  4138. function toQuantifier(digits) {
  4139. let [start = 0, stop = ""] = digits;
  4140. if (stop || start > 1) {
  4141. return `{${start + (stop ? "," + stop : "")}}`;
  4142. }
  4143. return "";
  4144. }
  4145. function toCharacterClass(a, b, options) {
  4146. return `[${a}${b - a === 1 ? "" : "-"}${b}]`;
  4147. }
  4148. function hasPadding(str) {
  4149. return /^-?(0+)\d/.test(str);
  4150. }
  4151. function padZeros(value, tok, options) {
  4152. if (!tok.isPadded) {
  4153. return value;
  4154. }
  4155. let diff = Math.abs(tok.maxLen - String(value).length);
  4156. let relax = options.relaxZeros !== false;
  4157. switch (diff) {
  4158. case 0:
  4159. return "";
  4160. case 1:
  4161. return relax ? "0?" : "0";
  4162. case 2:
  4163. return relax ? "0{0,2}" : "00";
  4164. default: {
  4165. return relax ? `0{0,${diff}}` : `0{${diff}}`;
  4166. }
  4167. }
  4168. }
  4169. toRegexRange.cache = {};
  4170. toRegexRange.clearCache = () => toRegexRange.cache = {};
  4171. module2.exports = toRegexRange;
  4172. }
  4173. });
  4174. var require_fill_range = __commonJS2({
  4175. "node_modules/fill-range/index.js"(exports2, module2) {
  4176. "use strict";
  4177. var util = require("util");
  4178. var toRegexRange = require_to_regex_range();
  4179. var isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  4180. var transform = (toNumber) => {
  4181. return (value) => toNumber === true ? Number(value) : String(value);
  4182. };
  4183. var isValidValue = (value) => {
  4184. return typeof value === "number" || typeof value === "string" && value !== "";
  4185. };
  4186. var isNumber = (num) => Number.isInteger(+num);
  4187. var zeros = (input) => {
  4188. let value = `${input}`;
  4189. let index = -1;
  4190. if (value[0] === "-")
  4191. value = value.slice(1);
  4192. if (value === "0")
  4193. return false;
  4194. while (value[++index] === "0")
  4195. ;
  4196. return index > 0;
  4197. };
  4198. var stringify2 = (start, end, options) => {
  4199. if (typeof start === "string" || typeof end === "string") {
  4200. return true;
  4201. }
  4202. return options.stringify === true;
  4203. };
  4204. var pad = (input, maxLength, toNumber) => {
  4205. if (maxLength > 0) {
  4206. let dash = input[0] === "-" ? "-" : "";
  4207. if (dash)
  4208. input = input.slice(1);
  4209. input = dash + input.padStart(dash ? maxLength - 1 : maxLength, "0");
  4210. }
  4211. if (toNumber === false) {
  4212. return String(input);
  4213. }
  4214. return input;
  4215. };
  4216. var toMaxLen = (input, maxLength) => {
  4217. let negative = input[0] === "-" ? "-" : "";
  4218. if (negative) {
  4219. input = input.slice(1);
  4220. maxLength--;
  4221. }
  4222. while (input.length < maxLength)
  4223. input = "0" + input;
  4224. return negative ? "-" + input : input;
  4225. };
  4226. var toSequence = (parts, options) => {
  4227. parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4228. parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
  4229. let prefix = options.capture ? "" : "?:";
  4230. let positives = "";
  4231. let negatives = "";
  4232. let result;
  4233. if (parts.positives.length) {
  4234. positives = parts.positives.join("|");
  4235. }
  4236. if (parts.negatives.length) {
  4237. negatives = `-(${prefix}${parts.negatives.join("|")})`;
  4238. }
  4239. if (positives && negatives) {
  4240. result = `${positives}|${negatives}`;
  4241. } else {
  4242. result = positives || negatives;
  4243. }
  4244. if (options.wrap) {
  4245. return `(${prefix}${result})`;
  4246. }
  4247. return result;
  4248. };
  4249. var toRange = (a, b, isNumbers, options) => {
  4250. if (isNumbers) {
  4251. return toRegexRange(a, b, Object.assign({
  4252. wrap: false
  4253. }, options));
  4254. }
  4255. let start = String.fromCharCode(a);
  4256. if (a === b)
  4257. return start;
  4258. let stop = String.fromCharCode(b);
  4259. return `[${start}-${stop}]`;
  4260. };
  4261. var toRegex = (start, end, options) => {
  4262. if (Array.isArray(start)) {
  4263. let wrap = options.wrap === true;
  4264. let prefix = options.capture ? "" : "?:";
  4265. return wrap ? `(${prefix}${start.join("|")})` : start.join("|");
  4266. }
  4267. return toRegexRange(start, end, options);
  4268. };
  4269. var rangeError = (...args) => {
  4270. return new RangeError("Invalid range arguments: " + util.inspect(...args));
  4271. };
  4272. var invalidRange = (start, end, options) => {
  4273. if (options.strictRanges === true)
  4274. throw rangeError([start, end]);
  4275. return [];
  4276. };
  4277. var invalidStep = (step, options) => {
  4278. if (options.strictRanges === true) {
  4279. throw new TypeError(`Expected step "${step}" to be a number`);
  4280. }
  4281. return [];
  4282. };
  4283. var fillNumbers = (start, end, step = 1, options = {}) => {
  4284. let a = Number(start);
  4285. let b = Number(end);
  4286. if (!Number.isInteger(a) || !Number.isInteger(b)) {
  4287. if (options.strictRanges === true)
  4288. throw rangeError([start, end]);
  4289. return [];
  4290. }
  4291. if (a === 0)
  4292. a = 0;
  4293. if (b === 0)
  4294. b = 0;
  4295. let descending = a > b;
  4296. let startString = String(start);
  4297. let endString = String(end);
  4298. let stepString = String(step);
  4299. step = Math.max(Math.abs(step), 1);
  4300. let padded = zeros(startString) || zeros(endString) || zeros(stepString);
  4301. let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
  4302. let toNumber = padded === false && stringify2(start, end, options) === false;
  4303. let format = options.transform || transform(toNumber);
  4304. if (options.toRegex && step === 1) {
  4305. return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
  4306. }
  4307. let parts = {
  4308. negatives: [],
  4309. positives: []
  4310. };
  4311. let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
  4312. let range = [];
  4313. let index = 0;
  4314. while (descending ? a >= b : a <= b) {
  4315. if (options.toRegex === true && step > 1) {
  4316. push(a);
  4317. } else {
  4318. range.push(pad(format(a, index), maxLen, toNumber));
  4319. }
  4320. a = descending ? a - step : a + step;
  4321. index++;
  4322. }
  4323. if (options.toRegex === true) {
  4324. return step > 1 ? toSequence(parts, options) : toRegex(range, null, Object.assign({
  4325. wrap: false
  4326. }, options));
  4327. }
  4328. return range;
  4329. };
  4330. var fillLetters = (start, end, step = 1, options = {}) => {
  4331. if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) {
  4332. return invalidRange(start, end, options);
  4333. }
  4334. let format = options.transform || ((val) => String.fromCharCode(val));
  4335. let a = `${start}`.charCodeAt(0);
  4336. let b = `${end}`.charCodeAt(0);
  4337. let descending = a > b;
  4338. let min = Math.min(a, b);
  4339. let max = Math.max(a, b);
  4340. if (options.toRegex && step === 1) {
  4341. return toRange(min, max, false, options);
  4342. }
  4343. let range = [];
  4344. let index = 0;
  4345. while (descending ? a >= b : a <= b) {
  4346. range.push(format(a, index));
  4347. a = descending ? a - step : a + step;
  4348. index++;
  4349. }
  4350. if (options.toRegex === true) {
  4351. return toRegex(range, null, {
  4352. wrap: false,
  4353. options
  4354. });
  4355. }
  4356. return range;
  4357. };
  4358. var fill = (start, end, step, options = {}) => {
  4359. if (end == null && isValidValue(start)) {
  4360. return [start];
  4361. }
  4362. if (!isValidValue(start) || !isValidValue(end)) {
  4363. return invalidRange(start, end, options);
  4364. }
  4365. if (typeof step === "function") {
  4366. return fill(start, end, 1, {
  4367. transform: step
  4368. });
  4369. }
  4370. if (isObject(step)) {
  4371. return fill(start, end, 0, step);
  4372. }
  4373. let opts = Object.assign({}, options);
  4374. if (opts.capture === true)
  4375. opts.wrap = true;
  4376. step = step || opts.step || 1;
  4377. if (!isNumber(step)) {
  4378. if (step != null && !isObject(step))
  4379. return invalidStep(step, opts);
  4380. return fill(start, end, 1, step);
  4381. }
  4382. if (isNumber(start) && isNumber(end)) {
  4383. return fillNumbers(start, end, step, opts);
  4384. }
  4385. return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
  4386. };
  4387. module2.exports = fill;
  4388. }
  4389. });
  4390. var require_compile = __commonJS2({
  4391. "node_modules/braces/lib/compile.js"(exports2, module2) {
  4392. "use strict";
  4393. var fill = require_fill_range();
  4394. var utils = require_utils2();
  4395. var compile = (ast, options = {}) => {
  4396. let walk = (node, parent = {}) => {
  4397. let invalidBlock = utils.isInvalidBrace(parent);
  4398. let invalidNode = node.invalid === true && options.escapeInvalid === true;
  4399. let invalid = invalidBlock === true || invalidNode === true;
  4400. let prefix = options.escapeInvalid === true ? "\\" : "";
  4401. let output = "";
  4402. if (node.isOpen === true) {
  4403. return prefix + node.value;
  4404. }
  4405. if (node.isClose === true) {
  4406. return prefix + node.value;
  4407. }
  4408. if (node.type === "open") {
  4409. return invalid ? prefix + node.value : "(";
  4410. }
  4411. if (node.type === "close") {
  4412. return invalid ? prefix + node.value : ")";
  4413. }
  4414. if (node.type === "comma") {
  4415. return node.prev.type === "comma" ? "" : invalid ? node.value : "|";
  4416. }
  4417. if (node.value) {
  4418. return node.value;
  4419. }
  4420. if (node.nodes && node.ranges > 0) {
  4421. let args = utils.reduce(node.nodes);
  4422. let range = fill(...args, Object.assign(Object.assign({}, options), {}, {
  4423. wrap: false,
  4424. toRegex: true
  4425. }));
  4426. if (range.length !== 0) {
  4427. return args.length > 1 && range.length > 1 ? `(${range})` : range;
  4428. }
  4429. }
  4430. if (node.nodes) {
  4431. for (let child of node.nodes) {
  4432. output += walk(child, node);
  4433. }
  4434. }
  4435. return output;
  4436. };
  4437. return walk(ast);
  4438. };
  4439. module2.exports = compile;
  4440. }
  4441. });
  4442. var require_expand = __commonJS2({
  4443. "node_modules/braces/lib/expand.js"(exports2, module2) {
  4444. "use strict";
  4445. var fill = require_fill_range();
  4446. var stringify2 = require_stringify();
  4447. var utils = require_utils2();
  4448. var append = (queue = "", stash = "", enclose = false) => {
  4449. let result = [];
  4450. queue = [].concat(queue);
  4451. stash = [].concat(stash);
  4452. if (!stash.length)
  4453. return queue;
  4454. if (!queue.length) {
  4455. return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
  4456. }
  4457. for (let item of queue) {
  4458. if (Array.isArray(item)) {
  4459. for (let value of item) {
  4460. result.push(append(value, stash, enclose));
  4461. }
  4462. } else {
  4463. for (let ele of stash) {
  4464. if (enclose === true && typeof ele === "string")
  4465. ele = `{${ele}}`;
  4466. result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
  4467. }
  4468. }
  4469. }
  4470. return utils.flatten(result);
  4471. };
  4472. var expand = (ast, options = {}) => {
  4473. let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
  4474. let walk = (node, parent = {}) => {
  4475. node.queue = [];
  4476. let p = parent;
  4477. let q = parent.queue;
  4478. while (p.type !== "brace" && p.type !== "root" && p.parent) {
  4479. p = p.parent;
  4480. q = p.queue;
  4481. }
  4482. if (node.invalid || node.dollar) {
  4483. q.push(append(q.pop(), stringify2(node, options)));
  4484. return;
  4485. }
  4486. if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
  4487. q.push(append(q.pop(), ["{}"]));
  4488. return;
  4489. }
  4490. if (node.nodes && node.ranges > 0) {
  4491. let args = utils.reduce(node.nodes);
  4492. if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
  4493. throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
  4494. }
  4495. let range = fill(...args, options);
  4496. if (range.length === 0) {
  4497. range = stringify2(node, options);
  4498. }
  4499. q.push(append(q.pop(), range));
  4500. node.nodes = [];
  4501. return;
  4502. }
  4503. let enclose = utils.encloseBrace(node);
  4504. let queue = node.queue;
  4505. let block = node;
  4506. while (block.type !== "brace" && block.type !== "root" && block.parent) {
  4507. block = block.parent;
  4508. queue = block.queue;
  4509. }
  4510. for (let i = 0; i < node.nodes.length; i++) {
  4511. let child = node.nodes[i];
  4512. if (child.type === "comma" && node.type === "brace") {
  4513. if (i === 1)
  4514. queue.push("");
  4515. queue.push("");
  4516. continue;
  4517. }
  4518. if (child.type === "close") {
  4519. q.push(append(q.pop(), queue, enclose));
  4520. continue;
  4521. }
  4522. if (child.value && child.type !== "open") {
  4523. queue.push(append(queue.pop(), child.value));
  4524. continue;
  4525. }
  4526. if (child.nodes) {
  4527. walk(child, node);
  4528. }
  4529. }
  4530. return queue;
  4531. };
  4532. return utils.flatten(walk(ast));
  4533. };
  4534. module2.exports = expand;
  4535. }
  4536. });
  4537. var require_constants = __commonJS2({
  4538. "node_modules/braces/lib/constants.js"(exports2, module2) {
  4539. "use strict";
  4540. module2.exports = {
  4541. MAX_LENGTH: 1024 * 64,
  4542. CHAR_0: "0",
  4543. CHAR_9: "9",
  4544. CHAR_UPPERCASE_A: "A",
  4545. CHAR_LOWERCASE_A: "a",
  4546. CHAR_UPPERCASE_Z: "Z",
  4547. CHAR_LOWERCASE_Z: "z",
  4548. CHAR_LEFT_PARENTHESES: "(",
  4549. CHAR_RIGHT_PARENTHESES: ")",
  4550. CHAR_ASTERISK: "*",
  4551. CHAR_AMPERSAND: "&",
  4552. CHAR_AT: "@",
  4553. CHAR_BACKSLASH: "\\",
  4554. CHAR_BACKTICK: "`",
  4555. CHAR_CARRIAGE_RETURN: "\r",
  4556. CHAR_CIRCUMFLEX_ACCENT: "^",
  4557. CHAR_COLON: ":",
  4558. CHAR_COMMA: ",",
  4559. CHAR_DOLLAR: "$",
  4560. CHAR_DOT: ".",
  4561. CHAR_DOUBLE_QUOTE: '"',
  4562. CHAR_EQUAL: "=",
  4563. CHAR_EXCLAMATION_MARK: "!",
  4564. CHAR_FORM_FEED: "\f",
  4565. CHAR_FORWARD_SLASH: "/",
  4566. CHAR_HASH: "#",
  4567. CHAR_HYPHEN_MINUS: "-",
  4568. CHAR_LEFT_ANGLE_BRACKET: "<",
  4569. CHAR_LEFT_CURLY_BRACE: "{",
  4570. CHAR_LEFT_SQUARE_BRACKET: "[",
  4571. CHAR_LINE_FEED: "\n",
  4572. CHAR_NO_BREAK_SPACE: "\xA0",
  4573. CHAR_PERCENT: "%",
  4574. CHAR_PLUS: "+",
  4575. CHAR_QUESTION_MARK: "?",
  4576. CHAR_RIGHT_ANGLE_BRACKET: ">",
  4577. CHAR_RIGHT_CURLY_BRACE: "}",
  4578. CHAR_RIGHT_SQUARE_BRACKET: "]",
  4579. CHAR_SEMICOLON: ";",
  4580. CHAR_SINGLE_QUOTE: "'",
  4581. CHAR_SPACE: " ",
  4582. CHAR_TAB: " ",
  4583. CHAR_UNDERSCORE: "_",
  4584. CHAR_VERTICAL_LINE: "|",
  4585. CHAR_ZERO_WIDTH_NOBREAK_SPACE: "\uFEFF"
  4586. };
  4587. }
  4588. });
  4589. var require_parse = __commonJS2({
  4590. "node_modules/braces/lib/parse.js"(exports2, module2) {
  4591. "use strict";
  4592. var stringify2 = require_stringify();
  4593. var {
  4594. MAX_LENGTH,
  4595. CHAR_BACKSLASH,
  4596. CHAR_BACKTICK,
  4597. CHAR_COMMA,
  4598. CHAR_DOT,
  4599. CHAR_LEFT_PARENTHESES,
  4600. CHAR_RIGHT_PARENTHESES,
  4601. CHAR_LEFT_CURLY_BRACE,
  4602. CHAR_RIGHT_CURLY_BRACE,
  4603. CHAR_LEFT_SQUARE_BRACKET,
  4604. CHAR_RIGHT_SQUARE_BRACKET,
  4605. CHAR_DOUBLE_QUOTE,
  4606. CHAR_SINGLE_QUOTE,
  4607. CHAR_NO_BREAK_SPACE,
  4608. CHAR_ZERO_WIDTH_NOBREAK_SPACE
  4609. } = require_constants();
  4610. var parse = (input, options = {}) => {
  4611. if (typeof input !== "string") {
  4612. throw new TypeError("Expected a string");
  4613. }
  4614. let opts = options || {};
  4615. let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  4616. if (input.length > max) {
  4617. throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
  4618. }
  4619. let ast = {
  4620. type: "root",
  4621. input,
  4622. nodes: []
  4623. };
  4624. let stack = [ast];
  4625. let block = ast;
  4626. let prev = ast;
  4627. let brackets = 0;
  4628. let length = input.length;
  4629. let index = 0;
  4630. let depth = 0;
  4631. let value;
  4632. let memo = {};
  4633. const advance = () => input[index++];
  4634. const push = (node) => {
  4635. if (node.type === "text" && prev.type === "dot") {
  4636. prev.type = "text";
  4637. }
  4638. if (prev && prev.type === "text" && node.type === "text") {
  4639. prev.value += node.value;
  4640. return;
  4641. }
  4642. block.nodes.push(node);
  4643. node.parent = block;
  4644. node.prev = prev;
  4645. prev = node;
  4646. return node;
  4647. };
  4648. push({
  4649. type: "bos"
  4650. });
  4651. while (index < length) {
  4652. block = stack[stack.length - 1];
  4653. value = advance();
  4654. if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
  4655. continue;
  4656. }
  4657. if (value === CHAR_BACKSLASH) {
  4658. push({
  4659. type: "text",
  4660. value: (options.keepEscaping ? value : "") + advance()
  4661. });
  4662. continue;
  4663. }
  4664. if (value === CHAR_RIGHT_SQUARE_BRACKET) {
  4665. push({
  4666. type: "text",
  4667. value: "\\" + value
  4668. });
  4669. continue;
  4670. }
  4671. if (value === CHAR_LEFT_SQUARE_BRACKET) {
  4672. brackets++;
  4673. let closed = true;
  4674. let next;
  4675. while (index < length && (next = advance())) {
  4676. value += next;
  4677. if (next === CHAR_LEFT_SQUARE_BRACKET) {
  4678. brackets++;
  4679. continue;
  4680. }
  4681. if (next === CHAR_BACKSLASH) {
  4682. value += advance();
  4683. continue;
  4684. }
  4685. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  4686. brackets--;
  4687. if (brackets === 0) {
  4688. break;
  4689. }
  4690. }
  4691. }
  4692. push({
  4693. type: "text",
  4694. value
  4695. });
  4696. continue;
  4697. }
  4698. if (value === CHAR_LEFT_PARENTHESES) {
  4699. block = push({
  4700. type: "paren",
  4701. nodes: []
  4702. });
  4703. stack.push(block);
  4704. push({
  4705. type: "text",
  4706. value
  4707. });
  4708. continue;
  4709. }
  4710. if (value === CHAR_RIGHT_PARENTHESES) {
  4711. if (block.type !== "paren") {
  4712. push({
  4713. type: "text",
  4714. value
  4715. });
  4716. continue;
  4717. }
  4718. block = stack.pop();
  4719. push({
  4720. type: "text",
  4721. value
  4722. });
  4723. block = stack[stack.length - 1];
  4724. continue;
  4725. }
  4726. if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
  4727. let open = value;
  4728. let next;
  4729. if (options.keepQuotes !== true) {
  4730. value = "";
  4731. }
  4732. while (index < length && (next = advance())) {
  4733. if (next === CHAR_BACKSLASH) {
  4734. value += next + advance();
  4735. continue;
  4736. }
  4737. if (next === open) {
  4738. if (options.keepQuotes === true)
  4739. value += next;
  4740. break;
  4741. }
  4742. value += next;
  4743. }
  4744. push({
  4745. type: "text",
  4746. value
  4747. });
  4748. continue;
  4749. }
  4750. if (value === CHAR_LEFT_CURLY_BRACE) {
  4751. depth++;
  4752. let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
  4753. let brace = {
  4754. type: "brace",
  4755. open: true,
  4756. close: false,
  4757. dollar,
  4758. depth,
  4759. commas: 0,
  4760. ranges: 0,
  4761. nodes: []
  4762. };
  4763. block = push(brace);
  4764. stack.push(block);
  4765. push({
  4766. type: "open",
  4767. value
  4768. });
  4769. continue;
  4770. }
  4771. if (value === CHAR_RIGHT_CURLY_BRACE) {
  4772. if (block.type !== "brace") {
  4773. push({
  4774. type: "text",
  4775. value
  4776. });
  4777. continue;
  4778. }
  4779. let type = "close";
  4780. block = stack.pop();
  4781. block.close = true;
  4782. push({
  4783. type,
  4784. value
  4785. });
  4786. depth--;
  4787. block = stack[stack.length - 1];
  4788. continue;
  4789. }
  4790. if (value === CHAR_COMMA && depth > 0) {
  4791. if (block.ranges > 0) {
  4792. block.ranges = 0;
  4793. let open = block.nodes.shift();
  4794. block.nodes = [open, {
  4795. type: "text",
  4796. value: stringify2(block)
  4797. }];
  4798. }
  4799. push({
  4800. type: "comma",
  4801. value
  4802. });
  4803. block.commas++;
  4804. continue;
  4805. }
  4806. if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
  4807. let siblings = block.nodes;
  4808. if (depth === 0 || siblings.length === 0) {
  4809. push({
  4810. type: "text",
  4811. value
  4812. });
  4813. continue;
  4814. }
  4815. if (prev.type === "dot") {
  4816. block.range = [];
  4817. prev.value += value;
  4818. prev.type = "range";
  4819. if (block.nodes.length !== 3 && block.nodes.length !== 5) {
  4820. block.invalid = true;
  4821. block.ranges = 0;
  4822. prev.type = "text";
  4823. continue;
  4824. }
  4825. block.ranges++;
  4826. block.args = [];
  4827. continue;
  4828. }
  4829. if (prev.type === "range") {
  4830. siblings.pop();
  4831. let before = siblings[siblings.length - 1];
  4832. before.value += prev.value + value;
  4833. prev = before;
  4834. block.ranges--;
  4835. continue;
  4836. }
  4837. push({
  4838. type: "dot",
  4839. value
  4840. });
  4841. continue;
  4842. }
  4843. push({
  4844. type: "text",
  4845. value
  4846. });
  4847. }
  4848. do {
  4849. block = stack.pop();
  4850. if (block.type !== "root") {
  4851. block.nodes.forEach((node) => {
  4852. if (!node.nodes) {
  4853. if (node.type === "open")
  4854. node.isOpen = true;
  4855. if (node.type === "close")
  4856. node.isClose = true;
  4857. if (!node.nodes)
  4858. node.type = "text";
  4859. node.invalid = true;
  4860. }
  4861. });
  4862. let parent = stack[stack.length - 1];
  4863. let index2 = parent.nodes.indexOf(block);
  4864. parent.nodes.splice(index2, 1, ...block.nodes);
  4865. }
  4866. } while (stack.length > 0);
  4867. push({
  4868. type: "eos"
  4869. });
  4870. return ast;
  4871. };
  4872. module2.exports = parse;
  4873. }
  4874. });
  4875. var require_braces = __commonJS2({
  4876. "node_modules/braces/index.js"(exports2, module2) {
  4877. "use strict";
  4878. var stringify2 = require_stringify();
  4879. var compile = require_compile();
  4880. var expand = require_expand();
  4881. var parse = require_parse();
  4882. var braces = (input, options = {}) => {
  4883. let output = [];
  4884. if (Array.isArray(input)) {
  4885. for (let pattern of input) {
  4886. let result = braces.create(pattern, options);
  4887. if (Array.isArray(result)) {
  4888. output.push(...result);
  4889. } else {
  4890. output.push(result);
  4891. }
  4892. }
  4893. } else {
  4894. output = [].concat(braces.create(input, options));
  4895. }
  4896. if (options && options.expand === true && options.nodupes === true) {
  4897. output = [...new Set(output)];
  4898. }
  4899. return output;
  4900. };
  4901. braces.parse = (input, options = {}) => parse(input, options);
  4902. braces.stringify = (input, options = {}) => {
  4903. if (typeof input === "string") {
  4904. return stringify2(braces.parse(input, options), options);
  4905. }
  4906. return stringify2(input, options);
  4907. };
  4908. braces.compile = (input, options = {}) => {
  4909. if (typeof input === "string") {
  4910. input = braces.parse(input, options);
  4911. }
  4912. return compile(input, options);
  4913. };
  4914. braces.expand = (input, options = {}) => {
  4915. if (typeof input === "string") {
  4916. input = braces.parse(input, options);
  4917. }
  4918. let result = expand(input, options);
  4919. if (options.noempty === true) {
  4920. result = result.filter(Boolean);
  4921. }
  4922. if (options.nodupes === true) {
  4923. result = [...new Set(result)];
  4924. }
  4925. return result;
  4926. };
  4927. braces.create = (input, options = {}) => {
  4928. if (input === "" || input.length < 3) {
  4929. return [input];
  4930. }
  4931. return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options);
  4932. };
  4933. module2.exports = braces;
  4934. }
  4935. });
  4936. var require_constants2 = __commonJS2({
  4937. "node_modules/picomatch/lib/constants.js"(exports2, module2) {
  4938. "use strict";
  4939. var path = require("path");
  4940. var WIN_SLASH = "\\\\/";
  4941. var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  4942. var DOT_LITERAL = "\\.";
  4943. var PLUS_LITERAL = "\\+";
  4944. var QMARK_LITERAL = "\\?";
  4945. var SLASH_LITERAL = "\\/";
  4946. var ONE_CHAR = "(?=.)";
  4947. var QMARK = "[^/]";
  4948. var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  4949. var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  4950. var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  4951. var NO_DOT = `(?!${DOT_LITERAL})`;
  4952. var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  4953. var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  4954. var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  4955. var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  4956. var STAR = `${QMARK}*?`;
  4957. var POSIX_CHARS = {
  4958. DOT_LITERAL,
  4959. PLUS_LITERAL,
  4960. QMARK_LITERAL,
  4961. SLASH_LITERAL,
  4962. ONE_CHAR,
  4963. QMARK,
  4964. END_ANCHOR,
  4965. DOTS_SLASH,
  4966. NO_DOT,
  4967. NO_DOTS,
  4968. NO_DOT_SLASH,
  4969. NO_DOTS_SLASH,
  4970. QMARK_NO_DOT,
  4971. STAR,
  4972. START_ANCHOR
  4973. };
  4974. var WINDOWS_CHARS = Object.assign(Object.assign({}, POSIX_CHARS), {}, {
  4975. SLASH_LITERAL: `[${WIN_SLASH}]`,
  4976. QMARK: WIN_NO_SLASH,
  4977. STAR: `${WIN_NO_SLASH}*?`,
  4978. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  4979. NO_DOT: `(?!${DOT_LITERAL})`,
  4980. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  4981. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  4982. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  4983. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  4984. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  4985. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  4986. });
  4987. var POSIX_REGEX_SOURCE = {
  4988. alnum: "a-zA-Z0-9",
  4989. alpha: "a-zA-Z",
  4990. ascii: "\\x00-\\x7F",
  4991. blank: " \\t",
  4992. cntrl: "\\x00-\\x1F\\x7F",
  4993. digit: "0-9",
  4994. graph: "\\x21-\\x7E",
  4995. lower: "a-z",
  4996. print: "\\x20-\\x7E ",
  4997. punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
  4998. space: " \\t\\r\\n\\v\\f",
  4999. upper: "A-Z",
  5000. word: "A-Za-z0-9_",
  5001. xdigit: "A-Fa-f0-9"
  5002. };
  5003. module2.exports = {
  5004. MAX_LENGTH: 1024 * 64,
  5005. POSIX_REGEX_SOURCE,
  5006. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  5007. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  5008. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  5009. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  5010. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  5011. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  5012. REPLACEMENTS: {
  5013. "***": "*",
  5014. "**/**": "**",
  5015. "**/**/**": "**"
  5016. },
  5017. CHAR_0: 48,
  5018. CHAR_9: 57,
  5019. CHAR_UPPERCASE_A: 65,
  5020. CHAR_LOWERCASE_A: 97,
  5021. CHAR_UPPERCASE_Z: 90,
  5022. CHAR_LOWERCASE_Z: 122,
  5023. CHAR_LEFT_PARENTHESES: 40,
  5024. CHAR_RIGHT_PARENTHESES: 41,
  5025. CHAR_ASTERISK: 42,
  5026. CHAR_AMPERSAND: 38,
  5027. CHAR_AT: 64,
  5028. CHAR_BACKWARD_SLASH: 92,
  5029. CHAR_CARRIAGE_RETURN: 13,
  5030. CHAR_CIRCUMFLEX_ACCENT: 94,
  5031. CHAR_COLON: 58,
  5032. CHAR_COMMA: 44,
  5033. CHAR_DOT: 46,
  5034. CHAR_DOUBLE_QUOTE: 34,
  5035. CHAR_EQUAL: 61,
  5036. CHAR_EXCLAMATION_MARK: 33,
  5037. CHAR_FORM_FEED: 12,
  5038. CHAR_FORWARD_SLASH: 47,
  5039. CHAR_GRAVE_ACCENT: 96,
  5040. CHAR_HASH: 35,
  5041. CHAR_HYPHEN_MINUS: 45,
  5042. CHAR_LEFT_ANGLE_BRACKET: 60,
  5043. CHAR_LEFT_CURLY_BRACE: 123,
  5044. CHAR_LEFT_SQUARE_BRACKET: 91,
  5045. CHAR_LINE_FEED: 10,
  5046. CHAR_NO_BREAK_SPACE: 160,
  5047. CHAR_PERCENT: 37,
  5048. CHAR_PLUS: 43,
  5049. CHAR_QUESTION_MARK: 63,
  5050. CHAR_RIGHT_ANGLE_BRACKET: 62,
  5051. CHAR_RIGHT_CURLY_BRACE: 125,
  5052. CHAR_RIGHT_SQUARE_BRACKET: 93,
  5053. CHAR_SEMICOLON: 59,
  5054. CHAR_SINGLE_QUOTE: 39,
  5055. CHAR_SPACE: 32,
  5056. CHAR_TAB: 9,
  5057. CHAR_UNDERSCORE: 95,
  5058. CHAR_VERTICAL_LINE: 124,
  5059. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
  5060. SEP: path.sep,
  5061. extglobChars(chars) {
  5062. return {
  5063. "!": {
  5064. type: "negate",
  5065. open: "(?:(?!(?:",
  5066. close: `))${chars.STAR})`
  5067. },
  5068. "?": {
  5069. type: "qmark",
  5070. open: "(?:",
  5071. close: ")?"
  5072. },
  5073. "+": {
  5074. type: "plus",
  5075. open: "(?:",
  5076. close: ")+"
  5077. },
  5078. "*": {
  5079. type: "star",
  5080. open: "(?:",
  5081. close: ")*"
  5082. },
  5083. "@": {
  5084. type: "at",
  5085. open: "(?:",
  5086. close: ")"
  5087. }
  5088. };
  5089. },
  5090. globChars(win32) {
  5091. return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  5092. }
  5093. };
  5094. }
  5095. });
  5096. var require_utils3 = __commonJS2({
  5097. "node_modules/picomatch/lib/utils.js"(exports2) {
  5098. "use strict";
  5099. var path = require("path");
  5100. var win32 = process.platform === "win32";
  5101. var {
  5102. REGEX_BACKSLASH,
  5103. REGEX_REMOVE_BACKSLASH,
  5104. REGEX_SPECIAL_CHARS,
  5105. REGEX_SPECIAL_CHARS_GLOBAL
  5106. } = require_constants2();
  5107. exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
  5108. exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
  5109. exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
  5110. exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
  5111. exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
  5112. exports2.removeBackslashes = (str) => {
  5113. return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
  5114. return match === "\\" ? "" : match;
  5115. });
  5116. };
  5117. exports2.supportsLookbehinds = () => {
  5118. const segs = process.version.slice(1).split(".").map(Number);
  5119. if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
  5120. return true;
  5121. }
  5122. return false;
  5123. };
  5124. exports2.isWindows = (options) => {
  5125. if (options && typeof options.windows === "boolean") {
  5126. return options.windows;
  5127. }
  5128. return win32 === true || path.sep === "\\";
  5129. };
  5130. exports2.escapeLast = (input, char, lastIdx) => {
  5131. const idx = input.lastIndexOf(char, lastIdx);
  5132. if (idx === -1)
  5133. return input;
  5134. if (input[idx - 1] === "\\")
  5135. return exports2.escapeLast(input, char, idx - 1);
  5136. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  5137. };
  5138. exports2.removePrefix = (input, state = {}) => {
  5139. let output = input;
  5140. if (output.startsWith("./")) {
  5141. output = output.slice(2);
  5142. state.prefix = "./";
  5143. }
  5144. return output;
  5145. };
  5146. exports2.wrapOutput = (input, state = {}, options = {}) => {
  5147. const prepend = options.contains ? "" : "^";
  5148. const append = options.contains ? "" : "$";
  5149. let output = `${prepend}(?:${input})${append}`;
  5150. if (state.negated === true) {
  5151. output = `(?:^(?!${output}).*$)`;
  5152. }
  5153. return output;
  5154. };
  5155. }
  5156. });
  5157. var require_scan = __commonJS2({
  5158. "node_modules/picomatch/lib/scan.js"(exports2, module2) {
  5159. "use strict";
  5160. var utils = require_utils3();
  5161. var {
  5162. CHAR_ASTERISK,
  5163. CHAR_AT,
  5164. CHAR_BACKWARD_SLASH,
  5165. CHAR_COMMA,
  5166. CHAR_DOT,
  5167. CHAR_EXCLAMATION_MARK,
  5168. CHAR_FORWARD_SLASH,
  5169. CHAR_LEFT_CURLY_BRACE,
  5170. CHAR_LEFT_PARENTHESES,
  5171. CHAR_LEFT_SQUARE_BRACKET,
  5172. CHAR_PLUS,
  5173. CHAR_QUESTION_MARK,
  5174. CHAR_RIGHT_CURLY_BRACE,
  5175. CHAR_RIGHT_PARENTHESES,
  5176. CHAR_RIGHT_SQUARE_BRACKET
  5177. } = require_constants2();
  5178. var isPathSeparator = (code) => {
  5179. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  5180. };
  5181. var depth = (token) => {
  5182. if (token.isPrefix !== true) {
  5183. token.depth = token.isGlobstar ? Infinity : 1;
  5184. }
  5185. };
  5186. var scan = (input, options) => {
  5187. const opts = options || {};
  5188. const length = input.length - 1;
  5189. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  5190. const slashes = [];
  5191. const tokens = [];
  5192. const parts = [];
  5193. let str = input;
  5194. let index = -1;
  5195. let start = 0;
  5196. let lastIndex = 0;
  5197. let isBrace = false;
  5198. let isBracket = false;
  5199. let isGlob = false;
  5200. let isExtglob = false;
  5201. let isGlobstar = false;
  5202. let braceEscaped = false;
  5203. let backslashes = false;
  5204. let negated = false;
  5205. let negatedExtglob = false;
  5206. let finished = false;
  5207. let braces = 0;
  5208. let prev;
  5209. let code;
  5210. let token = {
  5211. value: "",
  5212. depth: 0,
  5213. isGlob: false
  5214. };
  5215. const eos = () => index >= length;
  5216. const peek = () => str.charCodeAt(index + 1);
  5217. const advance = () => {
  5218. prev = code;
  5219. return str.charCodeAt(++index);
  5220. };
  5221. while (index < length) {
  5222. code = advance();
  5223. let next;
  5224. if (code === CHAR_BACKWARD_SLASH) {
  5225. backslashes = token.backslashes = true;
  5226. code = advance();
  5227. if (code === CHAR_LEFT_CURLY_BRACE) {
  5228. braceEscaped = true;
  5229. }
  5230. continue;
  5231. }
  5232. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  5233. braces++;
  5234. while (eos() !== true && (code = advance())) {
  5235. if (code === CHAR_BACKWARD_SLASH) {
  5236. backslashes = token.backslashes = true;
  5237. advance();
  5238. continue;
  5239. }
  5240. if (code === CHAR_LEFT_CURLY_BRACE) {
  5241. braces++;
  5242. continue;
  5243. }
  5244. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  5245. isBrace = token.isBrace = true;
  5246. isGlob = token.isGlob = true;
  5247. finished = true;
  5248. if (scanToEnd === true) {
  5249. continue;
  5250. }
  5251. break;
  5252. }
  5253. if (braceEscaped !== true && code === CHAR_COMMA) {
  5254. isBrace = token.isBrace = true;
  5255. isGlob = token.isGlob = true;
  5256. finished = true;
  5257. if (scanToEnd === true) {
  5258. continue;
  5259. }
  5260. break;
  5261. }
  5262. if (code === CHAR_RIGHT_CURLY_BRACE) {
  5263. braces--;
  5264. if (braces === 0) {
  5265. braceEscaped = false;
  5266. isBrace = token.isBrace = true;
  5267. finished = true;
  5268. break;
  5269. }
  5270. }
  5271. }
  5272. if (scanToEnd === true) {
  5273. continue;
  5274. }
  5275. break;
  5276. }
  5277. if (code === CHAR_FORWARD_SLASH) {
  5278. slashes.push(index);
  5279. tokens.push(token);
  5280. token = {
  5281. value: "",
  5282. depth: 0,
  5283. isGlob: false
  5284. };
  5285. if (finished === true)
  5286. continue;
  5287. if (prev === CHAR_DOT && index === start + 1) {
  5288. start += 2;
  5289. continue;
  5290. }
  5291. lastIndex = index + 1;
  5292. continue;
  5293. }
  5294. if (opts.noext !== true) {
  5295. const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
  5296. if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
  5297. isGlob = token.isGlob = true;
  5298. isExtglob = token.isExtglob = true;
  5299. finished = true;
  5300. if (code === CHAR_EXCLAMATION_MARK && index === start) {
  5301. negatedExtglob = true;
  5302. }
  5303. if (scanToEnd === true) {
  5304. while (eos() !== true && (code = advance())) {
  5305. if (code === CHAR_BACKWARD_SLASH) {
  5306. backslashes = token.backslashes = true;
  5307. code = advance();
  5308. continue;
  5309. }
  5310. if (code === CHAR_RIGHT_PARENTHESES) {
  5311. isGlob = token.isGlob = true;
  5312. finished = true;
  5313. break;
  5314. }
  5315. }
  5316. continue;
  5317. }
  5318. break;
  5319. }
  5320. }
  5321. if (code === CHAR_ASTERISK) {
  5322. if (prev === CHAR_ASTERISK)
  5323. isGlobstar = token.isGlobstar = true;
  5324. isGlob = token.isGlob = true;
  5325. finished = true;
  5326. if (scanToEnd === true) {
  5327. continue;
  5328. }
  5329. break;
  5330. }
  5331. if (code === CHAR_QUESTION_MARK) {
  5332. isGlob = token.isGlob = true;
  5333. finished = true;
  5334. if (scanToEnd === true) {
  5335. continue;
  5336. }
  5337. break;
  5338. }
  5339. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  5340. while (eos() !== true && (next = advance())) {
  5341. if (next === CHAR_BACKWARD_SLASH) {
  5342. backslashes = token.backslashes = true;
  5343. advance();
  5344. continue;
  5345. }
  5346. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  5347. isBracket = token.isBracket = true;
  5348. isGlob = token.isGlob = true;
  5349. finished = true;
  5350. break;
  5351. }
  5352. }
  5353. if (scanToEnd === true) {
  5354. continue;
  5355. }
  5356. break;
  5357. }
  5358. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  5359. negated = token.negated = true;
  5360. start++;
  5361. continue;
  5362. }
  5363. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  5364. isGlob = token.isGlob = true;
  5365. if (scanToEnd === true) {
  5366. while (eos() !== true && (code = advance())) {
  5367. if (code === CHAR_LEFT_PARENTHESES) {
  5368. backslashes = token.backslashes = true;
  5369. code = advance();
  5370. continue;
  5371. }
  5372. if (code === CHAR_RIGHT_PARENTHESES) {
  5373. finished = true;
  5374. break;
  5375. }
  5376. }
  5377. continue;
  5378. }
  5379. break;
  5380. }
  5381. if (isGlob === true) {
  5382. finished = true;
  5383. if (scanToEnd === true) {
  5384. continue;
  5385. }
  5386. break;
  5387. }
  5388. }
  5389. if (opts.noext === true) {
  5390. isExtglob = false;
  5391. isGlob = false;
  5392. }
  5393. let base = str;
  5394. let prefix = "";
  5395. let glob = "";
  5396. if (start > 0) {
  5397. prefix = str.slice(0, start);
  5398. str = str.slice(start);
  5399. lastIndex -= start;
  5400. }
  5401. if (base && isGlob === true && lastIndex > 0) {
  5402. base = str.slice(0, lastIndex);
  5403. glob = str.slice(lastIndex);
  5404. } else if (isGlob === true) {
  5405. base = "";
  5406. glob = str;
  5407. } else {
  5408. base = str;
  5409. }
  5410. if (base && base !== "" && base !== "/" && base !== str) {
  5411. if (isPathSeparator(base.charCodeAt(base.length - 1))) {
  5412. base = base.slice(0, -1);
  5413. }
  5414. }
  5415. if (opts.unescape === true) {
  5416. if (glob)
  5417. glob = utils.removeBackslashes(glob);
  5418. if (base && backslashes === true) {
  5419. base = utils.removeBackslashes(base);
  5420. }
  5421. }
  5422. const state = {
  5423. prefix,
  5424. input,
  5425. start,
  5426. base,
  5427. glob,
  5428. isBrace,
  5429. isBracket,
  5430. isGlob,
  5431. isExtglob,
  5432. isGlobstar,
  5433. negated,
  5434. negatedExtglob
  5435. };
  5436. if (opts.tokens === true) {
  5437. state.maxDepth = 0;
  5438. if (!isPathSeparator(code)) {
  5439. tokens.push(token);
  5440. }
  5441. state.tokens = tokens;
  5442. }
  5443. if (opts.parts === true || opts.tokens === true) {
  5444. let prevIndex;
  5445. for (let idx = 0; idx < slashes.length; idx++) {
  5446. const n = prevIndex ? prevIndex + 1 : start;
  5447. const i = slashes[idx];
  5448. const value = input.slice(n, i);
  5449. if (opts.tokens) {
  5450. if (idx === 0 && start !== 0) {
  5451. tokens[idx].isPrefix = true;
  5452. tokens[idx].value = prefix;
  5453. } else {
  5454. tokens[idx].value = value;
  5455. }
  5456. depth(tokens[idx]);
  5457. state.maxDepth += tokens[idx].depth;
  5458. }
  5459. if (idx !== 0 || value !== "") {
  5460. parts.push(value);
  5461. }
  5462. prevIndex = i;
  5463. }
  5464. if (prevIndex && prevIndex + 1 < input.length) {
  5465. const value = input.slice(prevIndex + 1);
  5466. parts.push(value);
  5467. if (opts.tokens) {
  5468. tokens[tokens.length - 1].value = value;
  5469. depth(tokens[tokens.length - 1]);
  5470. state.maxDepth += tokens[tokens.length - 1].depth;
  5471. }
  5472. }
  5473. state.slashes = slashes;
  5474. state.parts = parts;
  5475. }
  5476. return state;
  5477. };
  5478. module2.exports = scan;
  5479. }
  5480. });
  5481. var require_parse2 = __commonJS2({
  5482. "node_modules/picomatch/lib/parse.js"(exports2, module2) {
  5483. "use strict";
  5484. var constants = require_constants2();
  5485. var utils = require_utils3();
  5486. var {
  5487. MAX_LENGTH,
  5488. POSIX_REGEX_SOURCE,
  5489. REGEX_NON_SPECIAL_CHARS,
  5490. REGEX_SPECIAL_CHARS_BACKREF,
  5491. REPLACEMENTS
  5492. } = constants;
  5493. var expandRange = (args, options) => {
  5494. if (typeof options.expandRange === "function") {
  5495. return options.expandRange(...args, options);
  5496. }
  5497. args.sort();
  5498. const value = `[${args.join("-")}]`;
  5499. try {
  5500. new RegExp(value);
  5501. } catch (ex) {
  5502. return args.map((v) => utils.escapeRegex(v)).join("..");
  5503. }
  5504. return value;
  5505. };
  5506. var syntaxError = (type, char) => {
  5507. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  5508. };
  5509. var parse = (input, options) => {
  5510. if (typeof input !== "string") {
  5511. throw new TypeError("Expected a string");
  5512. }
  5513. input = REPLACEMENTS[input] || input;
  5514. const opts = Object.assign({}, options);
  5515. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  5516. let len = input.length;
  5517. if (len > max) {
  5518. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  5519. }
  5520. const bos = {
  5521. type: "bos",
  5522. value: "",
  5523. output: opts.prepend || ""
  5524. };
  5525. const tokens = [bos];
  5526. const capture = opts.capture ? "" : "?:";
  5527. const win32 = utils.isWindows(options);
  5528. const PLATFORM_CHARS = constants.globChars(win32);
  5529. const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
  5530. const {
  5531. DOT_LITERAL,
  5532. PLUS_LITERAL,
  5533. SLASH_LITERAL,
  5534. ONE_CHAR,
  5535. DOTS_SLASH,
  5536. NO_DOT,
  5537. NO_DOT_SLASH,
  5538. NO_DOTS_SLASH,
  5539. QMARK,
  5540. QMARK_NO_DOT,
  5541. STAR,
  5542. START_ANCHOR
  5543. } = PLATFORM_CHARS;
  5544. const globstar = (opts2) => {
  5545. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  5546. };
  5547. const nodot = opts.dot ? "" : NO_DOT;
  5548. const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  5549. let star = opts.bash === true ? globstar(opts) : STAR;
  5550. if (opts.capture) {
  5551. star = `(${star})`;
  5552. }
  5553. if (typeof opts.noext === "boolean") {
  5554. opts.noextglob = opts.noext;
  5555. }
  5556. const state = {
  5557. input,
  5558. index: -1,
  5559. start: 0,
  5560. dot: opts.dot === true,
  5561. consumed: "",
  5562. output: "",
  5563. prefix: "",
  5564. backtrack: false,
  5565. negated: false,
  5566. brackets: 0,
  5567. braces: 0,
  5568. parens: 0,
  5569. quotes: 0,
  5570. globstar: false,
  5571. tokens
  5572. };
  5573. input = utils.removePrefix(input, state);
  5574. len = input.length;
  5575. const extglobs = [];
  5576. const braces = [];
  5577. const stack = [];
  5578. let prev = bos;
  5579. let value;
  5580. const eos = () => state.index === len - 1;
  5581. const peek = state.peek = (n = 1) => input[state.index + n];
  5582. const advance = state.advance = () => input[++state.index] || "";
  5583. const remaining = () => input.slice(state.index + 1);
  5584. const consume = (value2 = "", num = 0) => {
  5585. state.consumed += value2;
  5586. state.index += num;
  5587. };
  5588. const append = (token) => {
  5589. state.output += token.output != null ? token.output : token.value;
  5590. consume(token.value);
  5591. };
  5592. const negate = () => {
  5593. let count = 1;
  5594. while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
  5595. advance();
  5596. state.start++;
  5597. count++;
  5598. }
  5599. if (count % 2 === 0) {
  5600. return false;
  5601. }
  5602. state.negated = true;
  5603. state.start++;
  5604. return true;
  5605. };
  5606. const increment = (type) => {
  5607. state[type]++;
  5608. stack.push(type);
  5609. };
  5610. const decrement = (type) => {
  5611. state[type]--;
  5612. stack.pop();
  5613. };
  5614. const push = (tok) => {
  5615. if (prev.type === "globstar") {
  5616. const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
  5617. const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
  5618. if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
  5619. state.output = state.output.slice(0, -prev.output.length);
  5620. prev.type = "star";
  5621. prev.value = "*";
  5622. prev.output = star;
  5623. state.output += prev.output;
  5624. }
  5625. }
  5626. if (extglobs.length && tok.type !== "paren") {
  5627. extglobs[extglobs.length - 1].inner += tok.value;
  5628. }
  5629. if (tok.value || tok.output)
  5630. append(tok);
  5631. if (prev && prev.type === "text" && tok.type === "text") {
  5632. prev.value += tok.value;
  5633. prev.output = (prev.output || "") + tok.value;
  5634. return;
  5635. }
  5636. tok.prev = prev;
  5637. tokens.push(tok);
  5638. prev = tok;
  5639. };
  5640. const extglobOpen = (type, value2) => {
  5641. const token = Object.assign(Object.assign({}, EXTGLOB_CHARS[value2]), {}, {
  5642. conditions: 1,
  5643. inner: ""
  5644. });
  5645. token.prev = prev;
  5646. token.parens = state.parens;
  5647. token.output = state.output;
  5648. const output = (opts.capture ? "(" : "") + token.open;
  5649. increment("parens");
  5650. push({
  5651. type,
  5652. value: value2,
  5653. output: state.output ? "" : ONE_CHAR
  5654. });
  5655. push({
  5656. type: "paren",
  5657. extglob: true,
  5658. value: advance(),
  5659. output
  5660. });
  5661. extglobs.push(token);
  5662. };
  5663. const extglobClose = (token) => {
  5664. let output = token.close + (opts.capture ? ")" : "");
  5665. let rest;
  5666. if (token.type === "negate") {
  5667. let extglobStar = star;
  5668. if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
  5669. extglobStar = globstar(opts);
  5670. }
  5671. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
  5672. output = token.close = `)$))${extglobStar}`;
  5673. }
  5674. if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
  5675. const expression = parse(rest, Object.assign(Object.assign({}, options), {}, {
  5676. fastpaths: false
  5677. })).output;
  5678. output = token.close = `)${expression})${extglobStar})`;
  5679. }
  5680. if (token.prev.type === "bos") {
  5681. state.negatedExtglob = true;
  5682. }
  5683. }
  5684. push({
  5685. type: "paren",
  5686. extglob: true,
  5687. value,
  5688. output
  5689. });
  5690. decrement("parens");
  5691. };
  5692. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  5693. let backslashes = false;
  5694. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
  5695. if (first === "\\") {
  5696. backslashes = true;
  5697. return m;
  5698. }
  5699. if (first === "?") {
  5700. if (esc) {
  5701. return esc + first + (rest ? QMARK.repeat(rest.length) : "");
  5702. }
  5703. if (index === 0) {
  5704. return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
  5705. }
  5706. return QMARK.repeat(chars.length);
  5707. }
  5708. if (first === ".") {
  5709. return DOT_LITERAL.repeat(chars.length);
  5710. }
  5711. if (first === "*") {
  5712. if (esc) {
  5713. return esc + first + (rest ? star : "");
  5714. }
  5715. return star;
  5716. }
  5717. return esc ? m : `\\${m}`;
  5718. });
  5719. if (backslashes === true) {
  5720. if (opts.unescape === true) {
  5721. output = output.replace(/\\/g, "");
  5722. } else {
  5723. output = output.replace(/\\+/g, (m) => {
  5724. return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
  5725. });
  5726. }
  5727. }
  5728. if (output === input && opts.contains === true) {
  5729. state.output = input;
  5730. return state;
  5731. }
  5732. state.output = utils.wrapOutput(output, state, options);
  5733. return state;
  5734. }
  5735. while (!eos()) {
  5736. value = advance();
  5737. if (value === "\0") {
  5738. continue;
  5739. }
  5740. if (value === "\\") {
  5741. const next = peek();
  5742. if (next === "/" && opts.bash !== true) {
  5743. continue;
  5744. }
  5745. if (next === "." || next === ";") {
  5746. continue;
  5747. }
  5748. if (!next) {
  5749. value += "\\";
  5750. push({
  5751. type: "text",
  5752. value
  5753. });
  5754. continue;
  5755. }
  5756. const match = /^\\+/.exec(remaining());
  5757. let slashes = 0;
  5758. if (match && match[0].length > 2) {
  5759. slashes = match[0].length;
  5760. state.index += slashes;
  5761. if (slashes % 2 !== 0) {
  5762. value += "\\";
  5763. }
  5764. }
  5765. if (opts.unescape === true) {
  5766. value = advance();
  5767. } else {
  5768. value += advance();
  5769. }
  5770. if (state.brackets === 0) {
  5771. push({
  5772. type: "text",
  5773. value
  5774. });
  5775. continue;
  5776. }
  5777. }
  5778. if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
  5779. if (opts.posix !== false && value === ":") {
  5780. const inner = prev.value.slice(1);
  5781. if (inner.includes("[")) {
  5782. prev.posix = true;
  5783. if (inner.includes(":")) {
  5784. const idx = prev.value.lastIndexOf("[");
  5785. const pre = prev.value.slice(0, idx);
  5786. const rest2 = prev.value.slice(idx + 2);
  5787. const posix = POSIX_REGEX_SOURCE[rest2];
  5788. if (posix) {
  5789. prev.value = pre + posix;
  5790. state.backtrack = true;
  5791. advance();
  5792. if (!bos.output && tokens.indexOf(prev) === 1) {
  5793. bos.output = ONE_CHAR;
  5794. }
  5795. continue;
  5796. }
  5797. }
  5798. }
  5799. }
  5800. if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
  5801. value = `\\${value}`;
  5802. }
  5803. if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
  5804. value = `\\${value}`;
  5805. }
  5806. if (opts.posix === true && value === "!" && prev.value === "[") {
  5807. value = "^";
  5808. }
  5809. prev.value += value;
  5810. append({
  5811. value
  5812. });
  5813. continue;
  5814. }
  5815. if (state.quotes === 1 && value !== '"') {
  5816. value = utils.escapeRegex(value);
  5817. prev.value += value;
  5818. append({
  5819. value
  5820. });
  5821. continue;
  5822. }
  5823. if (value === '"') {
  5824. state.quotes = state.quotes === 1 ? 0 : 1;
  5825. if (opts.keepQuotes === true) {
  5826. push({
  5827. type: "text",
  5828. value
  5829. });
  5830. }
  5831. continue;
  5832. }
  5833. if (value === "(") {
  5834. increment("parens");
  5835. push({
  5836. type: "paren",
  5837. value
  5838. });
  5839. continue;
  5840. }
  5841. if (value === ")") {
  5842. if (state.parens === 0 && opts.strictBrackets === true) {
  5843. throw new SyntaxError(syntaxError("opening", "("));
  5844. }
  5845. const extglob = extglobs[extglobs.length - 1];
  5846. if (extglob && state.parens === extglob.parens + 1) {
  5847. extglobClose(extglobs.pop());
  5848. continue;
  5849. }
  5850. push({
  5851. type: "paren",
  5852. value,
  5853. output: state.parens ? ")" : "\\)"
  5854. });
  5855. decrement("parens");
  5856. continue;
  5857. }
  5858. if (value === "[") {
  5859. if (opts.nobracket === true || !remaining().includes("]")) {
  5860. if (opts.nobracket !== true && opts.strictBrackets === true) {
  5861. throw new SyntaxError(syntaxError("closing", "]"));
  5862. }
  5863. value = `\\${value}`;
  5864. } else {
  5865. increment("brackets");
  5866. }
  5867. push({
  5868. type: "bracket",
  5869. value
  5870. });
  5871. continue;
  5872. }
  5873. if (value === "]") {
  5874. if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
  5875. push({
  5876. type: "text",
  5877. value,
  5878. output: `\\${value}`
  5879. });
  5880. continue;
  5881. }
  5882. if (state.brackets === 0) {
  5883. if (opts.strictBrackets === true) {
  5884. throw new SyntaxError(syntaxError("opening", "["));
  5885. }
  5886. push({
  5887. type: "text",
  5888. value,
  5889. output: `\\${value}`
  5890. });
  5891. continue;
  5892. }
  5893. decrement("brackets");
  5894. const prevValue = prev.value.slice(1);
  5895. if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
  5896. value = `/${value}`;
  5897. }
  5898. prev.value += value;
  5899. append({
  5900. value
  5901. });
  5902. if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
  5903. continue;
  5904. }
  5905. const escaped = utils.escapeRegex(prev.value);
  5906. state.output = state.output.slice(0, -prev.value.length);
  5907. if (opts.literalBrackets === true) {
  5908. state.output += escaped;
  5909. prev.value = escaped;
  5910. continue;
  5911. }
  5912. prev.value = `(${capture}${escaped}|${prev.value})`;
  5913. state.output += prev.value;
  5914. continue;
  5915. }
  5916. if (value === "{" && opts.nobrace !== true) {
  5917. increment("braces");
  5918. const open = {
  5919. type: "brace",
  5920. value,
  5921. output: "(",
  5922. outputIndex: state.output.length,
  5923. tokensIndex: state.tokens.length
  5924. };
  5925. braces.push(open);
  5926. push(open);
  5927. continue;
  5928. }
  5929. if (value === "}") {
  5930. const brace = braces[braces.length - 1];
  5931. if (opts.nobrace === true || !brace) {
  5932. push({
  5933. type: "text",
  5934. value,
  5935. output: value
  5936. });
  5937. continue;
  5938. }
  5939. let output = ")";
  5940. if (brace.dots === true) {
  5941. const arr = tokens.slice();
  5942. const range = [];
  5943. for (let i = arr.length - 1; i >= 0; i--) {
  5944. tokens.pop();
  5945. if (arr[i].type === "brace") {
  5946. break;
  5947. }
  5948. if (arr[i].type !== "dots") {
  5949. range.unshift(arr[i].value);
  5950. }
  5951. }
  5952. output = expandRange(range, opts);
  5953. state.backtrack = true;
  5954. }
  5955. if (brace.comma !== true && brace.dots !== true) {
  5956. const out = state.output.slice(0, brace.outputIndex);
  5957. const toks = state.tokens.slice(brace.tokensIndex);
  5958. brace.value = brace.output = "\\{";
  5959. value = output = "\\}";
  5960. state.output = out;
  5961. for (const t of toks) {
  5962. state.output += t.output || t.value;
  5963. }
  5964. }
  5965. push({
  5966. type: "brace",
  5967. value,
  5968. output
  5969. });
  5970. decrement("braces");
  5971. braces.pop();
  5972. continue;
  5973. }
  5974. if (value === "|") {
  5975. if (extglobs.length > 0) {
  5976. extglobs[extglobs.length - 1].conditions++;
  5977. }
  5978. push({
  5979. type: "text",
  5980. value
  5981. });
  5982. continue;
  5983. }
  5984. if (value === ",") {
  5985. let output = value;
  5986. const brace = braces[braces.length - 1];
  5987. if (brace && stack[stack.length - 1] === "braces") {
  5988. brace.comma = true;
  5989. output = "|";
  5990. }
  5991. push({
  5992. type: "comma",
  5993. value,
  5994. output
  5995. });
  5996. continue;
  5997. }
  5998. if (value === "/") {
  5999. if (prev.type === "dot" && state.index === state.start + 1) {
  6000. state.start = state.index + 1;
  6001. state.consumed = "";
  6002. state.output = "";
  6003. tokens.pop();
  6004. prev = bos;
  6005. continue;
  6006. }
  6007. push({
  6008. type: "slash",
  6009. value,
  6010. output: SLASH_LITERAL
  6011. });
  6012. continue;
  6013. }
  6014. if (value === ".") {
  6015. if (state.braces > 0 && prev.type === "dot") {
  6016. if (prev.value === ".")
  6017. prev.output = DOT_LITERAL;
  6018. const brace = braces[braces.length - 1];
  6019. prev.type = "dots";
  6020. prev.output += value;
  6021. prev.value += value;
  6022. brace.dots = true;
  6023. continue;
  6024. }
  6025. if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
  6026. push({
  6027. type: "text",
  6028. value,
  6029. output: DOT_LITERAL
  6030. });
  6031. continue;
  6032. }
  6033. push({
  6034. type: "dot",
  6035. value,
  6036. output: DOT_LITERAL
  6037. });
  6038. continue;
  6039. }
  6040. if (value === "?") {
  6041. const isGroup = prev && prev.value === "(";
  6042. if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6043. extglobOpen("qmark", value);
  6044. continue;
  6045. }
  6046. if (prev && prev.type === "paren") {
  6047. const next = peek();
  6048. let output = value;
  6049. if (next === "<" && !utils.supportsLookbehinds()) {
  6050. throw new Error("Node.js v10 or higher is required for regex lookbehinds");
  6051. }
  6052. if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
  6053. output = `\\${value}`;
  6054. }
  6055. push({
  6056. type: "text",
  6057. value,
  6058. output
  6059. });
  6060. continue;
  6061. }
  6062. if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
  6063. push({
  6064. type: "qmark",
  6065. value,
  6066. output: QMARK_NO_DOT
  6067. });
  6068. continue;
  6069. }
  6070. push({
  6071. type: "qmark",
  6072. value,
  6073. output: QMARK
  6074. });
  6075. continue;
  6076. }
  6077. if (value === "!") {
  6078. if (opts.noextglob !== true && peek() === "(") {
  6079. if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
  6080. extglobOpen("negate", value);
  6081. continue;
  6082. }
  6083. }
  6084. if (opts.nonegate !== true && state.index === 0) {
  6085. negate();
  6086. continue;
  6087. }
  6088. }
  6089. if (value === "+") {
  6090. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6091. extglobOpen("plus", value);
  6092. continue;
  6093. }
  6094. if (prev && prev.value === "(" || opts.regex === false) {
  6095. push({
  6096. type: "plus",
  6097. value,
  6098. output: PLUS_LITERAL
  6099. });
  6100. continue;
  6101. }
  6102. if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
  6103. push({
  6104. type: "plus",
  6105. value
  6106. });
  6107. continue;
  6108. }
  6109. push({
  6110. type: "plus",
  6111. value: PLUS_LITERAL
  6112. });
  6113. continue;
  6114. }
  6115. if (value === "@") {
  6116. if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
  6117. push({
  6118. type: "at",
  6119. extglob: true,
  6120. value,
  6121. output: ""
  6122. });
  6123. continue;
  6124. }
  6125. push({
  6126. type: "text",
  6127. value
  6128. });
  6129. continue;
  6130. }
  6131. if (value !== "*") {
  6132. if (value === "$" || value === "^") {
  6133. value = `\\${value}`;
  6134. }
  6135. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  6136. if (match) {
  6137. value += match[0];
  6138. state.index += match[0].length;
  6139. }
  6140. push({
  6141. type: "text",
  6142. value
  6143. });
  6144. continue;
  6145. }
  6146. if (prev && (prev.type === "globstar" || prev.star === true)) {
  6147. prev.type = "star";
  6148. prev.star = true;
  6149. prev.value += value;
  6150. prev.output = star;
  6151. state.backtrack = true;
  6152. state.globstar = true;
  6153. consume(value);
  6154. continue;
  6155. }
  6156. let rest = remaining();
  6157. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  6158. extglobOpen("star", value);
  6159. continue;
  6160. }
  6161. if (prev.type === "star") {
  6162. if (opts.noglobstar === true) {
  6163. consume(value);
  6164. continue;
  6165. }
  6166. const prior = prev.prev;
  6167. const before = prior.prev;
  6168. const isStart = prior.type === "slash" || prior.type === "bos";
  6169. const afterStar = before && (before.type === "star" || before.type === "globstar");
  6170. if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
  6171. push({
  6172. type: "star",
  6173. value,
  6174. output: ""
  6175. });
  6176. continue;
  6177. }
  6178. const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
  6179. const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
  6180. if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
  6181. push({
  6182. type: "star",
  6183. value,
  6184. output: ""
  6185. });
  6186. continue;
  6187. }
  6188. while (rest.slice(0, 3) === "/**") {
  6189. const after = input[state.index + 4];
  6190. if (after && after !== "/") {
  6191. break;
  6192. }
  6193. rest = rest.slice(3);
  6194. consume("/**", 3);
  6195. }
  6196. if (prior.type === "bos" && eos()) {
  6197. prev.type = "globstar";
  6198. prev.value += value;
  6199. prev.output = globstar(opts);
  6200. state.output = prev.output;
  6201. state.globstar = true;
  6202. consume(value);
  6203. continue;
  6204. }
  6205. if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
  6206. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6207. prior.output = `(?:${prior.output}`;
  6208. prev.type = "globstar";
  6209. prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
  6210. prev.value += value;
  6211. state.globstar = true;
  6212. state.output += prior.output + prev.output;
  6213. consume(value);
  6214. continue;
  6215. }
  6216. if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
  6217. const end = rest[1] !== void 0 ? "|$" : "";
  6218. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  6219. prior.output = `(?:${prior.output}`;
  6220. prev.type = "globstar";
  6221. prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
  6222. prev.value += value;
  6223. state.output += prior.output + prev.output;
  6224. state.globstar = true;
  6225. consume(value + advance());
  6226. push({
  6227. type: "slash",
  6228. value: "/",
  6229. output: ""
  6230. });
  6231. continue;
  6232. }
  6233. if (prior.type === "bos" && rest[0] === "/") {
  6234. prev.type = "globstar";
  6235. prev.value += value;
  6236. prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
  6237. state.output = prev.output;
  6238. state.globstar = true;
  6239. consume(value + advance());
  6240. push({
  6241. type: "slash",
  6242. value: "/",
  6243. output: ""
  6244. });
  6245. continue;
  6246. }
  6247. state.output = state.output.slice(0, -prev.output.length);
  6248. prev.type = "globstar";
  6249. prev.output = globstar(opts);
  6250. prev.value += value;
  6251. state.output += prev.output;
  6252. state.globstar = true;
  6253. consume(value);
  6254. continue;
  6255. }
  6256. const token = {
  6257. type: "star",
  6258. value,
  6259. output: star
  6260. };
  6261. if (opts.bash === true) {
  6262. token.output = ".*?";
  6263. if (prev.type === "bos" || prev.type === "slash") {
  6264. token.output = nodot + token.output;
  6265. }
  6266. push(token);
  6267. continue;
  6268. }
  6269. if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
  6270. token.output = value;
  6271. push(token);
  6272. continue;
  6273. }
  6274. if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
  6275. if (prev.type === "dot") {
  6276. state.output += NO_DOT_SLASH;
  6277. prev.output += NO_DOT_SLASH;
  6278. } else if (opts.dot === true) {
  6279. state.output += NO_DOTS_SLASH;
  6280. prev.output += NO_DOTS_SLASH;
  6281. } else {
  6282. state.output += nodot;
  6283. prev.output += nodot;
  6284. }
  6285. if (peek() !== "*") {
  6286. state.output += ONE_CHAR;
  6287. prev.output += ONE_CHAR;
  6288. }
  6289. }
  6290. push(token);
  6291. }
  6292. while (state.brackets > 0) {
  6293. if (opts.strictBrackets === true)
  6294. throw new SyntaxError(syntaxError("closing", "]"));
  6295. state.output = utils.escapeLast(state.output, "[");
  6296. decrement("brackets");
  6297. }
  6298. while (state.parens > 0) {
  6299. if (opts.strictBrackets === true)
  6300. throw new SyntaxError(syntaxError("closing", ")"));
  6301. state.output = utils.escapeLast(state.output, "(");
  6302. decrement("parens");
  6303. }
  6304. while (state.braces > 0) {
  6305. if (opts.strictBrackets === true)
  6306. throw new SyntaxError(syntaxError("closing", "}"));
  6307. state.output = utils.escapeLast(state.output, "{");
  6308. decrement("braces");
  6309. }
  6310. if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
  6311. push({
  6312. type: "maybe_slash",
  6313. value: "",
  6314. output: `${SLASH_LITERAL}?`
  6315. });
  6316. }
  6317. if (state.backtrack === true) {
  6318. state.output = "";
  6319. for (const token of state.tokens) {
  6320. state.output += token.output != null ? token.output : token.value;
  6321. if (token.suffix) {
  6322. state.output += token.suffix;
  6323. }
  6324. }
  6325. }
  6326. return state;
  6327. };
  6328. parse.fastpaths = (input, options) => {
  6329. const opts = Object.assign({}, options);
  6330. const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  6331. const len = input.length;
  6332. if (len > max) {
  6333. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  6334. }
  6335. input = REPLACEMENTS[input] || input;
  6336. const win32 = utils.isWindows(options);
  6337. const {
  6338. DOT_LITERAL,
  6339. SLASH_LITERAL,
  6340. ONE_CHAR,
  6341. DOTS_SLASH,
  6342. NO_DOT,
  6343. NO_DOTS,
  6344. NO_DOTS_SLASH,
  6345. STAR,
  6346. START_ANCHOR
  6347. } = constants.globChars(win32);
  6348. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  6349. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  6350. const capture = opts.capture ? "" : "?:";
  6351. const state = {
  6352. negated: false,
  6353. prefix: ""
  6354. };
  6355. let star = opts.bash === true ? ".*?" : STAR;
  6356. if (opts.capture) {
  6357. star = `(${star})`;
  6358. }
  6359. const globstar = (opts2) => {
  6360. if (opts2.noglobstar === true)
  6361. return star;
  6362. return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  6363. };
  6364. const create = (str) => {
  6365. switch (str) {
  6366. case "*":
  6367. return `${nodot}${ONE_CHAR}${star}`;
  6368. case ".*":
  6369. return `${DOT_LITERAL}${ONE_CHAR}${star}`;
  6370. case "*.*":
  6371. return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6372. case "*/*":
  6373. return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
  6374. case "**":
  6375. return nodot + globstar(opts);
  6376. case "**/*":
  6377. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
  6378. case "**/*.*":
  6379. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  6380. case "**/.*":
  6381. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
  6382. default: {
  6383. const match = /^(.*?)\.(\w+)$/.exec(str);
  6384. if (!match)
  6385. return;
  6386. const source2 = create(match[1]);
  6387. if (!source2)
  6388. return;
  6389. return source2 + DOT_LITERAL + match[2];
  6390. }
  6391. }
  6392. };
  6393. const output = utils.removePrefix(input, state);
  6394. let source = create(output);
  6395. if (source && opts.strictSlashes !== true) {
  6396. source += `${SLASH_LITERAL}?`;
  6397. }
  6398. return source;
  6399. };
  6400. module2.exports = parse;
  6401. }
  6402. });
  6403. var require_picomatch = __commonJS2({
  6404. "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
  6405. "use strict";
  6406. var path = require("path");
  6407. var scan = require_scan();
  6408. var parse = require_parse2();
  6409. var utils = require_utils3();
  6410. var constants = require_constants2();
  6411. var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
  6412. var picomatch = (glob, options, returnState = false) => {
  6413. if (Array.isArray(glob)) {
  6414. const fns = glob.map((input) => picomatch(input, options, returnState));
  6415. const arrayMatcher = (str) => {
  6416. for (const isMatch of fns) {
  6417. const state2 = isMatch(str);
  6418. if (state2)
  6419. return state2;
  6420. }
  6421. return false;
  6422. };
  6423. return arrayMatcher;
  6424. }
  6425. const isState = isObject(glob) && glob.tokens && glob.input;
  6426. if (glob === "" || typeof glob !== "string" && !isState) {
  6427. throw new TypeError("Expected pattern to be a non-empty string");
  6428. }
  6429. const opts = options || {};
  6430. const posix = utils.isWindows(options);
  6431. const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
  6432. const state = regex.state;
  6433. delete regex.state;
  6434. let isIgnored = () => false;
  6435. if (opts.ignore) {
  6436. const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
  6437. ignore: null,
  6438. onMatch: null,
  6439. onResult: null
  6440. });
  6441. isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
  6442. }
  6443. const matcher = (input, returnObject = false) => {
  6444. const {
  6445. isMatch,
  6446. match,
  6447. output
  6448. } = picomatch.test(input, regex, options, {
  6449. glob,
  6450. posix
  6451. });
  6452. const result = {
  6453. glob,
  6454. state,
  6455. regex,
  6456. posix,
  6457. input,
  6458. output,
  6459. match,
  6460. isMatch
  6461. };
  6462. if (typeof opts.onResult === "function") {
  6463. opts.onResult(result);
  6464. }
  6465. if (isMatch === false) {
  6466. result.isMatch = false;
  6467. return returnObject ? result : false;
  6468. }
  6469. if (isIgnored(input)) {
  6470. if (typeof opts.onIgnore === "function") {
  6471. opts.onIgnore(result);
  6472. }
  6473. result.isMatch = false;
  6474. return returnObject ? result : false;
  6475. }
  6476. if (typeof opts.onMatch === "function") {
  6477. opts.onMatch(result);
  6478. }
  6479. return returnObject ? result : true;
  6480. };
  6481. if (returnState) {
  6482. matcher.state = state;
  6483. }
  6484. return matcher;
  6485. };
  6486. picomatch.test = (input, regex, options, {
  6487. glob,
  6488. posix
  6489. } = {}) => {
  6490. if (typeof input !== "string") {
  6491. throw new TypeError("Expected input to be a string");
  6492. }
  6493. if (input === "") {
  6494. return {
  6495. isMatch: false,
  6496. output: ""
  6497. };
  6498. }
  6499. const opts = options || {};
  6500. const format = opts.format || (posix ? utils.toPosixSlashes : null);
  6501. let match = input === glob;
  6502. let output = match && format ? format(input) : input;
  6503. if (match === false) {
  6504. output = format ? format(input) : input;
  6505. match = output === glob;
  6506. }
  6507. if (match === false || opts.capture === true) {
  6508. if (opts.matchBase === true || opts.basename === true) {
  6509. match = picomatch.matchBase(input, regex, options, posix);
  6510. } else {
  6511. match = regex.exec(output);
  6512. }
  6513. }
  6514. return {
  6515. isMatch: Boolean(match),
  6516. match,
  6517. output
  6518. };
  6519. };
  6520. picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
  6521. const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
  6522. return regex.test(path.basename(input));
  6523. };
  6524. picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6525. picomatch.parse = (pattern, options) => {
  6526. if (Array.isArray(pattern))
  6527. return pattern.map((p) => picomatch.parse(p, options));
  6528. return parse(pattern, Object.assign(Object.assign({}, options), {}, {
  6529. fastpaths: false
  6530. }));
  6531. };
  6532. picomatch.scan = (input, options) => scan(input, options);
  6533. picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
  6534. if (returnOutput === true) {
  6535. return state.output;
  6536. }
  6537. const opts = options || {};
  6538. const prepend = opts.contains ? "" : "^";
  6539. const append = opts.contains ? "" : "$";
  6540. let source = `${prepend}(?:${state.output})${append}`;
  6541. if (state && state.negated === true) {
  6542. source = `^(?!${source}).*$`;
  6543. }
  6544. const regex = picomatch.toRegex(source, options);
  6545. if (returnState === true) {
  6546. regex.state = state;
  6547. }
  6548. return regex;
  6549. };
  6550. picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  6551. if (!input || typeof input !== "string") {
  6552. throw new TypeError("Expected a non-empty string");
  6553. }
  6554. let parsed = {
  6555. negated: false,
  6556. fastpaths: true
  6557. };
  6558. if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
  6559. parsed.output = parse.fastpaths(input, options);
  6560. }
  6561. if (!parsed.output) {
  6562. parsed = parse(input, options);
  6563. }
  6564. return picomatch.compileRe(parsed, options, returnOutput, returnState);
  6565. };
  6566. picomatch.toRegex = (source, options) => {
  6567. try {
  6568. const opts = options || {};
  6569. return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
  6570. } catch (err) {
  6571. if (options && options.debug === true)
  6572. throw err;
  6573. return /$^/;
  6574. }
  6575. };
  6576. picomatch.constants = constants;
  6577. module2.exports = picomatch;
  6578. }
  6579. });
  6580. var require_picomatch2 = __commonJS2({
  6581. "node_modules/picomatch/index.js"(exports2, module2) {
  6582. "use strict";
  6583. module2.exports = require_picomatch();
  6584. }
  6585. });
  6586. var require_micromatch = __commonJS2({
  6587. "node_modules/micromatch/index.js"(exports2, module2) {
  6588. "use strict";
  6589. var util = require("util");
  6590. var braces = require_braces();
  6591. var picomatch = require_picomatch2();
  6592. var utils = require_utils3();
  6593. var isEmptyString = (val) => val === "" || val === "./";
  6594. var micromatch = (list, patterns, options) => {
  6595. patterns = [].concat(patterns);
  6596. list = [].concat(list);
  6597. let omit = /* @__PURE__ */ new Set();
  6598. let keep = /* @__PURE__ */ new Set();
  6599. let items = /* @__PURE__ */ new Set();
  6600. let negatives = 0;
  6601. let onResult = (state) => {
  6602. items.add(state.output);
  6603. if (options && options.onResult) {
  6604. options.onResult(state);
  6605. }
  6606. };
  6607. for (let i = 0; i < patterns.length; i++) {
  6608. let isMatch = picomatch(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
  6609. onResult
  6610. }), true);
  6611. let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
  6612. if (negated)
  6613. negatives++;
  6614. for (let item of list) {
  6615. let matched = isMatch(item, true);
  6616. let match = negated ? !matched.isMatch : matched.isMatch;
  6617. if (!match)
  6618. continue;
  6619. if (negated) {
  6620. omit.add(matched.output);
  6621. } else {
  6622. omit.delete(matched.output);
  6623. keep.add(matched.output);
  6624. }
  6625. }
  6626. }
  6627. let result = negatives === patterns.length ? [...items] : [...keep];
  6628. let matches = result.filter((item) => !omit.has(item));
  6629. if (options && matches.length === 0) {
  6630. if (options.failglob === true) {
  6631. throw new Error(`No matches found for "${patterns.join(", ")}"`);
  6632. }
  6633. if (options.nonull === true || options.nullglob === true) {
  6634. return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
  6635. }
  6636. }
  6637. return matches;
  6638. };
  6639. micromatch.match = micromatch;
  6640. micromatch.matcher = (pattern, options) => picomatch(pattern, options);
  6641. micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
  6642. micromatch.any = micromatch.isMatch;
  6643. micromatch.not = (list, patterns, options = {}) => {
  6644. patterns = [].concat(patterns).map(String);
  6645. let result = /* @__PURE__ */ new Set();
  6646. let items = [];
  6647. let onResult = (state) => {
  6648. if (options.onResult)
  6649. options.onResult(state);
  6650. items.push(state.output);
  6651. };
  6652. let matches = new Set(micromatch(list, patterns, Object.assign(Object.assign({}, options), {}, {
  6653. onResult
  6654. })));
  6655. for (let item of items) {
  6656. if (!matches.has(item)) {
  6657. result.add(item);
  6658. }
  6659. }
  6660. return [...result];
  6661. };
  6662. micromatch.contains = (str, pattern, options) => {
  6663. if (typeof str !== "string") {
  6664. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6665. }
  6666. if (Array.isArray(pattern)) {
  6667. return pattern.some((p) => micromatch.contains(str, p, options));
  6668. }
  6669. if (typeof pattern === "string") {
  6670. if (isEmptyString(str) || isEmptyString(pattern)) {
  6671. return false;
  6672. }
  6673. if (str.includes(pattern) || str.startsWith("./") && str.slice(2).includes(pattern)) {
  6674. return true;
  6675. }
  6676. }
  6677. return micromatch.isMatch(str, pattern, Object.assign(Object.assign({}, options), {}, {
  6678. contains: true
  6679. }));
  6680. };
  6681. micromatch.matchKeys = (obj, patterns, options) => {
  6682. if (!utils.isObject(obj)) {
  6683. throw new TypeError("Expected the first argument to be an object");
  6684. }
  6685. let keys = micromatch(Object.keys(obj), patterns, options);
  6686. let res = {};
  6687. for (let key of keys)
  6688. res[key] = obj[key];
  6689. return res;
  6690. };
  6691. micromatch.some = (list, patterns, options) => {
  6692. let items = [].concat(list);
  6693. for (let pattern of [].concat(patterns)) {
  6694. let isMatch = picomatch(String(pattern), options);
  6695. if (items.some((item) => isMatch(item))) {
  6696. return true;
  6697. }
  6698. }
  6699. return false;
  6700. };
  6701. micromatch.every = (list, patterns, options) => {
  6702. let items = [].concat(list);
  6703. for (let pattern of [].concat(patterns)) {
  6704. let isMatch = picomatch(String(pattern), options);
  6705. if (!items.every((item) => isMatch(item))) {
  6706. return false;
  6707. }
  6708. }
  6709. return true;
  6710. };
  6711. micromatch.all = (str, patterns, options) => {
  6712. if (typeof str !== "string") {
  6713. throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
  6714. }
  6715. return [].concat(patterns).every((p) => picomatch(p, options)(str));
  6716. };
  6717. micromatch.capture = (glob, input, options) => {
  6718. let posix = utils.isWindows(options);
  6719. let regex = picomatch.makeRe(String(glob), Object.assign(Object.assign({}, options), {}, {
  6720. capture: true
  6721. }));
  6722. let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
  6723. if (match) {
  6724. return match.slice(1).map((v) => v === void 0 ? "" : v);
  6725. }
  6726. };
  6727. micromatch.makeRe = (...args) => picomatch.makeRe(...args);
  6728. micromatch.scan = (...args) => picomatch.scan(...args);
  6729. micromatch.parse = (patterns, options) => {
  6730. let res = [];
  6731. for (let pattern of [].concat(patterns || [])) {
  6732. for (let str of braces(String(pattern), options)) {
  6733. res.push(picomatch.parse(str, options));
  6734. }
  6735. }
  6736. return res;
  6737. };
  6738. micromatch.braces = (pattern, options) => {
  6739. if (typeof pattern !== "string")
  6740. throw new TypeError("Expected a string");
  6741. if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) {
  6742. return [pattern];
  6743. }
  6744. return braces(pattern, options);
  6745. };
  6746. micromatch.braceExpand = (pattern, options) => {
  6747. if (typeof pattern !== "string")
  6748. throw new TypeError("Expected a string");
  6749. return micromatch.braces(pattern, Object.assign(Object.assign({}, options), {}, {
  6750. expand: true
  6751. }));
  6752. };
  6753. module2.exports = micromatch;
  6754. }
  6755. });
  6756. var require_pattern = __commonJS2({
  6757. "node_modules/fast-glob/out/utils/pattern.js"(exports2) {
  6758. "use strict";
  6759. Object.defineProperty(exports2, "__esModule", {
  6760. value: true
  6761. });
  6762. 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;
  6763. var path = require("path");
  6764. var globParent = require_glob_parent();
  6765. var micromatch = require_micromatch();
  6766. var GLOBSTAR = "**";
  6767. var ESCAPE_SYMBOL = "\\";
  6768. var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
  6769. var REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
  6770. var REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
  6771. var GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
  6772. var BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
  6773. function isStaticPattern(pattern, options = {}) {
  6774. return !isDynamicPattern(pattern, options);
  6775. }
  6776. exports2.isStaticPattern = isStaticPattern;
  6777. function isDynamicPattern(pattern, options = {}) {
  6778. if (pattern === "") {
  6779. return false;
  6780. }
  6781. if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
  6782. return true;
  6783. }
  6784. if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
  6785. return true;
  6786. }
  6787. if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
  6788. return true;
  6789. }
  6790. if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
  6791. return true;
  6792. }
  6793. return false;
  6794. }
  6795. exports2.isDynamicPattern = isDynamicPattern;
  6796. function hasBraceExpansion(pattern) {
  6797. const openingBraceIndex = pattern.indexOf("{");
  6798. if (openingBraceIndex === -1) {
  6799. return false;
  6800. }
  6801. const closingBraceIndex = pattern.indexOf("}", openingBraceIndex + 1);
  6802. if (closingBraceIndex === -1) {
  6803. return false;
  6804. }
  6805. const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
  6806. return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
  6807. }
  6808. function convertToPositivePattern(pattern) {
  6809. return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
  6810. }
  6811. exports2.convertToPositivePattern = convertToPositivePattern;
  6812. function convertToNegativePattern(pattern) {
  6813. return "!" + pattern;
  6814. }
  6815. exports2.convertToNegativePattern = convertToNegativePattern;
  6816. function isNegativePattern(pattern) {
  6817. return pattern.startsWith("!") && pattern[1] !== "(";
  6818. }
  6819. exports2.isNegativePattern = isNegativePattern;
  6820. function isPositivePattern(pattern) {
  6821. return !isNegativePattern(pattern);
  6822. }
  6823. exports2.isPositivePattern = isPositivePattern;
  6824. function getNegativePatterns(patterns) {
  6825. return patterns.filter(isNegativePattern);
  6826. }
  6827. exports2.getNegativePatterns = getNegativePatterns;
  6828. function getPositivePatterns(patterns) {
  6829. return patterns.filter(isPositivePattern);
  6830. }
  6831. exports2.getPositivePatterns = getPositivePatterns;
  6832. function getPatternsInsideCurrentDirectory(patterns) {
  6833. return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
  6834. }
  6835. exports2.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
  6836. function getPatternsOutsideCurrentDirectory(patterns) {
  6837. return patterns.filter(isPatternRelatedToParentDirectory);
  6838. }
  6839. exports2.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
  6840. function isPatternRelatedToParentDirectory(pattern) {
  6841. return pattern.startsWith("..") || pattern.startsWith("./..");
  6842. }
  6843. exports2.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
  6844. function getBaseDirectory(pattern) {
  6845. return globParent(pattern, {
  6846. flipBackslashes: false
  6847. });
  6848. }
  6849. exports2.getBaseDirectory = getBaseDirectory;
  6850. function hasGlobStar(pattern) {
  6851. return pattern.includes(GLOBSTAR);
  6852. }
  6853. exports2.hasGlobStar = hasGlobStar;
  6854. function endsWithSlashGlobStar(pattern) {
  6855. return pattern.endsWith("/" + GLOBSTAR);
  6856. }
  6857. exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
  6858. function isAffectDepthOfReadingPattern(pattern) {
  6859. const basename = path.basename(pattern);
  6860. return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
  6861. }
  6862. exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
  6863. function expandPatternsWithBraceExpansion(patterns) {
  6864. return patterns.reduce((collection, pattern) => {
  6865. return collection.concat(expandBraceExpansion(pattern));
  6866. }, []);
  6867. }
  6868. exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
  6869. function expandBraceExpansion(pattern) {
  6870. return micromatch.braces(pattern, {
  6871. expand: true,
  6872. nodupes: true
  6873. });
  6874. }
  6875. exports2.expandBraceExpansion = expandBraceExpansion;
  6876. function getPatternParts(pattern, options) {
  6877. let {
  6878. parts
  6879. } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), {
  6880. parts: true
  6881. }));
  6882. if (parts.length === 0) {
  6883. parts = [pattern];
  6884. }
  6885. if (parts[0].startsWith("/")) {
  6886. parts[0] = parts[0].slice(1);
  6887. parts.unshift("");
  6888. }
  6889. return parts;
  6890. }
  6891. exports2.getPatternParts = getPatternParts;
  6892. function makeRe(pattern, options) {
  6893. return micromatch.makeRe(pattern, options);
  6894. }
  6895. exports2.makeRe = makeRe;
  6896. function convertPatternsToRe(patterns, options) {
  6897. return patterns.map((pattern) => makeRe(pattern, options));
  6898. }
  6899. exports2.convertPatternsToRe = convertPatternsToRe;
  6900. function matchAny(entry, patternsRe) {
  6901. return patternsRe.some((patternRe) => patternRe.test(entry));
  6902. }
  6903. exports2.matchAny = matchAny;
  6904. }
  6905. });
  6906. var require_merge2 = __commonJS2({
  6907. "node_modules/merge2/index.js"(exports2, module2) {
  6908. "use strict";
  6909. var Stream = require("stream");
  6910. var PassThrough = Stream.PassThrough;
  6911. var slice = Array.prototype.slice;
  6912. module2.exports = merge2;
  6913. function merge2() {
  6914. const streamsQueue = [];
  6915. const args = slice.call(arguments);
  6916. let merging = false;
  6917. let options = args[args.length - 1];
  6918. if (options && !Array.isArray(options) && options.pipe == null) {
  6919. args.pop();
  6920. } else {
  6921. options = {};
  6922. }
  6923. const doEnd = options.end !== false;
  6924. const doPipeError = options.pipeError === true;
  6925. if (options.objectMode == null) {
  6926. options.objectMode = true;
  6927. }
  6928. if (options.highWaterMark == null) {
  6929. options.highWaterMark = 64 * 1024;
  6930. }
  6931. const mergedStream = PassThrough(options);
  6932. function addStream() {
  6933. for (let i = 0, len = arguments.length; i < len; i++) {
  6934. streamsQueue.push(pauseStreams(arguments[i], options));
  6935. }
  6936. mergeStream();
  6937. return this;
  6938. }
  6939. function mergeStream() {
  6940. if (merging) {
  6941. return;
  6942. }
  6943. merging = true;
  6944. let streams = streamsQueue.shift();
  6945. if (!streams) {
  6946. process.nextTick(endStream);
  6947. return;
  6948. }
  6949. if (!Array.isArray(streams)) {
  6950. streams = [streams];
  6951. }
  6952. let pipesCount = streams.length + 1;
  6953. function next() {
  6954. if (--pipesCount > 0) {
  6955. return;
  6956. }
  6957. merging = false;
  6958. mergeStream();
  6959. }
  6960. function pipe(stream) {
  6961. function onend() {
  6962. stream.removeListener("merge2UnpipeEnd", onend);
  6963. stream.removeListener("end", onend);
  6964. if (doPipeError) {
  6965. stream.removeListener("error", onerror);
  6966. }
  6967. next();
  6968. }
  6969. function onerror(err) {
  6970. mergedStream.emit("error", err);
  6971. }
  6972. if (stream._readableState.endEmitted) {
  6973. return next();
  6974. }
  6975. stream.on("merge2UnpipeEnd", onend);
  6976. stream.on("end", onend);
  6977. if (doPipeError) {
  6978. stream.on("error", onerror);
  6979. }
  6980. stream.pipe(mergedStream, {
  6981. end: false
  6982. });
  6983. stream.resume();
  6984. }
  6985. for (let i = 0; i < streams.length; i++) {
  6986. pipe(streams[i]);
  6987. }
  6988. next();
  6989. }
  6990. function endStream() {
  6991. merging = false;
  6992. mergedStream.emit("queueDrain");
  6993. if (doEnd) {
  6994. mergedStream.end();
  6995. }
  6996. }
  6997. mergedStream.setMaxListeners(0);
  6998. mergedStream.add = addStream;
  6999. mergedStream.on("unpipe", function(stream) {
  7000. stream.emit("merge2UnpipeEnd");
  7001. });
  7002. if (args.length) {
  7003. addStream.apply(null, args);
  7004. }
  7005. return mergedStream;
  7006. }
  7007. function pauseStreams(streams, options) {
  7008. if (!Array.isArray(streams)) {
  7009. if (!streams._readableState && streams.pipe) {
  7010. streams = streams.pipe(PassThrough(options));
  7011. }
  7012. if (!streams._readableState || !streams.pause || !streams.pipe) {
  7013. throw new Error("Only readable stream can be merged.");
  7014. }
  7015. streams.pause();
  7016. } else {
  7017. for (let i = 0, len = streams.length; i < len; i++) {
  7018. streams[i] = pauseStreams(streams[i], options);
  7019. }
  7020. }
  7021. return streams;
  7022. }
  7023. }
  7024. });
  7025. var require_stream = __commonJS2({
  7026. "node_modules/fast-glob/out/utils/stream.js"(exports2) {
  7027. "use strict";
  7028. Object.defineProperty(exports2, "__esModule", {
  7029. value: true
  7030. });
  7031. exports2.merge = void 0;
  7032. var merge2 = require_merge2();
  7033. function merge(streams) {
  7034. const mergedStream = merge2(streams);
  7035. streams.forEach((stream) => {
  7036. stream.once("error", (error) => mergedStream.emit("error", error));
  7037. });
  7038. mergedStream.once("close", () => propagateCloseEventToSources(streams));
  7039. mergedStream.once("end", () => propagateCloseEventToSources(streams));
  7040. return mergedStream;
  7041. }
  7042. exports2.merge = merge;
  7043. function propagateCloseEventToSources(streams) {
  7044. streams.forEach((stream) => stream.emit("close"));
  7045. }
  7046. }
  7047. });
  7048. var require_string = __commonJS2({
  7049. "node_modules/fast-glob/out/utils/string.js"(exports2) {
  7050. "use strict";
  7051. Object.defineProperty(exports2, "__esModule", {
  7052. value: true
  7053. });
  7054. exports2.isEmpty = exports2.isString = void 0;
  7055. function isString(input) {
  7056. return typeof input === "string";
  7057. }
  7058. exports2.isString = isString;
  7059. function isEmpty(input) {
  7060. return input === "";
  7061. }
  7062. exports2.isEmpty = isEmpty;
  7063. }
  7064. });
  7065. var require_utils4 = __commonJS2({
  7066. "node_modules/fast-glob/out/utils/index.js"(exports2) {
  7067. "use strict";
  7068. Object.defineProperty(exports2, "__esModule", {
  7069. value: true
  7070. });
  7071. exports2.string = exports2.stream = exports2.pattern = exports2.path = exports2.fs = exports2.errno = exports2.array = void 0;
  7072. var array2 = require_array();
  7073. exports2.array = array2;
  7074. var errno = require_errno();
  7075. exports2.errno = errno;
  7076. var fs = require_fs();
  7077. exports2.fs = fs;
  7078. var path = require_path();
  7079. exports2.path = path;
  7080. var pattern = require_pattern();
  7081. exports2.pattern = pattern;
  7082. var stream = require_stream();
  7083. exports2.stream = stream;
  7084. var string = require_string();
  7085. exports2.string = string;
  7086. }
  7087. });
  7088. var require_tasks = __commonJS2({
  7089. "node_modules/fast-glob/out/managers/tasks.js"(exports2) {
  7090. "use strict";
  7091. Object.defineProperty(exports2, "__esModule", {
  7092. value: true
  7093. });
  7094. exports2.convertPatternGroupToTask = exports2.convertPatternGroupsToTasks = exports2.groupPatternsByBaseDirectory = exports2.getNegativePatternsAsPositive = exports2.getPositivePatterns = exports2.convertPatternsToTasks = exports2.generate = void 0;
  7095. var utils = require_utils4();
  7096. function generate(patterns, settings) {
  7097. const positivePatterns = getPositivePatterns(patterns);
  7098. const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
  7099. const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
  7100. const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
  7101. const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, false);
  7102. const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, true);
  7103. return staticTasks.concat(dynamicTasks);
  7104. }
  7105. exports2.generate = generate;
  7106. function convertPatternsToTasks(positive, negative, dynamic) {
  7107. const tasks = [];
  7108. const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive);
  7109. const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive);
  7110. const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
  7111. const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
  7112. tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
  7113. if ("." in insideCurrentDirectoryGroup) {
  7114. tasks.push(convertPatternGroupToTask(".", patternsInsideCurrentDirectory, negative, dynamic));
  7115. } else {
  7116. tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
  7117. }
  7118. return tasks;
  7119. }
  7120. exports2.convertPatternsToTasks = convertPatternsToTasks;
  7121. function getPositivePatterns(patterns) {
  7122. return utils.pattern.getPositivePatterns(patterns);
  7123. }
  7124. exports2.getPositivePatterns = getPositivePatterns;
  7125. function getNegativePatternsAsPositive(patterns, ignore) {
  7126. const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
  7127. const positive = negative.map(utils.pattern.convertToPositivePattern);
  7128. return positive;
  7129. }
  7130. exports2.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
  7131. function groupPatternsByBaseDirectory(patterns) {
  7132. const group = {};
  7133. return patterns.reduce((collection, pattern) => {
  7134. const base = utils.pattern.getBaseDirectory(pattern);
  7135. if (base in collection) {
  7136. collection[base].push(pattern);
  7137. } else {
  7138. collection[base] = [pattern];
  7139. }
  7140. return collection;
  7141. }, group);
  7142. }
  7143. exports2.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
  7144. function convertPatternGroupsToTasks(positive, negative, dynamic) {
  7145. return Object.keys(positive).map((base) => {
  7146. return convertPatternGroupToTask(base, positive[base], negative, dynamic);
  7147. });
  7148. }
  7149. exports2.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
  7150. function convertPatternGroupToTask(base, positive, negative, dynamic) {
  7151. return {
  7152. dynamic,
  7153. positive,
  7154. negative,
  7155. base,
  7156. patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
  7157. };
  7158. }
  7159. exports2.convertPatternGroupToTask = convertPatternGroupToTask;
  7160. }
  7161. });
  7162. var require_patterns = __commonJS2({
  7163. "node_modules/fast-glob/out/managers/patterns.js"(exports2) {
  7164. "use strict";
  7165. Object.defineProperty(exports2, "__esModule", {
  7166. value: true
  7167. });
  7168. exports2.removeDuplicateSlashes = exports2.transform = void 0;
  7169. var DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
  7170. function transform(patterns) {
  7171. return patterns.map((pattern) => removeDuplicateSlashes(pattern));
  7172. }
  7173. exports2.transform = transform;
  7174. function removeDuplicateSlashes(pattern) {
  7175. return pattern.replace(DOUBLE_SLASH_RE, "/");
  7176. }
  7177. exports2.removeDuplicateSlashes = removeDuplicateSlashes;
  7178. }
  7179. });
  7180. var require_async = __commonJS2({
  7181. "node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
  7182. "use strict";
  7183. Object.defineProperty(exports2, "__esModule", {
  7184. value: true
  7185. });
  7186. exports2.read = void 0;
  7187. function read(path, settings, callback) {
  7188. settings.fs.lstat(path, (lstatError, lstat) => {
  7189. if (lstatError !== null) {
  7190. callFailureCallback(callback, lstatError);
  7191. return;
  7192. }
  7193. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7194. callSuccessCallback(callback, lstat);
  7195. return;
  7196. }
  7197. settings.fs.stat(path, (statError, stat) => {
  7198. if (statError !== null) {
  7199. if (settings.throwErrorOnBrokenSymbolicLink) {
  7200. callFailureCallback(callback, statError);
  7201. return;
  7202. }
  7203. callSuccessCallback(callback, lstat);
  7204. return;
  7205. }
  7206. if (settings.markSymbolicLink) {
  7207. stat.isSymbolicLink = () => true;
  7208. }
  7209. callSuccessCallback(callback, stat);
  7210. });
  7211. });
  7212. }
  7213. exports2.read = read;
  7214. function callFailureCallback(callback, error) {
  7215. callback(error);
  7216. }
  7217. function callSuccessCallback(callback, result) {
  7218. callback(null, result);
  7219. }
  7220. }
  7221. });
  7222. var require_sync = __commonJS2({
  7223. "node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
  7224. "use strict";
  7225. Object.defineProperty(exports2, "__esModule", {
  7226. value: true
  7227. });
  7228. exports2.read = void 0;
  7229. function read(path, settings) {
  7230. const lstat = settings.fs.lstatSync(path);
  7231. if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
  7232. return lstat;
  7233. }
  7234. try {
  7235. const stat = settings.fs.statSync(path);
  7236. if (settings.markSymbolicLink) {
  7237. stat.isSymbolicLink = () => true;
  7238. }
  7239. return stat;
  7240. } catch (error) {
  7241. if (!settings.throwErrorOnBrokenSymbolicLink) {
  7242. return lstat;
  7243. }
  7244. throw error;
  7245. }
  7246. }
  7247. exports2.read = read;
  7248. }
  7249. });
  7250. var require_fs2 = __commonJS2({
  7251. "node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
  7252. "use strict";
  7253. Object.defineProperty(exports2, "__esModule", {
  7254. value: true
  7255. });
  7256. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7257. var fs = require("fs");
  7258. exports2.FILE_SYSTEM_ADAPTER = {
  7259. lstat: fs.lstat,
  7260. stat: fs.stat,
  7261. lstatSync: fs.lstatSync,
  7262. statSync: fs.statSync
  7263. };
  7264. function createFileSystemAdapter(fsMethods) {
  7265. if (fsMethods === void 0) {
  7266. return exports2.FILE_SYSTEM_ADAPTER;
  7267. }
  7268. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7269. }
  7270. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7271. }
  7272. });
  7273. var require_settings = __commonJS2({
  7274. "node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
  7275. "use strict";
  7276. Object.defineProperty(exports2, "__esModule", {
  7277. value: true
  7278. });
  7279. var fs = require_fs2();
  7280. var Settings = class {
  7281. constructor(_options = {}) {
  7282. this._options = _options;
  7283. this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
  7284. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7285. this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
  7286. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7287. }
  7288. _getValue(option, value) {
  7289. return option !== null && option !== void 0 ? option : value;
  7290. }
  7291. };
  7292. exports2.default = Settings;
  7293. }
  7294. });
  7295. var require_out = __commonJS2({
  7296. "node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
  7297. "use strict";
  7298. Object.defineProperty(exports2, "__esModule", {
  7299. value: true
  7300. });
  7301. exports2.statSync = exports2.stat = exports2.Settings = void 0;
  7302. var async = require_async();
  7303. var sync = require_sync();
  7304. var settings_1 = require_settings();
  7305. exports2.Settings = settings_1.default;
  7306. function stat(path, optionsOrSettingsOrCallback, callback) {
  7307. if (typeof optionsOrSettingsOrCallback === "function") {
  7308. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7309. return;
  7310. }
  7311. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7312. }
  7313. exports2.stat = stat;
  7314. function statSync(path, optionsOrSettings) {
  7315. const settings = getSettings(optionsOrSettings);
  7316. return sync.read(path, settings);
  7317. }
  7318. exports2.statSync = statSync;
  7319. function getSettings(settingsOrOptions = {}) {
  7320. if (settingsOrOptions instanceof settings_1.default) {
  7321. return settingsOrOptions;
  7322. }
  7323. return new settings_1.default(settingsOrOptions);
  7324. }
  7325. }
  7326. });
  7327. var require_queue_microtask = __commonJS2({
  7328. "node_modules/queue-microtask/index.js"(exports2, module2) {
  7329. var promise;
  7330. module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
  7331. throw err;
  7332. }, 0));
  7333. }
  7334. });
  7335. var require_run_parallel = __commonJS2({
  7336. "node_modules/run-parallel/index.js"(exports2, module2) {
  7337. module2.exports = runParallel;
  7338. var queueMicrotask2 = require_queue_microtask();
  7339. function runParallel(tasks, cb) {
  7340. let results, pending, keys;
  7341. let isSync = true;
  7342. if (Array.isArray(tasks)) {
  7343. results = [];
  7344. pending = tasks.length;
  7345. } else {
  7346. keys = Object.keys(tasks);
  7347. results = {};
  7348. pending = keys.length;
  7349. }
  7350. function done(err) {
  7351. function end() {
  7352. if (cb)
  7353. cb(err, results);
  7354. cb = null;
  7355. }
  7356. if (isSync)
  7357. queueMicrotask2(end);
  7358. else
  7359. end();
  7360. }
  7361. function each(i, err, result) {
  7362. results[i] = result;
  7363. if (--pending === 0 || err) {
  7364. done(err);
  7365. }
  7366. }
  7367. if (!pending) {
  7368. done(null);
  7369. } else if (keys) {
  7370. keys.forEach(function(key) {
  7371. tasks[key](function(err, result) {
  7372. each(key, err, result);
  7373. });
  7374. });
  7375. } else {
  7376. tasks.forEach(function(task, i) {
  7377. task(function(err, result) {
  7378. each(i, err, result);
  7379. });
  7380. });
  7381. }
  7382. isSync = false;
  7383. }
  7384. }
  7385. });
  7386. var require_constants3 = __commonJS2({
  7387. "node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
  7388. "use strict";
  7389. Object.defineProperty(exports2, "__esModule", {
  7390. value: true
  7391. });
  7392. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
  7393. var NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
  7394. if (NODE_PROCESS_VERSION_PARTS[0] === void 0 || NODE_PROCESS_VERSION_PARTS[1] === void 0) {
  7395. throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
  7396. }
  7397. var MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
  7398. var MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
  7399. var SUPPORTED_MAJOR_VERSION = 10;
  7400. var SUPPORTED_MINOR_VERSION = 10;
  7401. var IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
  7402. var IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
  7403. exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
  7404. }
  7405. });
  7406. var require_fs3 = __commonJS2({
  7407. "node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
  7408. "use strict";
  7409. Object.defineProperty(exports2, "__esModule", {
  7410. value: true
  7411. });
  7412. exports2.createDirentFromStats = void 0;
  7413. var DirentFromStats = class {
  7414. constructor(name, stats) {
  7415. this.name = name;
  7416. this.isBlockDevice = stats.isBlockDevice.bind(stats);
  7417. this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
  7418. this.isDirectory = stats.isDirectory.bind(stats);
  7419. this.isFIFO = stats.isFIFO.bind(stats);
  7420. this.isFile = stats.isFile.bind(stats);
  7421. this.isSocket = stats.isSocket.bind(stats);
  7422. this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
  7423. }
  7424. };
  7425. function createDirentFromStats(name, stats) {
  7426. return new DirentFromStats(name, stats);
  7427. }
  7428. exports2.createDirentFromStats = createDirentFromStats;
  7429. }
  7430. });
  7431. var require_utils5 = __commonJS2({
  7432. "node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
  7433. "use strict";
  7434. Object.defineProperty(exports2, "__esModule", {
  7435. value: true
  7436. });
  7437. exports2.fs = void 0;
  7438. var fs = require_fs3();
  7439. exports2.fs = fs;
  7440. }
  7441. });
  7442. var require_common = __commonJS2({
  7443. "node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
  7444. "use strict";
  7445. Object.defineProperty(exports2, "__esModule", {
  7446. value: true
  7447. });
  7448. exports2.joinPathSegments = void 0;
  7449. function joinPathSegments(a, b, separator) {
  7450. if (a.endsWith(separator)) {
  7451. return a + b;
  7452. }
  7453. return a + separator + b;
  7454. }
  7455. exports2.joinPathSegments = joinPathSegments;
  7456. }
  7457. });
  7458. var require_async2 = __commonJS2({
  7459. "node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
  7460. "use strict";
  7461. Object.defineProperty(exports2, "__esModule", {
  7462. value: true
  7463. });
  7464. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7465. var fsStat = require_out();
  7466. var rpl = require_run_parallel();
  7467. var constants_1 = require_constants3();
  7468. var utils = require_utils5();
  7469. var common = require_common();
  7470. function read(directory, settings, callback) {
  7471. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7472. readdirWithFileTypes(directory, settings, callback);
  7473. return;
  7474. }
  7475. readdir(directory, settings, callback);
  7476. }
  7477. exports2.read = read;
  7478. function readdirWithFileTypes(directory, settings, callback) {
  7479. settings.fs.readdir(directory, {
  7480. withFileTypes: true
  7481. }, (readdirError, dirents) => {
  7482. if (readdirError !== null) {
  7483. callFailureCallback(callback, readdirError);
  7484. return;
  7485. }
  7486. const entries = dirents.map((dirent) => ({
  7487. dirent,
  7488. name: dirent.name,
  7489. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7490. }));
  7491. if (!settings.followSymbolicLinks) {
  7492. callSuccessCallback(callback, entries);
  7493. return;
  7494. }
  7495. const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
  7496. rpl(tasks, (rplError, rplEntries) => {
  7497. if (rplError !== null) {
  7498. callFailureCallback(callback, rplError);
  7499. return;
  7500. }
  7501. callSuccessCallback(callback, rplEntries);
  7502. });
  7503. });
  7504. }
  7505. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7506. function makeRplTaskEntry(entry, settings) {
  7507. return (done) => {
  7508. if (!entry.dirent.isSymbolicLink()) {
  7509. done(null, entry);
  7510. return;
  7511. }
  7512. settings.fs.stat(entry.path, (statError, stats) => {
  7513. if (statError !== null) {
  7514. if (settings.throwErrorOnBrokenSymbolicLink) {
  7515. done(statError);
  7516. return;
  7517. }
  7518. done(null, entry);
  7519. return;
  7520. }
  7521. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7522. done(null, entry);
  7523. });
  7524. };
  7525. }
  7526. function readdir(directory, settings, callback) {
  7527. settings.fs.readdir(directory, (readdirError, names) => {
  7528. if (readdirError !== null) {
  7529. callFailureCallback(callback, readdirError);
  7530. return;
  7531. }
  7532. const tasks = names.map((name) => {
  7533. const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7534. return (done) => {
  7535. fsStat.stat(path, settings.fsStatSettings, (error, stats) => {
  7536. if (error !== null) {
  7537. done(error);
  7538. return;
  7539. }
  7540. const entry = {
  7541. name,
  7542. path,
  7543. dirent: utils.fs.createDirentFromStats(name, stats)
  7544. };
  7545. if (settings.stats) {
  7546. entry.stats = stats;
  7547. }
  7548. done(null, entry);
  7549. });
  7550. };
  7551. });
  7552. rpl(tasks, (rplError, entries) => {
  7553. if (rplError !== null) {
  7554. callFailureCallback(callback, rplError);
  7555. return;
  7556. }
  7557. callSuccessCallback(callback, entries);
  7558. });
  7559. });
  7560. }
  7561. exports2.readdir = readdir;
  7562. function callFailureCallback(callback, error) {
  7563. callback(error);
  7564. }
  7565. function callSuccessCallback(callback, result) {
  7566. callback(null, result);
  7567. }
  7568. }
  7569. });
  7570. var require_sync2 = __commonJS2({
  7571. "node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
  7572. "use strict";
  7573. Object.defineProperty(exports2, "__esModule", {
  7574. value: true
  7575. });
  7576. exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
  7577. var fsStat = require_out();
  7578. var constants_1 = require_constants3();
  7579. var utils = require_utils5();
  7580. var common = require_common();
  7581. function read(directory, settings) {
  7582. if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
  7583. return readdirWithFileTypes(directory, settings);
  7584. }
  7585. return readdir(directory, settings);
  7586. }
  7587. exports2.read = read;
  7588. function readdirWithFileTypes(directory, settings) {
  7589. const dirents = settings.fs.readdirSync(directory, {
  7590. withFileTypes: true
  7591. });
  7592. return dirents.map((dirent) => {
  7593. const entry = {
  7594. dirent,
  7595. name: dirent.name,
  7596. path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
  7597. };
  7598. if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
  7599. try {
  7600. const stats = settings.fs.statSync(entry.path);
  7601. entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
  7602. } catch (error) {
  7603. if (settings.throwErrorOnBrokenSymbolicLink) {
  7604. throw error;
  7605. }
  7606. }
  7607. }
  7608. return entry;
  7609. });
  7610. }
  7611. exports2.readdirWithFileTypes = readdirWithFileTypes;
  7612. function readdir(directory, settings) {
  7613. const names = settings.fs.readdirSync(directory);
  7614. return names.map((name) => {
  7615. const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
  7616. const stats = fsStat.statSync(entryPath, settings.fsStatSettings);
  7617. const entry = {
  7618. name,
  7619. path: entryPath,
  7620. dirent: utils.fs.createDirentFromStats(name, stats)
  7621. };
  7622. if (settings.stats) {
  7623. entry.stats = stats;
  7624. }
  7625. return entry;
  7626. });
  7627. }
  7628. exports2.readdir = readdir;
  7629. }
  7630. });
  7631. var require_fs4 = __commonJS2({
  7632. "node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
  7633. "use strict";
  7634. Object.defineProperty(exports2, "__esModule", {
  7635. value: true
  7636. });
  7637. exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
  7638. var fs = require("fs");
  7639. exports2.FILE_SYSTEM_ADAPTER = {
  7640. lstat: fs.lstat,
  7641. stat: fs.stat,
  7642. lstatSync: fs.lstatSync,
  7643. statSync: fs.statSync,
  7644. readdir: fs.readdir,
  7645. readdirSync: fs.readdirSync
  7646. };
  7647. function createFileSystemAdapter(fsMethods) {
  7648. if (fsMethods === void 0) {
  7649. return exports2.FILE_SYSTEM_ADAPTER;
  7650. }
  7651. return Object.assign(Object.assign({}, exports2.FILE_SYSTEM_ADAPTER), fsMethods);
  7652. }
  7653. exports2.createFileSystemAdapter = createFileSystemAdapter;
  7654. }
  7655. });
  7656. var require_settings2 = __commonJS2({
  7657. "node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
  7658. "use strict";
  7659. Object.defineProperty(exports2, "__esModule", {
  7660. value: true
  7661. });
  7662. var path = require("path");
  7663. var fsStat = require_out();
  7664. var fs = require_fs4();
  7665. var Settings = class {
  7666. constructor(_options = {}) {
  7667. this._options = _options;
  7668. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
  7669. this.fs = fs.createFileSystemAdapter(this._options.fs);
  7670. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  7671. this.stats = this._getValue(this._options.stats, false);
  7672. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
  7673. this.fsStatSettings = new fsStat.Settings({
  7674. followSymbolicLink: this.followSymbolicLinks,
  7675. fs: this.fs,
  7676. throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
  7677. });
  7678. }
  7679. _getValue(option, value) {
  7680. return option !== null && option !== void 0 ? option : value;
  7681. }
  7682. };
  7683. exports2.default = Settings;
  7684. }
  7685. });
  7686. var require_out2 = __commonJS2({
  7687. "node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
  7688. "use strict";
  7689. Object.defineProperty(exports2, "__esModule", {
  7690. value: true
  7691. });
  7692. exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
  7693. var async = require_async2();
  7694. var sync = require_sync2();
  7695. var settings_1 = require_settings2();
  7696. exports2.Settings = settings_1.default;
  7697. function scandir(path, optionsOrSettingsOrCallback, callback) {
  7698. if (typeof optionsOrSettingsOrCallback === "function") {
  7699. async.read(path, getSettings(), optionsOrSettingsOrCallback);
  7700. return;
  7701. }
  7702. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  7703. }
  7704. exports2.scandir = scandir;
  7705. function scandirSync(path, optionsOrSettings) {
  7706. const settings = getSettings(optionsOrSettings);
  7707. return sync.read(path, settings);
  7708. }
  7709. exports2.scandirSync = scandirSync;
  7710. function getSettings(settingsOrOptions = {}) {
  7711. if (settingsOrOptions instanceof settings_1.default) {
  7712. return settingsOrOptions;
  7713. }
  7714. return new settings_1.default(settingsOrOptions);
  7715. }
  7716. }
  7717. });
  7718. var require_reusify = __commonJS2({
  7719. "node_modules/reusify/reusify.js"(exports2, module2) {
  7720. "use strict";
  7721. function reusify(Constructor) {
  7722. var head = new Constructor();
  7723. var tail = head;
  7724. function get() {
  7725. var current = head;
  7726. if (current.next) {
  7727. head = current.next;
  7728. } else {
  7729. head = new Constructor();
  7730. tail = head;
  7731. }
  7732. current.next = null;
  7733. return current;
  7734. }
  7735. function release(obj) {
  7736. tail.next = obj;
  7737. tail = obj;
  7738. }
  7739. return {
  7740. get,
  7741. release
  7742. };
  7743. }
  7744. module2.exports = reusify;
  7745. }
  7746. });
  7747. var require_queue = __commonJS2({
  7748. "node_modules/fastq/queue.js"(exports2, module2) {
  7749. "use strict";
  7750. var reusify = require_reusify();
  7751. function fastqueue(context, worker, concurrency) {
  7752. if (typeof context === "function") {
  7753. concurrency = worker;
  7754. worker = context;
  7755. context = null;
  7756. }
  7757. if (concurrency < 1) {
  7758. throw new Error("fastqueue concurrency must be greater than 1");
  7759. }
  7760. var cache = reusify(Task);
  7761. var queueHead = null;
  7762. var queueTail = null;
  7763. var _running = 0;
  7764. var errorHandler = null;
  7765. var self2 = {
  7766. push,
  7767. drain: noop,
  7768. saturated: noop,
  7769. pause,
  7770. paused: false,
  7771. concurrency,
  7772. running,
  7773. resume,
  7774. idle,
  7775. length,
  7776. getQueue,
  7777. unshift,
  7778. empty: noop,
  7779. kill,
  7780. killAndDrain,
  7781. error
  7782. };
  7783. return self2;
  7784. function running() {
  7785. return _running;
  7786. }
  7787. function pause() {
  7788. self2.paused = true;
  7789. }
  7790. function length() {
  7791. var current = queueHead;
  7792. var counter = 0;
  7793. while (current) {
  7794. current = current.next;
  7795. counter++;
  7796. }
  7797. return counter;
  7798. }
  7799. function getQueue() {
  7800. var current = queueHead;
  7801. var tasks = [];
  7802. while (current) {
  7803. tasks.push(current.value);
  7804. current = current.next;
  7805. }
  7806. return tasks;
  7807. }
  7808. function resume() {
  7809. if (!self2.paused)
  7810. return;
  7811. self2.paused = false;
  7812. for (var i = 0; i < self2.concurrency; i++) {
  7813. _running++;
  7814. release();
  7815. }
  7816. }
  7817. function idle() {
  7818. return _running === 0 && self2.length() === 0;
  7819. }
  7820. function push(value, done) {
  7821. var current = cache.get();
  7822. current.context = context;
  7823. current.release = release;
  7824. current.value = value;
  7825. current.callback = done || noop;
  7826. current.errorHandler = errorHandler;
  7827. if (_running === self2.concurrency || self2.paused) {
  7828. if (queueTail) {
  7829. queueTail.next = current;
  7830. queueTail = current;
  7831. } else {
  7832. queueHead = current;
  7833. queueTail = current;
  7834. self2.saturated();
  7835. }
  7836. } else {
  7837. _running++;
  7838. worker.call(context, current.value, current.worked);
  7839. }
  7840. }
  7841. function unshift(value, done) {
  7842. var current = cache.get();
  7843. current.context = context;
  7844. current.release = release;
  7845. current.value = value;
  7846. current.callback = done || noop;
  7847. if (_running === self2.concurrency || self2.paused) {
  7848. if (queueHead) {
  7849. current.next = queueHead;
  7850. queueHead = current;
  7851. } else {
  7852. queueHead = current;
  7853. queueTail = current;
  7854. self2.saturated();
  7855. }
  7856. } else {
  7857. _running++;
  7858. worker.call(context, current.value, current.worked);
  7859. }
  7860. }
  7861. function release(holder) {
  7862. if (holder) {
  7863. cache.release(holder);
  7864. }
  7865. var next = queueHead;
  7866. if (next) {
  7867. if (!self2.paused) {
  7868. if (queueTail === queueHead) {
  7869. queueTail = null;
  7870. }
  7871. queueHead = next.next;
  7872. next.next = null;
  7873. worker.call(context, next.value, next.worked);
  7874. if (queueTail === null) {
  7875. self2.empty();
  7876. }
  7877. } else {
  7878. _running--;
  7879. }
  7880. } else if (--_running === 0) {
  7881. self2.drain();
  7882. }
  7883. }
  7884. function kill() {
  7885. queueHead = null;
  7886. queueTail = null;
  7887. self2.drain = noop;
  7888. }
  7889. function killAndDrain() {
  7890. queueHead = null;
  7891. queueTail = null;
  7892. self2.drain();
  7893. self2.drain = noop;
  7894. }
  7895. function error(handler) {
  7896. errorHandler = handler;
  7897. }
  7898. }
  7899. function noop() {
  7900. }
  7901. function Task() {
  7902. this.value = null;
  7903. this.callback = noop;
  7904. this.next = null;
  7905. this.release = noop;
  7906. this.context = null;
  7907. this.errorHandler = null;
  7908. var self2 = this;
  7909. this.worked = function worked(err, result) {
  7910. var callback = self2.callback;
  7911. var errorHandler = self2.errorHandler;
  7912. var val = self2.value;
  7913. self2.value = null;
  7914. self2.callback = noop;
  7915. if (self2.errorHandler) {
  7916. errorHandler(err, val);
  7917. }
  7918. callback.call(self2.context, err, result);
  7919. self2.release(self2);
  7920. };
  7921. }
  7922. function queueAsPromised(context, worker, concurrency) {
  7923. if (typeof context === "function") {
  7924. concurrency = worker;
  7925. worker = context;
  7926. context = null;
  7927. }
  7928. function asyncWrapper(arg, cb) {
  7929. worker.call(this, arg).then(function(res) {
  7930. cb(null, res);
  7931. }, cb);
  7932. }
  7933. var queue = fastqueue(context, asyncWrapper, concurrency);
  7934. var pushCb = queue.push;
  7935. var unshiftCb = queue.unshift;
  7936. queue.push = push;
  7937. queue.unshift = unshift;
  7938. queue.drained = drained;
  7939. return queue;
  7940. function push(value) {
  7941. var p = new Promise(function(resolve, reject) {
  7942. pushCb(value, function(err, result) {
  7943. if (err) {
  7944. reject(err);
  7945. return;
  7946. }
  7947. resolve(result);
  7948. });
  7949. });
  7950. p.catch(noop);
  7951. return p;
  7952. }
  7953. function unshift(value) {
  7954. var p = new Promise(function(resolve, reject) {
  7955. unshiftCb(value, function(err, result) {
  7956. if (err) {
  7957. reject(err);
  7958. return;
  7959. }
  7960. resolve(result);
  7961. });
  7962. });
  7963. p.catch(noop);
  7964. return p;
  7965. }
  7966. function drained() {
  7967. var previousDrain = queue.drain;
  7968. var p = new Promise(function(resolve) {
  7969. queue.drain = function() {
  7970. previousDrain();
  7971. resolve();
  7972. };
  7973. });
  7974. return p;
  7975. }
  7976. }
  7977. module2.exports = fastqueue;
  7978. module2.exports.promise = queueAsPromised;
  7979. }
  7980. });
  7981. var require_common2 = __commonJS2({
  7982. "node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
  7983. "use strict";
  7984. Object.defineProperty(exports2, "__esModule", {
  7985. value: true
  7986. });
  7987. exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
  7988. function isFatalError(settings, error) {
  7989. if (settings.errorFilter === null) {
  7990. return true;
  7991. }
  7992. return !settings.errorFilter(error);
  7993. }
  7994. exports2.isFatalError = isFatalError;
  7995. function isAppliedFilter(filter, value) {
  7996. return filter === null || filter(value);
  7997. }
  7998. exports2.isAppliedFilter = isAppliedFilter;
  7999. function replacePathSegmentSeparator(filepath, separator) {
  8000. return filepath.split(/[/\\]/).join(separator);
  8001. }
  8002. exports2.replacePathSegmentSeparator = replacePathSegmentSeparator;
  8003. function joinPathSegments(a, b, separator) {
  8004. if (a === "") {
  8005. return b;
  8006. }
  8007. if (a.endsWith(separator)) {
  8008. return a + b;
  8009. }
  8010. return a + separator + b;
  8011. }
  8012. exports2.joinPathSegments = joinPathSegments;
  8013. }
  8014. });
  8015. var require_reader = __commonJS2({
  8016. "node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
  8017. "use strict";
  8018. Object.defineProperty(exports2, "__esModule", {
  8019. value: true
  8020. });
  8021. var common = require_common2();
  8022. var Reader = class {
  8023. constructor(_root, _settings) {
  8024. this._root = _root;
  8025. this._settings = _settings;
  8026. this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
  8027. }
  8028. };
  8029. exports2.default = Reader;
  8030. }
  8031. });
  8032. var require_async3 = __commonJS2({
  8033. "node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
  8034. "use strict";
  8035. Object.defineProperty(exports2, "__esModule", {
  8036. value: true
  8037. });
  8038. var events_1 = require("events");
  8039. var fsScandir = require_out2();
  8040. var fastq = require_queue();
  8041. var common = require_common2();
  8042. var reader_1 = require_reader();
  8043. var AsyncReader = class extends reader_1.default {
  8044. constructor(_root, _settings) {
  8045. super(_root, _settings);
  8046. this._settings = _settings;
  8047. this._scandir = fsScandir.scandir;
  8048. this._emitter = new events_1.EventEmitter();
  8049. this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
  8050. this._isFatalError = false;
  8051. this._isDestroyed = false;
  8052. this._queue.drain = () => {
  8053. if (!this._isFatalError) {
  8054. this._emitter.emit("end");
  8055. }
  8056. };
  8057. }
  8058. read() {
  8059. this._isFatalError = false;
  8060. this._isDestroyed = false;
  8061. setImmediate(() => {
  8062. this._pushToQueue(this._root, this._settings.basePath);
  8063. });
  8064. return this._emitter;
  8065. }
  8066. get isDestroyed() {
  8067. return this._isDestroyed;
  8068. }
  8069. destroy() {
  8070. if (this._isDestroyed) {
  8071. throw new Error("The reader is already destroyed");
  8072. }
  8073. this._isDestroyed = true;
  8074. this._queue.killAndDrain();
  8075. }
  8076. onEntry(callback) {
  8077. this._emitter.on("entry", callback);
  8078. }
  8079. onError(callback) {
  8080. this._emitter.once("error", callback);
  8081. }
  8082. onEnd(callback) {
  8083. this._emitter.once("end", callback);
  8084. }
  8085. _pushToQueue(directory, base) {
  8086. const queueItem = {
  8087. directory,
  8088. base
  8089. };
  8090. this._queue.push(queueItem, (error) => {
  8091. if (error !== null) {
  8092. this._handleError(error);
  8093. }
  8094. });
  8095. }
  8096. _worker(item, done) {
  8097. this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
  8098. if (error !== null) {
  8099. done(error, void 0);
  8100. return;
  8101. }
  8102. for (const entry of entries) {
  8103. this._handleEntry(entry, item.base);
  8104. }
  8105. done(null, void 0);
  8106. });
  8107. }
  8108. _handleError(error) {
  8109. if (this._isDestroyed || !common.isFatalError(this._settings, error)) {
  8110. return;
  8111. }
  8112. this._isFatalError = true;
  8113. this._isDestroyed = true;
  8114. this._emitter.emit("error", error);
  8115. }
  8116. _handleEntry(entry, base) {
  8117. if (this._isDestroyed || this._isFatalError) {
  8118. return;
  8119. }
  8120. const fullpath = entry.path;
  8121. if (base !== void 0) {
  8122. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8123. }
  8124. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8125. this._emitEntry(entry);
  8126. }
  8127. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8128. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8129. }
  8130. }
  8131. _emitEntry(entry) {
  8132. this._emitter.emit("entry", entry);
  8133. }
  8134. };
  8135. exports2.default = AsyncReader;
  8136. }
  8137. });
  8138. var require_async4 = __commonJS2({
  8139. "node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
  8140. "use strict";
  8141. Object.defineProperty(exports2, "__esModule", {
  8142. value: true
  8143. });
  8144. var async_1 = require_async3();
  8145. var AsyncProvider = class {
  8146. constructor(_root, _settings) {
  8147. this._root = _root;
  8148. this._settings = _settings;
  8149. this._reader = new async_1.default(this._root, this._settings);
  8150. this._storage = [];
  8151. }
  8152. read(callback) {
  8153. this._reader.onError((error) => {
  8154. callFailureCallback(callback, error);
  8155. });
  8156. this._reader.onEntry((entry) => {
  8157. this._storage.push(entry);
  8158. });
  8159. this._reader.onEnd(() => {
  8160. callSuccessCallback(callback, this._storage);
  8161. });
  8162. this._reader.read();
  8163. }
  8164. };
  8165. exports2.default = AsyncProvider;
  8166. function callFailureCallback(callback, error) {
  8167. callback(error);
  8168. }
  8169. function callSuccessCallback(callback, entries) {
  8170. callback(null, entries);
  8171. }
  8172. }
  8173. });
  8174. var require_stream2 = __commonJS2({
  8175. "node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
  8176. "use strict";
  8177. Object.defineProperty(exports2, "__esModule", {
  8178. value: true
  8179. });
  8180. var stream_1 = require("stream");
  8181. var async_1 = require_async3();
  8182. var StreamProvider = class {
  8183. constructor(_root, _settings) {
  8184. this._root = _root;
  8185. this._settings = _settings;
  8186. this._reader = new async_1.default(this._root, this._settings);
  8187. this._stream = new stream_1.Readable({
  8188. objectMode: true,
  8189. read: () => {
  8190. },
  8191. destroy: () => {
  8192. if (!this._reader.isDestroyed) {
  8193. this._reader.destroy();
  8194. }
  8195. }
  8196. });
  8197. }
  8198. read() {
  8199. this._reader.onError((error) => {
  8200. this._stream.emit("error", error);
  8201. });
  8202. this._reader.onEntry((entry) => {
  8203. this._stream.push(entry);
  8204. });
  8205. this._reader.onEnd(() => {
  8206. this._stream.push(null);
  8207. });
  8208. this._reader.read();
  8209. return this._stream;
  8210. }
  8211. };
  8212. exports2.default = StreamProvider;
  8213. }
  8214. });
  8215. var require_sync3 = __commonJS2({
  8216. "node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
  8217. "use strict";
  8218. Object.defineProperty(exports2, "__esModule", {
  8219. value: true
  8220. });
  8221. var fsScandir = require_out2();
  8222. var common = require_common2();
  8223. var reader_1 = require_reader();
  8224. var SyncReader = class extends reader_1.default {
  8225. constructor() {
  8226. super(...arguments);
  8227. this._scandir = fsScandir.scandirSync;
  8228. this._storage = [];
  8229. this._queue = /* @__PURE__ */ new Set();
  8230. }
  8231. read() {
  8232. this._pushToQueue(this._root, this._settings.basePath);
  8233. this._handleQueue();
  8234. return this._storage;
  8235. }
  8236. _pushToQueue(directory, base) {
  8237. this._queue.add({
  8238. directory,
  8239. base
  8240. });
  8241. }
  8242. _handleQueue() {
  8243. for (const item of this._queue.values()) {
  8244. this._handleDirectory(item.directory, item.base);
  8245. }
  8246. }
  8247. _handleDirectory(directory, base) {
  8248. try {
  8249. const entries = this._scandir(directory, this._settings.fsScandirSettings);
  8250. for (const entry of entries) {
  8251. this._handleEntry(entry, base);
  8252. }
  8253. } catch (error) {
  8254. this._handleError(error);
  8255. }
  8256. }
  8257. _handleError(error) {
  8258. if (!common.isFatalError(this._settings, error)) {
  8259. return;
  8260. }
  8261. throw error;
  8262. }
  8263. _handleEntry(entry, base) {
  8264. const fullpath = entry.path;
  8265. if (base !== void 0) {
  8266. entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
  8267. }
  8268. if (common.isAppliedFilter(this._settings.entryFilter, entry)) {
  8269. this._pushToStorage(entry);
  8270. }
  8271. if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) {
  8272. this._pushToQueue(fullpath, base === void 0 ? void 0 : entry.path);
  8273. }
  8274. }
  8275. _pushToStorage(entry) {
  8276. this._storage.push(entry);
  8277. }
  8278. };
  8279. exports2.default = SyncReader;
  8280. }
  8281. });
  8282. var require_sync4 = __commonJS2({
  8283. "node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
  8284. "use strict";
  8285. Object.defineProperty(exports2, "__esModule", {
  8286. value: true
  8287. });
  8288. var sync_1 = require_sync3();
  8289. var SyncProvider = class {
  8290. constructor(_root, _settings) {
  8291. this._root = _root;
  8292. this._settings = _settings;
  8293. this._reader = new sync_1.default(this._root, this._settings);
  8294. }
  8295. read() {
  8296. return this._reader.read();
  8297. }
  8298. };
  8299. exports2.default = SyncProvider;
  8300. }
  8301. });
  8302. var require_settings3 = __commonJS2({
  8303. "node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
  8304. "use strict";
  8305. Object.defineProperty(exports2, "__esModule", {
  8306. value: true
  8307. });
  8308. var path = require("path");
  8309. var fsScandir = require_out2();
  8310. var Settings = class {
  8311. constructor(_options = {}) {
  8312. this._options = _options;
  8313. this.basePath = this._getValue(this._options.basePath, void 0);
  8314. this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
  8315. this.deepFilter = this._getValue(this._options.deepFilter, null);
  8316. this.entryFilter = this._getValue(this._options.entryFilter, null);
  8317. this.errorFilter = this._getValue(this._options.errorFilter, null);
  8318. this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
  8319. this.fsScandirSettings = new fsScandir.Settings({
  8320. followSymbolicLinks: this._options.followSymbolicLinks,
  8321. fs: this._options.fs,
  8322. pathSegmentSeparator: this._options.pathSegmentSeparator,
  8323. stats: this._options.stats,
  8324. throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
  8325. });
  8326. }
  8327. _getValue(option, value) {
  8328. return option !== null && option !== void 0 ? option : value;
  8329. }
  8330. };
  8331. exports2.default = Settings;
  8332. }
  8333. });
  8334. var require_out3 = __commonJS2({
  8335. "node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
  8336. "use strict";
  8337. Object.defineProperty(exports2, "__esModule", {
  8338. value: true
  8339. });
  8340. exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
  8341. var async_1 = require_async4();
  8342. var stream_1 = require_stream2();
  8343. var sync_1 = require_sync4();
  8344. var settings_1 = require_settings3();
  8345. exports2.Settings = settings_1.default;
  8346. function walk(directory, optionsOrSettingsOrCallback, callback) {
  8347. if (typeof optionsOrSettingsOrCallback === "function") {
  8348. new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
  8349. return;
  8350. }
  8351. new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
  8352. }
  8353. exports2.walk = walk;
  8354. function walkSync(directory, optionsOrSettings) {
  8355. const settings = getSettings(optionsOrSettings);
  8356. const provider = new sync_1.default(directory, settings);
  8357. return provider.read();
  8358. }
  8359. exports2.walkSync = walkSync;
  8360. function walkStream(directory, optionsOrSettings) {
  8361. const settings = getSettings(optionsOrSettings);
  8362. const provider = new stream_1.default(directory, settings);
  8363. return provider.read();
  8364. }
  8365. exports2.walkStream = walkStream;
  8366. function getSettings(settingsOrOptions = {}) {
  8367. if (settingsOrOptions instanceof settings_1.default) {
  8368. return settingsOrOptions;
  8369. }
  8370. return new settings_1.default(settingsOrOptions);
  8371. }
  8372. }
  8373. });
  8374. var require_reader2 = __commonJS2({
  8375. "node_modules/fast-glob/out/readers/reader.js"(exports2) {
  8376. "use strict";
  8377. Object.defineProperty(exports2, "__esModule", {
  8378. value: true
  8379. });
  8380. var path = require("path");
  8381. var fsStat = require_out();
  8382. var utils = require_utils4();
  8383. var Reader = class {
  8384. constructor(_settings) {
  8385. this._settings = _settings;
  8386. this._fsStatSettings = new fsStat.Settings({
  8387. followSymbolicLink: this._settings.followSymbolicLinks,
  8388. fs: this._settings.fs,
  8389. throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
  8390. });
  8391. }
  8392. _getFullEntryPath(filepath) {
  8393. return path.resolve(this._settings.cwd, filepath);
  8394. }
  8395. _makeEntry(stats, pattern) {
  8396. const entry = {
  8397. name: pattern,
  8398. path: pattern,
  8399. dirent: utils.fs.createDirentFromStats(pattern, stats)
  8400. };
  8401. if (this._settings.stats) {
  8402. entry.stats = stats;
  8403. }
  8404. return entry;
  8405. }
  8406. _isFatalError(error) {
  8407. return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
  8408. }
  8409. };
  8410. exports2.default = Reader;
  8411. }
  8412. });
  8413. var require_stream3 = __commonJS2({
  8414. "node_modules/fast-glob/out/readers/stream.js"(exports2) {
  8415. "use strict";
  8416. Object.defineProperty(exports2, "__esModule", {
  8417. value: true
  8418. });
  8419. var stream_1 = require("stream");
  8420. var fsStat = require_out();
  8421. var fsWalk = require_out3();
  8422. var reader_1 = require_reader2();
  8423. var ReaderStream = class extends reader_1.default {
  8424. constructor() {
  8425. super(...arguments);
  8426. this._walkStream = fsWalk.walkStream;
  8427. this._stat = fsStat.stat;
  8428. }
  8429. dynamic(root, options) {
  8430. return this._walkStream(root, options);
  8431. }
  8432. static(patterns, options) {
  8433. const filepaths = patterns.map(this._getFullEntryPath, this);
  8434. const stream = new stream_1.PassThrough({
  8435. objectMode: true
  8436. });
  8437. stream._write = (index, _enc, done) => {
  8438. return this._getEntry(filepaths[index], patterns[index], options).then((entry) => {
  8439. if (entry !== null && options.entryFilter(entry)) {
  8440. stream.push(entry);
  8441. }
  8442. if (index === filepaths.length - 1) {
  8443. stream.end();
  8444. }
  8445. done();
  8446. }).catch(done);
  8447. };
  8448. for (let i = 0; i < filepaths.length; i++) {
  8449. stream.write(i);
  8450. }
  8451. return stream;
  8452. }
  8453. _getEntry(filepath, pattern, options) {
  8454. return this._getStat(filepath).then((stats) => this._makeEntry(stats, pattern)).catch((error) => {
  8455. if (options.errorFilter(error)) {
  8456. return null;
  8457. }
  8458. throw error;
  8459. });
  8460. }
  8461. _getStat(filepath) {
  8462. return new Promise((resolve, reject) => {
  8463. this._stat(filepath, this._fsStatSettings, (error, stats) => {
  8464. return error === null ? resolve(stats) : reject(error);
  8465. });
  8466. });
  8467. }
  8468. };
  8469. exports2.default = ReaderStream;
  8470. }
  8471. });
  8472. var require_matcher = __commonJS2({
  8473. "node_modules/fast-glob/out/providers/matchers/matcher.js"(exports2) {
  8474. "use strict";
  8475. Object.defineProperty(exports2, "__esModule", {
  8476. value: true
  8477. });
  8478. var utils = require_utils4();
  8479. var Matcher = class {
  8480. constructor(_patterns, _settings, _micromatchOptions) {
  8481. this._patterns = _patterns;
  8482. this._settings = _settings;
  8483. this._micromatchOptions = _micromatchOptions;
  8484. this._storage = [];
  8485. this._fillStorage();
  8486. }
  8487. _fillStorage() {
  8488. const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
  8489. for (const pattern of patterns) {
  8490. const segments = this._getPatternSegments(pattern);
  8491. const sections = this._splitSegmentsIntoSections(segments);
  8492. this._storage.push({
  8493. complete: sections.length <= 1,
  8494. pattern,
  8495. segments,
  8496. sections
  8497. });
  8498. }
  8499. }
  8500. _getPatternSegments(pattern) {
  8501. const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
  8502. return parts.map((part) => {
  8503. const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
  8504. if (!dynamic) {
  8505. return {
  8506. dynamic: false,
  8507. pattern: part
  8508. };
  8509. }
  8510. return {
  8511. dynamic: true,
  8512. pattern: part,
  8513. patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
  8514. };
  8515. });
  8516. }
  8517. _splitSegmentsIntoSections(segments) {
  8518. return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
  8519. }
  8520. };
  8521. exports2.default = Matcher;
  8522. }
  8523. });
  8524. var require_partial = __commonJS2({
  8525. "node_modules/fast-glob/out/providers/matchers/partial.js"(exports2) {
  8526. "use strict";
  8527. Object.defineProperty(exports2, "__esModule", {
  8528. value: true
  8529. });
  8530. var matcher_1 = require_matcher();
  8531. var PartialMatcher = class extends matcher_1.default {
  8532. match(filepath) {
  8533. const parts = filepath.split("/");
  8534. const levels = parts.length;
  8535. const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
  8536. for (const pattern of patterns) {
  8537. const section = pattern.sections[0];
  8538. if (!pattern.complete && levels > section.length) {
  8539. return true;
  8540. }
  8541. const match = parts.every((part, index) => {
  8542. const segment = pattern.segments[index];
  8543. if (segment.dynamic && segment.patternRe.test(part)) {
  8544. return true;
  8545. }
  8546. if (!segment.dynamic && segment.pattern === part) {
  8547. return true;
  8548. }
  8549. return false;
  8550. });
  8551. if (match) {
  8552. return true;
  8553. }
  8554. }
  8555. return false;
  8556. }
  8557. };
  8558. exports2.default = PartialMatcher;
  8559. }
  8560. });
  8561. var require_deep = __commonJS2({
  8562. "node_modules/fast-glob/out/providers/filters/deep.js"(exports2) {
  8563. "use strict";
  8564. Object.defineProperty(exports2, "__esModule", {
  8565. value: true
  8566. });
  8567. var utils = require_utils4();
  8568. var partial_1 = require_partial();
  8569. var DeepFilter = class {
  8570. constructor(_settings, _micromatchOptions) {
  8571. this._settings = _settings;
  8572. this._micromatchOptions = _micromatchOptions;
  8573. }
  8574. getFilter(basePath, positive, negative) {
  8575. const matcher = this._getMatcher(positive);
  8576. const negativeRe = this._getNegativePatternsRe(negative);
  8577. return (entry) => this._filter(basePath, entry, matcher, negativeRe);
  8578. }
  8579. _getMatcher(patterns) {
  8580. return new partial_1.default(patterns, this._settings, this._micromatchOptions);
  8581. }
  8582. _getNegativePatternsRe(patterns) {
  8583. const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
  8584. return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
  8585. }
  8586. _filter(basePath, entry, matcher, negativeRe) {
  8587. if (this._isSkippedByDeep(basePath, entry.path)) {
  8588. return false;
  8589. }
  8590. if (this._isSkippedSymbolicLink(entry)) {
  8591. return false;
  8592. }
  8593. const filepath = utils.path.removeLeadingDotSegment(entry.path);
  8594. if (this._isSkippedByPositivePatterns(filepath, matcher)) {
  8595. return false;
  8596. }
  8597. return this._isSkippedByNegativePatterns(filepath, negativeRe);
  8598. }
  8599. _isSkippedByDeep(basePath, entryPath) {
  8600. if (this._settings.deep === Infinity) {
  8601. return false;
  8602. }
  8603. return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
  8604. }
  8605. _getEntryLevel(basePath, entryPath) {
  8606. const entryPathDepth = entryPath.split("/").length;
  8607. if (basePath === "") {
  8608. return entryPathDepth;
  8609. }
  8610. const basePathDepth = basePath.split("/").length;
  8611. return entryPathDepth - basePathDepth;
  8612. }
  8613. _isSkippedSymbolicLink(entry) {
  8614. return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
  8615. }
  8616. _isSkippedByPositivePatterns(entryPath, matcher) {
  8617. return !this._settings.baseNameMatch && !matcher.match(entryPath);
  8618. }
  8619. _isSkippedByNegativePatterns(entryPath, patternsRe) {
  8620. return !utils.pattern.matchAny(entryPath, patternsRe);
  8621. }
  8622. };
  8623. exports2.default = DeepFilter;
  8624. }
  8625. });
  8626. var require_entry = __commonJS2({
  8627. "node_modules/fast-glob/out/providers/filters/entry.js"(exports2) {
  8628. "use strict";
  8629. Object.defineProperty(exports2, "__esModule", {
  8630. value: true
  8631. });
  8632. var utils = require_utils4();
  8633. var EntryFilter = class {
  8634. constructor(_settings, _micromatchOptions) {
  8635. this._settings = _settings;
  8636. this._micromatchOptions = _micromatchOptions;
  8637. this.index = /* @__PURE__ */ new Map();
  8638. }
  8639. getFilter(positive, negative) {
  8640. const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
  8641. const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
  8642. return (entry) => this._filter(entry, positiveRe, negativeRe);
  8643. }
  8644. _filter(entry, positiveRe, negativeRe) {
  8645. if (this._settings.unique && this._isDuplicateEntry(entry)) {
  8646. return false;
  8647. }
  8648. if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
  8649. return false;
  8650. }
  8651. if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
  8652. return false;
  8653. }
  8654. const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
  8655. const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
  8656. if (this._settings.unique && isMatched) {
  8657. this._createIndexRecord(entry);
  8658. }
  8659. return isMatched;
  8660. }
  8661. _isDuplicateEntry(entry) {
  8662. return this.index.has(entry.path);
  8663. }
  8664. _createIndexRecord(entry) {
  8665. this.index.set(entry.path, void 0);
  8666. }
  8667. _onlyFileFilter(entry) {
  8668. return this._settings.onlyFiles && !entry.dirent.isFile();
  8669. }
  8670. _onlyDirectoryFilter(entry) {
  8671. return this._settings.onlyDirectories && !entry.dirent.isDirectory();
  8672. }
  8673. _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
  8674. if (!this._settings.absolute) {
  8675. return false;
  8676. }
  8677. const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
  8678. return utils.pattern.matchAny(fullpath, patternsRe);
  8679. }
  8680. _isMatchToPatterns(entryPath, patternsRe) {
  8681. const filepath = utils.path.removeLeadingDotSegment(entryPath);
  8682. return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + "/", patternsRe);
  8683. }
  8684. };
  8685. exports2.default = EntryFilter;
  8686. }
  8687. });
  8688. var require_error = __commonJS2({
  8689. "node_modules/fast-glob/out/providers/filters/error.js"(exports2) {
  8690. "use strict";
  8691. Object.defineProperty(exports2, "__esModule", {
  8692. value: true
  8693. });
  8694. var utils = require_utils4();
  8695. var ErrorFilter = class {
  8696. constructor(_settings) {
  8697. this._settings = _settings;
  8698. }
  8699. getFilter() {
  8700. return (error) => this._isNonFatalError(error);
  8701. }
  8702. _isNonFatalError(error) {
  8703. return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
  8704. }
  8705. };
  8706. exports2.default = ErrorFilter;
  8707. }
  8708. });
  8709. var require_entry2 = __commonJS2({
  8710. "node_modules/fast-glob/out/providers/transformers/entry.js"(exports2) {
  8711. "use strict";
  8712. Object.defineProperty(exports2, "__esModule", {
  8713. value: true
  8714. });
  8715. var utils = require_utils4();
  8716. var EntryTransformer = class {
  8717. constructor(_settings) {
  8718. this._settings = _settings;
  8719. }
  8720. getTransformer() {
  8721. return (entry) => this._transform(entry);
  8722. }
  8723. _transform(entry) {
  8724. let filepath = entry.path;
  8725. if (this._settings.absolute) {
  8726. filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
  8727. filepath = utils.path.unixify(filepath);
  8728. }
  8729. if (this._settings.markDirectories && entry.dirent.isDirectory()) {
  8730. filepath += "/";
  8731. }
  8732. if (!this._settings.objectMode) {
  8733. return filepath;
  8734. }
  8735. return Object.assign(Object.assign({}, entry), {
  8736. path: filepath
  8737. });
  8738. }
  8739. };
  8740. exports2.default = EntryTransformer;
  8741. }
  8742. });
  8743. var require_provider = __commonJS2({
  8744. "node_modules/fast-glob/out/providers/provider.js"(exports2) {
  8745. "use strict";
  8746. Object.defineProperty(exports2, "__esModule", {
  8747. value: true
  8748. });
  8749. var path = require("path");
  8750. var deep_1 = require_deep();
  8751. var entry_1 = require_entry();
  8752. var error_1 = require_error();
  8753. var entry_2 = require_entry2();
  8754. var Provider = class {
  8755. constructor(_settings) {
  8756. this._settings = _settings;
  8757. this.errorFilter = new error_1.default(this._settings);
  8758. this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
  8759. this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
  8760. this.entryTransformer = new entry_2.default(this._settings);
  8761. }
  8762. _getRootDirectory(task) {
  8763. return path.resolve(this._settings.cwd, task.base);
  8764. }
  8765. _getReaderOptions(task) {
  8766. const basePath = task.base === "." ? "" : task.base;
  8767. return {
  8768. basePath,
  8769. pathSegmentSeparator: "/",
  8770. concurrency: this._settings.concurrency,
  8771. deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
  8772. entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
  8773. errorFilter: this.errorFilter.getFilter(),
  8774. followSymbolicLinks: this._settings.followSymbolicLinks,
  8775. fs: this._settings.fs,
  8776. stats: this._settings.stats,
  8777. throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
  8778. transform: this.entryTransformer.getTransformer()
  8779. };
  8780. }
  8781. _getMicromatchOptions() {
  8782. return {
  8783. dot: this._settings.dot,
  8784. matchBase: this._settings.baseNameMatch,
  8785. nobrace: !this._settings.braceExpansion,
  8786. nocase: !this._settings.caseSensitiveMatch,
  8787. noext: !this._settings.extglob,
  8788. noglobstar: !this._settings.globstar,
  8789. posix: true,
  8790. strictSlashes: false
  8791. };
  8792. }
  8793. };
  8794. exports2.default = Provider;
  8795. }
  8796. });
  8797. var require_async5 = __commonJS2({
  8798. "node_modules/fast-glob/out/providers/async.js"(exports2) {
  8799. "use strict";
  8800. Object.defineProperty(exports2, "__esModule", {
  8801. value: true
  8802. });
  8803. var stream_1 = require_stream3();
  8804. var provider_1 = require_provider();
  8805. var ProviderAsync = class extends provider_1.default {
  8806. constructor() {
  8807. super(...arguments);
  8808. this._reader = new stream_1.default(this._settings);
  8809. }
  8810. read(task) {
  8811. const root = this._getRootDirectory(task);
  8812. const options = this._getReaderOptions(task);
  8813. const entries = [];
  8814. return new Promise((resolve, reject) => {
  8815. const stream = this.api(root, task, options);
  8816. stream.once("error", reject);
  8817. stream.on("data", (entry) => entries.push(options.transform(entry)));
  8818. stream.once("end", () => resolve(entries));
  8819. });
  8820. }
  8821. api(root, task, options) {
  8822. if (task.dynamic) {
  8823. return this._reader.dynamic(root, options);
  8824. }
  8825. return this._reader.static(task.patterns, options);
  8826. }
  8827. };
  8828. exports2.default = ProviderAsync;
  8829. }
  8830. });
  8831. var require_stream4 = __commonJS2({
  8832. "node_modules/fast-glob/out/providers/stream.js"(exports2) {
  8833. "use strict";
  8834. Object.defineProperty(exports2, "__esModule", {
  8835. value: true
  8836. });
  8837. var stream_1 = require("stream");
  8838. var stream_2 = require_stream3();
  8839. var provider_1 = require_provider();
  8840. var ProviderStream = class extends provider_1.default {
  8841. constructor() {
  8842. super(...arguments);
  8843. this._reader = new stream_2.default(this._settings);
  8844. }
  8845. read(task) {
  8846. const root = this._getRootDirectory(task);
  8847. const options = this._getReaderOptions(task);
  8848. const source = this.api(root, task, options);
  8849. const destination = new stream_1.Readable({
  8850. objectMode: true,
  8851. read: () => {
  8852. }
  8853. });
  8854. source.once("error", (error) => destination.emit("error", error)).on("data", (entry) => destination.emit("data", options.transform(entry))).once("end", () => destination.emit("end"));
  8855. destination.once("close", () => source.destroy());
  8856. return destination;
  8857. }
  8858. api(root, task, options) {
  8859. if (task.dynamic) {
  8860. return this._reader.dynamic(root, options);
  8861. }
  8862. return this._reader.static(task.patterns, options);
  8863. }
  8864. };
  8865. exports2.default = ProviderStream;
  8866. }
  8867. });
  8868. var require_sync5 = __commonJS2({
  8869. "node_modules/fast-glob/out/readers/sync.js"(exports2) {
  8870. "use strict";
  8871. Object.defineProperty(exports2, "__esModule", {
  8872. value: true
  8873. });
  8874. var fsStat = require_out();
  8875. var fsWalk = require_out3();
  8876. var reader_1 = require_reader2();
  8877. var ReaderSync = class extends reader_1.default {
  8878. constructor() {
  8879. super(...arguments);
  8880. this._walkSync = fsWalk.walkSync;
  8881. this._statSync = fsStat.statSync;
  8882. }
  8883. dynamic(root, options) {
  8884. return this._walkSync(root, options);
  8885. }
  8886. static(patterns, options) {
  8887. const entries = [];
  8888. for (const pattern of patterns) {
  8889. const filepath = this._getFullEntryPath(pattern);
  8890. const entry = this._getEntry(filepath, pattern, options);
  8891. if (entry === null || !options.entryFilter(entry)) {
  8892. continue;
  8893. }
  8894. entries.push(entry);
  8895. }
  8896. return entries;
  8897. }
  8898. _getEntry(filepath, pattern, options) {
  8899. try {
  8900. const stats = this._getStat(filepath);
  8901. return this._makeEntry(stats, pattern);
  8902. } catch (error) {
  8903. if (options.errorFilter(error)) {
  8904. return null;
  8905. }
  8906. throw error;
  8907. }
  8908. }
  8909. _getStat(filepath) {
  8910. return this._statSync(filepath, this._fsStatSettings);
  8911. }
  8912. };
  8913. exports2.default = ReaderSync;
  8914. }
  8915. });
  8916. var require_sync6 = __commonJS2({
  8917. "node_modules/fast-glob/out/providers/sync.js"(exports2) {
  8918. "use strict";
  8919. Object.defineProperty(exports2, "__esModule", {
  8920. value: true
  8921. });
  8922. var sync_1 = require_sync5();
  8923. var provider_1 = require_provider();
  8924. var ProviderSync = class extends provider_1.default {
  8925. constructor() {
  8926. super(...arguments);
  8927. this._reader = new sync_1.default(this._settings);
  8928. }
  8929. read(task) {
  8930. const root = this._getRootDirectory(task);
  8931. const options = this._getReaderOptions(task);
  8932. const entries = this.api(root, task, options);
  8933. return entries.map(options.transform);
  8934. }
  8935. api(root, task, options) {
  8936. if (task.dynamic) {
  8937. return this._reader.dynamic(root, options);
  8938. }
  8939. return this._reader.static(task.patterns, options);
  8940. }
  8941. };
  8942. exports2.default = ProviderSync;
  8943. }
  8944. });
  8945. var require_settings4 = __commonJS2({
  8946. "node_modules/fast-glob/out/settings.js"(exports2) {
  8947. "use strict";
  8948. Object.defineProperty(exports2, "__esModule", {
  8949. value: true
  8950. });
  8951. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
  8952. var fs = require("fs");
  8953. var os2 = require("os");
  8954. var CPU_COUNT = Math.max(os2.cpus().length, 1);
  8955. exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
  8956. lstat: fs.lstat,
  8957. lstatSync: fs.lstatSync,
  8958. stat: fs.stat,
  8959. statSync: fs.statSync,
  8960. readdir: fs.readdir,
  8961. readdirSync: fs.readdirSync
  8962. };
  8963. var Settings = class {
  8964. constructor(_options = {}) {
  8965. this._options = _options;
  8966. this.absolute = this._getValue(this._options.absolute, false);
  8967. this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
  8968. this.braceExpansion = this._getValue(this._options.braceExpansion, true);
  8969. this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
  8970. this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
  8971. this.cwd = this._getValue(this._options.cwd, process.cwd());
  8972. this.deep = this._getValue(this._options.deep, Infinity);
  8973. this.dot = this._getValue(this._options.dot, false);
  8974. this.extglob = this._getValue(this._options.extglob, true);
  8975. this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
  8976. this.fs = this._getFileSystemMethods(this._options.fs);
  8977. this.globstar = this._getValue(this._options.globstar, true);
  8978. this.ignore = this._getValue(this._options.ignore, []);
  8979. this.markDirectories = this._getValue(this._options.markDirectories, false);
  8980. this.objectMode = this._getValue(this._options.objectMode, false);
  8981. this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
  8982. this.onlyFiles = this._getValue(this._options.onlyFiles, true);
  8983. this.stats = this._getValue(this._options.stats, false);
  8984. this.suppressErrors = this._getValue(this._options.suppressErrors, false);
  8985. this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
  8986. this.unique = this._getValue(this._options.unique, true);
  8987. if (this.onlyDirectories) {
  8988. this.onlyFiles = false;
  8989. }
  8990. if (this.stats) {
  8991. this.objectMode = true;
  8992. }
  8993. }
  8994. _getValue(option, value) {
  8995. return option === void 0 ? value : option;
  8996. }
  8997. _getFileSystemMethods(methods = {}) {
  8998. return Object.assign(Object.assign({}, exports2.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
  8999. }
  9000. };
  9001. exports2.default = Settings;
  9002. }
  9003. });
  9004. var require_out4 = __commonJS2({
  9005. "node_modules/fast-glob/out/index.js"(exports2, module2) {
  9006. "use strict";
  9007. var taskManager = require_tasks();
  9008. var patternManager = require_patterns();
  9009. var async_1 = require_async5();
  9010. var stream_1 = require_stream4();
  9011. var sync_1 = require_sync6();
  9012. var settings_1 = require_settings4();
  9013. var utils = require_utils4();
  9014. async function FastGlob(source, options) {
  9015. assertPatternsInput(source);
  9016. const works = getWorks(source, async_1.default, options);
  9017. const result = await Promise.all(works);
  9018. return utils.array.flatten(result);
  9019. }
  9020. (function(FastGlob2) {
  9021. function sync(source, options) {
  9022. assertPatternsInput(source);
  9023. const works = getWorks(source, sync_1.default, options);
  9024. return utils.array.flatten(works);
  9025. }
  9026. FastGlob2.sync = sync;
  9027. function stream(source, options) {
  9028. assertPatternsInput(source);
  9029. const works = getWorks(source, stream_1.default, options);
  9030. return utils.stream.merge(works);
  9031. }
  9032. FastGlob2.stream = stream;
  9033. function generateTasks(source, options) {
  9034. assertPatternsInput(source);
  9035. const patterns = patternManager.transform([].concat(source));
  9036. const settings = new settings_1.default(options);
  9037. return taskManager.generate(patterns, settings);
  9038. }
  9039. FastGlob2.generateTasks = generateTasks;
  9040. function isDynamicPattern(source, options) {
  9041. assertPatternsInput(source);
  9042. const settings = new settings_1.default(options);
  9043. return utils.pattern.isDynamicPattern(source, settings);
  9044. }
  9045. FastGlob2.isDynamicPattern = isDynamicPattern;
  9046. function escapePath(source) {
  9047. assertPatternsInput(source);
  9048. return utils.path.escape(source);
  9049. }
  9050. FastGlob2.escapePath = escapePath;
  9051. })(FastGlob || (FastGlob = {}));
  9052. function getWorks(source, _Provider, options) {
  9053. const patterns = patternManager.transform([].concat(source));
  9054. const settings = new settings_1.default(options);
  9055. const tasks = taskManager.generate(patterns, settings);
  9056. const provider = new _Provider(settings);
  9057. return tasks.map(provider.read, provider);
  9058. }
  9059. function assertPatternsInput(input) {
  9060. const source = [].concat(input);
  9061. const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
  9062. if (!isValidSource) {
  9063. throw new TypeError("Patterns must be a string (non empty) or an array of strings");
  9064. }
  9065. }
  9066. module2.exports = FastGlob;
  9067. }
  9068. });
  9069. var require_expand_patterns = __commonJS2({
  9070. "src/cli/expand-patterns.js"(exports2, module2) {
  9071. "use strict";
  9072. var path = require("path");
  9073. var fastGlob = require_out4();
  9074. var {
  9075. statSafe
  9076. } = require_utils();
  9077. async function* expandPatterns(context) {
  9078. const cwd = process.cwd();
  9079. const seen = /* @__PURE__ */ new Set();
  9080. let noResults = true;
  9081. for await (const pathOrError of expandPatternsInternal(context)) {
  9082. noResults = false;
  9083. if (typeof pathOrError !== "string") {
  9084. yield pathOrError;
  9085. continue;
  9086. }
  9087. const relativePath = path.relative(cwd, pathOrError);
  9088. if (seen.has(relativePath)) {
  9089. continue;
  9090. }
  9091. seen.add(relativePath);
  9092. yield relativePath;
  9093. }
  9094. if (noResults && context.argv.errorOnUnmatchedPattern !== false) {
  9095. yield {
  9096. error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`
  9097. };
  9098. }
  9099. }
  9100. async function* expandPatternsInternal(context) {
  9101. const silentlyIgnoredDirs = [".git", ".svn", ".hg"];
  9102. if (context.argv.withNodeModules !== true) {
  9103. silentlyIgnoredDirs.push("node_modules");
  9104. }
  9105. const globOptions = {
  9106. dot: true,
  9107. ignore: silentlyIgnoredDirs.map((dir) => "**/" + dir)
  9108. };
  9109. let supportedFilesGlob;
  9110. const cwd = process.cwd();
  9111. const entries = [];
  9112. for (const pattern of context.filePatterns) {
  9113. const absolutePath = path.resolve(cwd, pattern);
  9114. if (containsIgnoredPathSegment(absolutePath, cwd, silentlyIgnoredDirs)) {
  9115. continue;
  9116. }
  9117. const stat = await statSafe(absolutePath);
  9118. if (stat) {
  9119. if (stat.isFile()) {
  9120. entries.push({
  9121. type: "file",
  9122. glob: escapePathForGlob(fixWindowsSlashes(pattern)),
  9123. input: pattern
  9124. });
  9125. } else if (stat.isDirectory()) {
  9126. const relativePath = path.relative(cwd, absolutePath) || ".";
  9127. entries.push({
  9128. type: "dir",
  9129. glob: escapePathForGlob(fixWindowsSlashes(relativePath)) + "/" + getSupportedFilesGlob(),
  9130. input: pattern
  9131. });
  9132. }
  9133. } else if (pattern[0] === "!") {
  9134. globOptions.ignore.push(fixWindowsSlashes(pattern.slice(1)));
  9135. } else {
  9136. entries.push({
  9137. type: "glob",
  9138. glob: fixWindowsSlashes(pattern),
  9139. input: pattern
  9140. });
  9141. }
  9142. }
  9143. for (const {
  9144. type,
  9145. glob,
  9146. input
  9147. } of entries) {
  9148. let result;
  9149. try {
  9150. result = await fastGlob(glob, globOptions);
  9151. } catch ({
  9152. message
  9153. }) {
  9154. yield {
  9155. error: `${errorMessages.globError[type]}: ${input}
  9156. ${message}`
  9157. };
  9158. continue;
  9159. }
  9160. if (result.length === 0) {
  9161. if (context.argv.errorOnUnmatchedPattern !== false) {
  9162. yield {
  9163. error: `${errorMessages.emptyResults[type]}: "${input}".`
  9164. };
  9165. }
  9166. } else {
  9167. yield* sortPaths(result);
  9168. }
  9169. }
  9170. function getSupportedFilesGlob() {
  9171. if (!supportedFilesGlob) {
  9172. const extensions = context.languages.flatMap((lang) => lang.extensions || []);
  9173. const filenames = context.languages.flatMap((lang) => lang.filenames || []);
  9174. supportedFilesGlob = `**/{${[...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), ...filenames]}}`;
  9175. }
  9176. return supportedFilesGlob;
  9177. }
  9178. }
  9179. var errorMessages = {
  9180. globError: {
  9181. file: "Unable to resolve file",
  9182. dir: "Unable to expand directory",
  9183. glob: "Unable to expand glob pattern"
  9184. },
  9185. emptyResults: {
  9186. file: "Explicitly specified file was ignored due to negative glob patterns",
  9187. dir: "No supported files were found in the directory",
  9188. glob: "No files matching the pattern were found"
  9189. }
  9190. };
  9191. function containsIgnoredPathSegment(absolutePath, cwd, ignoredDirectories) {
  9192. return path.relative(cwd, absolutePath).split(path.sep).some((dir) => ignoredDirectories.includes(dir));
  9193. }
  9194. function sortPaths(paths) {
  9195. return paths.sort((a, b) => a.localeCompare(b));
  9196. }
  9197. function escapePathForGlob(path2) {
  9198. return fastGlob.escapePath(path2.replace(/\\/g, "\0")).replace(/\\!/g, "@(!)").replace(/\0/g, "@(\\\\)");
  9199. }
  9200. var isWindows = path.sep === "\\";
  9201. function fixWindowsSlashes(pattern) {
  9202. return isWindows ? pattern.replace(/\\/g, "/") : pattern;
  9203. }
  9204. module2.exports = {
  9205. expandPatterns,
  9206. fixWindowsSlashes
  9207. };
  9208. }
  9209. });
  9210. var require_get_options_for_file = __commonJS2({
  9211. "src/cli/options/get-options-for-file.js"(exports2, module2) {
  9212. "use strict";
  9213. var dashify = require_dashify();
  9214. var prettier2 = require("./index.js");
  9215. var {
  9216. optionsNormalizer
  9217. } = require_prettier_internal();
  9218. var minimist = require_minimist2();
  9219. var createMinimistOptions = require_create_minimist_options();
  9220. var normalizeCliOptions = require_normalize_cli_options();
  9221. function getOptions(argv, detailedOptions) {
  9222. return Object.fromEntries(detailedOptions.filter(({
  9223. forwardToApi
  9224. }) => forwardToApi).map(({
  9225. forwardToApi,
  9226. name
  9227. }) => [forwardToApi, argv[name]]));
  9228. }
  9229. function cliifyOptions(object, apiDetailedOptionMap) {
  9230. return Object.fromEntries(Object.entries(object || {}).map(([key, value]) => {
  9231. const apiOption = apiDetailedOptionMap[key];
  9232. const cliKey = apiOption ? apiOption.name : key;
  9233. return [dashify(cliKey), value];
  9234. }));
  9235. }
  9236. function createApiDetailedOptionMap(detailedOptions) {
  9237. return Object.fromEntries(detailedOptions.filter((option) => option.forwardToApi && option.forwardToApi !== option.name).map((option) => [option.forwardToApi, option]));
  9238. }
  9239. function parseArgsToOptions(context, overrideDefaults) {
  9240. const minimistOptions = createMinimistOptions(context.detailedOptions);
  9241. const apiDetailedOptionMap = createApiDetailedOptionMap(context.detailedOptions);
  9242. return getOptions(normalizeCliOptions(minimist(context.rawArguments, {
  9243. string: minimistOptions.string,
  9244. boolean: minimistOptions.boolean,
  9245. default: cliifyOptions(overrideDefaults, apiDetailedOptionMap)
  9246. }), context.detailedOptions, {
  9247. logger: false
  9248. }), context.detailedOptions);
  9249. }
  9250. async function getOptionsOrDie(context, filePath) {
  9251. try {
  9252. if (context.argv.config === false) {
  9253. context.logger.debug("'--no-config' option found, skip loading config file.");
  9254. return null;
  9255. }
  9256. context.logger.debug(context.argv.config ? `load config file from '${context.argv.config}'` : `resolve config from '${filePath}'`);
  9257. const options = await prettier2.resolveConfig(filePath, {
  9258. editorconfig: context.argv.editorconfig,
  9259. config: context.argv.config
  9260. });
  9261. context.logger.debug("loaded options `" + JSON.stringify(options) + "`");
  9262. return options;
  9263. } catch (error) {
  9264. context.logger.error(`Invalid configuration file \`${filePath}\`: ` + error.message);
  9265. process.exit(2);
  9266. }
  9267. }
  9268. function applyConfigPrecedence(context, options) {
  9269. try {
  9270. switch (context.argv.configPrecedence) {
  9271. case "cli-override":
  9272. return parseArgsToOptions(context, options);
  9273. case "file-override":
  9274. return Object.assign(Object.assign({}, parseArgsToOptions(context)), options);
  9275. case "prefer-file":
  9276. return options || parseArgsToOptions(context);
  9277. }
  9278. } catch (error) {
  9279. context.logger.error(error.toString());
  9280. process.exit(2);
  9281. }
  9282. }
  9283. async function getOptionsForFile(context, filepath) {
  9284. const options = await getOptionsOrDie(context, filepath);
  9285. const hasPlugins = options && options.plugins;
  9286. if (hasPlugins) {
  9287. context.pushContextPlugins(options.plugins);
  9288. }
  9289. const appliedOptions = Object.assign({
  9290. filepath
  9291. }, applyConfigPrecedence(context, options && optionsNormalizer.normalizeApiOptions(options, context.supportOptions, {
  9292. logger: context.logger
  9293. })));
  9294. context.logger.debug(`applied config-precedence (${context.argv.configPrecedence}): ${JSON.stringify(appliedOptions)}`);
  9295. if (hasPlugins) {
  9296. context.popContextPlugins();
  9297. }
  9298. return appliedOptions;
  9299. }
  9300. module2.exports = getOptionsForFile;
  9301. }
  9302. });
  9303. var require_is_tty = __commonJS2({
  9304. "src/cli/is-tty.js"(exports2, module2) {
  9305. "use strict";
  9306. var {
  9307. isCI
  9308. } = require("./third-party.js");
  9309. module2.exports = function isTTY() {
  9310. return process.stdout.isTTY && !isCI();
  9311. };
  9312. }
  9313. });
  9314. var require_commondir = __commonJS2({
  9315. "node_modules/commondir/index.js"(exports2, module2) {
  9316. var path = require("path");
  9317. module2.exports = function(basedir, relfiles) {
  9318. if (relfiles) {
  9319. var files = relfiles.map(function(r) {
  9320. return path.resolve(basedir, r);
  9321. });
  9322. } else {
  9323. var files = basedir;
  9324. }
  9325. var res = files.slice(1).reduce(function(ps, file) {
  9326. if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
  9327. throw new Error("relative path without a basedir");
  9328. }
  9329. var xs = file.split(/\/+|\\+/);
  9330. for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
  9331. ;
  9332. return ps.slice(0, i);
  9333. }, files[0].split(/\/+|\\+/));
  9334. return res.length > 1 ? res.join("/") : "/";
  9335. };
  9336. }
  9337. });
  9338. var require_p_try = __commonJS2({
  9339. "node_modules/pkg-dir/node_modules/p-try/index.js"(exports2, module2) {
  9340. "use strict";
  9341. var pTry = (fn, ...arguments_) => new Promise((resolve) => {
  9342. resolve(fn(...arguments_));
  9343. });
  9344. module2.exports = pTry;
  9345. module2.exports.default = pTry;
  9346. }
  9347. });
  9348. var require_p_limit = __commonJS2({
  9349. "node_modules/pkg-dir/node_modules/p-limit/index.js"(exports2, module2) {
  9350. "use strict";
  9351. var pTry = require_p_try();
  9352. var pLimit = (concurrency) => {
  9353. if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
  9354. return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
  9355. }
  9356. const queue = [];
  9357. let activeCount = 0;
  9358. const next = () => {
  9359. activeCount--;
  9360. if (queue.length > 0) {
  9361. queue.shift()();
  9362. }
  9363. };
  9364. const run2 = (fn, resolve, ...args) => {
  9365. activeCount++;
  9366. const result = pTry(fn, ...args);
  9367. resolve(result);
  9368. result.then(next, next);
  9369. };
  9370. const enqueue = (fn, resolve, ...args) => {
  9371. if (activeCount < concurrency) {
  9372. run2(fn, resolve, ...args);
  9373. } else {
  9374. queue.push(run2.bind(null, fn, resolve, ...args));
  9375. }
  9376. };
  9377. const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
  9378. Object.defineProperties(generator, {
  9379. activeCount: {
  9380. get: () => activeCount
  9381. },
  9382. pendingCount: {
  9383. get: () => queue.length
  9384. },
  9385. clearQueue: {
  9386. value: () => {
  9387. queue.length = 0;
  9388. }
  9389. }
  9390. });
  9391. return generator;
  9392. };
  9393. module2.exports = pLimit;
  9394. module2.exports.default = pLimit;
  9395. }
  9396. });
  9397. var require_p_locate = __commonJS2({
  9398. "node_modules/pkg-dir/node_modules/p-locate/index.js"(exports2, module2) {
  9399. "use strict";
  9400. var pLimit = require_p_limit();
  9401. var EndError = class extends Error {
  9402. constructor(value) {
  9403. super();
  9404. this.value = value;
  9405. }
  9406. };
  9407. var testElement = async (element, tester) => tester(await element);
  9408. var finder = async (element) => {
  9409. const values = await Promise.all(element);
  9410. if (values[1] === true) {
  9411. throw new EndError(values[0]);
  9412. }
  9413. return false;
  9414. };
  9415. var pLocate = async (iterable, tester, options) => {
  9416. options = Object.assign({
  9417. concurrency: Infinity,
  9418. preserveOrder: true
  9419. }, options);
  9420. const limit = pLimit(options.concurrency);
  9421. const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
  9422. const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);
  9423. try {
  9424. await Promise.all(items.map((element) => checkLimit(finder, element)));
  9425. } catch (error) {
  9426. if (error instanceof EndError) {
  9427. return error.value;
  9428. }
  9429. throw error;
  9430. }
  9431. };
  9432. module2.exports = pLocate;
  9433. module2.exports.default = pLocate;
  9434. }
  9435. });
  9436. var require_locate_path = __commonJS2({
  9437. "node_modules/pkg-dir/node_modules/locate-path/index.js"(exports2, module2) {
  9438. "use strict";
  9439. var path = require("path");
  9440. var fs = require("fs");
  9441. var {
  9442. promisify
  9443. } = require("util");
  9444. var pLocate = require_p_locate();
  9445. var fsStat = promisify(fs.stat);
  9446. var fsLStat = promisify(fs.lstat);
  9447. var typeMappings = {
  9448. directory: "isDirectory",
  9449. file: "isFile"
  9450. };
  9451. function checkType({
  9452. type
  9453. }) {
  9454. if (type in typeMappings) {
  9455. return;
  9456. }
  9457. throw new Error(`Invalid type specified: ${type}`);
  9458. }
  9459. var matchType = (type, stat) => type === void 0 || stat[typeMappings[type]]();
  9460. module2.exports = async (paths, options) => {
  9461. options = Object.assign({
  9462. cwd: process.cwd(),
  9463. type: "file",
  9464. allowSymlinks: true
  9465. }, options);
  9466. checkType(options);
  9467. const statFn = options.allowSymlinks ? fsStat : fsLStat;
  9468. return pLocate(paths, async (path_) => {
  9469. try {
  9470. const stat = await statFn(path.resolve(options.cwd, path_));
  9471. return matchType(options.type, stat);
  9472. } catch (_) {
  9473. return false;
  9474. }
  9475. }, options);
  9476. };
  9477. module2.exports.sync = (paths, options) => {
  9478. options = Object.assign({
  9479. cwd: process.cwd(),
  9480. allowSymlinks: true,
  9481. type: "file"
  9482. }, options);
  9483. checkType(options);
  9484. const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;
  9485. for (const path_ of paths) {
  9486. try {
  9487. const stat = statFn(path.resolve(options.cwd, path_));
  9488. if (matchType(options.type, stat)) {
  9489. return path_;
  9490. }
  9491. } catch (_) {
  9492. }
  9493. }
  9494. };
  9495. }
  9496. });
  9497. var require_path_exists = __commonJS2({
  9498. "node_modules/path-exists/index.js"(exports2, module2) {
  9499. "use strict";
  9500. var fs = require("fs");
  9501. var {
  9502. promisify
  9503. } = require("util");
  9504. var pAccess = promisify(fs.access);
  9505. module2.exports = async (path) => {
  9506. try {
  9507. await pAccess(path);
  9508. return true;
  9509. } catch (_) {
  9510. return false;
  9511. }
  9512. };
  9513. module2.exports.sync = (path) => {
  9514. try {
  9515. fs.accessSync(path);
  9516. return true;
  9517. } catch (_) {
  9518. return false;
  9519. }
  9520. };
  9521. }
  9522. });
  9523. var require_find_up = __commonJS2({
  9524. "node_modules/pkg-dir/node_modules/find-up/index.js"(exports2, module2) {
  9525. "use strict";
  9526. var path = require("path");
  9527. var locatePath = require_locate_path();
  9528. var pathExists = require_path_exists();
  9529. var stop = Symbol("findUp.stop");
  9530. module2.exports = async (name, options = {}) => {
  9531. let directory = path.resolve(options.cwd || "");
  9532. const {
  9533. root
  9534. } = path.parse(directory);
  9535. const paths = [].concat(name);
  9536. const runMatcher = async (locateOptions) => {
  9537. if (typeof name !== "function") {
  9538. return locatePath(paths, locateOptions);
  9539. }
  9540. const foundPath = await name(locateOptions.cwd);
  9541. if (typeof foundPath === "string") {
  9542. return locatePath([foundPath], locateOptions);
  9543. }
  9544. return foundPath;
  9545. };
  9546. while (true) {
  9547. const foundPath = await runMatcher(Object.assign(Object.assign({}, options), {}, {
  9548. cwd: directory
  9549. }));
  9550. if (foundPath === stop) {
  9551. return;
  9552. }
  9553. if (foundPath) {
  9554. return path.resolve(directory, foundPath);
  9555. }
  9556. if (directory === root) {
  9557. return;
  9558. }
  9559. directory = path.dirname(directory);
  9560. }
  9561. };
  9562. module2.exports.sync = (name, options = {}) => {
  9563. let directory = path.resolve(options.cwd || "");
  9564. const {
  9565. root
  9566. } = path.parse(directory);
  9567. const paths = [].concat(name);
  9568. const runMatcher = (locateOptions) => {
  9569. if (typeof name !== "function") {
  9570. return locatePath.sync(paths, locateOptions);
  9571. }
  9572. const foundPath = name(locateOptions.cwd);
  9573. if (typeof foundPath === "string") {
  9574. return locatePath.sync([foundPath], locateOptions);
  9575. }
  9576. return foundPath;
  9577. };
  9578. while (true) {
  9579. const foundPath = runMatcher(Object.assign(Object.assign({}, options), {}, {
  9580. cwd: directory
  9581. }));
  9582. if (foundPath === stop) {
  9583. return;
  9584. }
  9585. if (foundPath) {
  9586. return path.resolve(directory, foundPath);
  9587. }
  9588. if (directory === root) {
  9589. return;
  9590. }
  9591. directory = path.dirname(directory);
  9592. }
  9593. };
  9594. module2.exports.exists = pathExists;
  9595. module2.exports.sync.exists = pathExists.sync;
  9596. module2.exports.stop = stop;
  9597. }
  9598. });
  9599. var require_pkg_dir = __commonJS2({
  9600. "node_modules/pkg-dir/index.js"(exports2, module2) {
  9601. "use strict";
  9602. var path = require("path");
  9603. var findUp = require_find_up();
  9604. var pkgDir = async (cwd) => {
  9605. const filePath = await findUp("package.json", {
  9606. cwd
  9607. });
  9608. return filePath && path.dirname(filePath);
  9609. };
  9610. module2.exports = pkgDir;
  9611. module2.exports.default = pkgDir;
  9612. module2.exports.sync = (cwd) => {
  9613. const filePath = findUp.sync("package.json", {
  9614. cwd
  9615. });
  9616. return filePath && path.dirname(filePath);
  9617. };
  9618. }
  9619. });
  9620. var require_semver = __commonJS2({
  9621. "node_modules/make-dir/node_modules/semver/semver.js"(exports2, module2) {
  9622. exports2 = module2.exports = SemVer;
  9623. var debug;
  9624. if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9625. debug = function() {
  9626. var args = Array.prototype.slice.call(arguments, 0);
  9627. args.unshift("SEMVER");
  9628. console.log.apply(console, args);
  9629. };
  9630. } else {
  9631. debug = function() {
  9632. };
  9633. }
  9634. exports2.SEMVER_SPEC_VERSION = "2.0.0";
  9635. var MAX_LENGTH = 256;
  9636. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  9637. var MAX_SAFE_COMPONENT_LENGTH = 16;
  9638. var re = exports2.re = [];
  9639. var src = exports2.src = [];
  9640. var t = exports2.tokens = {};
  9641. var R = 0;
  9642. function tok(n) {
  9643. t[n] = R++;
  9644. }
  9645. tok("NUMERICIDENTIFIER");
  9646. src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
  9647. tok("NUMERICIDENTIFIERLOOSE");
  9648. src[t.NUMERICIDENTIFIERLOOSE] = "[0-9]+";
  9649. tok("NONNUMERICIDENTIFIER");
  9650. src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-][a-zA-Z0-9-]*";
  9651. tok("MAINVERSION");
  9652. src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
  9653. tok("MAINVERSIONLOOSE");
  9654. src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
  9655. tok("PRERELEASEIDENTIFIER");
  9656. src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9657. tok("PRERELEASEIDENTIFIERLOOSE");
  9658. src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
  9659. tok("PRERELEASE");
  9660. src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
  9661. tok("PRERELEASELOOSE");
  9662. src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
  9663. tok("BUILDIDENTIFIER");
  9664. src[t.BUILDIDENTIFIER] = "[0-9A-Za-z-]+";
  9665. tok("BUILD");
  9666. src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
  9667. tok("FULL");
  9668. tok("FULLPLAIN");
  9669. src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
  9670. src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
  9671. tok("LOOSEPLAIN");
  9672. src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
  9673. tok("LOOSE");
  9674. src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
  9675. tok("GTLT");
  9676. src[t.GTLT] = "((?:<|>)?=?)";
  9677. tok("XRANGEIDENTIFIERLOOSE");
  9678. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
  9679. tok("XRANGEIDENTIFIER");
  9680. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
  9681. tok("XRANGEPLAIN");
  9682. src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
  9683. tok("XRANGEPLAINLOOSE");
  9684. src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
  9685. tok("XRANGE");
  9686. src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
  9687. tok("XRANGELOOSE");
  9688. src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
  9689. tok("COERCE");
  9690. src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
  9691. tok("COERCERTL");
  9692. re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
  9693. tok("LONETILDE");
  9694. src[t.LONETILDE] = "(?:~>?)";
  9695. tok("TILDETRIM");
  9696. src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
  9697. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
  9698. var tildeTrimReplace = "$1~";
  9699. tok("TILDE");
  9700. src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
  9701. tok("TILDELOOSE");
  9702. src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
  9703. tok("LONECARET");
  9704. src[t.LONECARET] = "(?:\\^)";
  9705. tok("CARETTRIM");
  9706. src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
  9707. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
  9708. var caretTrimReplace = "$1^";
  9709. tok("CARET");
  9710. src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
  9711. tok("CARETLOOSE");
  9712. src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
  9713. tok("COMPARATORLOOSE");
  9714. src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
  9715. tok("COMPARATOR");
  9716. src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
  9717. tok("COMPARATORTRIM");
  9718. src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
  9719. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
  9720. var comparatorTrimReplace = "$1$2$3";
  9721. tok("HYPHENRANGE");
  9722. src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
  9723. tok("HYPHENRANGELOOSE");
  9724. src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
  9725. tok("STAR");
  9726. src[t.STAR] = "(<|>)?=?\\s*\\*";
  9727. for (i = 0; i < R; i++) {
  9728. debug(i, src[i]);
  9729. if (!re[i]) {
  9730. re[i] = new RegExp(src[i]);
  9731. }
  9732. }
  9733. var i;
  9734. exports2.parse = parse;
  9735. function parse(version, options) {
  9736. if (!options || typeof options !== "object") {
  9737. options = {
  9738. loose: !!options,
  9739. includePrerelease: false
  9740. };
  9741. }
  9742. if (version instanceof SemVer) {
  9743. return version;
  9744. }
  9745. if (typeof version !== "string") {
  9746. return null;
  9747. }
  9748. if (version.length > MAX_LENGTH) {
  9749. return null;
  9750. }
  9751. var r = options.loose ? re[t.LOOSE] : re[t.FULL];
  9752. if (!r.test(version)) {
  9753. return null;
  9754. }
  9755. try {
  9756. return new SemVer(version, options);
  9757. } catch (er) {
  9758. return null;
  9759. }
  9760. }
  9761. exports2.valid = valid;
  9762. function valid(version, options) {
  9763. var v = parse(version, options);
  9764. return v ? v.version : null;
  9765. }
  9766. exports2.clean = clean;
  9767. function clean(version, options) {
  9768. var s = parse(version.trim().replace(/^[=v]+/, ""), options);
  9769. return s ? s.version : null;
  9770. }
  9771. exports2.SemVer = SemVer;
  9772. function SemVer(version, options) {
  9773. if (!options || typeof options !== "object") {
  9774. options = {
  9775. loose: !!options,
  9776. includePrerelease: false
  9777. };
  9778. }
  9779. if (version instanceof SemVer) {
  9780. if (version.loose === options.loose) {
  9781. return version;
  9782. } else {
  9783. version = version.version;
  9784. }
  9785. } else if (typeof version !== "string") {
  9786. throw new TypeError("Invalid Version: " + version);
  9787. }
  9788. if (version.length > MAX_LENGTH) {
  9789. throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
  9790. }
  9791. if (!(this instanceof SemVer)) {
  9792. return new SemVer(version, options);
  9793. }
  9794. debug("SemVer", version, options);
  9795. this.options = options;
  9796. this.loose = !!options.loose;
  9797. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
  9798. if (!m) {
  9799. throw new TypeError("Invalid Version: " + version);
  9800. }
  9801. this.raw = version;
  9802. this.major = +m[1];
  9803. this.minor = +m[2];
  9804. this.patch = +m[3];
  9805. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9806. throw new TypeError("Invalid major version");
  9807. }
  9808. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9809. throw new TypeError("Invalid minor version");
  9810. }
  9811. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9812. throw new TypeError("Invalid patch version");
  9813. }
  9814. if (!m[4]) {
  9815. this.prerelease = [];
  9816. } else {
  9817. this.prerelease = m[4].split(".").map(function(id) {
  9818. if (/^[0-9]+$/.test(id)) {
  9819. var num = +id;
  9820. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9821. return num;
  9822. }
  9823. }
  9824. return id;
  9825. });
  9826. }
  9827. this.build = m[5] ? m[5].split(".") : [];
  9828. this.format();
  9829. }
  9830. SemVer.prototype.format = function() {
  9831. this.version = this.major + "." + this.minor + "." + this.patch;
  9832. if (this.prerelease.length) {
  9833. this.version += "-" + this.prerelease.join(".");
  9834. }
  9835. return this.version;
  9836. };
  9837. SemVer.prototype.toString = function() {
  9838. return this.version;
  9839. };
  9840. SemVer.prototype.compare = function(other) {
  9841. debug("SemVer.compare", this.version, this.options, other);
  9842. if (!(other instanceof SemVer)) {
  9843. other = new SemVer(other, this.options);
  9844. }
  9845. return this.compareMain(other) || this.comparePre(other);
  9846. };
  9847. SemVer.prototype.compareMain = function(other) {
  9848. if (!(other instanceof SemVer)) {
  9849. other = new SemVer(other, this.options);
  9850. }
  9851. return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
  9852. };
  9853. SemVer.prototype.comparePre = function(other) {
  9854. if (!(other instanceof SemVer)) {
  9855. other = new SemVer(other, this.options);
  9856. }
  9857. if (this.prerelease.length && !other.prerelease.length) {
  9858. return -1;
  9859. } else if (!this.prerelease.length && other.prerelease.length) {
  9860. return 1;
  9861. } else if (!this.prerelease.length && !other.prerelease.length) {
  9862. return 0;
  9863. }
  9864. var i2 = 0;
  9865. do {
  9866. var a = this.prerelease[i2];
  9867. var b = other.prerelease[i2];
  9868. debug("prerelease compare", i2, a, b);
  9869. if (a === void 0 && b === void 0) {
  9870. return 0;
  9871. } else if (b === void 0) {
  9872. return 1;
  9873. } else if (a === void 0) {
  9874. return -1;
  9875. } else if (a === b) {
  9876. continue;
  9877. } else {
  9878. return compareIdentifiers(a, b);
  9879. }
  9880. } while (++i2);
  9881. };
  9882. SemVer.prototype.compareBuild = function(other) {
  9883. if (!(other instanceof SemVer)) {
  9884. other = new SemVer(other, this.options);
  9885. }
  9886. var i2 = 0;
  9887. do {
  9888. var a = this.build[i2];
  9889. var b = other.build[i2];
  9890. debug("prerelease compare", i2, a, b);
  9891. if (a === void 0 && b === void 0) {
  9892. return 0;
  9893. } else if (b === void 0) {
  9894. return 1;
  9895. } else if (a === void 0) {
  9896. return -1;
  9897. } else if (a === b) {
  9898. continue;
  9899. } else {
  9900. return compareIdentifiers(a, b);
  9901. }
  9902. } while (++i2);
  9903. };
  9904. SemVer.prototype.inc = function(release, identifier) {
  9905. switch (release) {
  9906. case "premajor":
  9907. this.prerelease.length = 0;
  9908. this.patch = 0;
  9909. this.minor = 0;
  9910. this.major++;
  9911. this.inc("pre", identifier);
  9912. break;
  9913. case "preminor":
  9914. this.prerelease.length = 0;
  9915. this.patch = 0;
  9916. this.minor++;
  9917. this.inc("pre", identifier);
  9918. break;
  9919. case "prepatch":
  9920. this.prerelease.length = 0;
  9921. this.inc("patch", identifier);
  9922. this.inc("pre", identifier);
  9923. break;
  9924. case "prerelease":
  9925. if (this.prerelease.length === 0) {
  9926. this.inc("patch", identifier);
  9927. }
  9928. this.inc("pre", identifier);
  9929. break;
  9930. case "major":
  9931. if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
  9932. this.major++;
  9933. }
  9934. this.minor = 0;
  9935. this.patch = 0;
  9936. this.prerelease = [];
  9937. break;
  9938. case "minor":
  9939. if (this.patch !== 0 || this.prerelease.length === 0) {
  9940. this.minor++;
  9941. }
  9942. this.patch = 0;
  9943. this.prerelease = [];
  9944. break;
  9945. case "patch":
  9946. if (this.prerelease.length === 0) {
  9947. this.patch++;
  9948. }
  9949. this.prerelease = [];
  9950. break;
  9951. case "pre":
  9952. if (this.prerelease.length === 0) {
  9953. this.prerelease = [0];
  9954. } else {
  9955. var i2 = this.prerelease.length;
  9956. while (--i2 >= 0) {
  9957. if (typeof this.prerelease[i2] === "number") {
  9958. this.prerelease[i2]++;
  9959. i2 = -2;
  9960. }
  9961. }
  9962. if (i2 === -1) {
  9963. this.prerelease.push(0);
  9964. }
  9965. }
  9966. if (identifier) {
  9967. if (this.prerelease[0] === identifier) {
  9968. if (isNaN(this.prerelease[1])) {
  9969. this.prerelease = [identifier, 0];
  9970. }
  9971. } else {
  9972. this.prerelease = [identifier, 0];
  9973. }
  9974. }
  9975. break;
  9976. default:
  9977. throw new Error("invalid increment argument: " + release);
  9978. }
  9979. this.format();
  9980. this.raw = this.version;
  9981. return this;
  9982. };
  9983. exports2.inc = inc;
  9984. function inc(version, release, loose, identifier) {
  9985. if (typeof loose === "string") {
  9986. identifier = loose;
  9987. loose = void 0;
  9988. }
  9989. try {
  9990. return new SemVer(version, loose).inc(release, identifier).version;
  9991. } catch (er) {
  9992. return null;
  9993. }
  9994. }
  9995. exports2.diff = diff;
  9996. function diff(version1, version2) {
  9997. if (eq(version1, version2)) {
  9998. return null;
  9999. } else {
  10000. var v1 = parse(version1);
  10001. var v2 = parse(version2);
  10002. var prefix = "";
  10003. if (v1.prerelease.length || v2.prerelease.length) {
  10004. prefix = "pre";
  10005. var defaultResult = "prerelease";
  10006. }
  10007. for (var key in v1) {
  10008. if (key === "major" || key === "minor" || key === "patch") {
  10009. if (v1[key] !== v2[key]) {
  10010. return prefix + key;
  10011. }
  10012. }
  10013. }
  10014. return defaultResult;
  10015. }
  10016. }
  10017. exports2.compareIdentifiers = compareIdentifiers;
  10018. var numeric = /^[0-9]+$/;
  10019. function compareIdentifiers(a, b) {
  10020. var anum = numeric.test(a);
  10021. var bnum = numeric.test(b);
  10022. if (anum && bnum) {
  10023. a = +a;
  10024. b = +b;
  10025. }
  10026. return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
  10027. }
  10028. exports2.rcompareIdentifiers = rcompareIdentifiers;
  10029. function rcompareIdentifiers(a, b) {
  10030. return compareIdentifiers(b, a);
  10031. }
  10032. exports2.major = major;
  10033. function major(a, loose) {
  10034. return new SemVer(a, loose).major;
  10035. }
  10036. exports2.minor = minor;
  10037. function minor(a, loose) {
  10038. return new SemVer(a, loose).minor;
  10039. }
  10040. exports2.patch = patch;
  10041. function patch(a, loose) {
  10042. return new SemVer(a, loose).patch;
  10043. }
  10044. exports2.compare = compare;
  10045. function compare(a, b, loose) {
  10046. return new SemVer(a, loose).compare(new SemVer(b, loose));
  10047. }
  10048. exports2.compareLoose = compareLoose;
  10049. function compareLoose(a, b) {
  10050. return compare(a, b, true);
  10051. }
  10052. exports2.compareBuild = compareBuild;
  10053. function compareBuild(a, b, loose) {
  10054. var versionA = new SemVer(a, loose);
  10055. var versionB = new SemVer(b, loose);
  10056. return versionA.compare(versionB) || versionA.compareBuild(versionB);
  10057. }
  10058. exports2.rcompare = rcompare;
  10059. function rcompare(a, b, loose) {
  10060. return compare(b, a, loose);
  10061. }
  10062. exports2.sort = sort;
  10063. function sort(list, loose) {
  10064. return list.sort(function(a, b) {
  10065. return exports2.compareBuild(a, b, loose);
  10066. });
  10067. }
  10068. exports2.rsort = rsort;
  10069. function rsort(list, loose) {
  10070. return list.sort(function(a, b) {
  10071. return exports2.compareBuild(b, a, loose);
  10072. });
  10073. }
  10074. exports2.gt = gt;
  10075. function gt(a, b, loose) {
  10076. return compare(a, b, loose) > 0;
  10077. }
  10078. exports2.lt = lt;
  10079. function lt(a, b, loose) {
  10080. return compare(a, b, loose) < 0;
  10081. }
  10082. exports2.eq = eq;
  10083. function eq(a, b, loose) {
  10084. return compare(a, b, loose) === 0;
  10085. }
  10086. exports2.neq = neq;
  10087. function neq(a, b, loose) {
  10088. return compare(a, b, loose) !== 0;
  10089. }
  10090. exports2.gte = gte;
  10091. function gte(a, b, loose) {
  10092. return compare(a, b, loose) >= 0;
  10093. }
  10094. exports2.lte = lte;
  10095. function lte(a, b, loose) {
  10096. return compare(a, b, loose) <= 0;
  10097. }
  10098. exports2.cmp = cmp;
  10099. function cmp(a, op, b, loose) {
  10100. switch (op) {
  10101. case "===":
  10102. if (typeof a === "object")
  10103. a = a.version;
  10104. if (typeof b === "object")
  10105. b = b.version;
  10106. return a === b;
  10107. case "!==":
  10108. if (typeof a === "object")
  10109. a = a.version;
  10110. if (typeof b === "object")
  10111. b = b.version;
  10112. return a !== b;
  10113. case "":
  10114. case "=":
  10115. case "==":
  10116. return eq(a, b, loose);
  10117. case "!=":
  10118. return neq(a, b, loose);
  10119. case ">":
  10120. return gt(a, b, loose);
  10121. case ">=":
  10122. return gte(a, b, loose);
  10123. case "<":
  10124. return lt(a, b, loose);
  10125. case "<=":
  10126. return lte(a, b, loose);
  10127. default:
  10128. throw new TypeError("Invalid operator: " + op);
  10129. }
  10130. }
  10131. exports2.Comparator = Comparator;
  10132. function Comparator(comp, options) {
  10133. if (!options || typeof options !== "object") {
  10134. options = {
  10135. loose: !!options,
  10136. includePrerelease: false
  10137. };
  10138. }
  10139. if (comp instanceof Comparator) {
  10140. if (comp.loose === !!options.loose) {
  10141. return comp;
  10142. } else {
  10143. comp = comp.value;
  10144. }
  10145. }
  10146. if (!(this instanceof Comparator)) {
  10147. return new Comparator(comp, options);
  10148. }
  10149. debug("comparator", comp, options);
  10150. this.options = options;
  10151. this.loose = !!options.loose;
  10152. this.parse(comp);
  10153. if (this.semver === ANY) {
  10154. this.value = "";
  10155. } else {
  10156. this.value = this.operator + this.semver.version;
  10157. }
  10158. debug("comp", this);
  10159. }
  10160. var ANY = {};
  10161. Comparator.prototype.parse = function(comp) {
  10162. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10163. var m = comp.match(r);
  10164. if (!m) {
  10165. throw new TypeError("Invalid comparator: " + comp);
  10166. }
  10167. this.operator = m[1] !== void 0 ? m[1] : "";
  10168. if (this.operator === "=") {
  10169. this.operator = "";
  10170. }
  10171. if (!m[2]) {
  10172. this.semver = ANY;
  10173. } else {
  10174. this.semver = new SemVer(m[2], this.options.loose);
  10175. }
  10176. };
  10177. Comparator.prototype.toString = function() {
  10178. return this.value;
  10179. };
  10180. Comparator.prototype.test = function(version) {
  10181. debug("Comparator.test", version, this.options.loose);
  10182. if (this.semver === ANY || version === ANY) {
  10183. return true;
  10184. }
  10185. if (typeof version === "string") {
  10186. try {
  10187. version = new SemVer(version, this.options);
  10188. } catch (er) {
  10189. return false;
  10190. }
  10191. }
  10192. return cmp(version, this.operator, this.semver, this.options);
  10193. };
  10194. Comparator.prototype.intersects = function(comp, options) {
  10195. if (!(comp instanceof Comparator)) {
  10196. throw new TypeError("a Comparator is required");
  10197. }
  10198. if (!options || typeof options !== "object") {
  10199. options = {
  10200. loose: !!options,
  10201. includePrerelease: false
  10202. };
  10203. }
  10204. var rangeTmp;
  10205. if (this.operator === "") {
  10206. if (this.value === "") {
  10207. return true;
  10208. }
  10209. rangeTmp = new Range(comp.value, options);
  10210. return satisfies(this.value, rangeTmp, options);
  10211. } else if (comp.operator === "") {
  10212. if (comp.value === "") {
  10213. return true;
  10214. }
  10215. rangeTmp = new Range(this.value, options);
  10216. return satisfies(comp.semver, rangeTmp, options);
  10217. }
  10218. var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
  10219. var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
  10220. var sameSemVer = this.semver.version === comp.semver.version;
  10221. var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
  10222. var oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
  10223. var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
  10224. return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
  10225. };
  10226. exports2.Range = Range;
  10227. function Range(range, options) {
  10228. if (!options || typeof options !== "object") {
  10229. options = {
  10230. loose: !!options,
  10231. includePrerelease: false
  10232. };
  10233. }
  10234. if (range instanceof Range) {
  10235. if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
  10236. return range;
  10237. } else {
  10238. return new Range(range.raw, options);
  10239. }
  10240. }
  10241. if (range instanceof Comparator) {
  10242. return new Range(range.value, options);
  10243. }
  10244. if (!(this instanceof Range)) {
  10245. return new Range(range, options);
  10246. }
  10247. this.options = options;
  10248. this.loose = !!options.loose;
  10249. this.includePrerelease = !!options.includePrerelease;
  10250. this.raw = range;
  10251. this.set = range.split(/\s*\|\|\s*/).map(function(range2) {
  10252. return this.parseRange(range2.trim());
  10253. }, this).filter(function(c) {
  10254. return c.length;
  10255. });
  10256. if (!this.set.length) {
  10257. throw new TypeError("Invalid SemVer Range: " + range);
  10258. }
  10259. this.format();
  10260. }
  10261. Range.prototype.format = function() {
  10262. this.range = this.set.map(function(comps) {
  10263. return comps.join(" ").trim();
  10264. }).join("||").trim();
  10265. return this.range;
  10266. };
  10267. Range.prototype.toString = function() {
  10268. return this.range;
  10269. };
  10270. Range.prototype.parseRange = function(range) {
  10271. var loose = this.options.loose;
  10272. range = range.trim();
  10273. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
  10274. range = range.replace(hr, hyphenReplace);
  10275. debug("hyphen replace", range);
  10276. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
  10277. debug("comparator trim", range, re[t.COMPARATORTRIM]);
  10278. range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
  10279. range = range.replace(re[t.CARETTRIM], caretTrimReplace);
  10280. range = range.split(/\s+/).join(" ");
  10281. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
  10282. var set = range.split(" ").map(function(comp) {
  10283. return parseComparator(comp, this.options);
  10284. }, this).join(" ").split(/\s+/);
  10285. if (this.options.loose) {
  10286. set = set.filter(function(comp) {
  10287. return !!comp.match(compRe);
  10288. });
  10289. }
  10290. set = set.map(function(comp) {
  10291. return new Comparator(comp, this.options);
  10292. }, this);
  10293. return set;
  10294. };
  10295. Range.prototype.intersects = function(range, options) {
  10296. if (!(range instanceof Range)) {
  10297. throw new TypeError("a Range is required");
  10298. }
  10299. return this.set.some(function(thisComparators) {
  10300. return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
  10301. return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
  10302. return rangeComparators.every(function(rangeComparator) {
  10303. return thisComparator.intersects(rangeComparator, options);
  10304. });
  10305. });
  10306. });
  10307. });
  10308. };
  10309. function isSatisfiable(comparators, options) {
  10310. var result = true;
  10311. var remainingComparators = comparators.slice();
  10312. var testComparator = remainingComparators.pop();
  10313. while (result && remainingComparators.length) {
  10314. result = remainingComparators.every(function(otherComparator) {
  10315. return testComparator.intersects(otherComparator, options);
  10316. });
  10317. testComparator = remainingComparators.pop();
  10318. }
  10319. return result;
  10320. }
  10321. exports2.toComparators = toComparators;
  10322. function toComparators(range, options) {
  10323. return new Range(range, options).set.map(function(comp) {
  10324. return comp.map(function(c) {
  10325. return c.value;
  10326. }).join(" ").trim().split(" ");
  10327. });
  10328. }
  10329. function parseComparator(comp, options) {
  10330. debug("comp", comp, options);
  10331. comp = replaceCarets(comp, options);
  10332. debug("caret", comp);
  10333. comp = replaceTildes(comp, options);
  10334. debug("tildes", comp);
  10335. comp = replaceXRanges(comp, options);
  10336. debug("xrange", comp);
  10337. comp = replaceStars(comp, options);
  10338. debug("stars", comp);
  10339. return comp;
  10340. }
  10341. function isX(id) {
  10342. return !id || id.toLowerCase() === "x" || id === "*";
  10343. }
  10344. function replaceTildes(comp, options) {
  10345. return comp.trim().split(/\s+/).map(function(comp2) {
  10346. return replaceTilde(comp2, options);
  10347. }).join(" ");
  10348. }
  10349. function replaceTilde(comp, options) {
  10350. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
  10351. return comp.replace(r, function(_, M, m, p, pr) {
  10352. debug("tilde", comp, _, M, m, p, pr);
  10353. var ret;
  10354. if (isX(M)) {
  10355. ret = "";
  10356. } else if (isX(m)) {
  10357. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10358. } else if (isX(p)) {
  10359. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10360. } else if (pr) {
  10361. debug("replaceTilde pr", pr);
  10362. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10363. } else {
  10364. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10365. }
  10366. debug("tilde return", ret);
  10367. return ret;
  10368. });
  10369. }
  10370. function replaceCarets(comp, options) {
  10371. return comp.trim().split(/\s+/).map(function(comp2) {
  10372. return replaceCaret(comp2, options);
  10373. }).join(" ");
  10374. }
  10375. function replaceCaret(comp, options) {
  10376. debug("caret", comp, options);
  10377. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
  10378. return comp.replace(r, function(_, M, m, p, pr) {
  10379. debug("caret", comp, _, M, m, p, pr);
  10380. var ret;
  10381. if (isX(M)) {
  10382. ret = "";
  10383. } else if (isX(m)) {
  10384. ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
  10385. } else if (isX(p)) {
  10386. if (M === "0") {
  10387. ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
  10388. } else {
  10389. ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
  10390. }
  10391. } else if (pr) {
  10392. debug("replaceCaret pr", pr);
  10393. if (M === "0") {
  10394. if (m === "0") {
  10395. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
  10396. } else {
  10397. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
  10398. }
  10399. } else {
  10400. ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
  10401. }
  10402. } else {
  10403. debug("no pr");
  10404. if (M === "0") {
  10405. if (m === "0") {
  10406. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
  10407. } else {
  10408. ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
  10409. }
  10410. } else {
  10411. ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
  10412. }
  10413. }
  10414. debug("caret return", ret);
  10415. return ret;
  10416. });
  10417. }
  10418. function replaceXRanges(comp, options) {
  10419. debug("replaceXRanges", comp, options);
  10420. return comp.split(/\s+/).map(function(comp2) {
  10421. return replaceXRange(comp2, options);
  10422. }).join(" ");
  10423. }
  10424. function replaceXRange(comp, options) {
  10425. comp = comp.trim();
  10426. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
  10427. return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
  10428. debug("xRange", comp, ret, gtlt, M, m, p, pr);
  10429. var xM = isX(M);
  10430. var xm = xM || isX(m);
  10431. var xp = xm || isX(p);
  10432. var anyX = xp;
  10433. if (gtlt === "=" && anyX) {
  10434. gtlt = "";
  10435. }
  10436. pr = options.includePrerelease ? "-0" : "";
  10437. if (xM) {
  10438. if (gtlt === ">" || gtlt === "<") {
  10439. ret = "<0.0.0-0";
  10440. } else {
  10441. ret = "*";
  10442. }
  10443. } else if (gtlt && anyX) {
  10444. if (xm) {
  10445. m = 0;
  10446. }
  10447. p = 0;
  10448. if (gtlt === ">") {
  10449. gtlt = ">=";
  10450. if (xm) {
  10451. M = +M + 1;
  10452. m = 0;
  10453. p = 0;
  10454. } else {
  10455. m = +m + 1;
  10456. p = 0;
  10457. }
  10458. } else if (gtlt === "<=") {
  10459. gtlt = "<";
  10460. if (xm) {
  10461. M = +M + 1;
  10462. } else {
  10463. m = +m + 1;
  10464. }
  10465. }
  10466. ret = gtlt + M + "." + m + "." + p + pr;
  10467. } else if (xm) {
  10468. ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
  10469. } else if (xp) {
  10470. ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
  10471. }
  10472. debug("xRange return", ret);
  10473. return ret;
  10474. });
  10475. }
  10476. function replaceStars(comp, options) {
  10477. debug("replaceStars", comp, options);
  10478. return comp.trim().replace(re[t.STAR], "");
  10479. }
  10480. function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
  10481. if (isX(fM)) {
  10482. from = "";
  10483. } else if (isX(fm)) {
  10484. from = ">=" + fM + ".0.0";
  10485. } else if (isX(fp)) {
  10486. from = ">=" + fM + "." + fm + ".0";
  10487. } else {
  10488. from = ">=" + from;
  10489. }
  10490. if (isX(tM)) {
  10491. to = "";
  10492. } else if (isX(tm)) {
  10493. to = "<" + (+tM + 1) + ".0.0";
  10494. } else if (isX(tp)) {
  10495. to = "<" + tM + "." + (+tm + 1) + ".0";
  10496. } else if (tpr) {
  10497. to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
  10498. } else {
  10499. to = "<=" + to;
  10500. }
  10501. return (from + " " + to).trim();
  10502. }
  10503. Range.prototype.test = function(version) {
  10504. if (!version) {
  10505. return false;
  10506. }
  10507. if (typeof version === "string") {
  10508. try {
  10509. version = new SemVer(version, this.options);
  10510. } catch (er) {
  10511. return false;
  10512. }
  10513. }
  10514. for (var i2 = 0; i2 < this.set.length; i2++) {
  10515. if (testSet(this.set[i2], version, this.options)) {
  10516. return true;
  10517. }
  10518. }
  10519. return false;
  10520. };
  10521. function testSet(set, version, options) {
  10522. for (var i2 = 0; i2 < set.length; i2++) {
  10523. if (!set[i2].test(version)) {
  10524. return false;
  10525. }
  10526. }
  10527. if (version.prerelease.length && !options.includePrerelease) {
  10528. for (i2 = 0; i2 < set.length; i2++) {
  10529. debug(set[i2].semver);
  10530. if (set[i2].semver === ANY) {
  10531. continue;
  10532. }
  10533. if (set[i2].semver.prerelease.length > 0) {
  10534. var allowed = set[i2].semver;
  10535. if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
  10536. return true;
  10537. }
  10538. }
  10539. }
  10540. return false;
  10541. }
  10542. return true;
  10543. }
  10544. exports2.satisfies = satisfies;
  10545. function satisfies(version, range, options) {
  10546. try {
  10547. range = new Range(range, options);
  10548. } catch (er) {
  10549. return false;
  10550. }
  10551. return range.test(version);
  10552. }
  10553. exports2.maxSatisfying = maxSatisfying;
  10554. function maxSatisfying(versions, range, options) {
  10555. var max = null;
  10556. var maxSV = null;
  10557. try {
  10558. var rangeObj = new Range(range, options);
  10559. } catch (er) {
  10560. return null;
  10561. }
  10562. versions.forEach(function(v) {
  10563. if (rangeObj.test(v)) {
  10564. if (!max || maxSV.compare(v) === -1) {
  10565. max = v;
  10566. maxSV = new SemVer(max, options);
  10567. }
  10568. }
  10569. });
  10570. return max;
  10571. }
  10572. exports2.minSatisfying = minSatisfying;
  10573. function minSatisfying(versions, range, options) {
  10574. var min = null;
  10575. var minSV = null;
  10576. try {
  10577. var rangeObj = new Range(range, options);
  10578. } catch (er) {
  10579. return null;
  10580. }
  10581. versions.forEach(function(v) {
  10582. if (rangeObj.test(v)) {
  10583. if (!min || minSV.compare(v) === 1) {
  10584. min = v;
  10585. minSV = new SemVer(min, options);
  10586. }
  10587. }
  10588. });
  10589. return min;
  10590. }
  10591. exports2.minVersion = minVersion;
  10592. function minVersion(range, loose) {
  10593. range = new Range(range, loose);
  10594. var minver = new SemVer("0.0.0");
  10595. if (range.test(minver)) {
  10596. return minver;
  10597. }
  10598. minver = new SemVer("0.0.0-0");
  10599. if (range.test(minver)) {
  10600. return minver;
  10601. }
  10602. minver = null;
  10603. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10604. var comparators = range.set[i2];
  10605. comparators.forEach(function(comparator) {
  10606. var compver = new SemVer(comparator.semver.version);
  10607. switch (comparator.operator) {
  10608. case ">":
  10609. if (compver.prerelease.length === 0) {
  10610. compver.patch++;
  10611. } else {
  10612. compver.prerelease.push(0);
  10613. }
  10614. compver.raw = compver.format();
  10615. case "":
  10616. case ">=":
  10617. if (!minver || gt(minver, compver)) {
  10618. minver = compver;
  10619. }
  10620. break;
  10621. case "<":
  10622. case "<=":
  10623. break;
  10624. default:
  10625. throw new Error("Unexpected operation: " + comparator.operator);
  10626. }
  10627. });
  10628. }
  10629. if (minver && range.test(minver)) {
  10630. return minver;
  10631. }
  10632. return null;
  10633. }
  10634. exports2.validRange = validRange;
  10635. function validRange(range, options) {
  10636. try {
  10637. return new Range(range, options).range || "*";
  10638. } catch (er) {
  10639. return null;
  10640. }
  10641. }
  10642. exports2.ltr = ltr;
  10643. function ltr(version, range, options) {
  10644. return outside(version, range, "<", options);
  10645. }
  10646. exports2.gtr = gtr;
  10647. function gtr(version, range, options) {
  10648. return outside(version, range, ">", options);
  10649. }
  10650. exports2.outside = outside;
  10651. function outside(version, range, hilo, options) {
  10652. version = new SemVer(version, options);
  10653. range = new Range(range, options);
  10654. var gtfn, ltefn, ltfn, comp, ecomp;
  10655. switch (hilo) {
  10656. case ">":
  10657. gtfn = gt;
  10658. ltefn = lte;
  10659. ltfn = lt;
  10660. comp = ">";
  10661. ecomp = ">=";
  10662. break;
  10663. case "<":
  10664. gtfn = lt;
  10665. ltefn = gte;
  10666. ltfn = gt;
  10667. comp = "<";
  10668. ecomp = "<=";
  10669. break;
  10670. default:
  10671. throw new TypeError('Must provide a hilo val of "<" or ">"');
  10672. }
  10673. if (satisfies(version, range, options)) {
  10674. return false;
  10675. }
  10676. for (var i2 = 0; i2 < range.set.length; ++i2) {
  10677. var comparators = range.set[i2];
  10678. var high = null;
  10679. var low = null;
  10680. comparators.forEach(function(comparator) {
  10681. if (comparator.semver === ANY) {
  10682. comparator = new Comparator(">=0.0.0");
  10683. }
  10684. high = high || comparator;
  10685. low = low || comparator;
  10686. if (gtfn(comparator.semver, high.semver, options)) {
  10687. high = comparator;
  10688. } else if (ltfn(comparator.semver, low.semver, options)) {
  10689. low = comparator;
  10690. }
  10691. });
  10692. if (high.operator === comp || high.operator === ecomp) {
  10693. return false;
  10694. }
  10695. if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
  10696. return false;
  10697. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10698. return false;
  10699. }
  10700. }
  10701. return true;
  10702. }
  10703. exports2.prerelease = prerelease;
  10704. function prerelease(version, options) {
  10705. var parsed = parse(version, options);
  10706. return parsed && parsed.prerelease.length ? parsed.prerelease : null;
  10707. }
  10708. exports2.intersects = intersects;
  10709. function intersects(r1, r2, options) {
  10710. r1 = new Range(r1, options);
  10711. r2 = new Range(r2, options);
  10712. return r1.intersects(r2);
  10713. }
  10714. exports2.coerce = coerce;
  10715. function coerce(version, options) {
  10716. if (version instanceof SemVer) {
  10717. return version;
  10718. }
  10719. if (typeof version === "number") {
  10720. version = String(version);
  10721. }
  10722. if (typeof version !== "string") {
  10723. return null;
  10724. }
  10725. options = options || {};
  10726. var match = null;
  10727. if (!options.rtl) {
  10728. match = version.match(re[t.COERCE]);
  10729. } else {
  10730. var next;
  10731. while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
  10732. if (!match || next.index + next[0].length !== match.index + match[0].length) {
  10733. match = next;
  10734. }
  10735. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
  10736. }
  10737. re[t.COERCERTL].lastIndex = -1;
  10738. }
  10739. if (match === null) {
  10740. return null;
  10741. }
  10742. return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
  10743. }
  10744. }
  10745. });
  10746. var require_make_dir = __commonJS2({
  10747. "node_modules/make-dir/index.js"(exports2, module2) {
  10748. "use strict";
  10749. var fs = require("fs");
  10750. var path = require("path");
  10751. var {
  10752. promisify
  10753. } = require("util");
  10754. var semver = require_semver();
  10755. var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
  10756. var checkPath = (pth) => {
  10757. if (process.platform === "win32") {
  10758. const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
  10759. if (pathHasInvalidWinCharacters) {
  10760. const error = new Error(`Path contains invalid characters: ${pth}`);
  10761. error.code = "EINVAL";
  10762. throw error;
  10763. }
  10764. }
  10765. };
  10766. var processOptions = (options) => {
  10767. const defaults = {
  10768. mode: 511,
  10769. fs
  10770. };
  10771. return Object.assign(Object.assign({}, defaults), options);
  10772. };
  10773. var permissionError = (pth) => {
  10774. const error = new Error(`operation not permitted, mkdir '${pth}'`);
  10775. error.code = "EPERM";
  10776. error.errno = -4048;
  10777. error.path = pth;
  10778. error.syscall = "mkdir";
  10779. return error;
  10780. };
  10781. var makeDir = async (input, options) => {
  10782. checkPath(input);
  10783. options = processOptions(options);
  10784. const mkdir = promisify(options.fs.mkdir);
  10785. const stat = promisify(options.fs.stat);
  10786. if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
  10787. const pth = path.resolve(input);
  10788. await mkdir(pth, {
  10789. mode: options.mode,
  10790. recursive: true
  10791. });
  10792. return pth;
  10793. }
  10794. const make = async (pth) => {
  10795. try {
  10796. await mkdir(pth, options.mode);
  10797. return pth;
  10798. } catch (error) {
  10799. if (error.code === "EPERM") {
  10800. throw error;
  10801. }
  10802. if (error.code === "ENOENT") {
  10803. if (path.dirname(pth) === pth) {
  10804. throw permissionError(pth);
  10805. }
  10806. if (error.message.includes("null bytes")) {
  10807. throw error;
  10808. }
  10809. await make(path.dirname(pth));
  10810. return make(pth);
  10811. }
  10812. try {
  10813. const stats = await stat(pth);
  10814. if (!stats.isDirectory()) {
  10815. throw new Error("The path is not a directory");
  10816. }
  10817. } catch (_) {
  10818. throw error;
  10819. }
  10820. return pth;
  10821. }
  10822. };
  10823. return make(path.resolve(input));
  10824. };
  10825. module2.exports = makeDir;
  10826. module2.exports.sync = (input, options) => {
  10827. checkPath(input);
  10828. options = processOptions(options);
  10829. if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
  10830. const pth = path.resolve(input);
  10831. fs.mkdirSync(pth, {
  10832. mode: options.mode,
  10833. recursive: true
  10834. });
  10835. return pth;
  10836. }
  10837. const make = (pth) => {
  10838. try {
  10839. options.fs.mkdirSync(pth, options.mode);
  10840. } catch (error) {
  10841. if (error.code === "EPERM") {
  10842. throw error;
  10843. }
  10844. if (error.code === "ENOENT") {
  10845. if (path.dirname(pth) === pth) {
  10846. throw permissionError(pth);
  10847. }
  10848. if (error.message.includes("null bytes")) {
  10849. throw error;
  10850. }
  10851. make(path.dirname(pth));
  10852. return make(pth);
  10853. }
  10854. try {
  10855. if (!options.fs.statSync(pth).isDirectory()) {
  10856. throw new Error("The path is not a directory");
  10857. }
  10858. } catch (_) {
  10859. throw error;
  10860. }
  10861. }
  10862. return pth;
  10863. };
  10864. return make(path.resolve(input));
  10865. };
  10866. }
  10867. });
  10868. var require_find_cache_dir = __commonJS2({
  10869. "node_modules/find-cache-dir/index.js"(exports2, module2) {
  10870. "use strict";
  10871. var path = require("path");
  10872. var fs = require("fs");
  10873. var commonDir = require_commondir();
  10874. var pkgDir = require_pkg_dir();
  10875. var makeDir = require_make_dir();
  10876. var {
  10877. env: env2,
  10878. cwd
  10879. } = process;
  10880. var isWritable = (path2) => {
  10881. try {
  10882. fs.accessSync(path2, fs.constants.W_OK);
  10883. return true;
  10884. } catch (_) {
  10885. return false;
  10886. }
  10887. };
  10888. function useDirectory(directory, options) {
  10889. if (options.create) {
  10890. makeDir.sync(directory);
  10891. }
  10892. if (options.thunk) {
  10893. return (...arguments_) => path.join(directory, ...arguments_);
  10894. }
  10895. return directory;
  10896. }
  10897. function getNodeModuleDirectory(directory) {
  10898. const nodeModules = path.join(directory, "node_modules");
  10899. if (!isWritable(nodeModules) && (fs.existsSync(nodeModules) || !isWritable(path.join(directory)))) {
  10900. return;
  10901. }
  10902. return nodeModules;
  10903. }
  10904. module2.exports = (options = {}) => {
  10905. if (env2.CACHE_DIR && !["true", "false", "1", "0"].includes(env2.CACHE_DIR)) {
  10906. return useDirectory(path.join(env2.CACHE_DIR, options.name), options);
  10907. }
  10908. let {
  10909. cwd: directory = cwd()
  10910. } = options;
  10911. if (options.files) {
  10912. directory = commonDir(directory, options.files);
  10913. }
  10914. directory = pkgDir.sync(directory);
  10915. if (!directory) {
  10916. return;
  10917. }
  10918. const nodeModules = getNodeModuleDirectory(directory);
  10919. if (!nodeModules) {
  10920. return void 0;
  10921. }
  10922. return useDirectory(path.join(directory, "node_modules", ".cache", options.name), options);
  10923. };
  10924. }
  10925. });
  10926. var require_find_cache_file = __commonJS2({
  10927. "src/cli/find-cache-file.js"(exports2, module2) {
  10928. "use strict";
  10929. var fs = require("fs").promises;
  10930. var os2 = require("os");
  10931. var path = require("path");
  10932. var findCacheDir = require_find_cache_dir();
  10933. var {
  10934. statSafe,
  10935. isJson
  10936. } = require_utils();
  10937. function findDefaultCacheFile() {
  10938. const cacheDir = findCacheDir({
  10939. name: "prettier",
  10940. create: true
  10941. }) || os2.tmpdir();
  10942. const cacheFilePath = path.join(cacheDir, ".prettier-cache");
  10943. return cacheFilePath;
  10944. }
  10945. async function findCacheFileFromOption(cacheLocation) {
  10946. const cacheFile = path.resolve(cacheLocation);
  10947. const stat = await statSafe(cacheFile);
  10948. if (stat) {
  10949. if (stat.isDirectory()) {
  10950. throw new Error(`Resolved --cache-location '${cacheFile}' is a directory`);
  10951. }
  10952. const data = await fs.readFile(cacheFile, "utf8");
  10953. if (!isJson(data)) {
  10954. throw new Error(`'${cacheFile}' isn't a valid JSON file`);
  10955. }
  10956. }
  10957. return cacheFile;
  10958. }
  10959. async function findCacheFile(cacheLocation) {
  10960. if (!cacheLocation) {
  10961. return findDefaultCacheFile();
  10962. }
  10963. const cacheFile = await findCacheFileFromOption(cacheLocation);
  10964. return cacheFile;
  10965. }
  10966. module2.exports = findCacheFile;
  10967. }
  10968. });
  10969. var require_cjs = __commonJS2({
  10970. "node_modules/flatted/cjs/index.js"(exports2) {
  10971. "use strict";
  10972. var {
  10973. parse: $parse,
  10974. stringify: $stringify
  10975. } = JSON;
  10976. var {
  10977. keys
  10978. } = Object;
  10979. var Primitive = String;
  10980. var primitive = "string";
  10981. var ignore = {};
  10982. var object = "object";
  10983. var noop = (_, value) => value;
  10984. var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
  10985. var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
  10986. var revive = (input, parsed, output, $) => {
  10987. const lazy = [];
  10988. for (let ke = keys(output), {
  10989. length
  10990. } = ke, y = 0; y < length; y++) {
  10991. const k = ke[y];
  10992. const value = output[k];
  10993. if (value instanceof Primitive) {
  10994. const tmp = input[value];
  10995. if (typeof tmp === object && !parsed.has(tmp)) {
  10996. parsed.add(tmp);
  10997. output[k] = ignore;
  10998. lazy.push({
  10999. k,
  11000. a: [input, parsed, tmp, $]
  11001. });
  11002. } else
  11003. output[k] = $.call(output, k, tmp);
  11004. } else if (output[k] !== ignore)
  11005. output[k] = $.call(output, k, value);
  11006. }
  11007. for (let {
  11008. length
  11009. } = lazy, i = 0; i < length; i++) {
  11010. const {
  11011. k,
  11012. a
  11013. } = lazy[i];
  11014. output[k] = $.call(output, k, revive.apply(null, a));
  11015. }
  11016. return output;
  11017. };
  11018. var set = (known, input, value) => {
  11019. const index = Primitive(input.push(value) - 1);
  11020. known.set(value, index);
  11021. return index;
  11022. };
  11023. var parse = (text, reviver) => {
  11024. const input = $parse(text, Primitives).map(primitives);
  11025. const value = input[0];
  11026. const $ = reviver || noop;
  11027. const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
  11028. return $.call({
  11029. "": tmp
  11030. }, "", tmp);
  11031. };
  11032. exports2.parse = parse;
  11033. var stringify2 = (value, replacer, space) => {
  11034. const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
  11035. const known = /* @__PURE__ */ new Map();
  11036. const input = [];
  11037. const output = [];
  11038. let i = +set(known, input, $.call({
  11039. "": value
  11040. }, "", value));
  11041. let firstRun = !i;
  11042. while (i < input.length) {
  11043. firstRun = true;
  11044. output[i] = $stringify(input[i++], replace, space);
  11045. }
  11046. return "[" + output.join(",") + "]";
  11047. function replace(key, value2) {
  11048. if (firstRun) {
  11049. firstRun = !firstRun;
  11050. return value2;
  11051. }
  11052. const after = $.call(this, key, value2);
  11053. switch (typeof after) {
  11054. case object:
  11055. if (after === null)
  11056. return after;
  11057. case primitive:
  11058. return known.get(after) || set(known, input, after);
  11059. }
  11060. return after;
  11061. }
  11062. };
  11063. exports2.stringify = stringify2;
  11064. var toJSON = (any) => $parse(stringify2(any));
  11065. exports2.toJSON = toJSON;
  11066. var fromJSON = (any) => parse($stringify(any));
  11067. exports2.fromJSON = fromJSON;
  11068. }
  11069. });
  11070. var require_utils6 = __commonJS2({
  11071. "node_modules/flat-cache/src/utils.js"(exports2, module2) {
  11072. var fs = require("fs");
  11073. var path = require("path");
  11074. var flatted = require_cjs();
  11075. module2.exports = {
  11076. tryParse: function(filePath, defaultValue) {
  11077. var result;
  11078. try {
  11079. result = this.readJSON(filePath);
  11080. } catch (ex) {
  11081. result = defaultValue;
  11082. }
  11083. return result;
  11084. },
  11085. readJSON: function(filePath) {
  11086. return flatted.parse(fs.readFileSync(filePath, {
  11087. encoding: "utf8"
  11088. }));
  11089. },
  11090. writeJSON: function(filePath, data) {
  11091. fs.mkdirSync(path.dirname(filePath), {
  11092. recursive: true
  11093. });
  11094. fs.writeFileSync(filePath, flatted.stringify(data));
  11095. }
  11096. };
  11097. }
  11098. });
  11099. var require_old = __commonJS2({
  11100. "node_modules/fs.realpath/old.js"(exports2) {
  11101. var pathModule = require("path");
  11102. var isWindows = process.platform === "win32";
  11103. var fs = require("fs");
  11104. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  11105. function rethrow() {
  11106. var callback;
  11107. if (DEBUG) {
  11108. var backtrace = new Error();
  11109. callback = debugCallback;
  11110. } else
  11111. callback = missingCallback;
  11112. return callback;
  11113. function debugCallback(err) {
  11114. if (err) {
  11115. backtrace.message = err.message;
  11116. err = backtrace;
  11117. missingCallback(err);
  11118. }
  11119. }
  11120. function missingCallback(err) {
  11121. if (err) {
  11122. if (process.throwDeprecation)
  11123. throw err;
  11124. else if (!process.noDeprecation) {
  11125. var msg = "fs: missing callback " + (err.stack || err.message);
  11126. if (process.traceDeprecation)
  11127. console.trace(msg);
  11128. else
  11129. console.error(msg);
  11130. }
  11131. }
  11132. }
  11133. }
  11134. function maybeCallback(cb) {
  11135. return typeof cb === "function" ? cb : rethrow();
  11136. }
  11137. var normalize = pathModule.normalize;
  11138. if (isWindows) {
  11139. nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  11140. } else {
  11141. nextPartRe = /(.*?)(?:[\/]+|$)/g;
  11142. }
  11143. var nextPartRe;
  11144. if (isWindows) {
  11145. splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  11146. } else {
  11147. splitRootRe = /^[\/]*/;
  11148. }
  11149. var splitRootRe;
  11150. exports2.realpathSync = function realpathSync(p, cache) {
  11151. p = pathModule.resolve(p);
  11152. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11153. return cache[p];
  11154. }
  11155. var original = p, seenLinks = {}, knownHard = {};
  11156. var pos;
  11157. var current;
  11158. var base;
  11159. var previous;
  11160. start();
  11161. function start() {
  11162. var m = splitRootRe.exec(p);
  11163. pos = m[0].length;
  11164. current = m[0];
  11165. base = m[0];
  11166. previous = "";
  11167. if (isWindows && !knownHard[base]) {
  11168. fs.lstatSync(base);
  11169. knownHard[base] = true;
  11170. }
  11171. }
  11172. while (pos < p.length) {
  11173. nextPartRe.lastIndex = pos;
  11174. var result = nextPartRe.exec(p);
  11175. previous = current;
  11176. current += result[0];
  11177. base = previous + result[1];
  11178. pos = nextPartRe.lastIndex;
  11179. if (knownHard[base] || cache && cache[base] === base) {
  11180. continue;
  11181. }
  11182. var resolvedLink;
  11183. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11184. resolvedLink = cache[base];
  11185. } else {
  11186. var stat = fs.lstatSync(base);
  11187. if (!stat.isSymbolicLink()) {
  11188. knownHard[base] = true;
  11189. if (cache)
  11190. cache[base] = base;
  11191. continue;
  11192. }
  11193. var linkTarget = null;
  11194. if (!isWindows) {
  11195. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11196. if (seenLinks.hasOwnProperty(id)) {
  11197. linkTarget = seenLinks[id];
  11198. }
  11199. }
  11200. if (linkTarget === null) {
  11201. fs.statSync(base);
  11202. linkTarget = fs.readlinkSync(base);
  11203. }
  11204. resolvedLink = pathModule.resolve(previous, linkTarget);
  11205. if (cache)
  11206. cache[base] = resolvedLink;
  11207. if (!isWindows)
  11208. seenLinks[id] = linkTarget;
  11209. }
  11210. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11211. start();
  11212. }
  11213. if (cache)
  11214. cache[original] = p;
  11215. return p;
  11216. };
  11217. exports2.realpath = function realpath(p, cache, cb) {
  11218. if (typeof cb !== "function") {
  11219. cb = maybeCallback(cache);
  11220. cache = null;
  11221. }
  11222. p = pathModule.resolve(p);
  11223. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  11224. return process.nextTick(cb.bind(null, null, cache[p]));
  11225. }
  11226. var original = p, seenLinks = {}, knownHard = {};
  11227. var pos;
  11228. var current;
  11229. var base;
  11230. var previous;
  11231. start();
  11232. function start() {
  11233. var m = splitRootRe.exec(p);
  11234. pos = m[0].length;
  11235. current = m[0];
  11236. base = m[0];
  11237. previous = "";
  11238. if (isWindows && !knownHard[base]) {
  11239. fs.lstat(base, function(err) {
  11240. if (err)
  11241. return cb(err);
  11242. knownHard[base] = true;
  11243. LOOP();
  11244. });
  11245. } else {
  11246. process.nextTick(LOOP);
  11247. }
  11248. }
  11249. function LOOP() {
  11250. if (pos >= p.length) {
  11251. if (cache)
  11252. cache[original] = p;
  11253. return cb(null, p);
  11254. }
  11255. nextPartRe.lastIndex = pos;
  11256. var result = nextPartRe.exec(p);
  11257. previous = current;
  11258. current += result[0];
  11259. base = previous + result[1];
  11260. pos = nextPartRe.lastIndex;
  11261. if (knownHard[base] || cache && cache[base] === base) {
  11262. return process.nextTick(LOOP);
  11263. }
  11264. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  11265. return gotResolvedLink(cache[base]);
  11266. }
  11267. return fs.lstat(base, gotStat);
  11268. }
  11269. function gotStat(err, stat) {
  11270. if (err)
  11271. return cb(err);
  11272. if (!stat.isSymbolicLink()) {
  11273. knownHard[base] = true;
  11274. if (cache)
  11275. cache[base] = base;
  11276. return process.nextTick(LOOP);
  11277. }
  11278. if (!isWindows) {
  11279. var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
  11280. if (seenLinks.hasOwnProperty(id)) {
  11281. return gotTarget(null, seenLinks[id], base);
  11282. }
  11283. }
  11284. fs.stat(base, function(err2) {
  11285. if (err2)
  11286. return cb(err2);
  11287. fs.readlink(base, function(err3, target) {
  11288. if (!isWindows)
  11289. seenLinks[id] = target;
  11290. gotTarget(err3, target);
  11291. });
  11292. });
  11293. }
  11294. function gotTarget(err, target, base2) {
  11295. if (err)
  11296. return cb(err);
  11297. var resolvedLink = pathModule.resolve(previous, target);
  11298. if (cache)
  11299. cache[base2] = resolvedLink;
  11300. gotResolvedLink(resolvedLink);
  11301. }
  11302. function gotResolvedLink(resolvedLink) {
  11303. p = pathModule.resolve(resolvedLink, p.slice(pos));
  11304. start();
  11305. }
  11306. };
  11307. }
  11308. });
  11309. var require_fs5 = __commonJS2({
  11310. "node_modules/fs.realpath/index.js"(exports2, module2) {
  11311. module2.exports = realpath;
  11312. realpath.realpath = realpath;
  11313. realpath.sync = realpathSync;
  11314. realpath.realpathSync = realpathSync;
  11315. realpath.monkeypatch = monkeypatch;
  11316. realpath.unmonkeypatch = unmonkeypatch;
  11317. var fs = require("fs");
  11318. var origRealpath = fs.realpath;
  11319. var origRealpathSync = fs.realpathSync;
  11320. var version = process.version;
  11321. var ok = /^v[0-5]\./.test(version);
  11322. var old = require_old();
  11323. function newError(er) {
  11324. return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
  11325. }
  11326. function realpath(p, cache, cb) {
  11327. if (ok) {
  11328. return origRealpath(p, cache, cb);
  11329. }
  11330. if (typeof cache === "function") {
  11331. cb = cache;
  11332. cache = null;
  11333. }
  11334. origRealpath(p, cache, function(er, result) {
  11335. if (newError(er)) {
  11336. old.realpath(p, cache, cb);
  11337. } else {
  11338. cb(er, result);
  11339. }
  11340. });
  11341. }
  11342. function realpathSync(p, cache) {
  11343. if (ok) {
  11344. return origRealpathSync(p, cache);
  11345. }
  11346. try {
  11347. return origRealpathSync(p, cache);
  11348. } catch (er) {
  11349. if (newError(er)) {
  11350. return old.realpathSync(p, cache);
  11351. } else {
  11352. throw er;
  11353. }
  11354. }
  11355. }
  11356. function monkeypatch() {
  11357. fs.realpath = realpath;
  11358. fs.realpathSync = realpathSync;
  11359. }
  11360. function unmonkeypatch() {
  11361. fs.realpath = origRealpath;
  11362. fs.realpathSync = origRealpathSync;
  11363. }
  11364. }
  11365. });
  11366. var require_concat_map = __commonJS2({
  11367. "node_modules/concat-map/index.js"(exports2, module2) {
  11368. module2.exports = function(xs, fn) {
  11369. var res = [];
  11370. for (var i = 0; i < xs.length; i++) {
  11371. var x = fn(xs[i], i);
  11372. if (isArray(x))
  11373. res.push.apply(res, x);
  11374. else
  11375. res.push(x);
  11376. }
  11377. return res;
  11378. };
  11379. var isArray = Array.isArray || function(xs) {
  11380. return Object.prototype.toString.call(xs) === "[object Array]";
  11381. };
  11382. }
  11383. });
  11384. var require_balanced_match = __commonJS2({
  11385. "node_modules/balanced-match/index.js"(exports2, module2) {
  11386. "use strict";
  11387. module2.exports = balanced;
  11388. function balanced(a, b, str) {
  11389. if (a instanceof RegExp)
  11390. a = maybeMatch(a, str);
  11391. if (b instanceof RegExp)
  11392. b = maybeMatch(b, str);
  11393. var r = range(a, b, str);
  11394. return r && {
  11395. start: r[0],
  11396. end: r[1],
  11397. pre: str.slice(0, r[0]),
  11398. body: str.slice(r[0] + a.length, r[1]),
  11399. post: str.slice(r[1] + b.length)
  11400. };
  11401. }
  11402. function maybeMatch(reg, str) {
  11403. var m = str.match(reg);
  11404. return m ? m[0] : null;
  11405. }
  11406. balanced.range = range;
  11407. function range(a, b, str) {
  11408. var begs, beg, left, right, result;
  11409. var ai = str.indexOf(a);
  11410. var bi = str.indexOf(b, ai + 1);
  11411. var i = ai;
  11412. if (ai >= 0 && bi > 0) {
  11413. if (a === b) {
  11414. return [ai, bi];
  11415. }
  11416. begs = [];
  11417. left = str.length;
  11418. while (i >= 0 && !result) {
  11419. if (i == ai) {
  11420. begs.push(i);
  11421. ai = str.indexOf(a, i + 1);
  11422. } else if (begs.length == 1) {
  11423. result = [begs.pop(), bi];
  11424. } else {
  11425. beg = begs.pop();
  11426. if (beg < left) {
  11427. left = beg;
  11428. right = bi;
  11429. }
  11430. bi = str.indexOf(b, i + 1);
  11431. }
  11432. i = ai < bi && ai >= 0 ? ai : bi;
  11433. }
  11434. if (begs.length) {
  11435. result = [left, right];
  11436. }
  11437. }
  11438. return result;
  11439. }
  11440. }
  11441. });
  11442. var require_brace_expansion = __commonJS2({
  11443. "node_modules/brace-expansion/index.js"(exports2, module2) {
  11444. var concatMap = require_concat_map();
  11445. var balanced = require_balanced_match();
  11446. module2.exports = expandTop;
  11447. var escSlash = "\0SLASH" + Math.random() + "\0";
  11448. var escOpen = "\0OPEN" + Math.random() + "\0";
  11449. var escClose = "\0CLOSE" + Math.random() + "\0";
  11450. var escComma = "\0COMMA" + Math.random() + "\0";
  11451. var escPeriod = "\0PERIOD" + Math.random() + "\0";
  11452. function numeric(str) {
  11453. return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
  11454. }
  11455. function escapeBraces(str) {
  11456. return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
  11457. }
  11458. function unescapeBraces(str) {
  11459. return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
  11460. }
  11461. function parseCommaParts(str) {
  11462. if (!str)
  11463. return [""];
  11464. var parts = [];
  11465. var m = balanced("{", "}", str);
  11466. if (!m)
  11467. return str.split(",");
  11468. var pre = m.pre;
  11469. var body = m.body;
  11470. var post = m.post;
  11471. var p = pre.split(",");
  11472. p[p.length - 1] += "{" + body + "}";
  11473. var postParts = parseCommaParts(post);
  11474. if (post.length) {
  11475. p[p.length - 1] += postParts.shift();
  11476. p.push.apply(p, postParts);
  11477. }
  11478. parts.push.apply(parts, p);
  11479. return parts;
  11480. }
  11481. function expandTop(str) {
  11482. if (!str)
  11483. return [];
  11484. if (str.substr(0, 2) === "{}") {
  11485. str = "\\{\\}" + str.substr(2);
  11486. }
  11487. return expand(escapeBraces(str), true).map(unescapeBraces);
  11488. }
  11489. function embrace(str) {
  11490. return "{" + str + "}";
  11491. }
  11492. function isPadded(el) {
  11493. return /^-?0\d/.test(el);
  11494. }
  11495. function lte(i, y) {
  11496. return i <= y;
  11497. }
  11498. function gte(i, y) {
  11499. return i >= y;
  11500. }
  11501. function expand(str, isTop) {
  11502. var expansions = [];
  11503. var m = balanced("{", "}", str);
  11504. if (!m || /\$$/.test(m.pre))
  11505. return [str];
  11506. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  11507. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  11508. var isSequence = isNumericSequence || isAlphaSequence;
  11509. var isOptions = m.body.indexOf(",") >= 0;
  11510. if (!isSequence && !isOptions) {
  11511. if (m.post.match(/,.*\}/)) {
  11512. str = m.pre + "{" + m.body + escClose + m.post;
  11513. return expand(str);
  11514. }
  11515. return [str];
  11516. }
  11517. var n;
  11518. if (isSequence) {
  11519. n = m.body.split(/\.\./);
  11520. } else {
  11521. n = parseCommaParts(m.body);
  11522. if (n.length === 1) {
  11523. n = expand(n[0], false).map(embrace);
  11524. if (n.length === 1) {
  11525. var post = m.post.length ? expand(m.post, false) : [""];
  11526. return post.map(function(p) {
  11527. return m.pre + n[0] + p;
  11528. });
  11529. }
  11530. }
  11531. }
  11532. var pre = m.pre;
  11533. var post = m.post.length ? expand(m.post, false) : [""];
  11534. var N;
  11535. if (isSequence) {
  11536. var x = numeric(n[0]);
  11537. var y = numeric(n[1]);
  11538. var width = Math.max(n[0].length, n[1].length);
  11539. var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
  11540. var test = lte;
  11541. var reverse = y < x;
  11542. if (reverse) {
  11543. incr *= -1;
  11544. test = gte;
  11545. }
  11546. var pad = n.some(isPadded);
  11547. N = [];
  11548. for (var i = x; test(i, y); i += incr) {
  11549. var c;
  11550. if (isAlphaSequence) {
  11551. c = String.fromCharCode(i);
  11552. if (c === "\\")
  11553. c = "";
  11554. } else {
  11555. c = String(i);
  11556. if (pad) {
  11557. var need = width - c.length;
  11558. if (need > 0) {
  11559. var z = new Array(need + 1).join("0");
  11560. if (i < 0)
  11561. c = "-" + z + c.slice(1);
  11562. else
  11563. c = z + c;
  11564. }
  11565. }
  11566. }
  11567. N.push(c);
  11568. }
  11569. } else {
  11570. N = concatMap(n, function(el) {
  11571. return expand(el, false);
  11572. });
  11573. }
  11574. for (var j = 0; j < N.length; j++) {
  11575. for (var k = 0; k < post.length; k++) {
  11576. var expansion = pre + N[j] + post[k];
  11577. if (!isTop || isSequence || expansion)
  11578. expansions.push(expansion);
  11579. }
  11580. }
  11581. return expansions;
  11582. }
  11583. }
  11584. });
  11585. var require_minimatch = __commonJS2({
  11586. "node_modules/minimatch/minimatch.js"(exports2, module2) {
  11587. module2.exports = minimatch;
  11588. minimatch.Minimatch = Minimatch;
  11589. var path = function() {
  11590. try {
  11591. return require("path");
  11592. } catch (e) {
  11593. }
  11594. }() || {
  11595. sep: "/"
  11596. };
  11597. minimatch.sep = path.sep;
  11598. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
  11599. var expand = require_brace_expansion();
  11600. var plTypes = {
  11601. "!": {
  11602. open: "(?:(?!(?:",
  11603. close: "))[^/]*?)"
  11604. },
  11605. "?": {
  11606. open: "(?:",
  11607. close: ")?"
  11608. },
  11609. "+": {
  11610. open: "(?:",
  11611. close: ")+"
  11612. },
  11613. "*": {
  11614. open: "(?:",
  11615. close: ")*"
  11616. },
  11617. "@": {
  11618. open: "(?:",
  11619. close: ")"
  11620. }
  11621. };
  11622. var qmark = "[^/]";
  11623. var star = qmark + "*?";
  11624. var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
  11625. var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
  11626. var reSpecials = charSet("().*{}+?[]^$\\!");
  11627. function charSet(s) {
  11628. return s.split("").reduce(function(set, c) {
  11629. set[c] = true;
  11630. return set;
  11631. }, {});
  11632. }
  11633. var slashSplit = /\/+/;
  11634. minimatch.filter = filter;
  11635. function filter(pattern, options) {
  11636. options = options || {};
  11637. return function(p, i, list) {
  11638. return minimatch(p, pattern, options);
  11639. };
  11640. }
  11641. function ext(a, b) {
  11642. b = b || {};
  11643. var t = {};
  11644. Object.keys(a).forEach(function(k) {
  11645. t[k] = a[k];
  11646. });
  11647. Object.keys(b).forEach(function(k) {
  11648. t[k] = b[k];
  11649. });
  11650. return t;
  11651. }
  11652. minimatch.defaults = function(def) {
  11653. if (!def || typeof def !== "object" || !Object.keys(def).length) {
  11654. return minimatch;
  11655. }
  11656. var orig = minimatch;
  11657. var m = function minimatch2(p, pattern, options) {
  11658. return orig(p, pattern, ext(def, options));
  11659. };
  11660. m.Minimatch = function Minimatch2(pattern, options) {
  11661. return new orig.Minimatch(pattern, ext(def, options));
  11662. };
  11663. m.Minimatch.defaults = function defaults(options) {
  11664. return orig.defaults(ext(def, options)).Minimatch;
  11665. };
  11666. m.filter = function filter2(pattern, options) {
  11667. return orig.filter(pattern, ext(def, options));
  11668. };
  11669. m.defaults = function defaults(options) {
  11670. return orig.defaults(ext(def, options));
  11671. };
  11672. m.makeRe = function makeRe2(pattern, options) {
  11673. return orig.makeRe(pattern, ext(def, options));
  11674. };
  11675. m.braceExpand = function braceExpand2(pattern, options) {
  11676. return orig.braceExpand(pattern, ext(def, options));
  11677. };
  11678. m.match = function(list, pattern, options) {
  11679. return orig.match(list, pattern, ext(def, options));
  11680. };
  11681. return m;
  11682. };
  11683. Minimatch.defaults = function(def) {
  11684. return minimatch.defaults(def).Minimatch;
  11685. };
  11686. function minimatch(p, pattern, options) {
  11687. assertValidPattern(pattern);
  11688. if (!options)
  11689. options = {};
  11690. if (!options.nocomment && pattern.charAt(0) === "#") {
  11691. return false;
  11692. }
  11693. return new Minimatch(pattern, options).match(p);
  11694. }
  11695. function Minimatch(pattern, options) {
  11696. if (!(this instanceof Minimatch)) {
  11697. return new Minimatch(pattern, options);
  11698. }
  11699. assertValidPattern(pattern);
  11700. if (!options)
  11701. options = {};
  11702. pattern = pattern.trim();
  11703. if (!options.allowWindowsEscape && path.sep !== "/") {
  11704. pattern = pattern.split(path.sep).join("/");
  11705. }
  11706. this.options = options;
  11707. this.set = [];
  11708. this.pattern = pattern;
  11709. this.regexp = null;
  11710. this.negate = false;
  11711. this.comment = false;
  11712. this.empty = false;
  11713. this.partial = !!options.partial;
  11714. this.make();
  11715. }
  11716. Minimatch.prototype.debug = function() {
  11717. };
  11718. Minimatch.prototype.make = make;
  11719. function make() {
  11720. var pattern = this.pattern;
  11721. var options = this.options;
  11722. if (!options.nocomment && pattern.charAt(0) === "#") {
  11723. this.comment = true;
  11724. return;
  11725. }
  11726. if (!pattern) {
  11727. this.empty = true;
  11728. return;
  11729. }
  11730. this.parseNegate();
  11731. var set = this.globSet = this.braceExpand();
  11732. if (options.debug)
  11733. this.debug = function debug() {
  11734. console.error.apply(console, arguments);
  11735. };
  11736. this.debug(this.pattern, set);
  11737. set = this.globParts = set.map(function(s) {
  11738. return s.split(slashSplit);
  11739. });
  11740. this.debug(this.pattern, set);
  11741. set = set.map(function(s, si, set2) {
  11742. return s.map(this.parse, this);
  11743. }, this);
  11744. this.debug(this.pattern, set);
  11745. set = set.filter(function(s) {
  11746. return s.indexOf(false) === -1;
  11747. });
  11748. this.debug(this.pattern, set);
  11749. this.set = set;
  11750. }
  11751. Minimatch.prototype.parseNegate = parseNegate;
  11752. function parseNegate() {
  11753. var pattern = this.pattern;
  11754. var negate = false;
  11755. var options = this.options;
  11756. var negateOffset = 0;
  11757. if (options.nonegate)
  11758. return;
  11759. for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
  11760. negate = !negate;
  11761. negateOffset++;
  11762. }
  11763. if (negateOffset)
  11764. this.pattern = pattern.substr(negateOffset);
  11765. this.negate = negate;
  11766. }
  11767. minimatch.braceExpand = function(pattern, options) {
  11768. return braceExpand(pattern, options);
  11769. };
  11770. Minimatch.prototype.braceExpand = braceExpand;
  11771. function braceExpand(pattern, options) {
  11772. if (!options) {
  11773. if (this instanceof Minimatch) {
  11774. options = this.options;
  11775. } else {
  11776. options = {};
  11777. }
  11778. }
  11779. pattern = typeof pattern === "undefined" ? this.pattern : pattern;
  11780. assertValidPattern(pattern);
  11781. if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
  11782. return [pattern];
  11783. }
  11784. return expand(pattern);
  11785. }
  11786. var MAX_PATTERN_LENGTH = 1024 * 64;
  11787. var assertValidPattern = function(pattern) {
  11788. if (typeof pattern !== "string") {
  11789. throw new TypeError("invalid pattern");
  11790. }
  11791. if (pattern.length > MAX_PATTERN_LENGTH) {
  11792. throw new TypeError("pattern is too long");
  11793. }
  11794. };
  11795. Minimatch.prototype.parse = parse;
  11796. var SUBPARSE = {};
  11797. function parse(pattern, isSub) {
  11798. assertValidPattern(pattern);
  11799. var options = this.options;
  11800. if (pattern === "**") {
  11801. if (!options.noglobstar)
  11802. return GLOBSTAR;
  11803. else
  11804. pattern = "*";
  11805. }
  11806. if (pattern === "")
  11807. return "";
  11808. var re = "";
  11809. var hasMagic = !!options.nocase;
  11810. var escaping = false;
  11811. var patternListStack = [];
  11812. var negativeLists = [];
  11813. var stateChar;
  11814. var inClass = false;
  11815. var reClassStart = -1;
  11816. var classStart = -1;
  11817. var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
  11818. var self2 = this;
  11819. function clearStateChar() {
  11820. if (stateChar) {
  11821. switch (stateChar) {
  11822. case "*":
  11823. re += star;
  11824. hasMagic = true;
  11825. break;
  11826. case "?":
  11827. re += qmark;
  11828. hasMagic = true;
  11829. break;
  11830. default:
  11831. re += "\\" + stateChar;
  11832. break;
  11833. }
  11834. self2.debug("clearStateChar %j %j", stateChar, re);
  11835. stateChar = false;
  11836. }
  11837. }
  11838. for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
  11839. this.debug("%s %s %s %j", pattern, i, re, c);
  11840. if (escaping && reSpecials[c]) {
  11841. re += "\\" + c;
  11842. escaping = false;
  11843. continue;
  11844. }
  11845. switch (c) {
  11846. case "/": {
  11847. return false;
  11848. }
  11849. case "\\":
  11850. clearStateChar();
  11851. escaping = true;
  11852. continue;
  11853. case "?":
  11854. case "*":
  11855. case "+":
  11856. case "@":
  11857. case "!":
  11858. this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
  11859. if (inClass) {
  11860. this.debug(" in class");
  11861. if (c === "!" && i === classStart + 1)
  11862. c = "^";
  11863. re += c;
  11864. continue;
  11865. }
  11866. self2.debug("call clearStateChar %j", stateChar);
  11867. clearStateChar();
  11868. stateChar = c;
  11869. if (options.noext)
  11870. clearStateChar();
  11871. continue;
  11872. case "(":
  11873. if (inClass) {
  11874. re += "(";
  11875. continue;
  11876. }
  11877. if (!stateChar) {
  11878. re += "\\(";
  11879. continue;
  11880. }
  11881. patternListStack.push({
  11882. type: stateChar,
  11883. start: i - 1,
  11884. reStart: re.length,
  11885. open: plTypes[stateChar].open,
  11886. close: plTypes[stateChar].close
  11887. });
  11888. re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
  11889. this.debug("plType %j %j", stateChar, re);
  11890. stateChar = false;
  11891. continue;
  11892. case ")":
  11893. if (inClass || !patternListStack.length) {
  11894. re += "\\)";
  11895. continue;
  11896. }
  11897. clearStateChar();
  11898. hasMagic = true;
  11899. var pl = patternListStack.pop();
  11900. re += pl.close;
  11901. if (pl.type === "!") {
  11902. negativeLists.push(pl);
  11903. }
  11904. pl.reEnd = re.length;
  11905. continue;
  11906. case "|":
  11907. if (inClass || !patternListStack.length || escaping) {
  11908. re += "\\|";
  11909. escaping = false;
  11910. continue;
  11911. }
  11912. clearStateChar();
  11913. re += "|";
  11914. continue;
  11915. case "[":
  11916. clearStateChar();
  11917. if (inClass) {
  11918. re += "\\" + c;
  11919. continue;
  11920. }
  11921. inClass = true;
  11922. classStart = i;
  11923. reClassStart = re.length;
  11924. re += c;
  11925. continue;
  11926. case "]":
  11927. if (i === classStart + 1 || !inClass) {
  11928. re += "\\" + c;
  11929. escaping = false;
  11930. continue;
  11931. }
  11932. var cs = pattern.substring(classStart + 1, i);
  11933. try {
  11934. RegExp("[" + cs + "]");
  11935. } catch (er) {
  11936. var sp = this.parse(cs, SUBPARSE);
  11937. re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
  11938. hasMagic = hasMagic || sp[1];
  11939. inClass = false;
  11940. continue;
  11941. }
  11942. hasMagic = true;
  11943. inClass = false;
  11944. re += c;
  11945. continue;
  11946. default:
  11947. clearStateChar();
  11948. if (escaping) {
  11949. escaping = false;
  11950. } else if (reSpecials[c] && !(c === "^" && inClass)) {
  11951. re += "\\";
  11952. }
  11953. re += c;
  11954. }
  11955. }
  11956. if (inClass) {
  11957. cs = pattern.substr(classStart + 1);
  11958. sp = this.parse(cs, SUBPARSE);
  11959. re = re.substr(0, reClassStart) + "\\[" + sp[0];
  11960. hasMagic = hasMagic || sp[1];
  11961. }
  11962. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  11963. var tail = re.slice(pl.reStart + pl.open.length);
  11964. this.debug("setting tail", re, pl);
  11965. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
  11966. if (!$2) {
  11967. $2 = "\\";
  11968. }
  11969. return $1 + $1 + $2 + "|";
  11970. });
  11971. this.debug("tail=%j\n %s", tail, tail, pl, re);
  11972. var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
  11973. hasMagic = true;
  11974. re = re.slice(0, pl.reStart) + t + "\\(" + tail;
  11975. }
  11976. clearStateChar();
  11977. if (escaping) {
  11978. re += "\\\\";
  11979. }
  11980. var addPatternStart = false;
  11981. switch (re.charAt(0)) {
  11982. case "[":
  11983. case ".":
  11984. case "(":
  11985. addPatternStart = true;
  11986. }
  11987. for (var n = negativeLists.length - 1; n > -1; n--) {
  11988. var nl = negativeLists[n];
  11989. var nlBefore = re.slice(0, nl.reStart);
  11990. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  11991. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  11992. var nlAfter = re.slice(nl.reEnd);
  11993. nlLast += nlAfter;
  11994. var openParensBefore = nlBefore.split("(").length - 1;
  11995. var cleanAfter = nlAfter;
  11996. for (i = 0; i < openParensBefore; i++) {
  11997. cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
  11998. }
  11999. nlAfter = cleanAfter;
  12000. var dollar = "";
  12001. if (nlAfter === "" && isSub !== SUBPARSE) {
  12002. dollar = "$";
  12003. }
  12004. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  12005. re = newRe;
  12006. }
  12007. if (re !== "" && hasMagic) {
  12008. re = "(?=.)" + re;
  12009. }
  12010. if (addPatternStart) {
  12011. re = patternStart + re;
  12012. }
  12013. if (isSub === SUBPARSE) {
  12014. return [re, hasMagic];
  12015. }
  12016. if (!hasMagic) {
  12017. return globUnescape(pattern);
  12018. }
  12019. var flags = options.nocase ? "i" : "";
  12020. try {
  12021. var regExp = new RegExp("^" + re + "$", flags);
  12022. } catch (er) {
  12023. return new RegExp("$.");
  12024. }
  12025. regExp._glob = pattern;
  12026. regExp._src = re;
  12027. return regExp;
  12028. }
  12029. minimatch.makeRe = function(pattern, options) {
  12030. return new Minimatch(pattern, options || {}).makeRe();
  12031. };
  12032. Minimatch.prototype.makeRe = makeRe;
  12033. function makeRe() {
  12034. if (this.regexp || this.regexp === false)
  12035. return this.regexp;
  12036. var set = this.set;
  12037. if (!set.length) {
  12038. this.regexp = false;
  12039. return this.regexp;
  12040. }
  12041. var options = this.options;
  12042. var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
  12043. var flags = options.nocase ? "i" : "";
  12044. var re = set.map(function(pattern) {
  12045. return pattern.map(function(p) {
  12046. return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
  12047. }).join("\\/");
  12048. }).join("|");
  12049. re = "^(?:" + re + ")$";
  12050. if (this.negate)
  12051. re = "^(?!" + re + ").*$";
  12052. try {
  12053. this.regexp = new RegExp(re, flags);
  12054. } catch (ex) {
  12055. this.regexp = false;
  12056. }
  12057. return this.regexp;
  12058. }
  12059. minimatch.match = function(list, pattern, options) {
  12060. options = options || {};
  12061. var mm = new Minimatch(pattern, options);
  12062. list = list.filter(function(f) {
  12063. return mm.match(f);
  12064. });
  12065. if (mm.options.nonull && !list.length) {
  12066. list.push(pattern);
  12067. }
  12068. return list;
  12069. };
  12070. Minimatch.prototype.match = function match(f, partial) {
  12071. if (typeof partial === "undefined")
  12072. partial = this.partial;
  12073. this.debug("match", f, this.pattern);
  12074. if (this.comment)
  12075. return false;
  12076. if (this.empty)
  12077. return f === "";
  12078. if (f === "/" && partial)
  12079. return true;
  12080. var options = this.options;
  12081. if (path.sep !== "/") {
  12082. f = f.split(path.sep).join("/");
  12083. }
  12084. f = f.split(slashSplit);
  12085. this.debug(this.pattern, "split", f);
  12086. var set = this.set;
  12087. this.debug(this.pattern, "set", set);
  12088. var filename;
  12089. var i;
  12090. for (i = f.length - 1; i >= 0; i--) {
  12091. filename = f[i];
  12092. if (filename)
  12093. break;
  12094. }
  12095. for (i = 0; i < set.length; i++) {
  12096. var pattern = set[i];
  12097. var file = f;
  12098. if (options.matchBase && pattern.length === 1) {
  12099. file = [filename];
  12100. }
  12101. var hit = this.matchOne(file, pattern, partial);
  12102. if (hit) {
  12103. if (options.flipNegate)
  12104. return true;
  12105. return !this.negate;
  12106. }
  12107. }
  12108. if (options.flipNegate)
  12109. return false;
  12110. return this.negate;
  12111. };
  12112. Minimatch.prototype.matchOne = function(file, pattern, partial) {
  12113. var options = this.options;
  12114. this.debug("matchOne", {
  12115. "this": this,
  12116. file,
  12117. pattern
  12118. });
  12119. this.debug("matchOne", file.length, pattern.length);
  12120. for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
  12121. this.debug("matchOne loop");
  12122. var p = pattern[pi];
  12123. var f = file[fi];
  12124. this.debug(pattern, p, f);
  12125. if (p === false)
  12126. return false;
  12127. if (p === GLOBSTAR) {
  12128. this.debug("GLOBSTAR", [pattern, p, f]);
  12129. var fr = fi;
  12130. var pr = pi + 1;
  12131. if (pr === pl) {
  12132. this.debug("** at the end");
  12133. for (; fi < fl; fi++) {
  12134. if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
  12135. return false;
  12136. }
  12137. return true;
  12138. }
  12139. while (fr < fl) {
  12140. var swallowee = file[fr];
  12141. this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
  12142. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  12143. this.debug("globstar found match!", fr, fl, swallowee);
  12144. return true;
  12145. } else {
  12146. if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
  12147. this.debug("dot detected!", file, fr, pattern, pr);
  12148. break;
  12149. }
  12150. this.debug("globstar swallow a segment, and continue");
  12151. fr++;
  12152. }
  12153. }
  12154. if (partial) {
  12155. this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
  12156. if (fr === fl)
  12157. return true;
  12158. }
  12159. return false;
  12160. }
  12161. var hit;
  12162. if (typeof p === "string") {
  12163. hit = f === p;
  12164. this.debug("string match", p, f, hit);
  12165. } else {
  12166. hit = f.match(p);
  12167. this.debug("pattern match", p, f, hit);
  12168. }
  12169. if (!hit)
  12170. return false;
  12171. }
  12172. if (fi === fl && pi === pl) {
  12173. return true;
  12174. } else if (fi === fl) {
  12175. return partial;
  12176. } else if (pi === pl) {
  12177. return fi === fl - 1 && file[fi] === "";
  12178. }
  12179. throw new Error("wtf?");
  12180. };
  12181. function globUnescape(s) {
  12182. return s.replace(/\\(.)/g, "$1");
  12183. }
  12184. function regExpEscape(s) {
  12185. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  12186. }
  12187. }
  12188. });
  12189. var require_inherits_browser = __commonJS2({
  12190. "node_modules/inherits/inherits_browser.js"(exports2, module2) {
  12191. if (typeof Object.create === "function") {
  12192. module2.exports = function inherits(ctor, superCtor) {
  12193. if (superCtor) {
  12194. ctor.super_ = superCtor;
  12195. ctor.prototype = Object.create(superCtor.prototype, {
  12196. constructor: {
  12197. value: ctor,
  12198. enumerable: false,
  12199. writable: true,
  12200. configurable: true
  12201. }
  12202. });
  12203. }
  12204. };
  12205. } else {
  12206. module2.exports = function inherits(ctor, superCtor) {
  12207. if (superCtor) {
  12208. ctor.super_ = superCtor;
  12209. var TempCtor = function() {
  12210. };
  12211. TempCtor.prototype = superCtor.prototype;
  12212. ctor.prototype = new TempCtor();
  12213. ctor.prototype.constructor = ctor;
  12214. }
  12215. };
  12216. }
  12217. }
  12218. });
  12219. var require_inherits = __commonJS2({
  12220. "node_modules/inherits/inherits.js"(exports2, module2) {
  12221. try {
  12222. util = require("util");
  12223. if (typeof util.inherits !== "function")
  12224. throw "";
  12225. module2.exports = util.inherits;
  12226. } catch (e) {
  12227. module2.exports = require_inherits_browser();
  12228. }
  12229. var util;
  12230. }
  12231. });
  12232. var require_path_is_absolute = __commonJS2({
  12233. "node_modules/path-is-absolute/index.js"(exports2, module2) {
  12234. "use strict";
  12235. function posix(path) {
  12236. return path.charAt(0) === "/";
  12237. }
  12238. function win32(path) {
  12239. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  12240. var result = splitDeviceRe.exec(path);
  12241. var device = result[1] || "";
  12242. var isUnc = Boolean(device && device.charAt(1) !== ":");
  12243. return Boolean(result[2] || isUnc);
  12244. }
  12245. module2.exports = process.platform === "win32" ? win32 : posix;
  12246. module2.exports.posix = posix;
  12247. module2.exports.win32 = win32;
  12248. }
  12249. });
  12250. var require_common3 = __commonJS2({
  12251. "node_modules/glob/common.js"(exports2) {
  12252. exports2.setopts = setopts;
  12253. exports2.ownProp = ownProp;
  12254. exports2.makeAbs = makeAbs;
  12255. exports2.finish = finish;
  12256. exports2.mark = mark;
  12257. exports2.isIgnored = isIgnored;
  12258. exports2.childrenIgnored = childrenIgnored;
  12259. function ownProp(obj, field) {
  12260. return Object.prototype.hasOwnProperty.call(obj, field);
  12261. }
  12262. var fs = require("fs");
  12263. var path = require("path");
  12264. var minimatch = require_minimatch();
  12265. var isAbsolute = require_path_is_absolute();
  12266. var Minimatch = minimatch.Minimatch;
  12267. function alphasort(a, b) {
  12268. return a.localeCompare(b, "en");
  12269. }
  12270. function setupIgnores(self2, options) {
  12271. self2.ignore = options.ignore || [];
  12272. if (!Array.isArray(self2.ignore))
  12273. self2.ignore = [self2.ignore];
  12274. if (self2.ignore.length) {
  12275. self2.ignore = self2.ignore.map(ignoreMap);
  12276. }
  12277. }
  12278. function ignoreMap(pattern) {
  12279. var gmatcher = null;
  12280. if (pattern.slice(-3) === "/**") {
  12281. var gpattern = pattern.replace(/(\/\*\*)+$/, "");
  12282. gmatcher = new Minimatch(gpattern, {
  12283. dot: true
  12284. });
  12285. }
  12286. return {
  12287. matcher: new Minimatch(pattern, {
  12288. dot: true
  12289. }),
  12290. gmatcher
  12291. };
  12292. }
  12293. function setopts(self2, pattern, options) {
  12294. if (!options)
  12295. options = {};
  12296. if (options.matchBase && pattern.indexOf("/") === -1) {
  12297. if (options.noglobstar) {
  12298. throw new Error("base matching requires globstar");
  12299. }
  12300. pattern = "**/" + pattern;
  12301. }
  12302. self2.silent = !!options.silent;
  12303. self2.pattern = pattern;
  12304. self2.strict = options.strict !== false;
  12305. self2.realpath = !!options.realpath;
  12306. self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
  12307. self2.follow = !!options.follow;
  12308. self2.dot = !!options.dot;
  12309. self2.mark = !!options.mark;
  12310. self2.nodir = !!options.nodir;
  12311. if (self2.nodir)
  12312. self2.mark = true;
  12313. self2.sync = !!options.sync;
  12314. self2.nounique = !!options.nounique;
  12315. self2.nonull = !!options.nonull;
  12316. self2.nosort = !!options.nosort;
  12317. self2.nocase = !!options.nocase;
  12318. self2.stat = !!options.stat;
  12319. self2.noprocess = !!options.noprocess;
  12320. self2.absolute = !!options.absolute;
  12321. self2.fs = options.fs || fs;
  12322. self2.maxLength = options.maxLength || Infinity;
  12323. self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
  12324. self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
  12325. self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
  12326. setupIgnores(self2, options);
  12327. self2.changedCwd = false;
  12328. var cwd = process.cwd();
  12329. if (!ownProp(options, "cwd"))
  12330. self2.cwd = cwd;
  12331. else {
  12332. self2.cwd = path.resolve(options.cwd);
  12333. self2.changedCwd = self2.cwd !== cwd;
  12334. }
  12335. self2.root = options.root || path.resolve(self2.cwd, "/");
  12336. self2.root = path.resolve(self2.root);
  12337. if (process.platform === "win32")
  12338. self2.root = self2.root.replace(/\\/g, "/");
  12339. self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
  12340. if (process.platform === "win32")
  12341. self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
  12342. self2.nomount = !!options.nomount;
  12343. options.nonegate = true;
  12344. options.nocomment = true;
  12345. self2.minimatch = new Minimatch(pattern, options);
  12346. self2.options = self2.minimatch.options;
  12347. }
  12348. function finish(self2) {
  12349. var nou = self2.nounique;
  12350. var all = nou ? [] : /* @__PURE__ */ Object.create(null);
  12351. for (var i = 0, l = self2.matches.length; i < l; i++) {
  12352. var matches = self2.matches[i];
  12353. if (!matches || Object.keys(matches).length === 0) {
  12354. if (self2.nonull) {
  12355. var literal = self2.minimatch.globSet[i];
  12356. if (nou)
  12357. all.push(literal);
  12358. else
  12359. all[literal] = true;
  12360. }
  12361. } else {
  12362. var m = Object.keys(matches);
  12363. if (nou)
  12364. all.push.apply(all, m);
  12365. else
  12366. m.forEach(function(m2) {
  12367. all[m2] = true;
  12368. });
  12369. }
  12370. }
  12371. if (!nou)
  12372. all = Object.keys(all);
  12373. if (!self2.nosort)
  12374. all = all.sort(alphasort);
  12375. if (self2.mark) {
  12376. for (var i = 0; i < all.length; i++) {
  12377. all[i] = self2._mark(all[i]);
  12378. }
  12379. if (self2.nodir) {
  12380. all = all.filter(function(e) {
  12381. var notDir = !/\/$/.test(e);
  12382. var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
  12383. if (notDir && c)
  12384. notDir = c !== "DIR" && !Array.isArray(c);
  12385. return notDir;
  12386. });
  12387. }
  12388. }
  12389. if (self2.ignore.length)
  12390. all = all.filter(function(m2) {
  12391. return !isIgnored(self2, m2);
  12392. });
  12393. self2.found = all;
  12394. }
  12395. function mark(self2, p) {
  12396. var abs = makeAbs(self2, p);
  12397. var c = self2.cache[abs];
  12398. var m = p;
  12399. if (c) {
  12400. var isDir = c === "DIR" || Array.isArray(c);
  12401. var slash = p.slice(-1) === "/";
  12402. if (isDir && !slash)
  12403. m += "/";
  12404. else if (!isDir && slash)
  12405. m = m.slice(0, -1);
  12406. if (m !== p) {
  12407. var mabs = makeAbs(self2, m);
  12408. self2.statCache[mabs] = self2.statCache[abs];
  12409. self2.cache[mabs] = self2.cache[abs];
  12410. }
  12411. }
  12412. return m;
  12413. }
  12414. function makeAbs(self2, f) {
  12415. var abs = f;
  12416. if (f.charAt(0) === "/") {
  12417. abs = path.join(self2.root, f);
  12418. } else if (isAbsolute(f) || f === "") {
  12419. abs = f;
  12420. } else if (self2.changedCwd) {
  12421. abs = path.resolve(self2.cwd, f);
  12422. } else {
  12423. abs = path.resolve(f);
  12424. }
  12425. if (process.platform === "win32")
  12426. abs = abs.replace(/\\/g, "/");
  12427. return abs;
  12428. }
  12429. function isIgnored(self2, path2) {
  12430. if (!self2.ignore.length)
  12431. return false;
  12432. return self2.ignore.some(function(item) {
  12433. return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
  12434. });
  12435. }
  12436. function childrenIgnored(self2, path2) {
  12437. if (!self2.ignore.length)
  12438. return false;
  12439. return self2.ignore.some(function(item) {
  12440. return !!(item.gmatcher && item.gmatcher.match(path2));
  12441. });
  12442. }
  12443. }
  12444. });
  12445. var require_sync7 = __commonJS2({
  12446. "node_modules/glob/sync.js"(exports2, module2) {
  12447. module2.exports = globSync;
  12448. globSync.GlobSync = GlobSync;
  12449. var rp = require_fs5();
  12450. var minimatch = require_minimatch();
  12451. var Minimatch = minimatch.Minimatch;
  12452. var Glob = require_glob().Glob;
  12453. var util = require("util");
  12454. var path = require("path");
  12455. var assert = require("assert");
  12456. var isAbsolute = require_path_is_absolute();
  12457. var common = require_common3();
  12458. var setopts = common.setopts;
  12459. var ownProp = common.ownProp;
  12460. var childrenIgnored = common.childrenIgnored;
  12461. var isIgnored = common.isIgnored;
  12462. function globSync(pattern, options) {
  12463. if (typeof options === "function" || arguments.length === 3)
  12464. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12465. return new GlobSync(pattern, options).found;
  12466. }
  12467. function GlobSync(pattern, options) {
  12468. if (!pattern)
  12469. throw new Error("must provide pattern");
  12470. if (typeof options === "function" || arguments.length === 3)
  12471. throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
  12472. if (!(this instanceof GlobSync))
  12473. return new GlobSync(pattern, options);
  12474. setopts(this, pattern, options);
  12475. if (this.noprocess)
  12476. return this;
  12477. var n = this.minimatch.set.length;
  12478. this.matches = new Array(n);
  12479. for (var i = 0; i < n; i++) {
  12480. this._process(this.minimatch.set[i], i, false);
  12481. }
  12482. this._finish();
  12483. }
  12484. GlobSync.prototype._finish = function() {
  12485. assert(this instanceof GlobSync);
  12486. if (this.realpath) {
  12487. var self2 = this;
  12488. this.matches.forEach(function(matchset, index) {
  12489. var set = self2.matches[index] = /* @__PURE__ */ Object.create(null);
  12490. for (var p in matchset) {
  12491. try {
  12492. p = self2._makeAbs(p);
  12493. var real = rp.realpathSync(p, self2.realpathCache);
  12494. set[real] = true;
  12495. } catch (er) {
  12496. if (er.syscall === "stat")
  12497. set[self2._makeAbs(p)] = true;
  12498. else
  12499. throw er;
  12500. }
  12501. }
  12502. });
  12503. }
  12504. common.finish(this);
  12505. };
  12506. GlobSync.prototype._process = function(pattern, index, inGlobStar) {
  12507. assert(this instanceof GlobSync);
  12508. var n = 0;
  12509. while (typeof pattern[n] === "string") {
  12510. n++;
  12511. }
  12512. var prefix;
  12513. switch (n) {
  12514. case pattern.length:
  12515. this._processSimple(pattern.join("/"), index);
  12516. return;
  12517. case 0:
  12518. prefix = null;
  12519. break;
  12520. default:
  12521. prefix = pattern.slice(0, n).join("/");
  12522. break;
  12523. }
  12524. var remain = pattern.slice(n);
  12525. var read;
  12526. if (prefix === null)
  12527. read = ".";
  12528. else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
  12529. if (!prefix || !isAbsolute(prefix))
  12530. prefix = "/" + prefix;
  12531. read = prefix;
  12532. } else
  12533. read = prefix;
  12534. var abs = this._makeAbs(read);
  12535. if (childrenIgnored(this, read))
  12536. return;
  12537. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  12538. if (isGlobStar)
  12539. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
  12540. else
  12541. this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
  12542. };
  12543. GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
  12544. var entries = this._readdir(abs, inGlobStar);
  12545. if (!entries)
  12546. return;
  12547. var pn = remain[0];
  12548. var negate = !!this.minimatch.negate;
  12549. var rawGlob = pn._glob;
  12550. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  12551. var matchedEntries = [];
  12552. for (var i = 0; i < entries.length; i++) {
  12553. var e = entries[i];
  12554. if (e.charAt(0) !== "." || dotOk) {
  12555. var m;
  12556. if (negate && !prefix) {
  12557. m = !e.match(pn);
  12558. } else {
  12559. m = e.match(pn);
  12560. }
  12561. if (m)
  12562. matchedEntries.push(e);
  12563. }
  12564. }
  12565. var len = matchedEntries.length;
  12566. if (len === 0)
  12567. return;
  12568. if (remain.length === 1 && !this.mark && !this.stat) {
  12569. if (!this.matches[index])
  12570. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12571. for (var i = 0; i < len; i++) {
  12572. var e = matchedEntries[i];
  12573. if (prefix) {
  12574. if (prefix.slice(-1) !== "/")
  12575. e = prefix + "/" + e;
  12576. else
  12577. e = prefix + e;
  12578. }
  12579. if (e.charAt(0) === "/" && !this.nomount) {
  12580. e = path.join(this.root, e);
  12581. }
  12582. this._emitMatch(index, e);
  12583. }
  12584. return;
  12585. }
  12586. remain.shift();
  12587. for (var i = 0; i < len; i++) {
  12588. var e = matchedEntries[i];
  12589. var newPattern;
  12590. if (prefix)
  12591. newPattern = [prefix, e];
  12592. else
  12593. newPattern = [e];
  12594. this._process(newPattern.concat(remain), index, inGlobStar);
  12595. }
  12596. };
  12597. GlobSync.prototype._emitMatch = function(index, e) {
  12598. if (isIgnored(this, e))
  12599. return;
  12600. var abs = this._makeAbs(e);
  12601. if (this.mark)
  12602. e = this._mark(e);
  12603. if (this.absolute) {
  12604. e = abs;
  12605. }
  12606. if (this.matches[index][e])
  12607. return;
  12608. if (this.nodir) {
  12609. var c = this.cache[abs];
  12610. if (c === "DIR" || Array.isArray(c))
  12611. return;
  12612. }
  12613. this.matches[index][e] = true;
  12614. if (this.stat)
  12615. this._stat(e);
  12616. };
  12617. GlobSync.prototype._readdirInGlobStar = function(abs) {
  12618. if (this.follow)
  12619. return this._readdir(abs, false);
  12620. var entries;
  12621. var lstat;
  12622. var stat;
  12623. try {
  12624. lstat = this.fs.lstatSync(abs);
  12625. } catch (er) {
  12626. if (er.code === "ENOENT") {
  12627. return null;
  12628. }
  12629. }
  12630. var isSym = lstat && lstat.isSymbolicLink();
  12631. this.symlinks[abs] = isSym;
  12632. if (!isSym && lstat && !lstat.isDirectory())
  12633. this.cache[abs] = "FILE";
  12634. else
  12635. entries = this._readdir(abs, false);
  12636. return entries;
  12637. };
  12638. GlobSync.prototype._readdir = function(abs, inGlobStar) {
  12639. var entries;
  12640. if (inGlobStar && !ownProp(this.symlinks, abs))
  12641. return this._readdirInGlobStar(abs);
  12642. if (ownProp(this.cache, abs)) {
  12643. var c = this.cache[abs];
  12644. if (!c || c === "FILE")
  12645. return null;
  12646. if (Array.isArray(c))
  12647. return c;
  12648. }
  12649. try {
  12650. return this._readdirEntries(abs, this.fs.readdirSync(abs));
  12651. } catch (er) {
  12652. this._readdirError(abs, er);
  12653. return null;
  12654. }
  12655. };
  12656. GlobSync.prototype._readdirEntries = function(abs, entries) {
  12657. if (!this.mark && !this.stat) {
  12658. for (var i = 0; i < entries.length; i++) {
  12659. var e = entries[i];
  12660. if (abs === "/")
  12661. e = abs + e;
  12662. else
  12663. e = abs + "/" + e;
  12664. this.cache[e] = true;
  12665. }
  12666. }
  12667. this.cache[abs] = entries;
  12668. return entries;
  12669. };
  12670. GlobSync.prototype._readdirError = function(f, er) {
  12671. switch (er.code) {
  12672. case "ENOTSUP":
  12673. case "ENOTDIR":
  12674. var abs = this._makeAbs(f);
  12675. this.cache[abs] = "FILE";
  12676. if (abs === this.cwdAbs) {
  12677. var error = new Error(er.code + " invalid cwd " + this.cwd);
  12678. error.path = this.cwd;
  12679. error.code = er.code;
  12680. throw error;
  12681. }
  12682. break;
  12683. case "ENOENT":
  12684. case "ELOOP":
  12685. case "ENAMETOOLONG":
  12686. case "UNKNOWN":
  12687. this.cache[this._makeAbs(f)] = false;
  12688. break;
  12689. default:
  12690. this.cache[this._makeAbs(f)] = false;
  12691. if (this.strict)
  12692. throw er;
  12693. if (!this.silent)
  12694. console.error("glob error", er);
  12695. break;
  12696. }
  12697. };
  12698. GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
  12699. var entries = this._readdir(abs, inGlobStar);
  12700. if (!entries)
  12701. return;
  12702. var remainWithoutGlobStar = remain.slice(1);
  12703. var gspref = prefix ? [prefix] : [];
  12704. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  12705. this._process(noGlobStar, index, false);
  12706. var len = entries.length;
  12707. var isSym = this.symlinks[abs];
  12708. if (isSym && inGlobStar)
  12709. return;
  12710. for (var i = 0; i < len; i++) {
  12711. var e = entries[i];
  12712. if (e.charAt(0) === "." && !this.dot)
  12713. continue;
  12714. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  12715. this._process(instead, index, true);
  12716. var below = gspref.concat(entries[i], remain);
  12717. this._process(below, index, true);
  12718. }
  12719. };
  12720. GlobSync.prototype._processSimple = function(prefix, index) {
  12721. var exists = this._stat(prefix);
  12722. if (!this.matches[index])
  12723. this.matches[index] = /* @__PURE__ */ Object.create(null);
  12724. if (!exists)
  12725. return;
  12726. if (prefix && isAbsolute(prefix) && !this.nomount) {
  12727. var trail = /[\/\\]$/.test(prefix);
  12728. if (prefix.charAt(0) === "/") {
  12729. prefix = path.join(this.root, prefix);
  12730. } else {
  12731. prefix = path.resolve(this.root, prefix);
  12732. if (trail)
  12733. prefix += "/";
  12734. }
  12735. }
  12736. if (process.platform === "win32")
  12737. prefix = prefix.replace(/\\/g, "/");
  12738. this._emitMatch(index, prefix);
  12739. };
  12740. GlobSync.prototype._stat = function(f) {
  12741. var abs = this._makeAbs(f);
  12742. var needDir = f.slice(-1) === "/";
  12743. if (f.length > this.maxLength)
  12744. return false;
  12745. if (!this.stat && ownProp(this.cache, abs)) {
  12746. var c = this.cache[abs];
  12747. if (Array.isArray(c))
  12748. c = "DIR";
  12749. if (!needDir || c === "DIR")
  12750. return c;
  12751. if (needDir && c === "FILE")
  12752. return false;
  12753. }
  12754. var exists;
  12755. var stat = this.statCache[abs];
  12756. if (!stat) {
  12757. var lstat;
  12758. try {
  12759. lstat = this.fs.lstatSync(abs);
  12760. } catch (er) {
  12761. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  12762. this.statCache[abs] = false;
  12763. return false;
  12764. }
  12765. }
  12766. if (lstat && lstat.isSymbolicLink()) {
  12767. try {
  12768. stat = this.fs.statSync(abs);
  12769. } catch (er) {
  12770. stat = lstat;
  12771. }
  12772. } else {
  12773. stat = lstat;
  12774. }
  12775. }
  12776. this.statCache[abs] = stat;
  12777. var c = true;
  12778. if (stat)
  12779. c = stat.isDirectory() ? "DIR" : "FILE";
  12780. this.cache[abs] = this.cache[abs] || c;
  12781. if (needDir && c === "FILE")
  12782. return false;
  12783. return c;
  12784. };
  12785. GlobSync.prototype._mark = function(p) {
  12786. return common.mark(this, p);
  12787. };
  12788. GlobSync.prototype._makeAbs = function(f) {
  12789. return common.makeAbs(this, f);
  12790. };
  12791. }
  12792. });
  12793. var require_wrappy = __commonJS2({
  12794. "node_modules/wrappy/wrappy.js"(exports2, module2) {
  12795. module2.exports = wrappy;
  12796. function wrappy(fn, cb) {
  12797. if (fn && cb)
  12798. return wrappy(fn)(cb);
  12799. if (typeof fn !== "function")
  12800. throw new TypeError("need wrapper function");
  12801. Object.keys(fn).forEach(function(k) {
  12802. wrapper[k] = fn[k];
  12803. });
  12804. return wrapper;
  12805. function wrapper() {
  12806. var args = new Array(arguments.length);
  12807. for (var i = 0; i < args.length; i++) {
  12808. args[i] = arguments[i];
  12809. }
  12810. var ret = fn.apply(this, args);
  12811. var cb2 = args[args.length - 1];
  12812. if (typeof ret === "function" && ret !== cb2) {
  12813. Object.keys(cb2).forEach(function(k) {
  12814. ret[k] = cb2[k];
  12815. });
  12816. }
  12817. return ret;
  12818. }
  12819. }
  12820. }
  12821. });
  12822. var require_once = __commonJS2({
  12823. "node_modules/once/once.js"(exports2, module2) {
  12824. var wrappy = require_wrappy();
  12825. module2.exports = wrappy(once);
  12826. module2.exports.strict = wrappy(onceStrict);
  12827. once.proto = once(function() {
  12828. Object.defineProperty(Function.prototype, "once", {
  12829. value: function() {
  12830. return once(this);
  12831. },
  12832. configurable: true
  12833. });
  12834. Object.defineProperty(Function.prototype, "onceStrict", {
  12835. value: function() {
  12836. return onceStrict(this);
  12837. },
  12838. configurable: true
  12839. });
  12840. });
  12841. function once(fn) {
  12842. var f = function() {
  12843. if (f.called)
  12844. return f.value;
  12845. f.called = true;
  12846. return f.value = fn.apply(this, arguments);
  12847. };
  12848. f.called = false;
  12849. return f;
  12850. }
  12851. function onceStrict(fn) {
  12852. var f = function() {
  12853. if (f.called)
  12854. throw new Error(f.onceError);
  12855. f.called = true;
  12856. return f.value = fn.apply(this, arguments);
  12857. };
  12858. var name = fn.name || "Function wrapped with `once`";
  12859. f.onceError = name + " shouldn't be called more than once";
  12860. f.called = false;
  12861. return f;
  12862. }
  12863. }
  12864. });
  12865. var require_inflight = __commonJS2({
  12866. "node_modules/inflight/inflight.js"(exports2, module2) {
  12867. var wrappy = require_wrappy();
  12868. var reqs = /* @__PURE__ */ Object.create(null);
  12869. var once = require_once();
  12870. module2.exports = wrappy(inflight);
  12871. function inflight(key, cb) {
  12872. if (reqs[key]) {
  12873. reqs[key].push(cb);
  12874. return null;
  12875. } else {
  12876. reqs[key] = [cb];
  12877. return makeres(key);
  12878. }
  12879. }
  12880. function makeres(key) {
  12881. return once(function RES() {
  12882. var cbs = reqs[key];
  12883. var len = cbs.length;
  12884. var args = slice(arguments);
  12885. try {
  12886. for (var i = 0; i < len; i++) {
  12887. cbs[i].apply(null, args);
  12888. }
  12889. } finally {
  12890. if (cbs.length > len) {
  12891. cbs.splice(0, len);
  12892. process.nextTick(function() {
  12893. RES.apply(null, args);
  12894. });
  12895. } else {
  12896. delete reqs[key];
  12897. }
  12898. }
  12899. });
  12900. }
  12901. function slice(args) {
  12902. var length = args.length;
  12903. var array2 = [];
  12904. for (var i = 0; i < length; i++)
  12905. array2[i] = args[i];
  12906. return array2;
  12907. }
  12908. }
  12909. });
  12910. var require_glob = __commonJS2({
  12911. "node_modules/glob/glob.js"(exports2, module2) {
  12912. module2.exports = glob;
  12913. var rp = require_fs5();
  12914. var minimatch = require_minimatch();
  12915. var Minimatch = minimatch.Minimatch;
  12916. var inherits = require_inherits();
  12917. var EE = require("events").EventEmitter;
  12918. var path = require("path");
  12919. var assert = require("assert");
  12920. var isAbsolute = require_path_is_absolute();
  12921. var globSync = require_sync7();
  12922. var common = require_common3();
  12923. var setopts = common.setopts;
  12924. var ownProp = common.ownProp;
  12925. var inflight = require_inflight();
  12926. var util = require("util");
  12927. var childrenIgnored = common.childrenIgnored;
  12928. var isIgnored = common.isIgnored;
  12929. var once = require_once();
  12930. function glob(pattern, options, cb) {
  12931. if (typeof options === "function")
  12932. cb = options, options = {};
  12933. if (!options)
  12934. options = {};
  12935. if (options.sync) {
  12936. if (cb)
  12937. throw new TypeError("callback provided to sync glob");
  12938. return globSync(pattern, options);
  12939. }
  12940. return new Glob(pattern, options, cb);
  12941. }
  12942. glob.sync = globSync;
  12943. var GlobSync = glob.GlobSync = globSync.GlobSync;
  12944. glob.glob = glob;
  12945. function extend(origin, add) {
  12946. if (add === null || typeof add !== "object") {
  12947. return origin;
  12948. }
  12949. var keys = Object.keys(add);
  12950. var i = keys.length;
  12951. while (i--) {
  12952. origin[keys[i]] = add[keys[i]];
  12953. }
  12954. return origin;
  12955. }
  12956. glob.hasMagic = function(pattern, options_) {
  12957. var options = extend({}, options_);
  12958. options.noprocess = true;
  12959. var g = new Glob(pattern, options);
  12960. var set = g.minimatch.set;
  12961. if (!pattern)
  12962. return false;
  12963. if (set.length > 1)
  12964. return true;
  12965. for (var j = 0; j < set[0].length; j++) {
  12966. if (typeof set[0][j] !== "string")
  12967. return true;
  12968. }
  12969. return false;
  12970. };
  12971. glob.Glob = Glob;
  12972. inherits(Glob, EE);
  12973. function Glob(pattern, options, cb) {
  12974. if (typeof options === "function") {
  12975. cb = options;
  12976. options = null;
  12977. }
  12978. if (options && options.sync) {
  12979. if (cb)
  12980. throw new TypeError("callback provided to sync glob");
  12981. return new GlobSync(pattern, options);
  12982. }
  12983. if (!(this instanceof Glob))
  12984. return new Glob(pattern, options, cb);
  12985. setopts(this, pattern, options);
  12986. this._didRealPath = false;
  12987. var n = this.minimatch.set.length;
  12988. this.matches = new Array(n);
  12989. if (typeof cb === "function") {
  12990. cb = once(cb);
  12991. this.on("error", cb);
  12992. this.on("end", function(matches) {
  12993. cb(null, matches);
  12994. });
  12995. }
  12996. var self2 = this;
  12997. this._processing = 0;
  12998. this._emitQueue = [];
  12999. this._processQueue = [];
  13000. this.paused = false;
  13001. if (this.noprocess)
  13002. return this;
  13003. if (n === 0)
  13004. return done();
  13005. var sync = true;
  13006. for (var i = 0; i < n; i++) {
  13007. this._process(this.minimatch.set[i], i, false, done);
  13008. }
  13009. sync = false;
  13010. function done() {
  13011. --self2._processing;
  13012. if (self2._processing <= 0) {
  13013. if (sync) {
  13014. process.nextTick(function() {
  13015. self2._finish();
  13016. });
  13017. } else {
  13018. self2._finish();
  13019. }
  13020. }
  13021. }
  13022. }
  13023. Glob.prototype._finish = function() {
  13024. assert(this instanceof Glob);
  13025. if (this.aborted)
  13026. return;
  13027. if (this.realpath && !this._didRealpath)
  13028. return this._realpath();
  13029. common.finish(this);
  13030. this.emit("end", this.found);
  13031. };
  13032. Glob.prototype._realpath = function() {
  13033. if (this._didRealpath)
  13034. return;
  13035. this._didRealpath = true;
  13036. var n = this.matches.length;
  13037. if (n === 0)
  13038. return this._finish();
  13039. var self2 = this;
  13040. for (var i = 0; i < this.matches.length; i++)
  13041. this._realpathSet(i, next);
  13042. function next() {
  13043. if (--n === 0)
  13044. self2._finish();
  13045. }
  13046. };
  13047. Glob.prototype._realpathSet = function(index, cb) {
  13048. var matchset = this.matches[index];
  13049. if (!matchset)
  13050. return cb();
  13051. var found = Object.keys(matchset);
  13052. var self2 = this;
  13053. var n = found.length;
  13054. if (n === 0)
  13055. return cb();
  13056. var set = this.matches[index] = /* @__PURE__ */ Object.create(null);
  13057. found.forEach(function(p, i) {
  13058. p = self2._makeAbs(p);
  13059. rp.realpath(p, self2.realpathCache, function(er, real) {
  13060. if (!er)
  13061. set[real] = true;
  13062. else if (er.syscall === "stat")
  13063. set[p] = true;
  13064. else
  13065. self2.emit("error", er);
  13066. if (--n === 0) {
  13067. self2.matches[index] = set;
  13068. cb();
  13069. }
  13070. });
  13071. });
  13072. };
  13073. Glob.prototype._mark = function(p) {
  13074. return common.mark(this, p);
  13075. };
  13076. Glob.prototype._makeAbs = function(f) {
  13077. return common.makeAbs(this, f);
  13078. };
  13079. Glob.prototype.abort = function() {
  13080. this.aborted = true;
  13081. this.emit("abort");
  13082. };
  13083. Glob.prototype.pause = function() {
  13084. if (!this.paused) {
  13085. this.paused = true;
  13086. this.emit("pause");
  13087. }
  13088. };
  13089. Glob.prototype.resume = function() {
  13090. if (this.paused) {
  13091. this.emit("resume");
  13092. this.paused = false;
  13093. if (this._emitQueue.length) {
  13094. var eq = this._emitQueue.slice(0);
  13095. this._emitQueue.length = 0;
  13096. for (var i = 0; i < eq.length; i++) {
  13097. var e = eq[i];
  13098. this._emitMatch(e[0], e[1]);
  13099. }
  13100. }
  13101. if (this._processQueue.length) {
  13102. var pq = this._processQueue.slice(0);
  13103. this._processQueue.length = 0;
  13104. for (var i = 0; i < pq.length; i++) {
  13105. var p = pq[i];
  13106. this._processing--;
  13107. this._process(p[0], p[1], p[2], p[3]);
  13108. }
  13109. }
  13110. }
  13111. };
  13112. Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
  13113. assert(this instanceof Glob);
  13114. assert(typeof cb === "function");
  13115. if (this.aborted)
  13116. return;
  13117. this._processing++;
  13118. if (this.paused) {
  13119. this._processQueue.push([pattern, index, inGlobStar, cb]);
  13120. return;
  13121. }
  13122. var n = 0;
  13123. while (typeof pattern[n] === "string") {
  13124. n++;
  13125. }
  13126. var prefix;
  13127. switch (n) {
  13128. case pattern.length:
  13129. this._processSimple(pattern.join("/"), index, cb);
  13130. return;
  13131. case 0:
  13132. prefix = null;
  13133. break;
  13134. default:
  13135. prefix = pattern.slice(0, n).join("/");
  13136. break;
  13137. }
  13138. var remain = pattern.slice(n);
  13139. var read;
  13140. if (prefix === null)
  13141. read = ".";
  13142. else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
  13143. if (!prefix || !isAbsolute(prefix))
  13144. prefix = "/" + prefix;
  13145. read = prefix;
  13146. } else
  13147. read = prefix;
  13148. var abs = this._makeAbs(read);
  13149. if (childrenIgnored(this, read))
  13150. return cb();
  13151. var isGlobStar = remain[0] === minimatch.GLOBSTAR;
  13152. if (isGlobStar)
  13153. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
  13154. else
  13155. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
  13156. };
  13157. Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13158. var self2 = this;
  13159. this._readdir(abs, inGlobStar, function(er, entries) {
  13160. return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13161. });
  13162. };
  13163. Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13164. if (!entries)
  13165. return cb();
  13166. var pn = remain[0];
  13167. var negate = !!this.minimatch.negate;
  13168. var rawGlob = pn._glob;
  13169. var dotOk = this.dot || rawGlob.charAt(0) === ".";
  13170. var matchedEntries = [];
  13171. for (var i = 0; i < entries.length; i++) {
  13172. var e = entries[i];
  13173. if (e.charAt(0) !== "." || dotOk) {
  13174. var m;
  13175. if (negate && !prefix) {
  13176. m = !e.match(pn);
  13177. } else {
  13178. m = e.match(pn);
  13179. }
  13180. if (m)
  13181. matchedEntries.push(e);
  13182. }
  13183. }
  13184. var len = matchedEntries.length;
  13185. if (len === 0)
  13186. return cb();
  13187. if (remain.length === 1 && !this.mark && !this.stat) {
  13188. if (!this.matches[index])
  13189. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13190. for (var i = 0; i < len; i++) {
  13191. var e = matchedEntries[i];
  13192. if (prefix) {
  13193. if (prefix !== "/")
  13194. e = prefix + "/" + e;
  13195. else
  13196. e = prefix + e;
  13197. }
  13198. if (e.charAt(0) === "/" && !this.nomount) {
  13199. e = path.join(this.root, e);
  13200. }
  13201. this._emitMatch(index, e);
  13202. }
  13203. return cb();
  13204. }
  13205. remain.shift();
  13206. for (var i = 0; i < len; i++) {
  13207. var e = matchedEntries[i];
  13208. var newPattern;
  13209. if (prefix) {
  13210. if (prefix !== "/")
  13211. e = prefix + "/" + e;
  13212. else
  13213. e = prefix + e;
  13214. }
  13215. this._process([e].concat(remain), index, inGlobStar, cb);
  13216. }
  13217. cb();
  13218. };
  13219. Glob.prototype._emitMatch = function(index, e) {
  13220. if (this.aborted)
  13221. return;
  13222. if (isIgnored(this, e))
  13223. return;
  13224. if (this.paused) {
  13225. this._emitQueue.push([index, e]);
  13226. return;
  13227. }
  13228. var abs = isAbsolute(e) ? e : this._makeAbs(e);
  13229. if (this.mark)
  13230. e = this._mark(e);
  13231. if (this.absolute)
  13232. e = abs;
  13233. if (this.matches[index][e])
  13234. return;
  13235. if (this.nodir) {
  13236. var c = this.cache[abs];
  13237. if (c === "DIR" || Array.isArray(c))
  13238. return;
  13239. }
  13240. this.matches[index][e] = true;
  13241. var st = this.statCache[abs];
  13242. if (st)
  13243. this.emit("stat", e, st);
  13244. this.emit("match", e);
  13245. };
  13246. Glob.prototype._readdirInGlobStar = function(abs, cb) {
  13247. if (this.aborted)
  13248. return;
  13249. if (this.follow)
  13250. return this._readdir(abs, false, cb);
  13251. var lstatkey = "lstat\0" + abs;
  13252. var self2 = this;
  13253. var lstatcb = inflight(lstatkey, lstatcb_);
  13254. if (lstatcb)
  13255. self2.fs.lstat(abs, lstatcb);
  13256. function lstatcb_(er, lstat) {
  13257. if (er && er.code === "ENOENT")
  13258. return cb();
  13259. var isSym = lstat && lstat.isSymbolicLink();
  13260. self2.symlinks[abs] = isSym;
  13261. if (!isSym && lstat && !lstat.isDirectory()) {
  13262. self2.cache[abs] = "FILE";
  13263. cb();
  13264. } else
  13265. self2._readdir(abs, false, cb);
  13266. }
  13267. };
  13268. Glob.prototype._readdir = function(abs, inGlobStar, cb) {
  13269. if (this.aborted)
  13270. return;
  13271. cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
  13272. if (!cb)
  13273. return;
  13274. if (inGlobStar && !ownProp(this.symlinks, abs))
  13275. return this._readdirInGlobStar(abs, cb);
  13276. if (ownProp(this.cache, abs)) {
  13277. var c = this.cache[abs];
  13278. if (!c || c === "FILE")
  13279. return cb();
  13280. if (Array.isArray(c))
  13281. return cb(null, c);
  13282. }
  13283. var self2 = this;
  13284. self2.fs.readdir(abs, readdirCb(this, abs, cb));
  13285. };
  13286. function readdirCb(self2, abs, cb) {
  13287. return function(er, entries) {
  13288. if (er)
  13289. self2._readdirError(abs, er, cb);
  13290. else
  13291. self2._readdirEntries(abs, entries, cb);
  13292. };
  13293. }
  13294. Glob.prototype._readdirEntries = function(abs, entries, cb) {
  13295. if (this.aborted)
  13296. return;
  13297. if (!this.mark && !this.stat) {
  13298. for (var i = 0; i < entries.length; i++) {
  13299. var e = entries[i];
  13300. if (abs === "/")
  13301. e = abs + e;
  13302. else
  13303. e = abs + "/" + e;
  13304. this.cache[e] = true;
  13305. }
  13306. }
  13307. this.cache[abs] = entries;
  13308. return cb(null, entries);
  13309. };
  13310. Glob.prototype._readdirError = function(f, er, cb) {
  13311. if (this.aborted)
  13312. return;
  13313. switch (er.code) {
  13314. case "ENOTSUP":
  13315. case "ENOTDIR":
  13316. var abs = this._makeAbs(f);
  13317. this.cache[abs] = "FILE";
  13318. if (abs === this.cwdAbs) {
  13319. var error = new Error(er.code + " invalid cwd " + this.cwd);
  13320. error.path = this.cwd;
  13321. error.code = er.code;
  13322. this.emit("error", error);
  13323. this.abort();
  13324. }
  13325. break;
  13326. case "ENOENT":
  13327. case "ELOOP":
  13328. case "ENAMETOOLONG":
  13329. case "UNKNOWN":
  13330. this.cache[this._makeAbs(f)] = false;
  13331. break;
  13332. default:
  13333. this.cache[this._makeAbs(f)] = false;
  13334. if (this.strict) {
  13335. this.emit("error", er);
  13336. this.abort();
  13337. }
  13338. if (!this.silent)
  13339. console.error("glob error", er);
  13340. break;
  13341. }
  13342. return cb();
  13343. };
  13344. Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
  13345. var self2 = this;
  13346. this._readdir(abs, inGlobStar, function(er, entries) {
  13347. self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  13348. });
  13349. };
  13350. Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  13351. if (!entries)
  13352. return cb();
  13353. var remainWithoutGlobStar = remain.slice(1);
  13354. var gspref = prefix ? [prefix] : [];
  13355. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  13356. this._process(noGlobStar, index, false, cb);
  13357. var isSym = this.symlinks[abs];
  13358. var len = entries.length;
  13359. if (isSym && inGlobStar)
  13360. return cb();
  13361. for (var i = 0; i < len; i++) {
  13362. var e = entries[i];
  13363. if (e.charAt(0) === "." && !this.dot)
  13364. continue;
  13365. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  13366. this._process(instead, index, true, cb);
  13367. var below = gspref.concat(entries[i], remain);
  13368. this._process(below, index, true, cb);
  13369. }
  13370. cb();
  13371. };
  13372. Glob.prototype._processSimple = function(prefix, index, cb) {
  13373. var self2 = this;
  13374. this._stat(prefix, function(er, exists) {
  13375. self2._processSimple2(prefix, index, er, exists, cb);
  13376. });
  13377. };
  13378. Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
  13379. if (!this.matches[index])
  13380. this.matches[index] = /* @__PURE__ */ Object.create(null);
  13381. if (!exists)
  13382. return cb();
  13383. if (prefix && isAbsolute(prefix) && !this.nomount) {
  13384. var trail = /[\/\\]$/.test(prefix);
  13385. if (prefix.charAt(0) === "/") {
  13386. prefix = path.join(this.root, prefix);
  13387. } else {
  13388. prefix = path.resolve(this.root, prefix);
  13389. if (trail)
  13390. prefix += "/";
  13391. }
  13392. }
  13393. if (process.platform === "win32")
  13394. prefix = prefix.replace(/\\/g, "/");
  13395. this._emitMatch(index, prefix);
  13396. cb();
  13397. };
  13398. Glob.prototype._stat = function(f, cb) {
  13399. var abs = this._makeAbs(f);
  13400. var needDir = f.slice(-1) === "/";
  13401. if (f.length > this.maxLength)
  13402. return cb();
  13403. if (!this.stat && ownProp(this.cache, abs)) {
  13404. var c = this.cache[abs];
  13405. if (Array.isArray(c))
  13406. c = "DIR";
  13407. if (!needDir || c === "DIR")
  13408. return cb(null, c);
  13409. if (needDir && c === "FILE")
  13410. return cb();
  13411. }
  13412. var exists;
  13413. var stat = this.statCache[abs];
  13414. if (stat !== void 0) {
  13415. if (stat === false)
  13416. return cb(null, stat);
  13417. else {
  13418. var type = stat.isDirectory() ? "DIR" : "FILE";
  13419. if (needDir && type === "FILE")
  13420. return cb();
  13421. else
  13422. return cb(null, type, stat);
  13423. }
  13424. }
  13425. var self2 = this;
  13426. var statcb = inflight("stat\0" + abs, lstatcb_);
  13427. if (statcb)
  13428. self2.fs.lstat(abs, statcb);
  13429. function lstatcb_(er, lstat) {
  13430. if (lstat && lstat.isSymbolicLink()) {
  13431. return self2.fs.stat(abs, function(er2, stat2) {
  13432. if (er2)
  13433. self2._stat2(f, abs, null, lstat, cb);
  13434. else
  13435. self2._stat2(f, abs, er2, stat2, cb);
  13436. });
  13437. } else {
  13438. self2._stat2(f, abs, er, lstat, cb);
  13439. }
  13440. }
  13441. };
  13442. Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
  13443. if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
  13444. this.statCache[abs] = false;
  13445. return cb();
  13446. }
  13447. var needDir = f.slice(-1) === "/";
  13448. this.statCache[abs] = stat;
  13449. if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
  13450. return cb(null, false, stat);
  13451. var c = true;
  13452. if (stat)
  13453. c = stat.isDirectory() ? "DIR" : "FILE";
  13454. this.cache[abs] = this.cache[abs] || c;
  13455. if (needDir && c === "FILE")
  13456. return cb();
  13457. return cb(null, c, stat);
  13458. };
  13459. }
  13460. });
  13461. var require_rimraf = __commonJS2({
  13462. "node_modules/rimraf/rimraf.js"(exports2, module2) {
  13463. var assert = require("assert");
  13464. var path = require("path");
  13465. var fs = require("fs");
  13466. var glob = void 0;
  13467. try {
  13468. glob = require_glob();
  13469. } catch (_err) {
  13470. }
  13471. var defaultGlobOpts = {
  13472. nosort: true,
  13473. silent: true
  13474. };
  13475. var timeout = 0;
  13476. var isWindows = process.platform === "win32";
  13477. var defaults = (options) => {
  13478. const methods = ["unlink", "chmod", "stat", "lstat", "rmdir", "readdir"];
  13479. methods.forEach((m) => {
  13480. options[m] = options[m] || fs[m];
  13481. m = m + "Sync";
  13482. options[m] = options[m] || fs[m];
  13483. });
  13484. options.maxBusyTries = options.maxBusyTries || 3;
  13485. options.emfileWait = options.emfileWait || 1e3;
  13486. if (options.glob === false) {
  13487. options.disableGlob = true;
  13488. }
  13489. if (options.disableGlob !== true && glob === void 0) {
  13490. throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
  13491. }
  13492. options.disableGlob = options.disableGlob || false;
  13493. options.glob = options.glob || defaultGlobOpts;
  13494. };
  13495. var rimraf = (p, options, cb) => {
  13496. if (typeof options === "function") {
  13497. cb = options;
  13498. options = {};
  13499. }
  13500. assert(p, "rimraf: missing path");
  13501. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13502. assert.equal(typeof cb, "function", "rimraf: callback function required");
  13503. assert(options, "rimraf: invalid options argument provided");
  13504. assert.equal(typeof options, "object", "rimraf: options should be object");
  13505. defaults(options);
  13506. let busyTries = 0;
  13507. let errState = null;
  13508. let n = 0;
  13509. const next = (er) => {
  13510. errState = errState || er;
  13511. if (--n === 0)
  13512. cb(errState);
  13513. };
  13514. const afterGlob = (er, results) => {
  13515. if (er)
  13516. return cb(er);
  13517. n = results.length;
  13518. if (n === 0)
  13519. return cb();
  13520. results.forEach((p2) => {
  13521. const CB = (er2) => {
  13522. if (er2) {
  13523. if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
  13524. busyTries++;
  13525. return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
  13526. }
  13527. if (er2.code === "EMFILE" && timeout < options.emfileWait) {
  13528. return setTimeout(() => rimraf_(p2, options, CB), timeout++);
  13529. }
  13530. if (er2.code === "ENOENT")
  13531. er2 = null;
  13532. }
  13533. timeout = 0;
  13534. next(er2);
  13535. };
  13536. rimraf_(p2, options, CB);
  13537. });
  13538. };
  13539. if (options.disableGlob || !glob.hasMagic(p))
  13540. return afterGlob(null, [p]);
  13541. options.lstat(p, (er, stat) => {
  13542. if (!er)
  13543. return afterGlob(null, [p]);
  13544. glob(p, options.glob, afterGlob);
  13545. });
  13546. };
  13547. var rimraf_ = (p, options, cb) => {
  13548. assert(p);
  13549. assert(options);
  13550. assert(typeof cb === "function");
  13551. options.lstat(p, (er, st) => {
  13552. if (er && er.code === "ENOENT")
  13553. return cb(null);
  13554. if (er && er.code === "EPERM" && isWindows)
  13555. fixWinEPERM(p, options, er, cb);
  13556. if (st && st.isDirectory())
  13557. return rmdir(p, options, er, cb);
  13558. options.unlink(p, (er2) => {
  13559. if (er2) {
  13560. if (er2.code === "ENOENT")
  13561. return cb(null);
  13562. if (er2.code === "EPERM")
  13563. return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
  13564. if (er2.code === "EISDIR")
  13565. return rmdir(p, options, er2, cb);
  13566. }
  13567. return cb(er2);
  13568. });
  13569. });
  13570. };
  13571. var fixWinEPERM = (p, options, er, cb) => {
  13572. assert(p);
  13573. assert(options);
  13574. assert(typeof cb === "function");
  13575. options.chmod(p, 438, (er2) => {
  13576. if (er2)
  13577. cb(er2.code === "ENOENT" ? null : er);
  13578. else
  13579. options.stat(p, (er3, stats) => {
  13580. if (er3)
  13581. cb(er3.code === "ENOENT" ? null : er);
  13582. else if (stats.isDirectory())
  13583. rmdir(p, options, er, cb);
  13584. else
  13585. options.unlink(p, cb);
  13586. });
  13587. });
  13588. };
  13589. var fixWinEPERMSync = (p, options, er) => {
  13590. assert(p);
  13591. assert(options);
  13592. try {
  13593. options.chmodSync(p, 438);
  13594. } catch (er2) {
  13595. if (er2.code === "ENOENT")
  13596. return;
  13597. else
  13598. throw er;
  13599. }
  13600. let stats;
  13601. try {
  13602. stats = options.statSync(p);
  13603. } catch (er3) {
  13604. if (er3.code === "ENOENT")
  13605. return;
  13606. else
  13607. throw er;
  13608. }
  13609. if (stats.isDirectory())
  13610. rmdirSync(p, options, er);
  13611. else
  13612. options.unlinkSync(p);
  13613. };
  13614. var rmdir = (p, options, originalEr, cb) => {
  13615. assert(p);
  13616. assert(options);
  13617. assert(typeof cb === "function");
  13618. options.rmdir(p, (er) => {
  13619. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  13620. rmkids(p, options, cb);
  13621. else if (er && er.code === "ENOTDIR")
  13622. cb(originalEr);
  13623. else
  13624. cb(er);
  13625. });
  13626. };
  13627. var rmkids = (p, options, cb) => {
  13628. assert(p);
  13629. assert(options);
  13630. assert(typeof cb === "function");
  13631. options.readdir(p, (er, files) => {
  13632. if (er)
  13633. return cb(er);
  13634. let n = files.length;
  13635. if (n === 0)
  13636. return options.rmdir(p, cb);
  13637. let errState;
  13638. files.forEach((f) => {
  13639. rimraf(path.join(p, f), options, (er2) => {
  13640. if (errState)
  13641. return;
  13642. if (er2)
  13643. return cb(errState = er2);
  13644. if (--n === 0)
  13645. options.rmdir(p, cb);
  13646. });
  13647. });
  13648. });
  13649. };
  13650. var rimrafSync = (p, options) => {
  13651. options = options || {};
  13652. defaults(options);
  13653. assert(p, "rimraf: missing path");
  13654. assert.equal(typeof p, "string", "rimraf: path should be a string");
  13655. assert(options, "rimraf: missing options");
  13656. assert.equal(typeof options, "object", "rimraf: options should be object");
  13657. let results;
  13658. if (options.disableGlob || !glob.hasMagic(p)) {
  13659. results = [p];
  13660. } else {
  13661. try {
  13662. options.lstatSync(p);
  13663. results = [p];
  13664. } catch (er) {
  13665. results = glob.sync(p, options.glob);
  13666. }
  13667. }
  13668. if (!results.length)
  13669. return;
  13670. for (let i = 0; i < results.length; i++) {
  13671. const p2 = results[i];
  13672. let st;
  13673. try {
  13674. st = options.lstatSync(p2);
  13675. } catch (er) {
  13676. if (er.code === "ENOENT")
  13677. return;
  13678. if (er.code === "EPERM" && isWindows)
  13679. fixWinEPERMSync(p2, options, er);
  13680. }
  13681. try {
  13682. if (st && st.isDirectory())
  13683. rmdirSync(p2, options, null);
  13684. else
  13685. options.unlinkSync(p2);
  13686. } catch (er) {
  13687. if (er.code === "ENOENT")
  13688. return;
  13689. if (er.code === "EPERM")
  13690. return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
  13691. if (er.code !== "EISDIR")
  13692. throw er;
  13693. rmdirSync(p2, options, er);
  13694. }
  13695. }
  13696. };
  13697. var rmdirSync = (p, options, originalEr) => {
  13698. assert(p);
  13699. assert(options);
  13700. try {
  13701. options.rmdirSync(p);
  13702. } catch (er) {
  13703. if (er.code === "ENOENT")
  13704. return;
  13705. if (er.code === "ENOTDIR")
  13706. throw originalEr;
  13707. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  13708. rmkidsSync(p, options);
  13709. }
  13710. };
  13711. var rmkidsSync = (p, options) => {
  13712. assert(p);
  13713. assert(options);
  13714. options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
  13715. const retries = isWindows ? 100 : 1;
  13716. let i = 0;
  13717. do {
  13718. let threw = true;
  13719. try {
  13720. const ret = options.rmdirSync(p, options);
  13721. threw = false;
  13722. return ret;
  13723. } finally {
  13724. if (++i < retries && threw)
  13725. continue;
  13726. }
  13727. } while (true);
  13728. };
  13729. module2.exports = rimraf;
  13730. rimraf.sync = rimrafSync;
  13731. }
  13732. });
  13733. var require_del = __commonJS2({
  13734. "node_modules/flat-cache/src/del.js"(exports2, module2) {
  13735. var rimraf = require_rimraf().sync;
  13736. var fs = require("fs");
  13737. module2.exports = function del(file) {
  13738. if (fs.existsSync(file)) {
  13739. rimraf(file, {
  13740. glob: false
  13741. });
  13742. return true;
  13743. }
  13744. return false;
  13745. };
  13746. }
  13747. });
  13748. var require_cache = __commonJS2({
  13749. "node_modules/flat-cache/src/cache.js"(exports2, module2) {
  13750. var path = require("path");
  13751. var fs = require("fs");
  13752. var utils = require_utils6();
  13753. var del = require_del();
  13754. var writeJSON = utils.writeJSON;
  13755. var cache = {
  13756. load: function(docId, cacheDir) {
  13757. var me = this;
  13758. me._visited = {};
  13759. me._persisted = {};
  13760. me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  13761. if (fs.existsSync(me._pathToFile)) {
  13762. me._persisted = utils.tryParse(me._pathToFile, {});
  13763. }
  13764. },
  13765. loadFile: function(pathToFile) {
  13766. var me = this;
  13767. var dir = path.dirname(pathToFile);
  13768. var fName = path.basename(pathToFile);
  13769. me.load(fName, dir);
  13770. },
  13771. all: function() {
  13772. return this._persisted;
  13773. },
  13774. keys: function() {
  13775. return Object.keys(this._persisted);
  13776. },
  13777. setKey: function(key, value) {
  13778. this._visited[key] = true;
  13779. this._persisted[key] = value;
  13780. },
  13781. removeKey: function(key) {
  13782. delete this._visited[key];
  13783. delete this._persisted[key];
  13784. },
  13785. getKey: function(key) {
  13786. this._visited[key] = true;
  13787. return this._persisted[key];
  13788. },
  13789. _prune: function() {
  13790. var me = this;
  13791. var obj = {};
  13792. var keys = Object.keys(me._visited);
  13793. if (keys.length === 0) {
  13794. return;
  13795. }
  13796. keys.forEach(function(key) {
  13797. obj[key] = me._persisted[key];
  13798. });
  13799. me._visited = {};
  13800. me._persisted = obj;
  13801. },
  13802. save: function(noPrune) {
  13803. var me = this;
  13804. !noPrune && me._prune();
  13805. writeJSON(me._pathToFile, me._persisted);
  13806. },
  13807. removeCacheFile: function() {
  13808. return del(this._pathToFile);
  13809. },
  13810. destroy: function() {
  13811. var me = this;
  13812. me._visited = {};
  13813. me._persisted = {};
  13814. me.removeCacheFile();
  13815. }
  13816. };
  13817. module2.exports = {
  13818. load: function(docId, cacheDir) {
  13819. return this.create(docId, cacheDir);
  13820. },
  13821. create: function(docId, cacheDir) {
  13822. var obj = Object.create(cache);
  13823. obj.load(docId, cacheDir);
  13824. return obj;
  13825. },
  13826. createFromFile: function(filePath) {
  13827. var obj = Object.create(cache);
  13828. obj.loadFile(filePath);
  13829. return obj;
  13830. },
  13831. clearCacheById: function(docId, cacheDir) {
  13832. var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, "../.cache/", docId);
  13833. return del(filePath);
  13834. },
  13835. clearAll: function(cacheDir) {
  13836. var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, "../.cache/");
  13837. return del(filePath);
  13838. }
  13839. };
  13840. }
  13841. });
  13842. var require_cache2 = __commonJS2({
  13843. "node_modules/file-entry-cache/cache.js"(exports2, module2) {
  13844. var path = require("path");
  13845. var crypto = require("crypto");
  13846. module2.exports = {
  13847. createFromFile: function(filePath, useChecksum) {
  13848. var fname = path.basename(filePath);
  13849. var dir = path.dirname(filePath);
  13850. return this.create(fname, dir, useChecksum);
  13851. },
  13852. create: function(cacheId, _path, useChecksum) {
  13853. var fs = require("fs");
  13854. var flatCache = require_cache();
  13855. var cache = flatCache.load(cacheId, _path);
  13856. var normalizedEntries = {};
  13857. var removeNotFoundFiles = function removeNotFoundFiles2() {
  13858. const cachedEntries = cache.keys();
  13859. cachedEntries.forEach(function remover(fPath) {
  13860. try {
  13861. fs.statSync(fPath);
  13862. } catch (err) {
  13863. if (err.code === "ENOENT") {
  13864. cache.removeKey(fPath);
  13865. }
  13866. }
  13867. });
  13868. };
  13869. removeNotFoundFiles();
  13870. return {
  13871. cache,
  13872. getHash: function(buffer) {
  13873. return crypto.createHash("md5").update(buffer).digest("hex");
  13874. },
  13875. hasFileChanged: function(file) {
  13876. return this.getFileDescriptor(file).changed;
  13877. },
  13878. analyzeFiles: function(files) {
  13879. var me = this;
  13880. files = files || [];
  13881. var res = {
  13882. changedFiles: [],
  13883. notFoundFiles: [],
  13884. notChangedFiles: []
  13885. };
  13886. me.normalizeEntries(files).forEach(function(entry) {
  13887. if (entry.changed) {
  13888. res.changedFiles.push(entry.key);
  13889. return;
  13890. }
  13891. if (entry.notFound) {
  13892. res.notFoundFiles.push(entry.key);
  13893. return;
  13894. }
  13895. res.notChangedFiles.push(entry.key);
  13896. });
  13897. return res;
  13898. },
  13899. getFileDescriptor: function(file) {
  13900. var fstat;
  13901. try {
  13902. fstat = fs.statSync(file);
  13903. } catch (ex) {
  13904. this.removeEntry(file);
  13905. return {
  13906. key: file,
  13907. notFound: true,
  13908. err: ex
  13909. };
  13910. }
  13911. if (useChecksum) {
  13912. return this._getFileDescriptorUsingChecksum(file);
  13913. }
  13914. return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
  13915. },
  13916. _getFileDescriptorUsingMtimeAndSize: function(file, fstat) {
  13917. var meta = cache.getKey(file);
  13918. var cacheExists = !!meta;
  13919. var cSize = fstat.size;
  13920. var cTime = fstat.mtime.getTime();
  13921. var isDifferentDate;
  13922. var isDifferentSize;
  13923. if (!meta) {
  13924. meta = {
  13925. size: cSize,
  13926. mtime: cTime
  13927. };
  13928. } else {
  13929. isDifferentDate = cTime !== meta.mtime;
  13930. isDifferentSize = cSize !== meta.size;
  13931. }
  13932. var nEntry = normalizedEntries[file] = {
  13933. key: file,
  13934. changed: !cacheExists || isDifferentDate || isDifferentSize,
  13935. meta
  13936. };
  13937. return nEntry;
  13938. },
  13939. _getFileDescriptorUsingChecksum: function(file) {
  13940. var meta = cache.getKey(file);
  13941. var cacheExists = !!meta;
  13942. var contentBuffer;
  13943. try {
  13944. contentBuffer = fs.readFileSync(file);
  13945. } catch (ex) {
  13946. contentBuffer = "";
  13947. }
  13948. var isDifferent = true;
  13949. var hash = this.getHash(contentBuffer);
  13950. if (!meta) {
  13951. meta = {
  13952. hash
  13953. };
  13954. } else {
  13955. isDifferent = hash !== meta.hash;
  13956. }
  13957. var nEntry = normalizedEntries[file] = {
  13958. key: file,
  13959. changed: !cacheExists || isDifferent,
  13960. meta
  13961. };
  13962. return nEntry;
  13963. },
  13964. getUpdatedFiles: function(files) {
  13965. var me = this;
  13966. files = files || [];
  13967. return me.normalizeEntries(files).filter(function(entry) {
  13968. return entry.changed;
  13969. }).map(function(entry) {
  13970. return entry.key;
  13971. });
  13972. },
  13973. normalizeEntries: function(files) {
  13974. files = files || [];
  13975. var me = this;
  13976. var nEntries = files.map(function(file) {
  13977. return me.getFileDescriptor(file);
  13978. });
  13979. return nEntries;
  13980. },
  13981. removeEntry: function(entryName) {
  13982. delete normalizedEntries[entryName];
  13983. cache.removeKey(entryName);
  13984. },
  13985. deleteCacheFile: function() {
  13986. cache.removeCacheFile();
  13987. },
  13988. destroy: function() {
  13989. normalizedEntries = {};
  13990. cache.destroy();
  13991. },
  13992. _getMetaForFileUsingCheckSum: function(cacheEntry) {
  13993. var contentBuffer = fs.readFileSync(cacheEntry.key);
  13994. var hash = this.getHash(contentBuffer);
  13995. var meta = Object.assign(cacheEntry.meta, {
  13996. hash
  13997. });
  13998. delete meta.size;
  13999. delete meta.mtime;
  14000. return meta;
  14001. },
  14002. _getMetaForFileUsingMtimeAndSize: function(cacheEntry) {
  14003. var stat = fs.statSync(cacheEntry.key);
  14004. var meta = Object.assign(cacheEntry.meta, {
  14005. size: stat.size,
  14006. mtime: stat.mtime.getTime()
  14007. });
  14008. delete meta.hash;
  14009. return meta;
  14010. },
  14011. reconcile: function(noPrune) {
  14012. removeNotFoundFiles();
  14013. noPrune = typeof noPrune === "undefined" ? true : noPrune;
  14014. var entries = normalizedEntries;
  14015. var keys = Object.keys(entries);
  14016. if (keys.length === 0) {
  14017. return;
  14018. }
  14019. var me = this;
  14020. keys.forEach(function(entryName) {
  14021. var cacheEntry = entries[entryName];
  14022. try {
  14023. var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
  14024. cache.setKey(entryName, meta);
  14025. } catch (err) {
  14026. if (err.code !== "ENOENT") {
  14027. throw err;
  14028. }
  14029. }
  14030. });
  14031. cache.save(noPrune);
  14032. }
  14033. };
  14034. }
  14035. };
  14036. }
  14037. });
  14038. var require_format_results_cache = __commonJS2({
  14039. "src/cli/format-results-cache.js"(exports2, module2) {
  14040. "use strict";
  14041. var fileEntryCache = require_cache2();
  14042. var stringify2 = require_fast_json_stable_stringify();
  14043. var {
  14044. version: prettierVersion
  14045. } = require("./index.js");
  14046. var {
  14047. createHash
  14048. } = require_utils();
  14049. var optionsHashCache = /* @__PURE__ */ new WeakMap();
  14050. var nodeVersion = process && process.version;
  14051. function getHashOfOptions(options) {
  14052. if (optionsHashCache.has(options)) {
  14053. return optionsHashCache.get(options);
  14054. }
  14055. const hash = createHash(`${prettierVersion}_${nodeVersion}_${stringify2(options)}`);
  14056. optionsHashCache.set(options, hash);
  14057. return hash;
  14058. }
  14059. function getMetadataFromFileDescriptor(fileDescriptor) {
  14060. return fileDescriptor.meta;
  14061. }
  14062. var FormatResultsCache = class {
  14063. constructor(cacheFileLocation, cacheStrategy) {
  14064. const useChecksum = cacheStrategy === "content";
  14065. this.cacheFileLocation = cacheFileLocation;
  14066. this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum);
  14067. }
  14068. existsAvailableFormatResultsCache(filePath, options) {
  14069. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14070. if (fileDescriptor.notFound) {
  14071. return false;
  14072. }
  14073. const hashOfOptions = getHashOfOptions(options);
  14074. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14075. const changed = fileDescriptor.changed || meta.hashOfOptions !== hashOfOptions;
  14076. return !changed;
  14077. }
  14078. setFormatResultsCache(filePath, options) {
  14079. const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);
  14080. const meta = getMetadataFromFileDescriptor(fileDescriptor);
  14081. if (fileDescriptor && !fileDescriptor.notFound) {
  14082. meta.hashOfOptions = getHashOfOptions(options);
  14083. }
  14084. }
  14085. removeFormatResultsCache(filePath) {
  14086. this.fileEntryCache.removeEntry(filePath);
  14087. }
  14088. reconcile() {
  14089. this.fileEntryCache.reconcile();
  14090. }
  14091. };
  14092. module2.exports = FormatResultsCache;
  14093. }
  14094. });
  14095. var require_base = __commonJS2({
  14096. "node_modules/diff/lib/diff/base.js"(exports2) {
  14097. "use strict";
  14098. Object.defineProperty(exports2, "__esModule", {
  14099. value: true
  14100. });
  14101. exports2["default"] = Diff;
  14102. function Diff() {
  14103. }
  14104. Diff.prototype = {
  14105. diff: function diff(oldString, newString) {
  14106. var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  14107. var callback = options.callback;
  14108. if (typeof options === "function") {
  14109. callback = options;
  14110. options = {};
  14111. }
  14112. this.options = options;
  14113. var self2 = this;
  14114. function done(value) {
  14115. if (callback) {
  14116. setTimeout(function() {
  14117. callback(void 0, value);
  14118. }, 0);
  14119. return true;
  14120. } else {
  14121. return value;
  14122. }
  14123. }
  14124. oldString = this.castInput(oldString);
  14125. newString = this.castInput(newString);
  14126. oldString = this.removeEmpty(this.tokenize(oldString));
  14127. newString = this.removeEmpty(this.tokenize(newString));
  14128. var newLen = newString.length, oldLen = oldString.length;
  14129. var editLength = 1;
  14130. var maxEditLength = newLen + oldLen;
  14131. var bestPath = [{
  14132. newPos: -1,
  14133. components: []
  14134. }];
  14135. var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
  14136. if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
  14137. return done([{
  14138. value: this.join(newString),
  14139. count: newString.length
  14140. }]);
  14141. }
  14142. function execEditLength() {
  14143. for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
  14144. var basePath = void 0;
  14145. var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
  14146. if (addPath) {
  14147. bestPath[diagonalPath - 1] = void 0;
  14148. }
  14149. var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
  14150. if (!canAdd && !canRemove) {
  14151. bestPath[diagonalPath] = void 0;
  14152. continue;
  14153. }
  14154. if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
  14155. basePath = clonePath(removePath);
  14156. self2.pushComponent(basePath.components, void 0, true);
  14157. } else {
  14158. basePath = addPath;
  14159. basePath.newPos++;
  14160. self2.pushComponent(basePath.components, true, void 0);
  14161. }
  14162. _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath);
  14163. if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
  14164. return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken));
  14165. } else {
  14166. bestPath[diagonalPath] = basePath;
  14167. }
  14168. }
  14169. editLength++;
  14170. }
  14171. if (callback) {
  14172. (function exec() {
  14173. setTimeout(function() {
  14174. if (editLength > maxEditLength) {
  14175. return callback();
  14176. }
  14177. if (!execEditLength()) {
  14178. exec();
  14179. }
  14180. }, 0);
  14181. })();
  14182. } else {
  14183. while (editLength <= maxEditLength) {
  14184. var ret = execEditLength();
  14185. if (ret) {
  14186. return ret;
  14187. }
  14188. }
  14189. }
  14190. },
  14191. pushComponent: function pushComponent(components, added, removed) {
  14192. var last = components[components.length - 1];
  14193. if (last && last.added === added && last.removed === removed) {
  14194. components[components.length - 1] = {
  14195. count: last.count + 1,
  14196. added,
  14197. removed
  14198. };
  14199. } else {
  14200. components.push({
  14201. count: 1,
  14202. added,
  14203. removed
  14204. });
  14205. }
  14206. },
  14207. extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
  14208. var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0;
  14209. while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
  14210. newPos++;
  14211. oldPos++;
  14212. commonCount++;
  14213. }
  14214. if (commonCount) {
  14215. basePath.components.push({
  14216. count: commonCount
  14217. });
  14218. }
  14219. basePath.newPos = newPos;
  14220. return oldPos;
  14221. },
  14222. equals: function equals(left, right) {
  14223. if (this.options.comparator) {
  14224. return this.options.comparator(left, right);
  14225. } else {
  14226. return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
  14227. }
  14228. },
  14229. removeEmpty: function removeEmpty(array2) {
  14230. var ret = [];
  14231. for (var i = 0; i < array2.length; i++) {
  14232. if (array2[i]) {
  14233. ret.push(array2[i]);
  14234. }
  14235. }
  14236. return ret;
  14237. },
  14238. castInput: function castInput(value) {
  14239. return value;
  14240. },
  14241. tokenize: function tokenize(value) {
  14242. return value.split("");
  14243. },
  14244. join: function join(chars) {
  14245. return chars.join("");
  14246. }
  14247. };
  14248. function buildValues(diff, components, newString, oldString, useLongestToken) {
  14249. var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0;
  14250. for (; componentPos < componentLen; componentPos++) {
  14251. var component = components[componentPos];
  14252. if (!component.removed) {
  14253. if (!component.added && useLongestToken) {
  14254. var value = newString.slice(newPos, newPos + component.count);
  14255. value = value.map(function(value2, i) {
  14256. var oldValue = oldString[oldPos + i];
  14257. return oldValue.length > value2.length ? oldValue : value2;
  14258. });
  14259. component.value = diff.join(value);
  14260. } else {
  14261. component.value = diff.join(newString.slice(newPos, newPos + component.count));
  14262. }
  14263. newPos += component.count;
  14264. if (!component.added) {
  14265. oldPos += component.count;
  14266. }
  14267. } else {
  14268. component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
  14269. oldPos += component.count;
  14270. if (componentPos && components[componentPos - 1].added) {
  14271. var tmp = components[componentPos - 1];
  14272. components[componentPos - 1] = components[componentPos];
  14273. components[componentPos] = tmp;
  14274. }
  14275. }
  14276. }
  14277. var lastComponent = components[componentLen - 1];
  14278. if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) {
  14279. components[componentLen - 2].value += lastComponent.value;
  14280. components.pop();
  14281. }
  14282. return components;
  14283. }
  14284. function clonePath(path) {
  14285. return {
  14286. newPos: path.newPos,
  14287. components: path.components.slice(0)
  14288. };
  14289. }
  14290. }
  14291. });
  14292. var require_params = __commonJS2({
  14293. "node_modules/diff/lib/util/params.js"(exports2) {
  14294. "use strict";
  14295. Object.defineProperty(exports2, "__esModule", {
  14296. value: true
  14297. });
  14298. exports2.generateOptions = generateOptions;
  14299. function generateOptions(options, defaults) {
  14300. if (typeof options === "function") {
  14301. defaults.callback = options;
  14302. } else if (options) {
  14303. for (var name in options) {
  14304. if (options.hasOwnProperty(name)) {
  14305. defaults[name] = options[name];
  14306. }
  14307. }
  14308. }
  14309. return defaults;
  14310. }
  14311. }
  14312. });
  14313. var require_line = __commonJS2({
  14314. "node_modules/diff/lib/diff/line.js"(exports2) {
  14315. "use strict";
  14316. Object.defineProperty(exports2, "__esModule", {
  14317. value: true
  14318. });
  14319. exports2.diffLines = diffLines;
  14320. exports2.diffTrimmedLines = diffTrimmedLines;
  14321. exports2.lineDiff = void 0;
  14322. var _base = _interopRequireDefault(require_base());
  14323. var _params = require_params();
  14324. function _interopRequireDefault(obj) {
  14325. return obj && obj.__esModule ? obj : {
  14326. "default": obj
  14327. };
  14328. }
  14329. var lineDiff = new _base["default"]();
  14330. exports2.lineDiff = lineDiff;
  14331. lineDiff.tokenize = function(value) {
  14332. var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
  14333. if (!linesAndNewlines[linesAndNewlines.length - 1]) {
  14334. linesAndNewlines.pop();
  14335. }
  14336. for (var i = 0; i < linesAndNewlines.length; i++) {
  14337. var line = linesAndNewlines[i];
  14338. if (i % 2 && !this.options.newlineIsToken) {
  14339. retLines[retLines.length - 1] += line;
  14340. } else {
  14341. if (this.options.ignoreWhitespace) {
  14342. line = line.trim();
  14343. }
  14344. retLines.push(line);
  14345. }
  14346. }
  14347. return retLines;
  14348. };
  14349. function diffLines(oldStr, newStr, callback) {
  14350. return lineDiff.diff(oldStr, newStr, callback);
  14351. }
  14352. function diffTrimmedLines(oldStr, newStr, callback) {
  14353. var options = (0, _params.generateOptions)(callback, {
  14354. ignoreWhitespace: true
  14355. });
  14356. return lineDiff.diff(oldStr, newStr, options);
  14357. }
  14358. }
  14359. });
  14360. var require_create = __commonJS2({
  14361. "node_modules/diff/lib/patch/create.js"(exports2) {
  14362. "use strict";
  14363. Object.defineProperty(exports2, "__esModule", {
  14364. value: true
  14365. });
  14366. exports2.structuredPatch = structuredPatch;
  14367. exports2.formatPatch = formatPatch;
  14368. exports2.createTwoFilesPatch = createTwoFilesPatch;
  14369. exports2.createPatch = createPatch;
  14370. var _line = require_line();
  14371. function _toConsumableArray(arr) {
  14372. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  14373. }
  14374. function _nonIterableSpread() {
  14375. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  14376. }
  14377. function _unsupportedIterableToArray(o, minLen) {
  14378. if (!o)
  14379. return;
  14380. if (typeof o === "string")
  14381. return _arrayLikeToArray(o, minLen);
  14382. var n = Object.prototype.toString.call(o).slice(8, -1);
  14383. if (n === "Object" && o.constructor)
  14384. n = o.constructor.name;
  14385. if (n === "Map" || n === "Set")
  14386. return Array.from(o);
  14387. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  14388. return _arrayLikeToArray(o, minLen);
  14389. }
  14390. function _iterableToArray(iter) {
  14391. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
  14392. return Array.from(iter);
  14393. }
  14394. function _arrayWithoutHoles(arr) {
  14395. if (Array.isArray(arr))
  14396. return _arrayLikeToArray(arr);
  14397. }
  14398. function _arrayLikeToArray(arr, len) {
  14399. if (len == null || len > arr.length)
  14400. len = arr.length;
  14401. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  14402. arr2[i] = arr[i];
  14403. }
  14404. return arr2;
  14405. }
  14406. function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14407. if (!options) {
  14408. options = {};
  14409. }
  14410. if (typeof options.context === "undefined") {
  14411. options.context = 4;
  14412. }
  14413. var diff = (0, _line.diffLines)(oldStr, newStr, options);
  14414. diff.push({
  14415. value: "",
  14416. lines: []
  14417. });
  14418. function contextLines(lines) {
  14419. return lines.map(function(entry) {
  14420. return " " + entry;
  14421. });
  14422. }
  14423. var hunks = [];
  14424. var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1;
  14425. var _loop = function _loop2(i2) {
  14426. var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n");
  14427. current.lines = lines;
  14428. if (current.added || current.removed) {
  14429. var _curRange;
  14430. if (!oldRangeStart) {
  14431. var prev = diff[i2 - 1];
  14432. oldRangeStart = oldLine;
  14433. newRangeStart = newLine;
  14434. if (prev) {
  14435. curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
  14436. oldRangeStart -= curRange.length;
  14437. newRangeStart -= curRange.length;
  14438. }
  14439. }
  14440. (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) {
  14441. return (current.added ? "+" : "-") + entry;
  14442. })));
  14443. if (current.added) {
  14444. newLine += lines.length;
  14445. } else {
  14446. oldLine += lines.length;
  14447. }
  14448. } else {
  14449. if (oldRangeStart) {
  14450. if (lines.length <= options.context * 2 && i2 < diff.length - 2) {
  14451. var _curRange2;
  14452. (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
  14453. } else {
  14454. var _curRange3;
  14455. var contextSize = Math.min(lines.length, options.context);
  14456. (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
  14457. var hunk = {
  14458. oldStart: oldRangeStart,
  14459. oldLines: oldLine - oldRangeStart + contextSize,
  14460. newStart: newRangeStart,
  14461. newLines: newLine - newRangeStart + contextSize,
  14462. lines: curRange
  14463. };
  14464. if (i2 >= diff.length - 2 && lines.length <= options.context) {
  14465. var oldEOFNewline = /\n$/.test(oldStr);
  14466. var newEOFNewline = /\n$/.test(newStr);
  14467. var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
  14468. if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
  14469. curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file");
  14470. }
  14471. if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
  14472. curRange.push("\\ No newline at end of file");
  14473. }
  14474. }
  14475. hunks.push(hunk);
  14476. oldRangeStart = 0;
  14477. newRangeStart = 0;
  14478. curRange = [];
  14479. }
  14480. }
  14481. oldLine += lines.length;
  14482. newLine += lines.length;
  14483. }
  14484. };
  14485. for (var i = 0; i < diff.length; i++) {
  14486. _loop(i);
  14487. }
  14488. return {
  14489. oldFileName,
  14490. newFileName,
  14491. oldHeader,
  14492. newHeader,
  14493. hunks
  14494. };
  14495. }
  14496. function formatPatch(diff) {
  14497. var ret = [];
  14498. if (diff.oldFileName == diff.newFileName) {
  14499. ret.push("Index: " + diff.oldFileName);
  14500. }
  14501. ret.push("===================================================================");
  14502. ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader));
  14503. ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader));
  14504. for (var i = 0; i < diff.hunks.length; i++) {
  14505. var hunk = diff.hunks[i];
  14506. if (hunk.oldLines === 0) {
  14507. hunk.oldStart -= 1;
  14508. }
  14509. if (hunk.newLines === 0) {
  14510. hunk.newStart -= 1;
  14511. }
  14512. ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@");
  14513. ret.push.apply(ret, hunk.lines);
  14514. }
  14515. return ret.join("\n") + "\n";
  14516. }
  14517. function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
  14518. return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
  14519. }
  14520. function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
  14521. return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
  14522. }
  14523. }
  14524. });
  14525. var require_format = __commonJS2({
  14526. "src/cli/format.js"(exports2, module2) {
  14527. "use strict";
  14528. var {
  14529. promises: fs
  14530. } = require("fs");
  14531. var path = require("path");
  14532. var {
  14533. default: chalk2
  14534. } = (init_source(), __toCommonJS(source_exports));
  14535. var prettier2 = require("./index.js");
  14536. var {
  14537. getStdin
  14538. } = require("./third-party.js");
  14539. var {
  14540. createIgnorer,
  14541. errors
  14542. } = require_prettier_internal();
  14543. var {
  14544. expandPatterns,
  14545. fixWindowsSlashes
  14546. } = require_expand_patterns();
  14547. var getOptionsForFile = require_get_options_for_file();
  14548. var isTTY = require_is_tty();
  14549. var findCacheFile = require_find_cache_file();
  14550. var FormatResultsCache = require_format_results_cache();
  14551. var {
  14552. statSafe
  14553. } = require_utils();
  14554. function diff(a, b) {
  14555. return require_create().createTwoFilesPatch("", "", a, b, "", "", {
  14556. context: 2
  14557. });
  14558. }
  14559. function handleError(context, filename, error, printedFilename) {
  14560. if (error instanceof errors.UndefinedParserError) {
  14561. if ((context.argv.write || context.argv.ignoreUnknown) && printedFilename) {
  14562. printedFilename.clear();
  14563. }
  14564. if (context.argv.ignoreUnknown) {
  14565. return;
  14566. }
  14567. if (!context.argv.check && !context.argv.listDifferent) {
  14568. process.exitCode = 2;
  14569. }
  14570. context.logger.error(error.message);
  14571. return;
  14572. }
  14573. if (context.argv.write) {
  14574. process.stdout.write("\n");
  14575. }
  14576. const isParseError = Boolean(error && error.loc);
  14577. const isValidationError = /^Invalid \S+ value\./.test(error && error.message);
  14578. if (isParseError) {
  14579. context.logger.error(`${filename}: ${String(error)}`);
  14580. } else if (isValidationError || error instanceof errors.ConfigError) {
  14581. context.logger.error(error.message);
  14582. process.exit(1);
  14583. } else if (error instanceof errors.DebugError) {
  14584. context.logger.error(`${filename}: ${error.message}`);
  14585. } else {
  14586. context.logger.error(filename + ": " + (error.stack || error));
  14587. }
  14588. process.exitCode = 2;
  14589. }
  14590. function writeOutput(context, result, options) {
  14591. process.stdout.write(context.argv.debugCheck ? result.filepath : result.formatted);
  14592. if (options && options.cursorOffset >= 0) {
  14593. process.stderr.write(result.cursorOffset + "\n");
  14594. }
  14595. }
  14596. function listDifferent(context, input, options, filename) {
  14597. if (!context.argv.check && !context.argv.listDifferent) {
  14598. return;
  14599. }
  14600. try {
  14601. if (!options.filepath && !options.parser) {
  14602. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14603. }
  14604. if (!prettier2.check(input, options)) {
  14605. if (!context.argv.write) {
  14606. context.logger.log(filename);
  14607. process.exitCode = 1;
  14608. }
  14609. }
  14610. } catch (error) {
  14611. context.logger.error(error.message);
  14612. }
  14613. return true;
  14614. }
  14615. function format(context, input, opt) {
  14616. if (!opt.parser && !opt.filepath) {
  14617. throw new errors.UndefinedParserError("No parser and no file path given, couldn't infer a parser.");
  14618. }
  14619. if (context.argv.debugPrintDoc) {
  14620. const doc = prettier2.__debug.printToDoc(input, opt);
  14621. return {
  14622. formatted: prettier2.__debug.formatDoc(doc) + "\n"
  14623. };
  14624. }
  14625. if (context.argv.debugPrintComments) {
  14626. return {
  14627. formatted: prettier2.format(JSON.stringify(prettier2.formatWithCursor(input, opt).comments || []), {
  14628. parser: "json"
  14629. })
  14630. };
  14631. }
  14632. if (context.argv.debugPrintAst) {
  14633. const {
  14634. ast
  14635. } = prettier2.__debug.parse(input, opt);
  14636. return {
  14637. formatted: JSON.stringify(ast)
  14638. };
  14639. }
  14640. if (context.argv.debugCheck) {
  14641. const pp = prettier2.format(input, opt);
  14642. const pppp = prettier2.format(pp, opt);
  14643. if (pp !== pppp) {
  14644. throw new errors.DebugError("prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp));
  14645. } else {
  14646. const stringify2 = (obj) => JSON.stringify(obj, null, 2);
  14647. const ast = stringify2(prettier2.__debug.parse(input, opt, true).ast);
  14648. const past = stringify2(prettier2.__debug.parse(pp, opt, true).ast);
  14649. if (ast !== past) {
  14650. const MAX_AST_SIZE = 2097152;
  14651. const astDiff = ast.length > MAX_AST_SIZE || past.length > MAX_AST_SIZE ? "AST diff too large to render" : diff(ast, past);
  14652. throw new errors.DebugError("ast(input) !== ast(prettier(input))\n" + astDiff + "\n" + diff(input, pp));
  14653. }
  14654. }
  14655. return {
  14656. formatted: pp,
  14657. filepath: opt.filepath || "(stdin)\n"
  14658. };
  14659. }
  14660. const {
  14661. performanceTestFlag
  14662. } = context;
  14663. if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugBenchmark) {
  14664. let benchmark;
  14665. try {
  14666. benchmark = require("benchmark");
  14667. } catch {
  14668. context.logger.debug("'--debug-benchmark' requires the 'benchmark' package to be installed.");
  14669. process.exit(2);
  14670. }
  14671. context.logger.debug("'--debug-benchmark' option found, measuring formatWithCursor with 'benchmark' module.");
  14672. const suite = new benchmark.Suite();
  14673. suite.add("format", () => {
  14674. prettier2.formatWithCursor(input, opt);
  14675. }).on("cycle", (event) => {
  14676. const results = {
  14677. benchmark: String(event.target),
  14678. hz: event.target.hz,
  14679. ms: event.target.times.cycle * 1e3
  14680. };
  14681. context.logger.debug("'--debug-benchmark' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14682. }).run({
  14683. async: false
  14684. });
  14685. } else if (performanceTestFlag !== null && performanceTestFlag !== void 0 && performanceTestFlag.debugRepeat) {
  14686. const repeat = context.argv.debugRepeat;
  14687. context.logger.debug("'--debug-repeat' option found, running formatWithCursor " + repeat + " times.");
  14688. let totalMs = 0;
  14689. for (let i = 0; i < repeat; ++i) {
  14690. const startMs = Date.now();
  14691. prettier2.formatWithCursor(input, opt);
  14692. totalMs += Date.now() - startMs;
  14693. }
  14694. const averageMs = totalMs / repeat;
  14695. const results = {
  14696. repeat,
  14697. hz: 1e3 / averageMs,
  14698. ms: averageMs
  14699. };
  14700. context.logger.debug("'--debug-repeat' measurements for formatWithCursor: " + JSON.stringify(results, null, 2));
  14701. }
  14702. return prettier2.formatWithCursor(input, opt);
  14703. }
  14704. async function createIgnorerFromContextOrDie(context) {
  14705. try {
  14706. return await createIgnorer(context.argv.ignorePath, context.argv.withNodeModules);
  14707. } catch (e) {
  14708. context.logger.error(e.message);
  14709. process.exit(2);
  14710. }
  14711. }
  14712. async function formatStdin2(context) {
  14713. const filepath = context.argv.filepath ? path.resolve(process.cwd(), context.argv.filepath) : process.cwd();
  14714. const ignorer = await createIgnorerFromContextOrDie(context);
  14715. const relativeFilepath = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filepath) : path.relative(process.cwd(), filepath);
  14716. try {
  14717. const input = await getStdin();
  14718. if (relativeFilepath && ignorer.ignores(fixWindowsSlashes(relativeFilepath))) {
  14719. writeOutput(context, {
  14720. formatted: input
  14721. });
  14722. return;
  14723. }
  14724. const options = await getOptionsForFile(context, filepath);
  14725. if (listDifferent(context, input, options, "(stdin)")) {
  14726. return;
  14727. }
  14728. const formatted = format(context, input, options);
  14729. const {
  14730. performanceTestFlag
  14731. } = context;
  14732. if (performanceTestFlag) {
  14733. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code to screen.`);
  14734. return;
  14735. }
  14736. writeOutput(context, formatted, options);
  14737. } catch (error) {
  14738. handleError(context, relativeFilepath || "stdin", error);
  14739. }
  14740. }
  14741. async function formatFiles2(context) {
  14742. var _formatResultsCache4;
  14743. const ignorer = await createIgnorerFromContextOrDie(context);
  14744. let numberOfUnformattedFilesFound = 0;
  14745. const {
  14746. performanceTestFlag
  14747. } = context;
  14748. if (context.argv.check && !performanceTestFlag) {
  14749. context.logger.log("Checking formatting...");
  14750. }
  14751. let formatResultsCache;
  14752. const cacheFilePath = await findCacheFile(context.argv.cacheLocation);
  14753. if (context.argv.cache) {
  14754. formatResultsCache = new FormatResultsCache(cacheFilePath, context.argv.cacheStrategy || "content");
  14755. } else {
  14756. if (context.argv.cacheStrategy) {
  14757. context.logger.error("`--cache-strategy` cannot be used without `--cache`.");
  14758. process.exit(2);
  14759. }
  14760. if (!context.argv.cacheLocation) {
  14761. const stat = await statSafe(cacheFilePath);
  14762. if (stat) {
  14763. await fs.unlink(cacheFilePath);
  14764. }
  14765. }
  14766. }
  14767. for await (const pathOrError of expandPatterns(context)) {
  14768. var _formatResultsCache;
  14769. if (typeof pathOrError === "object") {
  14770. context.logger.error(pathOrError.error);
  14771. process.exitCode = 2;
  14772. continue;
  14773. }
  14774. const filename = pathOrError;
  14775. const ignoreFilename = context.argv.ignorePath ? path.relative(path.dirname(context.argv.ignorePath), filename) : filename;
  14776. const fileIgnored = ignorer.ignores(fixWindowsSlashes(ignoreFilename));
  14777. if (fileIgnored && (context.argv.debugCheck || context.argv.write || context.argv.check || context.argv.listDifferent)) {
  14778. continue;
  14779. }
  14780. const options = Object.assign(Object.assign({}, await getOptionsForFile(context, filename)), {}, {
  14781. filepath: filename
  14782. });
  14783. let printedFilename;
  14784. if (isTTY()) {
  14785. printedFilename = context.logger.log(filename, {
  14786. newline: false,
  14787. clearable: true
  14788. });
  14789. }
  14790. let input;
  14791. try {
  14792. input = await fs.readFile(filename, "utf8");
  14793. } catch (error) {
  14794. context.logger.log("");
  14795. context.logger.error(`Unable to read file: ${filename}
  14796. ${error.message}`);
  14797. process.exitCode = 2;
  14798. continue;
  14799. }
  14800. if (fileIgnored) {
  14801. writeOutput(context, {
  14802. formatted: input
  14803. }, options);
  14804. continue;
  14805. }
  14806. const start = Date.now();
  14807. const isCacheExists = (_formatResultsCache = formatResultsCache) === null || _formatResultsCache === void 0 ? void 0 : _formatResultsCache.existsAvailableFormatResultsCache(filename, options);
  14808. let result;
  14809. let output;
  14810. try {
  14811. if (isCacheExists) {
  14812. result = {
  14813. formatted: input
  14814. };
  14815. } else {
  14816. result = format(context, input, options);
  14817. }
  14818. output = result.formatted;
  14819. } catch (error) {
  14820. handleError(context, filename, error, printedFilename);
  14821. continue;
  14822. }
  14823. const isDifferent = output !== input;
  14824. let shouldSetCache = !isDifferent;
  14825. if (printedFilename) {
  14826. printedFilename.clear();
  14827. }
  14828. if (performanceTestFlag) {
  14829. context.logger.log(`'${performanceTestFlag.name}' option found, skipped print code or write files.`);
  14830. return;
  14831. }
  14832. if (context.argv.write) {
  14833. if (isDifferent) {
  14834. if (!context.argv.check && !context.argv.listDifferent) {
  14835. context.logger.log(`${filename} ${Date.now() - start}ms`);
  14836. }
  14837. try {
  14838. await fs.writeFile(filename, output, "utf8");
  14839. shouldSetCache = true;
  14840. } catch (error) {
  14841. context.logger.error(`Unable to write file: ${filename}
  14842. ${error.message}`);
  14843. process.exitCode = 2;
  14844. }
  14845. } else if (!context.argv.check && !context.argv.listDifferent) {
  14846. const message = `${chalk2.grey(filename)} ${Date.now() - start}ms`;
  14847. if (isCacheExists) {
  14848. context.logger.log(`${message} (cached)`);
  14849. } else {
  14850. context.logger.log(message);
  14851. }
  14852. }
  14853. } else if (context.argv.debugCheck) {
  14854. if (result.filepath) {
  14855. context.logger.log(result.filepath);
  14856. } else {
  14857. process.exitCode = 2;
  14858. }
  14859. } else if (!context.argv.check && !context.argv.listDifferent) {
  14860. writeOutput(context, result, options);
  14861. }
  14862. if (shouldSetCache) {
  14863. var _formatResultsCache2;
  14864. (_formatResultsCache2 = formatResultsCache) === null || _formatResultsCache2 === void 0 ? void 0 : _formatResultsCache2.setFormatResultsCache(filename, options);
  14865. } else {
  14866. var _formatResultsCache3;
  14867. (_formatResultsCache3 = formatResultsCache) === null || _formatResultsCache3 === void 0 ? void 0 : _formatResultsCache3.removeFormatResultsCache(filename);
  14868. }
  14869. if (isDifferent) {
  14870. if (context.argv.check) {
  14871. context.logger.warn(filename);
  14872. } else if (context.argv.listDifferent) {
  14873. context.logger.log(filename);
  14874. }
  14875. numberOfUnformattedFilesFound += 1;
  14876. }
  14877. }
  14878. (_formatResultsCache4 = formatResultsCache) === null || _formatResultsCache4 === void 0 ? void 0 : _formatResultsCache4.reconcile();
  14879. if (context.argv.check) {
  14880. if (numberOfUnformattedFilesFound === 0) {
  14881. context.logger.log("All matched files use Prettier code style!");
  14882. } else if (numberOfUnformattedFilesFound === 1) {
  14883. 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?");
  14884. } else {
  14885. context.logger.warn(context.argv.write ? "Code style issues found in " + numberOfUnformattedFilesFound + " files." : "Code style issues found in " + numberOfUnformattedFilesFound + " files. Forgot to run Prettier?");
  14886. }
  14887. }
  14888. if ((context.argv.check || context.argv.listDifferent) && numberOfUnformattedFilesFound > 0 && !process.exitCode && !context.argv.write) {
  14889. process.exitCode = 1;
  14890. }
  14891. }
  14892. module2.exports = {
  14893. formatStdin: formatStdin2,
  14894. formatFiles: formatFiles2
  14895. };
  14896. }
  14897. });
  14898. var require_file_info = __commonJS2({
  14899. "src/cli/file-info.js"(exports2, module2) {
  14900. "use strict";
  14901. var stringify2 = require_fast_json_stable_stringify();
  14902. var prettier2 = require("./index.js");
  14903. var {
  14904. printToScreen: printToScreen2
  14905. } = require_utils();
  14906. async function logFileInfoOrDie2(context) {
  14907. const {
  14908. fileInfo: file,
  14909. ignorePath,
  14910. withNodeModules,
  14911. plugins,
  14912. pluginSearchDirs,
  14913. config
  14914. } = context.argv;
  14915. const fileInfo = await prettier2.getFileInfo(file, {
  14916. ignorePath,
  14917. withNodeModules,
  14918. plugins,
  14919. pluginSearchDirs,
  14920. resolveConfig: config !== false
  14921. });
  14922. printToScreen2(prettier2.format(stringify2(fileInfo), {
  14923. parser: "json"
  14924. }));
  14925. }
  14926. module2.exports = logFileInfoOrDie2;
  14927. }
  14928. });
  14929. var require_find_config_path = __commonJS2({
  14930. "src/cli/find-config-path.js"(exports2, module2) {
  14931. "use strict";
  14932. var path = require("path");
  14933. var prettier2 = require("./index.js");
  14934. var {
  14935. printToScreen: printToScreen2
  14936. } = require_utils();
  14937. async function logResolvedConfigPathOrDie2(context) {
  14938. const file = context.argv.findConfigPath;
  14939. const configFile = await prettier2.resolveConfigFile(file);
  14940. if (configFile) {
  14941. printToScreen2(path.relative(process.cwd(), configFile));
  14942. } else {
  14943. throw new Error(`Can not find configure file for "${file}"`);
  14944. }
  14945. }
  14946. module2.exports = logResolvedConfigPathOrDie2;
  14947. }
  14948. });
  14949. var stringify = require_fast_json_stable_stringify();
  14950. var prettier = require("./index.js");
  14951. var createLogger = require_logger();
  14952. var Context = require_context();
  14953. var {
  14954. parseArgvWithoutPlugins
  14955. } = require_parse_cli_arguments();
  14956. var {
  14957. createDetailedUsage,
  14958. createUsage
  14959. } = require_usage();
  14960. var {
  14961. formatStdin,
  14962. formatFiles
  14963. } = require_format();
  14964. var logFileInfoOrDie = require_file_info();
  14965. var logResolvedConfigPathOrDie = require_find_config_path();
  14966. var {
  14967. utils: {
  14968. isNonEmptyArray
  14969. }
  14970. } = require_prettier_internal();
  14971. var {
  14972. printToScreen
  14973. } = require_utils();
  14974. async function run(rawArguments) {
  14975. let logger = createLogger();
  14976. try {
  14977. const logLevel = parseArgvWithoutPlugins(rawArguments, logger, "loglevel").loglevel;
  14978. if (logLevel !== logger.logLevel) {
  14979. logger = createLogger(logLevel);
  14980. }
  14981. const context = new Context({
  14982. rawArguments,
  14983. logger
  14984. });
  14985. if (logger.logLevel !== "debug" && context.performanceTestFlag) {
  14986. context.logger = createLogger("debug");
  14987. }
  14988. await main(context);
  14989. } catch (error) {
  14990. logger.error(error.message);
  14991. process.exitCode = 1;
  14992. }
  14993. }
  14994. async function main(context) {
  14995. context.logger.debug(`normalized argv: ${JSON.stringify(context.argv)}`);
  14996. if (context.argv.pluginSearch === false) {
  14997. const rawPluginSearchDirs = context.argv.__raw["plugin-search-dir"];
  14998. if (typeof rawPluginSearchDirs === "string" || isNonEmptyArray(rawPluginSearchDirs)) {
  14999. throw new Error("Cannot use --no-plugin-search and --plugin-search-dir together.");
  15000. }
  15001. }
  15002. if (context.argv.check && context.argv.listDifferent) {
  15003. throw new Error("Cannot use --check and --list-different together.");
  15004. }
  15005. if (context.argv.write && context.argv.debugCheck) {
  15006. throw new Error("Cannot use --write and --debug-check together.");
  15007. }
  15008. if (context.argv.findConfigPath && context.filePatterns.length > 0) {
  15009. throw new Error("Cannot use --find-config-path with multiple files");
  15010. }
  15011. if (context.argv.fileInfo && context.filePatterns.length > 0) {
  15012. throw new Error("Cannot use --file-info with multiple files");
  15013. }
  15014. if (context.argv.version) {
  15015. printToScreen(prettier.version);
  15016. return;
  15017. }
  15018. if (context.argv.help !== void 0) {
  15019. printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
  15020. return;
  15021. }
  15022. if (context.argv.supportInfo) {
  15023. printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
  15024. parser: "json"
  15025. }));
  15026. return;
  15027. }
  15028. const hasFilePatterns = context.filePatterns.length > 0;
  15029. const useStdin = !hasFilePatterns && (!process.stdin.isTTY || context.argv.filePath);
  15030. if (context.argv.findConfigPath) {
  15031. await logResolvedConfigPathOrDie(context);
  15032. } else if (context.argv.fileInfo) {
  15033. await logFileInfoOrDie(context);
  15034. } else if (useStdin) {
  15035. if (context.argv.cache) {
  15036. context.logger.error("`--cache` cannot be used with stdin.");
  15037. process.exit(2);
  15038. }
  15039. await formatStdin(context);
  15040. } else if (hasFilePatterns) {
  15041. await formatFiles(context);
  15042. } else {
  15043. process.exitCode = 1;
  15044. printToScreen(createUsage(context));
  15045. }
  15046. }
  15047. module.exports = {
  15048. run
  15049. };