index.js 272 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // identity function for calling harmony imports with the correct context
  38. /******/ __webpack_require__.i = function(value) { return value; };
  39. /******/
  40. /******/ // define getter function for harmony exports
  41. /******/ __webpack_require__.d = function(exports, name, getter) {
  42. /******/ if(!__webpack_require__.o(exports, name)) {
  43. /******/ Object.defineProperty(exports, name, {
  44. /******/ configurable: false,
  45. /******/ enumerable: true,
  46. /******/ get: getter
  47. /******/ });
  48. /******/ }
  49. /******/ };
  50. /******/
  51. /******/ // getDefaultExport function for compatibility with non-harmony modules
  52. /******/ __webpack_require__.n = function(module) {
  53. /******/ var getter = module && module.__esModule ?
  54. /******/ function getDefault() { return module['default']; } :
  55. /******/ function getModuleExports() { return module; };
  56. /******/ __webpack_require__.d(getter, 'a', getter);
  57. /******/ return getter;
  58. /******/ };
  59. /******/
  60. /******/ // Object.prototype.hasOwnProperty.call
  61. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  62. /******/
  63. /******/ // __webpack_public_path__
  64. /******/ __webpack_require__.p = "";
  65. /******/
  66. /******/ // Load entry module and return exports
  67. /******/ return __webpack_require__(__webpack_require__.s = 14);
  68. /******/ })
  69. /************************************************************************/
  70. /******/ ([
  71. /* 0 */
  72. /***/ (function(module, exports) {
  73. module.exports = require("path");
  74. /***/ }),
  75. /* 1 */
  76. /***/ (function(module, exports, __webpack_require__) {
  77. "use strict";
  78. exports.__esModule = true;
  79. var _promise = __webpack_require__(173);
  80. var _promise2 = _interopRequireDefault(_promise);
  81. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82. exports.default = function (fn) {
  83. return function () {
  84. var gen = fn.apply(this, arguments);
  85. return new _promise2.default(function (resolve, reject) {
  86. function step(key, arg) {
  87. try {
  88. var info = gen[key](arg);
  89. var value = info.value;
  90. } catch (error) {
  91. reject(error);
  92. return;
  93. }
  94. if (info.done) {
  95. resolve(value);
  96. } else {
  97. return _promise2.default.resolve(value).then(function (value) {
  98. step("next", value);
  99. }, function (err) {
  100. step("throw", err);
  101. });
  102. }
  103. }
  104. return step("next");
  105. });
  106. };
  107. };
  108. /***/ }),
  109. /* 2 */
  110. /***/ (function(module, exports) {
  111. module.exports = require("util");
  112. /***/ }),
  113. /* 3 */
  114. /***/ (function(module, exports) {
  115. module.exports = require("fs");
  116. /***/ }),
  117. /* 4 */
  118. /***/ (function(module, exports, __webpack_require__) {
  119. "use strict";
  120. Object.defineProperty(exports, "__esModule", {
  121. value: true
  122. });
  123. class MessageError extends Error {
  124. constructor(msg, code) {
  125. super(msg);
  126. this.code = code;
  127. }
  128. }
  129. exports.MessageError = MessageError;
  130. class ProcessSpawnError extends MessageError {
  131. constructor(msg, code, process) {
  132. super(msg, code);
  133. this.process = process;
  134. }
  135. }
  136. exports.ProcessSpawnError = ProcessSpawnError;
  137. class SecurityError extends MessageError {}
  138. exports.SecurityError = SecurityError;
  139. class ProcessTermError extends MessageError {}
  140. exports.ProcessTermError = ProcessTermError;
  141. class ResponseError extends Error {
  142. constructor(msg, responseCode) {
  143. super(msg);
  144. this.responseCode = responseCode;
  145. }
  146. }
  147. exports.ResponseError = ResponseError;
  148. /***/ }),
  149. /* 5 */
  150. /***/ (function(module, exports, __webpack_require__) {
  151. "use strict";
  152. Object.defineProperty(exports, "__esModule", {
  153. value: true
  154. });
  155. exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined;
  156. var _asyncToGenerator2;
  157. function _load_asyncToGenerator() {
  158. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1));
  159. }
  160. let buildActionsForCopy = (() => {
  161. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
  162. //
  163. let build = (() => {
  164. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  165. const src = data.src,
  166. dest = data.dest,
  167. type = data.type;
  168. const onFresh = data.onFresh || noop;
  169. const onDone = data.onDone || noop;
  170. // TODO https://github.com/yarnpkg/yarn/issues/3751
  171. // related to bundled dependencies handling
  172. if (files.has(dest.toLowerCase())) {
  173. reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`);
  174. } else {
  175. files.add(dest.toLowerCase());
  176. }
  177. if (type === 'symlink') {
  178. yield mkdirp((_path || _load_path()).default.dirname(dest));
  179. onFresh();
  180. actions.symlink.push({
  181. dest,
  182. linkname: src
  183. });
  184. onDone();
  185. return;
  186. }
  187. if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) {
  188. // ignored file
  189. return;
  190. }
  191. const srcStat = yield lstat(src);
  192. let srcFiles;
  193. if (srcStat.isDirectory()) {
  194. srcFiles = yield readdir(src);
  195. }
  196. let destStat;
  197. try {
  198. // try accessing the destination
  199. destStat = yield lstat(dest);
  200. } catch (e) {
  201. // proceed if destination doesn't exist, otherwise error
  202. if (e.code !== 'ENOENT') {
  203. throw e;
  204. }
  205. }
  206. // if destination exists
  207. if (destStat) {
  208. const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
  209. const bothFolders = srcStat.isDirectory() && destStat.isDirectory();
  210. const bothFiles = srcStat.isFile() && destStat.isFile();
  211. // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
  212. // us modes that aren't valid. investigate this, it's generally safe to proceed.
  213. /* if (srcStat.mode !== destStat.mode) {
  214. try {
  215. await access(dest, srcStat.mode);
  216. } catch (err) {}
  217. } */
  218. if (bothFiles && artifactFiles.has(dest)) {
  219. // this file gets changed during build, likely by a custom install script. Don't bother checking it.
  220. onDone();
  221. reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
  222. return;
  223. }
  224. if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) {
  225. // we can safely assume this is the same file
  226. onDone();
  227. reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime));
  228. return;
  229. }
  230. if (bothSymlinks) {
  231. const srcReallink = yield readlink(src);
  232. if (srcReallink === (yield readlink(dest))) {
  233. // if both symlinks are the same then we can continue on
  234. onDone();
  235. reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
  236. return;
  237. }
  238. }
  239. if (bothFolders) {
  240. // mark files that aren't in this folder as possibly extraneous
  241. const destFiles = yield readdir(dest);
  242. invariant(srcFiles, 'src files not initialised');
  243. for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  244. var _ref6;
  245. if (_isArray4) {
  246. if (_i4 >= _iterator4.length) break;
  247. _ref6 = _iterator4[_i4++];
  248. } else {
  249. _i4 = _iterator4.next();
  250. if (_i4.done) break;
  251. _ref6 = _i4.value;
  252. }
  253. const file = _ref6;
  254. if (srcFiles.indexOf(file) < 0) {
  255. const loc = (_path || _load_path()).default.join(dest, file);
  256. possibleExtraneous.add(loc);
  257. if ((yield lstat(loc)).isDirectory()) {
  258. for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  259. var _ref7;
  260. if (_isArray5) {
  261. if (_i5 >= _iterator5.length) break;
  262. _ref7 = _iterator5[_i5++];
  263. } else {
  264. _i5 = _iterator5.next();
  265. if (_i5.done) break;
  266. _ref7 = _i5.value;
  267. }
  268. const file = _ref7;
  269. possibleExtraneous.add((_path || _load_path()).default.join(loc, file));
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. if (destStat && destStat.isSymbolicLink()) {
  277. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
  278. destStat = null;
  279. }
  280. if (srcStat.isSymbolicLink()) {
  281. onFresh();
  282. const linkname = yield readlink(src);
  283. actions.symlink.push({
  284. dest,
  285. linkname
  286. });
  287. onDone();
  288. } else if (srcStat.isDirectory()) {
  289. if (!destStat) {
  290. reporter.verbose(reporter.lang('verboseFileFolder', dest));
  291. yield mkdirp(dest);
  292. }
  293. const destParts = dest.split((_path || _load_path()).default.sep);
  294. while (destParts.length) {
  295. files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase());
  296. destParts.pop();
  297. }
  298. // push all files to queue
  299. invariant(srcFiles, 'src files not initialised');
  300. let remaining = srcFiles.length;
  301. if (!remaining) {
  302. onDone();
  303. }
  304. for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  305. var _ref8;
  306. if (_isArray6) {
  307. if (_i6 >= _iterator6.length) break;
  308. _ref8 = _iterator6[_i6++];
  309. } else {
  310. _i6 = _iterator6.next();
  311. if (_i6.done) break;
  312. _ref8 = _i6.value;
  313. }
  314. const file = _ref8;
  315. queue.push({
  316. dest: (_path || _load_path()).default.join(dest, file),
  317. onFresh,
  318. onDone: function (_onDone) {
  319. function onDone() {
  320. return _onDone.apply(this, arguments);
  321. }
  322. onDone.toString = function () {
  323. return _onDone.toString();
  324. };
  325. return onDone;
  326. }(function () {
  327. if (--remaining === 0) {
  328. onDone();
  329. }
  330. }),
  331. src: (_path || _load_path()).default.join(src, file)
  332. });
  333. }
  334. } else if (srcStat.isFile()) {
  335. onFresh();
  336. actions.file.push({
  337. src,
  338. dest,
  339. atime: srcStat.atime,
  340. mtime: srcStat.mtime,
  341. mode: srcStat.mode
  342. });
  343. onDone();
  344. } else {
  345. throw new Error(`unsure how to copy this: ${src}`);
  346. }
  347. });
  348. return function build(_x5) {
  349. return _ref5.apply(this, arguments);
  350. };
  351. })();
  352. const artifactFiles = new Set(events.artifactFiles || []);
  353. const files = new Set();
  354. // initialise events
  355. for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  356. var _ref2;
  357. if (_isArray) {
  358. if (_i >= _iterator.length) break;
  359. _ref2 = _iterator[_i++];
  360. } else {
  361. _i = _iterator.next();
  362. if (_i.done) break;
  363. _ref2 = _i.value;
  364. }
  365. const item = _ref2;
  366. const onDone = item.onDone;
  367. item.onDone = function () {
  368. events.onProgress(item.dest);
  369. if (onDone) {
  370. onDone();
  371. }
  372. };
  373. }
  374. events.onStart(queue.length);
  375. // start building actions
  376. const actions = {
  377. file: [],
  378. symlink: [],
  379. link: []
  380. };
  381. // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
  382. // at a time due to the requirement to push items onto the queue
  383. while (queue.length) {
  384. const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
  385. yield Promise.all(items.map(build));
  386. }
  387. // simulate the existence of some files to prevent considering them extraneous
  388. for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  389. var _ref3;
  390. if (_isArray2) {
  391. if (_i2 >= _iterator2.length) break;
  392. _ref3 = _iterator2[_i2++];
  393. } else {
  394. _i2 = _iterator2.next();
  395. if (_i2.done) break;
  396. _ref3 = _i2.value;
  397. }
  398. const file = _ref3;
  399. if (possibleExtraneous.has(file)) {
  400. reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file));
  401. possibleExtraneous.delete(file);
  402. }
  403. }
  404. for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  405. var _ref4;
  406. if (_isArray3) {
  407. if (_i3 >= _iterator3.length) break;
  408. _ref4 = _iterator3[_i3++];
  409. } else {
  410. _i3 = _iterator3.next();
  411. if (_i3.done) break;
  412. _ref4 = _i3.value;
  413. }
  414. const loc = _ref4;
  415. if (files.has(loc.toLowerCase())) {
  416. possibleExtraneous.delete(loc);
  417. }
  418. }
  419. return actions;
  420. });
  421. return function buildActionsForCopy(_x, _x2, _x3, _x4) {
  422. return _ref.apply(this, arguments);
  423. };
  424. })();
  425. let buildActionsForHardlink = (() => {
  426. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
  427. //
  428. let build = (() => {
  429. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  430. const src = data.src,
  431. dest = data.dest;
  432. const onFresh = data.onFresh || noop;
  433. const onDone = data.onDone || noop;
  434. if (files.has(dest.toLowerCase())) {
  435. // Fixes issue https://github.com/yarnpkg/yarn/issues/2734
  436. // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1,
  437. // package-linker passes that modules A1 and B1 need to be hardlinked,
  438. // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case
  439. // an exception.
  440. onDone();
  441. return;
  442. }
  443. files.add(dest.toLowerCase());
  444. if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) {
  445. // ignored file
  446. return;
  447. }
  448. const srcStat = yield lstat(src);
  449. let srcFiles;
  450. if (srcStat.isDirectory()) {
  451. srcFiles = yield readdir(src);
  452. }
  453. const destExists = yield exists(dest);
  454. if (destExists) {
  455. const destStat = yield lstat(dest);
  456. const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
  457. const bothFolders = srcStat.isDirectory() && destStat.isDirectory();
  458. const bothFiles = srcStat.isFile() && destStat.isFile();
  459. if (srcStat.mode !== destStat.mode) {
  460. try {
  461. yield access(dest, srcStat.mode);
  462. } catch (err) {
  463. // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
  464. // us modes that aren't valid. investigate this, it's generally safe to proceed.
  465. reporter.verbose(err);
  466. }
  467. }
  468. if (bothFiles && artifactFiles.has(dest)) {
  469. // this file gets changed during build, likely by a custom install script. Don't bother checking it.
  470. onDone();
  471. reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
  472. return;
  473. }
  474. // correct hardlink
  475. if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) {
  476. onDone();
  477. reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino));
  478. return;
  479. }
  480. if (bothSymlinks) {
  481. const srcReallink = yield readlink(src);
  482. if (srcReallink === (yield readlink(dest))) {
  483. // if both symlinks are the same then we can continue on
  484. onDone();
  485. reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
  486. return;
  487. }
  488. }
  489. if (bothFolders) {
  490. // mark files that aren't in this folder as possibly extraneous
  491. const destFiles = yield readdir(dest);
  492. invariant(srcFiles, 'src files not initialised');
  493. for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
  494. var _ref14;
  495. if (_isArray10) {
  496. if (_i10 >= _iterator10.length) break;
  497. _ref14 = _iterator10[_i10++];
  498. } else {
  499. _i10 = _iterator10.next();
  500. if (_i10.done) break;
  501. _ref14 = _i10.value;
  502. }
  503. const file = _ref14;
  504. if (srcFiles.indexOf(file) < 0) {
  505. const loc = (_path || _load_path()).default.join(dest, file);
  506. possibleExtraneous.add(loc);
  507. if ((yield lstat(loc)).isDirectory()) {
  508. for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
  509. var _ref15;
  510. if (_isArray11) {
  511. if (_i11 >= _iterator11.length) break;
  512. _ref15 = _iterator11[_i11++];
  513. } else {
  514. _i11 = _iterator11.next();
  515. if (_i11.done) break;
  516. _ref15 = _i11.value;
  517. }
  518. const file = _ref15;
  519. possibleExtraneous.add((_path || _load_path()).default.join(loc, file));
  520. }
  521. }
  522. }
  523. }
  524. }
  525. }
  526. if (srcStat.isSymbolicLink()) {
  527. onFresh();
  528. const linkname = yield readlink(src);
  529. actions.symlink.push({
  530. dest,
  531. linkname
  532. });
  533. onDone();
  534. } else if (srcStat.isDirectory()) {
  535. reporter.verbose(reporter.lang('verboseFileFolder', dest));
  536. yield mkdirp(dest);
  537. const destParts = dest.split((_path || _load_path()).default.sep);
  538. while (destParts.length) {
  539. files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase());
  540. destParts.pop();
  541. }
  542. // push all files to queue
  543. invariant(srcFiles, 'src files not initialised');
  544. let remaining = srcFiles.length;
  545. if (!remaining) {
  546. onDone();
  547. }
  548. for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
  549. var _ref16;
  550. if (_isArray12) {
  551. if (_i12 >= _iterator12.length) break;
  552. _ref16 = _iterator12[_i12++];
  553. } else {
  554. _i12 = _iterator12.next();
  555. if (_i12.done) break;
  556. _ref16 = _i12.value;
  557. }
  558. const file = _ref16;
  559. queue.push({
  560. onFresh,
  561. src: (_path || _load_path()).default.join(src, file),
  562. dest: (_path || _load_path()).default.join(dest, file),
  563. onDone: function (_onDone2) {
  564. function onDone() {
  565. return _onDone2.apply(this, arguments);
  566. }
  567. onDone.toString = function () {
  568. return _onDone2.toString();
  569. };
  570. return onDone;
  571. }(function () {
  572. if (--remaining === 0) {
  573. onDone();
  574. }
  575. })
  576. });
  577. }
  578. } else if (srcStat.isFile()) {
  579. onFresh();
  580. actions.link.push({
  581. src,
  582. dest,
  583. removeDest: destExists
  584. });
  585. onDone();
  586. } else {
  587. throw new Error(`unsure how to copy this: ${src}`);
  588. }
  589. });
  590. return function build(_x10) {
  591. return _ref13.apply(this, arguments);
  592. };
  593. })();
  594. const artifactFiles = new Set(events.artifactFiles || []);
  595. const files = new Set();
  596. // initialise events
  597. for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
  598. var _ref10;
  599. if (_isArray7) {
  600. if (_i7 >= _iterator7.length) break;
  601. _ref10 = _iterator7[_i7++];
  602. } else {
  603. _i7 = _iterator7.next();
  604. if (_i7.done) break;
  605. _ref10 = _i7.value;
  606. }
  607. const item = _ref10;
  608. const onDone = item.onDone || noop;
  609. item.onDone = function () {
  610. events.onProgress(item.dest);
  611. onDone();
  612. };
  613. }
  614. events.onStart(queue.length);
  615. // start building actions
  616. const actions = {
  617. file: [],
  618. symlink: [],
  619. link: []
  620. };
  621. // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
  622. // at a time due to the requirement to push items onto the queue
  623. while (queue.length) {
  624. const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
  625. yield Promise.all(items.map(build));
  626. }
  627. // simulate the existence of some files to prevent considering them extraneous
  628. for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
  629. var _ref11;
  630. if (_isArray8) {
  631. if (_i8 >= _iterator8.length) break;
  632. _ref11 = _iterator8[_i8++];
  633. } else {
  634. _i8 = _iterator8.next();
  635. if (_i8.done) break;
  636. _ref11 = _i8.value;
  637. }
  638. const file = _ref11;
  639. if (possibleExtraneous.has(file)) {
  640. reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file));
  641. possibleExtraneous.delete(file);
  642. }
  643. }
  644. for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
  645. var _ref12;
  646. if (_isArray9) {
  647. if (_i9 >= _iterator9.length) break;
  648. _ref12 = _iterator9[_i9++];
  649. } else {
  650. _i9 = _iterator9.next();
  651. if (_i9.done) break;
  652. _ref12 = _i9.value;
  653. }
  654. const loc = _ref12;
  655. if (files.has(loc.toLowerCase())) {
  656. possibleExtraneous.delete(loc);
  657. }
  658. }
  659. return actions;
  660. });
  661. return function buildActionsForHardlink(_x6, _x7, _x8, _x9) {
  662. return _ref9.apply(this, arguments);
  663. };
  664. })();
  665. let copyBulk = exports.copyBulk = (() => {
  666. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
  667. const events = {
  668. onStart: _events && _events.onStart || noop,
  669. onProgress: _events && _events.onProgress || noop,
  670. possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
  671. ignoreBasenames: _events && _events.ignoreBasenames || [],
  672. artifactFiles: _events && _events.artifactFiles || []
  673. };
  674. const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter);
  675. events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
  676. const fileActions = actions.file;
  677. const currentlyWriting = new Map();
  678. yield (_promise || _load_promise()).queue(fileActions, (() => {
  679. var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  680. let writePromise;
  681. while (writePromise = currentlyWriting.get(data.dest)) {
  682. yield writePromise;
  683. }
  684. reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest));
  685. const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () {
  686. return currentlyWriting.delete(data.dest);
  687. });
  688. currentlyWriting.set(data.dest, copier);
  689. events.onProgress(data.dest);
  690. return copier;
  691. });
  692. return function (_x14) {
  693. return _ref18.apply(this, arguments);
  694. };
  695. })(), CONCURRENT_QUEUE_ITEMS);
  696. // we need to copy symlinks last as they could reference files we were copying
  697. const symlinkActions = actions.symlink;
  698. yield (_promise || _load_promise()).queue(symlinkActions, function (data) {
  699. const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname);
  700. reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
  701. return symlink(linkname, data.dest);
  702. });
  703. });
  704. return function copyBulk(_x11, _x12, _x13) {
  705. return _ref17.apply(this, arguments);
  706. };
  707. })();
  708. let hardlinkBulk = exports.hardlinkBulk = (() => {
  709. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
  710. const events = {
  711. onStart: _events && _events.onStart || noop,
  712. onProgress: _events && _events.onProgress || noop,
  713. possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
  714. artifactFiles: _events && _events.artifactFiles || [],
  715. ignoreBasenames: []
  716. };
  717. const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter);
  718. events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
  719. const fileActions = actions.link;
  720. yield (_promise || _load_promise()).queue(fileActions, (() => {
  721. var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  722. reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest));
  723. if (data.removeDest) {
  724. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest);
  725. }
  726. yield link(data.src, data.dest);
  727. });
  728. return function (_x18) {
  729. return _ref20.apply(this, arguments);
  730. };
  731. })(), CONCURRENT_QUEUE_ITEMS);
  732. // we need to copy symlinks last as they could reference files we were copying
  733. const symlinkActions = actions.symlink;
  734. yield (_promise || _load_promise()).queue(symlinkActions, function (data) {
  735. const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname);
  736. reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
  737. return symlink(linkname, data.dest);
  738. });
  739. });
  740. return function hardlinkBulk(_x15, _x16, _x17) {
  741. return _ref19.apply(this, arguments);
  742. };
  743. })();
  744. let readFileAny = exports.readFileAny = (() => {
  745. var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) {
  746. for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) {
  747. var _ref22;
  748. if (_isArray13) {
  749. if (_i13 >= _iterator13.length) break;
  750. _ref22 = _iterator13[_i13++];
  751. } else {
  752. _i13 = _iterator13.next();
  753. if (_i13.done) break;
  754. _ref22 = _i13.value;
  755. }
  756. const file = _ref22;
  757. if (yield exists(file)) {
  758. return readFile(file);
  759. }
  760. }
  761. return null;
  762. });
  763. return function readFileAny(_x19) {
  764. return _ref21.apply(this, arguments);
  765. };
  766. })();
  767. let readJson = exports.readJson = (() => {
  768. var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  769. return (yield readJsonAndFile(loc)).object;
  770. });
  771. return function readJson(_x20) {
  772. return _ref23.apply(this, arguments);
  773. };
  774. })();
  775. let readJsonAndFile = exports.readJsonAndFile = (() => {
  776. var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  777. const file = yield readFile(loc);
  778. try {
  779. return {
  780. object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))),
  781. content: file
  782. };
  783. } catch (err) {
  784. err.message = `${loc}: ${err.message}`;
  785. throw err;
  786. }
  787. });
  788. return function readJsonAndFile(_x21) {
  789. return _ref24.apply(this, arguments);
  790. };
  791. })();
  792. let find = exports.find = (() => {
  793. var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) {
  794. const parts = dir.split((_path || _load_path()).default.sep);
  795. while (parts.length) {
  796. const loc = parts.concat(filename).join((_path || _load_path()).default.sep);
  797. if (yield exists(loc)) {
  798. return loc;
  799. } else {
  800. parts.pop();
  801. }
  802. }
  803. return false;
  804. });
  805. return function find(_x22, _x23) {
  806. return _ref25.apply(this, arguments);
  807. };
  808. })();
  809. let symlink = exports.symlink = (() => {
  810. var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
  811. try {
  812. const stats = yield lstat(dest);
  813. if (stats.isSymbolicLink()) {
  814. const resolved = yield realpath(dest);
  815. if (resolved === src) {
  816. return;
  817. }
  818. }
  819. } catch (err) {
  820. if (err.code !== 'ENOENT') {
  821. throw err;
  822. }
  823. }
  824. // We use rimraf for unlink which never throws an ENOENT on missing target
  825. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
  826. if (process.platform === 'win32') {
  827. // use directory junctions if possible on win32, this requires absolute paths
  828. yield fsSymlink(src, dest, 'junction');
  829. } else {
  830. // use relative paths otherwise which will be retained if the directory is moved
  831. let relative;
  832. try {
  833. relative = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src));
  834. } catch (err) {
  835. if (err.code !== 'ENOENT') {
  836. throw err;
  837. }
  838. relative = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src);
  839. }
  840. // When path.relative returns an empty string for the current directory, we should instead use
  841. // '.', which is a valid fs.symlink target.
  842. yield fsSymlink(relative || '.', dest);
  843. }
  844. });
  845. return function symlink(_x24, _x25) {
  846. return _ref26.apply(this, arguments);
  847. };
  848. })();
  849. let walk = exports.walk = (() => {
  850. var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) {
  851. let files = [];
  852. let filenames = yield readdir(dir);
  853. if (ignoreBasenames.size) {
  854. filenames = filenames.filter(function (name) {
  855. return !ignoreBasenames.has(name);
  856. });
  857. }
  858. for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
  859. var _ref28;
  860. if (_isArray14) {
  861. if (_i14 >= _iterator14.length) break;
  862. _ref28 = _iterator14[_i14++];
  863. } else {
  864. _i14 = _iterator14.next();
  865. if (_i14.done) break;
  866. _ref28 = _i14.value;
  867. }
  868. const name = _ref28;
  869. const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name;
  870. const loc = (_path || _load_path()).default.join(dir, name);
  871. const stat = yield lstat(loc);
  872. files.push({
  873. relative,
  874. basename: name,
  875. absolute: loc,
  876. mtime: +stat.mtime
  877. });
  878. if (stat.isDirectory()) {
  879. files = files.concat((yield walk(loc, relative, ignoreBasenames)));
  880. }
  881. }
  882. return files;
  883. });
  884. return function walk(_x26, _x27) {
  885. return _ref27.apply(this, arguments);
  886. };
  887. })();
  888. let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => {
  889. var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  890. const stat = yield lstat(loc);
  891. const size = stat.size,
  892. blockSize = stat.blksize;
  893. return Math.ceil(size / blockSize) * blockSize;
  894. });
  895. return function getFileSizeOnDisk(_x28) {
  896. return _ref29.apply(this, arguments);
  897. };
  898. })();
  899. let getEolFromFile = (() => {
  900. var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) {
  901. if (!(yield exists(path))) {
  902. return undefined;
  903. }
  904. const buffer = yield readFileBuffer(path);
  905. for (let i = 0; i < buffer.length; ++i) {
  906. if (buffer[i] === cr) {
  907. return '\r\n';
  908. }
  909. if (buffer[i] === lf) {
  910. return '\n';
  911. }
  912. }
  913. return undefined;
  914. });
  915. return function getEolFromFile(_x29) {
  916. return _ref30.apply(this, arguments);
  917. };
  918. })();
  919. let writeFilePreservingEol = exports.writeFilePreservingEol = (() => {
  920. var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) {
  921. const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL;
  922. if (eol !== '\n') {
  923. data = data.replace(/\n/g, eol);
  924. }
  925. yield writeFile(path, data);
  926. });
  927. return function writeFilePreservingEol(_x30, _x31) {
  928. return _ref31.apply(this, arguments);
  929. };
  930. })();
  931. let hardlinksWork = exports.hardlinksWork = (() => {
  932. var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
  933. const filename = 'test-file' + Math.random();
  934. const file = (_path || _load_path()).default.join(dir, filename);
  935. const fileLink = (_path || _load_path()).default.join(dir, filename + '-link');
  936. try {
  937. yield writeFile(file, 'test');
  938. yield link(file, fileLink);
  939. } catch (err) {
  940. return false;
  941. } finally {
  942. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file);
  943. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink);
  944. }
  945. return true;
  946. });
  947. return function hardlinksWork(_x32) {
  948. return _ref32.apply(this, arguments);
  949. };
  950. })();
  951. // not a strict polyfill for Node's fs.mkdtemp
  952. let makeTempDir = exports.makeTempDir = (() => {
  953. var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) {
  954. const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`);
  955. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir);
  956. yield mkdirp(dir);
  957. return dir;
  958. });
  959. return function makeTempDir(_x33) {
  960. return _ref33.apply(this, arguments);
  961. };
  962. })();
  963. let readFirstAvailableStream = exports.readFirstAvailableStream = (() => {
  964. var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
  965. for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) {
  966. var _ref35;
  967. if (_isArray15) {
  968. if (_i15 >= _iterator15.length) break;
  969. _ref35 = _iterator15[_i15++];
  970. } else {
  971. _i15 = _iterator15.next();
  972. if (_i15.done) break;
  973. _ref35 = _i15.value;
  974. }
  975. const path = _ref35;
  976. try {
  977. const fd = yield open(path, 'r');
  978. return (_fs || _load_fs()).default.createReadStream(path, { fd });
  979. } catch (err) {
  980. // Try the next one
  981. }
  982. }
  983. return null;
  984. });
  985. return function readFirstAvailableStream(_x34) {
  986. return _ref34.apply(this, arguments);
  987. };
  988. })();
  989. let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => {
  990. var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) {
  991. const result = {
  992. skipped: [],
  993. folder: null
  994. };
  995. for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
  996. var _ref37;
  997. if (_isArray16) {
  998. if (_i16 >= _iterator16.length) break;
  999. _ref37 = _iterator16[_i16++];
  1000. } else {
  1001. _i16 = _iterator16.next();
  1002. if (_i16.done) break;
  1003. _ref37 = _i16.value;
  1004. }
  1005. const folder = _ref37;
  1006. try {
  1007. yield mkdirp(folder);
  1008. yield access(folder, mode);
  1009. result.folder = folder;
  1010. return result;
  1011. } catch (error) {
  1012. result.skipped.push({
  1013. error,
  1014. folder
  1015. });
  1016. }
  1017. }
  1018. return result;
  1019. });
  1020. return function getFirstSuitableFolder(_x35) {
  1021. return _ref36.apply(this, arguments);
  1022. };
  1023. })();
  1024. exports.copy = copy;
  1025. exports.readFile = readFile;
  1026. exports.readFileRaw = readFileRaw;
  1027. exports.normalizeOS = normalizeOS;
  1028. var _fs;
  1029. function _load_fs() {
  1030. return _fs = _interopRequireDefault(__webpack_require__(3));
  1031. }
  1032. var _glob;
  1033. function _load_glob() {
  1034. return _glob = _interopRequireDefault(__webpack_require__(75));
  1035. }
  1036. var _os;
  1037. function _load_os() {
  1038. return _os = _interopRequireDefault(__webpack_require__(36));
  1039. }
  1040. var _path;
  1041. function _load_path() {
  1042. return _path = _interopRequireDefault(__webpack_require__(0));
  1043. }
  1044. var _blockingQueue;
  1045. function _load_blockingQueue() {
  1046. return _blockingQueue = _interopRequireDefault(__webpack_require__(84));
  1047. }
  1048. var _promise;
  1049. function _load_promise() {
  1050. return _promise = _interopRequireWildcard(__webpack_require__(40));
  1051. }
  1052. var _promise2;
  1053. function _load_promise2() {
  1054. return _promise2 = __webpack_require__(40);
  1055. }
  1056. var _map;
  1057. function _load_map() {
  1058. return _map = _interopRequireDefault(__webpack_require__(20));
  1059. }
  1060. var _fsNormalized;
  1061. function _load_fsNormalized() {
  1062. return _fsNormalized = __webpack_require__(164);
  1063. }
  1064. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  1065. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1066. const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : {
  1067. R_OK: (_fs || _load_fs()).default.R_OK,
  1068. W_OK: (_fs || _load_fs()).default.W_OK,
  1069. X_OK: (_fs || _load_fs()).default.X_OK
  1070. };
  1071. const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock');
  1072. const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile);
  1073. const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open);
  1074. const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile);
  1075. const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink);
  1076. const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath);
  1077. const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir);
  1078. const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename);
  1079. const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access);
  1080. const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat);
  1081. const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(116));
  1082. const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true);
  1083. const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat);
  1084. const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod);
  1085. const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link);
  1086. const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default);
  1087. exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink;
  1088. // fs.copyFile uses the native file copying instructions on the system, performing much better
  1089. // than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the
  1090. // concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD.
  1091. const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4;
  1092. const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink);
  1093. const invariant = __webpack_require__(7);
  1094. const stripBOM = __webpack_require__(122);
  1095. const noop = () => {};
  1096. function copy(src, dest, reporter) {
  1097. return copyBulk([{ src, dest }], reporter);
  1098. }
  1099. function _readFile(loc, encoding) {
  1100. return new Promise((resolve, reject) => {
  1101. (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) {
  1102. if (err) {
  1103. reject(err);
  1104. } else {
  1105. resolve(content);
  1106. }
  1107. });
  1108. });
  1109. }
  1110. function readFile(loc) {
  1111. return _readFile(loc, 'utf8').then(normalizeOS);
  1112. }
  1113. function readFileRaw(loc) {
  1114. return _readFile(loc, 'binary');
  1115. }
  1116. function normalizeOS(body) {
  1117. return body.replace(/\r\n/g, '\n');
  1118. }
  1119. const cr = '\r'.charCodeAt(0);
  1120. const lf = '\n'.charCodeAt(0);
  1121. /***/ }),
  1122. /* 6 */
  1123. /***/ (function(module, exports, __webpack_require__) {
  1124. "use strict";
  1125. Object.defineProperty(exports, "__esModule", {
  1126. value: true
  1127. });
  1128. exports.getPathKey = getPathKey;
  1129. const os = __webpack_require__(36);
  1130. const path = __webpack_require__(0);
  1131. const userHome = __webpack_require__(45).default;
  1132. var _require = __webpack_require__(171);
  1133. const getCacheDir = _require.getCacheDir,
  1134. getConfigDir = _require.getConfigDir,
  1135. getDataDir = _require.getDataDir;
  1136. const isWebpackBundle = __webpack_require__(227);
  1137. const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies'];
  1138. const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions';
  1139. const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES];
  1140. const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0';
  1141. const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com';
  1142. const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/';
  1143. const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh';
  1144. const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi';
  1145. const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version';
  1146. // cache version, bump whenever we make backwards incompatible changes
  1147. const CACHE_VERSION = exports.CACHE_VERSION = 2;
  1148. // lockfile version, bump whenever we make backwards incompatible changes
  1149. const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1;
  1150. // max amount of network requests to perform concurrently
  1151. const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8;
  1152. // HTTP timeout used when downloading packages
  1153. const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds
  1154. // max amount of child processes to execute concurrently
  1155. const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5;
  1156. const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid'];
  1157. function getPreferredCacheDirectories() {
  1158. const preferredCacheDirectories = [getCacheDir()];
  1159. if (process.getuid) {
  1160. // $FlowFixMe: process.getuid exists, dammit
  1161. preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`));
  1162. }
  1163. preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`));
  1164. return preferredCacheDirectories;
  1165. }
  1166. const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories();
  1167. const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir();
  1168. const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir();
  1169. const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link');
  1170. const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global');
  1171. const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath;
  1172. const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath();
  1173. // Webpack needs to be configured with node.__dirname/__filename = false
  1174. function getYarnBinPath() {
  1175. if (isWebpackBundle) {
  1176. return __filename;
  1177. } else {
  1178. return path.join(__dirname, '..', 'bin', 'yarn.js');
  1179. }
  1180. }
  1181. const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules';
  1182. const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json';
  1183. const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`;
  1184. const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn');
  1185. const META_FOLDER = exports.META_FOLDER = '.yarn-meta';
  1186. const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity';
  1187. const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock';
  1188. const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json';
  1189. const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz';
  1190. const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean';
  1191. const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json';
  1192. const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json';
  1193. const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' ';
  1194. const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997;
  1195. const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance';
  1196. const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env);
  1197. function getPathKey(platform, env) {
  1198. let pathKey = 'PATH';
  1199. // windows calls its path "Path" usually, but this is not guaranteed.
  1200. if (platform === 'win32') {
  1201. pathKey = 'Path';
  1202. for (const key in env) {
  1203. if (key.toLowerCase() === 'path') {
  1204. pathKey = key;
  1205. }
  1206. }
  1207. }
  1208. return pathKey;
  1209. }
  1210. const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = {
  1211. major: 'red',
  1212. premajor: 'red',
  1213. minor: 'yellow',
  1214. preminor: 'yellow',
  1215. patch: 'green',
  1216. prepatch: 'green',
  1217. prerelease: 'red',
  1218. unchanged: 'white',
  1219. unknown: 'red'
  1220. };
  1221. /***/ }),
  1222. /* 7 */
  1223. /***/ (function(module, exports, __webpack_require__) {
  1224. "use strict";
  1225. /**
  1226. * Copyright (c) 2013-present, Facebook, Inc.
  1227. *
  1228. * This source code is licensed under the MIT license found in the
  1229. * LICENSE file in the root directory of this source tree.
  1230. */
  1231. /**
  1232. * Use invariant() to assert state which your program assumes to be true.
  1233. *
  1234. * Provide sprintf-style format (only %s is supported) and arguments
  1235. * to provide information about what broke and what you were
  1236. * expecting.
  1237. *
  1238. * The invariant message will be stripped in production, but the invariant
  1239. * will remain to ensure logic does not differ in production.
  1240. */
  1241. var NODE_ENV = process.env.NODE_ENV;
  1242. var invariant = function(condition, format, a, b, c, d, e, f) {
  1243. if (NODE_ENV !== 'production') {
  1244. if (format === undefined) {
  1245. throw new Error('invariant requires an error message argument');
  1246. }
  1247. }
  1248. if (!condition) {
  1249. var error;
  1250. if (format === undefined) {
  1251. error = new Error(
  1252. 'Minified exception occurred; use the non-minified dev environment ' +
  1253. 'for the full error message and additional helpful warnings.'
  1254. );
  1255. } else {
  1256. var args = [a, b, c, d, e, f];
  1257. var argIndex = 0;
  1258. error = new Error(
  1259. format.replace(/%s/g, function() { return args[argIndex++]; })
  1260. );
  1261. error.name = 'Invariant Violation';
  1262. }
  1263. error.framesToPop = 1; // we don't care about invariant's own frame
  1264. throw error;
  1265. }
  1266. };
  1267. module.exports = invariant;
  1268. /***/ }),
  1269. /* 8 */,
  1270. /* 9 */
  1271. /***/ (function(module, exports) {
  1272. module.exports = require("crypto");
  1273. /***/ }),
  1274. /* 10 */,
  1275. /* 11 */
  1276. /***/ (function(module, exports) {
  1277. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1278. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  1279. ? window : typeof self != 'undefined' && self.Math == Math ? self
  1280. // eslint-disable-next-line no-new-func
  1281. : Function('return this')();
  1282. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  1283. /***/ }),
  1284. /* 12 */
  1285. /***/ (function(module, exports, __webpack_require__) {
  1286. "use strict";
  1287. Object.defineProperty(exports, "__esModule", {
  1288. value: true
  1289. });
  1290. exports.sortAlpha = sortAlpha;
  1291. exports.entries = entries;
  1292. exports.removePrefix = removePrefix;
  1293. exports.removeSuffix = removeSuffix;
  1294. exports.addSuffix = addSuffix;
  1295. exports.hyphenate = hyphenate;
  1296. exports.camelCase = camelCase;
  1297. exports.compareSortedArrays = compareSortedArrays;
  1298. exports.sleep = sleep;
  1299. const _camelCase = __webpack_require__(176);
  1300. function sortAlpha(a, b) {
  1301. // sort alphabetically in a deterministic way
  1302. const shortLen = Math.min(a.length, b.length);
  1303. for (let i = 0; i < shortLen; i++) {
  1304. const aChar = a.charCodeAt(i);
  1305. const bChar = b.charCodeAt(i);
  1306. if (aChar !== bChar) {
  1307. return aChar - bChar;
  1308. }
  1309. }
  1310. return a.length - b.length;
  1311. }
  1312. function entries(obj) {
  1313. const entries = [];
  1314. if (obj) {
  1315. for (const key in obj) {
  1316. entries.push([key, obj[key]]);
  1317. }
  1318. }
  1319. return entries;
  1320. }
  1321. function removePrefix(pattern, prefix) {
  1322. if (pattern.startsWith(prefix)) {
  1323. pattern = pattern.slice(prefix.length);
  1324. }
  1325. return pattern;
  1326. }
  1327. function removeSuffix(pattern, suffix) {
  1328. if (pattern.endsWith(suffix)) {
  1329. return pattern.slice(0, -suffix.length);
  1330. }
  1331. return pattern;
  1332. }
  1333. function addSuffix(pattern, suffix) {
  1334. if (!pattern.endsWith(suffix)) {
  1335. return pattern + suffix;
  1336. }
  1337. return pattern;
  1338. }
  1339. function hyphenate(str) {
  1340. return str.replace(/[A-Z]/g, match => {
  1341. return '-' + match.charAt(0).toLowerCase();
  1342. });
  1343. }
  1344. function camelCase(str) {
  1345. if (/[A-Z]/.test(str)) {
  1346. return null;
  1347. } else {
  1348. return _camelCase(str);
  1349. }
  1350. }
  1351. function compareSortedArrays(array1, array2) {
  1352. if (array1.length !== array2.length) {
  1353. return false;
  1354. }
  1355. for (let i = 0, len = array1.length; i < len; i++) {
  1356. if (array1[i] !== array2[i]) {
  1357. return false;
  1358. }
  1359. }
  1360. return true;
  1361. }
  1362. function sleep(ms) {
  1363. return new Promise(resolve => {
  1364. setTimeout(resolve, ms);
  1365. });
  1366. }
  1367. /***/ }),
  1368. /* 13 */
  1369. /***/ (function(module, exports, __webpack_require__) {
  1370. var store = __webpack_require__(107)('wks');
  1371. var uid = __webpack_require__(111);
  1372. var Symbol = __webpack_require__(11).Symbol;
  1373. var USE_SYMBOL = typeof Symbol == 'function';
  1374. var $exports = module.exports = function (name) {
  1375. return store[name] || (store[name] =
  1376. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  1377. };
  1378. $exports.store = store;
  1379. /***/ }),
  1380. /* 14 */
  1381. /***/ (function(module, exports, __webpack_require__) {
  1382. "use strict";
  1383. Object.defineProperty(exports, "__esModule", {
  1384. value: true
  1385. });
  1386. exports.stringify = exports.parse = undefined;
  1387. var _asyncToGenerator2;
  1388. function _load_asyncToGenerator() {
  1389. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1));
  1390. }
  1391. var _parse;
  1392. function _load_parse() {
  1393. return _parse = __webpack_require__(81);
  1394. }
  1395. Object.defineProperty(exports, 'parse', {
  1396. enumerable: true,
  1397. get: function get() {
  1398. return _interopRequireDefault(_parse || _load_parse()).default;
  1399. }
  1400. });
  1401. var _stringify;
  1402. function _load_stringify() {
  1403. return _stringify = __webpack_require__(150);
  1404. }
  1405. Object.defineProperty(exports, 'stringify', {
  1406. enumerable: true,
  1407. get: function get() {
  1408. return _interopRequireDefault(_stringify || _load_stringify()).default;
  1409. }
  1410. });
  1411. exports.implodeEntry = implodeEntry;
  1412. exports.explodeEntry = explodeEntry;
  1413. var _misc;
  1414. function _load_misc() {
  1415. return _misc = __webpack_require__(12);
  1416. }
  1417. var _normalizePattern;
  1418. function _load_normalizePattern() {
  1419. return _normalizePattern = __webpack_require__(29);
  1420. }
  1421. var _parse2;
  1422. function _load_parse2() {
  1423. return _parse2 = _interopRequireDefault(__webpack_require__(81));
  1424. }
  1425. var _constants;
  1426. function _load_constants() {
  1427. return _constants = __webpack_require__(6);
  1428. }
  1429. var _fs;
  1430. function _load_fs() {
  1431. return _fs = _interopRequireWildcard(__webpack_require__(5));
  1432. }
  1433. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  1434. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1435. const invariant = __webpack_require__(7);
  1436. const path = __webpack_require__(0);
  1437. const ssri = __webpack_require__(55);
  1438. function getName(pattern) {
  1439. return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name;
  1440. }
  1441. function blankObjectUndefined(obj) {
  1442. return obj && Object.keys(obj).length ? obj : undefined;
  1443. }
  1444. function keyForRemote(remote) {
  1445. return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null);
  1446. }
  1447. function serializeIntegrity(integrity) {
  1448. // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output
  1449. // See https://git.io/vx2Hy
  1450. return integrity.toString().split(' ').sort().join(' ');
  1451. }
  1452. function implodeEntry(pattern, obj) {
  1453. const inferredName = getName(pattern);
  1454. const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : '';
  1455. const imploded = {
  1456. name: inferredName === obj.name ? undefined : obj.name,
  1457. version: obj.version,
  1458. uid: obj.uid === obj.version ? undefined : obj.uid,
  1459. resolved: obj.resolved,
  1460. registry: obj.registry === 'npm' ? undefined : obj.registry,
  1461. dependencies: blankObjectUndefined(obj.dependencies),
  1462. optionalDependencies: blankObjectUndefined(obj.optionalDependencies),
  1463. permissions: blankObjectUndefined(obj.permissions),
  1464. prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants)
  1465. };
  1466. if (integrity) {
  1467. imploded.integrity = integrity;
  1468. }
  1469. return imploded;
  1470. }
  1471. function explodeEntry(pattern, obj) {
  1472. obj.optionalDependencies = obj.optionalDependencies || {};
  1473. obj.dependencies = obj.dependencies || {};
  1474. obj.uid = obj.uid || obj.version;
  1475. obj.permissions = obj.permissions || {};
  1476. obj.registry = obj.registry || 'npm';
  1477. obj.name = obj.name || getName(pattern);
  1478. const integrity = obj.integrity;
  1479. if (integrity && integrity.isIntegrity) {
  1480. obj.integrity = ssri.parse(integrity);
  1481. }
  1482. return obj;
  1483. }
  1484. class Lockfile {
  1485. constructor({ cache, source, parseResultType } = {}) {
  1486. this.source = source || '';
  1487. this.cache = cache;
  1488. this.parseResultType = parseResultType;
  1489. }
  1490. // source string if the `cache` was parsed
  1491. // if true, we're parsing an old yarn file and need to update integrity fields
  1492. hasEntriesExistWithoutIntegrity() {
  1493. if (!this.cache) {
  1494. return false;
  1495. }
  1496. for (const key in this.cache) {
  1497. // $FlowFixMe - `this.cache` is clearly defined at this point
  1498. if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) {
  1499. return true;
  1500. }
  1501. }
  1502. return false;
  1503. }
  1504. static fromDirectory(dir, reporter) {
  1505. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  1506. // read the manifest in this directory
  1507. const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME);
  1508. let lockfile;
  1509. let rawLockfile = '';
  1510. let parseResult;
  1511. if (yield (_fs || _load_fs()).exists(lockfileLoc)) {
  1512. rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc);
  1513. parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc);
  1514. if (reporter) {
  1515. if (parseResult.type === 'merge') {
  1516. reporter.info(reporter.lang('lockfileMerged'));
  1517. } else if (parseResult.type === 'conflict') {
  1518. reporter.warn(reporter.lang('lockfileConflict'));
  1519. }
  1520. }
  1521. lockfile = parseResult.object;
  1522. } else if (reporter) {
  1523. reporter.info(reporter.lang('noLockfileFound'));
  1524. }
  1525. return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type });
  1526. })();
  1527. }
  1528. getLocked(pattern) {
  1529. const cache = this.cache;
  1530. if (!cache) {
  1531. return undefined;
  1532. }
  1533. const shrunk = pattern in cache && cache[pattern];
  1534. if (typeof shrunk === 'string') {
  1535. return this.getLocked(shrunk);
  1536. } else if (shrunk) {
  1537. explodeEntry(pattern, shrunk);
  1538. return shrunk;
  1539. }
  1540. return undefined;
  1541. }
  1542. removePattern(pattern) {
  1543. const cache = this.cache;
  1544. if (!cache) {
  1545. return;
  1546. }
  1547. delete cache[pattern];
  1548. }
  1549. getLockfile(patterns) {
  1550. const lockfile = {};
  1551. const seen = new Map();
  1552. // order by name so that lockfile manifest is assigned to the first dependency with this manifest
  1553. // the others that have the same remoteKey will just refer to the first
  1554. // ordering allows for consistency in lockfile when it is serialized
  1555. const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha);
  1556. for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  1557. var _ref;
  1558. if (_isArray) {
  1559. if (_i >= _iterator.length) break;
  1560. _ref = _iterator[_i++];
  1561. } else {
  1562. _i = _iterator.next();
  1563. if (_i.done) break;
  1564. _ref = _i.value;
  1565. }
  1566. const pattern = _ref;
  1567. const pkg = patterns[pattern];
  1568. const remote = pkg._remote,
  1569. ref = pkg._reference;
  1570. invariant(ref, 'Package is missing a reference');
  1571. invariant(remote, 'Package is missing a remote');
  1572. const remoteKey = keyForRemote(remote);
  1573. const seenPattern = remoteKey && seen.get(remoteKey);
  1574. if (seenPattern) {
  1575. // no point in duplicating it
  1576. lockfile[pattern] = seenPattern;
  1577. // if we're relying on our name being inferred and two of the patterns have
  1578. // different inferred names then we need to set it
  1579. if (!seenPattern.name && getName(pattern) !== pkg.name) {
  1580. seenPattern.name = pkg.name;
  1581. }
  1582. continue;
  1583. }
  1584. const obj = implodeEntry(pattern, {
  1585. name: pkg.name,
  1586. version: pkg.version,
  1587. uid: pkg._uid,
  1588. resolved: remote.resolved,
  1589. integrity: remote.integrity,
  1590. registry: remote.registry,
  1591. dependencies: pkg.dependencies,
  1592. peerDependencies: pkg.peerDependencies,
  1593. optionalDependencies: pkg.optionalDependencies,
  1594. permissions: ref.permissions,
  1595. prebuiltVariants: pkg.prebuiltVariants
  1596. });
  1597. lockfile[pattern] = obj;
  1598. if (remoteKey) {
  1599. seen.set(remoteKey, obj);
  1600. }
  1601. }
  1602. return lockfile;
  1603. }
  1604. }
  1605. exports.default = Lockfile;
  1606. /***/ }),
  1607. /* 15 */,
  1608. /* 16 */,
  1609. /* 17 */
  1610. /***/ (function(module, exports) {
  1611. module.exports = require("stream");
  1612. /***/ }),
  1613. /* 18 */,
  1614. /* 19 */,
  1615. /* 20 */
  1616. /***/ (function(module, exports, __webpack_require__) {
  1617. "use strict";
  1618. Object.defineProperty(exports, "__esModule", {
  1619. value: true
  1620. });
  1621. exports.default = nullify;
  1622. function nullify(obj = {}) {
  1623. if (Array.isArray(obj)) {
  1624. for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  1625. var _ref;
  1626. if (_isArray) {
  1627. if (_i >= _iterator.length) break;
  1628. _ref = _iterator[_i++];
  1629. } else {
  1630. _i = _iterator.next();
  1631. if (_i.done) break;
  1632. _ref = _i.value;
  1633. }
  1634. const item = _ref;
  1635. nullify(item);
  1636. }
  1637. } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') {
  1638. Object.setPrototypeOf(obj, null);
  1639. // for..in can only be applied to 'object', not 'function'
  1640. if (typeof obj === 'object') {
  1641. for (const key in obj) {
  1642. nullify(obj[key]);
  1643. }
  1644. }
  1645. }
  1646. return obj;
  1647. }
  1648. /***/ }),
  1649. /* 21 */,
  1650. /* 22 */
  1651. /***/ (function(module, exports) {
  1652. module.exports = require("assert");
  1653. /***/ }),
  1654. /* 23 */
  1655. /***/ (function(module, exports) {
  1656. var core = module.exports = { version: '2.5.7' };
  1657. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  1658. /***/ }),
  1659. /* 24 */,
  1660. /* 25 */,
  1661. /* 26 */,
  1662. /* 27 */
  1663. /***/ (function(module, exports, __webpack_require__) {
  1664. var isObject = __webpack_require__(34);
  1665. module.exports = function (it) {
  1666. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  1667. return it;
  1668. };
  1669. /***/ }),
  1670. /* 28 */,
  1671. /* 29 */
  1672. /***/ (function(module, exports, __webpack_require__) {
  1673. "use strict";
  1674. Object.defineProperty(exports, "__esModule", {
  1675. value: true
  1676. });
  1677. exports.normalizePattern = normalizePattern;
  1678. /**
  1679. * Explode and normalize a pattern into its name and range.
  1680. */
  1681. function normalizePattern(pattern) {
  1682. let hasVersion = false;
  1683. let range = 'latest';
  1684. let name = pattern;
  1685. // if we're a scope then remove the @ and add it back later
  1686. let isScoped = false;
  1687. if (name[0] === '@') {
  1688. isScoped = true;
  1689. name = name.slice(1);
  1690. }
  1691. // take first part as the name
  1692. const parts = name.split('@');
  1693. if (parts.length > 1) {
  1694. name = parts.shift();
  1695. range = parts.join('@');
  1696. if (range) {
  1697. hasVersion = true;
  1698. } else {
  1699. range = '*';
  1700. }
  1701. }
  1702. // add back @ scope suffix
  1703. if (isScoped) {
  1704. name = `@${name}`;
  1705. }
  1706. return { name, range, hasVersion };
  1707. }
  1708. /***/ }),
  1709. /* 30 */,
  1710. /* 31 */
  1711. /***/ (function(module, exports, __webpack_require__) {
  1712. var dP = __webpack_require__(50);
  1713. var createDesc = __webpack_require__(106);
  1714. module.exports = __webpack_require__(33) ? function (object, key, value) {
  1715. return dP.f(object, key, createDesc(1, value));
  1716. } : function (object, key, value) {
  1717. object[key] = value;
  1718. return object;
  1719. };
  1720. /***/ }),
  1721. /* 32 */
  1722. /***/ (function(module, exports, __webpack_require__) {
  1723. /* eslint-disable node/no-deprecated-api */
  1724. var buffer = __webpack_require__(63)
  1725. var Buffer = buffer.Buffer
  1726. // alternative to using Object.keys for old browsers
  1727. function copyProps (src, dst) {
  1728. for (var key in src) {
  1729. dst[key] = src[key]
  1730. }
  1731. }
  1732. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  1733. module.exports = buffer
  1734. } else {
  1735. // Copy properties from require('buffer')
  1736. copyProps(buffer, exports)
  1737. exports.Buffer = SafeBuffer
  1738. }
  1739. function SafeBuffer (arg, encodingOrOffset, length) {
  1740. return Buffer(arg, encodingOrOffset, length)
  1741. }
  1742. // Copy static methods from Buffer
  1743. copyProps(Buffer, SafeBuffer)
  1744. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  1745. if (typeof arg === 'number') {
  1746. throw new TypeError('Argument must not be a number')
  1747. }
  1748. return Buffer(arg, encodingOrOffset, length)
  1749. }
  1750. SafeBuffer.alloc = function (size, fill, encoding) {
  1751. if (typeof size !== 'number') {
  1752. throw new TypeError('Argument must be a number')
  1753. }
  1754. var buf = Buffer(size)
  1755. if (fill !== undefined) {
  1756. if (typeof encoding === 'string') {
  1757. buf.fill(fill, encoding)
  1758. } else {
  1759. buf.fill(fill)
  1760. }
  1761. } else {
  1762. buf.fill(0)
  1763. }
  1764. return buf
  1765. }
  1766. SafeBuffer.allocUnsafe = function (size) {
  1767. if (typeof size !== 'number') {
  1768. throw new TypeError('Argument must be a number')
  1769. }
  1770. return Buffer(size)
  1771. }
  1772. SafeBuffer.allocUnsafeSlow = function (size) {
  1773. if (typeof size !== 'number') {
  1774. throw new TypeError('Argument must be a number')
  1775. }
  1776. return buffer.SlowBuffer(size)
  1777. }
  1778. /***/ }),
  1779. /* 33 */
  1780. /***/ (function(module, exports, __webpack_require__) {
  1781. // Thank's IE8 for his funny defineProperty
  1782. module.exports = !__webpack_require__(85)(function () {
  1783. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  1784. });
  1785. /***/ }),
  1786. /* 34 */
  1787. /***/ (function(module, exports) {
  1788. module.exports = function (it) {
  1789. return typeof it === 'object' ? it !== null : typeof it === 'function';
  1790. };
  1791. /***/ }),
  1792. /* 35 */
  1793. /***/ (function(module, exports) {
  1794. module.exports = {};
  1795. /***/ }),
  1796. /* 36 */
  1797. /***/ (function(module, exports) {
  1798. module.exports = require("os");
  1799. /***/ }),
  1800. /* 37 */,
  1801. /* 38 */,
  1802. /* 39 */,
  1803. /* 40 */
  1804. /***/ (function(module, exports, __webpack_require__) {
  1805. "use strict";
  1806. Object.defineProperty(exports, "__esModule", {
  1807. value: true
  1808. });
  1809. exports.wait = wait;
  1810. exports.promisify = promisify;
  1811. exports.queue = queue;
  1812. function wait(delay) {
  1813. return new Promise(resolve => {
  1814. setTimeout(resolve, delay);
  1815. });
  1816. }
  1817. function promisify(fn, firstData) {
  1818. return function (...args) {
  1819. return new Promise(function (resolve, reject) {
  1820. args.push(function (err, ...result) {
  1821. let res = result;
  1822. if (result.length <= 1) {
  1823. res = result[0];
  1824. }
  1825. if (firstData) {
  1826. res = err;
  1827. err = null;
  1828. }
  1829. if (err) {
  1830. reject(err);
  1831. } else {
  1832. resolve(res);
  1833. }
  1834. });
  1835. fn.apply(null, args);
  1836. });
  1837. };
  1838. }
  1839. function queue(arr, promiseProducer, concurrency = Infinity) {
  1840. concurrency = Math.min(concurrency, arr.length);
  1841. // clone
  1842. arr = arr.slice();
  1843. const results = [];
  1844. let total = arr.length;
  1845. if (!total) {
  1846. return Promise.resolve(results);
  1847. }
  1848. return new Promise((resolve, reject) => {
  1849. for (let i = 0; i < concurrency; i++) {
  1850. next();
  1851. }
  1852. function next() {
  1853. const item = arr.shift();
  1854. const promise = promiseProducer(item);
  1855. promise.then(function (result) {
  1856. results.push(result);
  1857. total--;
  1858. if (total === 0) {
  1859. resolve(results);
  1860. } else {
  1861. if (arr.length) {
  1862. next();
  1863. }
  1864. }
  1865. }, reject);
  1866. }
  1867. });
  1868. }
  1869. /***/ }),
  1870. /* 41 */
  1871. /***/ (function(module, exports, __webpack_require__) {
  1872. var global = __webpack_require__(11);
  1873. var core = __webpack_require__(23);
  1874. var ctx = __webpack_require__(48);
  1875. var hide = __webpack_require__(31);
  1876. var has = __webpack_require__(49);
  1877. var PROTOTYPE = 'prototype';
  1878. var $export = function (type, name, source) {
  1879. var IS_FORCED = type & $export.F;
  1880. var IS_GLOBAL = type & $export.G;
  1881. var IS_STATIC = type & $export.S;
  1882. var IS_PROTO = type & $export.P;
  1883. var IS_BIND = type & $export.B;
  1884. var IS_WRAP = type & $export.W;
  1885. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  1886. var expProto = exports[PROTOTYPE];
  1887. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  1888. var key, own, out;
  1889. if (IS_GLOBAL) source = name;
  1890. for (key in source) {
  1891. // contains in native
  1892. own = !IS_FORCED && target && target[key] !== undefined;
  1893. if (own && has(exports, key)) continue;
  1894. // export native or passed
  1895. out = own ? target[key] : source[key];
  1896. // prevent global pollution for namespaces
  1897. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  1898. // bind timers to global for call from export context
  1899. : IS_BIND && own ? ctx(out, global)
  1900. // wrap global constructors for prevent change them in library
  1901. : IS_WRAP && target[key] == out ? (function (C) {
  1902. var F = function (a, b, c) {
  1903. if (this instanceof C) {
  1904. switch (arguments.length) {
  1905. case 0: return new C();
  1906. case 1: return new C(a);
  1907. case 2: return new C(a, b);
  1908. } return new C(a, b, c);
  1909. } return C.apply(this, arguments);
  1910. };
  1911. F[PROTOTYPE] = C[PROTOTYPE];
  1912. return F;
  1913. // make static versions for prototype methods
  1914. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  1915. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  1916. if (IS_PROTO) {
  1917. (exports.virtual || (exports.virtual = {}))[key] = out;
  1918. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  1919. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  1920. }
  1921. }
  1922. };
  1923. // type bitmap
  1924. $export.F = 1; // forced
  1925. $export.G = 2; // global
  1926. $export.S = 4; // static
  1927. $export.P = 8; // proto
  1928. $export.B = 16; // bind
  1929. $export.W = 32; // wrap
  1930. $export.U = 64; // safe
  1931. $export.R = 128; // real proto method for `library`
  1932. module.exports = $export;
  1933. /***/ }),
  1934. /* 42 */
  1935. /***/ (function(module, exports, __webpack_require__) {
  1936. try {
  1937. var util = __webpack_require__(2);
  1938. if (typeof util.inherits !== 'function') throw '';
  1939. module.exports = util.inherits;
  1940. } catch (e) {
  1941. module.exports = __webpack_require__(224);
  1942. }
  1943. /***/ }),
  1944. /* 43 */,
  1945. /* 44 */,
  1946. /* 45 */
  1947. /***/ (function(module, exports, __webpack_require__) {
  1948. "use strict";
  1949. Object.defineProperty(exports, "__esModule", {
  1950. value: true
  1951. });
  1952. exports.home = undefined;
  1953. var _rootUser;
  1954. function _load_rootUser() {
  1955. return _rootUser = _interopRequireDefault(__webpack_require__(169));
  1956. }
  1957. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1958. const path = __webpack_require__(0);
  1959. const home = exports.home = __webpack_require__(36).homedir();
  1960. const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home;
  1961. exports.default = userHomeDir;
  1962. /***/ }),
  1963. /* 46 */
  1964. /***/ (function(module, exports) {
  1965. module.exports = function (it) {
  1966. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  1967. return it;
  1968. };
  1969. /***/ }),
  1970. /* 47 */
  1971. /***/ (function(module, exports) {
  1972. var toString = {}.toString;
  1973. module.exports = function (it) {
  1974. return toString.call(it).slice(8, -1);
  1975. };
  1976. /***/ }),
  1977. /* 48 */
  1978. /***/ (function(module, exports, __webpack_require__) {
  1979. // optional / simple context binding
  1980. var aFunction = __webpack_require__(46);
  1981. module.exports = function (fn, that, length) {
  1982. aFunction(fn);
  1983. if (that === undefined) return fn;
  1984. switch (length) {
  1985. case 1: return function (a) {
  1986. return fn.call(that, a);
  1987. };
  1988. case 2: return function (a, b) {
  1989. return fn.call(that, a, b);
  1990. };
  1991. case 3: return function (a, b, c) {
  1992. return fn.call(that, a, b, c);
  1993. };
  1994. }
  1995. return function (/* ...args */) {
  1996. return fn.apply(that, arguments);
  1997. };
  1998. };
  1999. /***/ }),
  2000. /* 49 */
  2001. /***/ (function(module, exports) {
  2002. var hasOwnProperty = {}.hasOwnProperty;
  2003. module.exports = function (it, key) {
  2004. return hasOwnProperty.call(it, key);
  2005. };
  2006. /***/ }),
  2007. /* 50 */
  2008. /***/ (function(module, exports, __webpack_require__) {
  2009. var anObject = __webpack_require__(27);
  2010. var IE8_DOM_DEFINE = __webpack_require__(184);
  2011. var toPrimitive = __webpack_require__(201);
  2012. var dP = Object.defineProperty;
  2013. exports.f = __webpack_require__(33) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  2014. anObject(O);
  2015. P = toPrimitive(P, true);
  2016. anObject(Attributes);
  2017. if (IE8_DOM_DEFINE) try {
  2018. return dP(O, P, Attributes);
  2019. } catch (e) { /* empty */ }
  2020. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  2021. if ('value' in Attributes) O[P] = Attributes.value;
  2022. return O;
  2023. };
  2024. /***/ }),
  2025. /* 51 */,
  2026. /* 52 */,
  2027. /* 53 */,
  2028. /* 54 */
  2029. /***/ (function(module, exports) {
  2030. module.exports = require("events");
  2031. /***/ }),
  2032. /* 55 */
  2033. /***/ (function(module, exports, __webpack_require__) {
  2034. "use strict";
  2035. const Buffer = __webpack_require__(32).Buffer
  2036. const crypto = __webpack_require__(9)
  2037. const Transform = __webpack_require__(17).Transform
  2038. const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
  2039. const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i
  2040. const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/
  2041. const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/
  2042. const VCHAR_REGEX = /^[\x21-\x7E]+$/
  2043. class Hash {
  2044. get isHash () { return true }
  2045. constructor (hash, opts) {
  2046. const strict = !!(opts && opts.strict)
  2047. this.source = hash.trim()
  2048. // 3.1. Integrity metadata (called "Hash" by ssri)
  2049. // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description
  2050. const match = this.source.match(
  2051. strict
  2052. ? STRICT_SRI_REGEX
  2053. : SRI_REGEX
  2054. )
  2055. if (!match) { return }
  2056. if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return }
  2057. this.algorithm = match[1]
  2058. this.digest = match[2]
  2059. const rawOpts = match[3]
  2060. this.options = rawOpts ? rawOpts.slice(1).split('?') : []
  2061. }
  2062. hexDigest () {
  2063. return this.digest && Buffer.from(this.digest, 'base64').toString('hex')
  2064. }
  2065. toJSON () {
  2066. return this.toString()
  2067. }
  2068. toString (opts) {
  2069. if (opts && opts.strict) {
  2070. // Strict mode enforces the standard as close to the foot of the
  2071. // letter as it can.
  2072. if (!(
  2073. // The spec has very restricted productions for algorithms.
  2074. // https://www.w3.org/TR/CSP2/#source-list-syntax
  2075. SPEC_ALGORITHMS.some(x => x === this.algorithm) &&
  2076. // Usually, if someone insists on using a "different" base64, we
  2077. // leave it as-is, since there's multiple standards, and the
  2078. // specified is not a URL-safe variant.
  2079. // https://www.w3.org/TR/CSP2/#base64_value
  2080. this.digest.match(BASE64_REGEX) &&
  2081. // Option syntax is strictly visual chars.
  2082. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression
  2083. // https://tools.ietf.org/html/rfc5234#appendix-B.1
  2084. (this.options || []).every(opt => opt.match(VCHAR_REGEX))
  2085. )) {
  2086. return ''
  2087. }
  2088. }
  2089. const options = this.options && this.options.length
  2090. ? `?${this.options.join('?')}`
  2091. : ''
  2092. return `${this.algorithm}-${this.digest}${options}`
  2093. }
  2094. }
  2095. class Integrity {
  2096. get isIntegrity () { return true }
  2097. toJSON () {
  2098. return this.toString()
  2099. }
  2100. toString (opts) {
  2101. opts = opts || {}
  2102. let sep = opts.sep || ' '
  2103. if (opts.strict) {
  2104. // Entries must be separated by whitespace, according to spec.
  2105. sep = sep.replace(/\S+/g, ' ')
  2106. }
  2107. return Object.keys(this).map(k => {
  2108. return this[k].map(hash => {
  2109. return Hash.prototype.toString.call(hash, opts)
  2110. }).filter(x => x.length).join(sep)
  2111. }).filter(x => x.length).join(sep)
  2112. }
  2113. concat (integrity, opts) {
  2114. const other = typeof integrity === 'string'
  2115. ? integrity
  2116. : stringify(integrity, opts)
  2117. return parse(`${this.toString(opts)} ${other}`, opts)
  2118. }
  2119. hexDigest () {
  2120. return parse(this, {single: true}).hexDigest()
  2121. }
  2122. match (integrity, opts) {
  2123. const other = parse(integrity, opts)
  2124. const algo = other.pickAlgorithm(opts)
  2125. return (
  2126. this[algo] &&
  2127. other[algo] &&
  2128. this[algo].find(hash =>
  2129. other[algo].find(otherhash =>
  2130. hash.digest === otherhash.digest
  2131. )
  2132. )
  2133. ) || false
  2134. }
  2135. pickAlgorithm (opts) {
  2136. const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash
  2137. const keys = Object.keys(this)
  2138. if (!keys.length) {
  2139. throw new Error(`No algorithms available for ${
  2140. JSON.stringify(this.toString())
  2141. }`)
  2142. }
  2143. return keys.reduce((acc, algo) => {
  2144. return pickAlgorithm(acc, algo) || acc
  2145. })
  2146. }
  2147. }
  2148. module.exports.parse = parse
  2149. function parse (sri, opts) {
  2150. opts = opts || {}
  2151. if (typeof sri === 'string') {
  2152. return _parse(sri, opts)
  2153. } else if (sri.algorithm && sri.digest) {
  2154. const fullSri = new Integrity()
  2155. fullSri[sri.algorithm] = [sri]
  2156. return _parse(stringify(fullSri, opts), opts)
  2157. } else {
  2158. return _parse(stringify(sri, opts), opts)
  2159. }
  2160. }
  2161. function _parse (integrity, opts) {
  2162. // 3.4.3. Parse metadata
  2163. // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  2164. if (opts.single) {
  2165. return new Hash(integrity, opts)
  2166. }
  2167. return integrity.trim().split(/\s+/).reduce((acc, string) => {
  2168. const hash = new Hash(string, opts)
  2169. if (hash.algorithm && hash.digest) {
  2170. const algo = hash.algorithm
  2171. if (!acc[algo]) { acc[algo] = [] }
  2172. acc[algo].push(hash)
  2173. }
  2174. return acc
  2175. }, new Integrity())
  2176. }
  2177. module.exports.stringify = stringify
  2178. function stringify (obj, opts) {
  2179. if (obj.algorithm && obj.digest) {
  2180. return Hash.prototype.toString.call(obj, opts)
  2181. } else if (typeof obj === 'string') {
  2182. return stringify(parse(obj, opts), opts)
  2183. } else {
  2184. return Integrity.prototype.toString.call(obj, opts)
  2185. }
  2186. }
  2187. module.exports.fromHex = fromHex
  2188. function fromHex (hexDigest, algorithm, opts) {
  2189. const optString = (opts && opts.options && opts.options.length)
  2190. ? `?${opts.options.join('?')}`
  2191. : ''
  2192. return parse(
  2193. `${algorithm}-${
  2194. Buffer.from(hexDigest, 'hex').toString('base64')
  2195. }${optString}`, opts
  2196. )
  2197. }
  2198. module.exports.fromData = fromData
  2199. function fromData (data, opts) {
  2200. opts = opts || {}
  2201. const algorithms = opts.algorithms || ['sha512']
  2202. const optString = opts.options && opts.options.length
  2203. ? `?${opts.options.join('?')}`
  2204. : ''
  2205. return algorithms.reduce((acc, algo) => {
  2206. const digest = crypto.createHash(algo).update(data).digest('base64')
  2207. const hash = new Hash(
  2208. `${algo}-${digest}${optString}`,
  2209. opts
  2210. )
  2211. if (hash.algorithm && hash.digest) {
  2212. const algo = hash.algorithm
  2213. if (!acc[algo]) { acc[algo] = [] }
  2214. acc[algo].push(hash)
  2215. }
  2216. return acc
  2217. }, new Integrity())
  2218. }
  2219. module.exports.fromStream = fromStream
  2220. function fromStream (stream, opts) {
  2221. opts = opts || {}
  2222. const P = opts.Promise || Promise
  2223. const istream = integrityStream(opts)
  2224. return new P((resolve, reject) => {
  2225. stream.pipe(istream)
  2226. stream.on('error', reject)
  2227. istream.on('error', reject)
  2228. let sri
  2229. istream.on('integrity', s => { sri = s })
  2230. istream.on('end', () => resolve(sri))
  2231. istream.on('data', () => {})
  2232. })
  2233. }
  2234. module.exports.checkData = checkData
  2235. function checkData (data, sri, opts) {
  2236. opts = opts || {}
  2237. sri = parse(sri, opts)
  2238. if (!Object.keys(sri).length) {
  2239. if (opts.error) {
  2240. throw Object.assign(
  2241. new Error('No valid integrity hashes to check against'), {
  2242. code: 'EINTEGRITY'
  2243. }
  2244. )
  2245. } else {
  2246. return false
  2247. }
  2248. }
  2249. const algorithm = sri.pickAlgorithm(opts)
  2250. const digest = crypto.createHash(algorithm).update(data).digest('base64')
  2251. const newSri = parse({algorithm, digest})
  2252. const match = newSri.match(sri, opts)
  2253. if (match || !opts.error) {
  2254. return match
  2255. } else if (typeof opts.size === 'number' && (data.length !== opts.size)) {
  2256. const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`)
  2257. err.code = 'EBADSIZE'
  2258. err.found = data.length
  2259. err.expected = opts.size
  2260. err.sri = sri
  2261. throw err
  2262. } else {
  2263. const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`)
  2264. err.code = 'EINTEGRITY'
  2265. err.found = newSri
  2266. err.expected = sri
  2267. err.algorithm = algorithm
  2268. err.sri = sri
  2269. throw err
  2270. }
  2271. }
  2272. module.exports.checkStream = checkStream
  2273. function checkStream (stream, sri, opts) {
  2274. opts = opts || {}
  2275. const P = opts.Promise || Promise
  2276. const checker = integrityStream(Object.assign({}, opts, {
  2277. integrity: sri
  2278. }))
  2279. return new P((resolve, reject) => {
  2280. stream.pipe(checker)
  2281. stream.on('error', reject)
  2282. checker.on('error', reject)
  2283. let sri
  2284. checker.on('verified', s => { sri = s })
  2285. checker.on('end', () => resolve(sri))
  2286. checker.on('data', () => {})
  2287. })
  2288. }
  2289. module.exports.integrityStream = integrityStream
  2290. function integrityStream (opts) {
  2291. opts = opts || {}
  2292. // For verification
  2293. const sri = opts.integrity && parse(opts.integrity, opts)
  2294. const goodSri = sri && Object.keys(sri).length
  2295. const algorithm = goodSri && sri.pickAlgorithm(opts)
  2296. const digests = goodSri && sri[algorithm]
  2297. // Calculating stream
  2298. const algorithms = Array.from(
  2299. new Set(
  2300. (opts.algorithms || ['sha512'])
  2301. .concat(algorithm ? [algorithm] : [])
  2302. )
  2303. )
  2304. const hashes = algorithms.map(crypto.createHash)
  2305. let streamSize = 0
  2306. const stream = new Transform({
  2307. transform (chunk, enc, cb) {
  2308. streamSize += chunk.length
  2309. hashes.forEach(h => h.update(chunk, enc))
  2310. cb(null, chunk, enc)
  2311. }
  2312. }).on('end', () => {
  2313. const optString = (opts.options && opts.options.length)
  2314. ? `?${opts.options.join('?')}`
  2315. : ''
  2316. const newSri = parse(hashes.map((h, i) => {
  2317. return `${algorithms[i]}-${h.digest('base64')}${optString}`
  2318. }).join(' '), opts)
  2319. // Integrity verification mode
  2320. const match = goodSri && newSri.match(sri, opts)
  2321. if (typeof opts.size === 'number' && streamSize !== opts.size) {
  2322. const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`)
  2323. err.code = 'EBADSIZE'
  2324. err.found = streamSize
  2325. err.expected = opts.size
  2326. err.sri = sri
  2327. stream.emit('error', err)
  2328. } else if (opts.integrity && !match) {
  2329. const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`)
  2330. err.code = 'EINTEGRITY'
  2331. err.found = newSri
  2332. err.expected = digests
  2333. err.algorithm = algorithm
  2334. err.sri = sri
  2335. stream.emit('error', err)
  2336. } else {
  2337. stream.emit('size', streamSize)
  2338. stream.emit('integrity', newSri)
  2339. match && stream.emit('verified', match)
  2340. }
  2341. })
  2342. return stream
  2343. }
  2344. module.exports.create = createIntegrity
  2345. function createIntegrity (opts) {
  2346. opts = opts || {}
  2347. const algorithms = opts.algorithms || ['sha512']
  2348. const optString = opts.options && opts.options.length
  2349. ? `?${opts.options.join('?')}`
  2350. : ''
  2351. const hashes = algorithms.map(crypto.createHash)
  2352. return {
  2353. update: function (chunk, enc) {
  2354. hashes.forEach(h => h.update(chunk, enc))
  2355. return this
  2356. },
  2357. digest: function (enc) {
  2358. const integrity = algorithms.reduce((acc, algo) => {
  2359. const digest = hashes.shift().digest('base64')
  2360. const hash = new Hash(
  2361. `${algo}-${digest}${optString}`,
  2362. opts
  2363. )
  2364. if (hash.algorithm && hash.digest) {
  2365. const algo = hash.algorithm
  2366. if (!acc[algo]) { acc[algo] = [] }
  2367. acc[algo].push(hash)
  2368. }
  2369. return acc
  2370. }, new Integrity())
  2371. return integrity
  2372. }
  2373. }
  2374. }
  2375. const NODE_HASHES = new Set(crypto.getHashes())
  2376. // This is a Best Effort™ at a reasonable priority for hash algos
  2377. const DEFAULT_PRIORITY = [
  2378. 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512',
  2379. // TODO - it's unclear _which_ of these Node will actually use as its name
  2380. // for the algorithm, so we guesswork it based on the OpenSSL names.
  2381. 'sha3',
  2382. 'sha3-256', 'sha3-384', 'sha3-512',
  2383. 'sha3_256', 'sha3_384', 'sha3_512'
  2384. ].filter(algo => NODE_HASHES.has(algo))
  2385. function getPrioritizedHash (algo1, algo2) {
  2386. return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase())
  2387. ? algo1
  2388. : algo2
  2389. }
  2390. /***/ }),
  2391. /* 56 */,
  2392. /* 57 */,
  2393. /* 58 */,
  2394. /* 59 */,
  2395. /* 60 */
  2396. /***/ (function(module, exports, __webpack_require__) {
  2397. module.exports = minimatch
  2398. minimatch.Minimatch = Minimatch
  2399. var path = { sep: '/' }
  2400. try {
  2401. path = __webpack_require__(0)
  2402. } catch (er) {}
  2403. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
  2404. var expand = __webpack_require__(175)
  2405. var plTypes = {
  2406. '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  2407. '?': { open: '(?:', close: ')?' },
  2408. '+': { open: '(?:', close: ')+' },
  2409. '*': { open: '(?:', close: ')*' },
  2410. '@': { open: '(?:', close: ')' }
  2411. }
  2412. // any single thing other than /
  2413. // don't need to escape / when using new RegExp()
  2414. var qmark = '[^/]'
  2415. // * => any number of characters
  2416. var star = qmark + '*?'
  2417. // ** when dots are allowed. Anything goes, except .. and .
  2418. // not (^ or / followed by one or two dots followed by $ or /),
  2419. // followed by anything, any number of times.
  2420. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
  2421. // not a ^ or / followed by a dot,
  2422. // followed by anything, any number of times.
  2423. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
  2424. // characters that need to be escaped in RegExp.
  2425. var reSpecials = charSet('().*{}+?[]^$\\!')
  2426. // "abc" -> { a:true, b:true, c:true }
  2427. function charSet (s) {
  2428. return s.split('').reduce(function (set, c) {
  2429. set[c] = true
  2430. return set
  2431. }, {})
  2432. }
  2433. // normalizes slashes.
  2434. var slashSplit = /\/+/
  2435. minimatch.filter = filter
  2436. function filter (pattern, options) {
  2437. options = options || {}
  2438. return function (p, i, list) {
  2439. return minimatch(p, pattern, options)
  2440. }
  2441. }
  2442. function ext (a, b) {
  2443. a = a || {}
  2444. b = b || {}
  2445. var t = {}
  2446. Object.keys(b).forEach(function (k) {
  2447. t[k] = b[k]
  2448. })
  2449. Object.keys(a).forEach(function (k) {
  2450. t[k] = a[k]
  2451. })
  2452. return t
  2453. }
  2454. minimatch.defaults = function (def) {
  2455. if (!def || !Object.keys(def).length) return minimatch
  2456. var orig = minimatch
  2457. var m = function minimatch (p, pattern, options) {
  2458. return orig.minimatch(p, pattern, ext(def, options))
  2459. }
  2460. m.Minimatch = function Minimatch (pattern, options) {
  2461. return new orig.Minimatch(pattern, ext(def, options))
  2462. }
  2463. return m
  2464. }
  2465. Minimatch.defaults = function (def) {
  2466. if (!def || !Object.keys(def).length) return Minimatch
  2467. return minimatch.defaults(def).Minimatch
  2468. }
  2469. function minimatch (p, pattern, options) {
  2470. if (typeof pattern !== 'string') {
  2471. throw new TypeError('glob pattern string required')
  2472. }
  2473. if (!options) options = {}
  2474. // shortcut: comments match nothing.
  2475. if (!options.nocomment && pattern.charAt(0) === '#') {
  2476. return false
  2477. }
  2478. // "" only matches ""
  2479. if (pattern.trim() === '') return p === ''
  2480. return new Minimatch(pattern, options).match(p)
  2481. }
  2482. function Minimatch (pattern, options) {
  2483. if (!(this instanceof Minimatch)) {
  2484. return new Minimatch(pattern, options)
  2485. }
  2486. if (typeof pattern !== 'string') {
  2487. throw new TypeError('glob pattern string required')
  2488. }
  2489. if (!options) options = {}
  2490. pattern = pattern.trim()
  2491. // windows support: need to use /, not \
  2492. if (path.sep !== '/') {
  2493. pattern = pattern.split(path.sep).join('/')
  2494. }
  2495. this.options = options
  2496. this.set = []
  2497. this.pattern = pattern
  2498. this.regexp = null
  2499. this.negate = false
  2500. this.comment = false
  2501. this.empty = false
  2502. // make the set of regexps etc.
  2503. this.make()
  2504. }
  2505. Minimatch.prototype.debug = function () {}
  2506. Minimatch.prototype.make = make
  2507. function make () {
  2508. // don't do it more than once.
  2509. if (this._made) return
  2510. var pattern = this.pattern
  2511. var options = this.options
  2512. // empty patterns and comments match nothing.
  2513. if (!options.nocomment && pattern.charAt(0) === '#') {
  2514. this.comment = true
  2515. return
  2516. }
  2517. if (!pattern) {
  2518. this.empty = true
  2519. return
  2520. }
  2521. // step 1: figure out negation, etc.
  2522. this.parseNegate()
  2523. // step 2: expand braces
  2524. var set = this.globSet = this.braceExpand()
  2525. if (options.debug) this.debug = console.error
  2526. this.debug(this.pattern, set)
  2527. // step 3: now we have a set, so turn each one into a series of path-portion
  2528. // matching patterns.
  2529. // These will be regexps, except in the case of "**", which is
  2530. // set to the GLOBSTAR object for globstar behavior,
  2531. // and will not contain any / characters
  2532. set = this.globParts = set.map(function (s) {
  2533. return s.split(slashSplit)
  2534. })
  2535. this.debug(this.pattern, set)
  2536. // glob --> regexps
  2537. set = set.map(function (s, si, set) {
  2538. return s.map(this.parse, this)
  2539. }, this)
  2540. this.debug(this.pattern, set)
  2541. // filter out everything that didn't compile properly.
  2542. set = set.filter(function (s) {
  2543. return s.indexOf(false) === -1
  2544. })
  2545. this.debug(this.pattern, set)
  2546. this.set = set
  2547. }
  2548. Minimatch.prototype.parseNegate = parseNegate
  2549. function parseNegate () {
  2550. var pattern = this.pattern
  2551. var negate = false
  2552. var options = this.options
  2553. var negateOffset = 0
  2554. if (options.nonegate) return
  2555. for (var i = 0, l = pattern.length
  2556. ; i < l && pattern.charAt(i) === '!'
  2557. ; i++) {
  2558. negate = !negate
  2559. negateOffset++
  2560. }
  2561. if (negateOffset) this.pattern = pattern.substr(negateOffset)
  2562. this.negate = negate
  2563. }
  2564. // Brace expansion:
  2565. // a{b,c}d -> abd acd
  2566. // a{b,}c -> abc ac
  2567. // a{0..3}d -> a0d a1d a2d a3d
  2568. // a{b,c{d,e}f}g -> abg acdfg acefg
  2569. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  2570. //
  2571. // Invalid sets are not expanded.
  2572. // a{2..}b -> a{2..}b
  2573. // a{b}c -> a{b}c
  2574. minimatch.braceExpand = function (pattern, options) {
  2575. return braceExpand(pattern, options)
  2576. }
  2577. Minimatch.prototype.braceExpand = braceExpand
  2578. function braceExpand (pattern, options) {
  2579. if (!options) {
  2580. if (this instanceof Minimatch) {
  2581. options = this.options
  2582. } else {
  2583. options = {}
  2584. }
  2585. }
  2586. pattern = typeof pattern === 'undefined'
  2587. ? this.pattern : pattern
  2588. if (typeof pattern === 'undefined') {
  2589. throw new TypeError('undefined pattern')
  2590. }
  2591. if (options.nobrace ||
  2592. !pattern.match(/\{.*\}/)) {
  2593. // shortcut. no need to expand.
  2594. return [pattern]
  2595. }
  2596. return expand(pattern)
  2597. }
  2598. // parse a component of the expanded set.
  2599. // At this point, no pattern may contain "/" in it
  2600. // so we're going to return a 2d array, where each entry is the full
  2601. // pattern, split on '/', and then turned into a regular expression.
  2602. // A regexp is made at the end which joins each array with an
  2603. // escaped /, and another full one which joins each regexp with |.
  2604. //
  2605. // Following the lead of Bash 4.1, note that "**" only has special meaning
  2606. // when it is the *only* thing in a path portion. Otherwise, any series
  2607. // of * is equivalent to a single *. Globstar behavior is enabled by
  2608. // default, and can be disabled by setting options.noglobstar.
  2609. Minimatch.prototype.parse = parse
  2610. var SUBPARSE = {}
  2611. function parse (pattern, isSub) {
  2612. if (pattern.length > 1024 * 64) {
  2613. throw new TypeError('pattern is too long')
  2614. }
  2615. var options = this.options
  2616. // shortcuts
  2617. if (!options.noglobstar && pattern === '**') return GLOBSTAR
  2618. if (pattern === '') return ''
  2619. var re = ''
  2620. var hasMagic = !!options.nocase
  2621. var escaping = false
  2622. // ? => one single character
  2623. var patternListStack = []
  2624. var negativeLists = []
  2625. var stateChar
  2626. var inClass = false
  2627. var reClassStart = -1
  2628. var classStart = -1
  2629. // . and .. never match anything that doesn't start with .,
  2630. // even when options.dot is set.
  2631. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  2632. // not (start or / followed by . or .. followed by / or end)
  2633. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  2634. : '(?!\\.)'
  2635. var self = this
  2636. function clearStateChar () {
  2637. if (stateChar) {
  2638. // we had some state-tracking character
  2639. // that wasn't consumed by this pass.
  2640. switch (stateChar) {
  2641. case '*':
  2642. re += star
  2643. hasMagic = true
  2644. break
  2645. case '?':
  2646. re += qmark
  2647. hasMagic = true
  2648. break
  2649. default:
  2650. re += '\\' + stateChar
  2651. break
  2652. }
  2653. self.debug('clearStateChar %j %j', stateChar, re)
  2654. stateChar = false
  2655. }
  2656. }
  2657. for (var i = 0, len = pattern.length, c
  2658. ; (i < len) && (c = pattern.charAt(i))
  2659. ; i++) {
  2660. this.debug('%s\t%s %s %j', pattern, i, re, c)
  2661. // skip over any that are escaped.
  2662. if (escaping && reSpecials[c]) {
  2663. re += '\\' + c
  2664. escaping = false
  2665. continue
  2666. }
  2667. switch (c) {
  2668. case '/':
  2669. // completely not allowed, even escaped.
  2670. // Should already be path-split by now.
  2671. return false
  2672. case '\\':
  2673. clearStateChar()
  2674. escaping = true
  2675. continue
  2676. // the various stateChar values
  2677. // for the "extglob" stuff.
  2678. case '?':
  2679. case '*':
  2680. case '+':
  2681. case '@':
  2682. case '!':
  2683. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
  2684. // all of those are literals inside a class, except that
  2685. // the glob [!a] means [^a] in regexp
  2686. if (inClass) {
  2687. this.debug(' in class')
  2688. if (c === '!' && i === classStart + 1) c = '^'
  2689. re += c
  2690. continue
  2691. }
  2692. // if we already have a stateChar, then it means
  2693. // that there was something like ** or +? in there.
  2694. // Handle the stateChar, then proceed with this one.
  2695. self.debug('call clearStateChar %j', stateChar)
  2696. clearStateChar()
  2697. stateChar = c
  2698. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  2699. // just clear the statechar *now*, rather than even diving into
  2700. // the patternList stuff.
  2701. if (options.noext) clearStateChar()
  2702. continue
  2703. case '(':
  2704. if (inClass) {
  2705. re += '('
  2706. continue
  2707. }
  2708. if (!stateChar) {
  2709. re += '\\('
  2710. continue
  2711. }
  2712. patternListStack.push({
  2713. type: stateChar,
  2714. start: i - 1,
  2715. reStart: re.length,
  2716. open: plTypes[stateChar].open,
  2717. close: plTypes[stateChar].close
  2718. })
  2719. // negation is (?:(?!js)[^/]*)
  2720. re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
  2721. this.debug('plType %j %j', stateChar, re)
  2722. stateChar = false
  2723. continue
  2724. case ')':
  2725. if (inClass || !patternListStack.length) {
  2726. re += '\\)'
  2727. continue
  2728. }
  2729. clearStateChar()
  2730. hasMagic = true
  2731. var pl = patternListStack.pop()
  2732. // negation is (?:(?!js)[^/]*)
  2733. // The others are (?:<pattern>)<type>
  2734. re += pl.close
  2735. if (pl.type === '!') {
  2736. negativeLists.push(pl)
  2737. }
  2738. pl.reEnd = re.length
  2739. continue
  2740. case '|':
  2741. if (inClass || !patternListStack.length || escaping) {
  2742. re += '\\|'
  2743. escaping = false
  2744. continue
  2745. }
  2746. clearStateChar()
  2747. re += '|'
  2748. continue
  2749. // these are mostly the same in regexp and glob
  2750. case '[':
  2751. // swallow any state-tracking char before the [
  2752. clearStateChar()
  2753. if (inClass) {
  2754. re += '\\' + c
  2755. continue
  2756. }
  2757. inClass = true
  2758. classStart = i
  2759. reClassStart = re.length
  2760. re += c
  2761. continue
  2762. case ']':
  2763. // a right bracket shall lose its special
  2764. // meaning and represent itself in
  2765. // a bracket expression if it occurs
  2766. // first in the list. -- POSIX.2 2.8.3.2
  2767. if (i === classStart + 1 || !inClass) {
  2768. re += '\\' + c
  2769. escaping = false
  2770. continue
  2771. }
  2772. // handle the case where we left a class open.
  2773. // "[z-a]" is valid, equivalent to "\[z-a\]"
  2774. if (inClass) {
  2775. // split where the last [ was, make sure we don't have
  2776. // an invalid re. if so, re-walk the contents of the
  2777. // would-be class to re-translate any characters that
  2778. // were passed through as-is
  2779. // TODO: It would probably be faster to determine this
  2780. // without a try/catch and a new RegExp, but it's tricky
  2781. // to do safely. For now, this is safe and works.
  2782. var cs = pattern.substring(classStart + 1, i)
  2783. try {
  2784. RegExp('[' + cs + ']')
  2785. } catch (er) {
  2786. // not a valid class!
  2787. var sp = this.parse(cs, SUBPARSE)
  2788. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
  2789. hasMagic = hasMagic || sp[1]
  2790. inClass = false
  2791. continue
  2792. }
  2793. }
  2794. // finish up the class.
  2795. hasMagic = true
  2796. inClass = false
  2797. re += c
  2798. continue
  2799. default:
  2800. // swallow any state char that wasn't consumed
  2801. clearStateChar()
  2802. if (escaping) {
  2803. // no need
  2804. escaping = false
  2805. } else if (reSpecials[c]
  2806. && !(c === '^' && inClass)) {
  2807. re += '\\'
  2808. }
  2809. re += c
  2810. } // switch
  2811. } // for
  2812. // handle the case where we left a class open.
  2813. // "[abc" is valid, equivalent to "\[abc"
  2814. if (inClass) {
  2815. // split where the last [ was, and escape it
  2816. // this is a huge pita. We now have to re-walk
  2817. // the contents of the would-be class to re-translate
  2818. // any characters that were passed through as-is
  2819. cs = pattern.substr(classStart + 1)
  2820. sp = this.parse(cs, SUBPARSE)
  2821. re = re.substr(0, reClassStart) + '\\[' + sp[0]
  2822. hasMagic = hasMagic || sp[1]
  2823. }
  2824. // handle the case where we had a +( thing at the *end*
  2825. // of the pattern.
  2826. // each pattern list stack adds 3 chars, and we need to go through
  2827. // and escape any | chars that were passed through as-is for the regexp.
  2828. // Go through and escape them, taking care not to double-escape any
  2829. // | chars that were already escaped.
  2830. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  2831. var tail = re.slice(pl.reStart + pl.open.length)
  2832. this.debug('setting tail', re, pl)
  2833. // maybe some even number of \, then maybe 1 \, followed by a |
  2834. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  2835. if (!$2) {
  2836. // the | isn't already escaped, so escape it.
  2837. $2 = '\\'
  2838. }
  2839. // need to escape all those slashes *again*, without escaping the
  2840. // one that we need for escaping the | character. As it works out,
  2841. // escaping an even number of slashes can be done by simply repeating
  2842. // it exactly after itself. That's why this trick works.
  2843. //
  2844. // I am sorry that you have to see this.
  2845. return $1 + $1 + $2 + '|'
  2846. })
  2847. this.debug('tail=%j\n %s', tail, tail, pl, re)
  2848. var t = pl.type === '*' ? star
  2849. : pl.type === '?' ? qmark
  2850. : '\\' + pl.type
  2851. hasMagic = true
  2852. re = re.slice(0, pl.reStart) + t + '\\(' + tail
  2853. }
  2854. // handle trailing things that only matter at the very end.
  2855. clearStateChar()
  2856. if (escaping) {
  2857. // trailing \\
  2858. re += '\\\\'
  2859. }
  2860. // only need to apply the nodot start if the re starts with
  2861. // something that could conceivably capture a dot
  2862. var addPatternStart = false
  2863. switch (re.charAt(0)) {
  2864. case '.':
  2865. case '[':
  2866. case '(': addPatternStart = true
  2867. }
  2868. // Hack to work around lack of negative lookbehind in JS
  2869. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  2870. // like 'a.xyz.yz' doesn't match. So, the first negative
  2871. // lookahead, has to look ALL the way ahead, to the end of
  2872. // the pattern.
  2873. for (var n = negativeLists.length - 1; n > -1; n--) {
  2874. var nl = negativeLists[n]
  2875. var nlBefore = re.slice(0, nl.reStart)
  2876. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
  2877. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
  2878. var nlAfter = re.slice(nl.reEnd)
  2879. nlLast += nlAfter
  2880. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  2881. // mean that we should *not* include the ) in the bit that is considered
  2882. // "after" the negated section.
  2883. var openParensBefore = nlBefore.split('(').length - 1
  2884. var cleanAfter = nlAfter
  2885. for (i = 0; i < openParensBefore; i++) {
  2886. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
  2887. }
  2888. nlAfter = cleanAfter
  2889. var dollar = ''
  2890. if (nlAfter === '' && isSub !== SUBPARSE) {
  2891. dollar = '$'
  2892. }
  2893. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
  2894. re = newRe
  2895. }
  2896. // if the re is not "" at this point, then we need to make sure
  2897. // it doesn't match against an empty path part.
  2898. // Otherwise a/* will match a/, which it should not.
  2899. if (re !== '' && hasMagic) {
  2900. re = '(?=.)' + re
  2901. }
  2902. if (addPatternStart) {
  2903. re = patternStart + re
  2904. }
  2905. // parsing just a piece of a larger pattern.
  2906. if (isSub === SUBPARSE) {
  2907. return [re, hasMagic]
  2908. }
  2909. // skip the regexp for non-magical patterns
  2910. // unescape anything in it, though, so that it'll be
  2911. // an exact match against a file etc.
  2912. if (!hasMagic) {
  2913. return globUnescape(pattern)
  2914. }
  2915. var flags = options.nocase ? 'i' : ''
  2916. try {
  2917. var regExp = new RegExp('^' + re + '$', flags)
  2918. } catch (er) {
  2919. // If it was an invalid regular expression, then it can't match
  2920. // anything. This trick looks for a character after the end of
  2921. // the string, which is of course impossible, except in multi-line
  2922. // mode, but it's not a /m regex.
  2923. return new RegExp('$.')
  2924. }
  2925. regExp._glob = pattern
  2926. regExp._src = re
  2927. return regExp
  2928. }
  2929. minimatch.makeRe = function (pattern, options) {
  2930. return new Minimatch(pattern, options || {}).makeRe()
  2931. }
  2932. Minimatch.prototype.makeRe = makeRe
  2933. function makeRe () {
  2934. if (this.regexp || this.regexp === false) return this.regexp
  2935. // at this point, this.set is a 2d array of partial
  2936. // pattern strings, or "**".
  2937. //
  2938. // It's better to use .match(). This function shouldn't
  2939. // be used, really, but it's pretty convenient sometimes,
  2940. // when you just want to work with a regex.
  2941. var set = this.set
  2942. if (!set.length) {
  2943. this.regexp = false
  2944. return this.regexp
  2945. }
  2946. var options = this.options
  2947. var twoStar = options.noglobstar ? star
  2948. : options.dot ? twoStarDot
  2949. : twoStarNoDot
  2950. var flags = options.nocase ? 'i' : ''
  2951. var re = set.map(function (pattern) {
  2952. return pattern.map(function (p) {
  2953. return (p === GLOBSTAR) ? twoStar
  2954. : (typeof p === 'string') ? regExpEscape(p)
  2955. : p._src
  2956. }).join('\\\/')
  2957. }).join('|')
  2958. // must match entire pattern
  2959. // ending in a * or ** will make it less strict.
  2960. re = '^(?:' + re + ')$'
  2961. // can match anything, as long as it's not this.
  2962. if (this.negate) re = '^(?!' + re + ').*$'
  2963. try {
  2964. this.regexp = new RegExp(re, flags)
  2965. } catch (ex) {
  2966. this.regexp = false
  2967. }
  2968. return this.regexp
  2969. }
  2970. minimatch.match = function (list, pattern, options) {
  2971. options = options || {}
  2972. var mm = new Minimatch(pattern, options)
  2973. list = list.filter(function (f) {
  2974. return mm.match(f)
  2975. })
  2976. if (mm.options.nonull && !list.length) {
  2977. list.push(pattern)
  2978. }
  2979. return list
  2980. }
  2981. Minimatch.prototype.match = match
  2982. function match (f, partial) {
  2983. this.debug('match', f, this.pattern)
  2984. // short-circuit in the case of busted things.
  2985. // comments, etc.
  2986. if (this.comment) return false
  2987. if (this.empty) return f === ''
  2988. if (f === '/' && partial) return true
  2989. var options = this.options
  2990. // windows: need to use /, not \
  2991. if (path.sep !== '/') {
  2992. f = f.split(path.sep).join('/')
  2993. }
  2994. // treat the test path as a set of pathparts.
  2995. f = f.split(slashSplit)
  2996. this.debug(this.pattern, 'split', f)
  2997. // just ONE of the pattern sets in this.set needs to match
  2998. // in order for it to be valid. If negating, then just one
  2999. // match means that we have failed.
  3000. // Either way, return on the first hit.
  3001. var set = this.set
  3002. this.debug(this.pattern, 'set', set)
  3003. // Find the basename of the path by looking for the last non-empty segment
  3004. var filename
  3005. var i
  3006. for (i = f.length - 1; i >= 0; i--) {
  3007. filename = f[i]
  3008. if (filename) break
  3009. }
  3010. for (i = 0; i < set.length; i++) {
  3011. var pattern = set[i]
  3012. var file = f
  3013. if (options.matchBase && pattern.length === 1) {
  3014. file = [filename]
  3015. }
  3016. var hit = this.matchOne(file, pattern, partial)
  3017. if (hit) {
  3018. if (options.flipNegate) return true
  3019. return !this.negate
  3020. }
  3021. }
  3022. // didn't get any hits. this is success if it's a negative
  3023. // pattern, failure otherwise.
  3024. if (options.flipNegate) return false
  3025. return this.negate
  3026. }
  3027. // set partial to true to test if, for example,
  3028. // "/a/b" matches the start of "/*/b/*/d"
  3029. // Partial means, if you run out of file before you run
  3030. // out of pattern, then that's fine, as long as all
  3031. // the parts match.
  3032. Minimatch.prototype.matchOne = function (file, pattern, partial) {
  3033. var options = this.options
  3034. this.debug('matchOne',
  3035. { 'this': this, file: file, pattern: pattern })
  3036. this.debug('matchOne', file.length, pattern.length)
  3037. for (var fi = 0,
  3038. pi = 0,
  3039. fl = file.length,
  3040. pl = pattern.length
  3041. ; (fi < fl) && (pi < pl)
  3042. ; fi++, pi++) {
  3043. this.debug('matchOne loop')
  3044. var p = pattern[pi]
  3045. var f = file[fi]
  3046. this.debug(pattern, p, f)
  3047. // should be impossible.
  3048. // some invalid regexp stuff in the set.
  3049. if (p === false) return false
  3050. if (p === GLOBSTAR) {
  3051. this.debug('GLOBSTAR', [pattern, p, f])
  3052. // "**"
  3053. // a/**/b/**/c would match the following:
  3054. // a/b/x/y/z/c
  3055. // a/x/y/z/b/c
  3056. // a/b/x/b/x/c
  3057. // a/b/c
  3058. // To do this, take the rest of the pattern after
  3059. // the **, and see if it would match the file remainder.
  3060. // If so, return success.
  3061. // If not, the ** "swallows" a segment, and try again.
  3062. // This is recursively awful.
  3063. //
  3064. // a/**/b/**/c matching a/b/x/y/z/c
  3065. // - a matches a
  3066. // - doublestar
  3067. // - matchOne(b/x/y/z/c, b/**/c)
  3068. // - b matches b
  3069. // - doublestar
  3070. // - matchOne(x/y/z/c, c) -> no
  3071. // - matchOne(y/z/c, c) -> no
  3072. // - matchOne(z/c, c) -> no
  3073. // - matchOne(c, c) yes, hit
  3074. var fr = fi
  3075. var pr = pi + 1
  3076. if (pr === pl) {
  3077. this.debug('** at the end')
  3078. // a ** at the end will just swallow the rest.
  3079. // We have found a match.
  3080. // however, it will not swallow /.x, unless
  3081. // options.dot is set.
  3082. // . and .. are *never* matched by **, for explosively
  3083. // exponential reasons.
  3084. for (; fi < fl; fi++) {
  3085. if (file[fi] === '.' || file[fi] === '..' ||
  3086. (!options.dot && file[fi].charAt(0) === '.')) return false
  3087. }
  3088. return true
  3089. }
  3090. // ok, let's see if we can swallow whatever we can.
  3091. while (fr < fl) {
  3092. var swallowee = file[fr]
  3093. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
  3094. // XXX remove this slice. Just pass the start index.
  3095. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  3096. this.debug('globstar found match!', fr, fl, swallowee)
  3097. // found a match.
  3098. return true
  3099. } else {
  3100. // can't swallow "." or ".." ever.
  3101. // can only swallow ".foo" when explicitly asked.
  3102. if (swallowee === '.' || swallowee === '..' ||
  3103. (!options.dot && swallowee.charAt(0) === '.')) {
  3104. this.debug('dot detected!', file, fr, pattern, pr)
  3105. break
  3106. }
  3107. // ** swallows a segment, and continue.
  3108. this.debug('globstar swallow a segment, and continue')
  3109. fr++
  3110. }
  3111. }
  3112. // no match was found.
  3113. // However, in partial mode, we can't say this is necessarily over.
  3114. // If there's more *pattern* left, then
  3115. if (partial) {
  3116. // ran out of file
  3117. this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
  3118. if (fr === fl) return true
  3119. }
  3120. return false
  3121. }
  3122. // something other than **
  3123. // non-magic patterns just have to match exactly
  3124. // patterns with magic have been turned into regexps.
  3125. var hit
  3126. if (typeof p === 'string') {
  3127. if (options.nocase) {
  3128. hit = f.toLowerCase() === p.toLowerCase()
  3129. } else {
  3130. hit = f === p
  3131. }
  3132. this.debug('string match', p, f, hit)
  3133. } else {
  3134. hit = f.match(p)
  3135. this.debug('pattern match', p, f, hit)
  3136. }
  3137. if (!hit) return false
  3138. }
  3139. // Note: ending in / means that we'll get a final ""
  3140. // at the end of the pattern. This can only match a
  3141. // corresponding "" at the end of the file.
  3142. // If the file ends in /, then it can only match a
  3143. // a pattern that ends in /, unless the pattern just
  3144. // doesn't have any more for it. But, a/b/ should *not*
  3145. // match "a/b/*", even though "" matches against the
  3146. // [^/]*? pattern, except in partial mode, where it might
  3147. // simply not be reached yet.
  3148. // However, a/b/ should still satisfy a/*
  3149. // now either we fell off the end of the pattern, or we're done.
  3150. if (fi === fl && pi === pl) {
  3151. // ran out of pattern and filename at the same time.
  3152. // an exact hit!
  3153. return true
  3154. } else if (fi === fl) {
  3155. // ran out of file, but still had pattern left.
  3156. // this is ok if we're doing the match as part of
  3157. // a glob fs traversal.
  3158. return partial
  3159. } else if (pi === pl) {
  3160. // ran out of pattern, still have file left.
  3161. // this is only acceptable if we're on the very last
  3162. // empty segment of a file with a trailing slash.
  3163. // a/* should match a/b/
  3164. var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
  3165. return emptyFileEnd
  3166. }
  3167. // should be unreachable.
  3168. throw new Error('wtf?')
  3169. }
  3170. // replace stuff like \* with *
  3171. function globUnescape (s) {
  3172. return s.replace(/\\(.)/g, '$1')
  3173. }
  3174. function regExpEscape (s) {
  3175. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
  3176. }
  3177. /***/ }),
  3178. /* 61 */
  3179. /***/ (function(module, exports, __webpack_require__) {
  3180. var wrappy = __webpack_require__(123)
  3181. module.exports = wrappy(once)
  3182. module.exports.strict = wrappy(onceStrict)
  3183. once.proto = once(function () {
  3184. Object.defineProperty(Function.prototype, 'once', {
  3185. value: function () {
  3186. return once(this)
  3187. },
  3188. configurable: true
  3189. })
  3190. Object.defineProperty(Function.prototype, 'onceStrict', {
  3191. value: function () {
  3192. return onceStrict(this)
  3193. },
  3194. configurable: true
  3195. })
  3196. })
  3197. function once (fn) {
  3198. var f = function () {
  3199. if (f.called) return f.value
  3200. f.called = true
  3201. return f.value = fn.apply(this, arguments)
  3202. }
  3203. f.called = false
  3204. return f
  3205. }
  3206. function onceStrict (fn) {
  3207. var f = function () {
  3208. if (f.called)
  3209. throw new Error(f.onceError)
  3210. f.called = true
  3211. return f.value = fn.apply(this, arguments)
  3212. }
  3213. var name = fn.name || 'Function wrapped with `once`'
  3214. f.onceError = name + " shouldn't be called more than once"
  3215. f.called = false
  3216. return f
  3217. }
  3218. /***/ }),
  3219. /* 62 */,
  3220. /* 63 */
  3221. /***/ (function(module, exports) {
  3222. module.exports = require("buffer");
  3223. /***/ }),
  3224. /* 64 */,
  3225. /* 65 */,
  3226. /* 66 */,
  3227. /* 67 */
  3228. /***/ (function(module, exports) {
  3229. // 7.2.1 RequireObjectCoercible(argument)
  3230. module.exports = function (it) {
  3231. if (it == undefined) throw TypeError("Can't call method on " + it);
  3232. return it;
  3233. };
  3234. /***/ }),
  3235. /* 68 */
  3236. /***/ (function(module, exports, __webpack_require__) {
  3237. var isObject = __webpack_require__(34);
  3238. var document = __webpack_require__(11).document;
  3239. // typeof document.createElement is 'object' in old IE
  3240. var is = isObject(document) && isObject(document.createElement);
  3241. module.exports = function (it) {
  3242. return is ? document.createElement(it) : {};
  3243. };
  3244. /***/ }),
  3245. /* 69 */
  3246. /***/ (function(module, exports) {
  3247. module.exports = true;
  3248. /***/ }),
  3249. /* 70 */
  3250. /***/ (function(module, exports, __webpack_require__) {
  3251. "use strict";
  3252. // 25.4.1.5 NewPromiseCapability(C)
  3253. var aFunction = __webpack_require__(46);
  3254. function PromiseCapability(C) {
  3255. var resolve, reject;
  3256. this.promise = new C(function ($$resolve, $$reject) {
  3257. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  3258. resolve = $$resolve;
  3259. reject = $$reject;
  3260. });
  3261. this.resolve = aFunction(resolve);
  3262. this.reject = aFunction(reject);
  3263. }
  3264. module.exports.f = function (C) {
  3265. return new PromiseCapability(C);
  3266. };
  3267. /***/ }),
  3268. /* 71 */
  3269. /***/ (function(module, exports, __webpack_require__) {
  3270. var def = __webpack_require__(50).f;
  3271. var has = __webpack_require__(49);
  3272. var TAG = __webpack_require__(13)('toStringTag');
  3273. module.exports = function (it, tag, stat) {
  3274. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  3275. };
  3276. /***/ }),
  3277. /* 72 */
  3278. /***/ (function(module, exports, __webpack_require__) {
  3279. var shared = __webpack_require__(107)('keys');
  3280. var uid = __webpack_require__(111);
  3281. module.exports = function (key) {
  3282. return shared[key] || (shared[key] = uid(key));
  3283. };
  3284. /***/ }),
  3285. /* 73 */
  3286. /***/ (function(module, exports) {
  3287. // 7.1.4 ToInteger
  3288. var ceil = Math.ceil;
  3289. var floor = Math.floor;
  3290. module.exports = function (it) {
  3291. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  3292. };
  3293. /***/ }),
  3294. /* 74 */
  3295. /***/ (function(module, exports, __webpack_require__) {
  3296. // to indexed object, toObject with fallback for non-array-like ES3 strings
  3297. var IObject = __webpack_require__(131);
  3298. var defined = __webpack_require__(67);
  3299. module.exports = function (it) {
  3300. return IObject(defined(it));
  3301. };
  3302. /***/ }),
  3303. /* 75 */
  3304. /***/ (function(module, exports, __webpack_require__) {
  3305. // Approach:
  3306. //
  3307. // 1. Get the minimatch set
  3308. // 2. For each pattern in the set, PROCESS(pattern, false)
  3309. // 3. Store matches per-set, then uniq them
  3310. //
  3311. // PROCESS(pattern, inGlobStar)
  3312. // Get the first [n] items from pattern that are all strings
  3313. // Join these together. This is PREFIX.
  3314. // If there is no more remaining, then stat(PREFIX) and
  3315. // add to matches if it succeeds. END.
  3316. //
  3317. // If inGlobStar and PREFIX is symlink and points to dir
  3318. // set ENTRIES = []
  3319. // else readdir(PREFIX) as ENTRIES
  3320. // If fail, END
  3321. //
  3322. // with ENTRIES
  3323. // If pattern[n] is GLOBSTAR
  3324. // // handle the case where the globstar match is empty
  3325. // // by pruning it out, and testing the resulting pattern
  3326. // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
  3327. // // handle other cases.
  3328. // for ENTRY in ENTRIES (not dotfiles)
  3329. // // attach globstar + tail onto the entry
  3330. // // Mark that this entry is a globstar match
  3331. // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
  3332. //
  3333. // else // not globstar
  3334. // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
  3335. // Test ENTRY against pattern[n]
  3336. // If fails, continue
  3337. // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
  3338. //
  3339. // Caveat:
  3340. // Cache all stats and readdirs results to minimize syscall. Since all
  3341. // we ever care about is existence and directory-ness, we can just keep
  3342. // `true` for files, and [children,...] for directories, or `false` for
  3343. // things that don't exist.
  3344. module.exports = glob
  3345. var fs = __webpack_require__(3)
  3346. var rp = __webpack_require__(114)
  3347. var minimatch = __webpack_require__(60)
  3348. var Minimatch = minimatch.Minimatch
  3349. var inherits = __webpack_require__(42)
  3350. var EE = __webpack_require__(54).EventEmitter
  3351. var path = __webpack_require__(0)
  3352. var assert = __webpack_require__(22)
  3353. var isAbsolute = __webpack_require__(76)
  3354. var globSync = __webpack_require__(218)
  3355. var common = __webpack_require__(115)
  3356. var alphasort = common.alphasort
  3357. var alphasorti = common.alphasorti
  3358. var setopts = common.setopts
  3359. var ownProp = common.ownProp
  3360. var inflight = __webpack_require__(223)
  3361. var util = __webpack_require__(2)
  3362. var childrenIgnored = common.childrenIgnored
  3363. var isIgnored = common.isIgnored
  3364. var once = __webpack_require__(61)
  3365. function glob (pattern, options, cb) {
  3366. if (typeof options === 'function') cb = options, options = {}
  3367. if (!options) options = {}
  3368. if (options.sync) {
  3369. if (cb)
  3370. throw new TypeError('callback provided to sync glob')
  3371. return globSync(pattern, options)
  3372. }
  3373. return new Glob(pattern, options, cb)
  3374. }
  3375. glob.sync = globSync
  3376. var GlobSync = glob.GlobSync = globSync.GlobSync
  3377. // old api surface
  3378. glob.glob = glob
  3379. function extend (origin, add) {
  3380. if (add === null || typeof add !== 'object') {
  3381. return origin
  3382. }
  3383. var keys = Object.keys(add)
  3384. var i = keys.length
  3385. while (i--) {
  3386. origin[keys[i]] = add[keys[i]]
  3387. }
  3388. return origin
  3389. }
  3390. glob.hasMagic = function (pattern, options_) {
  3391. var options = extend({}, options_)
  3392. options.noprocess = true
  3393. var g = new Glob(pattern, options)
  3394. var set = g.minimatch.set
  3395. if (!pattern)
  3396. return false
  3397. if (set.length > 1)
  3398. return true
  3399. for (var j = 0; j < set[0].length; j++) {
  3400. if (typeof set[0][j] !== 'string')
  3401. return true
  3402. }
  3403. return false
  3404. }
  3405. glob.Glob = Glob
  3406. inherits(Glob, EE)
  3407. function Glob (pattern, options, cb) {
  3408. if (typeof options === 'function') {
  3409. cb = options
  3410. options = null
  3411. }
  3412. if (options && options.sync) {
  3413. if (cb)
  3414. throw new TypeError('callback provided to sync glob')
  3415. return new GlobSync(pattern, options)
  3416. }
  3417. if (!(this instanceof Glob))
  3418. return new Glob(pattern, options, cb)
  3419. setopts(this, pattern, options)
  3420. this._didRealPath = false
  3421. // process each pattern in the minimatch set
  3422. var n = this.minimatch.set.length
  3423. // The matches are stored as {<filename>: true,...} so that
  3424. // duplicates are automagically pruned.
  3425. // Later, we do an Object.keys() on these.
  3426. // Keep them as a list so we can fill in when nonull is set.
  3427. this.matches = new Array(n)
  3428. if (typeof cb === 'function') {
  3429. cb = once(cb)
  3430. this.on('error', cb)
  3431. this.on('end', function (matches) {
  3432. cb(null, matches)
  3433. })
  3434. }
  3435. var self = this
  3436. this._processing = 0
  3437. this._emitQueue = []
  3438. this._processQueue = []
  3439. this.paused = false
  3440. if (this.noprocess)
  3441. return this
  3442. if (n === 0)
  3443. return done()
  3444. var sync = true
  3445. for (var i = 0; i < n; i ++) {
  3446. this._process(this.minimatch.set[i], i, false, done)
  3447. }
  3448. sync = false
  3449. function done () {
  3450. --self._processing
  3451. if (self._processing <= 0) {
  3452. if (sync) {
  3453. process.nextTick(function () {
  3454. self._finish()
  3455. })
  3456. } else {
  3457. self._finish()
  3458. }
  3459. }
  3460. }
  3461. }
  3462. Glob.prototype._finish = function () {
  3463. assert(this instanceof Glob)
  3464. if (this.aborted)
  3465. return
  3466. if (this.realpath && !this._didRealpath)
  3467. return this._realpath()
  3468. common.finish(this)
  3469. this.emit('end', this.found)
  3470. }
  3471. Glob.prototype._realpath = function () {
  3472. if (this._didRealpath)
  3473. return
  3474. this._didRealpath = true
  3475. var n = this.matches.length
  3476. if (n === 0)
  3477. return this._finish()
  3478. var self = this
  3479. for (var i = 0; i < this.matches.length; i++)
  3480. this._realpathSet(i, next)
  3481. function next () {
  3482. if (--n === 0)
  3483. self._finish()
  3484. }
  3485. }
  3486. Glob.prototype._realpathSet = function (index, cb) {
  3487. var matchset = this.matches[index]
  3488. if (!matchset)
  3489. return cb()
  3490. var found = Object.keys(matchset)
  3491. var self = this
  3492. var n = found.length
  3493. if (n === 0)
  3494. return cb()
  3495. var set = this.matches[index] = Object.create(null)
  3496. found.forEach(function (p, i) {
  3497. // If there's a problem with the stat, then it means that
  3498. // one or more of the links in the realpath couldn't be
  3499. // resolved. just return the abs value in that case.
  3500. p = self._makeAbs(p)
  3501. rp.realpath(p, self.realpathCache, function (er, real) {
  3502. if (!er)
  3503. set[real] = true
  3504. else if (er.syscall === 'stat')
  3505. set[p] = true
  3506. else
  3507. self.emit('error', er) // srsly wtf right here
  3508. if (--n === 0) {
  3509. self.matches[index] = set
  3510. cb()
  3511. }
  3512. })
  3513. })
  3514. }
  3515. Glob.prototype._mark = function (p) {
  3516. return common.mark(this, p)
  3517. }
  3518. Glob.prototype._makeAbs = function (f) {
  3519. return common.makeAbs(this, f)
  3520. }
  3521. Glob.prototype.abort = function () {
  3522. this.aborted = true
  3523. this.emit('abort')
  3524. }
  3525. Glob.prototype.pause = function () {
  3526. if (!this.paused) {
  3527. this.paused = true
  3528. this.emit('pause')
  3529. }
  3530. }
  3531. Glob.prototype.resume = function () {
  3532. if (this.paused) {
  3533. this.emit('resume')
  3534. this.paused = false
  3535. if (this._emitQueue.length) {
  3536. var eq = this._emitQueue.slice(0)
  3537. this._emitQueue.length = 0
  3538. for (var i = 0; i < eq.length; i ++) {
  3539. var e = eq[i]
  3540. this._emitMatch(e[0], e[1])
  3541. }
  3542. }
  3543. if (this._processQueue.length) {
  3544. var pq = this._processQueue.slice(0)
  3545. this._processQueue.length = 0
  3546. for (var i = 0; i < pq.length; i ++) {
  3547. var p = pq[i]
  3548. this._processing--
  3549. this._process(p[0], p[1], p[2], p[3])
  3550. }
  3551. }
  3552. }
  3553. }
  3554. Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  3555. assert(this instanceof Glob)
  3556. assert(typeof cb === 'function')
  3557. if (this.aborted)
  3558. return
  3559. this._processing++
  3560. if (this.paused) {
  3561. this._processQueue.push([pattern, index, inGlobStar, cb])
  3562. return
  3563. }
  3564. //console.error('PROCESS %d', this._processing, pattern)
  3565. // Get the first [n] parts of pattern that are all strings.
  3566. var n = 0
  3567. while (typeof pattern[n] === 'string') {
  3568. n ++
  3569. }
  3570. // now n is the index of the first one that is *not* a string.
  3571. // see if there's anything else
  3572. var prefix
  3573. switch (n) {
  3574. // if not, then this is rather simple
  3575. case pattern.length:
  3576. this._processSimple(pattern.join('/'), index, cb)
  3577. return
  3578. case 0:
  3579. // pattern *starts* with some non-trivial item.
  3580. // going to readdir(cwd), but not include the prefix in matches.
  3581. prefix = null
  3582. break
  3583. default:
  3584. // pattern has some string bits in the front.
  3585. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  3586. // or 'relative' like '../baz'
  3587. prefix = pattern.slice(0, n).join('/')
  3588. break
  3589. }
  3590. var remain = pattern.slice(n)
  3591. // get the list of entries.
  3592. var read
  3593. if (prefix === null)
  3594. read = '.'
  3595. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  3596. if (!prefix || !isAbsolute(prefix))
  3597. prefix = '/' + prefix
  3598. read = prefix
  3599. } else
  3600. read = prefix
  3601. var abs = this._makeAbs(read)
  3602. //if ignored, skip _processing
  3603. if (childrenIgnored(this, read))
  3604. return cb()
  3605. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  3606. if (isGlobStar)
  3607. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
  3608. else
  3609. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
  3610. }
  3611. Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  3612. var self = this
  3613. this._readdir(abs, inGlobStar, function (er, entries) {
  3614. return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  3615. })
  3616. }
  3617. Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  3618. // if the abs isn't a dir, then nothing can match!
  3619. if (!entries)
  3620. return cb()
  3621. // It will only match dot entries if it starts with a dot, or if
  3622. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  3623. var pn = remain[0]
  3624. var negate = !!this.minimatch.negate
  3625. var rawGlob = pn._glob
  3626. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  3627. var matchedEntries = []
  3628. for (var i = 0; i < entries.length; i++) {
  3629. var e = entries[i]
  3630. if (e.charAt(0) !== '.' || dotOk) {
  3631. var m
  3632. if (negate && !prefix) {
  3633. m = !e.match(pn)
  3634. } else {
  3635. m = e.match(pn)
  3636. }
  3637. if (m)
  3638. matchedEntries.push(e)
  3639. }
  3640. }
  3641. //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
  3642. var len = matchedEntries.length
  3643. // If there are no matched entries, then nothing matches.
  3644. if (len === 0)
  3645. return cb()
  3646. // if this is the last remaining pattern bit, then no need for
  3647. // an additional stat *unless* the user has specified mark or
  3648. // stat explicitly. We know they exist, since readdir returned
  3649. // them.
  3650. if (remain.length === 1 && !this.mark && !this.stat) {
  3651. if (!this.matches[index])
  3652. this.matches[index] = Object.create(null)
  3653. for (var i = 0; i < len; i ++) {
  3654. var e = matchedEntries[i]
  3655. if (prefix) {
  3656. if (prefix !== '/')
  3657. e = prefix + '/' + e
  3658. else
  3659. e = prefix + e
  3660. }
  3661. if (e.charAt(0) === '/' && !this.nomount) {
  3662. e = path.join(this.root, e)
  3663. }
  3664. this._emitMatch(index, e)
  3665. }
  3666. // This was the last one, and no stats were needed
  3667. return cb()
  3668. }
  3669. // now test all matched entries as stand-ins for that part
  3670. // of the pattern.
  3671. remain.shift()
  3672. for (var i = 0; i < len; i ++) {
  3673. var e = matchedEntries[i]
  3674. var newPattern
  3675. if (prefix) {
  3676. if (prefix !== '/')
  3677. e = prefix + '/' + e
  3678. else
  3679. e = prefix + e
  3680. }
  3681. this._process([e].concat(remain), index, inGlobStar, cb)
  3682. }
  3683. cb()
  3684. }
  3685. Glob.prototype._emitMatch = function (index, e) {
  3686. if (this.aborted)
  3687. return
  3688. if (isIgnored(this, e))
  3689. return
  3690. if (this.paused) {
  3691. this._emitQueue.push([index, e])
  3692. return
  3693. }
  3694. var abs = isAbsolute(e) ? e : this._makeAbs(e)
  3695. if (this.mark)
  3696. e = this._mark(e)
  3697. if (this.absolute)
  3698. e = abs
  3699. if (this.matches[index][e])
  3700. return
  3701. if (this.nodir) {
  3702. var c = this.cache[abs]
  3703. if (c === 'DIR' || Array.isArray(c))
  3704. return
  3705. }
  3706. this.matches[index][e] = true
  3707. var st = this.statCache[abs]
  3708. if (st)
  3709. this.emit('stat', e, st)
  3710. this.emit('match', e)
  3711. }
  3712. Glob.prototype._readdirInGlobStar = function (abs, cb) {
  3713. if (this.aborted)
  3714. return
  3715. // follow all symlinked directories forever
  3716. // just proceed as if this is a non-globstar situation
  3717. if (this.follow)
  3718. return this._readdir(abs, false, cb)
  3719. var lstatkey = 'lstat\0' + abs
  3720. var self = this
  3721. var lstatcb = inflight(lstatkey, lstatcb_)
  3722. if (lstatcb)
  3723. fs.lstat(abs, lstatcb)
  3724. function lstatcb_ (er, lstat) {
  3725. if (er && er.code === 'ENOENT')
  3726. return cb()
  3727. var isSym = lstat && lstat.isSymbolicLink()
  3728. self.symlinks[abs] = isSym
  3729. // If it's not a symlink or a dir, then it's definitely a regular file.
  3730. // don't bother doing a readdir in that case.
  3731. if (!isSym && lstat && !lstat.isDirectory()) {
  3732. self.cache[abs] = 'FILE'
  3733. cb()
  3734. } else
  3735. self._readdir(abs, false, cb)
  3736. }
  3737. }
  3738. Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  3739. if (this.aborted)
  3740. return
  3741. cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
  3742. if (!cb)
  3743. return
  3744. //console.error('RD %j %j', +inGlobStar, abs)
  3745. if (inGlobStar && !ownProp(this.symlinks, abs))
  3746. return this._readdirInGlobStar(abs, cb)
  3747. if (ownProp(this.cache, abs)) {
  3748. var c = this.cache[abs]
  3749. if (!c || c === 'FILE')
  3750. return cb()
  3751. if (Array.isArray(c))
  3752. return cb(null, c)
  3753. }
  3754. var self = this
  3755. fs.readdir(abs, readdirCb(this, abs, cb))
  3756. }
  3757. function readdirCb (self, abs, cb) {
  3758. return function (er, entries) {
  3759. if (er)
  3760. self._readdirError(abs, er, cb)
  3761. else
  3762. self._readdirEntries(abs, entries, cb)
  3763. }
  3764. }
  3765. Glob.prototype._readdirEntries = function (abs, entries, cb) {
  3766. if (this.aborted)
  3767. return
  3768. // if we haven't asked to stat everything, then just
  3769. // assume that everything in there exists, so we can avoid
  3770. // having to stat it a second time.
  3771. if (!this.mark && !this.stat) {
  3772. for (var i = 0; i < entries.length; i ++) {
  3773. var e = entries[i]
  3774. if (abs === '/')
  3775. e = abs + e
  3776. else
  3777. e = abs + '/' + e
  3778. this.cache[e] = true
  3779. }
  3780. }
  3781. this.cache[abs] = entries
  3782. return cb(null, entries)
  3783. }
  3784. Glob.prototype._readdirError = function (f, er, cb) {
  3785. if (this.aborted)
  3786. return
  3787. // handle errors, and cache the information
  3788. switch (er.code) {
  3789. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  3790. case 'ENOTDIR': // totally normal. means it *does* exist.
  3791. var abs = this._makeAbs(f)
  3792. this.cache[abs] = 'FILE'
  3793. if (abs === this.cwdAbs) {
  3794. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  3795. error.path = this.cwd
  3796. error.code = er.code
  3797. this.emit('error', error)
  3798. this.abort()
  3799. }
  3800. break
  3801. case 'ENOENT': // not terribly unusual
  3802. case 'ELOOP':
  3803. case 'ENAMETOOLONG':
  3804. case 'UNKNOWN':
  3805. this.cache[this._makeAbs(f)] = false
  3806. break
  3807. default: // some unusual error. Treat as failure.
  3808. this.cache[this._makeAbs(f)] = false
  3809. if (this.strict) {
  3810. this.emit('error', er)
  3811. // If the error is handled, then we abort
  3812. // if not, we threw out of here
  3813. this.abort()
  3814. }
  3815. if (!this.silent)
  3816. console.error('glob error', er)
  3817. break
  3818. }
  3819. return cb()
  3820. }
  3821. Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  3822. var self = this
  3823. this._readdir(abs, inGlobStar, function (er, entries) {
  3824. self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  3825. })
  3826. }
  3827. Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  3828. //console.error('pgs2', prefix, remain[0], entries)
  3829. // no entries means not a dir, so it can never have matches
  3830. // foo.txt/** doesn't match foo.txt
  3831. if (!entries)
  3832. return cb()
  3833. // test without the globstar, and with every child both below
  3834. // and replacing the globstar.
  3835. var remainWithoutGlobStar = remain.slice(1)
  3836. var gspref = prefix ? [ prefix ] : []
  3837. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  3838. // the noGlobStar pattern exits the inGlobStar state
  3839. this._process(noGlobStar, index, false, cb)
  3840. var isSym = this.symlinks[abs]
  3841. var len = entries.length
  3842. // If it's a symlink, and we're in a globstar, then stop
  3843. if (isSym && inGlobStar)
  3844. return cb()
  3845. for (var i = 0; i < len; i++) {
  3846. var e = entries[i]
  3847. if (e.charAt(0) === '.' && !this.dot)
  3848. continue
  3849. // these two cases enter the inGlobStar state
  3850. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  3851. this._process(instead, index, true, cb)
  3852. var below = gspref.concat(entries[i], remain)
  3853. this._process(below, index, true, cb)
  3854. }
  3855. cb()
  3856. }
  3857. Glob.prototype._processSimple = function (prefix, index, cb) {
  3858. // XXX review this. Shouldn't it be doing the mounting etc
  3859. // before doing stat? kinda weird?
  3860. var self = this
  3861. this._stat(prefix, function (er, exists) {
  3862. self._processSimple2(prefix, index, er, exists, cb)
  3863. })
  3864. }
  3865. Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
  3866. //console.error('ps2', prefix, exists)
  3867. if (!this.matches[index])
  3868. this.matches[index] = Object.create(null)
  3869. // If it doesn't exist, then just mark the lack of results
  3870. if (!exists)
  3871. return cb()
  3872. if (prefix && isAbsolute(prefix) && !this.nomount) {
  3873. var trail = /[\/\\]$/.test(prefix)
  3874. if (prefix.charAt(0) === '/') {
  3875. prefix = path.join(this.root, prefix)
  3876. } else {
  3877. prefix = path.resolve(this.root, prefix)
  3878. if (trail)
  3879. prefix += '/'
  3880. }
  3881. }
  3882. if (process.platform === 'win32')
  3883. prefix = prefix.replace(/\\/g, '/')
  3884. // Mark this as a match
  3885. this._emitMatch(index, prefix)
  3886. cb()
  3887. }
  3888. // Returns either 'DIR', 'FILE', or false
  3889. Glob.prototype._stat = function (f, cb) {
  3890. var abs = this._makeAbs(f)
  3891. var needDir = f.slice(-1) === '/'
  3892. if (f.length > this.maxLength)
  3893. return cb()
  3894. if (!this.stat && ownProp(this.cache, abs)) {
  3895. var c = this.cache[abs]
  3896. if (Array.isArray(c))
  3897. c = 'DIR'
  3898. // It exists, but maybe not how we need it
  3899. if (!needDir || c === 'DIR')
  3900. return cb(null, c)
  3901. if (needDir && c === 'FILE')
  3902. return cb()
  3903. // otherwise we have to stat, because maybe c=true
  3904. // if we know it exists, but not what it is.
  3905. }
  3906. var exists
  3907. var stat = this.statCache[abs]
  3908. if (stat !== undefined) {
  3909. if (stat === false)
  3910. return cb(null, stat)
  3911. else {
  3912. var type = stat.isDirectory() ? 'DIR' : 'FILE'
  3913. if (needDir && type === 'FILE')
  3914. return cb()
  3915. else
  3916. return cb(null, type, stat)
  3917. }
  3918. }
  3919. var self = this
  3920. var statcb = inflight('stat\0' + abs, lstatcb_)
  3921. if (statcb)
  3922. fs.lstat(abs, statcb)
  3923. function lstatcb_ (er, lstat) {
  3924. if (lstat && lstat.isSymbolicLink()) {
  3925. // If it's a symlink, then treat it as the target, unless
  3926. // the target does not exist, then treat it as a file.
  3927. return fs.stat(abs, function (er, stat) {
  3928. if (er)
  3929. self._stat2(f, abs, null, lstat, cb)
  3930. else
  3931. self._stat2(f, abs, er, stat, cb)
  3932. })
  3933. } else {
  3934. self._stat2(f, abs, er, lstat, cb)
  3935. }
  3936. }
  3937. }
  3938. Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  3939. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  3940. this.statCache[abs] = false
  3941. return cb()
  3942. }
  3943. var needDir = f.slice(-1) === '/'
  3944. this.statCache[abs] = stat
  3945. if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
  3946. return cb(null, false, stat)
  3947. var c = true
  3948. if (stat)
  3949. c = stat.isDirectory() ? 'DIR' : 'FILE'
  3950. this.cache[abs] = this.cache[abs] || c
  3951. if (needDir && c === 'FILE')
  3952. return cb()
  3953. return cb(null, c, stat)
  3954. }
  3955. /***/ }),
  3956. /* 76 */
  3957. /***/ (function(module, exports, __webpack_require__) {
  3958. "use strict";
  3959. function posix(path) {
  3960. return path.charAt(0) === '/';
  3961. }
  3962. function win32(path) {
  3963. // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
  3964. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  3965. var result = splitDeviceRe.exec(path);
  3966. var device = result[1] || '';
  3967. var isUnc = Boolean(device && device.charAt(1) !== ':');
  3968. // UNC paths are always absolute
  3969. return Boolean(result[2] || isUnc);
  3970. }
  3971. module.exports = process.platform === 'win32' ? win32 : posix;
  3972. module.exports.posix = posix;
  3973. module.exports.win32 = win32;
  3974. /***/ }),
  3975. /* 77 */,
  3976. /* 78 */,
  3977. /* 79 */
  3978. /***/ (function(module, exports) {
  3979. module.exports = require("tty");
  3980. /***/ }),
  3981. /* 80 */,
  3982. /* 81 */
  3983. /***/ (function(module, exports, __webpack_require__) {
  3984. "use strict";
  3985. Object.defineProperty(exports, "__esModule", {
  3986. value: true
  3987. });
  3988. exports.default = function (str, fileLoc = 'lockfile') {
  3989. str = (0, (_stripBom || _load_stripBom()).default)(str);
  3990. return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) };
  3991. };
  3992. var _util;
  3993. function _load_util() {
  3994. return _util = _interopRequireDefault(__webpack_require__(2));
  3995. }
  3996. var _invariant;
  3997. function _load_invariant() {
  3998. return _invariant = _interopRequireDefault(__webpack_require__(7));
  3999. }
  4000. var _stripBom;
  4001. function _load_stripBom() {
  4002. return _stripBom = _interopRequireDefault(__webpack_require__(122));
  4003. }
  4004. var _constants;
  4005. function _load_constants() {
  4006. return _constants = __webpack_require__(6);
  4007. }
  4008. var _errors;
  4009. function _load_errors() {
  4010. return _errors = __webpack_require__(4);
  4011. }
  4012. var _map;
  4013. function _load_map() {
  4014. return _map = _interopRequireDefault(__webpack_require__(20));
  4015. }
  4016. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4017. /* eslint quotes: 0 */
  4018. const VERSION_REGEX = /^yarn lockfile v(\d+)$/;
  4019. const TOKEN_TYPES = {
  4020. boolean: 'BOOLEAN',
  4021. string: 'STRING',
  4022. identifier: 'IDENTIFIER',
  4023. eof: 'EOF',
  4024. colon: 'COLON',
  4025. newline: 'NEWLINE',
  4026. comment: 'COMMENT',
  4027. indent: 'INDENT',
  4028. invalid: 'INVALID',
  4029. number: 'NUMBER',
  4030. comma: 'COMMA'
  4031. };
  4032. const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number];
  4033. function isValidPropValueToken(token) {
  4034. return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0;
  4035. }
  4036. function* tokenise(input) {
  4037. let lastNewline = false;
  4038. let line = 1;
  4039. let col = 0;
  4040. function buildToken(type, value) {
  4041. return { line, col, type, value };
  4042. }
  4043. while (input.length) {
  4044. let chop = 0;
  4045. if (input[0] === '\n' || input[0] === '\r') {
  4046. chop++;
  4047. // If this is a \r\n line, ignore both chars but only add one new line
  4048. if (input[1] === '\n') {
  4049. chop++;
  4050. }
  4051. line++;
  4052. col = 0;
  4053. yield buildToken(TOKEN_TYPES.newline);
  4054. } else if (input[0] === '#') {
  4055. chop++;
  4056. let val = '';
  4057. while (input[chop] !== '\n') {
  4058. val += input[chop];
  4059. chop++;
  4060. }
  4061. yield buildToken(TOKEN_TYPES.comment, val);
  4062. } else if (input[0] === ' ') {
  4063. if (lastNewline) {
  4064. let indent = '';
  4065. for (let i = 0; input[i] === ' '; i++) {
  4066. indent += input[i];
  4067. }
  4068. if (indent.length % 2) {
  4069. throw new TypeError('Invalid number of spaces');
  4070. } else {
  4071. chop = indent.length;
  4072. yield buildToken(TOKEN_TYPES.indent, indent.length / 2);
  4073. }
  4074. } else {
  4075. chop++;
  4076. }
  4077. } else if (input[0] === '"') {
  4078. let val = '';
  4079. for (let i = 0;; i++) {
  4080. const currentChar = input[i];
  4081. val += currentChar;
  4082. if (i > 0 && currentChar === '"') {
  4083. const isEscaped = input[i - 1] === '\\' && input[i - 2] !== '\\';
  4084. if (!isEscaped) {
  4085. break;
  4086. }
  4087. }
  4088. }
  4089. chop = val.length;
  4090. try {
  4091. yield buildToken(TOKEN_TYPES.string, JSON.parse(val));
  4092. } catch (err) {
  4093. if (err instanceof SyntaxError) {
  4094. yield buildToken(TOKEN_TYPES.invalid);
  4095. } else {
  4096. throw err;
  4097. }
  4098. }
  4099. } else if (/^[0-9]/.test(input)) {
  4100. let val = '';
  4101. for (let i = 0; /^[0-9]$/.test(input[i]); i++) {
  4102. val += input[i];
  4103. }
  4104. chop = val.length;
  4105. yield buildToken(TOKEN_TYPES.number, +val);
  4106. } else if (/^true/.test(input)) {
  4107. yield buildToken(TOKEN_TYPES.boolean, true);
  4108. chop = 4;
  4109. } else if (/^false/.test(input)) {
  4110. yield buildToken(TOKEN_TYPES.boolean, false);
  4111. chop = 5;
  4112. } else if (input[0] === ':') {
  4113. yield buildToken(TOKEN_TYPES.colon);
  4114. chop++;
  4115. } else if (input[0] === ',') {
  4116. yield buildToken(TOKEN_TYPES.comma);
  4117. chop++;
  4118. } else if (/^[a-zA-Z\/-]/g.test(input)) {
  4119. let name = '';
  4120. for (let i = 0; i < input.length; i++) {
  4121. const char = input[i];
  4122. if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') {
  4123. break;
  4124. } else {
  4125. name += char;
  4126. }
  4127. }
  4128. chop = name.length;
  4129. yield buildToken(TOKEN_TYPES.string, name);
  4130. } else {
  4131. yield buildToken(TOKEN_TYPES.invalid);
  4132. }
  4133. if (!chop) {
  4134. // will trigger infinite recursion
  4135. yield buildToken(TOKEN_TYPES.invalid);
  4136. }
  4137. col += chop;
  4138. lastNewline = input[0] === '\n' || input[0] === '\r' && input[1] === '\n';
  4139. input = input.slice(chop);
  4140. }
  4141. yield buildToken(TOKEN_TYPES.eof);
  4142. }
  4143. class Parser {
  4144. constructor(input, fileLoc = 'lockfile') {
  4145. this.comments = [];
  4146. this.tokens = tokenise(input);
  4147. this.fileLoc = fileLoc;
  4148. }
  4149. onComment(token) {
  4150. const value = token.value;
  4151. (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string');
  4152. const comment = value.trim();
  4153. const versionMatch = comment.match(VERSION_REGEX);
  4154. if (versionMatch) {
  4155. const version = +versionMatch[1];
  4156. if (version > (_constants || _load_constants()).LOCKFILE_VERSION) {
  4157. throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`);
  4158. }
  4159. }
  4160. this.comments.push(comment);
  4161. }
  4162. next() {
  4163. const item = this.tokens.next();
  4164. (0, (_invariant || _load_invariant()).default)(item, 'expected a token');
  4165. const done = item.done,
  4166. value = item.value;
  4167. if (done || !value) {
  4168. throw new Error('No more tokens');
  4169. } else if (value.type === TOKEN_TYPES.comment) {
  4170. this.onComment(value);
  4171. return this.next();
  4172. } else {
  4173. return this.token = value;
  4174. }
  4175. }
  4176. unexpected(msg = 'Unexpected token') {
  4177. throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
  4178. }
  4179. expect(tokType) {
  4180. if (this.token.type === tokType) {
  4181. this.next();
  4182. } else {
  4183. this.unexpected();
  4184. }
  4185. }
  4186. eat(tokType) {
  4187. if (this.token.type === tokType) {
  4188. this.next();
  4189. return true;
  4190. } else {
  4191. return false;
  4192. }
  4193. }
  4194. parse(indent = 0) {
  4195. const obj = (0, (_map || _load_map()).default)();
  4196. while (true) {
  4197. const propToken = this.token;
  4198. if (propToken.type === TOKEN_TYPES.newline) {
  4199. const nextToken = this.next();
  4200. if (!indent) {
  4201. // if we have 0 indentation then the next token doesn't matter
  4202. continue;
  4203. }
  4204. if (nextToken.type !== TOKEN_TYPES.indent) {
  4205. // if we have no indentation after a newline then we've gone down a level
  4206. break;
  4207. }
  4208. if (nextToken.value === indent) {
  4209. // all is good, the indent is on our level
  4210. this.next();
  4211. } else {
  4212. // the indentation is less than our level
  4213. break;
  4214. }
  4215. } else if (propToken.type === TOKEN_TYPES.indent) {
  4216. if (propToken.value === indent) {
  4217. this.next();
  4218. } else {
  4219. break;
  4220. }
  4221. } else if (propToken.type === TOKEN_TYPES.eof) {
  4222. break;
  4223. } else if (propToken.type === TOKEN_TYPES.string) {
  4224. // property key
  4225. const key = propToken.value;
  4226. (0, (_invariant || _load_invariant()).default)(key, 'Expected a key');
  4227. const keys = [key];
  4228. this.next();
  4229. // support multiple keys
  4230. while (this.token.type === TOKEN_TYPES.comma) {
  4231. this.next(); // skip comma
  4232. const keyToken = this.token;
  4233. if (keyToken.type !== TOKEN_TYPES.string) {
  4234. this.unexpected('Expected string');
  4235. }
  4236. const key = keyToken.value;
  4237. (0, (_invariant || _load_invariant()).default)(key, 'Expected a key');
  4238. keys.push(key);
  4239. this.next();
  4240. }
  4241. const valToken = this.token;
  4242. if (valToken.type === TOKEN_TYPES.colon) {
  4243. // object
  4244. this.next();
  4245. // parse object
  4246. const val = this.parse(indent + 1);
  4247. for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  4248. var _ref;
  4249. if (_isArray) {
  4250. if (_i >= _iterator.length) break;
  4251. _ref = _iterator[_i++];
  4252. } else {
  4253. _i = _iterator.next();
  4254. if (_i.done) break;
  4255. _ref = _i.value;
  4256. }
  4257. const key = _ref;
  4258. obj[key] = val;
  4259. }
  4260. if (indent && this.token.type !== TOKEN_TYPES.indent) {
  4261. break;
  4262. }
  4263. } else if (isValidPropValueToken(valToken)) {
  4264. // plain value
  4265. for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  4266. var _ref2;
  4267. if (_isArray2) {
  4268. if (_i2 >= _iterator2.length) break;
  4269. _ref2 = _iterator2[_i2++];
  4270. } else {
  4271. _i2 = _iterator2.next();
  4272. if (_i2.done) break;
  4273. _ref2 = _i2.value;
  4274. }
  4275. const key = _ref2;
  4276. obj[key] = valToken.value;
  4277. }
  4278. this.next();
  4279. } else {
  4280. this.unexpected('Invalid value type');
  4281. }
  4282. } else {
  4283. this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`);
  4284. }
  4285. }
  4286. return obj;
  4287. }
  4288. }
  4289. const MERGE_CONFLICT_ANCESTOR = '|||||||';
  4290. const MERGE_CONFLICT_END = '>>>>>>>';
  4291. const MERGE_CONFLICT_SEP = '=======';
  4292. const MERGE_CONFLICT_START = '<<<<<<<';
  4293. /**
  4294. * Extract the two versions of the lockfile from a merge conflict.
  4295. */
  4296. function extractConflictVariants(str) {
  4297. const variants = [[], []];
  4298. const lines = str.split(/\r?\n/g);
  4299. let skip = false;
  4300. while (lines.length) {
  4301. const line = lines.shift();
  4302. if (line.startsWith(MERGE_CONFLICT_START)) {
  4303. // get the first variant
  4304. while (lines.length) {
  4305. const conflictLine = lines.shift();
  4306. if (conflictLine === MERGE_CONFLICT_SEP) {
  4307. skip = false;
  4308. break;
  4309. } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) {
  4310. skip = true;
  4311. continue;
  4312. } else {
  4313. variants[0].push(conflictLine);
  4314. }
  4315. }
  4316. // get the second variant
  4317. while (lines.length) {
  4318. const conflictLine = lines.shift();
  4319. if (conflictLine.startsWith(MERGE_CONFLICT_END)) {
  4320. break;
  4321. } else {
  4322. variants[1].push(conflictLine);
  4323. }
  4324. }
  4325. } else {
  4326. variants[0].push(line);
  4327. variants[1].push(line);
  4328. }
  4329. }
  4330. return [variants[0].join('\n'), variants[1].join('\n')];
  4331. }
  4332. /**
  4333. * Check if a lockfile has merge conflicts.
  4334. */
  4335. function hasMergeConflicts(str) {
  4336. return str.includes(MERGE_CONFLICT_START) && str.includes(MERGE_CONFLICT_SEP) && str.includes(MERGE_CONFLICT_END);
  4337. }
  4338. /**
  4339. * Parse the lockfile.
  4340. */
  4341. function parse(str, fileLoc) {
  4342. const parser = new Parser(str, fileLoc);
  4343. parser.next();
  4344. return parser.parse();
  4345. }
  4346. /**
  4347. * Parse and merge the two variants in a conflicted lockfile.
  4348. */
  4349. function parseWithConflict(str, fileLoc) {
  4350. const variants = extractConflictVariants(str);
  4351. try {
  4352. return { type: 'merge', object: Object.assign({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) };
  4353. } catch (err) {
  4354. if (err instanceof SyntaxError) {
  4355. return { type: 'conflict', object: {} };
  4356. } else {
  4357. throw err;
  4358. }
  4359. }
  4360. }
  4361. /***/ }),
  4362. /* 82 */,
  4363. /* 83 */,
  4364. /* 84 */
  4365. /***/ (function(module, exports, __webpack_require__) {
  4366. "use strict";
  4367. Object.defineProperty(exports, "__esModule", {
  4368. value: true
  4369. });
  4370. var _map;
  4371. function _load_map() {
  4372. return _map = _interopRequireDefault(__webpack_require__(20));
  4373. }
  4374. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4375. const debug = __webpack_require__(212)('yarn');
  4376. class BlockingQueue {
  4377. constructor(alias, maxConcurrency = Infinity) {
  4378. this.concurrencyQueue = [];
  4379. this.maxConcurrency = maxConcurrency;
  4380. this.runningCount = 0;
  4381. this.warnedStuck = false;
  4382. this.alias = alias;
  4383. this.first = true;
  4384. this.running = (0, (_map || _load_map()).default)();
  4385. this.queue = (0, (_map || _load_map()).default)();
  4386. this.stuckTick = this.stuckTick.bind(this);
  4387. }
  4388. stillActive() {
  4389. if (this.stuckTimer) {
  4390. clearTimeout(this.stuckTimer);
  4391. }
  4392. this.stuckTimer = setTimeout(this.stuckTick, 5000);
  4393. // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559
  4394. // $FlowFixMe: Node's setInterval returns a Timeout, not a Number
  4395. this.stuckTimer.unref && this.stuckTimer.unref();
  4396. }
  4397. stuckTick() {
  4398. if (this.runningCount === 1) {
  4399. this.warnedStuck = true;
  4400. debug(`The ${JSON.stringify(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${Object.keys(this.running)[0]}`);
  4401. }
  4402. }
  4403. push(key, factory) {
  4404. if (this.first) {
  4405. this.first = false;
  4406. } else {
  4407. this.stillActive();
  4408. }
  4409. return new Promise((resolve, reject) => {
  4410. // we're already running so push ourselves to the queue
  4411. const queue = this.queue[key] = this.queue[key] || [];
  4412. queue.push({ factory, resolve, reject });
  4413. if (!this.running[key]) {
  4414. this.shift(key);
  4415. }
  4416. });
  4417. }
  4418. shift(key) {
  4419. if (this.running[key]) {
  4420. delete this.running[key];
  4421. this.runningCount--;
  4422. if (this.stuckTimer) {
  4423. clearTimeout(this.stuckTimer);
  4424. this.stuckTimer = null;
  4425. }
  4426. if (this.warnedStuck) {
  4427. this.warnedStuck = false;
  4428. debug(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`);
  4429. }
  4430. }
  4431. const queue = this.queue[key];
  4432. if (!queue) {
  4433. return;
  4434. }
  4435. var _queue$shift = queue.shift();
  4436. const resolve = _queue$shift.resolve,
  4437. reject = _queue$shift.reject,
  4438. factory = _queue$shift.factory;
  4439. if (!queue.length) {
  4440. delete this.queue[key];
  4441. }
  4442. const next = () => {
  4443. this.shift(key);
  4444. this.shiftConcurrencyQueue();
  4445. };
  4446. const run = () => {
  4447. this.running[key] = true;
  4448. this.runningCount++;
  4449. factory().then(function (val) {
  4450. resolve(val);
  4451. next();
  4452. return null;
  4453. }).catch(function (err) {
  4454. reject(err);
  4455. next();
  4456. });
  4457. };
  4458. this.maybePushConcurrencyQueue(run);
  4459. }
  4460. maybePushConcurrencyQueue(run) {
  4461. if (this.runningCount < this.maxConcurrency) {
  4462. run();
  4463. } else {
  4464. this.concurrencyQueue.push(run);
  4465. }
  4466. }
  4467. shiftConcurrencyQueue() {
  4468. if (this.runningCount < this.maxConcurrency) {
  4469. const fn = this.concurrencyQueue.shift();
  4470. if (fn) {
  4471. fn();
  4472. }
  4473. }
  4474. }
  4475. }
  4476. exports.default = BlockingQueue;
  4477. /***/ }),
  4478. /* 85 */
  4479. /***/ (function(module, exports) {
  4480. module.exports = function (exec) {
  4481. try {
  4482. return !!exec();
  4483. } catch (e) {
  4484. return true;
  4485. }
  4486. };
  4487. /***/ }),
  4488. /* 86 */,
  4489. /* 87 */,
  4490. /* 88 */,
  4491. /* 89 */,
  4492. /* 90 */,
  4493. /* 91 */,
  4494. /* 92 */,
  4495. /* 93 */,
  4496. /* 94 */,
  4497. /* 95 */,
  4498. /* 96 */,
  4499. /* 97 */,
  4500. /* 98 */,
  4501. /* 99 */,
  4502. /* 100 */
  4503. /***/ (function(module, exports, __webpack_require__) {
  4504. // getting tag from 19.1.3.6 Object.prototype.toString()
  4505. var cof = __webpack_require__(47);
  4506. var TAG = __webpack_require__(13)('toStringTag');
  4507. // ES3 wrong here
  4508. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  4509. // fallback for IE11 Script Access Denied error
  4510. var tryGet = function (it, key) {
  4511. try {
  4512. return it[key];
  4513. } catch (e) { /* empty */ }
  4514. };
  4515. module.exports = function (it) {
  4516. var O, T, B;
  4517. return it === undefined ? 'Undefined' : it === null ? 'Null'
  4518. // @@toStringTag case
  4519. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  4520. // builtinTag case
  4521. : ARG ? cof(O)
  4522. // ES3 arguments fallback
  4523. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  4524. };
  4525. /***/ }),
  4526. /* 101 */
  4527. /***/ (function(module, exports) {
  4528. // IE 8- don't enum bug keys
  4529. module.exports = (
  4530. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  4531. ).split(',');
  4532. /***/ }),
  4533. /* 102 */
  4534. /***/ (function(module, exports, __webpack_require__) {
  4535. var document = __webpack_require__(11).document;
  4536. module.exports = document && document.documentElement;
  4537. /***/ }),
  4538. /* 103 */
  4539. /***/ (function(module, exports, __webpack_require__) {
  4540. "use strict";
  4541. var LIBRARY = __webpack_require__(69);
  4542. var $export = __webpack_require__(41);
  4543. var redefine = __webpack_require__(197);
  4544. var hide = __webpack_require__(31);
  4545. var Iterators = __webpack_require__(35);
  4546. var $iterCreate = __webpack_require__(188);
  4547. var setToStringTag = __webpack_require__(71);
  4548. var getPrototypeOf = __webpack_require__(194);
  4549. var ITERATOR = __webpack_require__(13)('iterator');
  4550. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  4551. var FF_ITERATOR = '@@iterator';
  4552. var KEYS = 'keys';
  4553. var VALUES = 'values';
  4554. var returnThis = function () { return this; };
  4555. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  4556. $iterCreate(Constructor, NAME, next);
  4557. var getMethod = function (kind) {
  4558. if (!BUGGY && kind in proto) return proto[kind];
  4559. switch (kind) {
  4560. case KEYS: return function keys() { return new Constructor(this, kind); };
  4561. case VALUES: return function values() { return new Constructor(this, kind); };
  4562. } return function entries() { return new Constructor(this, kind); };
  4563. };
  4564. var TAG = NAME + ' Iterator';
  4565. var DEF_VALUES = DEFAULT == VALUES;
  4566. var VALUES_BUG = false;
  4567. var proto = Base.prototype;
  4568. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  4569. var $default = $native || getMethod(DEFAULT);
  4570. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  4571. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  4572. var methods, key, IteratorPrototype;
  4573. // Fix native
  4574. if ($anyNative) {
  4575. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  4576. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  4577. // Set @@toStringTag to native iterators
  4578. setToStringTag(IteratorPrototype, TAG, true);
  4579. // fix for some old engines
  4580. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  4581. }
  4582. }
  4583. // fix Array#{values, @@iterator}.name in V8 / FF
  4584. if (DEF_VALUES && $native && $native.name !== VALUES) {
  4585. VALUES_BUG = true;
  4586. $default = function values() { return $native.call(this); };
  4587. }
  4588. // Define iterator
  4589. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  4590. hide(proto, ITERATOR, $default);
  4591. }
  4592. // Plug for library
  4593. Iterators[NAME] = $default;
  4594. Iterators[TAG] = returnThis;
  4595. if (DEFAULT) {
  4596. methods = {
  4597. values: DEF_VALUES ? $default : getMethod(VALUES),
  4598. keys: IS_SET ? $default : getMethod(KEYS),
  4599. entries: $entries
  4600. };
  4601. if (FORCED) for (key in methods) {
  4602. if (!(key in proto)) redefine(proto, key, methods[key]);
  4603. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  4604. }
  4605. return methods;
  4606. };
  4607. /***/ }),
  4608. /* 104 */
  4609. /***/ (function(module, exports) {
  4610. module.exports = function (exec) {
  4611. try {
  4612. return { e: false, v: exec() };
  4613. } catch (e) {
  4614. return { e: true, v: e };
  4615. }
  4616. };
  4617. /***/ }),
  4618. /* 105 */
  4619. /***/ (function(module, exports, __webpack_require__) {
  4620. var anObject = __webpack_require__(27);
  4621. var isObject = __webpack_require__(34);
  4622. var newPromiseCapability = __webpack_require__(70);
  4623. module.exports = function (C, x) {
  4624. anObject(C);
  4625. if (isObject(x) && x.constructor === C) return x;
  4626. var promiseCapability = newPromiseCapability.f(C);
  4627. var resolve = promiseCapability.resolve;
  4628. resolve(x);
  4629. return promiseCapability.promise;
  4630. };
  4631. /***/ }),
  4632. /* 106 */
  4633. /***/ (function(module, exports) {
  4634. module.exports = function (bitmap, value) {
  4635. return {
  4636. enumerable: !(bitmap & 1),
  4637. configurable: !(bitmap & 2),
  4638. writable: !(bitmap & 4),
  4639. value: value
  4640. };
  4641. };
  4642. /***/ }),
  4643. /* 107 */
  4644. /***/ (function(module, exports, __webpack_require__) {
  4645. var core = __webpack_require__(23);
  4646. var global = __webpack_require__(11);
  4647. var SHARED = '__core-js_shared__';
  4648. var store = global[SHARED] || (global[SHARED] = {});
  4649. (module.exports = function (key, value) {
  4650. return store[key] || (store[key] = value !== undefined ? value : {});
  4651. })('versions', []).push({
  4652. version: core.version,
  4653. mode: __webpack_require__(69) ? 'pure' : 'global',
  4654. copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
  4655. });
  4656. /***/ }),
  4657. /* 108 */
  4658. /***/ (function(module, exports, __webpack_require__) {
  4659. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  4660. var anObject = __webpack_require__(27);
  4661. var aFunction = __webpack_require__(46);
  4662. var SPECIES = __webpack_require__(13)('species');
  4663. module.exports = function (O, D) {
  4664. var C = anObject(O).constructor;
  4665. var S;
  4666. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  4667. };
  4668. /***/ }),
  4669. /* 109 */
  4670. /***/ (function(module, exports, __webpack_require__) {
  4671. var ctx = __webpack_require__(48);
  4672. var invoke = __webpack_require__(185);
  4673. var html = __webpack_require__(102);
  4674. var cel = __webpack_require__(68);
  4675. var global = __webpack_require__(11);
  4676. var process = global.process;
  4677. var setTask = global.setImmediate;
  4678. var clearTask = global.clearImmediate;
  4679. var MessageChannel = global.MessageChannel;
  4680. var Dispatch = global.Dispatch;
  4681. var counter = 0;
  4682. var queue = {};
  4683. var ONREADYSTATECHANGE = 'onreadystatechange';
  4684. var defer, channel, port;
  4685. var run = function () {
  4686. var id = +this;
  4687. // eslint-disable-next-line no-prototype-builtins
  4688. if (queue.hasOwnProperty(id)) {
  4689. var fn = queue[id];
  4690. delete queue[id];
  4691. fn();
  4692. }
  4693. };
  4694. var listener = function (event) {
  4695. run.call(event.data);
  4696. };
  4697. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  4698. if (!setTask || !clearTask) {
  4699. setTask = function setImmediate(fn) {
  4700. var args = [];
  4701. var i = 1;
  4702. while (arguments.length > i) args.push(arguments[i++]);
  4703. queue[++counter] = function () {
  4704. // eslint-disable-next-line no-new-func
  4705. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  4706. };
  4707. defer(counter);
  4708. return counter;
  4709. };
  4710. clearTask = function clearImmediate(id) {
  4711. delete queue[id];
  4712. };
  4713. // Node.js 0.8-
  4714. if (__webpack_require__(47)(process) == 'process') {
  4715. defer = function (id) {
  4716. process.nextTick(ctx(run, id, 1));
  4717. };
  4718. // Sphere (JS game engine) Dispatch API
  4719. } else if (Dispatch && Dispatch.now) {
  4720. defer = function (id) {
  4721. Dispatch.now(ctx(run, id, 1));
  4722. };
  4723. // Browsers with MessageChannel, includes WebWorkers
  4724. } else if (MessageChannel) {
  4725. channel = new MessageChannel();
  4726. port = channel.port2;
  4727. channel.port1.onmessage = listener;
  4728. defer = ctx(port.postMessage, port, 1);
  4729. // Browsers with postMessage, skip WebWorkers
  4730. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  4731. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  4732. defer = function (id) {
  4733. global.postMessage(id + '', '*');
  4734. };
  4735. global.addEventListener('message', listener, false);
  4736. // IE8-
  4737. } else if (ONREADYSTATECHANGE in cel('script')) {
  4738. defer = function (id) {
  4739. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  4740. html.removeChild(this);
  4741. run.call(id);
  4742. };
  4743. };
  4744. // Rest old browsers
  4745. } else {
  4746. defer = function (id) {
  4747. setTimeout(ctx(run, id, 1), 0);
  4748. };
  4749. }
  4750. }
  4751. module.exports = {
  4752. set: setTask,
  4753. clear: clearTask
  4754. };
  4755. /***/ }),
  4756. /* 110 */
  4757. /***/ (function(module, exports, __webpack_require__) {
  4758. // 7.1.15 ToLength
  4759. var toInteger = __webpack_require__(73);
  4760. var min = Math.min;
  4761. module.exports = function (it) {
  4762. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  4763. };
  4764. /***/ }),
  4765. /* 111 */
  4766. /***/ (function(module, exports) {
  4767. var id = 0;
  4768. var px = Math.random();
  4769. module.exports = function (key) {
  4770. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  4771. };
  4772. /***/ }),
  4773. /* 112 */
  4774. /***/ (function(module, exports, __webpack_require__) {
  4775. /**
  4776. * This is the common logic for both the Node.js and web browser
  4777. * implementations of `debug()`.
  4778. *
  4779. * Expose `debug()` as the module.
  4780. */
  4781. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  4782. exports.coerce = coerce;
  4783. exports.disable = disable;
  4784. exports.enable = enable;
  4785. exports.enabled = enabled;
  4786. exports.humanize = __webpack_require__(229);
  4787. /**
  4788. * Active `debug` instances.
  4789. */
  4790. exports.instances = [];
  4791. /**
  4792. * The currently active debug mode names, and names to skip.
  4793. */
  4794. exports.names = [];
  4795. exports.skips = [];
  4796. /**
  4797. * Map of special "%n" handling functions, for the debug "format" argument.
  4798. *
  4799. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  4800. */
  4801. exports.formatters = {};
  4802. /**
  4803. * Select a color.
  4804. * @param {String} namespace
  4805. * @return {Number}
  4806. * @api private
  4807. */
  4808. function selectColor(namespace) {
  4809. var hash = 0, i;
  4810. for (i in namespace) {
  4811. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  4812. hash |= 0; // Convert to 32bit integer
  4813. }
  4814. return exports.colors[Math.abs(hash) % exports.colors.length];
  4815. }
  4816. /**
  4817. * Create a debugger with the given `namespace`.
  4818. *
  4819. * @param {String} namespace
  4820. * @return {Function}
  4821. * @api public
  4822. */
  4823. function createDebug(namespace) {
  4824. var prevTime;
  4825. function debug() {
  4826. // disabled?
  4827. if (!debug.enabled) return;
  4828. var self = debug;
  4829. // set `diff` timestamp
  4830. var curr = +new Date();
  4831. var ms = curr - (prevTime || curr);
  4832. self.diff = ms;
  4833. self.prev = prevTime;
  4834. self.curr = curr;
  4835. prevTime = curr;
  4836. // turn the `arguments` into a proper Array
  4837. var args = new Array(arguments.length);
  4838. for (var i = 0; i < args.length; i++) {
  4839. args[i] = arguments[i];
  4840. }
  4841. args[0] = exports.coerce(args[0]);
  4842. if ('string' !== typeof args[0]) {
  4843. // anything else let's inspect with %O
  4844. args.unshift('%O');
  4845. }
  4846. // apply any `formatters` transformations
  4847. var index = 0;
  4848. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  4849. // if we encounter an escaped % then don't increase the array index
  4850. if (match === '%%') return match;
  4851. index++;
  4852. var formatter = exports.formatters[format];
  4853. if ('function' === typeof formatter) {
  4854. var val = args[index];
  4855. match = formatter.call(self, val);
  4856. // now we need to remove `args[index]` since it's inlined in the `format`
  4857. args.splice(index, 1);
  4858. index--;
  4859. }
  4860. return match;
  4861. });
  4862. // apply env-specific formatting (colors, etc.)
  4863. exports.formatArgs.call(self, args);
  4864. var logFn = debug.log || exports.log || console.log.bind(console);
  4865. logFn.apply(self, args);
  4866. }
  4867. debug.namespace = namespace;
  4868. debug.enabled = exports.enabled(namespace);
  4869. debug.useColors = exports.useColors();
  4870. debug.color = selectColor(namespace);
  4871. debug.destroy = destroy;
  4872. // env-specific initialization logic for debug instances
  4873. if ('function' === typeof exports.init) {
  4874. exports.init(debug);
  4875. }
  4876. exports.instances.push(debug);
  4877. return debug;
  4878. }
  4879. function destroy () {
  4880. var index = exports.instances.indexOf(this);
  4881. if (index !== -1) {
  4882. exports.instances.splice(index, 1);
  4883. return true;
  4884. } else {
  4885. return false;
  4886. }
  4887. }
  4888. /**
  4889. * Enables a debug mode by namespaces. This can include modes
  4890. * separated by a colon and wildcards.
  4891. *
  4892. * @param {String} namespaces
  4893. * @api public
  4894. */
  4895. function enable(namespaces) {
  4896. exports.save(namespaces);
  4897. exports.names = [];
  4898. exports.skips = [];
  4899. var i;
  4900. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  4901. var len = split.length;
  4902. for (i = 0; i < len; i++) {
  4903. if (!split[i]) continue; // ignore empty strings
  4904. namespaces = split[i].replace(/\*/g, '.*?');
  4905. if (namespaces[0] === '-') {
  4906. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  4907. } else {
  4908. exports.names.push(new RegExp('^' + namespaces + '$'));
  4909. }
  4910. }
  4911. for (i = 0; i < exports.instances.length; i++) {
  4912. var instance = exports.instances[i];
  4913. instance.enabled = exports.enabled(instance.namespace);
  4914. }
  4915. }
  4916. /**
  4917. * Disable debug output.
  4918. *
  4919. * @api public
  4920. */
  4921. function disable() {
  4922. exports.enable('');
  4923. }
  4924. /**
  4925. * Returns true if the given mode name is enabled, false otherwise.
  4926. *
  4927. * @param {String} name
  4928. * @return {Boolean}
  4929. * @api public
  4930. */
  4931. function enabled(name) {
  4932. if (name[name.length - 1] === '*') {
  4933. return true;
  4934. }
  4935. var i, len;
  4936. for (i = 0, len = exports.skips.length; i < len; i++) {
  4937. if (exports.skips[i].test(name)) {
  4938. return false;
  4939. }
  4940. }
  4941. for (i = 0, len = exports.names.length; i < len; i++) {
  4942. if (exports.names[i].test(name)) {
  4943. return true;
  4944. }
  4945. }
  4946. return false;
  4947. }
  4948. /**
  4949. * Coerce `val`.
  4950. *
  4951. * @param {Mixed} val
  4952. * @return {Mixed}
  4953. * @api private
  4954. */
  4955. function coerce(val) {
  4956. if (val instanceof Error) return val.stack || val.message;
  4957. return val;
  4958. }
  4959. /***/ }),
  4960. /* 113 */,
  4961. /* 114 */
  4962. /***/ (function(module, exports, __webpack_require__) {
  4963. module.exports = realpath
  4964. realpath.realpath = realpath
  4965. realpath.sync = realpathSync
  4966. realpath.realpathSync = realpathSync
  4967. realpath.monkeypatch = monkeypatch
  4968. realpath.unmonkeypatch = unmonkeypatch
  4969. var fs = __webpack_require__(3)
  4970. var origRealpath = fs.realpath
  4971. var origRealpathSync = fs.realpathSync
  4972. var version = process.version
  4973. var ok = /^v[0-5]\./.test(version)
  4974. var old = __webpack_require__(217)
  4975. function newError (er) {
  4976. return er && er.syscall === 'realpath' && (
  4977. er.code === 'ELOOP' ||
  4978. er.code === 'ENOMEM' ||
  4979. er.code === 'ENAMETOOLONG'
  4980. )
  4981. }
  4982. function realpath (p, cache, cb) {
  4983. if (ok) {
  4984. return origRealpath(p, cache, cb)
  4985. }
  4986. if (typeof cache === 'function') {
  4987. cb = cache
  4988. cache = null
  4989. }
  4990. origRealpath(p, cache, function (er, result) {
  4991. if (newError(er)) {
  4992. old.realpath(p, cache, cb)
  4993. } else {
  4994. cb(er, result)
  4995. }
  4996. })
  4997. }
  4998. function realpathSync (p, cache) {
  4999. if (ok) {
  5000. return origRealpathSync(p, cache)
  5001. }
  5002. try {
  5003. return origRealpathSync(p, cache)
  5004. } catch (er) {
  5005. if (newError(er)) {
  5006. return old.realpathSync(p, cache)
  5007. } else {
  5008. throw er
  5009. }
  5010. }
  5011. }
  5012. function monkeypatch () {
  5013. fs.realpath = realpath
  5014. fs.realpathSync = realpathSync
  5015. }
  5016. function unmonkeypatch () {
  5017. fs.realpath = origRealpath
  5018. fs.realpathSync = origRealpathSync
  5019. }
  5020. /***/ }),
  5021. /* 115 */
  5022. /***/ (function(module, exports, __webpack_require__) {
  5023. exports.alphasort = alphasort
  5024. exports.alphasorti = alphasorti
  5025. exports.setopts = setopts
  5026. exports.ownProp = ownProp
  5027. exports.makeAbs = makeAbs
  5028. exports.finish = finish
  5029. exports.mark = mark
  5030. exports.isIgnored = isIgnored
  5031. exports.childrenIgnored = childrenIgnored
  5032. function ownProp (obj, field) {
  5033. return Object.prototype.hasOwnProperty.call(obj, field)
  5034. }
  5035. var path = __webpack_require__(0)
  5036. var minimatch = __webpack_require__(60)
  5037. var isAbsolute = __webpack_require__(76)
  5038. var Minimatch = minimatch.Minimatch
  5039. function alphasorti (a, b) {
  5040. return a.toLowerCase().localeCompare(b.toLowerCase())
  5041. }
  5042. function alphasort (a, b) {
  5043. return a.localeCompare(b)
  5044. }
  5045. function setupIgnores (self, options) {
  5046. self.ignore = options.ignore || []
  5047. if (!Array.isArray(self.ignore))
  5048. self.ignore = [self.ignore]
  5049. if (self.ignore.length) {
  5050. self.ignore = self.ignore.map(ignoreMap)
  5051. }
  5052. }
  5053. // ignore patterns are always in dot:true mode.
  5054. function ignoreMap (pattern) {
  5055. var gmatcher = null
  5056. if (pattern.slice(-3) === '/**') {
  5057. var gpattern = pattern.replace(/(\/\*\*)+$/, '')
  5058. gmatcher = new Minimatch(gpattern, { dot: true })
  5059. }
  5060. return {
  5061. matcher: new Minimatch(pattern, { dot: true }),
  5062. gmatcher: gmatcher
  5063. }
  5064. }
  5065. function setopts (self, pattern, options) {
  5066. if (!options)
  5067. options = {}
  5068. // base-matching: just use globstar for that.
  5069. if (options.matchBase && -1 === pattern.indexOf("/")) {
  5070. if (options.noglobstar) {
  5071. throw new Error("base matching requires globstar")
  5072. }
  5073. pattern = "**/" + pattern
  5074. }
  5075. self.silent = !!options.silent
  5076. self.pattern = pattern
  5077. self.strict = options.strict !== false
  5078. self.realpath = !!options.realpath
  5079. self.realpathCache = options.realpathCache || Object.create(null)
  5080. self.follow = !!options.follow
  5081. self.dot = !!options.dot
  5082. self.mark = !!options.mark
  5083. self.nodir = !!options.nodir
  5084. if (self.nodir)
  5085. self.mark = true
  5086. self.sync = !!options.sync
  5087. self.nounique = !!options.nounique
  5088. self.nonull = !!options.nonull
  5089. self.nosort = !!options.nosort
  5090. self.nocase = !!options.nocase
  5091. self.stat = !!options.stat
  5092. self.noprocess = !!options.noprocess
  5093. self.absolute = !!options.absolute
  5094. self.maxLength = options.maxLength || Infinity
  5095. self.cache = options.cache || Object.create(null)
  5096. self.statCache = options.statCache || Object.create(null)
  5097. self.symlinks = options.symlinks || Object.create(null)
  5098. setupIgnores(self, options)
  5099. self.changedCwd = false
  5100. var cwd = process.cwd()
  5101. if (!ownProp(options, "cwd"))
  5102. self.cwd = cwd
  5103. else {
  5104. self.cwd = path.resolve(options.cwd)
  5105. self.changedCwd = self.cwd !== cwd
  5106. }
  5107. self.root = options.root || path.resolve(self.cwd, "/")
  5108. self.root = path.resolve(self.root)
  5109. if (process.platform === "win32")
  5110. self.root = self.root.replace(/\\/g, "/")
  5111. // TODO: is an absolute `cwd` supposed to be resolved against `root`?
  5112. // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
  5113. self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
  5114. if (process.platform === "win32")
  5115. self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
  5116. self.nomount = !!options.nomount
  5117. // disable comments and negation in Minimatch.
  5118. // Note that they are not supported in Glob itself anyway.
  5119. options.nonegate = true
  5120. options.nocomment = true
  5121. self.minimatch = new Minimatch(pattern, options)
  5122. self.options = self.minimatch.options
  5123. }
  5124. function finish (self) {
  5125. var nou = self.nounique
  5126. var all = nou ? [] : Object.create(null)
  5127. for (var i = 0, l = self.matches.length; i < l; i ++) {
  5128. var matches = self.matches[i]
  5129. if (!matches || Object.keys(matches).length === 0) {
  5130. if (self.nonull) {
  5131. // do like the shell, and spit out the literal glob
  5132. var literal = self.minimatch.globSet[i]
  5133. if (nou)
  5134. all.push(literal)
  5135. else
  5136. all[literal] = true
  5137. }
  5138. } else {
  5139. // had matches
  5140. var m = Object.keys(matches)
  5141. if (nou)
  5142. all.push.apply(all, m)
  5143. else
  5144. m.forEach(function (m) {
  5145. all[m] = true
  5146. })
  5147. }
  5148. }
  5149. if (!nou)
  5150. all = Object.keys(all)
  5151. if (!self.nosort)
  5152. all = all.sort(self.nocase ? alphasorti : alphasort)
  5153. // at *some* point we statted all of these
  5154. if (self.mark) {
  5155. for (var i = 0; i < all.length; i++) {
  5156. all[i] = self._mark(all[i])
  5157. }
  5158. if (self.nodir) {
  5159. all = all.filter(function (e) {
  5160. var notDir = !(/\/$/.test(e))
  5161. var c = self.cache[e] || self.cache[makeAbs(self, e)]
  5162. if (notDir && c)
  5163. notDir = c !== 'DIR' && !Array.isArray(c)
  5164. return notDir
  5165. })
  5166. }
  5167. }
  5168. if (self.ignore.length)
  5169. all = all.filter(function(m) {
  5170. return !isIgnored(self, m)
  5171. })
  5172. self.found = all
  5173. }
  5174. function mark (self, p) {
  5175. var abs = makeAbs(self, p)
  5176. var c = self.cache[abs]
  5177. var m = p
  5178. if (c) {
  5179. var isDir = c === 'DIR' || Array.isArray(c)
  5180. var slash = p.slice(-1) === '/'
  5181. if (isDir && !slash)
  5182. m += '/'
  5183. else if (!isDir && slash)
  5184. m = m.slice(0, -1)
  5185. if (m !== p) {
  5186. var mabs = makeAbs(self, m)
  5187. self.statCache[mabs] = self.statCache[abs]
  5188. self.cache[mabs] = self.cache[abs]
  5189. }
  5190. }
  5191. return m
  5192. }
  5193. // lotta situps...
  5194. function makeAbs (self, f) {
  5195. var abs = f
  5196. if (f.charAt(0) === '/') {
  5197. abs = path.join(self.root, f)
  5198. } else if (isAbsolute(f) || f === '') {
  5199. abs = f
  5200. } else if (self.changedCwd) {
  5201. abs = path.resolve(self.cwd, f)
  5202. } else {
  5203. abs = path.resolve(f)
  5204. }
  5205. if (process.platform === 'win32')
  5206. abs = abs.replace(/\\/g, '/')
  5207. return abs
  5208. }
  5209. // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
  5210. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
  5211. function isIgnored (self, path) {
  5212. if (!self.ignore.length)
  5213. return false
  5214. return self.ignore.some(function(item) {
  5215. return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  5216. })
  5217. }
  5218. function childrenIgnored (self, path) {
  5219. if (!self.ignore.length)
  5220. return false
  5221. return self.ignore.some(function(item) {
  5222. return !!(item.gmatcher && item.gmatcher.match(path))
  5223. })
  5224. }
  5225. /***/ }),
  5226. /* 116 */
  5227. /***/ (function(module, exports, __webpack_require__) {
  5228. var path = __webpack_require__(0);
  5229. var fs = __webpack_require__(3);
  5230. var _0777 = parseInt('0777', 8);
  5231. module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
  5232. function mkdirP (p, opts, f, made) {
  5233. if (typeof opts === 'function') {
  5234. f = opts;
  5235. opts = {};
  5236. }
  5237. else if (!opts || typeof opts !== 'object') {
  5238. opts = { mode: opts };
  5239. }
  5240. var mode = opts.mode;
  5241. var xfs = opts.fs || fs;
  5242. if (mode === undefined) {
  5243. mode = _0777 & (~process.umask());
  5244. }
  5245. if (!made) made = null;
  5246. var cb = f || function () {};
  5247. p = path.resolve(p);
  5248. xfs.mkdir(p, mode, function (er) {
  5249. if (!er) {
  5250. made = made || p;
  5251. return cb(null, made);
  5252. }
  5253. switch (er.code) {
  5254. case 'ENOENT':
  5255. mkdirP(path.dirname(p), opts, function (er, made) {
  5256. if (er) cb(er, made);
  5257. else mkdirP(p, opts, cb, made);
  5258. });
  5259. break;
  5260. // In the case of any other error, just see if there's a dir
  5261. // there already. If so, then hooray! If not, then something
  5262. // is borked.
  5263. default:
  5264. xfs.stat(p, function (er2, stat) {
  5265. // if the stat fails, then that's super weird.
  5266. // let the original error be the failure reason.
  5267. if (er2 || !stat.isDirectory()) cb(er, made)
  5268. else cb(null, made);
  5269. });
  5270. break;
  5271. }
  5272. });
  5273. }
  5274. mkdirP.sync = function sync (p, opts, made) {
  5275. if (!opts || typeof opts !== 'object') {
  5276. opts = { mode: opts };
  5277. }
  5278. var mode = opts.mode;
  5279. var xfs = opts.fs || fs;
  5280. if (mode === undefined) {
  5281. mode = _0777 & (~process.umask());
  5282. }
  5283. if (!made) made = null;
  5284. p = path.resolve(p);
  5285. try {
  5286. xfs.mkdirSync(p, mode);
  5287. made = made || p;
  5288. }
  5289. catch (err0) {
  5290. switch (err0.code) {
  5291. case 'ENOENT' :
  5292. made = sync(path.dirname(p), opts, made);
  5293. sync(p, opts, made);
  5294. break;
  5295. // In the case of any other error, just see if there's a dir
  5296. // there already. If so, then hooray! If not, then something
  5297. // is borked.
  5298. default:
  5299. var stat;
  5300. try {
  5301. stat = xfs.statSync(p);
  5302. }
  5303. catch (err1) {
  5304. throw err0;
  5305. }
  5306. if (!stat.isDirectory()) throw err0;
  5307. break;
  5308. }
  5309. }
  5310. return made;
  5311. };
  5312. /***/ }),
  5313. /* 117 */,
  5314. /* 118 */,
  5315. /* 119 */,
  5316. /* 120 */,
  5317. /* 121 */,
  5318. /* 122 */
  5319. /***/ (function(module, exports, __webpack_require__) {
  5320. "use strict";
  5321. module.exports = x => {
  5322. if (typeof x !== 'string') {
  5323. throw new TypeError('Expected a string, got ' + typeof x);
  5324. }
  5325. // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
  5326. // conversion translates it to FEFF (UTF-16 BOM)
  5327. if (x.charCodeAt(0) === 0xFEFF) {
  5328. return x.slice(1);
  5329. }
  5330. return x;
  5331. };
  5332. /***/ }),
  5333. /* 123 */
  5334. /***/ (function(module, exports) {
  5335. // Returns a wrapper function that returns a wrapped callback
  5336. // The wrapper function should do some stuff, and return a
  5337. // presumably different callback function.
  5338. // This makes sure that own properties are retained, so that
  5339. // decorations and such are not lost along the way.
  5340. module.exports = wrappy
  5341. function wrappy (fn, cb) {
  5342. if (fn && cb) return wrappy(fn)(cb)
  5343. if (typeof fn !== 'function')
  5344. throw new TypeError('need wrapper function')
  5345. Object.keys(fn).forEach(function (k) {
  5346. wrapper[k] = fn[k]
  5347. })
  5348. return wrapper
  5349. function wrapper() {
  5350. var args = new Array(arguments.length)
  5351. for (var i = 0; i < args.length; i++) {
  5352. args[i] = arguments[i]
  5353. }
  5354. var ret = fn.apply(this, args)
  5355. var cb = args[args.length-1]
  5356. if (typeof ret === 'function' && ret !== cb) {
  5357. Object.keys(cb).forEach(function (k) {
  5358. ret[k] = cb[k]
  5359. })
  5360. }
  5361. return ret
  5362. }
  5363. }
  5364. /***/ }),
  5365. /* 124 */,
  5366. /* 125 */,
  5367. /* 126 */,
  5368. /* 127 */,
  5369. /* 128 */,
  5370. /* 129 */,
  5371. /* 130 */,
  5372. /* 131 */
  5373. /***/ (function(module, exports, __webpack_require__) {
  5374. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  5375. var cof = __webpack_require__(47);
  5376. // eslint-disable-next-line no-prototype-builtins
  5377. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  5378. return cof(it) == 'String' ? it.split('') : Object(it);
  5379. };
  5380. /***/ }),
  5381. /* 132 */
  5382. /***/ (function(module, exports, __webpack_require__) {
  5383. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  5384. var $keys = __webpack_require__(195);
  5385. var enumBugKeys = __webpack_require__(101);
  5386. module.exports = Object.keys || function keys(O) {
  5387. return $keys(O, enumBugKeys);
  5388. };
  5389. /***/ }),
  5390. /* 133 */
  5391. /***/ (function(module, exports, __webpack_require__) {
  5392. // 7.1.13 ToObject(argument)
  5393. var defined = __webpack_require__(67);
  5394. module.exports = function (it) {
  5395. return Object(defined(it));
  5396. };
  5397. /***/ }),
  5398. /* 134 */,
  5399. /* 135 */,
  5400. /* 136 */,
  5401. /* 137 */,
  5402. /* 138 */,
  5403. /* 139 */,
  5404. /* 140 */,
  5405. /* 141 */,
  5406. /* 142 */,
  5407. /* 143 */,
  5408. /* 144 */,
  5409. /* 145 */
  5410. /***/ (function(module, exports) {
  5411. module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.10.0-0","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^2.2.4","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^3.0.1","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.3","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.24","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.10.0","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^3.9.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","gulp-util":"^3.0.7","gulp-watch":"^5.0.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
  5412. /***/ }),
  5413. /* 146 */,
  5414. /* 147 */,
  5415. /* 148 */,
  5416. /* 149 */,
  5417. /* 150 */
  5418. /***/ (function(module, exports, __webpack_require__) {
  5419. "use strict";
  5420. Object.defineProperty(exports, "__esModule", {
  5421. value: true
  5422. });
  5423. exports.default = stringify;
  5424. var _misc;
  5425. function _load_misc() {
  5426. return _misc = __webpack_require__(12);
  5427. }
  5428. var _constants;
  5429. function _load_constants() {
  5430. return _constants = __webpack_require__(6);
  5431. }
  5432. var _package;
  5433. function _load_package() {
  5434. return _package = __webpack_require__(145);
  5435. }
  5436. const NODE_VERSION = process.version;
  5437. function shouldWrapKey(str) {
  5438. return str.indexOf('true') === 0 || str.indexOf('false') === 0 || /[:\s\n\\",\[\]]/g.test(str) || /^[0-9]/g.test(str) || !/^[a-zA-Z]/g.test(str);
  5439. }
  5440. function maybeWrap(str) {
  5441. if (typeof str === 'boolean' || typeof str === 'number' || shouldWrapKey(str)) {
  5442. return JSON.stringify(str);
  5443. } else {
  5444. return str;
  5445. }
  5446. }
  5447. const priorities = {
  5448. name: 1,
  5449. version: 2,
  5450. uid: 3,
  5451. resolved: 4,
  5452. integrity: 5,
  5453. registry: 6,
  5454. dependencies: 7
  5455. };
  5456. function priorityThenAlphaSort(a, b) {
  5457. if (priorities[a] || priorities[b]) {
  5458. return (priorities[a] || 100) > (priorities[b] || 100) ? 1 : -1;
  5459. } else {
  5460. return (0, (_misc || _load_misc()).sortAlpha)(a, b);
  5461. }
  5462. }
  5463. function _stringify(obj, options) {
  5464. if (typeof obj !== 'object') {
  5465. throw new TypeError();
  5466. }
  5467. const indent = options.indent;
  5468. const lines = [];
  5469. // Sorting order needs to be consistent between runs, we run native sort by name because there are no
  5470. // problems with it being unstable because there are no to keys the same
  5471. // However priorities can be duplicated and native sort can shuffle things from run to run
  5472. const keys = Object.keys(obj).sort(priorityThenAlphaSort);
  5473. let addedKeys = [];
  5474. for (let i = 0; i < keys.length; i++) {
  5475. const key = keys[i];
  5476. const val = obj[key];
  5477. if (val == null || addedKeys.indexOf(key) >= 0) {
  5478. continue;
  5479. }
  5480. const valKeys = [key];
  5481. // get all keys that have the same value equality, we only want this for objects
  5482. if (typeof val === 'object') {
  5483. for (let j = i + 1; j < keys.length; j++) {
  5484. const key = keys[j];
  5485. if (val === obj[key]) {
  5486. valKeys.push(key);
  5487. }
  5488. }
  5489. }
  5490. const keyLine = valKeys.sort((_misc || _load_misc()).sortAlpha).map(maybeWrap).join(', ');
  5491. if (typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number') {
  5492. lines.push(`${keyLine} ${maybeWrap(val)}`);
  5493. } else if (typeof val === 'object') {
  5494. lines.push(`${keyLine}:\n${_stringify(val, { indent: indent + ' ' })}` + (options.topLevel ? '\n' : ''));
  5495. } else {
  5496. throw new TypeError();
  5497. }
  5498. addedKeys = addedKeys.concat(valKeys);
  5499. }
  5500. return indent + lines.join(`\n${indent}`);
  5501. }
  5502. function stringify(obj, noHeader, enableVersions) {
  5503. const val = _stringify(obj, {
  5504. indent: '',
  5505. topLevel: true
  5506. });
  5507. if (noHeader) {
  5508. return val;
  5509. }
  5510. const lines = [];
  5511. lines.push('# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.');
  5512. lines.push(`# yarn lockfile v${(_constants || _load_constants()).LOCKFILE_VERSION}`);
  5513. if (enableVersions) {
  5514. lines.push(`# yarn v${(_package || _load_package()).version}`);
  5515. lines.push(`# node ${NODE_VERSION}`);
  5516. }
  5517. lines.push('\n');
  5518. lines.push(val);
  5519. return lines.join('\n');
  5520. }
  5521. /***/ }),
  5522. /* 151 */,
  5523. /* 152 */,
  5524. /* 153 */,
  5525. /* 154 */,
  5526. /* 155 */,
  5527. /* 156 */,
  5528. /* 157 */,
  5529. /* 158 */,
  5530. /* 159 */,
  5531. /* 160 */,
  5532. /* 161 */,
  5533. /* 162 */,
  5534. /* 163 */,
  5535. /* 164 */
  5536. /***/ (function(module, exports, __webpack_require__) {
  5537. "use strict";
  5538. Object.defineProperty(exports, "__esModule", {
  5539. value: true
  5540. });
  5541. exports.fileDatesEqual = exports.copyFile = exports.unlink = undefined;
  5542. var _asyncToGenerator2;
  5543. function _load_asyncToGenerator() {
  5544. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1));
  5545. }
  5546. // We want to preserve file timestamps when copying a file, since yarn uses them to decide if a file has
  5547. // changed compared to the cache.
  5548. // There are some OS specific cases here:
  5549. // * On linux, fs.copyFile does not preserve timestamps, but does on OSX and Win.
  5550. // * On windows, you must open a file with write permissions to call `fs.futimes`.
  5551. // * On OSX you can open with read permissions and still call `fs.futimes`.
  5552. let fixTimes = (() => {
  5553. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fd, dest, data) {
  5554. const doOpen = fd === undefined;
  5555. let openfd = fd ? fd : -1;
  5556. if (disableTimestampCorrection === undefined) {
  5557. // if timestamps match already, no correction is needed.
  5558. // the need to correct timestamps varies based on OS and node versions.
  5559. const destStat = yield lstat(dest);
  5560. disableTimestampCorrection = fileDatesEqual(destStat.mtime, data.mtime);
  5561. }
  5562. if (disableTimestampCorrection) {
  5563. return;
  5564. }
  5565. if (doOpen) {
  5566. try {
  5567. openfd = yield open(dest, 'a', data.mode);
  5568. } catch (er) {
  5569. // file is likely read-only
  5570. try {
  5571. openfd = yield open(dest, 'r', data.mode);
  5572. } catch (err) {
  5573. // We can't even open this file for reading.
  5574. return;
  5575. }
  5576. }
  5577. }
  5578. try {
  5579. if (openfd) {
  5580. yield futimes(openfd, data.atime, data.mtime);
  5581. }
  5582. } catch (er) {
  5583. // If `futimes` throws an exception, we probably have a case of a read-only file on Windows.
  5584. // In this case we can just return. The incorrect timestamp will just cause that file to be recopied
  5585. // on subsequent installs, which will effect yarn performance but not break anything.
  5586. } finally {
  5587. if (doOpen && openfd) {
  5588. yield close(openfd);
  5589. }
  5590. }
  5591. });
  5592. return function fixTimes(_x7, _x8, _x9) {
  5593. return _ref3.apply(this, arguments);
  5594. };
  5595. })();
  5596. // Compare file timestamps.
  5597. // Some versions of Node on windows zero the milliseconds when utime is used.
  5598. var _fs;
  5599. function _load_fs() {
  5600. return _fs = _interopRequireDefault(__webpack_require__(3));
  5601. }
  5602. var _promise;
  5603. function _load_promise() {
  5604. return _promise = __webpack_require__(40);
  5605. }
  5606. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5607. // This module serves as a wrapper for file operations that are inconsistant across node and OS versions.
  5608. let disableTimestampCorrection = undefined; // OS dependent. will be detected on first file copy.
  5609. const readFileBuffer = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.readFile);
  5610. const close = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.close);
  5611. const lstat = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.lstat);
  5612. const open = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.open);
  5613. const futimes = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.futimes);
  5614. const write = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.write);
  5615. const unlink = exports.unlink = (0, (_promise || _load_promise()).promisify)(__webpack_require__(233));
  5616. /**
  5617. * Unlinks the destination to force a recreation. This is needed on case-insensitive file systems
  5618. * to force the correct naming when the filename has changed only in character-casing. (Jest -> jest).
  5619. */
  5620. const copyFile = exports.copyFile = (() => {
  5621. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) {
  5622. try {
  5623. yield unlink(data.dest);
  5624. yield copyFilePoly(data.src, data.dest, 0, data);
  5625. } finally {
  5626. if (cleanup) {
  5627. cleanup();
  5628. }
  5629. }
  5630. });
  5631. return function copyFile(_x, _x2) {
  5632. return _ref.apply(this, arguments);
  5633. };
  5634. })();
  5635. // Node 8.5.0 introduced `fs.copyFile` which is much faster, so use that when available.
  5636. // Otherwise we fall back to reading and writing files as buffers.
  5637. const copyFilePoly = (src, dest, flags, data) => {
  5638. if ((_fs || _load_fs()).default.copyFile) {
  5639. return new Promise((resolve, reject) => (_fs || _load_fs()).default.copyFile(src, dest, flags, err => {
  5640. if (err) {
  5641. reject(err);
  5642. } else {
  5643. fixTimes(undefined, dest, data).then(() => resolve()).catch(ex => reject(ex));
  5644. }
  5645. }));
  5646. } else {
  5647. return copyWithBuffer(src, dest, flags, data);
  5648. }
  5649. };
  5650. const copyWithBuffer = (() => {
  5651. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) {
  5652. // Use open -> write -> futimes -> close sequence to avoid opening the file twice:
  5653. // one with writeFile and one with utimes
  5654. const fd = yield open(dest, 'w', data.mode);
  5655. try {
  5656. const buffer = yield readFileBuffer(src);
  5657. yield write(fd, buffer, 0, buffer.length);
  5658. yield fixTimes(fd, dest, data);
  5659. } finally {
  5660. yield close(fd);
  5661. }
  5662. });
  5663. return function copyWithBuffer(_x3, _x4, _x5, _x6) {
  5664. return _ref2.apply(this, arguments);
  5665. };
  5666. })();const fileDatesEqual = exports.fileDatesEqual = (a, b) => {
  5667. const aTime = a.getTime();
  5668. const bTime = b.getTime();
  5669. if (process.platform !== 'win32') {
  5670. return aTime === bTime;
  5671. }
  5672. // See https://github.com/nodejs/node/pull/12607
  5673. // Submillisecond times from stat and utimes are truncated on Windows,
  5674. // causing a file with mtime 8.0079998 and 8.0081144 to become 8.007 and 8.008
  5675. // and making it impossible to update these files to their correct timestamps.
  5676. if (Math.abs(aTime - bTime) <= 1) {
  5677. return true;
  5678. }
  5679. const aTimeSec = Math.floor(aTime / 1000);
  5680. const bTimeSec = Math.floor(bTime / 1000);
  5681. // See https://github.com/nodejs/node/issues/2069
  5682. // Some versions of Node on windows zero the milliseconds when utime is used
  5683. // So if any of the time has a milliseconds part of zero we suspect that the
  5684. // bug is present and compare only seconds.
  5685. if (aTime - aTimeSec * 1000 === 0 || bTime - bTimeSec * 1000 === 0) {
  5686. return aTimeSec === bTimeSec;
  5687. }
  5688. return aTime === bTime;
  5689. };
  5690. /***/ }),
  5691. /* 165 */,
  5692. /* 166 */,
  5693. /* 167 */,
  5694. /* 168 */,
  5695. /* 169 */
  5696. /***/ (function(module, exports, __webpack_require__) {
  5697. "use strict";
  5698. Object.defineProperty(exports, "__esModule", {
  5699. value: true
  5700. });
  5701. exports.isFakeRoot = isFakeRoot;
  5702. exports.isRootUser = isRootUser;
  5703. function getUid() {
  5704. if (process.platform !== 'win32' && process.getuid) {
  5705. return process.getuid();
  5706. }
  5707. return null;
  5708. }
  5709. exports.default = isRootUser(getUid()) && !isFakeRoot();
  5710. function isFakeRoot() {
  5711. return Boolean(process.env.FAKEROOTKEY);
  5712. }
  5713. function isRootUser(uid) {
  5714. return uid === 0;
  5715. }
  5716. /***/ }),
  5717. /* 170 */,
  5718. /* 171 */
  5719. /***/ (function(module, exports, __webpack_require__) {
  5720. "use strict";
  5721. Object.defineProperty(exports, "__esModule", {
  5722. value: true
  5723. });
  5724. exports.getDataDir = getDataDir;
  5725. exports.getCacheDir = getCacheDir;
  5726. exports.getConfigDir = getConfigDir;
  5727. const path = __webpack_require__(0);
  5728. const userHome = __webpack_require__(45).default;
  5729. const FALLBACK_CONFIG_DIR = path.join(userHome, '.config', 'yarn');
  5730. const FALLBACK_CACHE_DIR = path.join(userHome, '.cache', 'yarn');
  5731. function getDataDir() {
  5732. if (process.platform === 'win32') {
  5733. const WIN32_APPDATA_DIR = getLocalAppDataDir();
  5734. return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Data');
  5735. } else if (process.env.XDG_DATA_HOME) {
  5736. return path.join(process.env.XDG_DATA_HOME, 'yarn');
  5737. } else {
  5738. // This could arguably be ~/Library/Application Support/Yarn on Macs,
  5739. // but that feels unintuitive for a cli tool
  5740. // Instead, use our prior fallback. Some day this could be
  5741. // path.join(userHome, '.local', 'share', 'yarn')
  5742. // or return path.join(WIN32_APPDATA_DIR, 'Data') on win32
  5743. return FALLBACK_CONFIG_DIR;
  5744. }
  5745. }
  5746. function getCacheDir() {
  5747. if (process.platform === 'win32') {
  5748. // process.env.TEMP also exists, but most apps put caches here
  5749. return path.join(getLocalAppDataDir() || path.join(userHome, 'AppData', 'Local', 'Yarn'), 'Cache');
  5750. } else if (process.env.XDG_CACHE_HOME) {
  5751. return path.join(process.env.XDG_CACHE_HOME, 'yarn');
  5752. } else if (process.platform === 'darwin') {
  5753. return path.join(userHome, 'Library', 'Caches', 'Yarn');
  5754. } else {
  5755. return FALLBACK_CACHE_DIR;
  5756. }
  5757. }
  5758. function getConfigDir() {
  5759. if (process.platform === 'win32') {
  5760. // Use our prior fallback. Some day this could be
  5761. // return path.join(WIN32_APPDATA_DIR, 'Config')
  5762. const WIN32_APPDATA_DIR = getLocalAppDataDir();
  5763. return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Config');
  5764. } else if (process.env.XDG_CONFIG_HOME) {
  5765. return path.join(process.env.XDG_CONFIG_HOME, 'yarn');
  5766. } else {
  5767. return FALLBACK_CONFIG_DIR;
  5768. }
  5769. }
  5770. function getLocalAppDataDir() {
  5771. return process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, 'Yarn') : null;
  5772. }
  5773. /***/ }),
  5774. /* 172 */,
  5775. /* 173 */
  5776. /***/ (function(module, exports, __webpack_require__) {
  5777. module.exports = { "default": __webpack_require__(179), __esModule: true };
  5778. /***/ }),
  5779. /* 174 */
  5780. /***/ (function(module, exports, __webpack_require__) {
  5781. "use strict";
  5782. module.exports = balanced;
  5783. function balanced(a, b, str) {
  5784. if (a instanceof RegExp) a = maybeMatch(a, str);
  5785. if (b instanceof RegExp) b = maybeMatch(b, str);
  5786. var r = range(a, b, str);
  5787. return r && {
  5788. start: r[0],
  5789. end: r[1],
  5790. pre: str.slice(0, r[0]),
  5791. body: str.slice(r[0] + a.length, r[1]),
  5792. post: str.slice(r[1] + b.length)
  5793. };
  5794. }
  5795. function maybeMatch(reg, str) {
  5796. var m = str.match(reg);
  5797. return m ? m[0] : null;
  5798. }
  5799. balanced.range = range;
  5800. function range(a, b, str) {
  5801. var begs, beg, left, right, result;
  5802. var ai = str.indexOf(a);
  5803. var bi = str.indexOf(b, ai + 1);
  5804. var i = ai;
  5805. if (ai >= 0 && bi > 0) {
  5806. begs = [];
  5807. left = str.length;
  5808. while (i >= 0 && !result) {
  5809. if (i == ai) {
  5810. begs.push(i);
  5811. ai = str.indexOf(a, i + 1);
  5812. } else if (begs.length == 1) {
  5813. result = [ begs.pop(), bi ];
  5814. } else {
  5815. beg = begs.pop();
  5816. if (beg < left) {
  5817. left = beg;
  5818. right = bi;
  5819. }
  5820. bi = str.indexOf(b, i + 1);
  5821. }
  5822. i = ai < bi && ai >= 0 ? ai : bi;
  5823. }
  5824. if (begs.length) {
  5825. result = [ left, right ];
  5826. }
  5827. }
  5828. return result;
  5829. }
  5830. /***/ }),
  5831. /* 175 */
  5832. /***/ (function(module, exports, __webpack_require__) {
  5833. var concatMap = __webpack_require__(178);
  5834. var balanced = __webpack_require__(174);
  5835. module.exports = expandTop;
  5836. var escSlash = '\0SLASH'+Math.random()+'\0';
  5837. var escOpen = '\0OPEN'+Math.random()+'\0';
  5838. var escClose = '\0CLOSE'+Math.random()+'\0';
  5839. var escComma = '\0COMMA'+Math.random()+'\0';
  5840. var escPeriod = '\0PERIOD'+Math.random()+'\0';
  5841. function numeric(str) {
  5842. return parseInt(str, 10) == str
  5843. ? parseInt(str, 10)
  5844. : str.charCodeAt(0);
  5845. }
  5846. function escapeBraces(str) {
  5847. return str.split('\\\\').join(escSlash)
  5848. .split('\\{').join(escOpen)
  5849. .split('\\}').join(escClose)
  5850. .split('\\,').join(escComma)
  5851. .split('\\.').join(escPeriod);
  5852. }
  5853. function unescapeBraces(str) {
  5854. return str.split(escSlash).join('\\')
  5855. .split(escOpen).join('{')
  5856. .split(escClose).join('}')
  5857. .split(escComma).join(',')
  5858. .split(escPeriod).join('.');
  5859. }
  5860. // Basically just str.split(","), but handling cases
  5861. // where we have nested braced sections, which should be
  5862. // treated as individual members, like {a,{b,c},d}
  5863. function parseCommaParts(str) {
  5864. if (!str)
  5865. return [''];
  5866. var parts = [];
  5867. var m = balanced('{', '}', str);
  5868. if (!m)
  5869. return str.split(',');
  5870. var pre = m.pre;
  5871. var body = m.body;
  5872. var post = m.post;
  5873. var p = pre.split(',');
  5874. p[p.length-1] += '{' + body + '}';
  5875. var postParts = parseCommaParts(post);
  5876. if (post.length) {
  5877. p[p.length-1] += postParts.shift();
  5878. p.push.apply(p, postParts);
  5879. }
  5880. parts.push.apply(parts, p);
  5881. return parts;
  5882. }
  5883. function expandTop(str) {
  5884. if (!str)
  5885. return [];
  5886. // I don't know why Bash 4.3 does this, but it does.
  5887. // Anything starting with {} will have the first two bytes preserved
  5888. // but *only* at the top level, so {},a}b will not expand to anything,
  5889. // but a{},b}c will be expanded to [a}c,abc].
  5890. // One could argue that this is a bug in Bash, but since the goal of
  5891. // this module is to match Bash's rules, we escape a leading {}
  5892. if (str.substr(0, 2) === '{}') {
  5893. str = '\\{\\}' + str.substr(2);
  5894. }
  5895. return expand(escapeBraces(str), true).map(unescapeBraces);
  5896. }
  5897. function identity(e) {
  5898. return e;
  5899. }
  5900. function embrace(str) {
  5901. return '{' + str + '}';
  5902. }
  5903. function isPadded(el) {
  5904. return /^-?0\d/.test(el);
  5905. }
  5906. function lte(i, y) {
  5907. return i <= y;
  5908. }
  5909. function gte(i, y) {
  5910. return i >= y;
  5911. }
  5912. function expand(str, isTop) {
  5913. var expansions = [];
  5914. var m = balanced('{', '}', str);
  5915. if (!m || /\$$/.test(m.pre)) return [str];
  5916. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  5917. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  5918. var isSequence = isNumericSequence || isAlphaSequence;
  5919. var isOptions = m.body.indexOf(',') >= 0;
  5920. if (!isSequence && !isOptions) {
  5921. // {a},b}
  5922. if (m.post.match(/,.*\}/)) {
  5923. str = m.pre + '{' + m.body + escClose + m.post;
  5924. return expand(str);
  5925. }
  5926. return [str];
  5927. }
  5928. var n;
  5929. if (isSequence) {
  5930. n = m.body.split(/\.\./);
  5931. } else {
  5932. n = parseCommaParts(m.body);
  5933. if (n.length === 1) {
  5934. // x{{a,b}}y ==> x{a}y x{b}y
  5935. n = expand(n[0], false).map(embrace);
  5936. if (n.length === 1) {
  5937. var post = m.post.length
  5938. ? expand(m.post, false)
  5939. : [''];
  5940. return post.map(function(p) {
  5941. return m.pre + n[0] + p;
  5942. });
  5943. }
  5944. }
  5945. }
  5946. // at this point, n is the parts, and we know it's not a comma set
  5947. // with a single entry.
  5948. // no need to expand pre, since it is guaranteed to be free of brace-sets
  5949. var pre = m.pre;
  5950. var post = m.post.length
  5951. ? expand(m.post, false)
  5952. : [''];
  5953. var N;
  5954. if (isSequence) {
  5955. var x = numeric(n[0]);
  5956. var y = numeric(n[1]);
  5957. var width = Math.max(n[0].length, n[1].length)
  5958. var incr = n.length == 3
  5959. ? Math.abs(numeric(n[2]))
  5960. : 1;
  5961. var test = lte;
  5962. var reverse = y < x;
  5963. if (reverse) {
  5964. incr *= -1;
  5965. test = gte;
  5966. }
  5967. var pad = n.some(isPadded);
  5968. N = [];
  5969. for (var i = x; test(i, y); i += incr) {
  5970. var c;
  5971. if (isAlphaSequence) {
  5972. c = String.fromCharCode(i);
  5973. if (c === '\\')
  5974. c = '';
  5975. } else {
  5976. c = String(i);
  5977. if (pad) {
  5978. var need = width - c.length;
  5979. if (need > 0) {
  5980. var z = new Array(need + 1).join('0');
  5981. if (i < 0)
  5982. c = '-' + z + c.slice(1);
  5983. else
  5984. c = z + c;
  5985. }
  5986. }
  5987. }
  5988. N.push(c);
  5989. }
  5990. } else {
  5991. N = concatMap(n, function(el) { return expand(el, false) });
  5992. }
  5993. for (var j = 0; j < N.length; j++) {
  5994. for (var k = 0; k < post.length; k++) {
  5995. var expansion = pre + N[j] + post[k];
  5996. if (!isTop || isSequence || expansion)
  5997. expansions.push(expansion);
  5998. }
  5999. }
  6000. return expansions;
  6001. }
  6002. /***/ }),
  6003. /* 176 */
  6004. /***/ (function(module, exports, __webpack_require__) {
  6005. "use strict";
  6006. function preserveCamelCase(str) {
  6007. let isLastCharLower = false;
  6008. let isLastCharUpper = false;
  6009. let isLastLastCharUpper = false;
  6010. for (let i = 0; i < str.length; i++) {
  6011. const c = str[i];
  6012. if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
  6013. str = str.substr(0, i) + '-' + str.substr(i);
  6014. isLastCharLower = false;
  6015. isLastLastCharUpper = isLastCharUpper;
  6016. isLastCharUpper = true;
  6017. i++;
  6018. } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
  6019. str = str.substr(0, i - 1) + '-' + str.substr(i - 1);
  6020. isLastLastCharUpper = isLastCharUpper;
  6021. isLastCharUpper = false;
  6022. isLastCharLower = true;
  6023. } else {
  6024. isLastCharLower = c.toLowerCase() === c;
  6025. isLastLastCharUpper = isLastCharUpper;
  6026. isLastCharUpper = c.toUpperCase() === c;
  6027. }
  6028. }
  6029. return str;
  6030. }
  6031. module.exports = function (str) {
  6032. if (arguments.length > 1) {
  6033. str = Array.from(arguments)
  6034. .map(x => x.trim())
  6035. .filter(x => x.length)
  6036. .join('-');
  6037. } else {
  6038. str = str.trim();
  6039. }
  6040. if (str.length === 0) {
  6041. return '';
  6042. }
  6043. if (str.length === 1) {
  6044. return str.toLowerCase();
  6045. }
  6046. if (/^[a-z0-9]+$/.test(str)) {
  6047. return str;
  6048. }
  6049. const hasUpperCase = str !== str.toLowerCase();
  6050. if (hasUpperCase) {
  6051. str = preserveCamelCase(str);
  6052. }
  6053. return str
  6054. .replace(/^[_.\- ]+/, '')
  6055. .toLowerCase()
  6056. .replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase());
  6057. };
  6058. /***/ }),
  6059. /* 177 */,
  6060. /* 178 */
  6061. /***/ (function(module, exports) {
  6062. module.exports = function (xs, fn) {
  6063. var res = [];
  6064. for (var i = 0; i < xs.length; i++) {
  6065. var x = fn(xs[i], i);
  6066. if (isArray(x)) res.push.apply(res, x);
  6067. else res.push(x);
  6068. }
  6069. return res;
  6070. };
  6071. var isArray = Array.isArray || function (xs) {
  6072. return Object.prototype.toString.call(xs) === '[object Array]';
  6073. };
  6074. /***/ }),
  6075. /* 179 */
  6076. /***/ (function(module, exports, __webpack_require__) {
  6077. __webpack_require__(205);
  6078. __webpack_require__(207);
  6079. __webpack_require__(210);
  6080. __webpack_require__(206);
  6081. __webpack_require__(208);
  6082. __webpack_require__(209);
  6083. module.exports = __webpack_require__(23).Promise;
  6084. /***/ }),
  6085. /* 180 */
  6086. /***/ (function(module, exports) {
  6087. module.exports = function () { /* empty */ };
  6088. /***/ }),
  6089. /* 181 */
  6090. /***/ (function(module, exports) {
  6091. module.exports = function (it, Constructor, name, forbiddenField) {
  6092. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  6093. throw TypeError(name + ': incorrect invocation!');
  6094. } return it;
  6095. };
  6096. /***/ }),
  6097. /* 182 */
  6098. /***/ (function(module, exports, __webpack_require__) {
  6099. // false -> Array#indexOf
  6100. // true -> Array#includes
  6101. var toIObject = __webpack_require__(74);
  6102. var toLength = __webpack_require__(110);
  6103. var toAbsoluteIndex = __webpack_require__(200);
  6104. module.exports = function (IS_INCLUDES) {
  6105. return function ($this, el, fromIndex) {
  6106. var O = toIObject($this);
  6107. var length = toLength(O.length);
  6108. var index = toAbsoluteIndex(fromIndex, length);
  6109. var value;
  6110. // Array#includes uses SameValueZero equality algorithm
  6111. // eslint-disable-next-line no-self-compare
  6112. if (IS_INCLUDES && el != el) while (length > index) {
  6113. value = O[index++];
  6114. // eslint-disable-next-line no-self-compare
  6115. if (value != value) return true;
  6116. // Array#indexOf ignores holes, Array#includes - not
  6117. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  6118. if (O[index] === el) return IS_INCLUDES || index || 0;
  6119. } return !IS_INCLUDES && -1;
  6120. };
  6121. };
  6122. /***/ }),
  6123. /* 183 */
  6124. /***/ (function(module, exports, __webpack_require__) {
  6125. var ctx = __webpack_require__(48);
  6126. var call = __webpack_require__(187);
  6127. var isArrayIter = __webpack_require__(186);
  6128. var anObject = __webpack_require__(27);
  6129. var toLength = __webpack_require__(110);
  6130. var getIterFn = __webpack_require__(203);
  6131. var BREAK = {};
  6132. var RETURN = {};
  6133. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  6134. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  6135. var f = ctx(fn, that, entries ? 2 : 1);
  6136. var index = 0;
  6137. var length, step, iterator, result;
  6138. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  6139. // fast case for arrays with default iterator
  6140. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  6141. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  6142. if (result === BREAK || result === RETURN) return result;
  6143. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  6144. result = call(iterator, f, step.value, entries);
  6145. if (result === BREAK || result === RETURN) return result;
  6146. }
  6147. };
  6148. exports.BREAK = BREAK;
  6149. exports.RETURN = RETURN;
  6150. /***/ }),
  6151. /* 184 */
  6152. /***/ (function(module, exports, __webpack_require__) {
  6153. module.exports = !__webpack_require__(33) && !__webpack_require__(85)(function () {
  6154. return Object.defineProperty(__webpack_require__(68)('div'), 'a', { get: function () { return 7; } }).a != 7;
  6155. });
  6156. /***/ }),
  6157. /* 185 */
  6158. /***/ (function(module, exports) {
  6159. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  6160. module.exports = function (fn, args, that) {
  6161. var un = that === undefined;
  6162. switch (args.length) {
  6163. case 0: return un ? fn()
  6164. : fn.call(that);
  6165. case 1: return un ? fn(args[0])
  6166. : fn.call(that, args[0]);
  6167. case 2: return un ? fn(args[0], args[1])
  6168. : fn.call(that, args[0], args[1]);
  6169. case 3: return un ? fn(args[0], args[1], args[2])
  6170. : fn.call(that, args[0], args[1], args[2]);
  6171. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  6172. : fn.call(that, args[0], args[1], args[2], args[3]);
  6173. } return fn.apply(that, args);
  6174. };
  6175. /***/ }),
  6176. /* 186 */
  6177. /***/ (function(module, exports, __webpack_require__) {
  6178. // check on default Array iterator
  6179. var Iterators = __webpack_require__(35);
  6180. var ITERATOR = __webpack_require__(13)('iterator');
  6181. var ArrayProto = Array.prototype;
  6182. module.exports = function (it) {
  6183. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  6184. };
  6185. /***/ }),
  6186. /* 187 */
  6187. /***/ (function(module, exports, __webpack_require__) {
  6188. // call something on iterator step with safe closing on error
  6189. var anObject = __webpack_require__(27);
  6190. module.exports = function (iterator, fn, value, entries) {
  6191. try {
  6192. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  6193. // 7.4.6 IteratorClose(iterator, completion)
  6194. } catch (e) {
  6195. var ret = iterator['return'];
  6196. if (ret !== undefined) anObject(ret.call(iterator));
  6197. throw e;
  6198. }
  6199. };
  6200. /***/ }),
  6201. /* 188 */
  6202. /***/ (function(module, exports, __webpack_require__) {
  6203. "use strict";
  6204. var create = __webpack_require__(192);
  6205. var descriptor = __webpack_require__(106);
  6206. var setToStringTag = __webpack_require__(71);
  6207. var IteratorPrototype = {};
  6208. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  6209. __webpack_require__(31)(IteratorPrototype, __webpack_require__(13)('iterator'), function () { return this; });
  6210. module.exports = function (Constructor, NAME, next) {
  6211. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  6212. setToStringTag(Constructor, NAME + ' Iterator');
  6213. };
  6214. /***/ }),
  6215. /* 189 */
  6216. /***/ (function(module, exports, __webpack_require__) {
  6217. var ITERATOR = __webpack_require__(13)('iterator');
  6218. var SAFE_CLOSING = false;
  6219. try {
  6220. var riter = [7][ITERATOR]();
  6221. riter['return'] = function () { SAFE_CLOSING = true; };
  6222. // eslint-disable-next-line no-throw-literal
  6223. Array.from(riter, function () { throw 2; });
  6224. } catch (e) { /* empty */ }
  6225. module.exports = function (exec, skipClosing) {
  6226. if (!skipClosing && !SAFE_CLOSING) return false;
  6227. var safe = false;
  6228. try {
  6229. var arr = [7];
  6230. var iter = arr[ITERATOR]();
  6231. iter.next = function () { return { done: safe = true }; };
  6232. arr[ITERATOR] = function () { return iter; };
  6233. exec(arr);
  6234. } catch (e) { /* empty */ }
  6235. return safe;
  6236. };
  6237. /***/ }),
  6238. /* 190 */
  6239. /***/ (function(module, exports) {
  6240. module.exports = function (done, value) {
  6241. return { value: value, done: !!done };
  6242. };
  6243. /***/ }),
  6244. /* 191 */
  6245. /***/ (function(module, exports, __webpack_require__) {
  6246. var global = __webpack_require__(11);
  6247. var macrotask = __webpack_require__(109).set;
  6248. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  6249. var process = global.process;
  6250. var Promise = global.Promise;
  6251. var isNode = __webpack_require__(47)(process) == 'process';
  6252. module.exports = function () {
  6253. var head, last, notify;
  6254. var flush = function () {
  6255. var parent, fn;
  6256. if (isNode && (parent = process.domain)) parent.exit();
  6257. while (head) {
  6258. fn = head.fn;
  6259. head = head.next;
  6260. try {
  6261. fn();
  6262. } catch (e) {
  6263. if (head) notify();
  6264. else last = undefined;
  6265. throw e;
  6266. }
  6267. } last = undefined;
  6268. if (parent) parent.enter();
  6269. };
  6270. // Node.js
  6271. if (isNode) {
  6272. notify = function () {
  6273. process.nextTick(flush);
  6274. };
  6275. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  6276. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  6277. var toggle = true;
  6278. var node = document.createTextNode('');
  6279. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  6280. notify = function () {
  6281. node.data = toggle = !toggle;
  6282. };
  6283. // environments with maybe non-completely correct, but existent Promise
  6284. } else if (Promise && Promise.resolve) {
  6285. // Promise.resolve without an argument throws an error in LG WebOS 2
  6286. var promise = Promise.resolve(undefined);
  6287. notify = function () {
  6288. promise.then(flush);
  6289. };
  6290. // for other environments - macrotask based on:
  6291. // - setImmediate
  6292. // - MessageChannel
  6293. // - window.postMessag
  6294. // - onreadystatechange
  6295. // - setTimeout
  6296. } else {
  6297. notify = function () {
  6298. // strange IE + webpack dev server bug - use .call(global)
  6299. macrotask.call(global, flush);
  6300. };
  6301. }
  6302. return function (fn) {
  6303. var task = { fn: fn, next: undefined };
  6304. if (last) last.next = task;
  6305. if (!head) {
  6306. head = task;
  6307. notify();
  6308. } last = task;
  6309. };
  6310. };
  6311. /***/ }),
  6312. /* 192 */
  6313. /***/ (function(module, exports, __webpack_require__) {
  6314. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  6315. var anObject = __webpack_require__(27);
  6316. var dPs = __webpack_require__(193);
  6317. var enumBugKeys = __webpack_require__(101);
  6318. var IE_PROTO = __webpack_require__(72)('IE_PROTO');
  6319. var Empty = function () { /* empty */ };
  6320. var PROTOTYPE = 'prototype';
  6321. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  6322. var createDict = function () {
  6323. // Thrash, waste and sodomy: IE GC bug
  6324. var iframe = __webpack_require__(68)('iframe');
  6325. var i = enumBugKeys.length;
  6326. var lt = '<';
  6327. var gt = '>';
  6328. var iframeDocument;
  6329. iframe.style.display = 'none';
  6330. __webpack_require__(102).appendChild(iframe);
  6331. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  6332. // createDict = iframe.contentWindow.Object;
  6333. // html.removeChild(iframe);
  6334. iframeDocument = iframe.contentWindow.document;
  6335. iframeDocument.open();
  6336. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  6337. iframeDocument.close();
  6338. createDict = iframeDocument.F;
  6339. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  6340. return createDict();
  6341. };
  6342. module.exports = Object.create || function create(O, Properties) {
  6343. var result;
  6344. if (O !== null) {
  6345. Empty[PROTOTYPE] = anObject(O);
  6346. result = new Empty();
  6347. Empty[PROTOTYPE] = null;
  6348. // add "__proto__" for Object.getPrototypeOf polyfill
  6349. result[IE_PROTO] = O;
  6350. } else result = createDict();
  6351. return Properties === undefined ? result : dPs(result, Properties);
  6352. };
  6353. /***/ }),
  6354. /* 193 */
  6355. /***/ (function(module, exports, __webpack_require__) {
  6356. var dP = __webpack_require__(50);
  6357. var anObject = __webpack_require__(27);
  6358. var getKeys = __webpack_require__(132);
  6359. module.exports = __webpack_require__(33) ? Object.defineProperties : function defineProperties(O, Properties) {
  6360. anObject(O);
  6361. var keys = getKeys(Properties);
  6362. var length = keys.length;
  6363. var i = 0;
  6364. var P;
  6365. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  6366. return O;
  6367. };
  6368. /***/ }),
  6369. /* 194 */
  6370. /***/ (function(module, exports, __webpack_require__) {
  6371. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  6372. var has = __webpack_require__(49);
  6373. var toObject = __webpack_require__(133);
  6374. var IE_PROTO = __webpack_require__(72)('IE_PROTO');
  6375. var ObjectProto = Object.prototype;
  6376. module.exports = Object.getPrototypeOf || function (O) {
  6377. O = toObject(O);
  6378. if (has(O, IE_PROTO)) return O[IE_PROTO];
  6379. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  6380. return O.constructor.prototype;
  6381. } return O instanceof Object ? ObjectProto : null;
  6382. };
  6383. /***/ }),
  6384. /* 195 */
  6385. /***/ (function(module, exports, __webpack_require__) {
  6386. var has = __webpack_require__(49);
  6387. var toIObject = __webpack_require__(74);
  6388. var arrayIndexOf = __webpack_require__(182)(false);
  6389. var IE_PROTO = __webpack_require__(72)('IE_PROTO');
  6390. module.exports = function (object, names) {
  6391. var O = toIObject(object);
  6392. var i = 0;
  6393. var result = [];
  6394. var key;
  6395. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  6396. // Don't enum bug & hidden keys
  6397. while (names.length > i) if (has(O, key = names[i++])) {
  6398. ~arrayIndexOf(result, key) || result.push(key);
  6399. }
  6400. return result;
  6401. };
  6402. /***/ }),
  6403. /* 196 */
  6404. /***/ (function(module, exports, __webpack_require__) {
  6405. var hide = __webpack_require__(31);
  6406. module.exports = function (target, src, safe) {
  6407. for (var key in src) {
  6408. if (safe && target[key]) target[key] = src[key];
  6409. else hide(target, key, src[key]);
  6410. } return target;
  6411. };
  6412. /***/ }),
  6413. /* 197 */
  6414. /***/ (function(module, exports, __webpack_require__) {
  6415. module.exports = __webpack_require__(31);
  6416. /***/ }),
  6417. /* 198 */
  6418. /***/ (function(module, exports, __webpack_require__) {
  6419. "use strict";
  6420. var global = __webpack_require__(11);
  6421. var core = __webpack_require__(23);
  6422. var dP = __webpack_require__(50);
  6423. var DESCRIPTORS = __webpack_require__(33);
  6424. var SPECIES = __webpack_require__(13)('species');
  6425. module.exports = function (KEY) {
  6426. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  6427. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  6428. configurable: true,
  6429. get: function () { return this; }
  6430. });
  6431. };
  6432. /***/ }),
  6433. /* 199 */
  6434. /***/ (function(module, exports, __webpack_require__) {
  6435. var toInteger = __webpack_require__(73);
  6436. var defined = __webpack_require__(67);
  6437. // true -> String#at
  6438. // false -> String#codePointAt
  6439. module.exports = function (TO_STRING) {
  6440. return function (that, pos) {
  6441. var s = String(defined(that));
  6442. var i = toInteger(pos);
  6443. var l = s.length;
  6444. var a, b;
  6445. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  6446. a = s.charCodeAt(i);
  6447. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  6448. ? TO_STRING ? s.charAt(i) : a
  6449. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  6450. };
  6451. };
  6452. /***/ }),
  6453. /* 200 */
  6454. /***/ (function(module, exports, __webpack_require__) {
  6455. var toInteger = __webpack_require__(73);
  6456. var max = Math.max;
  6457. var min = Math.min;
  6458. module.exports = function (index, length) {
  6459. index = toInteger(index);
  6460. return index < 0 ? max(index + length, 0) : min(index, length);
  6461. };
  6462. /***/ }),
  6463. /* 201 */
  6464. /***/ (function(module, exports, __webpack_require__) {
  6465. // 7.1.1 ToPrimitive(input [, PreferredType])
  6466. var isObject = __webpack_require__(34);
  6467. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  6468. // and the second argument - flag - preferred type is a string
  6469. module.exports = function (it, S) {
  6470. if (!isObject(it)) return it;
  6471. var fn, val;
  6472. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  6473. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  6474. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  6475. throw TypeError("Can't convert object to primitive value");
  6476. };
  6477. /***/ }),
  6478. /* 202 */
  6479. /***/ (function(module, exports, __webpack_require__) {
  6480. var global = __webpack_require__(11);
  6481. var navigator = global.navigator;
  6482. module.exports = navigator && navigator.userAgent || '';
  6483. /***/ }),
  6484. /* 203 */
  6485. /***/ (function(module, exports, __webpack_require__) {
  6486. var classof = __webpack_require__(100);
  6487. var ITERATOR = __webpack_require__(13)('iterator');
  6488. var Iterators = __webpack_require__(35);
  6489. module.exports = __webpack_require__(23).getIteratorMethod = function (it) {
  6490. if (it != undefined) return it[ITERATOR]
  6491. || it['@@iterator']
  6492. || Iterators[classof(it)];
  6493. };
  6494. /***/ }),
  6495. /* 204 */
  6496. /***/ (function(module, exports, __webpack_require__) {
  6497. "use strict";
  6498. var addToUnscopables = __webpack_require__(180);
  6499. var step = __webpack_require__(190);
  6500. var Iterators = __webpack_require__(35);
  6501. var toIObject = __webpack_require__(74);
  6502. // 22.1.3.4 Array.prototype.entries()
  6503. // 22.1.3.13 Array.prototype.keys()
  6504. // 22.1.3.29 Array.prototype.values()
  6505. // 22.1.3.30 Array.prototype[@@iterator]()
  6506. module.exports = __webpack_require__(103)(Array, 'Array', function (iterated, kind) {
  6507. this._t = toIObject(iterated); // target
  6508. this._i = 0; // next index
  6509. this._k = kind; // kind
  6510. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  6511. }, function () {
  6512. var O = this._t;
  6513. var kind = this._k;
  6514. var index = this._i++;
  6515. if (!O || index >= O.length) {
  6516. this._t = undefined;
  6517. return step(1);
  6518. }
  6519. if (kind == 'keys') return step(0, index);
  6520. if (kind == 'values') return step(0, O[index]);
  6521. return step(0, [index, O[index]]);
  6522. }, 'values');
  6523. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  6524. Iterators.Arguments = Iterators.Array;
  6525. addToUnscopables('keys');
  6526. addToUnscopables('values');
  6527. addToUnscopables('entries');
  6528. /***/ }),
  6529. /* 205 */
  6530. /***/ (function(module, exports) {
  6531. /***/ }),
  6532. /* 206 */
  6533. /***/ (function(module, exports, __webpack_require__) {
  6534. "use strict";
  6535. var LIBRARY = __webpack_require__(69);
  6536. var global = __webpack_require__(11);
  6537. var ctx = __webpack_require__(48);
  6538. var classof = __webpack_require__(100);
  6539. var $export = __webpack_require__(41);
  6540. var isObject = __webpack_require__(34);
  6541. var aFunction = __webpack_require__(46);
  6542. var anInstance = __webpack_require__(181);
  6543. var forOf = __webpack_require__(183);
  6544. var speciesConstructor = __webpack_require__(108);
  6545. var task = __webpack_require__(109).set;
  6546. var microtask = __webpack_require__(191)();
  6547. var newPromiseCapabilityModule = __webpack_require__(70);
  6548. var perform = __webpack_require__(104);
  6549. var userAgent = __webpack_require__(202);
  6550. var promiseResolve = __webpack_require__(105);
  6551. var PROMISE = 'Promise';
  6552. var TypeError = global.TypeError;
  6553. var process = global.process;
  6554. var versions = process && process.versions;
  6555. var v8 = versions && versions.v8 || '';
  6556. var $Promise = global[PROMISE];
  6557. var isNode = classof(process) == 'process';
  6558. var empty = function () { /* empty */ };
  6559. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  6560. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  6561. var USE_NATIVE = !!function () {
  6562. try {
  6563. // correct subclassing with @@species support
  6564. var promise = $Promise.resolve(1);
  6565. var FakePromise = (promise.constructor = {})[__webpack_require__(13)('species')] = function (exec) {
  6566. exec(empty, empty);
  6567. };
  6568. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  6569. return (isNode || typeof PromiseRejectionEvent == 'function')
  6570. && promise.then(empty) instanceof FakePromise
  6571. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  6572. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  6573. // we can't detect it synchronously, so just check versions
  6574. && v8.indexOf('6.6') !== 0
  6575. && userAgent.indexOf('Chrome/66') === -1;
  6576. } catch (e) { /* empty */ }
  6577. }();
  6578. // helpers
  6579. var isThenable = function (it) {
  6580. var then;
  6581. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  6582. };
  6583. var notify = function (promise, isReject) {
  6584. if (promise._n) return;
  6585. promise._n = true;
  6586. var chain = promise._c;
  6587. microtask(function () {
  6588. var value = promise._v;
  6589. var ok = promise._s == 1;
  6590. var i = 0;
  6591. var run = function (reaction) {
  6592. var handler = ok ? reaction.ok : reaction.fail;
  6593. var resolve = reaction.resolve;
  6594. var reject = reaction.reject;
  6595. var domain = reaction.domain;
  6596. var result, then, exited;
  6597. try {
  6598. if (handler) {
  6599. if (!ok) {
  6600. if (promise._h == 2) onHandleUnhandled(promise);
  6601. promise._h = 1;
  6602. }
  6603. if (handler === true) result = value;
  6604. else {
  6605. if (domain) domain.enter();
  6606. result = handler(value); // may throw
  6607. if (domain) {
  6608. domain.exit();
  6609. exited = true;
  6610. }
  6611. }
  6612. if (result === reaction.promise) {
  6613. reject(TypeError('Promise-chain cycle'));
  6614. } else if (then = isThenable(result)) {
  6615. then.call(result, resolve, reject);
  6616. } else resolve(result);
  6617. } else reject(value);
  6618. } catch (e) {
  6619. if (domain && !exited) domain.exit();
  6620. reject(e);
  6621. }
  6622. };
  6623. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  6624. promise._c = [];
  6625. promise._n = false;
  6626. if (isReject && !promise._h) onUnhandled(promise);
  6627. });
  6628. };
  6629. var onUnhandled = function (promise) {
  6630. task.call(global, function () {
  6631. var value = promise._v;
  6632. var unhandled = isUnhandled(promise);
  6633. var result, handler, console;
  6634. if (unhandled) {
  6635. result = perform(function () {
  6636. if (isNode) {
  6637. process.emit('unhandledRejection', value, promise);
  6638. } else if (handler = global.onunhandledrejection) {
  6639. handler({ promise: promise, reason: value });
  6640. } else if ((console = global.console) && console.error) {
  6641. console.error('Unhandled promise rejection', value);
  6642. }
  6643. });
  6644. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  6645. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  6646. } promise._a = undefined;
  6647. if (unhandled && result.e) throw result.v;
  6648. });
  6649. };
  6650. var isUnhandled = function (promise) {
  6651. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  6652. };
  6653. var onHandleUnhandled = function (promise) {
  6654. task.call(global, function () {
  6655. var handler;
  6656. if (isNode) {
  6657. process.emit('rejectionHandled', promise);
  6658. } else if (handler = global.onrejectionhandled) {
  6659. handler({ promise: promise, reason: promise._v });
  6660. }
  6661. });
  6662. };
  6663. var $reject = function (value) {
  6664. var promise = this;
  6665. if (promise._d) return;
  6666. promise._d = true;
  6667. promise = promise._w || promise; // unwrap
  6668. promise._v = value;
  6669. promise._s = 2;
  6670. if (!promise._a) promise._a = promise._c.slice();
  6671. notify(promise, true);
  6672. };
  6673. var $resolve = function (value) {
  6674. var promise = this;
  6675. var then;
  6676. if (promise._d) return;
  6677. promise._d = true;
  6678. promise = promise._w || promise; // unwrap
  6679. try {
  6680. if (promise === value) throw TypeError("Promise can't be resolved itself");
  6681. if (then = isThenable(value)) {
  6682. microtask(function () {
  6683. var wrapper = { _w: promise, _d: false }; // wrap
  6684. try {
  6685. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  6686. } catch (e) {
  6687. $reject.call(wrapper, e);
  6688. }
  6689. });
  6690. } else {
  6691. promise._v = value;
  6692. promise._s = 1;
  6693. notify(promise, false);
  6694. }
  6695. } catch (e) {
  6696. $reject.call({ _w: promise, _d: false }, e); // wrap
  6697. }
  6698. };
  6699. // constructor polyfill
  6700. if (!USE_NATIVE) {
  6701. // 25.4.3.1 Promise(executor)
  6702. $Promise = function Promise(executor) {
  6703. anInstance(this, $Promise, PROMISE, '_h');
  6704. aFunction(executor);
  6705. Internal.call(this);
  6706. try {
  6707. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  6708. } catch (err) {
  6709. $reject.call(this, err);
  6710. }
  6711. };
  6712. // eslint-disable-next-line no-unused-vars
  6713. Internal = function Promise(executor) {
  6714. this._c = []; // <- awaiting reactions
  6715. this._a = undefined; // <- checked in isUnhandled reactions
  6716. this._s = 0; // <- state
  6717. this._d = false; // <- done
  6718. this._v = undefined; // <- value
  6719. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  6720. this._n = false; // <- notify
  6721. };
  6722. Internal.prototype = __webpack_require__(196)($Promise.prototype, {
  6723. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  6724. then: function then(onFulfilled, onRejected) {
  6725. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  6726. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  6727. reaction.fail = typeof onRejected == 'function' && onRejected;
  6728. reaction.domain = isNode ? process.domain : undefined;
  6729. this._c.push(reaction);
  6730. if (this._a) this._a.push(reaction);
  6731. if (this._s) notify(this, false);
  6732. return reaction.promise;
  6733. },
  6734. // 25.4.5.1 Promise.prototype.catch(onRejected)
  6735. 'catch': function (onRejected) {
  6736. return this.then(undefined, onRejected);
  6737. }
  6738. });
  6739. OwnPromiseCapability = function () {
  6740. var promise = new Internal();
  6741. this.promise = promise;
  6742. this.resolve = ctx($resolve, promise, 1);
  6743. this.reject = ctx($reject, promise, 1);
  6744. };
  6745. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  6746. return C === $Promise || C === Wrapper
  6747. ? new OwnPromiseCapability(C)
  6748. : newGenericPromiseCapability(C);
  6749. };
  6750. }
  6751. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  6752. __webpack_require__(71)($Promise, PROMISE);
  6753. __webpack_require__(198)(PROMISE);
  6754. Wrapper = __webpack_require__(23)[PROMISE];
  6755. // statics
  6756. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  6757. // 25.4.4.5 Promise.reject(r)
  6758. reject: function reject(r) {
  6759. var capability = newPromiseCapability(this);
  6760. var $$reject = capability.reject;
  6761. $$reject(r);
  6762. return capability.promise;
  6763. }
  6764. });
  6765. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  6766. // 25.4.4.6 Promise.resolve(x)
  6767. resolve: function resolve(x) {
  6768. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  6769. }
  6770. });
  6771. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(189)(function (iter) {
  6772. $Promise.all(iter)['catch'](empty);
  6773. })), PROMISE, {
  6774. // 25.4.4.1 Promise.all(iterable)
  6775. all: function all(iterable) {
  6776. var C = this;
  6777. var capability = newPromiseCapability(C);
  6778. var resolve = capability.resolve;
  6779. var reject = capability.reject;
  6780. var result = perform(function () {
  6781. var values = [];
  6782. var index = 0;
  6783. var remaining = 1;
  6784. forOf(iterable, false, function (promise) {
  6785. var $index = index++;
  6786. var alreadyCalled = false;
  6787. values.push(undefined);
  6788. remaining++;
  6789. C.resolve(promise).then(function (value) {
  6790. if (alreadyCalled) return;
  6791. alreadyCalled = true;
  6792. values[$index] = value;
  6793. --remaining || resolve(values);
  6794. }, reject);
  6795. });
  6796. --remaining || resolve(values);
  6797. });
  6798. if (result.e) reject(result.v);
  6799. return capability.promise;
  6800. },
  6801. // 25.4.4.4 Promise.race(iterable)
  6802. race: function race(iterable) {
  6803. var C = this;
  6804. var capability = newPromiseCapability(C);
  6805. var reject = capability.reject;
  6806. var result = perform(function () {
  6807. forOf(iterable, false, function (promise) {
  6808. C.resolve(promise).then(capability.resolve, reject);
  6809. });
  6810. });
  6811. if (result.e) reject(result.v);
  6812. return capability.promise;
  6813. }
  6814. });
  6815. /***/ }),
  6816. /* 207 */
  6817. /***/ (function(module, exports, __webpack_require__) {
  6818. "use strict";
  6819. var $at = __webpack_require__(199)(true);
  6820. // 21.1.3.27 String.prototype[@@iterator]()
  6821. __webpack_require__(103)(String, 'String', function (iterated) {
  6822. this._t = String(iterated); // target
  6823. this._i = 0; // next index
  6824. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  6825. }, function () {
  6826. var O = this._t;
  6827. var index = this._i;
  6828. var point;
  6829. if (index >= O.length) return { value: undefined, done: true };
  6830. point = $at(O, index);
  6831. this._i += point.length;
  6832. return { value: point, done: false };
  6833. });
  6834. /***/ }),
  6835. /* 208 */
  6836. /***/ (function(module, exports, __webpack_require__) {
  6837. "use strict";
  6838. // https://github.com/tc39/proposal-promise-finally
  6839. var $export = __webpack_require__(41);
  6840. var core = __webpack_require__(23);
  6841. var global = __webpack_require__(11);
  6842. var speciesConstructor = __webpack_require__(108);
  6843. var promiseResolve = __webpack_require__(105);
  6844. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  6845. var C = speciesConstructor(this, core.Promise || global.Promise);
  6846. var isFunction = typeof onFinally == 'function';
  6847. return this.then(
  6848. isFunction ? function (x) {
  6849. return promiseResolve(C, onFinally()).then(function () { return x; });
  6850. } : onFinally,
  6851. isFunction ? function (e) {
  6852. return promiseResolve(C, onFinally()).then(function () { throw e; });
  6853. } : onFinally
  6854. );
  6855. } });
  6856. /***/ }),
  6857. /* 209 */
  6858. /***/ (function(module, exports, __webpack_require__) {
  6859. "use strict";
  6860. // https://github.com/tc39/proposal-promise-try
  6861. var $export = __webpack_require__(41);
  6862. var newPromiseCapability = __webpack_require__(70);
  6863. var perform = __webpack_require__(104);
  6864. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  6865. var promiseCapability = newPromiseCapability.f(this);
  6866. var result = perform(callbackfn);
  6867. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  6868. return promiseCapability.promise;
  6869. } });
  6870. /***/ }),
  6871. /* 210 */
  6872. /***/ (function(module, exports, __webpack_require__) {
  6873. __webpack_require__(204);
  6874. var global = __webpack_require__(11);
  6875. var hide = __webpack_require__(31);
  6876. var Iterators = __webpack_require__(35);
  6877. var TO_STRING_TAG = __webpack_require__(13)('toStringTag');
  6878. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  6879. 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  6880. 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  6881. 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  6882. 'TextTrackList,TouchList').split(',');
  6883. for (var i = 0; i < DOMIterables.length; i++) {
  6884. var NAME = DOMIterables[i];
  6885. var Collection = global[NAME];
  6886. var proto = Collection && Collection.prototype;
  6887. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  6888. Iterators[NAME] = Iterators.Array;
  6889. }
  6890. /***/ }),
  6891. /* 211 */
  6892. /***/ (function(module, exports, __webpack_require__) {
  6893. /**
  6894. * This is the web browser implementation of `debug()`.
  6895. *
  6896. * Expose `debug()` as the module.
  6897. */
  6898. exports = module.exports = __webpack_require__(112);
  6899. exports.log = log;
  6900. exports.formatArgs = formatArgs;
  6901. exports.save = save;
  6902. exports.load = load;
  6903. exports.useColors = useColors;
  6904. exports.storage = 'undefined' != typeof chrome
  6905. && 'undefined' != typeof chrome.storage
  6906. ? chrome.storage.local
  6907. : localstorage();
  6908. /**
  6909. * Colors.
  6910. */
  6911. exports.colors = [
  6912. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  6913. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  6914. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  6915. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  6916. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  6917. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  6918. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  6919. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  6920. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  6921. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  6922. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  6923. ];
  6924. /**
  6925. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  6926. * and the Firebug extension (any Firefox version) are known
  6927. * to support "%c" CSS customizations.
  6928. *
  6929. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  6930. */
  6931. function useColors() {
  6932. // NB: In an Electron preload script, document will be defined but not fully
  6933. // initialized. Since we know we're in Chrome, we'll just detect this case
  6934. // explicitly
  6935. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  6936. return true;
  6937. }
  6938. // Internet Explorer and Edge do not support colors.
  6939. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  6940. return false;
  6941. }
  6942. // is webkit? http://stackoverflow.com/a/16459606/376773
  6943. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  6944. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  6945. // is firebug? http://stackoverflow.com/a/398120/376773
  6946. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  6947. // is firefox >= v31?
  6948. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  6949. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  6950. // double check webkit in userAgent just in case we are in a worker
  6951. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  6952. }
  6953. /**
  6954. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  6955. */
  6956. exports.formatters.j = function(v) {
  6957. try {
  6958. return JSON.stringify(v);
  6959. } catch (err) {
  6960. return '[UnexpectedJSONParseError]: ' + err.message;
  6961. }
  6962. };
  6963. /**
  6964. * Colorize log arguments if enabled.
  6965. *
  6966. * @api public
  6967. */
  6968. function formatArgs(args) {
  6969. var useColors = this.useColors;
  6970. args[0] = (useColors ? '%c' : '')
  6971. + this.namespace
  6972. + (useColors ? ' %c' : ' ')
  6973. + args[0]
  6974. + (useColors ? '%c ' : ' ')
  6975. + '+' + exports.humanize(this.diff);
  6976. if (!useColors) return;
  6977. var c = 'color: ' + this.color;
  6978. args.splice(1, 0, c, 'color: inherit')
  6979. // the final "%c" is somewhat tricky, because there could be other
  6980. // arguments passed either before or after the %c, so we need to
  6981. // figure out the correct index to insert the CSS into
  6982. var index = 0;
  6983. var lastC = 0;
  6984. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  6985. if ('%%' === match) return;
  6986. index++;
  6987. if ('%c' === match) {
  6988. // we only are interested in the *last* %c
  6989. // (the user may have provided their own)
  6990. lastC = index;
  6991. }
  6992. });
  6993. args.splice(lastC, 0, c);
  6994. }
  6995. /**
  6996. * Invokes `console.log()` when available.
  6997. * No-op when `console.log` is not a "function".
  6998. *
  6999. * @api public
  7000. */
  7001. function log() {
  7002. // this hackery is required for IE8/9, where
  7003. // the `console.log` function doesn't have 'apply'
  7004. return 'object' === typeof console
  7005. && console.log
  7006. && Function.prototype.apply.call(console.log, console, arguments);
  7007. }
  7008. /**
  7009. * Save `namespaces`.
  7010. *
  7011. * @param {String} namespaces
  7012. * @api private
  7013. */
  7014. function save(namespaces) {
  7015. try {
  7016. if (null == namespaces) {
  7017. exports.storage.removeItem('debug');
  7018. } else {
  7019. exports.storage.debug = namespaces;
  7020. }
  7021. } catch(e) {}
  7022. }
  7023. /**
  7024. * Load `namespaces`.
  7025. *
  7026. * @return {String} returns the previously persisted debug modes
  7027. * @api private
  7028. */
  7029. function load() {
  7030. var r;
  7031. try {
  7032. r = exports.storage.debug;
  7033. } catch(e) {}
  7034. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  7035. if (!r && typeof process !== 'undefined' && 'env' in process) {
  7036. r = process.env.DEBUG;
  7037. }
  7038. return r;
  7039. }
  7040. /**
  7041. * Enable namespaces listed in `localStorage.debug` initially.
  7042. */
  7043. exports.enable(load());
  7044. /**
  7045. * Localstorage attempts to return the localstorage.
  7046. *
  7047. * This is necessary because safari throws
  7048. * when a user disables cookies/localstorage
  7049. * and you attempt to access it.
  7050. *
  7051. * @return {LocalStorage}
  7052. * @api private
  7053. */
  7054. function localstorage() {
  7055. try {
  7056. return window.localStorage;
  7057. } catch (e) {}
  7058. }
  7059. /***/ }),
  7060. /* 212 */
  7061. /***/ (function(module, exports, __webpack_require__) {
  7062. /**
  7063. * Detect Electron renderer process, which is node, but we should
  7064. * treat as a browser.
  7065. */
  7066. if (typeof process === 'undefined' || process.type === 'renderer') {
  7067. module.exports = __webpack_require__(211);
  7068. } else {
  7069. module.exports = __webpack_require__(213);
  7070. }
  7071. /***/ }),
  7072. /* 213 */
  7073. /***/ (function(module, exports, __webpack_require__) {
  7074. /**
  7075. * Module dependencies.
  7076. */
  7077. var tty = __webpack_require__(79);
  7078. var util = __webpack_require__(2);
  7079. /**
  7080. * This is the Node.js implementation of `debug()`.
  7081. *
  7082. * Expose `debug()` as the module.
  7083. */
  7084. exports = module.exports = __webpack_require__(112);
  7085. exports.init = init;
  7086. exports.log = log;
  7087. exports.formatArgs = formatArgs;
  7088. exports.save = save;
  7089. exports.load = load;
  7090. exports.useColors = useColors;
  7091. /**
  7092. * Colors.
  7093. */
  7094. exports.colors = [ 6, 2, 3, 4, 5, 1 ];
  7095. try {
  7096. var supportsColor = __webpack_require__(239);
  7097. if (supportsColor && supportsColor.level >= 2) {
  7098. exports.colors = [
  7099. 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
  7100. 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
  7101. 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
  7102. 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
  7103. 205, 206, 207, 208, 209, 214, 215, 220, 221
  7104. ];
  7105. }
  7106. } catch (err) {
  7107. // swallow - we only care if `supports-color` is available; it doesn't have to be.
  7108. }
  7109. /**
  7110. * Build up the default `inspectOpts` object from the environment variables.
  7111. *
  7112. * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
  7113. */
  7114. exports.inspectOpts = Object.keys(process.env).filter(function (key) {
  7115. return /^debug_/i.test(key);
  7116. }).reduce(function (obj, key) {
  7117. // camel-case
  7118. var prop = key
  7119. .substring(6)
  7120. .toLowerCase()
  7121. .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
  7122. // coerce string value into JS value
  7123. var val = process.env[key];
  7124. if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
  7125. else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
  7126. else if (val === 'null') val = null;
  7127. else val = Number(val);
  7128. obj[prop] = val;
  7129. return obj;
  7130. }, {});
  7131. /**
  7132. * Is stdout a TTY? Colored output is enabled when `true`.
  7133. */
  7134. function useColors() {
  7135. return 'colors' in exports.inspectOpts
  7136. ? Boolean(exports.inspectOpts.colors)
  7137. : tty.isatty(process.stderr.fd);
  7138. }
  7139. /**
  7140. * Map %o to `util.inspect()`, all on a single line.
  7141. */
  7142. exports.formatters.o = function(v) {
  7143. this.inspectOpts.colors = this.useColors;
  7144. return util.inspect(v, this.inspectOpts)
  7145. .split('\n').map(function(str) {
  7146. return str.trim()
  7147. }).join(' ');
  7148. };
  7149. /**
  7150. * Map %o to `util.inspect()`, allowing multiple lines if needed.
  7151. */
  7152. exports.formatters.O = function(v) {
  7153. this.inspectOpts.colors = this.useColors;
  7154. return util.inspect(v, this.inspectOpts);
  7155. };
  7156. /**
  7157. * Adds ANSI color escape codes if enabled.
  7158. *
  7159. * @api public
  7160. */
  7161. function formatArgs(args) {
  7162. var name = this.namespace;
  7163. var useColors = this.useColors;
  7164. if (useColors) {
  7165. var c = this.color;
  7166. var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
  7167. var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
  7168. args[0] = prefix + args[0].split('\n').join('\n' + prefix);
  7169. args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
  7170. } else {
  7171. args[0] = getDate() + name + ' ' + args[0];
  7172. }
  7173. }
  7174. function getDate() {
  7175. if (exports.inspectOpts.hideDate) {
  7176. return '';
  7177. } else {
  7178. return new Date().toISOString() + ' ';
  7179. }
  7180. }
  7181. /**
  7182. * Invokes `util.format()` with the specified arguments and writes to stderr.
  7183. */
  7184. function log() {
  7185. return process.stderr.write(util.format.apply(util, arguments) + '\n');
  7186. }
  7187. /**
  7188. * Save `namespaces`.
  7189. *
  7190. * @param {String} namespaces
  7191. * @api private
  7192. */
  7193. function save(namespaces) {
  7194. if (null == namespaces) {
  7195. // If you set a process.env field to null or undefined, it gets cast to the
  7196. // string 'null' or 'undefined'. Just delete instead.
  7197. delete process.env.DEBUG;
  7198. } else {
  7199. process.env.DEBUG = namespaces;
  7200. }
  7201. }
  7202. /**
  7203. * Load `namespaces`.
  7204. *
  7205. * @return {String} returns the previously persisted debug modes
  7206. * @api private
  7207. */
  7208. function load() {
  7209. return process.env.DEBUG;
  7210. }
  7211. /**
  7212. * Init logic for `debug` instances.
  7213. *
  7214. * Create a new `inspectOpts` object in case `useColors` is set
  7215. * differently for a particular `debug` instance.
  7216. */
  7217. function init (debug) {
  7218. debug.inspectOpts = {};
  7219. var keys = Object.keys(exports.inspectOpts);
  7220. for (var i = 0; i < keys.length; i++) {
  7221. debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
  7222. }
  7223. }
  7224. /**
  7225. * Enable namespaces listed in `process.env.DEBUG` initially.
  7226. */
  7227. exports.enable(load());
  7228. /***/ }),
  7229. /* 214 */,
  7230. /* 215 */,
  7231. /* 216 */,
  7232. /* 217 */
  7233. /***/ (function(module, exports, __webpack_require__) {
  7234. // Copyright Joyent, Inc. and other Node contributors.
  7235. //
  7236. // Permission is hereby granted, free of charge, to any person obtaining a
  7237. // copy of this software and associated documentation files (the
  7238. // "Software"), to deal in the Software without restriction, including
  7239. // without limitation the rights to use, copy, modify, merge, publish,
  7240. // distribute, sublicense, and/or sell copies of the Software, and to permit
  7241. // persons to whom the Software is furnished to do so, subject to the
  7242. // following conditions:
  7243. //
  7244. // The above copyright notice and this permission notice shall be included
  7245. // in all copies or substantial portions of the Software.
  7246. //
  7247. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  7248. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  7249. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  7250. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  7251. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  7252. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  7253. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  7254. var pathModule = __webpack_require__(0);
  7255. var isWindows = process.platform === 'win32';
  7256. var fs = __webpack_require__(3);
  7257. // JavaScript implementation of realpath, ported from node pre-v6
  7258. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  7259. function rethrow() {
  7260. // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
  7261. // is fairly slow to generate.
  7262. var callback;
  7263. if (DEBUG) {
  7264. var backtrace = new Error;
  7265. callback = debugCallback;
  7266. } else
  7267. callback = missingCallback;
  7268. return callback;
  7269. function debugCallback(err) {
  7270. if (err) {
  7271. backtrace.message = err.message;
  7272. err = backtrace;
  7273. missingCallback(err);
  7274. }
  7275. }
  7276. function missingCallback(err) {
  7277. if (err) {
  7278. if (process.throwDeprecation)
  7279. throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
  7280. else if (!process.noDeprecation) {
  7281. var msg = 'fs: missing callback ' + (err.stack || err.message);
  7282. if (process.traceDeprecation)
  7283. console.trace(msg);
  7284. else
  7285. console.error(msg);
  7286. }
  7287. }
  7288. }
  7289. }
  7290. function maybeCallback(cb) {
  7291. return typeof cb === 'function' ? cb : rethrow();
  7292. }
  7293. var normalize = pathModule.normalize;
  7294. // Regexp that finds the next partion of a (partial) path
  7295. // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
  7296. if (isWindows) {
  7297. var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  7298. } else {
  7299. var nextPartRe = /(.*?)(?:[\/]+|$)/g;
  7300. }
  7301. // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
  7302. if (isWindows) {
  7303. var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  7304. } else {
  7305. var splitRootRe = /^[\/]*/;
  7306. }
  7307. exports.realpathSync = function realpathSync(p, cache) {
  7308. // make p is absolute
  7309. p = pathModule.resolve(p);
  7310. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  7311. return cache[p];
  7312. }
  7313. var original = p,
  7314. seenLinks = {},
  7315. knownHard = {};
  7316. // current character position in p
  7317. var pos;
  7318. // the partial path so far, including a trailing slash if any
  7319. var current;
  7320. // the partial path without a trailing slash (except when pointing at a root)
  7321. var base;
  7322. // the partial path scanned in the previous round, with slash
  7323. var previous;
  7324. start();
  7325. function start() {
  7326. // Skip over roots
  7327. var m = splitRootRe.exec(p);
  7328. pos = m[0].length;
  7329. current = m[0];
  7330. base = m[0];
  7331. previous = '';
  7332. // On windows, check that the root exists. On unix there is no need.
  7333. if (isWindows && !knownHard[base]) {
  7334. fs.lstatSync(base);
  7335. knownHard[base] = true;
  7336. }
  7337. }
  7338. // walk down the path, swapping out linked pathparts for their real
  7339. // values
  7340. // NB: p.length changes.
  7341. while (pos < p.length) {
  7342. // find the next part
  7343. nextPartRe.lastIndex = pos;
  7344. var result = nextPartRe.exec(p);
  7345. previous = current;
  7346. current += result[0];
  7347. base = previous + result[1];
  7348. pos = nextPartRe.lastIndex;
  7349. // continue if not a symlink
  7350. if (knownHard[base] || (cache && cache[base] === base)) {
  7351. continue;
  7352. }
  7353. var resolvedLink;
  7354. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  7355. // some known symbolic link. no need to stat again.
  7356. resolvedLink = cache[base];
  7357. } else {
  7358. var stat = fs.lstatSync(base);
  7359. if (!stat.isSymbolicLink()) {
  7360. knownHard[base] = true;
  7361. if (cache) cache[base] = base;
  7362. continue;
  7363. }
  7364. // read the link if it wasn't read before
  7365. // dev/ino always return 0 on windows, so skip the check.
  7366. var linkTarget = null;
  7367. if (!isWindows) {
  7368. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  7369. if (seenLinks.hasOwnProperty(id)) {
  7370. linkTarget = seenLinks[id];
  7371. }
  7372. }
  7373. if (linkTarget === null) {
  7374. fs.statSync(base);
  7375. linkTarget = fs.readlinkSync(base);
  7376. }
  7377. resolvedLink = pathModule.resolve(previous, linkTarget);
  7378. // track this, if given a cache.
  7379. if (cache) cache[base] = resolvedLink;
  7380. if (!isWindows) seenLinks[id] = linkTarget;
  7381. }
  7382. // resolve the link, then start over
  7383. p = pathModule.resolve(resolvedLink, p.slice(pos));
  7384. start();
  7385. }
  7386. if (cache) cache[original] = p;
  7387. return p;
  7388. };
  7389. exports.realpath = function realpath(p, cache, cb) {
  7390. if (typeof cb !== 'function') {
  7391. cb = maybeCallback(cache);
  7392. cache = null;
  7393. }
  7394. // make p is absolute
  7395. p = pathModule.resolve(p);
  7396. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  7397. return process.nextTick(cb.bind(null, null, cache[p]));
  7398. }
  7399. var original = p,
  7400. seenLinks = {},
  7401. knownHard = {};
  7402. // current character position in p
  7403. var pos;
  7404. // the partial path so far, including a trailing slash if any
  7405. var current;
  7406. // the partial path without a trailing slash (except when pointing at a root)
  7407. var base;
  7408. // the partial path scanned in the previous round, with slash
  7409. var previous;
  7410. start();
  7411. function start() {
  7412. // Skip over roots
  7413. var m = splitRootRe.exec(p);
  7414. pos = m[0].length;
  7415. current = m[0];
  7416. base = m[0];
  7417. previous = '';
  7418. // On windows, check that the root exists. On unix there is no need.
  7419. if (isWindows && !knownHard[base]) {
  7420. fs.lstat(base, function(err) {
  7421. if (err) return cb(err);
  7422. knownHard[base] = true;
  7423. LOOP();
  7424. });
  7425. } else {
  7426. process.nextTick(LOOP);
  7427. }
  7428. }
  7429. // walk down the path, swapping out linked pathparts for their real
  7430. // values
  7431. function LOOP() {
  7432. // stop if scanned past end of path
  7433. if (pos >= p.length) {
  7434. if (cache) cache[original] = p;
  7435. return cb(null, p);
  7436. }
  7437. // find the next part
  7438. nextPartRe.lastIndex = pos;
  7439. var result = nextPartRe.exec(p);
  7440. previous = current;
  7441. current += result[0];
  7442. base = previous + result[1];
  7443. pos = nextPartRe.lastIndex;
  7444. // continue if not a symlink
  7445. if (knownHard[base] || (cache && cache[base] === base)) {
  7446. return process.nextTick(LOOP);
  7447. }
  7448. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  7449. // known symbolic link. no need to stat again.
  7450. return gotResolvedLink(cache[base]);
  7451. }
  7452. return fs.lstat(base, gotStat);
  7453. }
  7454. function gotStat(err, stat) {
  7455. if (err) return cb(err);
  7456. // if not a symlink, skip to the next path part
  7457. if (!stat.isSymbolicLink()) {
  7458. knownHard[base] = true;
  7459. if (cache) cache[base] = base;
  7460. return process.nextTick(LOOP);
  7461. }
  7462. // stat & read the link if not read before
  7463. // call gotTarget as soon as the link target is known
  7464. // dev/ino always return 0 on windows, so skip the check.
  7465. if (!isWindows) {
  7466. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  7467. if (seenLinks.hasOwnProperty(id)) {
  7468. return gotTarget(null, seenLinks[id], base);
  7469. }
  7470. }
  7471. fs.stat(base, function(err) {
  7472. if (err) return cb(err);
  7473. fs.readlink(base, function(err, target) {
  7474. if (!isWindows) seenLinks[id] = target;
  7475. gotTarget(err, target);
  7476. });
  7477. });
  7478. }
  7479. function gotTarget(err, target, base) {
  7480. if (err) return cb(err);
  7481. var resolvedLink = pathModule.resolve(previous, target);
  7482. if (cache) cache[base] = resolvedLink;
  7483. gotResolvedLink(resolvedLink);
  7484. }
  7485. function gotResolvedLink(resolvedLink) {
  7486. // resolve the link, then start over
  7487. p = pathModule.resolve(resolvedLink, p.slice(pos));
  7488. start();
  7489. }
  7490. };
  7491. /***/ }),
  7492. /* 218 */
  7493. /***/ (function(module, exports, __webpack_require__) {
  7494. module.exports = globSync
  7495. globSync.GlobSync = GlobSync
  7496. var fs = __webpack_require__(3)
  7497. var rp = __webpack_require__(114)
  7498. var minimatch = __webpack_require__(60)
  7499. var Minimatch = minimatch.Minimatch
  7500. var Glob = __webpack_require__(75).Glob
  7501. var util = __webpack_require__(2)
  7502. var path = __webpack_require__(0)
  7503. var assert = __webpack_require__(22)
  7504. var isAbsolute = __webpack_require__(76)
  7505. var common = __webpack_require__(115)
  7506. var alphasort = common.alphasort
  7507. var alphasorti = common.alphasorti
  7508. var setopts = common.setopts
  7509. var ownProp = common.ownProp
  7510. var childrenIgnored = common.childrenIgnored
  7511. var isIgnored = common.isIgnored
  7512. function globSync (pattern, options) {
  7513. if (typeof options === 'function' || arguments.length === 3)
  7514. throw new TypeError('callback provided to sync glob\n'+
  7515. 'See: https://github.com/isaacs/node-glob/issues/167')
  7516. return new GlobSync(pattern, options).found
  7517. }
  7518. function GlobSync (pattern, options) {
  7519. if (!pattern)
  7520. throw new Error('must provide pattern')
  7521. if (typeof options === 'function' || arguments.length === 3)
  7522. throw new TypeError('callback provided to sync glob\n'+
  7523. 'See: https://github.com/isaacs/node-glob/issues/167')
  7524. if (!(this instanceof GlobSync))
  7525. return new GlobSync(pattern, options)
  7526. setopts(this, pattern, options)
  7527. if (this.noprocess)
  7528. return this
  7529. var n = this.minimatch.set.length
  7530. this.matches = new Array(n)
  7531. for (var i = 0; i < n; i ++) {
  7532. this._process(this.minimatch.set[i], i, false)
  7533. }
  7534. this._finish()
  7535. }
  7536. GlobSync.prototype._finish = function () {
  7537. assert(this instanceof GlobSync)
  7538. if (this.realpath) {
  7539. var self = this
  7540. this.matches.forEach(function (matchset, index) {
  7541. var set = self.matches[index] = Object.create(null)
  7542. for (var p in matchset) {
  7543. try {
  7544. p = self._makeAbs(p)
  7545. var real = rp.realpathSync(p, self.realpathCache)
  7546. set[real] = true
  7547. } catch (er) {
  7548. if (er.syscall === 'stat')
  7549. set[self._makeAbs(p)] = true
  7550. else
  7551. throw er
  7552. }
  7553. }
  7554. })
  7555. }
  7556. common.finish(this)
  7557. }
  7558. GlobSync.prototype._process = function (pattern, index, inGlobStar) {
  7559. assert(this instanceof GlobSync)
  7560. // Get the first [n] parts of pattern that are all strings.
  7561. var n = 0
  7562. while (typeof pattern[n] === 'string') {
  7563. n ++
  7564. }
  7565. // now n is the index of the first one that is *not* a string.
  7566. // See if there's anything else
  7567. var prefix
  7568. switch (n) {
  7569. // if not, then this is rather simple
  7570. case pattern.length:
  7571. this._processSimple(pattern.join('/'), index)
  7572. return
  7573. case 0:
  7574. // pattern *starts* with some non-trivial item.
  7575. // going to readdir(cwd), but not include the prefix in matches.
  7576. prefix = null
  7577. break
  7578. default:
  7579. // pattern has some string bits in the front.
  7580. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  7581. // or 'relative' like '../baz'
  7582. prefix = pattern.slice(0, n).join('/')
  7583. break
  7584. }
  7585. var remain = pattern.slice(n)
  7586. // get the list of entries.
  7587. var read
  7588. if (prefix === null)
  7589. read = '.'
  7590. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  7591. if (!prefix || !isAbsolute(prefix))
  7592. prefix = '/' + prefix
  7593. read = prefix
  7594. } else
  7595. read = prefix
  7596. var abs = this._makeAbs(read)
  7597. //if ignored, skip processing
  7598. if (childrenIgnored(this, read))
  7599. return
  7600. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  7601. if (isGlobStar)
  7602. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
  7603. else
  7604. this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
  7605. }
  7606. GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  7607. var entries = this._readdir(abs, inGlobStar)
  7608. // if the abs isn't a dir, then nothing can match!
  7609. if (!entries)
  7610. return
  7611. // It will only match dot entries if it starts with a dot, or if
  7612. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  7613. var pn = remain[0]
  7614. var negate = !!this.minimatch.negate
  7615. var rawGlob = pn._glob
  7616. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  7617. var matchedEntries = []
  7618. for (var i = 0; i < entries.length; i++) {
  7619. var e = entries[i]
  7620. if (e.charAt(0) !== '.' || dotOk) {
  7621. var m
  7622. if (negate && !prefix) {
  7623. m = !e.match(pn)
  7624. } else {
  7625. m = e.match(pn)
  7626. }
  7627. if (m)
  7628. matchedEntries.push(e)
  7629. }
  7630. }
  7631. var len = matchedEntries.length
  7632. // If there are no matched entries, then nothing matches.
  7633. if (len === 0)
  7634. return
  7635. // if this is the last remaining pattern bit, then no need for
  7636. // an additional stat *unless* the user has specified mark or
  7637. // stat explicitly. We know they exist, since readdir returned
  7638. // them.
  7639. if (remain.length === 1 && !this.mark && !this.stat) {
  7640. if (!this.matches[index])
  7641. this.matches[index] = Object.create(null)
  7642. for (var i = 0; i < len; i ++) {
  7643. var e = matchedEntries[i]
  7644. if (prefix) {
  7645. if (prefix.slice(-1) !== '/')
  7646. e = prefix + '/' + e
  7647. else
  7648. e = prefix + e
  7649. }
  7650. if (e.charAt(0) === '/' && !this.nomount) {
  7651. e = path.join(this.root, e)
  7652. }
  7653. this._emitMatch(index, e)
  7654. }
  7655. // This was the last one, and no stats were needed
  7656. return
  7657. }
  7658. // now test all matched entries as stand-ins for that part
  7659. // of the pattern.
  7660. remain.shift()
  7661. for (var i = 0; i < len; i ++) {
  7662. var e = matchedEntries[i]
  7663. var newPattern
  7664. if (prefix)
  7665. newPattern = [prefix, e]
  7666. else
  7667. newPattern = [e]
  7668. this._process(newPattern.concat(remain), index, inGlobStar)
  7669. }
  7670. }
  7671. GlobSync.prototype._emitMatch = function (index, e) {
  7672. if (isIgnored(this, e))
  7673. return
  7674. var abs = this._makeAbs(e)
  7675. if (this.mark)
  7676. e = this._mark(e)
  7677. if (this.absolute) {
  7678. e = abs
  7679. }
  7680. if (this.matches[index][e])
  7681. return
  7682. if (this.nodir) {
  7683. var c = this.cache[abs]
  7684. if (c === 'DIR' || Array.isArray(c))
  7685. return
  7686. }
  7687. this.matches[index][e] = true
  7688. if (this.stat)
  7689. this._stat(e)
  7690. }
  7691. GlobSync.prototype._readdirInGlobStar = function (abs) {
  7692. // follow all symlinked directories forever
  7693. // just proceed as if this is a non-globstar situation
  7694. if (this.follow)
  7695. return this._readdir(abs, false)
  7696. var entries
  7697. var lstat
  7698. var stat
  7699. try {
  7700. lstat = fs.lstatSync(abs)
  7701. } catch (er) {
  7702. if (er.code === 'ENOENT') {
  7703. // lstat failed, doesn't exist
  7704. return null
  7705. }
  7706. }
  7707. var isSym = lstat && lstat.isSymbolicLink()
  7708. this.symlinks[abs] = isSym
  7709. // If it's not a symlink or a dir, then it's definitely a regular file.
  7710. // don't bother doing a readdir in that case.
  7711. if (!isSym && lstat && !lstat.isDirectory())
  7712. this.cache[abs] = 'FILE'
  7713. else
  7714. entries = this._readdir(abs, false)
  7715. return entries
  7716. }
  7717. GlobSync.prototype._readdir = function (abs, inGlobStar) {
  7718. var entries
  7719. if (inGlobStar && !ownProp(this.symlinks, abs))
  7720. return this._readdirInGlobStar(abs)
  7721. if (ownProp(this.cache, abs)) {
  7722. var c = this.cache[abs]
  7723. if (!c || c === 'FILE')
  7724. return null
  7725. if (Array.isArray(c))
  7726. return c
  7727. }
  7728. try {
  7729. return this._readdirEntries(abs, fs.readdirSync(abs))
  7730. } catch (er) {
  7731. this._readdirError(abs, er)
  7732. return null
  7733. }
  7734. }
  7735. GlobSync.prototype._readdirEntries = function (abs, entries) {
  7736. // if we haven't asked to stat everything, then just
  7737. // assume that everything in there exists, so we can avoid
  7738. // having to stat it a second time.
  7739. if (!this.mark && !this.stat) {
  7740. for (var i = 0; i < entries.length; i ++) {
  7741. var e = entries[i]
  7742. if (abs === '/')
  7743. e = abs + e
  7744. else
  7745. e = abs + '/' + e
  7746. this.cache[e] = true
  7747. }
  7748. }
  7749. this.cache[abs] = entries
  7750. // mark and cache dir-ness
  7751. return entries
  7752. }
  7753. GlobSync.prototype._readdirError = function (f, er) {
  7754. // handle errors, and cache the information
  7755. switch (er.code) {
  7756. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  7757. case 'ENOTDIR': // totally normal. means it *does* exist.
  7758. var abs = this._makeAbs(f)
  7759. this.cache[abs] = 'FILE'
  7760. if (abs === this.cwdAbs) {
  7761. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  7762. error.path = this.cwd
  7763. error.code = er.code
  7764. throw error
  7765. }
  7766. break
  7767. case 'ENOENT': // not terribly unusual
  7768. case 'ELOOP':
  7769. case 'ENAMETOOLONG':
  7770. case 'UNKNOWN':
  7771. this.cache[this._makeAbs(f)] = false
  7772. break
  7773. default: // some unusual error. Treat as failure.
  7774. this.cache[this._makeAbs(f)] = false
  7775. if (this.strict)
  7776. throw er
  7777. if (!this.silent)
  7778. console.error('glob error', er)
  7779. break
  7780. }
  7781. }
  7782. GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
  7783. var entries = this._readdir(abs, inGlobStar)
  7784. // no entries means not a dir, so it can never have matches
  7785. // foo.txt/** doesn't match foo.txt
  7786. if (!entries)
  7787. return
  7788. // test without the globstar, and with every child both below
  7789. // and replacing the globstar.
  7790. var remainWithoutGlobStar = remain.slice(1)
  7791. var gspref = prefix ? [ prefix ] : []
  7792. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  7793. // the noGlobStar pattern exits the inGlobStar state
  7794. this._process(noGlobStar, index, false)
  7795. var len = entries.length
  7796. var isSym = this.symlinks[abs]
  7797. // If it's a symlink, and we're in a globstar, then stop
  7798. if (isSym && inGlobStar)
  7799. return
  7800. for (var i = 0; i < len; i++) {
  7801. var e = entries[i]
  7802. if (e.charAt(0) === '.' && !this.dot)
  7803. continue
  7804. // these two cases enter the inGlobStar state
  7805. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  7806. this._process(instead, index, true)
  7807. var below = gspref.concat(entries[i], remain)
  7808. this._process(below, index, true)
  7809. }
  7810. }
  7811. GlobSync.prototype._processSimple = function (prefix, index) {
  7812. // XXX review this. Shouldn't it be doing the mounting etc
  7813. // before doing stat? kinda weird?
  7814. var exists = this._stat(prefix)
  7815. if (!this.matches[index])
  7816. this.matches[index] = Object.create(null)
  7817. // If it doesn't exist, then just mark the lack of results
  7818. if (!exists)
  7819. return
  7820. if (prefix && isAbsolute(prefix) && !this.nomount) {
  7821. var trail = /[\/\\]$/.test(prefix)
  7822. if (prefix.charAt(0) === '/') {
  7823. prefix = path.join(this.root, prefix)
  7824. } else {
  7825. prefix = path.resolve(this.root, prefix)
  7826. if (trail)
  7827. prefix += '/'
  7828. }
  7829. }
  7830. if (process.platform === 'win32')
  7831. prefix = prefix.replace(/\\/g, '/')
  7832. // Mark this as a match
  7833. this._emitMatch(index, prefix)
  7834. }
  7835. // Returns either 'DIR', 'FILE', or false
  7836. GlobSync.prototype._stat = function (f) {
  7837. var abs = this._makeAbs(f)
  7838. var needDir = f.slice(-1) === '/'
  7839. if (f.length > this.maxLength)
  7840. return false
  7841. if (!this.stat && ownProp(this.cache, abs)) {
  7842. var c = this.cache[abs]
  7843. if (Array.isArray(c))
  7844. c = 'DIR'
  7845. // It exists, but maybe not how we need it
  7846. if (!needDir || c === 'DIR')
  7847. return c
  7848. if (needDir && c === 'FILE')
  7849. return false
  7850. // otherwise we have to stat, because maybe c=true
  7851. // if we know it exists, but not what it is.
  7852. }
  7853. var exists
  7854. var stat = this.statCache[abs]
  7855. if (!stat) {
  7856. var lstat
  7857. try {
  7858. lstat = fs.lstatSync(abs)
  7859. } catch (er) {
  7860. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  7861. this.statCache[abs] = false
  7862. return false
  7863. }
  7864. }
  7865. if (lstat && lstat.isSymbolicLink()) {
  7866. try {
  7867. stat = fs.statSync(abs)
  7868. } catch (er) {
  7869. stat = lstat
  7870. }
  7871. } else {
  7872. stat = lstat
  7873. }
  7874. }
  7875. this.statCache[abs] = stat
  7876. var c = true
  7877. if (stat)
  7878. c = stat.isDirectory() ? 'DIR' : 'FILE'
  7879. this.cache[abs] = this.cache[abs] || c
  7880. if (needDir && c === 'FILE')
  7881. return false
  7882. return c
  7883. }
  7884. GlobSync.prototype._mark = function (p) {
  7885. return common.mark(this, p)
  7886. }
  7887. GlobSync.prototype._makeAbs = function (f) {
  7888. return common.makeAbs(this, f)
  7889. }
  7890. /***/ }),
  7891. /* 219 */,
  7892. /* 220 */,
  7893. /* 221 */
  7894. /***/ (function(module, exports, __webpack_require__) {
  7895. "use strict";
  7896. module.exports = function (flag, argv) {
  7897. argv = argv || process.argv;
  7898. var terminatorPos = argv.indexOf('--');
  7899. var prefix = /^--/.test(flag) ? '' : '--';
  7900. var pos = argv.indexOf(prefix + flag);
  7901. return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true);
  7902. };
  7903. /***/ }),
  7904. /* 222 */,
  7905. /* 223 */
  7906. /***/ (function(module, exports, __webpack_require__) {
  7907. var wrappy = __webpack_require__(123)
  7908. var reqs = Object.create(null)
  7909. var once = __webpack_require__(61)
  7910. module.exports = wrappy(inflight)
  7911. function inflight (key, cb) {
  7912. if (reqs[key]) {
  7913. reqs[key].push(cb)
  7914. return null
  7915. } else {
  7916. reqs[key] = [cb]
  7917. return makeres(key)
  7918. }
  7919. }
  7920. function makeres (key) {
  7921. return once(function RES () {
  7922. var cbs = reqs[key]
  7923. var len = cbs.length
  7924. var args = slice(arguments)
  7925. // XXX It's somewhat ambiguous whether a new callback added in this
  7926. // pass should be queued for later execution if something in the
  7927. // list of callbacks throws, or if it should just be discarded.
  7928. // However, it's such an edge case that it hardly matters, and either
  7929. // choice is likely as surprising as the other.
  7930. // As it happens, we do go ahead and schedule it for later execution.
  7931. try {
  7932. for (var i = 0; i < len; i++) {
  7933. cbs[i].apply(null, args)
  7934. }
  7935. } finally {
  7936. if (cbs.length > len) {
  7937. // added more in the interim.
  7938. // de-zalgo, just in case, but don't call again.
  7939. cbs.splice(0, len)
  7940. process.nextTick(function () {
  7941. RES.apply(null, args)
  7942. })
  7943. } else {
  7944. delete reqs[key]
  7945. }
  7946. }
  7947. })
  7948. }
  7949. function slice (args) {
  7950. var length = args.length
  7951. var array = []
  7952. for (var i = 0; i < length; i++) array[i] = args[i]
  7953. return array
  7954. }
  7955. /***/ }),
  7956. /* 224 */
  7957. /***/ (function(module, exports) {
  7958. if (typeof Object.create === 'function') {
  7959. // implementation from standard node.js 'util' module
  7960. module.exports = function inherits(ctor, superCtor) {
  7961. ctor.super_ = superCtor
  7962. ctor.prototype = Object.create(superCtor.prototype, {
  7963. constructor: {
  7964. value: ctor,
  7965. enumerable: false,
  7966. writable: true,
  7967. configurable: true
  7968. }
  7969. });
  7970. };
  7971. } else {
  7972. // old school shim for old browsers
  7973. module.exports = function inherits(ctor, superCtor) {
  7974. ctor.super_ = superCtor
  7975. var TempCtor = function () {}
  7976. TempCtor.prototype = superCtor.prototype
  7977. ctor.prototype = new TempCtor()
  7978. ctor.prototype.constructor = ctor
  7979. }
  7980. }
  7981. /***/ }),
  7982. /* 225 */,
  7983. /* 226 */,
  7984. /* 227 */
  7985. /***/ (function(module, exports, __webpack_require__) {
  7986. // @flow
  7987. /*::
  7988. declare var __webpack_require__: mixed;
  7989. */
  7990. module.exports = typeof __webpack_require__ !== "undefined";
  7991. /***/ }),
  7992. /* 228 */,
  7993. /* 229 */
  7994. /***/ (function(module, exports) {
  7995. /**
  7996. * Helpers.
  7997. */
  7998. var s = 1000;
  7999. var m = s * 60;
  8000. var h = m * 60;
  8001. var d = h * 24;
  8002. var y = d * 365.25;
  8003. /**
  8004. * Parse or format the given `val`.
  8005. *
  8006. * Options:
  8007. *
  8008. * - `long` verbose formatting [false]
  8009. *
  8010. * @param {String|Number} val
  8011. * @param {Object} [options]
  8012. * @throws {Error} throw an error if val is not a non-empty string or a number
  8013. * @return {String|Number}
  8014. * @api public
  8015. */
  8016. module.exports = function(val, options) {
  8017. options = options || {};
  8018. var type = typeof val;
  8019. if (type === 'string' && val.length > 0) {
  8020. return parse(val);
  8021. } else if (type === 'number' && isNaN(val) === false) {
  8022. return options.long ? fmtLong(val) : fmtShort(val);
  8023. }
  8024. throw new Error(
  8025. 'val is not a non-empty string or a valid number. val=' +
  8026. JSON.stringify(val)
  8027. );
  8028. };
  8029. /**
  8030. * Parse the given `str` and return milliseconds.
  8031. *
  8032. * @param {String} str
  8033. * @return {Number}
  8034. * @api private
  8035. */
  8036. function parse(str) {
  8037. str = String(str);
  8038. if (str.length > 100) {
  8039. return;
  8040. }
  8041. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
  8042. str
  8043. );
  8044. if (!match) {
  8045. return;
  8046. }
  8047. var n = parseFloat(match[1]);
  8048. var type = (match[2] || 'ms').toLowerCase();
  8049. switch (type) {
  8050. case 'years':
  8051. case 'year':
  8052. case 'yrs':
  8053. case 'yr':
  8054. case 'y':
  8055. return n * y;
  8056. case 'days':
  8057. case 'day':
  8058. case 'd':
  8059. return n * d;
  8060. case 'hours':
  8061. case 'hour':
  8062. case 'hrs':
  8063. case 'hr':
  8064. case 'h':
  8065. return n * h;
  8066. case 'minutes':
  8067. case 'minute':
  8068. case 'mins':
  8069. case 'min':
  8070. case 'm':
  8071. return n * m;
  8072. case 'seconds':
  8073. case 'second':
  8074. case 'secs':
  8075. case 'sec':
  8076. case 's':
  8077. return n * s;
  8078. case 'milliseconds':
  8079. case 'millisecond':
  8080. case 'msecs':
  8081. case 'msec':
  8082. case 'ms':
  8083. return n;
  8084. default:
  8085. return undefined;
  8086. }
  8087. }
  8088. /**
  8089. * Short format for `ms`.
  8090. *
  8091. * @param {Number} ms
  8092. * @return {String}
  8093. * @api private
  8094. */
  8095. function fmtShort(ms) {
  8096. if (ms >= d) {
  8097. return Math.round(ms / d) + 'd';
  8098. }
  8099. if (ms >= h) {
  8100. return Math.round(ms / h) + 'h';
  8101. }
  8102. if (ms >= m) {
  8103. return Math.round(ms / m) + 'm';
  8104. }
  8105. if (ms >= s) {
  8106. return Math.round(ms / s) + 's';
  8107. }
  8108. return ms + 'ms';
  8109. }
  8110. /**
  8111. * Long format for `ms`.
  8112. *
  8113. * @param {Number} ms
  8114. * @return {String}
  8115. * @api private
  8116. */
  8117. function fmtLong(ms) {
  8118. return plural(ms, d, 'day') ||
  8119. plural(ms, h, 'hour') ||
  8120. plural(ms, m, 'minute') ||
  8121. plural(ms, s, 'second') ||
  8122. ms + ' ms';
  8123. }
  8124. /**
  8125. * Pluralization helper.
  8126. */
  8127. function plural(ms, n, name) {
  8128. if (ms < n) {
  8129. return;
  8130. }
  8131. if (ms < n * 1.5) {
  8132. return Math.floor(ms / n) + ' ' + name;
  8133. }
  8134. return Math.ceil(ms / n) + ' ' + name + 's';
  8135. }
  8136. /***/ }),
  8137. /* 230 */,
  8138. /* 231 */,
  8139. /* 232 */,
  8140. /* 233 */
  8141. /***/ (function(module, exports, __webpack_require__) {
  8142. module.exports = rimraf
  8143. rimraf.sync = rimrafSync
  8144. var assert = __webpack_require__(22)
  8145. var path = __webpack_require__(0)
  8146. var fs = __webpack_require__(3)
  8147. var glob = __webpack_require__(75)
  8148. var _0666 = parseInt('666', 8)
  8149. var defaultGlobOpts = {
  8150. nosort: true,
  8151. silent: true
  8152. }
  8153. // for EMFILE handling
  8154. var timeout = 0
  8155. var isWindows = (process.platform === "win32")
  8156. function defaults (options) {
  8157. var methods = [
  8158. 'unlink',
  8159. 'chmod',
  8160. 'stat',
  8161. 'lstat',
  8162. 'rmdir',
  8163. 'readdir'
  8164. ]
  8165. methods.forEach(function(m) {
  8166. options[m] = options[m] || fs[m]
  8167. m = m + 'Sync'
  8168. options[m] = options[m] || fs[m]
  8169. })
  8170. options.maxBusyTries = options.maxBusyTries || 3
  8171. options.emfileWait = options.emfileWait || 1000
  8172. if (options.glob === false) {
  8173. options.disableGlob = true
  8174. }
  8175. options.disableGlob = options.disableGlob || false
  8176. options.glob = options.glob || defaultGlobOpts
  8177. }
  8178. function rimraf (p, options, cb) {
  8179. if (typeof options === 'function') {
  8180. cb = options
  8181. options = {}
  8182. }
  8183. assert(p, 'rimraf: missing path')
  8184. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  8185. assert.equal(typeof cb, 'function', 'rimraf: callback function required')
  8186. assert(options, 'rimraf: invalid options argument provided')
  8187. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  8188. defaults(options)
  8189. var busyTries = 0
  8190. var errState = null
  8191. var n = 0
  8192. if (options.disableGlob || !glob.hasMagic(p))
  8193. return afterGlob(null, [p])
  8194. options.lstat(p, function (er, stat) {
  8195. if (!er)
  8196. return afterGlob(null, [p])
  8197. glob(p, options.glob, afterGlob)
  8198. })
  8199. function next (er) {
  8200. errState = errState || er
  8201. if (--n === 0)
  8202. cb(errState)
  8203. }
  8204. function afterGlob (er, results) {
  8205. if (er)
  8206. return cb(er)
  8207. n = results.length
  8208. if (n === 0)
  8209. return cb()
  8210. results.forEach(function (p) {
  8211. rimraf_(p, options, function CB (er) {
  8212. if (er) {
  8213. if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
  8214. busyTries < options.maxBusyTries) {
  8215. busyTries ++
  8216. var time = busyTries * 100
  8217. // try again, with the same exact callback as this one.
  8218. return setTimeout(function () {
  8219. rimraf_(p, options, CB)
  8220. }, time)
  8221. }
  8222. // this one won't happen if graceful-fs is used.
  8223. if (er.code === "EMFILE" && timeout < options.emfileWait) {
  8224. return setTimeout(function () {
  8225. rimraf_(p, options, CB)
  8226. }, timeout ++)
  8227. }
  8228. // already gone
  8229. if (er.code === "ENOENT") er = null
  8230. }
  8231. timeout = 0
  8232. next(er)
  8233. })
  8234. })
  8235. }
  8236. }
  8237. // Two possible strategies.
  8238. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
  8239. // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
  8240. //
  8241. // Both result in an extra syscall when you guess wrong. However, there
  8242. // are likely far more normal files in the world than directories. This
  8243. // is based on the assumption that a the average number of files per
  8244. // directory is >= 1.
  8245. //
  8246. // If anyone ever complains about this, then I guess the strategy could
  8247. // be made configurable somehow. But until then, YAGNI.
  8248. function rimraf_ (p, options, cb) {
  8249. assert(p)
  8250. assert(options)
  8251. assert(typeof cb === 'function')
  8252. // sunos lets the root user unlink directories, which is... weird.
  8253. // so we have to lstat here and make sure it's not a dir.
  8254. options.lstat(p, function (er, st) {
  8255. if (er && er.code === "ENOENT")
  8256. return cb(null)
  8257. // Windows can EPERM on stat. Life is suffering.
  8258. if (er && er.code === "EPERM" && isWindows)
  8259. fixWinEPERM(p, options, er, cb)
  8260. if (st && st.isDirectory())
  8261. return rmdir(p, options, er, cb)
  8262. options.unlink(p, function (er) {
  8263. if (er) {
  8264. if (er.code === "ENOENT")
  8265. return cb(null)
  8266. if (er.code === "EPERM")
  8267. return (isWindows)
  8268. ? fixWinEPERM(p, options, er, cb)
  8269. : rmdir(p, options, er, cb)
  8270. if (er.code === "EISDIR")
  8271. return rmdir(p, options, er, cb)
  8272. }
  8273. return cb(er)
  8274. })
  8275. })
  8276. }
  8277. function fixWinEPERM (p, options, er, cb) {
  8278. assert(p)
  8279. assert(options)
  8280. assert(typeof cb === 'function')
  8281. if (er)
  8282. assert(er instanceof Error)
  8283. options.chmod(p, _0666, function (er2) {
  8284. if (er2)
  8285. cb(er2.code === "ENOENT" ? null : er)
  8286. else
  8287. options.stat(p, function(er3, stats) {
  8288. if (er3)
  8289. cb(er3.code === "ENOENT" ? null : er)
  8290. else if (stats.isDirectory())
  8291. rmdir(p, options, er, cb)
  8292. else
  8293. options.unlink(p, cb)
  8294. })
  8295. })
  8296. }
  8297. function fixWinEPERMSync (p, options, er) {
  8298. assert(p)
  8299. assert(options)
  8300. if (er)
  8301. assert(er instanceof Error)
  8302. try {
  8303. options.chmodSync(p, _0666)
  8304. } catch (er2) {
  8305. if (er2.code === "ENOENT")
  8306. return
  8307. else
  8308. throw er
  8309. }
  8310. try {
  8311. var stats = options.statSync(p)
  8312. } catch (er3) {
  8313. if (er3.code === "ENOENT")
  8314. return
  8315. else
  8316. throw er
  8317. }
  8318. if (stats.isDirectory())
  8319. rmdirSync(p, options, er)
  8320. else
  8321. options.unlinkSync(p)
  8322. }
  8323. function rmdir (p, options, originalEr, cb) {
  8324. assert(p)
  8325. assert(options)
  8326. if (originalEr)
  8327. assert(originalEr instanceof Error)
  8328. assert(typeof cb === 'function')
  8329. // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
  8330. // if we guessed wrong, and it's not a directory, then
  8331. // raise the original error.
  8332. options.rmdir(p, function (er) {
  8333. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  8334. rmkids(p, options, cb)
  8335. else if (er && er.code === "ENOTDIR")
  8336. cb(originalEr)
  8337. else
  8338. cb(er)
  8339. })
  8340. }
  8341. function rmkids(p, options, cb) {
  8342. assert(p)
  8343. assert(options)
  8344. assert(typeof cb === 'function')
  8345. options.readdir(p, function (er, files) {
  8346. if (er)
  8347. return cb(er)
  8348. var n = files.length
  8349. if (n === 0)
  8350. return options.rmdir(p, cb)
  8351. var errState
  8352. files.forEach(function (f) {
  8353. rimraf(path.join(p, f), options, function (er) {
  8354. if (errState)
  8355. return
  8356. if (er)
  8357. return cb(errState = er)
  8358. if (--n === 0)
  8359. options.rmdir(p, cb)
  8360. })
  8361. })
  8362. })
  8363. }
  8364. // this looks simpler, and is strictly *faster*, but will
  8365. // tie up the JavaScript thread and fail on excessively
  8366. // deep directory trees.
  8367. function rimrafSync (p, options) {
  8368. options = options || {}
  8369. defaults(options)
  8370. assert(p, 'rimraf: missing path')
  8371. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  8372. assert(options, 'rimraf: missing options')
  8373. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  8374. var results
  8375. if (options.disableGlob || !glob.hasMagic(p)) {
  8376. results = [p]
  8377. } else {
  8378. try {
  8379. options.lstatSync(p)
  8380. results = [p]
  8381. } catch (er) {
  8382. results = glob.sync(p, options.glob)
  8383. }
  8384. }
  8385. if (!results.length)
  8386. return
  8387. for (var i = 0; i < results.length; i++) {
  8388. var p = results[i]
  8389. try {
  8390. var st = options.lstatSync(p)
  8391. } catch (er) {
  8392. if (er.code === "ENOENT")
  8393. return
  8394. // Windows can EPERM on stat. Life is suffering.
  8395. if (er.code === "EPERM" && isWindows)
  8396. fixWinEPERMSync(p, options, er)
  8397. }
  8398. try {
  8399. // sunos lets the root user unlink directories, which is... weird.
  8400. if (st && st.isDirectory())
  8401. rmdirSync(p, options, null)
  8402. else
  8403. options.unlinkSync(p)
  8404. } catch (er) {
  8405. if (er.code === "ENOENT")
  8406. return
  8407. if (er.code === "EPERM")
  8408. return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
  8409. if (er.code !== "EISDIR")
  8410. throw er
  8411. rmdirSync(p, options, er)
  8412. }
  8413. }
  8414. }
  8415. function rmdirSync (p, options, originalEr) {
  8416. assert(p)
  8417. assert(options)
  8418. if (originalEr)
  8419. assert(originalEr instanceof Error)
  8420. try {
  8421. options.rmdirSync(p)
  8422. } catch (er) {
  8423. if (er.code === "ENOENT")
  8424. return
  8425. if (er.code === "ENOTDIR")
  8426. throw originalEr
  8427. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  8428. rmkidsSync(p, options)
  8429. }
  8430. }
  8431. function rmkidsSync (p, options) {
  8432. assert(p)
  8433. assert(options)
  8434. options.readdirSync(p).forEach(function (f) {
  8435. rimrafSync(path.join(p, f), options)
  8436. })
  8437. // We only end up here once we got ENOTEMPTY at least once, and
  8438. // at this point, we are guaranteed to have removed all the kids.
  8439. // So, we know that it won't be ENOENT or ENOTDIR or anything else.
  8440. // try really hard to delete stuff on windows, because it has a
  8441. // PROFOUNDLY annoying habit of not closing handles promptly when
  8442. // files are deleted, resulting in spurious ENOTEMPTY errors.
  8443. var retries = isWindows ? 100 : 1
  8444. var i = 0
  8445. do {
  8446. var threw = true
  8447. try {
  8448. var ret = options.rmdirSync(p, options)
  8449. threw = false
  8450. return ret
  8451. } finally {
  8452. if (++i < retries && threw)
  8453. continue
  8454. }
  8455. } while (true)
  8456. }
  8457. /***/ }),
  8458. /* 234 */,
  8459. /* 235 */,
  8460. /* 236 */,
  8461. /* 237 */,
  8462. /* 238 */,
  8463. /* 239 */
  8464. /***/ (function(module, exports, __webpack_require__) {
  8465. "use strict";
  8466. var hasFlag = __webpack_require__(221);
  8467. var support = function (level) {
  8468. if (level === 0) {
  8469. return false;
  8470. }
  8471. return {
  8472. level: level,
  8473. hasBasic: true,
  8474. has256: level >= 2,
  8475. has16m: level >= 3
  8476. };
  8477. };
  8478. var supportLevel = (function () {
  8479. if (hasFlag('no-color') ||
  8480. hasFlag('no-colors') ||
  8481. hasFlag('color=false')) {
  8482. return 0;
  8483. }
  8484. if (hasFlag('color=16m') ||
  8485. hasFlag('color=full') ||
  8486. hasFlag('color=truecolor')) {
  8487. return 3;
  8488. }
  8489. if (hasFlag('color=256')) {
  8490. return 2;
  8491. }
  8492. if (hasFlag('color') ||
  8493. hasFlag('colors') ||
  8494. hasFlag('color=true') ||
  8495. hasFlag('color=always')) {
  8496. return 1;
  8497. }
  8498. if (process.stdout && !process.stdout.isTTY) {
  8499. return 0;
  8500. }
  8501. if (process.platform === 'win32') {
  8502. return 1;
  8503. }
  8504. if ('CI' in process.env) {
  8505. if ('TRAVIS' in process.env || process.env.CI === 'Travis') {
  8506. return 1;
  8507. }
  8508. return 0;
  8509. }
  8510. if ('TEAMCITY_VERSION' in process.env) {
  8511. return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1;
  8512. }
  8513. if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) {
  8514. return 2;
  8515. }
  8516. if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
  8517. return 1;
  8518. }
  8519. if ('COLORTERM' in process.env) {
  8520. return 1;
  8521. }
  8522. if (process.env.TERM === 'dumb') {
  8523. return 0;
  8524. }
  8525. return 0;
  8526. })();
  8527. if (supportLevel === 0 && 'FORCE_COLOR' in process.env) {
  8528. supportLevel = 1;
  8529. }
  8530. module.exports = process && support(supportLevel);
  8531. /***/ })
  8532. /******/ ]);